lix 16.0.1 → 16.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/lix.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- (()=>{var e={6732:function(e,t,r){(function(e){"use strict";var t={},$estr=function(){return js_Boot.__string_rec(this,"")},n=n||{},i;function $extend(e,t){var r=Object.create(e);for(var n in t)r[n]=t[n];if(t.toString!==Object.prototype.toString)r.toString=t.toString;return r}var s=n["Attribute"]={__ename__:"Attribute",__constructs__:null,Off:{_hx_name:"Off",_hx_index:0,__enum__:"Attribute",toString:$estr},Bold:{_hx_name:"Bold",_hx_index:1,__enum__:"Attribute",toString:$estr},Underline:{_hx_name:"Underline",_hx_index:2,__enum__:"Attribute",toString:$estr},Blink:{_hx_name:"Blink",_hx_index:3,__enum__:"Attribute",toString:$estr},ReverseVideo:{_hx_name:"ReverseVideo",_hx_index:4,__enum__:"Attribute",toString:$estr},Concealed:{_hx_name:"Concealed",_hx_index:5,__enum__:"Attribute",toString:$estr},BoldOff:{_hx_name:"BoldOff",_hx_index:6,__enum__:"Attribute",toString:$estr},UnderlineOff:{_hx_name:"UnderlineOff",_hx_index:7,__enum__:"Attribute",toString:$estr},BlinkOff:{_hx_name:"BlinkOff",_hx_index:8,__enum__:"Attribute",toString:$estr},NormalVideo:{_hx_name:"NormalVideo",_hx_index:9,__enum__:"Attribute",toString:$estr},ConcealedOff:{_hx_name:"ConcealedOff",_hx_index:10,__enum__:"Attribute",toString:$estr},Black:{_hx_name:"Black",_hx_index:11,__enum__:"Attribute",toString:$estr},Red:{_hx_name:"Red",_hx_index:12,__enum__:"Attribute",toString:$estr},Green:{_hx_name:"Green",_hx_index:13,__enum__:"Attribute",toString:$estr},Yellow:{_hx_name:"Yellow",_hx_index:14,__enum__:"Attribute",toString:$estr},Blue:{_hx_name:"Blue",_hx_index:15,__enum__:"Attribute",toString:$estr},Magenta:{_hx_name:"Magenta",_hx_index:16,__enum__:"Attribute",toString:$estr},Cyan:{_hx_name:"Cyan",_hx_index:17,__enum__:"Attribute",toString:$estr},White:{_hx_name:"White",_hx_index:18,__enum__:"Attribute",toString:$estr},DefaultForeground:{_hx_name:"DefaultForeground",_hx_index:19,__enum__:"Attribute",toString:$estr},BlackBack:{_hx_name:"BlackBack",_hx_index:20,__enum__:"Attribute",toString:$estr},RedBack:{_hx_name:"RedBack",_hx_index:21,__enum__:"Attribute",toString:$estr},GreenBack:{_hx_name:"GreenBack",_hx_index:22,__enum__:"Attribute",toString:$estr},YellowBack:{_hx_name:"YellowBack",_hx_index:23,__enum__:"Attribute",toString:$estr},BlueBack:{_hx_name:"BlueBack",_hx_index:24,__enum__:"Attribute",toString:$estr},MagentaBack:{_hx_name:"MagentaBack",_hx_index:25,__enum__:"Attribute",toString:$estr},CyanBack:{_hx_name:"CyanBack",_hx_index:26,__enum__:"Attribute",toString:$estr},WhiteBack:{_hx_name:"WhiteBack",_hx_index:27,__enum__:"Attribute",toString:$estr},DefaultBackground:{_hx_name:"DefaultBackground",_hx_index:28,__enum__:"Attribute",toString:$estr}};s.__constructs__=[s.Off,s.Bold,s.Underline,s.Blink,s.ReverseVideo,s.Concealed,s.BoldOff,s.UnderlineOff,s.BlinkOff,s.NormalVideo,s.ConcealedOff,s.Black,s.Red,s.Green,s.Yellow,s.Blue,s.Magenta,s.Cyan,s.White,s.DefaultForeground,s.BlackBack,s.RedBack,s.GreenBack,s.YellowBack,s.BlueBack,s.MagentaBack,s.CyanBack,s.WhiteBack,s.DefaultBackground];var Sys=function(){};t["Sys"]=Sys;Sys.__name__="Sys";Sys.systemName=function(){var e=process.platform;switch(e){case"darwin":return"Mac";case"freebsd":return"BSD";case"linux":return"Linux";case"win32":return"Windows";default:var t=e;return t}};var a=r(2081);var Reflect=function(){};t["Reflect"]=Reflect;Reflect.__name__="Reflect";Reflect.field=function(e,t){try{return e[t]}catch(e){return null}};Reflect.fields=function(e){var t=[];if(e!=null){var r=Object.prototype.hasOwnProperty;for(var n in e){if(n!="__id__"&&n!="hx__closures__"&&r.call(e,n)){t.push(n)}}}return t};Reflect.isFunction=function(e){if(typeof e=="function"){return!(e.__name__||e.__ename__)}else{return false}};Reflect.compare=function(e,t){if(e==t){return 0}else if(e>t){return 1}else{return-1}};Reflect.isEnumValue=function(e){if(e!=null){return e.__enum__!=null}else{return false}};Reflect.deleteField=function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t)){return false}delete e[t];return true};Reflect.copy=function(e){if(e==null){return null}var t={};var r=0;var n=Reflect.fields(e);while(r<n.length){var i=n[r];++r;t[i]=Reflect.field(e,i)}return t};var js_Boot=function(){};t["js.Boot"]=js_Boot;js_Boot.__name__="js.Boot";js_Boot.getClass=function(e){if(e==null){return null}else if(e instanceof Array){return Array}else{var t=e.__class__;if(t!=null){return t}var r=js_Boot.__nativeClassName(e);if(r!=null){return js_Boot.__resolveNativeClass(r)}return null}};js_Boot.__string_rec=function(e,t){if(e==null){return"null"}if(t.length>=5){return"<...>"}var r=typeof e;if(r=="function"&&(e.__name__||e.__ename__)){r="object"}switch(r){case"function":return"<function>";case"object":if(e.__enum__){var i=n[e.__enum__];var s=i.__constructs__[e._hx_index];var a=s._hx_name;if(s.__params__){t=t+"\t";return a+"("+function(r){var n;var i=[];{var a=0;var l=s.__params__;while(true){if(!(a<l.length)){break}var o=l[a];a=a+1;i.push(js_Boot.__string_rec(e[o],t))}}n=i;return n}(this).join(",")+")"}else{return a}}if(e instanceof Array){var l="[";t+="\t";var o=0;var u=e.length;while(o<u){var c=o++;l+=(c>0?",":"")+js_Boot.__string_rec(e[c],t)}l+="]";return l}var h;try{h=e.toString}catch(o){return"???"}if(h!=null&&h!=Object.toString&&typeof h=="function"){var d=e.toString();if(d!="[object Object]"){return d}}var l="{\n";t+="\t";var v=e.hasOwnProperty!=null;var m=null;for(m in e){if(v&&!e.hasOwnProperty(m)){continue}if(m=="prototype"||m=="__class__"||m=="__super__"||m=="__interfaces__"||m=="__properties__"){continue}if(l.length!=2){l+=", \n"}l+=t+m+" : "+js_Boot.__string_rec(e[m],t)}t=t.substring(1);l+="\n"+t+"}";return l;case"string":return e;default:return String(e)}};js_Boot.__interfLoop=function(e,t){if(e==null){return false}if(e==t){return true}var r=e.__interfaces__;if(r!=null){var n=0;var i=r.length;while(n<i){var s=n++;var a=r[s];if(a==t||js_Boot.__interfLoop(a,t)){return true}}}return js_Boot.__interfLoop(e.__super__,t)};js_Boot.__instanceof=function(e,t){if(t==null){return false}switch(t){case Array:return e instanceof Array;case he:return typeof e=="boolean";case ue:return e!=null;case ce:return typeof e=="number";case oe:if(typeof e=="number"){return(e|0)===e}else{return false}break;case String:return typeof e=="string";default:if(e!=null){if(typeof t=="function"){if(js_Boot.__downcastCheck(e,t)){return true}}else if(typeof t=="object"&&js_Boot.__isNativeObj(t)){if(e instanceof t){return true}}}else{return false}if(t==fe?e.__name__!=null:false){return true}if(t==de?e.__ename__!=null:false){return true}return e.__enum__!=null?n[e.__enum__]==t:false}};js_Boot.__downcastCheck=function(e,t){if(!(e instanceof t)){if(t.__isInterface__){return js_Boot.__interfLoop(js_Boot.getClass(e),t)}else{return false}}else{return true}};js_Boot.__nativeClassName=function(e){var t=js_Boot.__toStr.call(e).slice(8,-1);if(t=="Object"||t=="Function"||t=="Math"||t=="JSON"){return null}return t};js_Boot.__isNativeObj=function(e){return js_Boot.__nativeClassName(e)!=null};js_Boot.__resolveNativeClass=function(t){return e[t]};var Std=function(){};t["Std"]=Std;Std.__name__="Std";Std.string=function(e){return js_Boot.__string_rec(e,"")};Std.parseInt=function(e){var t=parseInt(e);if(isNaN(t)){return null}return t};var ANSI=function(){};t["ANSI"]=ANSI;ANSI.__name__="ANSI";ANSI.aset=function(e){if(ANSI.strip||ANSI.stripIfUnavailable&&!ANSI.available){return""}var t=""+"[";var r=[];var n=0;while(n<e.length){var i=e[n];++n;if(!js_Boot.__instanceof(i,s)){throw haxe_Exception.thrown("Set argument is not an Attribute: "+Std.string(i))}r.push(ANSI.values.get(i))}return t+r.join(";")+"m"};ANSI.detectSupport=function(){if(Sys.systemName().toLowerCase().indexOf("window")==-1){var e=-1;try{e=a.spawnSync("tput",["colors"]).error==null?0:125}catch(e){}return e==0}else{return process.env["ANSICON"]!=null}};var DateTools=function(){};t["DateTools"]=DateTools;DateTools.__name__="DateTools";DateTools.__format_get=function(e,t){switch(t){case"%":return"%";case"A":return DateTools.DAY_NAMES[e.getDay()];case"B":return DateTools.MONTH_NAMES[e.getMonth()];case"C":return StringTools.lpad(Std.string(e.getFullYear()/100|0),"0",2);case"D":return DateTools.__format(e,"%m/%d/%y");case"F":return DateTools.__format(e,"%Y-%m-%d");case"M":return StringTools.lpad(Std.string(e.getMinutes()),"0",2);case"R":return DateTools.__format(e,"%H:%M");case"S":return StringTools.lpad(Std.string(e.getSeconds()),"0",2);case"T":return DateTools.__format(e,"%H:%M:%S");case"Y":return Std.string(e.getFullYear());case"a":return DateTools.DAY_SHORT_NAMES[e.getDay()];case"d":return StringTools.lpad(Std.string(e.getDate()),"0",2);case"e":return Std.string(e.getDate());case"b":case"h":return DateTools.MONTH_SHORT_NAMES[e.getMonth()];case"H":case"k":return StringTools.lpad(Std.string(e.getHours()),t=="H"?"0":" ",2);case"I":case"l":var r=e.getHours()%12;return StringTools.lpad(Std.string(r==0?12:r),t=="I"?"0":" ",2);case"m":return StringTools.lpad(Std.string(e.getMonth()+1),"0",2);case"n":return"\n";case"p":if(e.getHours()>11){return"PM"}else{return"AM"}break;case"r":return DateTools.__format(e,"%I:%M:%S %p");case"s":return Std.string(e.getTime()/1e3|0);case"t":return"\t";case"u":var n=e.getDay();if(n==0){return"7"}else if(n==null){return"null"}else{return""+n}break;case"w":return Std.string(e.getDay());case"y":return StringTools.lpad(Std.string(e.getFullYear()%100),"0",2);default:throw new haxe_exceptions_NotImplementedException("Date.format %"+t+"- not implemented yet.",null,{fileName:"DateTools.hx",lineNumber:101,className:"DateTools",methodName:"__format_get"})}};DateTools.__format=function(e,t){var r="";var n=0;while(true){var i=t.indexOf("%",n);if(i<0){break}var s=i-n;r+=s==null?HxOverrides.substr(t,n,null):HxOverrides.substr(t,n,s);r+=Std.string(DateTools.__format_get(e,HxOverrides.substr(t,i+1,1)));n=i+2}var s=t.length-n;r+=s==null?HxOverrides.substr(t,n,null):HxOverrides.substr(t,n,s);return r};DateTools.format=function(e,t){return DateTools.__format(e,t)};var EReg=function(e,t){this.r=new RegExp(e,t.split("u").join(""))};t["EReg"]=EReg;EReg.__name__="EReg";EReg.prototype={match:function(e){if(this.r.global){this.r.lastIndex=0}this.r.m=this.r.exec(e);this.r.s=e;return this.r.m!=null},matched:function(e){if(this.r.m!=null&&e>=0&&e<this.r.m.length){return this.r.m[e]}else{throw haxe_Exception.thrown("EReg::matched")}},matchedLeft:function(){if(this.r.m==null){throw haxe_Exception.thrown("No string matched")}return HxOverrides.substr(this.r.s,0,this.r.m.index)},matchedRight:function(){if(this.r.m==null){throw haxe_Exception.thrown("No string matched")}var e=this.r.m.index+this.r.m[0].length;return HxOverrides.substr(this.r.s,e,this.r.s.length-e)},matchedPos:function(){if(this.r.m==null){throw haxe_Exception.thrown("No string matched")}return{pos:this.r.m.index,len:this.r.m[0].length}},matchSub:function(e,t,r){if(r==null){r=-1}if(this.r.global){this.r.lastIndex=t;this.r.m=this.r.exec(r<0?e:HxOverrides.substr(e,0,t+r));var n=this.r.m!=null;if(n){this.r.s=e}return n}else{var n=this.match(r<0?HxOverrides.substr(e,t,null):HxOverrides.substr(e,t,r));if(n){this.r.s=e;this.r.m.index+=t}return n}},map:function(e,t){var r=0;var n="";do{if(r>=e.length){break}else if(!this.matchSub(e,r)){n+=Std.string(HxOverrides.substr(e,r,null));break}var i=this.matchedPos();n+=Std.string(HxOverrides.substr(e,r,i.pos-r));n+=Std.string(t(this));if(i.len==0){n+=Std.string(HxOverrides.substr(e,i.pos,1));r=i.pos+1}else{r=i.pos+i.len}}while(this.r.global);if(!this.r.global&&r>0&&r<e.length){n+=Std.string(HxOverrides.substr(e,r,null))}return n},__class__:EReg};var HxOverrides=function(){};t["HxOverrides"]=HxOverrides;HxOverrides.__name__="HxOverrides";HxOverrides.dateStr=function(e){var t=e.getMonth()+1;var r=e.getDate();var n=e.getHours();var i=e.getMinutes();var s=e.getSeconds();return e.getFullYear()+"-"+(t<10?"0"+t:""+t)+"-"+(r<10?"0"+r:""+r)+" "+(n<10?"0"+n:""+n)+":"+(i<10?"0"+i:""+i)+":"+(s<10?"0"+s:""+s)};HxOverrides.strDate=function(e){switch(e.length){case 8:var t=e.split(":");var r=new Date;r["setTime"](0);r["setUTCHours"](t[0]);r["setUTCMinutes"](t[1]);r["setUTCSeconds"](t[2]);return r;case 10:var t=e.split("-");return new Date(t[0],t[1]-1,t[2],0,0,0);case 19:var t=e.split(" ");var n=t[0].split("-");var i=t[1].split(":");return new Date(n[0],n[1]-1,n[2],i[0],i[1],i[2]);default:throw haxe_Exception.thrown("Invalid date format : "+e)}};HxOverrides.cca=function(e,t){var r=e.charCodeAt(t);if(r!=r){return undefined}return r};HxOverrides.substr=function(e,t,r){if(r==null){r=e.length}else if(r<0){if(t==0){r=e.length+r}else{return""}}return e.substr(t,r)};HxOverrides.remove=function(e,t){var r=e.indexOf(t);if(r==-1){return false}e.splice(r,1);return true};HxOverrides.now=function(){return Date.now()};var IntIterator=function(e,t){this.min=e;this.max=t};t["IntIterator"]=IntIterator;IntIterator.__name__="IntIterator";IntIterator.prototype={__class__:IntIterator};var Lambda=function(){};t["Lambda"]=Lambda;Lambda.__name__="Lambda";Lambda.has=function(e,t){var r=$getIterator(e);while(r.hasNext()){var n=r.next();if(n==t){return true}}return false};Math.__name__="Math";var StringBuf=function(){this.b=""};t["StringBuf"]=StringBuf;StringBuf.__name__="StringBuf";StringBuf.prototype={__class__:StringBuf};var haxe_SysTools=function(){};t["haxe.SysTools"]=haxe_SysTools;haxe_SysTools.__name__="haxe.SysTools";haxe_SysTools.quoteUnixArg=function(e){if(e==""){return"''"}if(!new EReg("[^a-zA-Z0-9_@%+=:,./-]","").match(e)){return e}return"'"+StringTools.replace(e,"'","'\"'\"'")+"'"};haxe_SysTools.quoteWinArg=function(e,t){if(!new EReg('^(/)?[^ \t/\\\\"]+$',"").match(e)){var r="";var n=e.indexOf(" ")!=-1||e.indexOf("\t")!=-1||e==""||e.indexOf("/")>0;if(n){r+='"'}var i=new StringBuf;var s=0;var a=e.length;while(s<a){var l=s++;var o=HxOverrides.cca(e,l);if(o==null){var u=o;if(i.b.length>0){r+=Std.string(i.b);i=new StringBuf}r+=String.fromCodePoint(u)}else{switch(o){case 34:var c=i.b;r+=c==null?"null":""+c;r+=c==null?"null":""+c;i=new StringBuf;r+='\\"';break;case 92:i.b+="\\";break;default:var h=o;if(i.b.length>0){r+=Std.string(i.b);i=new StringBuf}r+=String.fromCodePoint(h)}}}r+=Std.string(i.b);if(n){r+=Std.string(i.b);r+='"'}e=r}if(t){var r="";var s=0;var a=e.length;while(s<a){var l=s++;var u=HxOverrides.cca(e,l);if(haxe_SysTools.winMetaCharacters.indexOf(u)>=0){r+=String.fromCodePoint(94)}r+=String.fromCodePoint(u)}return r}else{return e}};var StringTools=function(){};t["StringTools"]=StringTools;StringTools.__name__="StringTools";StringTools.startsWith=function(e,t){if(e.length>=t.length){return e.lastIndexOf(t,0)==0}else{return false}};StringTools.endsWith=function(e,t){var r=t.length;var n=e.length;if(n>=r){return e.indexOf(t,n-r)==n-r}else{return false}};StringTools.isSpace=function(e,t){var r=HxOverrides.cca(e,t);if(!(r>8&&r<14)){return r==32}else{return true}};StringTools.ltrim=function(e){var t=e.length;var r=0;while(r<t&&StringTools.isSpace(e,r))++r;if(r>0){return HxOverrides.substr(e,r,t-r)}else{return e}};StringTools.rtrim=function(e){var t=e.length;var r=0;while(r<t&&StringTools.isSpace(e,t-r-1))++r;if(r>0){return HxOverrides.substr(e,0,t-r)}else{return e}};StringTools.trim=function(e){return StringTools.ltrim(StringTools.rtrim(e))};StringTools.lpad=function(e,t,r){if(t.length<=0){return e}var n="";r-=e.length;while(n.length<r)n+=t==null?"null":""+t;n+=e==null?"null":""+e;return n};StringTools.replace=function(e,t,r){return e.split(t).join(r)};var haxe_io_Output=function(){};t["haxe.io.Output"]=haxe_io_Output;haxe_io_Output.__name__="haxe.io.Output";haxe_io_Output.prototype={writeByte:function(e){throw new haxe_exceptions_NotImplementedException(null,null,{fileName:"haxe/io/Output.hx",lineNumber:47,className:"haxe.io.Output",methodName:"writeByte"})},writeBytes:function(e,t,r){if(t<0||r<0||t+r>e.length){throw haxe_Exception.thrown(h.OutsideBounds)}var n=e.b;var i=r;while(i>0){this.writeByte(n[t]);++t;--i}return r},writeFullBytes:function(e,t,r){while(r>0){var n=this.writeBytes(e,t,r);t+=n;r-=n}},writeString:function(e,t){var r=haxe_io_Bytes.ofString(e,t);this.writeFullBytes(r,0,r.length)},__class__:haxe_io_Output};var _$Sys_FileOutput=function(e){this.fd=e};t["_Sys.FileOutput"]=_$Sys_FileOutput;_$Sys_FileOutput.__name__="_Sys.FileOutput";_$Sys_FileOutput.__super__=haxe_io_Output;_$Sys_FileOutput.prototype=$extend(haxe_io_Output.prototype,{writeByte:function(e){g.writeSync(this.fd,String.fromCodePoint(e))},writeBytes:function(e,t,r){var n=e.b;return g.writeSync(this.fd,O.from(n.buffer,n.byteOffset,e.length),t,r)},writeString:function(e,t){g.writeSync(this.fd,e)},__class__:_$Sys_FileOutput});var haxe_io_Input=function(){};t["haxe.io.Input"]=haxe_io_Input;haxe_io_Input.__name__="haxe.io.Input";haxe_io_Input.prototype={readByte:function(){throw new haxe_exceptions_NotImplementedException(null,null,{fileName:"haxe/io/Input.hx",lineNumber:53,className:"haxe.io.Input",methodName:"readByte"})},readBytes:function(e,t,r){var n=r;var i=e.b;if(t<0||r<0||t+r>e.length){throw haxe_Exception.thrown(h.OutsideBounds)}try{while(n>0){i[t]=this.readByte();++t;--n}}catch(e){if(!(haxe_Exception.caught(e).unwrap()instanceof haxe_io_Eof)){throw e}}return r-n},read:function(e){var t=new haxe_io_Bytes(new ArrayBuffer(e));var r=0;while(e>0){var n=this.readBytes(t,r,e);if(n==0){throw haxe_Exception.thrown(h.Blocked)}r+=n;e-=n}return t},__class__:haxe_io_Input};var l=n["ValueType"]={__ename__:"ValueType",__constructs__:null,TNull:{_hx_name:"TNull",_hx_index:0,__enum__:"ValueType",toString:$estr},TInt:{_hx_name:"TInt",_hx_index:1,__enum__:"ValueType",toString:$estr},TFloat:{_hx_name:"TFloat",_hx_index:2,__enum__:"ValueType",toString:$estr},TBool:{_hx_name:"TBool",_hx_index:3,__enum__:"ValueType",toString:$estr},TObject:{_hx_name:"TObject",_hx_index:4,__enum__:"ValueType",toString:$estr},TFunction:{_hx_name:"TFunction",_hx_index:5,__enum__:"ValueType",toString:$estr},TClass:(i=function(e){return{_hx_index:6,c:e,__enum__:"ValueType",toString:$estr}},i._hx_name="TClass",i.__params__=["c"],i),TEnum:(i=function(e){return{_hx_index:7,e:e,__enum__:"ValueType",toString:$estr}},i._hx_name="TEnum",i.__params__=["e"],i),TUnknown:{_hx_name:"TUnknown",_hx_index:8,__enum__:"ValueType",toString:$estr}};l.__constructs__=[l.TNull,l.TInt,l.TFloat,l.TBool,l.TObject,l.TFunction,l.TClass,l.TEnum,l.TUnknown];var Type=function(){};t["Type"]=Type;Type.__name__="Type";Type.createEnum=function(e,t,r){var n=Reflect.field(e,t);if(n==null){throw haxe_Exception.thrown("No such constructor "+t)}if(Reflect.isFunction(n)){if(r==null){throw haxe_Exception.thrown("Constructor "+t+" need parameters")}return n.apply(e,r)}if(r!=null&&r.length!=0){throw haxe_Exception.thrown("Constructor "+t+" does not need parameters")}return n};Type.typeof=function(e){switch(typeof e){case"boolean":return l.TBool;case"function":if(e.__name__||e.__ename__){return l.TObject}return l.TFunction;case"number":if(Math.ceil(e)==e%2147483648){return l.TInt}return l.TFloat;case"object":if(e==null){return l.TNull}var t=e.__enum__;if(t!=null){return l.TEnum(n[t])}var r=js_Boot.getClass(e);if(r!=null){return l.TClass(r)}return l.TObject;case"string":return l.TClass(String);case"undefined":return l.TNull;default:return l.TUnknown}};Type.enumParameters=function(e){var t=n[e.__enum__];var r=t.__constructs__[e._hx_index].__params__;if(r!=null){var i=[];var s=0;while(s<r.length){var a=r[s];++s;i.push(e[a])}return i}else{return[]}};var o=n["haxe.StackItem"]={__ename__:"haxe.StackItem",__constructs__:null,CFunction:{_hx_name:"CFunction",_hx_index:0,__enum__:"haxe.StackItem",toString:$estr},Module:(i=function(e){return{_hx_index:1,m:e,__enum__:"haxe.StackItem",toString:$estr}},i._hx_name="Module",i.__params__=["m"],i),FilePos:(i=function(e,t,r,n){return{_hx_index:2,s:e,file:t,line:r,column:n,__enum__:"haxe.StackItem",toString:$estr}},i._hx_name="FilePos",i.__params__=["s","file","line","column"],i),Method:(i=function(e,t){return{_hx_index:3,classname:e,method:t,__enum__:"haxe.StackItem",toString:$estr}},i._hx_name="Method",i.__params__=["classname","method"],i),LocalFunction:(i=function(e){return{_hx_index:4,v:e,__enum__:"haxe.StackItem",toString:$estr}},i._hx_name="LocalFunction",i.__params__=["v"],i)};o.__constructs__=[o.CFunction,o.Module,o.FilePos,o.Method,o.LocalFunction];var haxe_IMap=function(){};t["haxe.IMap"]=haxe_IMap;haxe_IMap.__name__="haxe.IMap";haxe_IMap.__isInterface__=true;var haxe_Exception=function(e,t,r){Error.call(this,e);this.message=e;this.__previousException=t;this.__nativeException=r!=null?r:this};t["haxe.Exception"]=haxe_Exception;haxe_Exception.__name__="haxe.Exception";haxe_Exception.caught=function(e){if(e instanceof haxe_Exception){return e}else if(e instanceof Error){return new haxe_Exception(e.message,null,e)}else{return new haxe_ValueException(e,null,e)}};haxe_Exception.thrown=function(e){if(e instanceof haxe_Exception){return e.get_native()}else if(e instanceof Error){return e}else{var t=new haxe_ValueException(e);return t}};haxe_Exception.__super__=Error;haxe_Exception.prototype=$extend(Error.prototype,{unwrap:function(){return this.__nativeException},toString:function(){return this.get_message()},get_message:function(){return this.message},get_native:function(){return this.__nativeException},__class__:haxe_Exception});var haxe_Http=function(e){this.params=[];this.headers={};this.url=G.fromString(e)};t["haxe.Http"]=haxe_Http;haxe_Http.__name__="haxe.Http";haxe_Http.prototype={setHeader:function(e,t){var r=this.headers[e];if(r==null){this.headers[e]=[t]}else{var n=r;n.push(t)}return this},setParameter:function(e,t){this.params.push(se.ofString(e)+"="+se.ofString(t));return this},onData:function(e){},onError:function(e){},request:function(e){var t=this;if(this.rawPostData!=null){e=true}if(e==null){e=false}var r=this.params.join("&");var n=this.url.scheme;var i=ne.get_name(this.url.host);var s=ne.get_port(this.url.host);var a=this.url;var l;if(r==""){l=""}else if(e==null){var o=r;l=(this.url.query==null?"?":"&")+o}else if(e==true){l=""}else{var o=r;l=(this.url.query==null?"?":"&")+o}var u=this.rawPostData;var c;if(u==null){c=e?r:null}else{var o=u;c=o}(n==null?S.request:n=="https"?E.request:S.request)({hostname:i,port:s,protocol:this.url.scheme+":",method:e?"POST":"GET",path:(a.query==null?a.path:(a.path==null?"null":a.path)+"?"+(a.query==null?"null":a.query))+l,headers:this.headers},(function(e){var r=[];e.on("end",(function(){var e=StringTools.replace(O.concat(r).toString(),"%F6","%6f");t.onData(e)}));e.on("data",$bind(r,$arrayPush));e.on("error",(function(e){t.onError(Std.string(e))}))})).on("error",(function(e){t.onError(Std.string(e))})).end(c)},__class__:haxe_Http};var haxe_Serializer=function(){this.buf=new StringBuf;this.cache=[];this.useCache=haxe_Serializer.USE_CACHE;this.useEnumIndex=haxe_Serializer.USE_ENUM_INDEX;this.shash=new haxe_ds_StringMap;this.scount=0};t["haxe.Serializer"]=haxe_Serializer;haxe_Serializer.__name__="haxe.Serializer";haxe_Serializer.prototype={toString:function(){return this.buf.b},serializeString:function(e){var t=this.shash.h[e];if(t!=null){this.buf.b+="R";this.buf.b+=t==null?"null":""+t;return}this.shash.h[e]=this.scount++;this.buf.b+="y";e=encodeURIComponent(e);this.buf.b+=Std.string(e.length);this.buf.b+=":";this.buf.b+=e==null?"null":""+e},serializeRef:function(e){var t=typeof e;var r=0;var n=this.cache.length;while(r<n){var i=r++;var s=this.cache[i];if(typeof s==t&&s==e){this.buf.b+="r";this.buf.b+=i==null?"null":""+i;return true}}this.cache.push(e);return false},serializeFields:function(e){var t=0;var r=Reflect.fields(e);while(t<r.length){var n=r[t];++t;this.serializeString(n);this.serialize(Reflect.field(e,n))}this.buf.b+="g"},serialize:function(e){var t=Type.typeof(e);switch(t._hx_index){case 0:this.buf.b+="n";break;case 1:var r=e;if(r==0){this.buf.b+="z";return}this.buf.b+="i";this.buf.b+=r==null?"null":""+r;break;case 2:var r=e;if(isNaN(r)){this.buf.b+="k"}else if(!isFinite(r)){this.buf.b+=r<0?"m":"p"}else{this.buf.b+="d";this.buf.b+=r==null?"null":""+r}break;case 3:this.buf.b+=e?"t":"f";break;case 4:if(js_Boot.__instanceof(e,fe)){var i=e.__name__;this.buf.b+="A";this.serializeString(i)}else if(js_Boot.__instanceof(e,de)){this.buf.b+="B";this.serializeString(e.__ename__)}else{if(this.useCache&&this.serializeRef(e)){return}this.buf.b+="o";this.serializeFields(e)}break;case 5:throw haxe_Exception.thrown("Cannot serialize function");case 6:var s=t.c;if(s==String){this.serializeString(e);return}if(this.useCache&&this.serializeRef(e)){return}switch(s){case Array:var a=0;this.buf.b+="a";var l=e["length"];var o=0;var u=l;while(o<u){var c=o++;if(e[c]==null){++a}else{if(a>0){if(a==1){this.buf.b+="n"}else{this.buf.b+="u";this.buf.b+=a==null?"null":""+a}a=0}this.serialize(e[c])}}if(a>0){if(a==1){this.buf.b+="n"}else{this.buf.b+="u";this.buf.b+=a==null?"null":""+a}}this.buf.b+="h";break;case Date:var h=e;this.buf.b+="v";this.buf.b+=Std.string(h.getTime());break;case haxe_ds_IntMap:this.buf.b+="q";var r=e;var d=r.keys();while(d.hasNext()){var v=d.next();this.buf.b+=":";this.buf.b+=v==null?"null":""+v;this.serialize(r.h[v])}this.buf.b+="h";break;case haxe_ds_List:this.buf.b+="l";var r=e;var m=r.h;while(m!=null){var p=m.item;m=m.next;var c=p;this.serialize(c)}this.buf.b+="h";break;case haxe_ds_ObjectMap:this.buf.b+="M";var r=e;var d=r.keys();while(d.hasNext()){var v=d.next();var _=Reflect.field(v,"__id__");Reflect.deleteField(v,"__id__");this.serialize(v);v["__id__"]=_;this.serialize(r.h[v.__id__])}this.buf.b+="h";break;case haxe_ds_StringMap:this.buf.b+="b";var r=e;var g=r.h;var w=g;var x=Object.keys(g);var b=x.length;var y=0;while(y<b){var d=x[y++];this.serializeString(d);this.serialize(r.h[d])}this.buf.b+="h";break;case haxe_io_Bytes:var r=e;this.buf.b+="s";this.buf.b+=Std.string(Math.ceil(r.length*8/6));this.buf.b+=":";var c=0;var S=r.length-2;var E=haxe_Serializer.BASE64_CODES;if(E==null){E=new Array(haxe_Serializer.BASE64.length);var o=0;var u=haxe_Serializer.BASE64.length;while(o<u){var N=o++;E[N]=HxOverrides.cca(haxe_Serializer.BASE64,N)}haxe_Serializer.BASE64_CODES=E}while(c<S){var k=r.b[c++];var O=r.b[c++];var R=r.b[c++];this.buf.b+=String.fromCodePoint(E[k>>2]);this.buf.b+=String.fromCodePoint(E[(k<<4|O>>4)&63]);this.buf.b+=String.fromCodePoint(E[(O<<2|R>>6)&63]);this.buf.b+=String.fromCodePoint(E[R&63])}if(c==S){var k=r.b[c++];var O=r.b[c++];this.buf.b+=String.fromCodePoint(E[k>>2]);this.buf.b+=String.fromCodePoint(E[(k<<4|O>>4)&63]);this.buf.b+=String.fromCodePoint(E[O<<2&63])}else if(c==S+1){var k=r.b[c++];this.buf.b+=String.fromCodePoint(E[k>>2]);this.buf.b+=String.fromCodePoint(E[k<<4&63])}break;default:if(this.useCache){this.cache.pop()}if(e.hxSerialize!=null){this.buf.b+="C";this.serializeString(s.__name__);if(this.useCache){this.cache.push(e)}e.hxSerialize(this);this.buf.b+="g"}else{this.buf.b+="c";this.serializeString(s.__name__);if(this.useCache){this.cache.push(e)}this.serializeFields(e)}}break;case 7:var C=t.e;if(this.useCache){if(this.serializeRef(e)){return}this.cache.pop()}this.buf.b+=Std.string(this.useEnumIndex?"j":"w");this.serializeString(C.__ename__);if(this.useEnumIndex){this.buf.b+=":";this.buf.b+=Std.string(e._hx_index)}else{var C=e;this.serializeString(n[C.__enum__].__constructs__[C._hx_index]._hx_name)}this.buf.b+=":";var A=Type.enumParameters(e);this.buf.b+=Std.string(A.length);var t=0;while(t<A.length){var I=A[t];++t;this.serialize(I)}if(this.useCache){this.cache.push(e)}break;default:throw haxe_Exception.thrown("Cannot serialize "+Std.string(e))}},__class__:haxe_Serializer};var haxe_Timer=function(e){var t=this;this.id=setInterval((function(){t.run()}),e)};t["haxe.Timer"]=haxe_Timer;haxe_Timer.__name__="haxe.Timer";haxe_Timer.delay=function(e,t){var r=new haxe_Timer(t);r.run=function(){r.stop();e()};return r};haxe_Timer.prototype={stop:function(){if(this.id==null){return}clearInterval(this.id);this.id=null},run:function(){},__class__:haxe_Timer};var haxe__$Unserializer_DefaultResolver=function(){};t["haxe._Unserializer.DefaultResolver"]=haxe__$Unserializer_DefaultResolver;haxe__$Unserializer_DefaultResolver.__name__="haxe._Unserializer.DefaultResolver";haxe__$Unserializer_DefaultResolver.prototype={resolveClass:function(e){return t[e]},resolveEnum:function(e){return n[e]},__class__:haxe__$Unserializer_DefaultResolver};var haxe_Unserializer=function(e){this.buf=e;this.length=this.buf.length;this.pos=0;this.scache=[];this.cache=[];var t=haxe_Unserializer.DEFAULT_RESOLVER;if(t==null){t=new haxe__$Unserializer_DefaultResolver;haxe_Unserializer.DEFAULT_RESOLVER=t}this.resolver=t};t["haxe.Unserializer"]=haxe_Unserializer;haxe_Unserializer.__name__="haxe.Unserializer";haxe_Unserializer.initCodes=function(){var e=[];var t=0;var r=haxe_Unserializer.BASE64.length;while(t<r){var n=t++;e[haxe_Unserializer.BASE64.charCodeAt(n)]=n}return e};haxe_Unserializer.prototype={readDigits:function(){var e=0;var t=false;var r=this.pos;while(true){var n=this.buf.charCodeAt(this.pos);if(n!=n){break}if(n==45){if(this.pos!=r){break}t=true;this.pos++;continue}if(n<48||n>57){break}e=e*10+(n-48);this.pos++}if(t){e*=-1}return e},readFloat:function(){var e=this.pos;while(true){var t=this.buf.charCodeAt(this.pos);if(t!=t){break}if(t>=43&&t<58||t==101||t==69){this.pos++}else{break}}return parseFloat(HxOverrides.substr(this.buf,e,this.pos-e))},unserializeObject:function(e){while(true){if(this.pos>=this.length){throw haxe_Exception.thrown("Invalid object")}if(this.buf.charCodeAt(this.pos)==103){break}var t=this.unserialize();if(typeof t!="string"){throw haxe_Exception.thrown("Invalid object key")}var r=this.unserialize();e[t]=r}this.pos++},unserializeEnum:function(e,t){if(this.buf.charCodeAt(this.pos++)!=58){throw haxe_Exception.thrown("Invalid enum format")}var r=this.readDigits();if(r==0){return Type.createEnum(e,t)}var n=[];while(r-- >0)n.push(this.unserialize());return Type.createEnum(e,t,n)},unserialize:function(){switch(this.buf.charCodeAt(this.pos++)){case 65:var e=this.unserialize();var t=this.resolver.resolveClass(e);if(t==null){throw haxe_Exception.thrown("Class not found "+e)}return t;case 66:var e=this.unserialize();var r=this.resolver.resolveEnum(e);if(r==null){throw haxe_Exception.thrown("Enum not found "+e)}return r;case 67:var e=this.unserialize();var t=this.resolver.resolveClass(e);if(t==null){throw haxe_Exception.thrown("Class not found "+e)}var n=Object.create(t.prototype);this.cache.push(n);n.hxUnserialize(this);if(this.buf.charCodeAt(this.pos++)!=103){throw haxe_Exception.thrown("Invalid custom data")}return n;case 77:var i=new haxe_ds_ObjectMap;this.cache.push(i);var s=this.buf;while(this.buf.charCodeAt(this.pos)!=104){var a=this.unserialize();i.set(a,this.unserialize())}this.pos++;return i;case 82:var l=this.readDigits();if(l<0||l>=this.scache.length){throw haxe_Exception.thrown("Invalid string reference")}return this.scache[l];case 97:var s=this.buf;var o=[];this.cache.push(o);while(true){var u=this.buf.charCodeAt(this.pos);if(u==104){this.pos++;break}if(u==117){this.pos++;var l=this.readDigits();o[o.length+l-1]=null}else{o.push(this.unserialize())}}return o;case 98:var i=new haxe_ds_StringMap;this.cache.push(i);var s=this.buf;while(this.buf.charCodeAt(this.pos)!=104){var a=this.unserialize();var c=this.unserialize();i.h[a]=c}this.pos++;return i;case 99:var e=this.unserialize();var t=this.resolver.resolveClass(e);if(t==null){throw haxe_Exception.thrown("Class not found "+e)}var n=Object.create(t.prototype);this.cache.push(n);this.unserializeObject(n);return n;case 100:return this.readFloat();case 102:return false;case 105:return this.readDigits();case 106:var e=this.unserialize();var h=this.resolver.resolveEnum(e);if(h==null){throw haxe_Exception.thrown("Enum not found "+e)}this.pos++;var d=this.readDigits();var v=h.__constructs__;var m=new Array(v.length);var p=0;var _=v.length;while(p<_){var g=p++;m[g]=v[g]._hx_name}var w=m[d];if(w==null){throw haxe_Exception.thrown("Unknown enum index "+e+"@"+d)}var r=this.unserializeEnum(h,w);this.cache.push(r);return r;case 107:return NaN;case 108:var x=new haxe_ds_List;this.cache.push(x);var s=this.buf;while(this.buf.charCodeAt(this.pos)!=104)x.add(this.unserialize());this.pos++;return x;case 109:return-Infinity;case 110:return null;case 111:var n={};this.cache.push(n);this.unserializeObject(n);return n;case 112:return Infinity;case 113:var i=new haxe_ds_IntMap;this.cache.push(i);var s=this.buf;var u=this.buf.charCodeAt(this.pos++);while(u==58){var g=this.readDigits();var c=this.unserialize();i.h[g]=c;u=this.buf.charCodeAt(this.pos++)}if(u!=104){throw haxe_Exception.thrown("Invalid IntMap format")}return i;case 114:var l=this.readDigits();if(l<0||l>=this.cache.length){throw haxe_Exception.thrown("Invalid reference")}return this.cache[l];case 115:var b=this.readDigits();var s=this.buf;if(this.buf.charCodeAt(this.pos++)!=58||this.length-this.pos<b){throw haxe_Exception.thrown("Invalid bytes length")}var y=haxe_Unserializer.CODES;if(y==null){y=haxe_Unserializer.initCodes();haxe_Unserializer.CODES=y}var g=this.pos;var S=b&3;var E=(b>>2)*3+(S>=2?S-1:0);var N=g+(b-S);var k=new haxe_io_Bytes(new ArrayBuffer(E));var O=0;while(g<N){var R=y[s.charCodeAt(g++)];var C=y[s.charCodeAt(g++)];k.b[O++]=R<<2|C>>4;var A=y[s.charCodeAt(g++)];k.b[O++]=C<<4|A>>2;var I=y[s.charCodeAt(g++)];k.b[O++]=A<<6|I}if(S>=2){var R=y[s.charCodeAt(g++)];var C=y[s.charCodeAt(g++)];k.b[O++]=R<<2|C>>4;if(S==3){var A=y[s.charCodeAt(g++)];k.b[O++]=C<<4|A>>2}}this.pos+=b;this.cache.push(k);return k;case 116:return true;case 118:var F;if(this.buf.charCodeAt(this.pos)>=48&&this.buf.charCodeAt(this.pos)<=57&&this.buf.charCodeAt(this.pos+1)>=48&&this.buf.charCodeAt(this.pos+1)<=57&&this.buf.charCodeAt(this.pos+2)>=48&&this.buf.charCodeAt(this.pos+2)<=57&&this.buf.charCodeAt(this.pos+3)>=48&&this.buf.charCodeAt(this.pos+3)<=57&&this.buf.charCodeAt(this.pos+4)==45){F=HxOverrides.strDate(HxOverrides.substr(this.buf,this.pos,19));this.pos+=19}else{F=new Date(this.readFloat())}this.cache.push(F);return F;case 119:var e=this.unserialize();var h=this.resolver.resolveEnum(e);if(h==null){throw haxe_Exception.thrown("Enum not found "+e)}var r=this.unserializeEnum(h,this.unserialize());this.cache.push(r);return r;case 120:throw haxe_Exception.thrown(this.unserialize());case 121:var b=this.readDigits();if(this.buf.charCodeAt(this.pos++)!=58||this.length-this.pos<b){throw haxe_Exception.thrown("Invalid string length")}var a=HxOverrides.substr(this.buf,this.pos,b);this.pos+=b;a=decodeURIComponent(a.split("+").join(" "));this.scache.push(a);return a;case 122:return 0;default:}this.pos--;throw haxe_Exception.thrown("Invalid char "+this.buf.charAt(this.pos)+" at position "+this.pos)},__class__:haxe_Unserializer};var haxe_ValueException=function(e,t,r){haxe_Exception.call(this,String(e),t,r);this.value=e};t["haxe.ValueException"]=haxe_ValueException;haxe_ValueException.__name__="haxe.ValueException";haxe_ValueException.__super__=haxe_Exception;haxe_ValueException.prototype=$extend(haxe_Exception.prototype,{unwrap:function(){return this.value},__class__:haxe_ValueException});var haxe_ds_BalancedTree=function(){};t["haxe.ds.BalancedTree"]=haxe_ds_BalancedTree;haxe_ds_BalancedTree.__name__="haxe.ds.BalancedTree";haxe_ds_BalancedTree.__interfaces__=[haxe_IMap];haxe_ds_BalancedTree.prototype={set:function(e,t){this.root=this.setLoop(e,t,this.root)},get:function(e){var t=this.root;while(t!=null){var r=this.compare(e,t.key);if(r==0){return t.value}if(r<0){t=t.left}else{t=t.right}}return null},setLoop:function(e,t,r){if(r==null){return new haxe_ds_TreeNode(null,e,t,null)}var n=this.compare(e,r.key);if(n==0){return new haxe_ds_TreeNode(r.left,e,t,r.right,r==null?0:r._height)}else if(n<0){var i=this.setLoop(e,t,r.left);return this.balance(i,r.key,r.value,r.right)}else{var s=this.setLoop(e,t,r.right);return this.balance(r.left,r.key,r.value,s)}},balance:function(e,t,r,n){var i=e==null?0:e._height;var s=n==null?0:n._height;if(i>s+2){var a=e.left;var l=e.right;if((a==null?0:a._height)>=(l==null?0:l._height)){return new haxe_ds_TreeNode(e.left,e.key,e.value,new haxe_ds_TreeNode(e.right,t,r,n))}else{return new haxe_ds_TreeNode(new haxe_ds_TreeNode(e.left,e.key,e.value,e.right.left),e.right.key,e.right.value,new haxe_ds_TreeNode(e.right.right,t,r,n))}}else if(s>i+2){var a=n.right;var l=n.left;if((a==null?0:a._height)>(l==null?0:l._height)){return new haxe_ds_TreeNode(new haxe_ds_TreeNode(e,t,r,n.left),n.key,n.value,n.right)}else{return new haxe_ds_TreeNode(new haxe_ds_TreeNode(e,t,r,n.left.left),n.left.key,n.left.value,new haxe_ds_TreeNode(n.left.right,n.key,n.value,n.right))}}else{return new haxe_ds_TreeNode(e,t,r,n,(i>s?i:s)+1)}},compare:function(e,t){return Reflect.compare(e,t)},__class__:haxe_ds_BalancedTree};var haxe_ds_TreeNode=function(e,t,r,n,i){if(i==null){i=-1}this.left=e;this.key=t;this.value=r;this.right=n;if(i==-1){var s;var a=this.left;var l=this.right;if((a==null?0:a._height)>(l==null?0:l._height)){var a=this.left;s=a==null?0:a._height}else{var a=this.right;s=a==null?0:a._height}this._height=s+1}else{this._height=i}};t["haxe.ds.TreeNode"]=haxe_ds_TreeNode;haxe_ds_TreeNode.__name__="haxe.ds.TreeNode";haxe_ds_TreeNode.prototype={__class__:haxe_ds_TreeNode};var haxe_ds_EnumValueMap=function(){haxe_ds_BalancedTree.call(this)};t["haxe.ds.EnumValueMap"]=haxe_ds_EnumValueMap;haxe_ds_EnumValueMap.__name__="haxe.ds.EnumValueMap";haxe_ds_EnumValueMap.__interfaces__=[haxe_IMap];haxe_ds_EnumValueMap.__super__=haxe_ds_BalancedTree;haxe_ds_EnumValueMap.prototype=$extend(haxe_ds_BalancedTree.prototype,{compare:function(e,t){var r=e._hx_index-t._hx_index;if(r!=0){return r}var n=Type.enumParameters(e);var i=Type.enumParameters(t);if(n.length==0&&i.length==0){return 0}return this.compareArgs(n,i)},compareArgs:function(e,t){var r=e.length-t.length;if(r!=0){return r}var n=0;var i=e.length;while(n<i){var s=n++;var a=this.compareArg(e[s],t[s]);if(a!=0){return a}}return 0},compareArg:function(e,t){if(Reflect.isEnumValue(e)&&Reflect.isEnumValue(t)){return this.compare(e,t)}else if(e instanceof Array&&t instanceof Array){return this.compareArgs(e,t)}else{return Reflect.compare(e,t)}},__class__:haxe_ds_EnumValueMap});var haxe_ds_IntMap=function(){this.h={}};t["haxe.ds.IntMap"]=haxe_ds_IntMap;haxe_ds_IntMap.__name__="haxe.ds.IntMap";haxe_ds_IntMap.__interfaces__=[haxe_IMap];haxe_ds_IntMap.prototype={keys:function(){var e=[];for(var t in this.h)if(this.h.hasOwnProperty(t))e.push(+t);return new haxe_iterators_ArrayIterator(e)},__class__:haxe_ds_IntMap};var haxe_ds_List=function(){this.length=0};t["haxe.ds.List"]=haxe_ds_List;haxe_ds_List.__name__="haxe.ds.List";haxe_ds_List.prototype={add:function(e){var t=new haxe_ds__$List_ListNode(e,null);if(this.h==null){this.h=t}else{this.q.next=t}this.q=t;this.length++},iterator:function(){return new haxe_ds__$List_ListIterator(this.h)},__class__:haxe_ds_List};var haxe_ds__$List_ListNode=function(e,t){this.item=e;this.next=t};t["haxe.ds._List.ListNode"]=haxe_ds__$List_ListNode;haxe_ds__$List_ListNode.__name__="haxe.ds._List.ListNode";haxe_ds__$List_ListNode.prototype={__class__:haxe_ds__$List_ListNode};var haxe_ds__$List_ListIterator=function(e){this.head=e};t["haxe.ds._List.ListIterator"]=haxe_ds__$List_ListIterator;haxe_ds__$List_ListIterator.__name__="haxe.ds._List.ListIterator";haxe_ds__$List_ListIterator.prototype={hasNext:function(){return this.head!=null},next:function(){var e=this.head.item;this.head=this.head.next;return e},__class__:haxe_ds__$List_ListIterator};var haxe_ds_ObjectMap=function(){this.h={__keys__:{}}};t["haxe.ds.ObjectMap"]=haxe_ds_ObjectMap;haxe_ds_ObjectMap.__name__="haxe.ds.ObjectMap";haxe_ds_ObjectMap.__interfaces__=[haxe_IMap];haxe_ds_ObjectMap.prototype={set:function(t,r){var n=t.__id__;if(n==null){n=t.__id__=e.$haxeUID++}this.h[n]=r;this.h.__keys__[n]=t},keys:function(){var e=[];for(var t in this.h.__keys__){if(this.h.hasOwnProperty(t)){e.push(this.h.__keys__[t])}}return new haxe_iterators_ArrayIterator(e)},__class__:haxe_ds_ObjectMap};var u=n["haxe.ds.Option"]={__ename__:"haxe.ds.Option",__constructs__:null,Some:(i=function(e){return{_hx_index:0,v:e,__enum__:"haxe.ds.Option",toString:$estr}},i._hx_name="Some",i.__params__=["v"],i),None:{_hx_name:"None",_hx_index:1,__enum__:"haxe.ds.Option",toString:$estr}};u.__constructs__=[u.Some,u.None];var haxe_ds_StringMap=function(){this.h=Object.create(null)};t["haxe.ds.StringMap"]=haxe_ds_StringMap;haxe_ds_StringMap.__name__="haxe.ds.StringMap";haxe_ds_StringMap.__interfaces__=[haxe_IMap];haxe_ds_StringMap.prototype={__class__:haxe_ds_StringMap};var haxe_ds__$StringMap_StringMapKeyValueIterator=function(e){this.h=e;this.keys=Object.keys(e);this.length=this.keys.length;this.current=0};t["haxe.ds._StringMap.StringMapKeyValueIterator"]=haxe_ds__$StringMap_StringMapKeyValueIterator;haxe_ds__$StringMap_StringMapKeyValueIterator.__name__="haxe.ds._StringMap.StringMapKeyValueIterator";haxe_ds__$StringMap_StringMapKeyValueIterator.prototype={hasNext:function(){return this.current<this.length},next:function(){var e=this.keys[this.current++];return{key:e,value:this.h[e]}},__class__:haxe_ds__$StringMap_StringMapKeyValueIterator};var haxe_exceptions_PosException=function(e,t,r){haxe_Exception.call(this,e,t);if(r==null){this.posInfos={fileName:"(unknown)",lineNumber:0,className:"(unknown)",methodName:"(unknown)"}}else{this.posInfos=r}};t["haxe.exceptions.PosException"]=haxe_exceptions_PosException;haxe_exceptions_PosException.__name__="haxe.exceptions.PosException";haxe_exceptions_PosException.__super__=haxe_Exception;haxe_exceptions_PosException.prototype=$extend(haxe_Exception.prototype,{toString:function(){return""+haxe_Exception.prototype.toString.call(this)+" in "+this.posInfos.className+"."+this.posInfos.methodName+" at "+this.posInfos.fileName+":"+this.posInfos.lineNumber},__class__:haxe_exceptions_PosException});var haxe_exceptions_NotImplementedException=function(e,t,r){if(e==null){e="Not implemented"}haxe_exceptions_PosException.call(this,e,t,r)};t["haxe.exceptions.NotImplementedException"]=haxe_exceptions_NotImplementedException;haxe_exceptions_NotImplementedException.__name__="haxe.exceptions.NotImplementedException";haxe_exceptions_NotImplementedException.__super__=haxe_exceptions_PosException;haxe_exceptions_NotImplementedException.prototype=$extend(haxe_exceptions_PosException.prototype,{__class__:haxe_exceptions_NotImplementedException});var haxe_io_Bytes=function(e){this.length=e.byteLength;this.b=new Uint8Array(e);this.b.bufferValue=e;e.hxBytes=this;e.bytes=this.b};t["haxe.io.Bytes"]=haxe_io_Bytes;haxe_io_Bytes.__name__="haxe.io.Bytes";haxe_io_Bytes.ofString=function(e,t){if(t==c.RawNative){var r=new Uint8Array(e.length<<1);var n=0;var i=e.length;while(n<i){var s=n++;var a=e.charCodeAt(s);r[s<<1]=a&255;r[s<<1|1]=a>>8}return new haxe_io_Bytes(r.buffer)}var l=[];var s=0;while(s<e.length){var a=e.charCodeAt(s++);if(55296<=a&&a<=56319){a=a-55232<<10|e.charCodeAt(s++)&1023}if(a<=127){l.push(a)}else if(a<=2047){l.push(192|a>>6);l.push(128|a&63)}else if(a<=65535){l.push(224|a>>12);l.push(128|a>>6&63);l.push(128|a&63)}else{l.push(240|a>>18);l.push(128|a>>12&63);l.push(128|a>>6&63);l.push(128|a&63)}}return new haxe_io_Bytes(new Uint8Array(l).buffer)};haxe_io_Bytes.prototype={sub:function(e,t){if(e<0||t<0||e+t>this.length){throw haxe_Exception.thrown(h.OutsideBounds)}return new haxe_io_Bytes(this.b.buffer.slice(e+this.b.byteOffset,e+this.b.byteOffset+t))},getInt32:function(e){if(this.data==null){this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)}return this.data.getInt32(e,true)},getString:function(e,t,r){if(e<0||t<0||e+t>this.length){throw haxe_Exception.thrown(h.OutsideBounds)}if(r==null){r=c.UTF8}var n="";var i=this.b;var s=e;var a=e+t;switch(r._hx_index){case 0:var l=e>0;while(s<a){var o=i[s++];if(o<128){if(o==0){break}n+=String.fromCodePoint(o)}else if(o<224){var u=(o&63)<<6|i[s++]&127;n+=String.fromCodePoint(u)}else if(o<240){var d=i[s++];var v=(o&31)<<12|(d&127)<<6|i[s++]&127;n+=String.fromCodePoint(v)}else{var m=i[s++];var p=i[s++];var _=(o&15)<<18|(m&127)<<12|(p&127)<<6|i[s++]&127;n+=String.fromCodePoint(_)}}break;case 1:while(s<a){var o=i[s++]|i[s++]<<8;n+=String.fromCodePoint(o)}break}return n},toString:function(){return this.getString(0,this.length)},__class__:haxe_io_Bytes};var c=n["haxe.io.Encoding"]={__ename__:"haxe.io.Encoding",__constructs__:null,UTF8:{_hx_name:"UTF8",_hx_index:0,__enum__:"haxe.io.Encoding",toString:$estr},RawNative:{_hx_name:"RawNative",_hx_index:1,__enum__:"haxe.io.Encoding",toString:$estr}};c.__constructs__=[c.UTF8,c.RawNative];var haxe_io_Eof=function(){};t["haxe.io.Eof"]=haxe_io_Eof;haxe_io_Eof.__name__="haxe.io.Eof";haxe_io_Eof.prototype={toString:function(){return"Eof"},__class__:haxe_io_Eof};var h=n["haxe.io.Error"]={__ename__:"haxe.io.Error",__constructs__:null,Blocked:{_hx_name:"Blocked",_hx_index:0,__enum__:"haxe.io.Error",toString:$estr},Overflow:{_hx_name:"Overflow",_hx_index:1,__enum__:"haxe.io.Error",toString:$estr},OutsideBounds:{_hx_name:"OutsideBounds",_hx_index:2,__enum__:"haxe.io.Error",toString:$estr},Custom:(i=function(e){return{_hx_index:3,e:e,__enum__:"haxe.io.Error",toString:$estr}},i._hx_name="Custom",i.__params__=["e"],i)};h.__constructs__=[h.Blocked,h.Overflow,h.OutsideBounds,h.Custom];var haxe_io_Path=function(e){switch(e){case".":case"..":this.dir=e;this.file="";return}var t=e.lastIndexOf("/");var r=e.lastIndexOf("\\");if(t<r){this.dir=HxOverrides.substr(e,0,r);e=HxOverrides.substr(e,r+1,null);this.backslash=true}else if(r<t){this.dir=HxOverrides.substr(e,0,t);e=HxOverrides.substr(e,t+1,null)}else{this.dir=null}var n=e.lastIndexOf(".");if(n!=-1){this.ext=HxOverrides.substr(e,n+1,null);this.file=HxOverrides.substr(e,0,n)}else{this.ext=null;this.file=e}};t["haxe.io.Path"]=haxe_io_Path;haxe_io_Path.__name__="haxe.io.Path";haxe_io_Path.withoutExtension=function(e){var t=new haxe_io_Path(e);t.ext=null;return t.toString()};haxe_io_Path.withoutDirectory=function(e){var t=new haxe_io_Path(e);t.dir=null;return t.toString()};haxe_io_Path.directory=function(e){var t=new haxe_io_Path(e);if(t.dir==null){return""}return t.dir};haxe_io_Path.extension=function(e){var t=new haxe_io_Path(e);if(t.ext==null){return""}return t.ext};haxe_io_Path.withExtension=function(e,t){var r=new haxe_io_Path(e);r.ext=t;return r.toString()};haxe_io_Path.join=function(e){var t=[];var r=0;var n=e;while(r<n.length){var i=n[r];++r;if(i!=null&&i!=""){t.push(i)}}var e=t;if(e.length==0){return""}var s=e[0];var t=1;var r=e.length;while(t<r){var a=t++;s=haxe_io_Path.addTrailingSlash(s);s+=e[a]}return haxe_io_Path.normalize(s)};haxe_io_Path.normalize=function(e){var t="/";e=e.split("\\").join(t);if(e==t){return t}var r=[];var n=0;var i=e.split(t);while(n<i.length){var s=i[n];++n;if(s==".."&&r.length>0&&r[r.length-1]!=".."){r.pop()}else if(s==""){if(r.length>0||HxOverrides.cca(e,0)==47){r.push(s)}}else if(s!="."){r.push(s)}}var a=r.join(t);var l="";var o=false;var u=false;var c=0;var h=a;while(c<h.length){var d=h;var v=c++;var m=d.charCodeAt(v);if(m>=55296&&m<=56319){m=m-55232<<10|d.charCodeAt(v+1)&1023}var p=m;if(p>=65536){++c}var _=p;switch(_){case 47:if(!o){u=true}else{var g=_;o=false;if(u){l+="/";u=false}l+=String.fromCodePoint(g)}break;case 58:l+=":";o=true;break;default:var w=_;o=false;if(u){l+="/";u=false}l+=String.fromCodePoint(w)}}return l};haxe_io_Path.addTrailingSlash=function(e){if(e.length==0){return"/"}var t=e.lastIndexOf("/");var r=e.lastIndexOf("\\");if(t<r){if(r!=e.length-1){return e+"\\"}else{return e}}else if(t!=e.length-1){return e+"/"}else{return e}};haxe_io_Path.removeTrailingSlashes=function(e){e:while(true){var t=HxOverrides.cca(e,e.length-1);if(t==null){break}else{switch(t){case 47:case 92:e=HxOverrides.substr(e,0,-1);break;default:break e}}}return e};haxe_io_Path.isAbsolute=function(e){if(StringTools.startsWith(e,"/")){return true}if(e.charAt(1)==":"){return true}if(StringTools.startsWith(e,"\\\\")){return true}return false};haxe_io_Path.prototype={toString:function(){return(this.dir==null?"":this.dir+(this.backslash?"\\":"/"))+this.file+(this.ext==null?"":"."+this.ext)},__class__:haxe_io_Path};var haxe_iterators_ArrayIterator=function(e){this.current=0;this.array=e};t["haxe.iterators.ArrayIterator"]=haxe_iterators_ArrayIterator;haxe_iterators_ArrayIterator.__name__="haxe.iterators.ArrayIterator";haxe_iterators_ArrayIterator.prototype={hasNext:function(){return this.current<this.array.length},next:function(){return this.array[this.current++]},__class__:haxe_iterators_ArrayIterator};var haxe_remoting_AsyncConnection=function(){};t["haxe.remoting.AsyncConnection"]=haxe_remoting_AsyncConnection;haxe_remoting_AsyncConnection.__name__="haxe.remoting.AsyncConnection";haxe_remoting_AsyncConnection.__isInterface__=true;haxe_remoting_AsyncConnection.prototype={__class__:haxe_remoting_AsyncConnection};var haxe_remoting_HttpAsyncConnection=function(e,t){this.__data=e;this.__path=t};t["haxe.remoting.HttpAsyncConnection"]=haxe_remoting_HttpAsyncConnection;haxe_remoting_HttpAsyncConnection.__name__="haxe.remoting.HttpAsyncConnection";haxe_remoting_HttpAsyncConnection.__interfaces__=[haxe_remoting_AsyncConnection];haxe_remoting_HttpAsyncConnection.urlConnect=function(e){return new haxe_remoting_HttpAsyncConnection({url:e,error:function(e){throw haxe_Exception.thrown(e)}},[])};haxe_remoting_HttpAsyncConnection.prototype={resolve:function(e){var t=new haxe_remoting_HttpAsyncConnection(this.__data,this.__path.slice());t.__path.push(e);return t},setErrorHandler:function(e){this.__data.error=e},call:function(e,t){var r=new haxe_Http(this.__data.url);var n=new haxe_Serializer;n.serialize(this.__path);n.serialize(e);r.setHeader("X-Haxe-Remoting","1");r.setParameter("__x",n.toString());var i=this.__data.error;r.onData=function(e){var r=true;var n;try{if(HxOverrides.substr(e,0,3)!="hxr"){throw haxe_Exception.thrown("Invalid response : '"+e+"'")}var s=new haxe_Unserializer(HxOverrides.substr(e,3,null));n=s.unserialize()}catch(e){var a=haxe_Exception.caught(e).unwrap();n=null;r=false;i(a)}if(r&&t!=null){t(n)}};r.onError=i;r.request(true)},__class__:haxe_remoting_HttpAsyncConnection};var haxeshim_Args=function(e,t){this.cwd=e;this.args=t};t["haxeshim.Args"]=haxeshim_Args;haxeshim_Args.__name__="haxeshim.Args";haxeshim_Args.interpolate=function(e,t){if(e.indexOf("${")==-1){return w.Success(e)}var r="";var n=0;while(n<e.length){var i=e.indexOf("${",n);if(i==-1){var s=null;r+=s==null?HxOverrides.substr(e,n,null):HxOverrides.substr(e,n,s);break}else{var a=i;var l=a-n;r+=l==null?HxOverrides.substr(e,n,null):HxOverrides.substr(e,n,l);var o=a+2;var u;var c=e.indexOf("}",o);if(c==-1){return w.Failure("unclosed interpolation in "+e)}else{var h=c;u=h}var d=HxOverrides.substr(e,o,u-o);var v;var m=t(d);if(m==null){return w.Failure("unknown variable "+d)}else{var p=m;if(p=="$"+"{"+d+"}"){v=p}else{var _=haxeshim_Args.interpolate(p,t);if(_._hx_index==0){var g=_.data;v=g}else{var x=_;return x}}}r+=Std.string(v);n=u+1}}return w.Success(r)};haxeshim_Args.fromMultilineString=function(e,t,r,n){if(n==null){n=false}var i=[];var s=new haxeshim_Errors;var getVar1=function(e){if(e=="__dirname"){return haxe_io_Path.directory(t)}else{return r(e)}};var add=function(e,r){var add=function(e){i.push({pos:m.File(t,r),val:e})};if(e.charAt(0)=="-"){add(e)}else{var n=haxeshim_Args.interpolate(e,getVar1);switch(n._hx_index){case 0:var a=n.data;add(a);break;case 1:var l=n.failure;s.fail(l,m.File(t,r));break}}};var a=e.split("\n");var l=StringTools.trim;var o=new Array(a.length);var u=0;var c=a.length;while(u<c){var h=u++;o[h]=l(a[h])}var d=o;var u=0;var c=d.length;while(u<c){var v=u++;var p=d[v];var _=function(e){return function(t){add(t,e[0])}}([v]);var g=p.charAt(0);if(g!=null){switch(g){case"#":break;case"-":var w=p.indexOf(" ");if(w==-1){_(p)}else{var x=w;_(HxOverrides.substr(p,0,x));_(StringTools.trim(HxOverrides.substr(p,x,null)))}break;default:var b=StringTools.trim(p);if(b!=""){var y=b;if(n){_("-cp")}_(y)}}}}return s.produce(i)};haxeshim_Args.getNdll=function(e){if(StringTools.startsWith(e,"ndll:")){return u.Some(HxOverrides.substr(e,5,null))}else{return u.None}};haxeshim_Args.makeNdll=function(e){return"ndll:"+e};haxeshim_Args.split=function(e,t,r,n){var i=[];var s=0;var a=e.length;while(s<a){var l=s++;i.push({val:e[l],pos:m.Cmd(l)})}var e=i;var o=[];var u=[];var c=[];var h=new haxeshim_Errors;var resolvePath=function(e){if(haxe_io_Path.isAbsolute(e)){return e}else{return haxe_io_Path.join([t,e])}};var flush=function(){if(u.length>0){var e=new haxeshim_Args(t,o.concat(u));u=[];c.push(e)}};while(true){var i=e.shift();if(i==null){flush();break}else{var d=i;var s=d.val;switch(s){case"--each":o=u;u=[];break;case"--next":flush();break;case"--cwd":case"-C":var a=e.shift();if(a==null){h.fail(""+d.val+" without argument",d.pos)}else{var v=a;t=resolvePath(v.val);if(!r.isDirectory(t)){h.fail("Cannot use "+t+" as working directory",v.pos);e=[]}}break;case"--run":case"-x":u=u.concat([d].concat(e));e=[];flush();break;default:var p=s;if(haxe_io_Path.extension(p)=="hxml"){e=haxeshim_Args.readHxml(resolvePath(p),r,n,h,d.pos).concat(e)}else{var _=s;if(StringTools.startsWith(_,"${")){var g=haxeshim_Args.interpolate(_,n);switch(g._hx_index){case 0:var w=g.data;u.push({val:w,pos:d.pos});break;case 1:var x=g.failure;h.fail(x,d.pos);break}}else{u.push(d)}}}}}return h.produce(c)};haxeshim_Args.readHxml=function(e,t,r,n,i){var s=t.readFile(e);switch(s._hx_index){case 0:var a=s.data;return n.getResult(haxeshim_Args.fromMultilineString(a,e,r));case 1:var l=s.failure;n.fail(l,i);return[]}};haxeshim_Args.prototype={__class__:haxeshim_Args};var haxeshim_Attempt=function(){};t["haxeshim.Attempt"]=haxeshim_Attempt;haxeshim_Attempt.__name__="haxeshim.Attempt";haxeshim_Attempt.to=function(e,t,r){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyFunc((function(){return tink_core_TypedError.catchExceptions(t,(function(t){return tink_core_TypedError.withData(null,"Failed to "+e,t,r)}),{fileName:"haxeshim/Attempt.hx",lineNumber:8,className:"haxeshim.Attempt",methodName:"to"})})))};var d=n["haxeshim.ServerKind"]={__ename__:"haxeshim.ServerKind",__constructs__:null,Port:(i=function(e){return{_hx_index:0,num:e,__enum__:"haxeshim.ServerKind",toString:$estr}},i._hx_name="Port",i.__params__=["num"],i),Stdio:{_hx_name:"Stdio",_hx_index:1,__enum__:"haxeshim.ServerKind",toString:$estr}};d.__constructs__=[d.Port,d.Stdio];var v=n["haxeshim.StdioState"]={__ename__:"haxeshim.StdioState",__constructs__:null,AwaitingHeader:(i=function(e){return{_hx_index:0,buf:e,__enum__:"haxeshim.StdioState",toString:$estr}},i._hx_name="AwaitingHeader",i.__params__=["buf"],i),AwaitingData:(i=function(e,t){return{_hx_index:1,buf:e,total:t,__enum__:"haxeshim.StdioState",toString:$estr}},i._hx_name="AwaitingData",i.__params__=["buf","total"],i)};v.__constructs__=[v.AwaitingHeader,v.AwaitingData];var haxeshim_CompilerServer=function(e,t,r){this.freePort=Y.irreversible((function(e){var t=N.createServer();t.listen(0,(function(){var r=t.address().port;t.close((function(){e(w.Success(r))}))}))}));this.args=r;this.scope=t;switch(e._hx_index){case 0:var n=e.num;this.waitOnPort(n);break;case 1:this.stdio();break}};t["haxeshim.CompilerServer"]=haxeshim_CompilerServer;haxeshim_CompilerServer.__name__="haxeshim.CompilerServer";haxeshim_CompilerServer.prototype={handleIntSignals:function(){var cleanExit=function(){process.exit()};process.on("SIGINT",cleanExit);process.on("SIGTERM",cleanExit)},stdio:function(){var e=this;g.watch(this.scope.configFile,{persistent:false},(function(t,r){var n=10;var i=null;i=function(t){if(t==null){t=0}try{e.scope.reload()}catch(e){if(t>=n){haxeshim_Logger.get().error("Reloading .haxerc after change detected failed "+n+" times!");process.exit(500)}else{var r=t+1;haxe_Timer.delay((function(){i(r)}),100)}}};i()}));var t=null;var quit=function(){if(t!=null){t.kill()}};process.on("exit",quit);this.handleIntSignals();process.stdin.on("end",quit);process.stdin.on("close",quit);var r=v.AwaitingHeader(O.alloc(0));var frame=function(e){var t=O.alloc(4+e.length);t.writeInt32LE(e.length,0);e.copy(t,4);return t};var processData=function(r){var n=O.alloc(0);var i=e;var s=r.indexOf(1);var l;if(s==-1){l=r}else{var o=s;n=r.slice(o);l=r.slice(0,o)}var u=i.parseArgs(l);if(t==null||u.version!=e.lastVersion){if(t!=null){t.kill();t.stdout.unpipe(process.stdout);t.stderr.unpipe(process.stderr)}e.lastVersion=u.version;var c=e.scope.haxeInstallation;t=a.spawn(c.compiler,e.args.concat(["--wait","stdio"]),{cwd:e.scope.cwd,env:x.toVars(haxeshim_sys_Exec.mergeEnv(c.env)),stdio:"pipe"});var h=t;t.on("exit",(function(e,r){if(t==h){t=null}}));t.stdout.pipe(process.stdout);t.stderr.pipe(process.stderr)}var s=e.scope;var d=u.args;var v=tink_core_TypedError.catchExceptions((function(){return s.resolve(d)}),null,{fileName:"haxeshim/CompilerServer.hx",lineNumber:142,className:"haxeshim.CompilerServer",methodName:"stdio"});switch(v._hx_index){case 0:var m=v.data;var p=O.from(m.join("\n"));t.stdin.write(frame(O.concat([p,n])));break;case 1:var _=v.failure;haxeshim_sys_Exec.die(_.code,_.message);break}};var reduce=function(){while(true){var e;switch(r._hx_index){case 0:var t=r.buf;e=t.length>=4?v.AwaitingData(t.slice(4),t.readInt32LE(0)):r;break;case 1:var n=r.buf;var i=r.total;if(n.length>=i){processData(n.slice(0,i));e=v.AwaitingHeader(n.slice(i))}else{e=r}break;default:e=r}if(r==e){break}r=e}};process.stdin.on("data",(function(e){switch(r._hx_index){case 0:var t=r.buf;r=v.AwaitingHeader(O.concat([t,e]));break;case 1:var t=r.buf;var n=r.total;r=v.AwaitingData(O.concat([t,e]),n);break}reduce()}))},parseArgs:function(e){var t=e.toString().split("\n");var r;var n=t.indexOf("--haxe-version");if(n==-1){r=this.lastVersion==null?this.scope.haxeInstallation.version:this.lastVersion}else{var i=n;r=t.splice(i,2).pop()}return{version:r,args:t}},waitOnPort:function(e){var t=this;var quit=function(){if(t.waiting!=null){t.waiting.handle((function(e){if(e._hx_index==0){var t=e.data;t.kill()}}))}};process.on("exit",quit);this.handleIntSignals();var r=N.createServer((function(e){var r=[];e.on("data",(function(n){var i=n.indexOf(0);if(i==-1){r.push(n)}else{var s=i;r.push(n.slice(0,s));e.unshift(n.slice(s+1));var a=O.concat(r).toString().split("\n");r=[];var l;var i=a.indexOf("--haxe-version");if(i==-1){l=t.lastVersion==null?t.scope.haxeInstallation.version:t.lastVersion}else{var s=i;l=a.splice(s,2).pop()}t.connect(l).handle((function(t){switch(t._hx_index){case 0:var r=t.data;r.write(a.join("\n")+String.fromCodePoint(0));r.pipe(e,{end:true});break;case 1:var n=t.failure;e.end(n.message+"\n"+""+"\n","utf8");break}}))}}));e.on("error",(function(){}));e.on("end",(function(){}))}));r.listen(e)},disconnect:function(){if(this.waiting==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return X.next(this.waiting,(function(e){return Y.map(e.kill(),w.Success)}))}},connect:function(e){var t=this;if(e!=this.lastVersion||this.waiting==null){this.lastVersion=e;var r=this.waiting=X.next(this.disconnect(),(function(r){return X.next(t.freePort,K.ofSafeSync((function(r){var n=t.scope.getInstallation(e);var i=haxeshim_sys_Exec.async(n.compiler,t.scope.cwd,t.args.concat(["--wait",r==null?"null":""+r]),n.env);return{died:Y.irreversible((function(e){var t=e;var r=null;var nu=function(){t(r)};i.on("exit",nu);var n=e;var s=null;var nu=function(){n(s)};i.on("error",nu);var a=e;var l=null;var nu=function(){a(l)};i.on("disconnect",nu)})),version:e,socket:function(){var f=function(e,t){var n=10;var i=null;i=function(s){var a=N.createConnection(r,"127.0.0.1");a.on("error",(function(e){if(s>=n){t(new tink_core_TypedError(null,"Failed to connect to 127.0.0.1:"+r+" after "+n+" attempts because "+e,{fileName:"haxeshim/CompilerServer.hx",lineNumber:291,className:"haxeshim.CompilerServer",methodName:"connect"}))}else{var a=s+1;haxe_Timer.delay((function(){i(a)}),100)}})).on("connect",(function(){e(a)}))};i(1)};var f1=function(e,t){f(e,t);return null};var wakeup=function(e){return f1((function(t){e(w.Success(t))}),(function(t){e(w.Failure(t))}))};return new tink_core__$Future_SuspendableFuture((function(e,t){return wakeup(e)}))},kill:function(){i.kill();return Y.delay(500,new tink_core__$Lazy_LazyConst(null))}}})))}));this.waiting.handle((function(e){switch(e._hx_index){case 0:var n=e.data;n.died.handle((function(){if(t.waiting==r){t.waiting=null}}));break;case 1:var i=e.failure;t.waiting=null;break}}))}return X.next(this.waiting,(function(e){return e.socket()}))},__class__:haxeshim_CompilerServer};var haxeshim_Errors=function(){this.errors=[]};t["haxeshim.Errors"]=haxeshim_Errors;haxeshim_Errors.__name__="haxeshim.Errors";haxeshim_Errors.getCode=function(e){var t=0;var r=e;while(t<r.length){var n=r[t];++t;var i=n.code;if(i!=null){var s=i;return s}}return 500};haxeshim_Errors.prototype={fail:function(e,t,r){this.errors.push({message:e,pos:t,code:r})},produce:function(e){if(this.errors.length==0){return w.Success(e)}else{return w.Failure({result:e,errors:this.errors})}},getResult:function(e){switch(e._hx_index){case 0:var t=e.data;return t;case 1:var t=e.failure;var r=0;var n=t.errors;while(r<n.length){var i=n[r];++r;this.errors.push(i)}return t.result}},__class__:haxeshim_Errors};var m=n["haxeshim.Pos"]={__ename__:"haxeshim.Pos",__constructs__:null,File:(i=function(e,t){return{_hx_index:0,path:e,line:t,__enum__:"haxeshim.Pos",toString:$estr}},i._hx_name="File",i.__params__=["path","line"],i),Cmd:(i=function(e){return{_hx_index:1,index:e,__enum__:"haxeshim.Pos",toString:$estr}},i._hx_name="Cmd",i.__params__=["index"],i),Custom:(i=function(e){return{_hx_index:2,source:e,__enum__:"haxeshim.Pos",toString:$estr}},i._hx_name="Custom",i.__params__=["source"],i)};m.__constructs__=[m.File,m.Cmd,m.Custom];var haxeshim_PosTools=function(){};t["haxeshim.PosTools"]=haxeshim_PosTools;haxeshim_PosTools.__name__="haxeshim.PosTools";haxeshim_PosTools.toString=function(e){switch(e._hx_index){case 0:var t=e.path;var r=e.line;return""+t+":"+r;case 1:var n=e.index;return"CLI arg#"+n;case 2:var i=e.source;return i}};var haxeshim_Logger=function(){};t["haxeshim.Logger"]=haxeshim_Logger;haxeshim_Logger.__name__="haxeshim.Logger";haxeshim_Logger.get=function(e){if(e==null){e=false}if(e){if(haxeshim_Logger.SILENT==null){haxeshim_Logger.SILENT=new haxeshim_Logger}return haxeshim_Logger.SILENT}else{if(haxeshim_Logger.DEFAULT==null){haxeshim_Logger.DEFAULT=new haxeshim__$Logger_SysLogger}return haxeshim_Logger.DEFAULT}};haxeshim_Logger.prototype={error:function(e){},warning:function(e){},info:function(e){},success:function(e){},progress:function(e){},__class__:haxeshim_Logger};var haxeshim__$Logger_SysLogger=function(){haxeshim_Logger.call(this)};t["haxeshim._Logger.SysLogger"]=haxeshim__$Logger_SysLogger;haxeshim__$Logger_SysLogger.__name__="haxeshim._Logger.SysLogger";haxeshim__$Logger_SysLogger.__super__=haxeshim_Logger;haxeshim__$Logger_SysLogger.prototype=$extend(haxeshim_Logger.prototype,{log:function(e,t){this.progress("");var r=haxeshim__$Logger_SysLogger.out;var n;switch(e._hx_index){case 0:n=[s.Red];break;case 1:n=[s.Yellow];break;case 2:n=[s.DefaultForeground];break;case 3:n=[s.Green];break}r.writeString(ANSI.aset(n)+t+ANSI.aset([s.Off])+"\n")},error:function(e){this.log(p.Error,e)},warning:function(e){this.log(p.Warning,e)},info:function(e){this.log(p.Info,e)},success:function(e){this.log(p.Success,e)},progress:function(e){if(haxeshim__$Logger_SysLogger.isTTY){if(e.length>80){e=HxOverrides.substr(e,0,77)+"..."}haxeshim__$Logger_SysLogger.out.writeString((ANSI.strip||ANSI.stripIfUnavailable&&!ANSI.available?"":"")+(ANSI.strip||ANSI.stripIfUnavailable&&!ANSI.available?"":"["+1+"G")+e)}},__class__:haxeshim__$Logger_SysLogger});var p=n["haxeshim._Logger.Level"]={__ename__:"haxeshim._Logger.Level",__constructs__:null,Error:{_hx_name:"Error",_hx_index:0,__enum__:"haxeshim._Logger.Level",toString:$estr},Warning:{_hx_name:"Warning",_hx_index:1,__enum__:"haxeshim._Logger.Level",toString:$estr},Info:{_hx_name:"Info",_hx_index:2,__enum__:"haxeshim._Logger.Level",toString:$estr},Success:{_hx_name:"Success",_hx_index:3,__enum__:"haxeshim._Logger.Level",toString:$estr}};p.__constructs__=[p.Error,p.Warning,p.Info,p.Success];var haxeshim_cli_HaxeCli=function(e){this.scope=e};t["haxeshim.cli.HaxeCli"]=haxeshim_cli_HaxeCli;haxeshim_cli_HaxeCli.__name__="haxeshim.cli.HaxeCli";haxeshim_cli_HaxeCli.prototype={installLibs:function(e){return this.scope.withLogger(haxeshim_Logger.get(e),(i=this.scope,$bind(i,i.installLibs))).handle((function(e){if(e._hx_index==1){var t=e.failure;haxeshim_Logger.get().error(t.message);var r=t.code;process.exit(r)}}))},dispatch:function(e){var getScope=function(){var e={cwd:null};return haxeshim_sys_Exec.gracefully((function(){return haxeshim_scope_Scope.seek(e)}))};var t;var r;r=e.indexOf("--wait");var n=r;if(n>=0&&n<e.length-1){var i;var s=e.splice(n,2).pop();var r;if(s==null){r=Std.parseInt(s);var a=r;i=d.Port(a)}else if(s=="stdio"){i=d.Stdio}else{r=Std.parseInt(s);var a=r;i=d.Port(a)}new haxeshim_CompilerServer(i,getScope(),e)}else{t=e.slice(0,2);if(t.length==2){if(t[0]=="--run"){var l=t[1];if(l.indexOf("-")!=-1&&l.toLowerCase()==l){var o=e.slice(2);var u=getScope();switch(l){case"install-libs":var i;switch(o.length){case 0:i=false;break;case 1:i=o[0]=="--silent"?true:haxeshim_sys_Exec.die(422,"unexpected arguments "+Std.string(o));break;default:i=haxeshim_sys_Exec.die(422,"unexpected arguments "+Std.string(o))}this.installLibs(i);break;case"resolve-args":var s=u;var c=o;var h=haxeshim_sys_Exec.gracefully((function(){return s.resolve(c)})).join("\n");process.stdout.write(Std.string(h));process.stdout.write("\n");process.exit(0);break;case"show-version":if(o.length>0){haxeshim_sys_Exec.die(422,"too many arguments")}var v;var m=haxeshim_sys_Exec.eval(u.haxeInstallation.compiler,u.cwd,["-version"]);switch(m._hx_index){case 0:var h=m.data;v=StringTools.trim(h.stdout.toString()+h.stderr.toString());break;case 1:var p=m.failure;v=haxeshim_sys_Exec.die(p.code,p.message);break}process.stdout.write(Std.string("-D haxe-ver="+v));process.stdout.write("\n");var h="-cp "+u.haxeInstallation.stdLib;process.stdout.write(Std.string(h));process.stdout.write("\n");break;default:var h=l;haxeshim_sys_Exec.die(404,"Unknown extension "+h)}}else{var o=e;var u=getScope();var m=o.indexOf("--haxe-version");if(o.indexOf("--connect")==-1){var i=m==-1}else if(m==-1){o.push("--haxe-version");o.push(u.haxeInstallation.version)}var m=u.haxeInstallation.compiler;var _=m;if(sys_FileSystem.exists(_)){var get=function(e){switch(e._hx_index){case 0:var t=e.data;return t;case 1:var r=e.failure;var n=r.result;var i=r.errors;return haxeshim_sys_Exec.dieFromErrors(i)}};var callHaxe=function(e,t){var r=haxeshim_sys_Exec.sync(_,t,e,u.haxeInstallation.env);switch(r._hx_index){case 0:var n=r.data;if(n!=0){var i=n;haxeshim_sys_Exec.die(i)}break;case 1:var s=r.failure;haxeshim_sys_Exec.die(s.code,s.message);break}};if(o.length==0){callHaxe(o,u.cwd)}else{var g=0;var w=get(u.getBuilds(o));while(g<w.length){var x=w[g];++g;var b=get(x);get(b.checkClassPaths());var callHaxe1=callHaxe;var y=[];var S=0;var E=b.args;while(S<E.length){var N=E[S];++S;y.push(N.val)}callHaxe1(y,b.cwd)}}}else{var k=m;haxeshim_sys_Exec.die(404,'haxe compiler not found at the expected location "'+k+'"')}}}else{var o=e;var O=getScope();var m=o.indexOf("--haxe-version");if(o.indexOf("--connect")==-1){var i=m==-1}else if(m==-1){o.push("--haxe-version");o.push(O.haxeInstallation.version)}var m=O.haxeInstallation.compiler;var R=m;if(sys_FileSystem.exists(R)){var get1=function(e){switch(e._hx_index){case 0:var t=e.data;return t;case 1:var r=e.failure;var n=r.result;var i=r.errors;return haxeshim_sys_Exec.dieFromErrors(i)}};var callHaxe1=function(e,t){var r=haxeshim_sys_Exec.sync(R,t,e,O.haxeInstallation.env);switch(r._hx_index){case 0:var n=r.data;if(n!=0){var i=n;haxeshim_sys_Exec.die(i)}break;case 1:var s=r.failure;haxeshim_sys_Exec.die(s.code,s.message);break}};if(o.length==0){callHaxe1(o,O.cwd)}else{var g=0;var w=get1(O.getBuilds(o));while(g<w.length){var x=w[g];++g;var b=get1(x);get1(b.checkClassPaths());var callHaxe2=callHaxe1;var y=[];var S=0;var E=b.args;while(S<E.length){var N=E[S];++S;y.push(N.val)}callHaxe2(y,b.cwd)}}}else{var k=m;haxeshim_sys_Exec.die(404,'haxe compiler not found at the expected location "'+k+'"')}}}else{var o=e;var C=getScope();var m=o.indexOf("--haxe-version");if(o.indexOf("--connect")==-1){var i=m==-1}else if(m==-1){o.push("--haxe-version");o.push(C.haxeInstallation.version)}var m=C.haxeInstallation.compiler;var A=m;if(sys_FileSystem.exists(A)){var get2=function(e){switch(e._hx_index){case 0:var t=e.data;return t;case 1:var r=e.failure;var n=r.result;var i=r.errors;return haxeshim_sys_Exec.dieFromErrors(i)}};var callHaxe2=function(e,t){var r=haxeshim_sys_Exec.sync(A,t,e,C.haxeInstallation.env);switch(r._hx_index){case 0:var n=r.data;if(n!=0){var i=n;haxeshim_sys_Exec.die(i)}break;case 1:var s=r.failure;haxeshim_sys_Exec.die(s.code,s.message);break}};if(o.length==0){callHaxe2(o,C.cwd)}else{var g=0;var w=get2(C.getBuilds(o));while(g<w.length){var x=w[g];++g;var b=get2(x);get2(b.checkClassPaths());var I=callHaxe2;var y=[];var S=0;var E=b.args;while(S<E.length){var N=E[S];++S;y.push(N.val)}I(y,b.cwd)}}}else{var k=m;haxeshim_sys_Exec.die(404,'haxe compiler not found at the expected location "'+k+'"')}}}},__class__:haxeshim_cli_HaxeCli};var haxeshim_cli_HaxelibCli=function(e){this.scope=e;this.installation=e.haxeInstallation};t["haxeshim.cli.HaxelibCli"]=haxeshim_cli_HaxelibCli;haxeshim_cli_HaxelibCli.__name__="haxeshim.cli.HaxelibCli";haxeshim_cli_HaxelibCli.exit=function(e){switch(e._hx_index){case 0:var t=e.data;process.exit(0);break;case 1:var r=e.failure;haxeshim_sys_Exec.die(r.code,r.message);break}};haxeshim_cli_HaxelibCli.exitWithCode=function(e){switch(e._hx_index){case 0:var t=e.data;process.exit(t);break;case 1:var r=e.failure;haxeshim_sys_Exec.die(r.code,r.message);break}};haxeshim_cli_HaxelibCli.prototype={callHaxelib:function(e){haxeshim_cli_HaxelibCli.exitWithCode(haxeshim_sys_Exec.sync(this.installation.haxelib,haxe_io_Path.addTrailingSlash(process.cwd()),e,this.installation.env))},run:function(e){var t=this;this.scope.getLibCommand(e).handle((function(r){switch(r._hx_index){case 0:var n=r.data;haxeshim_cli_HaxelibCli.exit(n());break;case 1:var i=r.failure;t.callHaxelib(["run"].concat(e));break}}))},__class__:haxeshim_cli_HaxelibCli};var haxeshim_scope_HaxeInstallation=function(e,t,r,n){this.path=e;this.version=t;this.compiler=""+e+"/haxe"+haxeshim_sys_Os.EXECUTABLE_EXTENSION;this.haxelib=""+e+"/haxelib"+haxeshim_sys_Os.EXECUTABLE_EXTENSION;this.stdLib=""+e+"/std";this.haxelibRepo=r;this.neko=n;this.env=x.mergeInto(n.env,x.ofObj({HAXE_STD_PATH:this.stdLib,HAXEPATH:e,HAXELIB_PATH:r,HAXE_VERSION:t}))};t["haxeshim.scope.HaxeInstallation"]=haxeshim_scope_HaxeInstallation;haxeshim_scope_HaxeInstallation.__name__="haxeshim.scope.HaxeInstallation";haxeshim_scope_HaxeInstallation.at=function(e){var t=e.path;var r=e.version;var n=""+t+"/platform.txt";var i;if(sys_FileSystem.exists(n)){i=g.readFileSync(n,{encoding:"utf8"})}else if(!sys_FileSystem.exists(t)){i=haxeshim_sys_Os.get_platform()}else{var s=new sys_io_FileInput(g.openSync(""+t+"/haxe"+haxeshim_sys_Os.EXECUTABLE_EXTENSION,"r"));var a=s.read(1024);var l=y.detect(a);try{g.writeFileSync(n,l)}catch(e){var o=haxe_Exception.caught(e).unwrap();haxeshim_Logger.get().error("Failed to cache platform in info: "+Std.string(o))}i=l}var u=i;return new haxeshim_scope_HaxeInstallation(t,r,e.haxelibRepo,haxeshim_scope_NekoInstallation.get(e.root,u,r))};haxeshim_scope_HaxeInstallation.prototype={__class__:haxeshim_scope_HaxeInstallation};var haxeshim_scope_NekoInstallation=function(e){this.path=e.path;this.platform=e.platform;this.version=e.version;this.executable=""+this.path+"/neko"+haxeshim_sys_Os.EXECUTABLE_EXTENSION;var t;switch(Sys.systemName()){case"Mac":t="DYLD_LIBRARY_PATH";break;case"Windows":t="PATH";break;default:t="LD_LIBRARY_PATH"}var r=process.env[t];var n;if(r==null){var i=new haxe_ds_StringMap;i.h[t]=this.path;n=x.ofMap(i)}else{var s=r;if(s.indexOf(this.path)!=-1){n=x.ofObj({})}else{var a=r;var r=new haxe_ds_StringMap;r.h[t]=a+haxeshim_sys_Os.DELIMITER+this.path;n=x.ofMap(r)}}this.env=n};t["haxeshim.scope.NekoInstallation"]=haxeshim_scope_NekoInstallation;haxeshim_scope_NekoInstallation.__name__="haxeshim.scope.NekoInstallation";haxeshim_scope_NekoInstallation.get=function(e,t,r){var n="2.4.0";return new haxeshim_scope_NekoInstallation({platform:t,version:n,path:""+e+"/neko/versions/"+n+"-"+t})};haxeshim_scope_NekoInstallation.prototype={__class__:haxeshim_scope_NekoInstallation};var haxeshim_sys_Os=function(){};t["haxeshim.sys.Os"]=haxeshim_sys_Os;haxeshim_sys_Os.__name__="haxeshim.sys.Os";haxeshim_sys_Os.get_platform=function(){var e;if(haxeshim_sys_Os.platform!=null){e=haxeshim_sys_Os.platform}else{var t=process.platform;var r=process.arch;switch(t){case"darwin":switch(r){case"arm64":e="mac-arm";break;case"x64":e="mac64";break;default:e="unknown"}break;case"linux":switch(r){case"arm":e="linux-arm";break;case"arm64":e="linux-arm64";break;case"ia32":e="linux32";break;case"riscv64":e="linux-riscv";break;case"x64":e="linux64";break;default:e="unknown"}break;case"win32":switch(r){case"ia32":e="win32";break;case"x64":e="win64";break;default:e="unknown"}break;default:e="unknown"}}return haxeshim_sys_Os.platform=e};var tink_core__$Lazy_Computable=function(){};t["tink.core._Lazy.Computable"]=tink_core__$Lazy_Computable;tink_core__$Lazy_Computable.__name__="tink.core._Lazy.Computable";tink_core__$Lazy_Computable.__isInterface__=true;tink_core__$Lazy_Computable.prototype={__class__:tink_core__$Lazy_Computable};var tink_core__$Lazy_LazyObject=function(){};t["tink.core._Lazy.LazyObject"]=tink_core__$Lazy_LazyObject;tink_core__$Lazy_LazyObject.__name__="tink.core._Lazy.LazyObject";tink_core__$Lazy_LazyObject.__isInterface__=true;tink_core__$Lazy_LazyObject.__interfaces__=[tink_core__$Lazy_Computable];tink_core__$Lazy_LazyObject.prototype={__class__:tink_core__$Lazy_LazyObject};var tink_core__$Lazy_LazyConst=function(e){this.value=e};t["tink.core._Lazy.LazyConst"]=tink_core__$Lazy_LazyConst;tink_core__$Lazy_LazyConst.__name__="tink.core._Lazy.LazyConst";tink_core__$Lazy_LazyConst.__interfaces__=[tink_core__$Lazy_LazyObject];tink_core__$Lazy_LazyConst.prototype={isComputed:function(){return true},get:function(){return this.value},compute:function(){},underlying:function(){return null},__class__:tink_core__$Lazy_LazyConst};var _={};_.get=function(e){e.compute();return e.get()};var sys_FileSystem=function(){};t["sys.FileSystem"]=sys_FileSystem;sys_FileSystem.__name__="sys.FileSystem";sys_FileSystem.exists=function(e){try{g.accessSync(e);return true}catch(e){return false}};sys_FileSystem.isDirectory=function(e){try{return g.statSync(e).isDirectory()}catch(e){return false}};sys_FileSystem.createDirectory=function(e){try{g.mkdirSync(e)}catch(n){var t=haxe_Exception.caught(n).unwrap();if(t.code=="ENOENT"){sys_FileSystem.createDirectory(k.dirname(e));g.mkdirSync(e)}else{var r;try{r=g.statSync(e)}catch(e){throw t}if(!r.isDirectory()){throw t}}}};sys_FileSystem.deleteDirectory=function(e){if(sys_FileSystem.exists(e)){var t=0;var r=g.readdirSync(e);while(t<r.length){var n=r[t];++t;var i=e+"/"+n;if(sys_FileSystem.isDirectory(i)){sys_FileSystem.deleteDirectory(i)}else{g.unlinkSync(i)}}g.rmdirSync(e)}};var g=r(7147);var w=n["tink.core.Outcome"]={__ename__:"tink.core.Outcome",__constructs__:null,Success:(i=function(e){return{_hx_index:0,data:e,__enum__:"tink.core.Outcome",toString:$estr}},i._hx_name="Success",i.__params__=["data"],i),Failure:(i=function(e){return{_hx_index:1,failure:e,__enum__:"tink.core.Outcome",toString:$estr}},i._hx_name="Failure",i.__params__=["failure"],i)};w.__constructs__=[w.Success,w.Failure];var haxeshim_scope_Scope=function(e,t,r,n){this.logger=haxeshim_Logger.get(false);this.haxeshimRoot=e;this.isGlobal=t;this.scopeDir=r;this.scopeLibDir=""+r+"/haxe_libraries";this.cwd=n;this.configFile=""+r+"/"+haxeshim_scope_Scope.CONFIG_FILE;this.versionDir=""+e+"/versions";this.haxelibRepo=""+e+"/haxelib";var i=process.env["HAXESHIM_LIBCACHE"];var s=process.env["HAXE_LIBCACHE"];var a;if(i==null){if(s==null){a=""+e+"/haxe_libraries"}else{var l=s;a=l}}else{var l=i;a=l}this.libCache=a};t["haxeshim.scope.Scope"]=haxeshim_scope_Scope;haxeshim_scope_Scope.__name__="haxeshim.scope.Scope";haxeshim_scope_Scope.create=function(e,t){return haxeshim_sys_Fs.save(""+e+"/"+haxeshim_scope_Scope.CONFIG_FILE,b.ofString(JSON.stringify(t,null," ")),{fileName:"haxeshim/scope/Scope.hx",lineNumber:194,className:"haxeshim.scope.Scope",methodName:"create"})};haxeshim_scope_Scope.exists=function(e){return sys_FileSystem.exists(""+e+"/"+haxeshim_scope_Scope.CONFIG_FILE)};haxeshim_scope_Scope.seek=function(e){if(e==null){e={}}var t;var r=e.cwd;if(r==null){t=haxe_io_Path.addTrailingSlash(process.cwd())}else{var n=r;t=n}var i;var r=e.startLookingIn;if(r==null){i=t}else{var n=r;i=n}var s;var r=e.haxeshimRoot;if(r==null){s=haxeshim_scope_Scope.DEFAULT_ROOT}else{var n=r;s=n}var a=s;var l=t;var make=function(e,t){return new haxeshim_scope_Scope(a,e,t,l)};var o;var r=haxeshim_sys_Fs.findNearest(haxeshim_scope_Scope.CONFIG_FILE,haxe_io_Path.isAbsolute(i)?i:k.resolve(i));switch(r._hx_index){case 0:var n=r.v;o=make(false,haxe_io_Path.directory(n));break;case 1:o=make(true,s);break}o.reload();return o};haxeshim_scope_Scope.env=function(e){var t=process.env[e];if(t==null){return u.None}else if(t==""){return u.None}else{var r=t;return u.Some(r)}};haxeshim_scope_Scope.prototype={withLogger:function(e,t){var r=this;var n=this.logger;this.logger=e;return tink_core_TypedError.tryFinally(t,(function(){r.logger=n}))},installLibs:function(){var e=this;return haxeshim_Attempt.to("install libraries",(function(){var t=e.getInstallationInstructions();var r=0;var n=t.missing;if(n.length!=0){var i=n;r=404;var n=0;while(n<i.length){var s=i[n];++n;e.logger.error(""+s.lib+" has no install instruction for missing classpath "+s.cp+"\n")}}var a=t.instructions.install.length+t.instructions.postInstall.length;var l=0;var o=0;var u=t.instructions.install;var n=0;while(n<u.length){var c=u[n];++n;e.logger.progress("["+ ++l+"/"+a+"] "+c);var h=haxeshim_sys_Exec.shell(c,haxe_io_Path.addTrailingSlash(process.cwd()));if(h._hx_index==1){var d=h.failure;r=d.code}else{++o}}var u=t.instructions.postInstall;var n=0;while(n<u.length){var c=u[n];++n;e.logger.progress("["+ ++l+"/"+a+"] "+c);var h=haxeshim_sys_Exec.shell(c,haxe_io_Path.addTrailingSlash(process.cwd()));if(h._hx_index==1){var d=h.failure;r=d.code}else{++o}}var v=a==1?"library":"libraries";if(r!=0){throw haxe_Exception.thrown(new tink_core_TypedError(r,"Failed to install "+(a-o)+"/"+a+" "+v+".",{fileName:"haxeshim/scope/Scope.hx",lineNumber:117,className:"haxeshim.scope.Scope",methodName:"installLibs"}))}else if(a>0){e.logger.success("Installed "+a+" "+v+".")}return null}),{fileName:"haxeshim/scope/Scope.hx",lineNumber:83,className:"haxeshim.scope.Scope",methodName:"installLibs"})},reload:function(){var e;try{e=g.readFileSync(this.configFile,{encoding:"utf8"})}catch(e){var t=haxe_Exception.caught(e).unwrap();throw haxe_Exception.thrown(this.isGlobal?"Global config file "+this.configFile+" does not exist or cannot be opened":"Unable to open file "+this.configFile+" because "+Std.string(t))}var r;try{r=JSON.parse(e)}catch(r){var t=haxe_Exception.caught(r).unwrap();new _$Sys_FileOutput(2).writeString("Invalid JSON in file "+this.configFile+":\n\n"+e+"\n\n");throw haxe_Exception.thrown(t)}this.setConfig(r)},setConfig:function(e){if(e.version==null){throw haxe_Exception.thrown("No version set in "+this.configFile)}if(e.resolveLibs==null){e.resolveLibs=this.isGlobal?"mixed":"scoped"}var t=e.resolveLibs;switch(t){case"haxelib":case"mixed":case"scoped":break;default:var r=t;throw haxe_Exception.thrown("invalid value "+r+" for `resolveLibs` in "+this.configFile)}this.config=e;this.haxeInstallation=this.getInstallation(e.version)},getVar:function(e){var t=process.env[e];if(t==null){return this.getDefault(e)}else if(t==""){return this.getDefault(e)}else{var r=t;return r}},getDefault:function(e){switch(e){case"CWD":return this.cwd;case"HAXESHIM_LIBCACHE":case"HAXE_LIBCACHE":return this.libCache;case"SCOPE_DIR":return this.scopeDir;default:return null}},delete:function(){g.unlinkSync(this.configFile)},reconfigure:function(e){var t=this;return X.next(haxeshim_sys_Fs.save(this.configFile,b.ofString(JSON.stringify(e,null," ")),{fileName:"haxeshim/scope/Scope.hx",lineNumber:201,className:"haxeshim.scope.Scope",methodName:"reconfigure"}),(function(r){t.setConfig(e);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(r)))}))},path:function(e){if(haxe_io_Path.isAbsolute(e)){return u.Some(e)}else if(StringTools.startsWith(e,"./")||StringTools.startsWith(e,"../")){return u.Some(""+this.cwd+"/"+e)}else{return u.None}},getInstallation:function(e){var t=this.haxeshimRoot;var r=this.haxelibRepo;var n=this.path(e);var i;switch(n._hx_index){case 0:var s=n.v;i=s;break;case 1:i=""+this.versionDir+"/"+e;break}return haxeshim_scope_HaxeInstallation.at({root:t,version:e,haxelibRepo:r,path:i})},resolveThroughHaxelib:function(e){if(e.length==0){return w.Success([])}else{var t=this.haxeInstallation.haxelib;var r=this.cwd;var n=[];var i=0;while(i<e.length){var s=e[i];++i;n.push(s.val)}var i=haxeshim_sys_Exec.eval(t,r,["path"].concat(n),this.haxeInstallation.env);switch(i._hx_index){case 0:var t=i.data;var a;var r=t.stderr;if(t.status==0){var l=t.stdout;return tink_core_OutcomeTools.map(haxeshim_Args.fromMultilineString(l,"haxelib path",$bind(this,this.getVar),true),(function(e){var t=0;var r=e.length;while(t<r){var n=t++;if(e[n].val=="-L"){var set=function(t,r){e[t]={pos:e[t].pos,val:r(e[t].val)}};set(n,(function(e){return"-lib"}));set(n+1,(function(e){return"ndll:"+e}))}}return e}))}else{a=new tink_core_TypedError(t.status,t.stdout+t.stderr,{fileName:"haxeshim/scope/Scope.hx",lineNumber:251,className:"haxeshim.scope.Scope",methodName:"resolveThroughHaxelib"});var o=a;var u=new haxeshim_Errors;u.fail(o.message,m.Custom("haxelib path"),o.code);return u.produce([])}break;case 1:var o=i.failure;var u=new haxeshim_Errors;u.fail(o.message,m.Custom("haxelib path"),o.code);return u.produce([])}}},interpolate:function(e,t){var r=this;var n;if(t==null){n=$bind(this,this.getVar)}else{var i=t;n=function(e){var t=i(e);if(t==null){return r.getVar(e)}else{var n=t;return n}}}return tink_core_OutcomeTools.sure(haxeshim_Args.interpolate(e,n))},parseDirectives:function(e){var t=new haxe_ds_StringMap;var r=0;var n=e.split("\n");var i=StringTools.trim;var s=new Array(n.length);var a=0;var l=n.length;while(a<l){var o=a++;s[o]=i(n[o])}var a=s;while(r<a.length){var u=a[r];++r;if(StringTools.startsWith(u,"#")){var c=StringTools.ltrim(HxOverrides.substr(u,1,null));if(StringTools.startsWith(c,"@")){var l=c.indexOf(":");if(l!=-1){var h=l;var d=c.substring(1,h);var v;var m=t.h[d];if(m==null){var p=[];t.h[d]=p;v=p}else{var _=m;v=_}v.push(this.interpolate(StringTools.ltrim(HxOverrides.substr(c,h+1,null))))}}}}return t},libHxml:function(e){return""+this.scopeLibDir+"/"+e+".hxml"},getDirectives:function(e){return X.next(haxeshim_sys_Fs.get(this.libHxml(e),{fileName:"haxeshim/scope/Scope.hx",lineNumber:289,className:"haxeshim.scope.Scope",methodName:"getDirectives"}),K.ofSafeSync($bind(this,this.parseDirectives)))},getLibCommand:function(e){var t=this;var r=[];var n=0;while(n<e.length){var i=e[n];++n;r.push(this.interpolate(i))}e=r;var s=e.shift();return X.next(this.getDirectives(s),(function(r){var n=r.h["run"];if(n==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"no @run directive found for library "+s,{fileName:"haxeshim/scope/Scope.hx",lineNumber:298,className:"haxeshim.scope.Scope",methodName:"getLibCommand"}))))}else{switch(n.length){case 0:return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"no @run directive found for library "+s,{fileName:"haxeshim/scope/Scope.hx",lineNumber:298,className:"haxeshim.scope.Scope",methodName:"getLibCommand"}))));case 1:var i=n[0];var a=[t.interpolate(i)];var l;if(haxeshim_sys_Os.IS_WINDOWS){var o=true;l=function(e){return haxe_SysTools.quoteWinArg(e,o)}}else{l=haxe_SysTools.quoteUnixArg}var u=new Array(e.length);var n=0;var c=e.length;while(n<c){var h=n++;u[h]=l(e[h])}var i=a.concat(u).join(" ");var d=haxe_io_Path.addTrailingSlash(process.cwd());var v=t.haxeInstallation.env;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success((function(){return haxeshim_sys_Exec.shell(i,d,v)}))));default:return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"more than one @run directive for library "+s,{fileName:"haxeshim/scope/Scope.hx",lineNumber:303,className:"haxeshim.scope.Scope",methodName:"getLibCommand"}))))}}}))},getInstallationInstructions:function(){var e=[];var t={install:[],postInstall:[]};if(sys_FileSystem.exists(this.scopeLibDir)){var r=0;var n=g.readdirSync(this.scopeLibDir);while(r<n.length){var i=n[r];++r;var s=""+this.scopeLibDir+"/"+i;if(!sys_FileSystem.isDirectory(s)&&StringTools.endsWith(s,".hxml")){var a=g.readFileSync(s,{encoding:"utf8"});var l;var o=haxeshim_Args.fromMultilineString(a,s,$bind(this,this.getVar));switch(o._hx_index){case 0:var u=o.data;var c=[];var h=0;while(h<u.length){var d=u[h];++h;c.push(d.val)}l=c;break;case 1:var v=o.failure;var m=v.errors;var p=v.result;var _=[];var w=0;while(w<p.length){var x=p[w];++w;_.push(x.val)}l=_;break}var b=0;var y=l.length;while(b<y)switch(l[b++]){case"--class-path":case"-cp":case"-p":var S=l[b++];if(!sys_FileSystem.exists(S)){var E=this.parseDirectives(a);var N=E.h["install"];if(N==null){e.push({lib:i,cp:S})}else if(N.length==0){e.push({lib:i,cp:S})}else{var k=N;var O=0;while(O<k.length){var R=k[O];++O;t.install.push(R)}var C=E.h["post-install"];if(C!=null){var A=C;var I=0;while(I<A.length){var F=A[I];++I;t.postInstall.push(F)}}}b=y}break;default:}}}}return{missing:e,instructions:t}},resolveArgs:function(e){var t=this.cwd;var resolvePath=function(e){if(haxe_io_Path.isAbsolute(e)){return e}else{return haxe_io_Path.join([t,e])}};t=resolvePath(e.cwd);var r=[];var n=[];var i=new haxeshim_Errors;var s=[];var a=[];var l=[];var o=0;e:while(o<e.args.length){var u=e.args[o++];switch(u.val){case"--run":l=e.args.slice(o-1);break e;case"--connect":case"--display":case"--server-connect":case"--server-listen":a.push(u);var c=e.args[o++];if(c==null){i.fail(""+u.val+" requires argument",u.pos)}else{var h=c;a.push(h)}break;case"--wait":a.push(u);break;default:s.push(u)}}var d=Object.create(null);e:while(s.length>0){var u=[s.shift()];var v=function(e){return function(t){i.fail(t,e[0].pos)}}(u);var c=u[0].val;switch(c){case"--connect":case"--cwd":case"--each":case"--next":case"--run":case"--wait":case"-C":var m=c;if(StringTools.endsWith(m,".hxml")){s=haxeshim_Args.readHxml(resolvePath(m),haxeshim_scope_Scope.fs,$bind(this,this.getVar),i,u[0].pos).concat(s)}else{var p=c;v(""+p+" not allowed here");break e}break;case"--lib":case"-L":case"-lib":var _=s.shift();var g;if(_==null){v("-lib requires argument")}else{g=haxeshim_Args.getNdll(_.val);if(g._hx_index==0){var w=g.v;var h=_;r.push(u[0]);r.push(h)}else{var x=_;if(!d[x.val]){d[x.val]=true;var b=this.config.resolveLibs;var y;if(b=="haxelib"){n.push(x)}else{y=b=="mixed";var S=y;var E=this.libHxml(x.val);var N=haxeshim_scope_Scope.fs.readFile(E);switch(N._hx_index){case 0:var k=N.data;s=i.getResult(haxeshim_Args.fromMultilineString(k,E,$bind(this,this.getVar))).concat(s);break;case 1:var O=N.failure;if(sys_FileSystem.exists(E)){v(O)}else if(S){n.push(x)}else{v("-lib "+x.val+" is missing "+E)}break}}}}}break;default:var R=c;if(StringTools.endsWith(R,".hxml")){s=haxeshim_Args.readHxml(resolvePath(R),haxeshim_scope_Scope.fs,$bind(this,this.getVar),i,u[0].pos).concat(s)}else{r.push(u[0])}}}r=a.concat(r).concat(i.getResult(this.resolveThroughHaxelib(n))).concat(l);return i.produce(new haxeshim_scope_ResolvedArgs(t,r))},getBuilds:function(e){var t=new haxeshim_Errors;var r=[];var n=0;var i=t.getResult(haxeshim_Args.split(e,this.cwd,haxeshim_scope_Scope.fs,$bind(this,this.getVar)));while(n<i.length){var s=i[n];++n;if(s.args.length>0){r.push(this.resolveArgs(s))}}return t.produce(r)},resolve:function(e){var t=[];var r=new haxeshim_Errors;var n=0;var i=r.getResult(haxeshim_Args.split(e,this.cwd,haxeshim_scope_Scope.fs,$bind(this,this.getVar)));while(n<i.length){var s=i[n];++n;if(s.args.length>0){if(t.length!=0){t.push("--next")}if(s.cwd!=this.cwd){t.push("--cwd");t.push(s.cwd)}var a=0;var l=r.getResult(this.resolveArgs(s)).args;while(a<l.length){var o=l[a];++a;t.push(o.val)}}}var n=r.produce(42);if(n._hx_index==1){var u;u=n.failure.errors[0];var c=u;var h=c.message;process.stdout.write(Std.string(h));process.stdout.write("\n");var d;var n=c.code;if(n==null){d=500}else{var h=n;d=h}process.exit(d)}return t},__class__:haxeshim_scope_Scope};var haxeshim_scope_ResolvedArgs=function(e,t){haxeshim_Args.call(this,e,t)};t["haxeshim.scope.ResolvedArgs"]=haxeshim_scope_ResolvedArgs;haxeshim_scope_ResolvedArgs.__name__="haxeshim.scope.ResolvedArgs";haxeshim_scope_ResolvedArgs.__super__=haxeshim_Args;haxeshim_scope_ResolvedArgs.prototype=$extend(haxeshim_Args.prototype,{resolve:function(e){if(haxe_io_Path.isAbsolute(e)){return e}else{return haxe_io_Path.join([this.cwd,e])}},checkClassPaths:function(){var e=new haxeshim_Errors;var t=0;var r=this.args.length;while(t<r){var n=t++;switch(this.args[n].val){case"--class-path":case"-cp":case"-p":if(n+1<this.args.length){var i=this.args[n+1];try{g.readdirSync(this.resolve(i.val))}catch(t){e.fail("classpath "+i.val+" is not a directory or cannot be read from",i.pos)}}break;default:}}return e.produce(null)},__class__:haxeshim_scope_ResolvedArgs});var x={};x.ofObj=function(e){return x.ofVars(e)};x.ofVars=function(e){var t={};var r=0;var n=Reflect.fields(e);while(r<n.length){var i=n[r];++r;t[haxeshim_sys_Os.IS_WINDOWS?i.toUpperCase():i]=e[i]}return t};x.ofMap=function(e){var t={};var r=e.h;var n=r;var i=Object.keys(r);var s=i.length;var a=0;while(a<s){var l=i[a++];t[haxeshim_sys_Os.IS_WINDOWS?l.toUpperCase():l]=e.h[l]}return t};x.vars=function(e){return e};x.toVars=function(e){return Reflect.copy(e)};x.mergeInto=function(e,t){var r=x.vars(t);if(e==null){var n=r;return n}else if(r==null){var n=e;return n}else{var i=e;var s=r;var a={};var l=s;var r=0;var o=Reflect.fields(l);while(r<o.length){var u=o[r];++r;a[u]=l[u]}var l=i;var r=0;var o=Reflect.fields(l);while(r<o.length){var u=o[r];++r;a[u]=l[u]}return a}};var haxeshim_sys_Exec=function(){};t["haxeshim.sys.Exec"]=haxeshim_sys_Exec;haxeshim_sys_Exec.__name__="haxeshim.sys.Exec";haxeshim_sys_Exec.die=function(e,t){if(t!=null){haxeshim_Logger.get().error(t)}process.exit(e);throw haxe_Exception.thrown("unreachable")};haxeshim_sys_Exec.dieFromErrors=function(e){var t=null;var r=haxeshim_Logger.get();var n=0;var i=e;while(n<i.length){var s=i[n];++n;r.error(haxeshim_PosTools.toString(s.pos)+(": "+s.message))}var t=haxeshim_Errors.getCode(e);process.exit(t);throw haxe_Exception.thrown("unreachable")};haxeshim_sys_Exec.gracefully=function(e){try{return e()}catch(e){var t=haxe_Exception.caught(e).unwrap();if(t instanceof tink_core_TypedError){var r=t;return haxeshim_sys_Exec.die(r.code,r.message)}else{var r=t;return haxeshim_sys_Exec.die(500,Std.string(r))}}};haxeshim_sys_Exec.mergeEnv=function(e){return x.mergeInto(e,x.ofVars(process.env))};haxeshim_sys_Exec.async=function(e,t,r,n){return a.spawn(e,r,{cwd:t,stdio:"inherit",env:x.toVars(haxeshim_sys_Exec.mergeEnv(n))})};haxeshim_sys_Exec.shell=function(e,t,r){try{return w.Success(a.execSync(e,{cwd:t,stdio:"inherit",env:x.toVars(haxeshim_sys_Exec.mergeEnv(r))}))}catch(t){var n=haxe_Exception.caught(t).unwrap();return w.Failure(new tink_core_TypedError(n.status,"Failed to invoke `"+e+"` because "+Std.string(n),{fileName:"haxeshim/sys/Exec.hx",lineNumber:47,className:"haxeshim.sys.Exec",methodName:"shell"}))}};haxeshim_sys_Exec.sync=function(e,t,r,n){var i=a.spawnSync(e,r,{cwd:t,stdio:"inherit",env:x.toVars(haxeshim_sys_Exec.mergeEnv(n))});var s=i.error;var l=i.output;var l=i.pid;var l=i.signal;var l=i.status;var o=i.stderr;var o=i.stdout;if(s==null){var u=l;return w.Success(u)}else{var c=s;var u=l;return w.Failure(new tink_core_TypedError(u,"Failed to call "+e+" because "+Std.string(c),{fileName:"haxeshim/sys/Exec.hx",lineNumber:54,className:"haxeshim.sys.Exec",methodName:"sync"}))}};haxeshim_sys_Exec.eval=function(e,t,r,n){var i=a.spawnSync(e,r,{cwd:t,env:x.toVars(haxeshim_sys_Exec.mergeEnv(n))});var s=i;if(s.error==null){return w.Success({status:s.status,stdout:s.stdout.toString(),stderr:s.stderr.toString()})}else{var l=i.output;var l=i.pid;var l=i.signal;var l=i.status;var l=i.stderr;var l=i.stdout;var o=i.error;return w.Failure(new tink_core_TypedError(null,"Failed to call "+e+" because "+Std.string(o),{fileName:"haxeshim/sys/Exec.hx",lineNumber:66,className:"haxeshim.sys.Exec",methodName:"eval"}))}};var b={};b.ofString=function(e){return haxe_io_Bytes.ofString(e)};var haxeshim_sys_Fs=function(){};t["haxeshim.sys.Fs"]=haxeshim_sys_Fs;haxeshim_sys_Fs.__name__="haxeshim.sys.Fs";haxeshim_sys_Fs.get=function(e,t){var r=e;return haxeshim_Attempt.to("get content of "+e,(function(){return g.readFileSync(r,{encoding:"utf8"})}),t)};haxeshim_sys_Fs.save=function(e,t,r){return X.noise(X.next(haxeshim_sys_Fs.ensureDir(e),(function(n){var i=e;var _g=function(e){var t=e.b;g.writeFileSync(i,O.from(t.buffer,t.byteOffset,e.length))};var s=t;var tmp=function(){_g(s)};return haxeshim_Attempt.to("save to "+e,tmp,r)})))};haxeshim_sys_Fs.exists=function(e){var t=e;return haxeshim_Attempt.to("check the existence of "+e,(function(){return sys_FileSystem.exists(t)}),{fileName:"haxeshim/sys/Fs.hx",lineNumber:23,className:"haxeshim.sys.Fs",methodName:"exists"})};haxeshim_sys_Fs.ensureDir=function(e){var t=StringTools.endsWith(e,"/")||StringTools.endsWith(e,"\\");if(t){e=haxe_io_Path.removeTrailingSlashes(e)}var r=haxe_io_Path.directory(e);if(haxe_io_Path.removeTrailingSlashes(r)==e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return X.next(X.next(haxeshim_sys_Fs.exists(r),(function(e){if(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return haxeshim_sys_Fs.ensureDir(haxe_io_Path.addTrailingSlash(r))}})),(function(r){if(t){return X.next(haxeshim_sys_Fs.exists(e),(function(t){return haxeshim_Attempt.to("create directory "+e,(function(){if(!t){sys_FileSystem.createDirectory(e)}return null}),{fileName:"haxeshim/sys/Fs.hx",lineNumber:46,className:"haxeshim.sys.Fs",methodName:"ensureDir"})}))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}}))}};haxeshim_sys_Fs.isDirectory=function(e){var t=e;return haxeshim_Attempt.to("check if "+e+" is a directory",(function(){return sys_FileSystem.isDirectory(t)}),{fileName:"haxeshim/sys/Fs.hx",lineNumber:57,className:"haxeshim.sys.Fs",methodName:"isDirectory"})};haxeshim_sys_Fs.move=function(e,t){return X.noise(X.next(haxeshim_sys_Fs.ensureDir(t),(function(r){var n=e;var _g=function(e){g.renameSync(n,e)};var i=t;var tmp=function(){_g(i)};return haxeshim_Attempt.to("move "+e+" to "+t,tmp,{fileName:"haxeshim/sys/Fs.hx",lineNumber:64,className:"haxeshim.sys.Fs",methodName:"move"})})))};haxeshim_sys_Fs.copy=function(e,t,r,n){var i=null;i=function(e,t,s){if(r==null||r(e)){return X.next(haxeshim_sys_Fs.isDirectory(e),(function(r){if(r){return X.next(haxeshim_sys_Fs.ensureDir(haxe_io_Path.addTrailingSlash(t)),(function(r){var n=[];var s=0;var a=g.readdirSync(e);while(s<a.length){var l=a[s];++s;n.push(i(""+e+"/"+l,""+t+"/"+l,false))}return X.noise(X.inParallel(n))}))}else{return X.next(X.next(s?haxeshim_sys_Fs.ensureDir(t):X.NOISE,(function(r){if(n==null||n({src:e,dest:t})){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(false)))}else{return haxeshim_sys_Fs.exists(t)}})),(function(r){if(r){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{var n=e;var i=t;var copy=function(){sys_io_File.copy(n,i)};return X.noise(haxeshim_Attempt.to("copy "+e+" to "+t,copy,{fileName:"haxeshim/sys/Fs.hx",lineNumber:89,className:"haxeshim.sys.Fs",methodName:"copy"}))}}))}}))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}};return i(e,t,true)};haxeshim_sys_Fs.ls=function(e,t){var r=[];var n=0;var i=g.readdirSync(e);while(n<i.length){var s=i[n];++n;var a=""+e+"/"+s;var l;if(t==null||t(a)){l=a}else{continue}r.push(l)}return r};haxeshim_sys_Fs.delete=function(e){return haxeshim_Attempt.to("delete "+e,(function(){if(e!=null&&sys_FileSystem.exists(e)){if(sys_FileSystem.isDirectory(e)){var t=0;var r=g.readdirSync(e);while(t<r.length){var n=r[t];++t;haxeshim_sys_Fs.delete(""+e+"/"+n)}if(sys_FileSystem.exists(e)){var t=0;var r=g.readdirSync(e);while(t<r.length){var n=r[t];++t;var i=e+"/"+n;if(sys_FileSystem.isDirectory(i)){if(sys_FileSystem.exists(i)){var s=0;var a=g.readdirSync(i);while(s<a.length){var l=a[s];++s;var o=i+"/"+l;if(sys_FileSystem.isDirectory(o)){sys_FileSystem.deleteDirectory(o)}else{g.unlinkSync(o)}}g.rmdirSync(i)}}else{g.unlinkSync(i)}}g.rmdirSync(e)}}else{g.unlinkSync(e)}}}),{fileName:"haxeshim/sys/Fs.hx",lineNumber:104,className:"haxeshim.sys.Fs",methodName:"delete"})};haxeshim_sys_Fs.peel=function(e,t){var r=0;var n=0;var i=t;while(n<i){var s=n++;var a=e.indexOf("/",r);if(a==-1){return u.None}else{var l=a;r=l+1}}return u.Some(HxOverrides.substr(e,r,null))};haxeshim_sys_Fs.findNearest=function(e,t){while(true)if(sys_FileSystem.exists(""+t+"/"+e)){return u.Some(""+t+"/"+e)}else{var r=haxe_io_Path.directory(t);var n=r;if(t==n){return u.None}else{var i=r;t=i}}};var y={};y.detect=function(e){var t=e;if(t.length>=5&&t.b[0]==127&&t.b[1]==69&&t.b[2]==76&&t.b[3]==70){var r=t.b[4];var n=t.b[18]|t.b[19]<<8;switch(n){case 3:if(r==1){return"linux32"}else{return"linux64"}break;case 40:return"linux-arm";case 62:return"linux64";case 183:return"linux-arm64";case 243:return"linux-riscv";default:if(r==1){return"linux32"}else{return"linux64"}}}if(t.length>=64){var i=t.getInt32(60);if(t.b[i++]==80&&t.b[i++]==69&&t.b[i++]==0&&t.b[i++]==0){var s=t.b[i++]|t.b[i++]<<8;switch(s){case 332:return"win32";case 34404:return"win64";default:return"unknown"}}}if(t.length>=4){var a=t.b[0]<<24|t.b[1]<<16|t.b[2]<<8|t.b[3];if(a==-17958193||a==-805638658){switch(t.b[4]<<24|t.b[5]<<16|t.b[6]<<8|t.b[7]){case 16777223:return"mac64";case 16777228:return"mac-arm";default:return"mac64"}}if(a==-17958194||a==-822415874){return"mac64"}if(a==-889275714||a==-1095041334){return"mac-universal"}}return"unknown"};var js_lib__$ArrayBuffer_ArrayBufferCompat=function(){};t["js.lib._ArrayBuffer.ArrayBufferCompat"]=js_lib__$ArrayBuffer_ArrayBufferCompat;js_lib__$ArrayBuffer_ArrayBufferCompat.__name__="js.lib._ArrayBuffer.ArrayBufferCompat";js_lib__$ArrayBuffer_ArrayBufferCompat.sliceImpl=function(e,t){var r=new Uint8Array(this,e,t==null?null:t-e);var n=new Uint8Array(r.byteLength);n.set(r);return n.buffer};var S=r(3685);var E=r(5687);var N=r(1808);var k=r(1017);var O=r(4300).Buffer;var js_node_buffer__$Buffer_Helper=function(){};t["js.node.buffer._Buffer.Helper"]=js_node_buffer__$Buffer_Helper;js_node_buffer__$Buffer_Helper.__name__="js.node.buffer._Buffer.Helper";js_node_buffer__$Buffer_Helper.bytesOfBuffer=function(e){var t=Object.create(haxe_io_Bytes.prototype);t.length=e.byteLength;t.b=e;e.bufferValue=e;e.hxBytes=t;e.bytes=e;return t};var R=r(2781).PassThrough;var C=r(7310).URL;var lix_cli_Cli=function(){};t["lix.cli.Cli"]=lix_cli_Cli;lix_cli_Cli.__name__="lix.cli.Cli";lix_cli_Cli.main=function(){var e=lix_cli_HaxeCmd.ensureScope();var t=process.argv.slice(2);lix_cli_Command.attempt(e,(function(){lix_cli_Cli.dispatch(t)}))};lix_cli_Cli.dispatch=function(e){var t="haxe";var r="lix";var n="lix - Libraries for Haxe";var i="git+https://github.com/lix-pm/lix.git";var s="git";var a="https://github.com/lix-pm/lix#readme";var l={"@vercel/ncc":"^0.38.1",yauzl:"github:lix-pm/yauzl",tar:"^6.0.1","graceful-fs":"^4.1.15"};var o="bin";var c="16.0.1";var h="back2dos";var d="node bin/postinstall.js";var v="ncc";var m="haxe --run Build";var p="MIT";var _="https://github.com/lix-pm/lix/issues";var x="bin/haxeshim.js";var y="bin/lix.js";var S="bin/haxelibshim.js";var E="bin/nekoshim.js";var N=c;var k=HxOverrides.remove(e,"--silent");var O=HxOverrides.remove(e,"--force");var R=HxOverrides.remove(e,"--global")||HxOverrides.remove(e,"-g");var C=HxOverrides.remove(e,"--flat");var F=haxeshim_scope_Scope.seek({cwd:R?haxeshim_scope_Scope.DEFAULT_ROOT:null});e=lix_cli_Command.expand(e,[A.ofString("+tink install github:haxetink/tink_${0}"),A.ofString("+coco install github:MVCoconut/coconut.${0}"),A.ofString("+lib install haxelib:${0}")]);var grab=function(t){var r=e.indexOf(t);if(r==-1){return null}else{var n=r;return e.splice(n,2)[1]}};var L=new lix_client_sources_GitLab(grab("--gl-private-token"));var D=grab("--gh-credentials");var T;var B;if(D==null){B=null}else{T=D.split(":");if(T.length==2){var P=T[0];var M=T[1];B=""+P+":"+M}else{var z=D;B=haxeshim_sys_Exec.die(422,"`--gh-credentials "+z+"` should be `--gh-credentials <user>:<token>`")}}var U=new lix_client_sources_GitHub(B);var W=ne._new(grab("--haxelib-url"));var V=new lix_client_sources_Web([$bind(L,L.intercept),$bind(U,U.intercept)]);var $=[V,new lix_client_sources_Haxelib(W),U,L,new lix_client_sources_Git(F)];var q=Object.create(null);var D=0;while(D<$.length){var Z=$[D];++D;var K=0;var J=Z.schemes();while(K<J.length){var Q=J[K];++K;q[Q]=Z}}var resolve=function(e){var t=q[e.scheme];if(t==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Unknown scheme in url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/cli/Cli.hx",lineNumber:52,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{var r=t;return r.processUrl(e)}};var ee=haxeshim_Logger.get(k);var te=new lix_client_haxe_Switcher(F,ee);var re=new lix_client_Libraries(F,resolve,(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(501,"not implemented",{fileName:"src/lix/cli/Cli.hx",lineNumber:63,className:"lix.cli.Cli",methodName:"dispatch"}))))}),ee,O);lix_cli_Command.dispatch(e,"lix - Libraries for Haxe (v"+N+")",[new lix_cli_Command(I.ofString("install"),"<url> [as <lib[#ver]>]","install lib from specified url",(function(e){if(F.isGlobal&&!R){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Current scope is global. Please use --global if you intend to install globally, or create a local scope with `lix scope create`.",{fileName:"src/lix/cli/Cli.hx",lineNumber:73,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{switch(e.length){case 0:return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Missing url",{fileName:"src/lix/cli/Cli.hx",lineNumber:84,className:"lix.cli.Cli",methodName:"dispatch"}))));case 1:var t=e[0];var r=t;if(G.fromString(r).scheme==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Did you mean `lix install haxelib:"+r+"`?",{fileName:"src/lix/cli/Cli.hx",lineNumber:81,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{var n=t;return re.installUrl(G.fromString(n),null,{flat:C})}break;case 2:var t=e[0];if(t=="haxe"){var i=e[1];return te.install(i,{force:O})}else{var r=t;if(G.fromString(r).scheme==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Did you mean `lix install haxelib:"+r+"`?",{fileName:"src/lix/cli/Cli.hx",lineNumber:81,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{var s=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:85,className:"lix.cli.Cli",methodName:"dispatch"}))))}}break;case 3:if(e[1]=="as"){var n=e[0];var a=e[2];return re.installUrl(G.fromString(n),lix_client_LibVersion.parse(a),{flat:C})}else{var s=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:85,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;default:var s=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:85,className:"lix.cli.Cli",methodName:"dispatch"}))))}}})),new lix_cli_Command(I.ofString("install haxe"),"<version>|<alias>","install specified haxe version",null),new lix_cli_Command(I.ofString("use"),"haxe <version>|<alias>","use specified haxe version",(function(e){if(e.length==2){if(e[0]=="haxe"){var t=e[1];return X.next(te.resolveInstalled(j.ofString(t)),$bind(te,te.switchTo))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:91,className:"lix.cli.Cli",methodName:"dispatch"}))))}}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:91,className:"lix.cli.Cli",methodName:"dispatch"}))))}})),new lix_cli_Command(I.ofString("dev"),"<lib> <path>","use dev version of library",(function(e){if(e.length==2){var t=e[0];var r=e[1];return re.dev(t,r)}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:95,className:"lix.cli.Cli",methodName:"dispatch"}))))}})),new lix_cli_Command(I.ofString("download haxe"),"<version>|<alias>","download specified haxe version",null),new lix_cli_Command(I.ofString("scope"),"[create|delete]","creates or deletes the current scope or\ninspects it if no argument is supplied",(function(e){switch(e.length){case 0:ee.info((F.isGlobal?"[global]":"[local]")+(" "+F.scopeDir));return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)));case 1:switch(e[0]){case"create":return X.next(haxeshim_scope_Scope.create(F.cwd,{version:F.config.version,resolveLibs:F.isGlobal?"scoped":F.config.resolveLibs}),(function(e){ee.success("created scope in "+F.cwd);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}));case"delete":if(F.isGlobal){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Cannot delete global scope",{fileName:"src/lix/cli/Cli.hx",lineNumber:110,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{F.delete();ee.success("deleted scope in "+F.scopeDir);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}break;default:var t=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Invalid arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:122,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;default:var t=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Invalid arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:122,className:"lix.cli.Cli",methodName:"dispatch"}))))}})),new lix_cli_Command(I.ofString("haxe-versions"),"","lists currently downloaded versions",(function(e){if(e.length==0){return X.next(te.officialInstalled(H.IncludePrereleases),(function(e){return X.next(te.nightliesInstalled(),(function(t){var highlight=function(e){if(e==F.config.version){return" -> "+e}else{return" "+e}};process.stdout.write("");process.stdout.write("\n");process.stdout.write("Official releases:");process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var r=$getIterator(e);while(r.hasNext()){var n=r.next();var i=highlight(n);process.stdout.write(Std.string(i));process.stdout.write("\n")}if($getIterator(t).hasNext()){process.stdout.write("");process.stdout.write("\n");process.stdout.write("Nightly builds:");process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var r=$getIterator(t);while(r.hasNext()){var n=r.next();var i=highlight(n.hash)+DateTools.format(n.published," (%Y-%m-%d %H:%M)");process.stdout.write(Std.string(i));process.stdout.write("\n")}}process.stdout.write("");process.stdout.write("\n");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}))}))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"command `list` does expect arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:159,className:"lix.cli.Cli",methodName:"dispatch"}))))}})),new lix_cli_Command(I.ofString("download"),"[<url[#lib[#ver]]>]","download lib from url if specified,\notherwise download missing libs",(function(e){switch(e.length){case 0:return X.next(lix_client_haxe_Switcher.ensureNeko(F.haxeInstallation.neko,ee),(function(e){var t=te.resolveOnline(j.ofString(F.config.version));var r=te;var n={force:false};return X.next(X.next(t,(function(e){return r.download(e,n)})),(function(e){new haxeshim_cli_HaxeCli(F).installLibs(k);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}))}));case 1:var t=G.fromString(e[0]);return X.noise(re.downloadUrl(t));case 2:if(e[0]=="haxe"){var r=e[1];return X.noise(te.resolveAndDownload(r,{force:O}))}else{var n=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:205,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;case 3:var i=e[0];var s=e[2];switch(e[1]){case"as":var t=i;var a=s;var l=StringTools.replace(a,"#","/");var o=F.libCache+("/"+l);var shorten=function(e){if(e.length>40){return HxOverrides.substr(e,0,37)+"..."}else{return e}};if(sys_FileSystem.exists(o)){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"`download <url> as <ver>` is no longer supported",{fileName:"src/lix/cli/Cli.hx",lineNumber:175,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{var u=ee;var c=shorten;var h=new Array(e.length);var d=0;var v=e.length;while(d<v){var m=d++;h[m]=c(e[m])}u.warning("Warning: Processing obsolete `download "+h.join(" ")+"`.\n Please reinstall library in a timely manner!\n\n");return X.noise(X.next(X.next(re.downloadUrl(G.fromString(t),{into:l}),(function(e){var t=e;return X.next(haxeshim_sys_Fs.ensureDir(o),(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t)))}))})),(function(e){g.renameSync(lix_client_DownloadedArchive.getAbsRoot(e.storageRoot,e.relRoot),o);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e)))})))}break;case"into":var t=i;var p=s;return X.noise(re.downloadUrl(G.fromString(t),{into:p}));default:var n=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:205,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;default:var n=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:205,className:"lix.cli.Cli",methodName:"dispatch"}))))}})),new lix_cli_Command(I.ofString("run"),"lib ...args","run a library",(function(e){if(e.length==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"no library specified",{fileName:"src/lix/cli/Cli.hx",lineNumber:209,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{var t=e;return X.noise(X.next(F.getLibCommand(t),(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(e()))})))}})),new lix_cli_Command(["--version","-v"],"","print version",(function(e){if(e.length>0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:215,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{process.stdout.write(Std.string(N));process.stdout.write("\n");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}})),new lix_cli_Command(I.ofString("run-haxelib"),"path ...args","invoke a haxelib at a given path following haxelib's conventions",(function(e){if(e.length==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"no path supplied",{fileName:"src/lix/cli/Cli.hx",lineNumber:223,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{new haxeshim_cli_HaxelibCli(F).run(e.slice(1));return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}}))],[],(function(e){var t=e[0];var r;if(t==null){return u.None}else{switch(t){case"--library":case"--run":case"-L":case"-lib":return u.Some((function(){new haxeshim_cli_HaxeCli(F).dispatch(e);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}));default:r=StringTools.endsWith(t,".hxml");if(r==true){return u.Some((function(){new haxeshim_cli_HaxeCli(F).dispatch(e);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}))}else{var n=t;if(sys_FileSystem.exists(F.libHxml(n))){return u.Some((function(){new haxeshim_cli_HaxelibCli(F).run(e);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}))}else{var i=t;if(lix_cli_Cli.isClassName(i)){return u.Some((function(){var absolute=function(e){return haxe_io_Path.join([F.scopeDir,e])};var f=function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst({classPath:"",name:haxe_io_Path.withoutDirectory(haxe_io_Path.removeTrailingSlashes(F.scopeDir)),dependencies:{}}))};return Y.flatMap(Y.flatMap(X.next(haxeshim_sys_Fs.get(absolute("haxelib.json"),{fileName:"src/lix/cli/Cli.hx",lineNumber:247,className:"lix.cli.Cli",methodName:"dispatch"}),(function(e){var t=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(tink_core_TypedError.catchExceptions((function(){return JSON.parse(t)}),null,{fileName:"src/lix/cli/Cli.hx",lineNumber:248,className:"lix.cli.Cli",methodName:"dispatch"})))})),(function(e){switch(e._hx_index){case 0:var t=e.data;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(t));case 1:var r=e.failure;return f(r)}})),(function(t){var r=StringTools.replace(i,".","/")+".hx";var n=[{file:r,args:["-cp",absolute("")]},{file:"scripts/"+r,args:["-cp",absolute("scripts")]}];var s=t.classPath;if(s!=null){if(s!=""){var a=s;var l=""+a+"/"+r;var o;if(sys_FileSystem.exists(F.libHxml(t.name))){o=["-lib",t.name]}else{var u=[];var s=t.dependencies;if(s!=null){var c=s;var h=c;var d=h;var v=Reflect.fields(h);var m=0;while(m<v.length){var p=v[m++];var _=d[p];var g=p;var x=g;var y=_;u.push("-lib");u.push(x)}}o=u.concat(["-cp",absolute(a)])}n.push({file:l,args:o})}}var s=0;while(s<n.length){var S=[n[s]];++s;var E=haxe_io_Path.join([F.scopeDir,S[0].file]);if(sys_FileSystem.exists(E)!=false){var N=[E];return X.next(haxeshim_sys_Fs.get(N[0],{fileName:"src/lix/cli/Cli.hx",lineNumber:290,className:"lix.cli.Cli",methodName:"dispatch"}),function(t,r){return function(n){var s=[];var a=n.split("\n");var l=0;if(StringTools.startsWith(a[0],"#!")){++l}while(true){var o=StringTools.trim(a[l++]);if(o!=""){var n=o;if(StringTools.startsWith(n,"//!")){var u=0;var c=HxOverrides.substr(n,3,null).split(" ");while(u<c.length){var h=c[u];++u;var d=StringTools.trim(h);if(d!=""){var v=d;s.push(v)}}}else{break}}}s=s.concat(r[0].args);var m=e.slice(1);var o=F.getBuilds(s);switch(o._hx_index){case 0:var u=o.data;if(u.length==1){var c=u[0];switch(c._hx_index){case 0:var u=c.data;var p=u.checkClassPaths();if(p._hx_index==1){var d=p.failure;var _=d.result;var g=d.errors;var x=g[0];return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(x.code,haxeshim_PosTools.toString(x.pos)+": "+x.message,{fileName:"src/lix/cli/Cli.hx",lineNumber:320,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{var y=u.cwd;var S=u.args;var u=[];var d=0;var _=S;while(d<_.length){var E=_[d];++d;u.push(E.val)}var S=u;var N=null;var u=0;var d=S.length-1;e:while(u<d){var k=u++;switch(S[k]){case"--define":case"-D":var _=S[k+1];var p;if(_=="hxnodejs"){var O=S.indexOf("-js");if(O==-1){var R=haxe_io_Path.withExtension(haxe_io_Path.withoutExtension(t[0]),"js");S=S.concat(["-js",R]);N=R}else{var h=O;N=S[h+1]}break e}else{p=StringTools.startsWith(_,"hxnodejs=");if(p==true){var C=S.indexOf("-js");if(C==-1){var A=haxe_io_Path.withExtension(haxe_io_Path.withoutExtension(t[0]),"js");S=S.concat(["-js",A]);N=A}else{var v=C;N=S[v+1]}break e}}break;default:}}S=S.concat(N==null?["--run",i].concat(m):["-main",i]);var u=haxeshim_sys_Exec.sync(F.haxeInstallation.compiler,y,S,F.haxeInstallation.env);switch(u._hx_index){case 0:var d=u.data;if(d==0){if(N==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return X.next(X.next(haxeshim_sys_Fs.get(N,{fileName:"src/lix/cli/Cli.hx",lineNumber:354,className:"lix.cli.Cli",methodName:"dispatch"}),function(){return function(e){return haxeshim_sys_Fs.save(N,b.ofString(['try { require("fs").unlinkSync(__filename); } catch (e) {}',e].join("\n")),{fileName:"src/lix/cli/Cli.hx",lineNumber:356,className:"lix.cli.Cli",methodName:"dispatch"})}}()),function(){return function(e){var t=haxeshim_sys_Exec.sync("node",y,[N].concat(m));switch(t._hx_index){case 0:var r=t.data;if(r==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{var n=r;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(n,"node exited with code "+n,{fileName:"src/lix/cli/Cli.hx",lineNumber:364,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;case 1:var i=t.failure;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(i)))}}}())}}else{var h=d;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(h,"haxe exited with code "+h,{fileName:"src/lix/cli/Cli.hx",lineNumber:369,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;case 1:var x=u.failure;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(x)))}}break;case 1:var u=c.failure;var c=u.result;var g=u.errors;var x=g[0];return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(x.code,haxeshim_PosTools.toString(x.pos)+": "+x.message,{fileName:"src/lix/cli/Cli.hx",lineNumber:320,className:"lix.cli.Cli",methodName:"dispatch"}))))}}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"multiple builds defined",{fileName:"src/lix/cli/Cli.hx",lineNumber:373,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;case 1:var u=o.failure;var o=u.result;var g=u.errors;var x=g[0];return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(x.code,haxeshim_PosTools.toString(x.pos)+": "+x.message,{fileName:"src/lix/cli/Cli.hx",lineNumber:320,className:"lix.cli.Cli",methodName:"dispatch"}))))}}}(N,S))}}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(404,"Class not found: "+i,{fileName:"src/lix/cli/Cli.hx",lineNumber:380,className:"lix.cli.Cli",methodName:"dispatch"}))))}))}))}else{return u.None}}}}}})).handle(lix_cli_Command.reportOutcome)};lix_cli_Cli.isClassName=function(e){var t=HxOverrides.cca(e.split(".").pop(),0);if(t>=65){return t<=90}else{return false}};var A={};A.ofString=function(e){var t=e.indexOf(" ");if(t==-1){throw haxe_Exception.thrown('invalid expander syntax in "'+e+'"')}else{var r=t;return A.make(HxOverrides.substr(e,0,r),HxOverrides.substr(e,r+1,null))}};A.make=function(e,t){var r=new EReg("\\$\\{([0-9]+)\\}","g");var n=[];var i=-1;r.map(t,(function(e){n.pop();var t=e.matchedLeft();var r=e.matchedRight();n.push((function(e){return t}));var s=Std.parseInt(e.matched(1));if(s>i){i=s}n.push((function(e){return e[s]}));n.push((function(e){return r}));return""}));var apply=function(e){var t=[];var r=0;var i=[];var s=0;while(s<n.length){var a=n[s];++s;i.push(a(e))}var s=i.join("").split(" ");while(r<s.length){var l=s[r];++r;var i=StringTools.trim(l);var o;if(i==""){continue}else{var u=i;o=u}t.push(o)}return t};return function(t){var r=0;var n=t.length;while(r<n){var s=r++;if(t[s]==e){return u.Some(t.slice(0,s).concat(apply(t.slice(s+1,s+i+2))).concat(t.slice(s+i+2)))}}return u.None}};var I={};I.ofString=function(e){return[e]};I.toString=function(e){if(e.length==1){var t=e[0];return t}else{var r=e;return r.join(" / ")}};I.eq=function(e,t){return e.indexOf(t)!=-1};var lix_cli_Command=function(e,t,r,n){this.name=e;this.args=t;this.doc=r;this.exec=n};t["lix.cli.Command"]=lix_cli_Command;lix_cli_Command.__name__="lix.cli.Command";lix_cli_Command.attempt=function(e,t){var r=J.ofSync(lix_cli_Command.reportError);Y.flatMap(e,(function(e){switch(e._hx_index){case 0:var t=e.data;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(t));case 1:var n=e.failure;return r(n)}})).handle(t)};lix_cli_Command.reportError=function(e){haxeshim_Logger.get().error(e.message);var t=e.code;process.exit(t);return null};lix_cli_Command.reportOutcome=function(e){if(e._hx_index==1){var t=e.failure;lix_cli_Command.reportError(t)}};lix_cli_Command.expand=function(e,t){var r=true;while(r){r=false;var n=0;while(n<t.length){var i=t[n];++n;var s=i(e);if(s._hx_index==0){var a=s.v;e=a;r=true}}}return e};lix_cli_Command.dispatch=function(e,t,r,n,i){var s=e.shift();if(s==null){process.stdout.write(Std.string(t));process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var a=0;var l=0;while(l<r.length){var o=r[l];++l;var u=0;var c=0;var h=o.args.split("\n");while(c<h.length){var d=h[c];++c;if(d.length>u){u=d.length}}var v=u;var m=I.toString(o.name).length+v;if(m>a){a=m}}a+=7;var pad=function(e){return StringTools.lpad(e," ",a)};process.stdout.write(" Supported commands:");process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var l=0;while(l<r.length){var o=r[l];++l;var p=o.args.split("\n");var _=o.name==null?"null":I.toString(o.name);var c=p[0];var g;if(c==null){g=""}else if(c==""){g=""}else{var u=c;g=" "+u}p[0]=" "+_+g+" : ";var h=1;var x=p.length;while(h<x){var b=h++;p[b]+=" "}var y=o.doc.split("\n");while(p.length<y.length)p.push("");while(p.length>y.length)y.push("");var S=0;var E=p.length;while(S<E){var N=S++;var k=pad(p[N])+y[N];process.stdout.write(Std.string(k));process.stdout.write("\n")}}var l=0;while(l<n.length){var O=n[l];++l;process.stdout.write("");process.stdout.write("\n");var u=" "+O.name;process.stdout.write(Std.string(u));process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var c=0;var h=O.value;while(c<h.length){var R=h[c];++c;var k=pad(""+R.name+" : ")+R.value;process.stdout.write(Std.string(k));process.stdout.write("\n")}}process.stdout.write("");process.stdout.write("\n");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{switch(s){case"--help":case"-help":case"/?":case"?":case"help":process.stdout.write(Std.string(t));process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var C=0;var l=0;while(l<r.length){var o=r[l];++l;var u=0;var c=0;var h=o.args.split("\n");while(c<h.length){var d=h[c];++c;if(d.length>u){u=d.length}}var v=u;var m=I.toString(o.name).length+v;if(m>C){C=m}}C+=7;var pad1=function(e){return StringTools.lpad(e," ",C)};process.stdout.write(" Supported commands:");process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var l=0;while(l<r.length){var o=r[l];++l;var p=o.args.split("\n");var _=o.name==null?"null":I.toString(o.name);var c=p[0];var g;if(c==null){g=""}else if(c==""){g=""}else{var u=c;g=" "+u}p[0]=" "+_+g+" : ";var h=1;var x=p.length;while(h<x){var b=h++;p[b]+=" "}var y=o.doc.split("\n");while(p.length<y.length)p.push("");while(p.length>y.length)y.push("");var S=0;var E=p.length;while(S<E){var N=S++;var k=pad1(p[N])+y[N];process.stdout.write(Std.string(k));process.stdout.write("\n")}}var l=0;while(l<n.length){var O=n[l];++l;process.stdout.write("");process.stdout.write("\n");var u=" "+O.name;process.stdout.write(Std.string(u));process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var c=0;var h=O.value;while(c<h.length){var R=h[c];++c;var k=pad1(""+R.name+" : ")+R.value;process.stdout.write(Std.string(k));process.stdout.write("\n")}}process.stdout.write("");process.stdout.write("\n");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)));default:var A=s;var s=0;while(s<r.length){var F=r[s];++s;if(I.eq(F.name,A)){return F.exec(e)}}if(i!=null){e.unshift(A);var s=i(e);if(s._hx_index==0){var u=s.v;return u()}}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(404,"Unknown command "+A+". Try `lix help`.",{fileName:"src/lix/cli/Command.hx",lineNumber:201,className:"lix.cli.Command",methodName:"dispatch"}))))}}};lix_cli_Command.prototype={__class__:lix_cli_Command};var lix_cli_HaxeCmd=function(){};t["lix.cli.HaxeCmd"]=lix_cli_HaxeCmd;lix_cli_HaxeCmd.__name__="lix.cli.HaxeCmd";lix_cli_HaxeCmd.ensureScope=function(){if(haxeshim_scope_Scope.exists(haxeshim_scope_Scope.DEFAULT_ROOT)){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return haxeshim_scope_Scope.create(haxeshim_scope_Scope.DEFAULT_ROOT,{version:"stable",resolveLibs:"mixed"})}};var F=n["lix.client.ArchiveKind"]={__ename__:"lix.client.ArchiveKind",__constructs__:null,Zip:{_hx_name:"Zip",_hx_index:0,__enum__:"lix.client.ArchiveKind",toString:$estr},Tar:{_hx_name:"Tar",_hx_index:1,__enum__:"lix.client.ArchiveKind",toString:$estr},Custom:(i=function(e){return{_hx_index:2,load:e,__enum__:"lix.client.ArchiveKind",toString:$estr}},i._hx_name="Custom",i.__params__=["load"],i)};F.__constructs__=[F.Zip,F.Tar,F.Custom];var L=n["lix.client.ArchiveDestination"]={__ename__:"lix.client.ArchiveDestination",__constructs__:null,Fixed:(i=function(e){return{_hx_index:0,path:e,__enum__:"lix.client.ArchiveDestination",toString:$estr}},i._hx_name="Fixed",i.__params__=["path"],i),Computed:(i=function(e){return{_hx_index:1,f:e,__enum__:"lix.client.ArchiveDestination",toString:$estr}},i._hx_name="Computed",i.__params__=["f"],i)};L.__constructs__=[L.Fixed,L.Computed];var D=n["lix.client.ArchiveDependency"]={__ename__:"lix.client.ArchiveDependency",__constructs__:null,FromUrl:(i=function(e){return{_hx_index:0,u:e,__enum__:"lix.client.ArchiveDependency",toString:$estr}},i._hx_name="FromUrl",i.__params__=["u"],i),FromHxml:(i=function(e){return{_hx_index:1,path:e,__enum__:"lix.client.ArchiveDependency",toString:$estr}},i._hx_name="FromHxml",i.__params__=["path"],i)};D.__constructs__=[D.FromUrl,D.FromHxml];var lix_client_ArchiveInfos=function(e,t,r,n,i,s,a,l,o){this.name=e;this.version=t;this.classPath=r;this.hasNdll=n;this.runAs=i;this.dependencies=s;this.haxeshimDependencies=a;this.postDownload=l;this.postInstall=o};t["lix.client.ArchiveInfos"]=lix_client_ArchiveInfos;lix_client_ArchiveInfos.__name__="lix.client.ArchiveInfos";lix_client_ArchiveInfos.prototype={__class__:lix_client_ArchiveInfos};var T={};T.keyValueIterator=function(e){if(e==null){return new haxe_iterators_ArrayIterator([])}else{var t=e;return new haxe_ds__$StringMap_StringMapKeyValueIterator(t.h)}};var B={};B.ofHaxeshim=function(e){var t=[];var r=$keyValueIterator(T)(e);while(r.hasNext()){var n=r.next();var i=n.key;var s=n.value;t.push(new tink_core_NamedWith(i,D.FromHxml(s)))}var a=t;a.sort((function(e,t){return Reflect.compare(e.name,t.name)}));return a};B.ofMap=function(e){var t=[];var r=e.h;var n=r;var i=Object.keys(r);var s=i.length;var a=0;while(a<s){var l=i[a++];var o=l;var u=n[l];var c=o;var h=u;t.push(new tink_core_NamedWith(c,h))}var d=t;d.sort((function(e,t){return Reflect.compare(e.name,t.name)}));return d};var lix_client_DownloadedArchive=function(e,t,r,n){this.alreadyDownloaded=true;this.storageRoot=t;this.relRoot=e;this.job=r;this.infos=n};t["lix.client.DownloadedArchive"]=lix_client_DownloadedArchive;lix_client_DownloadedArchive.__name__="lix.client.DownloadedArchive";lix_client_DownloadedArchive.getAbsRoot=function(e,t){return haxe_io_Path.removeTrailingSlashes(""+e+"/"+t)};lix_client_DownloadedArchive.escape=function(e){if(e==null){return null}var t=0;var r=lix_client_DownloadedArchive.RESERVED.length;while(t<r){var n=t++;e=StringTools.replace(e,lix_client_DownloadedArchive.RESERVED.charAt(n),"_")}return e};lix_client_DownloadedArchive.path=function(e){var t=lix_client_DownloadedArchive.escape;var r=new Array(e.length);var n=0;var i=e.length;while(n<i){var s=n++;r[s]=t(e[s])}return r.join("/")};lix_client_DownloadedArchive.fresh=function(e,t,r,n){var i=""+e+"/"+lix_client_DownloadedArchive.seekRoot(e);return X.next(lix_client_DownloadedArchive.readInfos(i,n.lib),(function(s){var a;if(r==null){var l=n.dest;var o;switch(l._hx_index){case 0:var u=l.path;o=u;break;case 1:var c=l.f;o=c(s);break}a=lix_client_DownloadedArchive.path(o)}else{a=r}var h=new lix_client_DownloadedArchive(a,t,n,s);h.alreadyDownloaded=false;var d=lix_client_DownloadedArchive.getAbsRoot(h.storageRoot,h.relRoot);if(s.haxeshimDependencies!=null){var v=haxe_io_Path.removeTrailingSlashes(i).length;var l=s.name;var m=s.version;var p=s.classPath;var _=s.hasNdll;var g=s.runAs;var x=s.dependencies;var b=new haxe_ds_StringMap;var y=$keyValueIterator(T)(s.haxeshimDependencies);while(y.hasNext()){var S=y.next();var E=S.key;var u=S.value;b.h[E]=d+HxOverrides.substr(u,v,null)}var N=new lix_client_ArchiveInfos(l,m,p,_,g,x,b,s.postDownload,s.postInstall);h.infos=N}var k=null;var O=lix_client_DownloadedArchive.getAbsRoot(h.storageRoot,h.relRoot);var R=X.next(X.next(X.next(X.next(haxeshim_sys_Fs.exists(O),(function(e){if(e){var t=O;k=""+O+"-archived@"+(new Date).getTime();return haxeshim_sys_Fs.move(t,k)}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}})),(function(e){return haxeshim_sys_Fs.move(i,lix_client_DownloadedArchive.getAbsRoot(h.storageRoot,h.relRoot))})),(function(e){return haxeshim_sys_Fs.delete(k)})),(function(t){return haxeshim_sys_Fs.delete(e)}));var C=h;return X.next(R,(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(C)))}))}))};lix_client_DownloadedArchive.existent=function(e,t,r){return X.next(lix_client_DownloadedArchive.readInfos(lix_client_DownloadedArchive.getAbsRoot(t,e),r.lib),(function(n){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(new lix_client_DownloadedArchive(e,t,r,n))))}))};lix_client_DownloadedArchive.seekRoot=function(e){var t=g.readdirSync(e);if(t.length==1){var r=t[0];if(sys_FileSystem.isDirectory(""+e+"/"+r)){return""+r+"/"+lix_client_DownloadedArchive.seekRoot(""+e+"/"+r)}else{return""}}else{return""}};lix_client_DownloadedArchive.readInfos=function(e,t){var r=g.readdirSync(e);var guessClassPath=function(){if(r.indexOf("src")!=-1){return"src"}else if(r.indexOf("Sources")!=-1){return"Sources"}else if(r.indexOf("hx")!=-1){return"hx"}else{return""}};if(t==null){t=lix_client_LibVersion.UNDEFINED}var n;if(r.indexOf(".haxerc")!=-1&&r.indexOf("haxe_libraries")!=-1){var i=""+e+"/haxe_libraries";var s=new haxe_ds_StringMap;var a=0;var l=g.readdirSync(i);while(a<l.length){var o=l[a];++a;if(haxe_io_Path.extension(o)=="hxml"){var c=haxe_io_Path.withoutExtension(o);s.h[c]=""+i+"/"+o}}n=s}else{n=null}var h=r.indexOf("ndll")!=-1;var d;if(r.indexOf("haxelib.json")!=-1){var v=JSON.parse(g.readFileSync(""+e+"/haxelib.json",{encoding:"utf8"}));var s=v.name;var a=v.version;var l;var m=v.classPath;if(m==null){l=""}else{var p=m;l=p}var m=v.dependencies;var x;if(m==null){x=B.ofMap(new haxe_ds_StringMap)}else{var b=m;var m=new haxe_ds_StringMap;var y=b;var S=y;var E=Reflect.fields(y);var N=0;while(N<E.length){var c=E[N++];var k=S[c];var O=c;var R=O;var C=k;var A;var I;var F;switch(C){case"":case"*":F=G.fromString("haxelib:"+R);break;default:I=G.fromString(C).scheme;if(I==null){var L=C;F=G.fromString("haxelib:"+R+"#"+L)}else{A=G.fromString(C);var T=A.auth;var P=A.hash;var M=A.host;var z=A.hosts;var U=A.path;var H=A.payload;var j=A.query;var W=A.scheme;var V=A.query==null?A.path:(A.path==null?"null":A.path)+"?"+(A.query==null?"null":A.query);if(W==null){var $=C;F=G.fromString($)}else if(W=="git"){if(j==null){var q=G.fromString(H);var Y=q.auth;var Z=q.hash;var X=q.host;var K=q.hosts;var J=q.path;var Q=q.payload;var ee=q.query;var te=q.scheme;var re=q.query==null?q.path:(q.path==null?"null":q.path)+"?"+(q.query==null?"null":q.query);if(X==null){var ie=C;F=G.fromString(ie)}else{var se=ne.get_name(X);var ae=ne.get_port(X);if(se==null){var le=C;F=G.fromString(le)}else{switch(se){case"github.com":case"gitlab.com":if(te==null){var oe=C;F=G.fromString(oe)}else if(te=="https"){var ue=q;F=ue}else{var ce=C;F=G.fromString(ce)}break;default:var he=C;F=G.fromString(he)}}}}else{var fe=G.fromString(H);var de=fe.auth;var ve=fe.hash;var me=fe.host;var pe=fe.hosts;var _e=fe.path;var ge=fe.payload;var we=fe.query;var xe=fe.scheme;var be=fe.query==null?fe.path:(fe.path==null?"null":fe.path)+"?"+(fe.query==null?"null":fe.query);if(me==null){var ye=C;F=G.fromString(ye)}else{var Se=ne.get_name(me);var Ee=ne.get_port(me);if(Se==null){var Ne=C;F=G.fromString(Ne)}else{switch(Se){case"github.com":case"gitlab.com":if(xe==null){var ke=C;F=G.fromString(ke)}else if(xe=="https"){var Oe=fe;F=Oe}else{var Re=C;F=G.fromString(Re)}break;default:var Ce=C;F=G.fromString(Ce)}}}}}else{var Ae=C;F=G.fromString(Ae)}}}m.h[R]=D.FromUrl(F)}x=B.ofMap(m)}d=new lix_client_ArchiveInfos(s,a,l,h,(function(e){if(sys_FileSystem.exists(""+e.libRoot+"/run.n")||v.main!=null){return u.Some("haxelib run-dir "+v.name+' "$'+'{DOWNLOAD_LOCATION}"')}else{return u.None}}),x,n,v.postDownload,v.postInstall)}else if(r.indexOf("package.json")!=-1){var Ie=JSON.parse(g.readFileSync(""+e+"/package.json",{encoding:"utf8"}));d=new lix_client_ArchiveInfos(Ie.name,Ie.version,guessClassPath(),h,(function(e){return u.None}),B.ofHaxeshim(n),null,null,null)}else{var Fe=t.name;var Le=new tink_core__$Lazy_LazyConst("untitled");var s;if(Fe._hx_index==0){var p=Fe.v;s=p}else{s=_.get(Le)}var Fe=t.version;var Le=new tink_core__$Lazy_LazyConst("0.0.0");var a;if(Fe._hx_index==0){var p=Fe.v;a=p}else{a=_.get(Le)}d=new lix_client_ArchiveInfos(s,a,guessClassPath(),h,(function(e){return u.None}),B.ofHaxeshim(n),null,null,null)}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(d)))};lix_client_DownloadedArchive.prototype={__class__:lix_client_DownloadedArchive};var P=r(8781);var lix_client_Download=function(){};t["lix.client.Download"]=lix_client_Download;lix_client_Download.__name__="lix.client.Download";lix_client_Download.text=function(e){return X.next(lix_client_Download.bytes(e),(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e.toString())))}))};lix_client_Download.bytes=function(e){return lix_client_Download.download(e,(function(e,t,r){lix_client_Download.buffered(t).handle(r)}))};lix_client_Download.buffered=function(e){return Y.async((function(t){var r=[];e.on("data",$bind(r,$arrayPush));e.on("end",(function(){t(w.Success(js_node_buffer__$Buffer_Helper.bytesOfBuffer(O.concat(r))))}))}))};lix_client_Download.archive=function(e,t,r,n){return lix_client_Download.download(e,lix_client_Download.withLogger(n,(function(n,i,s){if(i.headers["content-type"]=="application/zip"||StringTools.endsWith(e,".zip")||StringTools.endsWith(n,".zip")){lix_client_Download.unzip(e,r,t,i,s)}else{lix_client_Download.untar(e,r,t,i,s)}})))};lix_client_Download.unzip=function(e,t,n,i,s){X.next(lix_client_Download.buffered(i),(function(i){return Y.async((function(a){var l=i.length-4;while(l-- >0)if(i.b[l]==80&&i.b[l+1]==75&&i.b[l+2]==5&&i.b[l+3]==6){i.b[l+20]=0;i.b[l+21]=0;i=i.sub(0,l+22);break}if(l==0){a(w.Failure(new tink_core_TypedError(422,"Unzip failed to find central directory in "+e,{fileName:"src/lix/client/Download.hx",lineNumber:65,className:"lix.client.Download",methodName:"unzip"})));return}var o=i.b;P.fromBuffer(O.from(o.buffer,o.byteOffset,i.length),(function(i,l){var o=-1;var done=function(){o+=1;s.onProgress(o,l.entryCount,false);if(o==l.entryCount){var e=a;var r=w.Success(t);haxe_Timer.delay((function(){e(r)}),100)}};if(i!=null){a(w.Failure(new tink_core_TypedError(422,"Failed to unzip "+e+" because "+Std.string(i),{fileName:"src/lix/client/Download.hx",lineNumber:78,className:"lix.client.Download",methodName:"unzip"})))}l.on("entry",(function(e){var i=haxeshim_sys_Fs.peel(lix_client_Download.stripLeadingSlashes(e.fileName),n);switch(i._hx_index){case 0:var s=i.v;var a=""+t+"/"+s;if(StringTools.endsWith(a,"/")){done()}else{haxeshim_sys_Fs.ensureDir(a).eager();l.openReadStream(e,(function(e,t){var n=r(7758).createWriteStream(a);t.pipe(n,{end:true});n.on("close",done)}))}break;case 1:break}}));l.on("end",(function(){l.close();done()}))}))}))})).handle($bind(s,s.done))};lix_client_Download.stripLeadingSlashes=function(e){if(e.charAt(0)=="/"){return lix_client_Download.stripLeadingSlashes(HxOverrides.substr(e,1,null))}else{return e}};lix_client_Download.untar=function(e,t,n,i,s){return Y.async((function(e){var a=0;var l=0;var o=[];var update=function(){s.onProgress(l,a+1,true)};var u=1;var done=function(r){if(r==null){r=0}l+=r;update();haxe_Timer.delay((function(){if((u-=1)<=0){s.onProgress(a,a,true);var r=[];var n=0;while(n<o.length){var i=[o[n]];++n;r.push(Y.async(function(e){return function(t){g.unlink(e[0].to,function(e){return function(r){g.symlink(e[0].from,e[0].to,function(){return function(e){t(e==null?w.Success(null):w.Failure(new tink_core_TypedError(null,e.message,{fileName:"src/lix/client/Download.hx",lineNumber:137,className:"lix.client.Download",methodName:"untar"})))}}())}}(e))}}(i)))}X.next(X.inParallel(r),(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t)))})).handle(e)}}),100)};var c=null;var fail=function(t){var r=e;c=new tink_core_TypedError(null,t,{fileName:"src/lix/client/Download.hx",lineNumber:149,className:"lix.client.Download",methodName:"untar"});r(w.Failure(c))};lix_client_uncompress_Tar.parse(i,(function(i){if(c!=null){return}a+=i.size;update();var skip=function(){i.on("data",(function(){}))};var s=haxeshim_sys_Fs.peel(lix_client_Download.stripLeadingSlashes(i.path),n);switch(s._hx_index){case 0:var l=s.v;var h=""+t+"/"+l;if(StringTools.endsWith(h,"/")){skip()}else{haxeshim_sys_Fs.ensureDir(h).handle((function(t){if(t._hx_index==1){var n=t.failure;c=n;e(w.Failure(c))}else if(i.type=="SymbolicLink"){skip();o.push({from:i.linkpath,to:h})}else{u+=1;var s=new R;var a=r(7758).createWriteStream(h,{mode:i.mode});i.pipe(s,{end:true});s.pipe(a,{end:true});var l=i.size;a.on("close",(function(){done(l)}))}}))}break;case 1:skip();break}})).handle((function(t){if(t._hx_index==1){var r=t.failure;e(w.Failure(r))}else{done()}}))})).handle($bind(s,s.done))};lix_client_Download.tar=function(e,t,r,n){var i=r;var s=t;return lix_client_Download.download(e,lix_client_Download.withLogger(n,(function(e,t,r){return lix_client_Download.untar(e,i,s,t,r)})))};lix_client_Download.zip=function(e,t,r,n){var i=r;var s=t;return lix_client_Download.download(e,lix_client_Download.withLogger(n,(function(e,t,r){lix_client_Download.unzip(e,i,s,t,r)})))};lix_client_Download.withLogger=function(e,t){return function(r,n,i){var s=Std.parseInt(n.headers["content-length"]);var a=0;var l=0;var o=1;var u=null;var progress=function(t){if(t==u){return}u=t;e.progress(t)};var pct=function(e){e=Math.min(1,Math.max(0,e));var t=Std.string(Math.round(1e3*e)/10);var r;if(t.indexOf(".")==-1){var n=t;r=""+n+".0"}else{var i=t;r=i}return StringTools.lpad(r," ",5)+"%"};var c=new Date(0).getTime();var update=function(){if(!(l==o||l/o>=1)){var e=(new Date).getTime();if(e>c+137){c=e;var t=[];if(a<s){t.push("Downloaded: "+pct(a/s))}if(l>0){t.push("Saved: "+pct(l/o))}progress(" "+t.join(" "))}}};n.on("data",(function(e){a+=e.length;update()}));var h=0;t(r,n,{onProgress:function(e,t,r){l=e;o=t;if(r){var n=a/s;var i=l/o;var u=n*i;if(u<h){u=h}h=u;l=Math.round(u*1e3);o=1e3}update()},done:function(t){e.success("-> Done!");i(t)}})}};lix_client_Download.download=function(e,t){return Y.async((function(r){var n=new C(e);var i=n.search;var s={protocol:n.protocol,host:n.host,path:""+n.pathname+(i!=null?i:"")};if(n.username!=null&&n.password!=null){s.auth=n.username+":"+n.password}var a=s;a.agent=false;if(a.headers==null){a.headers={}}a.headers["user-agent"]=lix_client_Download.USER_AGENT;var fail=function(t){r(w.Failure(tink_core_TypedError.withData(null,"Failed to download "+e+" because "+t.message,t,{fileName:"src/lix/client/Download.hx",lineNumber:300,className:"lix.client.Download",methodName:"download"})))};var l=StringTools.startsWith(e,"https:")?E.get(a):S.get(a);l.setTimeout(3e4);l.on("error",fail);l.on("response",(function(n){if(n.statusCode>=400){r(w.Failure(tink_core_TypedError.withData(n.statusCode,n.statusMessage,n,{fileName:"src/lix/client/Download.hx",lineNumber:311,className:"lix.client.Download",methodName:"download"})))}else{var i=n.headers["location"];if(i==null){n.on("error",fail);t(e,n,(function(e){switch(e._hx_index){case 0:var t=e.data;r(w.Success(t));break;case 1:var n=e.failure;r(w.Failure(n));break}}))}else{var s=i;lix_client_Download.download(new C(s,e).toString(),t).handle(r)}}}))}))};var lix_client_LibVersion=function(e,t){this.name=e;this.version=t};t["lix.client.LibVersion"]=lix_client_LibVersion;lix_client_LibVersion.__name__="lix.client.LibVersion";lix_client_LibVersion.parse=function(e){if(e==null){return null}else{var t=e.indexOf("#");if(t==-1){return new lix_client_LibVersion(u.Some(e),u.None)}else{var r=t;return new lix_client_LibVersion(u.Some(e.substring(0,r)),u.Some(e.substring(r+1)))}}};lix_client_LibVersion.prototype={__class__:lix_client_LibVersion};var lix_client_Libraries=function(e,t,r,n,i){this.scope=e;this.urlToJob=t;this.resolver=r;this.logger=n;this.force=i};t["lix.client.Libraries"]=lix_client_Libraries;lix_client_Libraries.__name__="lix.client.Libraries";lix_client_Libraries.prototype={downloadUrl:function(e,t){return this.downloadArchive(this.urlToJob(e),t)},downloadArchive:function(e,t){var r=this;return X.next(e,(function(e){var n=null;var i=t!=null?t.into:null;if(i==null){var s=e.dest;switch(s._hx_index){case 0:var a=s.path;i=lix_client_DownloadedArchive.path(a);break;case 1:var l=s.f;n=""+r.scope.libCache+"/.cache/libNames/"+lix_client_DownloadedArchive.escape(G.toString(e.normalized));if(sys_FileSystem.exists(n)){i=g.readFileSync(n,{encoding:"utf8"})}break}}var o=i!=null&&sys_FileSystem.exists(""+r.scope.libCache+"/"+i);if(o&&!r.force){r.logger.success("already downloaded: "+(e.normalized==null?"null":G.toString(e.normalized)));return lix_client_DownloadedArchive.existent(i,r.scope.libCache,e)}else{var u=r.logger;var c=e.normalized==null?"null":G.toString(e.normalized);u.info(""+(o?"forcedly redownloading":"downloading")+" "+c);var h=""+r.scope.haxeshimRoot+"/downloads/download@"+Math.floor((new Date).getTime())+"_"+process.pid;var s=e.kind;var c;if(s==null){c=lix_client_Download.archive(G.toString(e.url),0,h,r.logger)}else{switch(s._hx_index){case 0:c=lix_client_Download.zip(G.toString(e.url),0,h,r.logger);break;case 1:c=lix_client_Download.tar(G.toString(e.url),0,h,r.logger);break;case 2:var d=s.load;c=d({dest:h,logger:r.logger,source:e.normalized,scope:r.scope});break}}return X.next(X.next(c,(function(t){return lix_client_DownloadedArchive.fresh(t,r.scope.libCache,i,e)})),(function(e){if(n!=null){var t=e;return X.next(haxeshim_sys_Fs.save(n,b.ofString(e.relRoot),{fileName:"src/lix/client/Libraries.hx",lineNumber:65,className:"lix.client.Libraries",methodName:"downloadArchive"}),(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t)))}))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e)))}}))}}))},installUrl:function(e,t,r){return this.installArchive(this.urlToJob(e),t,r)},installFromLibHxml:function(e,t){var r=this;var n=this.scope.libHxml(e);return X.next(X.next(X.next(X.next(X.next(X.next(haxeshim_sys_Fs.copy(t,""+this.scope.scopeLibDir+"/"+e+".hxml"),(function(t){return r.scope.getDirectives(e)})),(function(e){var n=e.h["install"];if(n==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"No install directive in "+t,{fileName:"src/lix/client/Libraries.hx",lineNumber:81,className:"lix.client.Libraries",methodName:"installFromLibHxml"}))))}else if(n.length==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"No install directive in "+t,{fileName:"src/lix/client/Libraries.hx",lineNumber:81,className:"lix.client.Libraries",methodName:"installFromLibHxml"}))))}else{var i=n;var n=[];var s=0;while(s<i.length){var e=[i[s]];++s;n.push(X.next(X.NOISE,function(e){return function(t){r.logger.info(e[0]);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(haxeshim_sys_Exec.shell(e[0],r.scope.scopeDir)))}}(e)))}return X.inSequence(n)}})),(function(e){return haxeshim_sys_Fs.get(t,{fileName:"src/lix/client/Libraries.hx",lineNumber:90,className:"lix.client.Libraries",methodName:"installFromLibHxml"})})),(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(haxeshim_Args.fromMultilineString(e,n,(i=r.scope,$bind(i,i.getVar))))))})),(function(e){switch(e._hx_index){case 0:var t=e.data;var r=[];var n=0;while(n<t.length){var i=t[n];++n;r.push(i.val)}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(r)));case 1:var s=e.failure.errors[0];return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(s.code,s.message,{fileName:"src/lix/client/Libraries.hx",lineNumber:94,className:"lix.client.Libraries",methodName:"installFromLibHxml"}))))}})),(function(e){var t=[];var r=0;var n=e;while(r<n.length){var i=n[r];var s=r++;var a=s;var l=i;if(l=="-lib"&&haxeshim_Args.getNdll(e[a+1])==u.None){t.push(e[a+1])}}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t)))}))},dev:function(e,t){var r=this;var n=haxe_io_Path.isAbsolute(t);var i=n?t:haxe_io_Path.join([this.scope.scopeDir,t]);var s=n?t:"$"+"{SCOPE_DIR}/"+t;var a=i;var l=tink_core_TypedError.catchExceptions((function(){return g.readdirSync(a)}),null,{fileName:"src/lix/client/Libraries.hx",lineNumber:112,className:"lix.client.Libraries",methodName:"dev"});if(l._hx_index==0){var o=l.data;if(o.indexOf("haxelib.json")!=-1){var u=""+i+"/haxelib.json";return X.next(X.next(haxeshim_sys_Fs.get(u,{fileName:"src/lix/client/Libraries.hx",lineNumber:116,className:"lix.client.Libraries",methodName:"dev"}),(function(e){try{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(JSON.parse(e))))}catch(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"cannot parse "+u,{fileName:"src/lix/client/Libraries.hx",lineNumber:119,className:"lix.client.Libraries",methodName:"dev"}))))}})),(function(n){var i=[];if(n.dependencies!=null){var a=n.dependencies;var l=a;var u=Reflect.fields(a);var c=0;while(c<u.length){var h=u[c++];var d=l[h];var v=h;var m=v;var p=d;i.push("-lib "+m)}}var _=n.classPath;var g;if(_==null){g=t}else{var p=_;g=""+s+"/"+p}i.push("-cp "+g);var _=n.version;var g;if(_==null){g="dev"}else{var p=_;g=p}i.push("-D "+e+"="+g);var w=i.length;if(o.indexOf("extraParams.hxml")!=-1){i.push(""+s+"/extraParams.hxml")}i.push('--macro Sys.println("haxe_libraries/'+e+".hxml:"+w+": [Warning] Using dev version of library "+e+'")');return haxeshim_sys_Fs.save(r.scope.libHxml(e),b.ofString(i.join("\n")),{fileName:"src/lix/client/Libraries.hx",lineNumber:143,className:"lix.client.Libraries",methodName:"dev"})}))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,""+i+" does not contain haxelib.json",{fileName:"src/lix/client/Libraries.hx",lineNumber:147,className:"lix.client.Libraries",methodName:"dev"}))))}}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,""+i+" is not a readable directory",{fileName:"src/lix/client/Libraries.hx",lineNumber:149,className:"lix.client.Libraries",methodName:"dev"}))))}},installArchive:function(e,t,r){var n=this;return X.next(this.downloadArchive(e),(function(e){var i;var s=""+lix_client_DownloadedArchive.getAbsRoot(e.storageRoot,e.relRoot)+"/extraParams.hxml";i=sys_FileSystem.exists(s)?g.readFileSync(s,{encoding:"utf8"}):null;if(t==null){t=new lix_client_LibVersion(u.None,u.None)}var a=e.infos;if(r==null){r={}}var l=r.alreadyInstalled!=null?r.alreadyInstalled:new haxe_ds_StringMap;r.alreadyInstalled=l;var o=t.name;var c=new tink_core__$Lazy_LazyConst(a.name);var h;if(o._hx_index==0){var d=o.v;h=d}else{h=_.get(c)}var o=t.version;var c=new tink_core__$Lazy_LazyConst(a.version);var v;if(o._hx_index==0){var d=o.v;v=d}else{v=_.get(c)}if(h==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Could not determine library name for "+(e.job.normalized==null?"null":G.toString(e.job.normalized)),{fileName:"src/lix/client/Libraries.hx",lineNumber:182,className:"lix.client.Libraries",methodName:"installArchive"}))))}var m=n.scope.libHxml(h);var p="$"+"{"+"HAXE_LIBCACHE"+"}/"+e.relRoot;var interpolate=function(e){return n.scope.interpolate(e,(function(e){if(e=="DOWNLOAD_LOCATION"){return p}else{return null}}))};var exec=function(e,t,r){if(t!=null){t=interpolate(t);if(r==null){r=n.scope.cwd}n.logger.info("Running "+e+" hook:");n.logger.info("> "+t);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(tink_core_OutcomeTools.map(haxeshim_sys_Exec.shell(t,n.scope.interpolate(r),n.scope.haxeInstallation.env),(function(e){return null}))))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}};var saveHxml=function(t){var s=["# @"+"install"+': lix --silent download "'+(e.job.normalized==null?"null":G.toString(e.job.normalized))+'" into '+e.relRoot];var l=a.postDownload;if(l!=null){var o=l;s.push("# @"+"post-install"+": cd "+p+" && "+interpolate(o))}var l=a.runAs({libRoot:n.scope.interpolate(p)});switch(l._hx_index){case 0:var o=l.v;s.push("# @run: "+tink_core_OutcomeTools.sure(haxeshim_Args.interpolate(o,(function(e){if(e=="DOWNLOAD_LOCATION"){return p}else{var t=e;return"$"+"{"+t+"}"}}))));break;case 1:break}var lines=function(e){var t=[];var r=0;while(r<e.length){var n=e[r];++r;if(n!=null){t.push(n)}}return t.join("\n")};var u=m;var c=lines;var l=[];var d=0;var _=a.dependencies;while(d<_.length){var g=_[d];++d;l.push("-lib "+g.name)}return X.next(haxeshim_sys_Fs.save(u,b.ofString(c(s.concat(l).concat(["-cp "+p+"/"+a.classPath,"-D "+h+"="+v,i,a.hasNdll?"-lib "+haxeshim_Args.makeNdll(""+p+"/ndll/"):null]))),{fileName:"src/lix/client/Libraries.hx",lineNumber:237,className:"lix.client.Libraries",methodName:"installArchive"}),(function(e){r.alreadyInstalled.h[h]=true;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t)))}))};var installDependencies=function(){if(r.flat){return X.NOISE}else{var e=[];var t=0;var i=a.dependencies;while(t<i.length){var s=i[t];++t;var l=[s.name];var o=s.value;if(sys_FileSystem.exists(""+n.scope.scopeLibDir+"/"+l[0]+".hxml")&&r.alreadyInstalled.h[l[0]]){e.push(X.NOISE)}else{var c=a.haxeshimDependencies;var d;if(c==null){d=null}else{var v=c;d=v.h[l[0]]}var m;switch(o._hx_index){case 0:if(d==null){var p=o.u;m=X.next(n.installUrl(p,new lix_client_LibVersion(u.Some(l[0]),u.None),r),function(e){return function(t){r.alreadyInstalled.h[e[0]]=true;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t)))}}(l))}else{var _=d;var g=[null];g[0]=function(e){return function(t,i){if(r.alreadyInstalled.h[t]){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return X.noise(X.next(n.installFromLibHxml(t,i),function(e){return function(n){r.alreadyInstalled.h[t]=true;var i=[];var s=0;while(s<n.length){var l=n[s];++s;var o=a.haxeshimDependencies;var u;if(o==null){u=null}else{var c=o;u=c.h[l]}i.push(e[0](l,u))}return X.inSequence(i)}}(e)))}}}(g);m=g[0](l[0],_)}break;case 1:var x=o.path;var b=[null];b[0]=function(e){return function(t,i){if(r.alreadyInstalled.h[t]){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return X.noise(X.next(n.installFromLibHxml(t,i),function(e){return function(n){r.alreadyInstalled.h[t]=true;var i=[];var s=0;while(s<n.length){var l=n[s];++s;var o=a.haxeshimDependencies;var u;if(o==null){u=null}else{var c=o;u=c.h[l]}i.push(e[0](l,u))}return X.inSequence(i)}}(e)))}}}(b);m=b[0](l[0],x);break}e.push(m)}}return Y.flatMap(Y.inSequence(e),(function(e){var t=[];var r=0;while(r<e.length){var n=e[r];++r;var i;if(n._hx_index==1){var s=n.failure;i=s}else{continue}t.push(i)}var a=t;if(a.length==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{var l=a;var s="Failed to install dependencies of "+h+" :\n ";var o=new Array(l.length);var t=0;var r=l.length;while(t<r){var u=t++;o[u]=l[u].message}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(tink_core_TypedError.withData(null,s+o.join("\n "),l,{fileName:"src/lix/client/Libraries.hx",lineNumber:295,className:"lix.client.Libraries",methodName:"installArchive"}))))}}))}};return X.next(X.next(X.next(X.next(X.next(saveHxml(),(function(e){n.logger.success("-> mounted as "+h+"#"+v);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))})),(function(e){return installDependencies()})),(function(t){if(!e.alreadyDownloaded){return exec("post download",a.postDownload,p)}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}})),saveHxml),(function(e){return exec("post install",a.postInstall)}))}))},__class__:lix_client_Libraries};var M={};M.get_isPrerelease=function(e){return e.indexOf("-")!=-1};M.isNumber=function(e){return new EReg("^[0-9]*$","").match(e)};M.fragment=function(e,t){if(M.isNumber(e)&&M.isNumber(t)){return Std.parseInt(e)-Std.parseInt(t)}else{return Reflect.compare(e,t)}};M.compare=function(e,t){var r=e.split("-");var n=t.split("-");var i=0;while(i<r.length&&i<n.length){var e=r[i].split(".");var t=n[i++].split(".");var s=0;while(s<e.length&&s<t.length){var a=M.fragment(e[s],t[s]);if(a==0){++s}else{var l=a;return-l}}var o=e.length-t.length;if(o!=0){var u=o;return-u}}return(r.length-n.length)*(i==1?1:-1)};var z=n["lix.client.haxe.ResolvedUserVersionData"]={__ename__:"lix.client.haxe.ResolvedUserVersionData",__constructs__:null,RNightly:(i=function(e){return{_hx_index:0,nightly:e,__enum__:"lix.client.haxe.ResolvedUserVersionData",toString:$estr}},i._hx_name="RNightly",i.__params__=["nightly"],i),ROfficial:(i=function(e){return{_hx_index:1,version:e,__enum__:"lix.client.haxe.ResolvedUserVersionData",toString:$estr}},i._hx_name="ROfficial",i.__params__=["version"],i),RCustom:(i=function(e){return{_hx_index:2,path:e,__enum__:"lix.client.haxe.ResolvedUserVersionData",toString:$estr}},i._hx_name="RCustom",i.__params__=["path"],i)};z.__constructs__=[z.RNightly,z.ROfficial,z.RCustom];var U={};U.get_id=function(e){switch(e._hx_index){case 0:var t=e.nightly;var r=t.development;var r=t.file;var r=t.published;var n=t.hash;return n;case 1:var n=e.version;return n;case 2:var n=e.path;return n}};U.toString=function(e){switch(e._hx_index){case 0:var t=e.nightly;return t.hash;case 1:var r=e.version;return r;case 2:var n=e.path;return n}};var H=n["lix.client.haxe.PickOfficial"]={__ename__:"lix.client.haxe.PickOfficial",__constructs__:null,StableOnly:{_hx_name:"StableOnly",_hx_index:0,__enum__:"lix.client.haxe.PickOfficial",toString:$estr},IncludePrereleases:{_hx_name:"IncludePrereleases",_hx_index:1,__enum__:"lix.client.haxe.PickOfficial",toString:$estr}};H.__constructs__=[H.StableOnly,H.IncludePrereleases];var lix_client_haxe_Switcher=function(e,t){this.scope=e;this.logger=t;haxeshim_sys_Fs.ensureDir(haxe_io_Path.addTrailingSlash(e.versionDir)).eager();haxeshim_sys_Fs.ensureDir(haxe_io_Path.addTrailingSlash(e.haxelibRepo)).eager();haxeshim_sys_Fs.ensureDir(this.downloads=e.haxeshimRoot+"/downloads/").eager()};t["lix.client.haxe.Switcher"]=lix_client_haxe_Switcher;lix_client_haxe_Switcher.__name__="lix.client.haxe.Switcher";lix_client_haxe_Switcher.nightlies=function(){var e=haxeshim_sys_Os.get_platform();var t;switch(e){case"linux-arm64":t="linux-arm64";break;case"linux64":t="linux64";break;case"mac-arm":case"mac-universal":case"mac64":t="mac";break;case"win64":t="windows64";break;default:var r=e;t=r}return"https://build.haxe.org/builds/haxe/"+t};lix_client_haxe_Switcher.linkToNightly=function(e,t,r){if(r==null){r=DateTools.format(t,"haxe_%Y-%m-%d_development_"+e+".tar.gz")}return DateTools.format(t,""+lix_client_haxe_Switcher.nightlies()+"/"+r)};lix_client_haxe_Switcher.sortedOfficial=function(e,t){if(e==H.StableOnly){var r=[];var n=0;while(n<t.length){var i=t[n];++n;if(!M.get_isPrerelease(i)){r.push(i)}}t=r}t.sort(M.compare);return t};lix_client_haxe_Switcher.officialOnline=function(e){return X.next(lix_client_Download.text("https://haxe.org/website-content/downloads/versions.json"),(function(t){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(lix_client_haxe_Switcher.sortedOfficial(e,JSON.parse(t).versions.map((function(e){return e.version}))))))}))};lix_client_haxe_Switcher.sortedNightlies=function(e){e.sort((function(e,t){return Reflect.compare(t.published.getTime(),e.published.getTime())}));return e};lix_client_haxe_Switcher.nightliesOnline=function(){return X.next(X.next(new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(lix_client_haxe_Switcher.nightlies()))),lix_client_Download.text),K.ofSafeSync((function(e){var t=e.split("------------------\n").pop().split("\n");var r=[];var parseDate=function(e){try{return u.Some(HxOverrides.strDate(e))}catch(e){return u.None}};var n=0;while(n<t.length){var i=t[n];++n;var s=StringTools.trim(i).split('<a href="');if(s.length==2){var a=s[1];var l=parseDate(s[0].split(" ")[0]);if(l._hx_index==0){var o;var c=l.v;o=a.split('"')[0];var h=o;var d=h.split(".")[0].split("_").pop();if(d==null){var v=d;r.push({hash:v,file:h,development:h.indexOf("_development_")!=-1,published:c})}else if(d!="latest"){var m=d;r.push({hash:m,file:h,development:h.indexOf("_development_")!=-1,published:c})}}}}return lix_client_haxe_Switcher.sortedNightlies(r)})))};lix_client_haxe_Switcher.attempt=function(e,t){try{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(_.get(t))))}catch(t){var r=haxe_Exception.caught(t).unwrap();return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Failed to "+e+" because "+Std.string(r),{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:103,className:"lix.client.haxe.Switcher",methodName:"attempt"}))))}};lix_client_haxe_Switcher.pickFirst=function(e,t,r){if(r==null){return lix_client_haxe_Switcher.pickFirst(e,t,(function(e){return true}))}else{return function(n){var i=$getIterator(n);while(i.hasNext()){var s=i.next();if(r(s)){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t(s))))}}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(404,"No "+e+" build found",{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:137,className:"lix.client.haxe.Switcher",methodName:"pickFirst"}))))}}};lix_client_haxe_Switcher.ensureNeko=function(e,t){var r=e.path;if(sys_FileSystem.exists(r)){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(r)))}else{t.info("Neko seems to be missing. Attempting download ...");var n=lix_client_haxe_Switcher.getNekoUrl(e);switch(n._hx_index){case 0:var i=n.data;var s=StringTools.startsWith(e.platform,"win")?lix_client_Download.zip:lix_client_Download.tar;return X.next(s(i,1,r,t),(function(e){t.success("done");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e)))}));case 1:var a=n.failure;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(a)))}}};lix_client_haxe_Switcher.getNekoUrl=function(e){var t;var r=e.platform;switch(r){case"linux-arm64":t="linux-arm64";break;case"linux64":t="linux64";break;case"mac-arm":case"mac-universal":case"mac64":t="osx-universal";break;case"win32":t="win";break;case"win64":t="win64";break;default:var n=r;return w.Failure(new tink_core_TypedError(null,"Unsupported platform: "+n,{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:319,className:"lix.client.haxe.Switcher",methodName:"getNekoUrl"}))}return w.Success("https://github.com/HaxeFoundation/neko/releases/download/v"+StringTools.replace(e.version,".","-")+"/neko-"+e.version+"-"+t+"."+(StringTools.startsWith(e.platform,"win")?"zip":"tar.gz"))};lix_client_haxe_Switcher.prototype={officialInstalled:function(e){var t=[];var r=0;var n=g.readdirSync(this.scope.versionDir);while(r<n.length){var i=n[r];++r;if(!j.isHash(i)&&sys_FileSystem.isDirectory(this.versionDir(i))){t.push(i)}}return lix_client_haxe_Switcher.attempt("Get installed Haxe versions",new tink_core__$Lazy_LazyConst(lix_client_haxe_Switcher.sortedOfficial(e,t)))},nightliesInstalled:function(){var e=[];var t=0;var r=j.isHash;var n=[];var i=0;var s=g.readdirSync(this.scope.versionDir);while(i<s.length){var a=s[i];++i;if(r(a)){n.push(a)}}var i=n;while(t<i.length){var a=i[t];++t;e.push({hash:a,published:HxOverrides.strDate(JSON.parse(g.readFileSync(""+this.versionDir(a)+"/"+lix_client_haxe_Switcher.VERSION_INFO,{encoding:"utf8"})).published)})}return lix_client_haxe_Switcher.attempt("get installed Haxe versions",new tink_core__$Lazy_LazyConst(lix_client_haxe_Switcher.sortedNightlies(e)))},switchTo:function(e){if(U.get_id(e)==this.scope.config.version){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return this.scope.reconfigure({version:U.get_id(e),resolveLibs:this.scope.config.resolveLibs})}},resolveInstalled:function(e){return this.resolve(e,$bind(this,this.officialInstalled),$bind(this,this.nightliesInstalled))},resolveOnline:function(e){return this.resolve(e,lix_client_haxe_Switcher.officialOnline,lix_client_haxe_Switcher.nightliesOnline)},resolve:function(e,t,r){switch(e._hx_index){case 0:return X.next(r(),lix_client_haxe_Switcher.pickFirst("nightly",z.RNightly,(function(e){return e.development!=false})));case 1:return X.next(t(H.IncludePrereleases),lix_client_haxe_Switcher.pickFirst("official",z.ROfficial));case 2:return X.next(t(H.StableOnly),lix_client_haxe_Switcher.pickFirst("stable",z.ROfficial));case 3:var n=e.hash;return X.next(r(),(function(e){var t=$getIterator(e);while(t.hasNext()){var r=t.next();if(r.hash==n){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(z.RNightly(r))))}}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(404,"Unable to resolve nightly version "+n+" locally, install it first with `lix install haxe "+n+"`",{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:162,className:"lix.client.haxe.Switcher",methodName:"resolve"}))))}));case 4:var i=e.version;return X.next(t(H.IncludePrereleases),(function(e){if(Lambda.has(e,i)){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(z.ROfficial(i))))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(404,"Unable to resolve version "+i+" locally, install it first with `lix install haxe "+i+"`",{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:170,className:"lix.client.haxe.Switcher",methodName:"resolve"}))))}}));case 5:var s=e.path;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(z.RCustom(s))))}},versionDir:function(e){return this.scope.getInstallation(e).path},isDownloaded:function(e){return sys_FileSystem.exists(this.versionDir(U.get_id(e)))},linkToOfficial:function(e){var t="https://haxe.org/website-content/downloads/"+e+"/downloads/haxe-"+e+"-";var r;switch(Sys.systemName()){case"Mac":r="osx.tar.gz";break;case"Windows":r="win"+(e<"5"?"":"64")+".zip";break;default:r="linux"+(e<"3"?"":"64")+".tar.gz"}return t+r},replace:function(e,t,r,n){var i=t;while(true){var s=haxeshim_sys_Fs.ls(t);if(s.length==1){var a=s[0];t=a}else{break}}if(n!=null){n(t)}if(sys_FileSystem.exists(e)){var l=""+this.downloads+"/"+r+"@"+Math.floor(g.statSync(e).ctime.getTime());g.renameSync(e,l);g.renameSync(t,e)}else{g.renameSync(t,e)}if(sys_FileSystem.exists(i)){haxeshim_sys_Fs.delete(i)}},install:function(e,t){return X.next(this.resolveAndDownload(e,t),$bind(this,this.switchTo))},resolveAndDownload:function(e,t){var r=this;var n;var i=j.ofString(e);if(i._hx_index==4){var s=i.version;n=this.resolveInstalled(j.ofString(e))}else{n=new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,""+e+" needs to be resolved online",{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:226,className:"lix.client.haxe.Switcher",methodName:"resolveAndDownload"}))))}var f=function(t){r.logger.info('Looking up Haxe version "'+e+'" online');return X.next(r.resolveOnline(j.ofString(e)),(function(e){r.logger.info(" Resolved to "+(e==null?"null":U.toString(e))+". Downloading ...");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e)))}))};return X.next(Y.flatMap(n,(function(e){switch(e._hx_index){case 0:var t=e.data;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(e));case 1:var r=e.failure;return f(r)}})),(function(e){return X.next(r.download(e,t),(function(t){r.logger.success(!t?" ... already downloaded!":" ... download complete!");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e)))}))}))},download:function(e,t){var r=this;var getDownloadDir=function(e){return""+r.downloads+"/"+e+"@"+Math.floor((new Date).getTime())+"_"+process.pid};if(this.isDownloaded(e)==true){if(t.force!=true){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(false)))}else{switch(e._hx_index){case 0:var n=e.nightly;var i=n.development;var s=n.file;var a=n.hash;var l=n.published;var o=lix_client_haxe_Switcher.linkToNightly(a,l,s);var u=getDownloadDir(a);r.logger.info("Downloading Haxe: "+(e==null?"null":U.toString(e)));return X.next(lix_client_Download.archive(o,0,u,r.logger),(function(e){r.replace(r.versionDir(a),e,a,(function(e){g.writeFileSync(""+e+"/"+lix_client_haxe_Switcher.VERSION_INFO,JSON.stringify({published:HxOverrides.dateStr(l)}))}));return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(true)))}));case 1:var c=e.version;var o=this.linkToOfficial(c);var u=getDownloadDir(c);r.logger.info("Downloading Haxe: "+(e==null?"null":U.toString(e)));return X.next(lix_client_Download.archive(o,0,u,r.logger),(function(e){r.replace(r.versionDir(c),e,c);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(true)))}));case 2:var n=e.path;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Cannot download custom version",{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:265,className:"lix.client.haxe.Switcher",methodName:"download"}))))}}}else{switch(e._hx_index){case 0:var n=e.nightly;var i=n.development;var s=n.file;var h=n.hash;var d=n.published;var o=lix_client_haxe_Switcher.linkToNightly(h,d,s);var u=getDownloadDir(h);r.logger.info("Downloading Haxe: "+(e==null?"null":U.toString(e)));return X.next(lix_client_Download.archive(o,0,u,r.logger),(function(e){r.replace(r.versionDir(h),e,h,(function(e){g.writeFileSync(""+e+"/"+lix_client_haxe_Switcher.VERSION_INFO,JSON.stringify({published:HxOverrides.dateStr(d)}))}));return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(true)))}));case 1:var v=e.version;var o=this.linkToOfficial(v);var u=getDownloadDir(v);r.logger.info("Downloading Haxe: "+(e==null?"null":U.toString(e)));return X.next(lix_client_Download.archive(o,0,u,r.logger),(function(e){r.replace(r.versionDir(v),e,v);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(true)))}));case 2:var n=e.path;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Cannot download custom version",{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:265,className:"lix.client.haxe.Switcher",methodName:"download"}))))}}},__class__:lix_client_haxe_Switcher};var j={};j.isHash=function(e){var t=0;var r=e.length;while(t<r){var n=t++;var i=j.hex;var s=e.charCodeAt(n);if(!i.h[s]){return false}}return true};j.isPath=function(e){if(!haxe_io_Path.isAbsolute(e)){return e.charAt(0)=="."}else{return true}};j.ofString=function(e){if(e==null){return null}else{var t;var r;if(e==null){r=j.isHash(e);if(r==true){return W.UNightly(e)}else{t=j.isPath(e);if(t==true){return W.UCustom(e)}else{return W.UOfficial(e)}}}else{switch(e){case"auto":return null;case"latest":return W.ULatest;case"edge":case"nightly":return W.UEdge;case"stable":return W.UStable;default:r=j.isHash(e);if(r==true){return W.UNightly(e)}else{t=j.isPath(e);if(t==true){return W.UCustom(e)}else{return W.UOfficial(e)}}}}}};var W=n["lix.client.haxe.UserVersionData"]={__ename__:"lix.client.haxe.UserVersionData",__constructs__:null,UEdge:{_hx_name:"UEdge",_hx_index:0,__enum__:"lix.client.haxe.UserVersionData",toString:$estr},ULatest:{_hx_name:"ULatest",_hx_index:1,__enum__:"lix.client.haxe.UserVersionData",toString:$estr},UStable:{_hx_name:"UStable",_hx_index:2,__enum__:"lix.client.haxe.UserVersionData",toString:$estr},UNightly:(i=function(e){return{_hx_index:3,hash:e,__enum__:"lix.client.haxe.UserVersionData",toString:$estr}},i._hx_name="UNightly",i.__params__=["hash"],i),UOfficial:(i=function(e){return{_hx_index:4,version:e,__enum__:"lix.client.haxe.UserVersionData",toString:$estr}},i._hx_name="UOfficial",i.__params__=["version"],i),UCustom:(i=function(e){return{_hx_index:5,path:e,__enum__:"lix.client.haxe.UserVersionData",toString:$estr}},i._hx_name="UCustom",i.__params__=["path"],i)};W.__constructs__=[W.UEdge,W.ULatest,W.UStable,W.UNightly,W.UOfficial,W.UCustom];var lix_client_sources_Git=function(e){this.scope=e};t["lix.client.sources.Git"]=lix_client_sources_Git;lix_client_sources_Git.__name__="lix.client.sources.Git";lix_client_sources_Git.strip=function(e){if(StringTools.endsWith(e,".git")){return haxe_io_Path.withoutExtension(e)}else{return e}};lix_client_sources_Git.eval=function(e,t,r,n){var i=a.spawnSync(e,r,{cwd:t,stdio:["inherit","pipe","inherit"],env:x.toVars(haxeshim_sys_Exec.mergeEnv(n))});var s=i;if(s.error==null){return w.Success({status:s.status,stdout:s.stdout.toString()})}else{var l=i.output;var l=i.pid;var l=i.signal;var l=i.status;var l=i.stderr;var l=i.stdout;var o=i.error;return w.Failure(new tink_core_TypedError(null,"Failed to call "+e+" because "+Std.string(o),{fileName:"src/lix/client/sources/Git.hx",lineNumber:25,className:"lix.client.sources.Git",methodName:"eval"}))}};lix_client_sources_Git.cli=function(e){haxeshim_sys_Fs.ensureDir(haxe_io_Path.addTrailingSlash(e)).eager();return{call:function(t){return X.next(new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(haxeshim_sys_Exec.sync("git",e,t))),(function(e){if(e==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(e,"git "+t[0]+" failed",{fileName:"src/lix/client/sources/Git.hx",lineNumber:33,className:"lix.client.sources.Git",methodName:"cli"}))))}}))},eval:function(t){return X.next(new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(lix_client_sources_Git.eval("git",e,t))),(function(e){var r=e.stdout;if(e.status==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e.stdout.toString())))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(e.status,"git "+t[0]+" failed",{fileName:"src/lix/client/sources/Git.hx",lineNumber:40,className:"lix.client.sources.Git",methodName:"cli"}))))}}))}}};lix_client_sources_Git.prototype={schemes:function(){return["git"]},processUrl:function(e){var t=this;var r=G.fromString(e.payload);var n=G.resolve(r,G.fromString(""));var i;var s=r.hash;if(s==null){i="HEAD"}else if(s==""){i="HEAD"}else{var a=s;i=a}var l=lix_client_sources_Git.cli(".");var o=i.length!=40?X.next(l.eval(["ls-remote",G.toString(n),i]),(function(e){var t=StringTools.trim(e);if(t==""){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Cannot resolve version "+i,{fileName:"src/lix/client/sources/Git.hx",lineNumber:63,className:"lix.client.sources.Git",methodName:"processUrl"}))))}else{var r=t;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(HxOverrides.substr(r,0,40))))}})):new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(i)));return X.next(o,K.ofSafeSync((function(i){var s=e;var a=e.scheme+":";var l=G.resolve(r,G.fromString("#"+i));var o=L.Computed((function(e){return[e.name,e.version,"git",i]}));var c=F.Custom((function(e){var r=haxe_io_Path.join([t.scope.libCache,".gitrepos",lix_client_DownloadedArchive.escape(G.toString(n))]);var s=lix_client_sources_Git.cli(r);var a=s;var l=sys_FileSystem.exists(""+r+"/.git")?["fetch"]:["clone",G.toString(n),"."];return X.next(X.next(X.next(X.next(a.call(l),(function(e){return s.call(["-c","advice.detachedHead=false","checkout",i])})),(function(e){return s.call(["submodule","update","--init","--recursive"])})),(function(t){return haxeshim_sys_Fs.copy(r,e.dest,(function(e){return e!=""+r+"/.git"}))})),(function(t){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e.dest)))}))}));return{url:s,normalized:G.fromString(a+(l==null?"null":G.toString(l))),dest:o,lib:new lix_client_LibVersion(u.None,u.None),kind:c}})))},__class__:lix_client_sources_Git};var lix_client_sources_GitHub=function(e){this.credentials=e};t["lix.client.sources.GitHub"]=lix_client_sources_GitHub;lix_client_sources_GitHub.__name__="lix.client.sources.GitHub";lix_client_sources_GitHub.isArchive=function(e){var t=ie.parts(e);if(t.length==4){var r=t[0];var r=t[1];var r=t[3];if(se.toString(t[2])=="archive"){return true}else{return false}}else{return false}};lix_client_sources_GitHub.prototype={intercept:function(e){var t=e.auth;var t=e.hash;var t=e.host;var r=e.hosts;var r=e.path;var n=e.payload;var n=e.query;var i=e.scheme;var s=e.query==null?e.path:(e.path==null?"null":e.path)+"?"+(e.query==null?"null":e.query);if(t==null){return u.None}else{var s=ne.get_name(t);var a=ne.get_port(t);if(s==null){return u.None}else if(s=="github.com"){if(i==null){return u.None}else if(i=="https"){if(n==null){if(lix_client_sources_GitHub.isArchive(r)==false){return u.Some(this.processUrl(e))}else{return u.None}}else if(lix_client_sources_GitHub.isArchive(r)==false){return u.Some(this.processUrl(e))}else{return u.None}}else{return u.None}}else{return u.None}}},schemes:function(){return["github","gh"]},grabCommit:function(e,t,r){if(this.credentials==null&&(r==""||!j.isHash(r))){return X.next(X.mapError(lix_client_Download.bytes("https://github.com/"+e+"/"+t+".git/info/refs?service=git-upload-pack"),(function(r){if(r.code==401){return new tink_core_TypedError(r.code,r.message+(' - Possible typo in "'+e+"/"+t+'"'),{fileName:"src/lix/client/sources/GitHub.hx",lineNumber:35,className:"lix.client.sources.GitHub",methodName:"grabCommit"})}else{return r}})),(function(n){if(r==""){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(HxOverrides.substr(n.toString().split(" HEAD")[0],-40,null))))}var i="";var s=n.b.bufferValue;var a=0;var l=n.length;while(a<l){var o=a++;var u=s.bytes[o];if(u!=0){var c=u;i+=String.fromCodePoint(c)}}var a=0;var l=i.split("\n");while(a<l.length){var h=l[a];++a;var u=h.split(" ");if(u.length==2){var d;d=HxOverrides.substr(u[0],-40,null);var v=d;var m=u[1];if(v.length==40&&StringTools.endsWith(m,"/"+r)){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(v)))}}}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Failed to lookup sha for github:"+e+"/"+t+Std.string(n),{fileName:"src/lix/client/sources/GitHub.hx",lineNumber:60,className:"lix.client.sources.GitHub",methodName:"grabCommit"}))))}))}else{var n;if(this.credentials==null){n="null"}else{var i=this.credentials;n=i==null?"":""+i+"@"}return X.next(lix_client_Download.text("https://"+n+"api.github.com/repos/"+e+"/"+t+"/commits?sha="+r),(function(n){try{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(JSON.parse(n)[0].sha)))}catch(s){var n;if(r==null){n=""}else if(r==""){n=""}else{var i=r;n="#"+i}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Failed to lookup sha for github:"+e+"/"+t+n,{fileName:"src/lix/client/sources/GitHub.hx",lineNumber:73,className:"lix.client.sources.GitHub",methodName:"grabCommit"}))))}}))}},getArchive:function(e,t,r,n){var i=this;var doGet=function(r){return i.getArchive(e,t,r,n)};if(r==null){return X.next(this.grabCommit(e,t,""),doGet)}else{var s=r;if(s.length==40){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success({normalized:G.fromString("gh://"+(n==null?"":""+n+"@")+"github.com/"+e+"/"+t+"#"+s),dest:L.Computed((function(e){return[e.name,e.version,"github",s]})),url:G.fromString("https://"+(n==null?"":""+n+"@")+"github.com/"+e+"/"+t+"/archive/"+s+".tar.gz"),lib:new lix_client_LibVersion(u.Some(t),u.None)})))}else{var a=r;return X.next(this.grabCommit(e,t,a),doGet)}}},processUrl:function(e){var t=e.path;var r;if(t==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid github url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/client/sources/GitHub.hx",lineNumber:99,className:"lix.client.sources.GitHub",methodName:"processUrl"}))))}else{r=ae.toStringArray(ie.parts(t));if(r.length==2){var n=r[0];var i=r[1];return this.getArchive(n,lix_client_sources_Git.strip(i),e.hash,e.auth)}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid github url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/client/sources/GitHub.hx",lineNumber:102,className:"lix.client.sources.GitHub",methodName:"processUrl"}))))}}},__class__:lix_client_sources_GitHub};var lix_client_sources_GitLab=function(e){if(e==null){e=""}var t=StringTools.trim(e);var r;if(t==""){r=""}else{var n=t;r="private_token="+n}this.privateToken=r};t["lix.client.sources.GitLab"]=lix_client_sources_GitLab;lix_client_sources_GitLab.__name__="lix.client.sources.GitLab";lix_client_sources_GitLab.host=function(e){if(e==null){return"gitlab.com"}else{var t=e.host;if(t==null){return"gitlab.com"}else{var r=t;return r}}};lix_client_sources_GitLab.prototype={intercept:function(e){var t=e.auth;var t=e.hash;var t=e.host;var r=e.hosts;var r=e.path;var n=e.payload;var n=e.query;var i=e.scheme;var s=e.query==null?e.path:(e.path==null?"null":e.path)+"?"+(e.query==null?"null":e.query);if(t==null){return u.None}else{var s=ne.get_name(t);var a=ne.get_port(t);if(s==null){return u.None}else if(s=="gitlab.com"){if(i==null){return u.None}else if(i=="https"){if(n==null){if(se.toString(ie.parts(r)[0])=="api"==false){return u.Some(this.processUrl(e))}else{return u.None}}else if(se.toString(ie.parts(r)[0])=="api"==false){return u.Some(this.processUrl(e))}else{return u.None}}else{return u.None}}else{return u.None}}},schemes:function(){return["gitlab"]},grabCommit:function(e,t,r,n){return X.next(lix_client_Download.text("https://"+lix_client_sources_GitLab.host(n)+"/api/v4/projects/"+e+"%2F"+t+"/repository/commits/"+r+"?"+this.privateToken),(function(n){try{var i=JSON.parse(n);if(r==""){i=i[0]}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(i.id)))}catch(i){var n;if(r==null){n=""}else if(r==""){n=""}else{var s=r;n="#"+s}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Failed to lookup sha for gitlab:"+e+"/"+t+n,{fileName:"src/lix/client/sources/GitLab.hx",lineNumber:43,className:"lix.client.sources.GitLab",methodName:"grabCommit"}))))}}))},getArchive:function(e,t,r,n){if(r==null){var i=this;var s=e;var a=t;var l=n;var tmp=function(e){return i.getArchive(s,a,e,l)};return X.next(this.grabCommit(e,t,"",n),tmp)}else{var o=r;if(o.length==40){var c="https://"+lix_client_sources_GitLab.host(n)+"/api/v4/projects/"+e+"%2F"+t+"/repository/archive.zip?sha="+o+"&"+this.privateToken;var h=L.Computed((function(e){return[e.name,e.version,"gitlab",o]}));return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success({normalized:G.fromString(c),dest:h,url:G.fromString(c),lib:new lix_client_LibVersion(u.Some(t),u.None)})))}else{var d=r;var v=this;var m=e;var p=t;var _=n;var tmp=function(e){return v.getArchive(m,p,e,_)};return X.next(this.grabCommit(e,t,d,n),tmp)}}},processUrl:function(e){var t=e.path;var r;if(t==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid gitlab url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/client/sources/GitLab.hx",lineNumber:65,className:"lix.client.sources.GitLab",methodName:"processUrl"}))))}else{r=ae.toStringArray(ie.parts(t));if(r.length==2){var n=r[0];var i=r[1];return this.getArchive(n,lix_client_sources_Git.strip(i),e.hash,{host:e.host})}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid gitlab url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/client/sources/GitLab.hx",lineNumber:67,className:"lix.client.sources.GitLab",methodName:"processUrl"}))))}}},__class__:lix_client_sources_GitLab};var lix_client_sources_Haxelib=function(e){if(e==null){e="https://lib.haxe.org/"}this.baseURL=e};t["lix.client.sources.Haxelib"]=lix_client_sources_Haxelib;lix_client_sources_Haxelib.__name__="lix.client.sources.Haxelib";lix_client_sources_Haxelib.prototype={get_isOfficial:function(){return this.isOfficial=this.isOfficial!=null?this.isOfficial:"https://lib.haxe.org/"==this.baseURL},getBaseUrl:function(e){if(e==null){return G.fromString(this.baseURL)}else{var t=e.host;if(t==null){return G.fromString(this.baseURL)}else{var r=t;return G.fromString(""+(ne.get_port(r)==null?"https":"http")+"://"+(r==null?"null":r)+"/")}}},resolve:function(e,t){return G.resolve(this.getBaseUrl(t),e)},schemes:function(){return["haxelib"]},processUrl:function(e){var t=se.toString(le.toMap(e.query).h["url"]);if((t==null||t==this.baseURL)==true){var r=e.path;var n;if(r==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid haxelib url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/client/sources/Haxelib.hx",lineNumber:37,className:"lix.client.sources.Haxelib",methodName:"processUrl"}))))}else{n=ae.toStringArray(ie.parts(r));if(n.length==1){var i=n[0];return this.getArchive(i,e.hash,{host:e.host})}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid haxelib url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/client/sources/Haxelib.hx",lineNumber:39,className:"lix.client.sources.Haxelib",methodName:"processUrl"}))))}}}else{var i=t;return new lix_client_sources_Haxelib(i).processUrl(e)}},getArchive:function(e,t,r){var n=this;return X.next(this.getInfos(e,r),(function(e){var i;if(r==null){i=u.None}else{var s=r.host;if(s==null){i=u.None}else{var a=s;i=u.Some(a)}}var l=!(i==u.None&&n.get_isOfficial());var o=e.name;if(t==null){var getVersions=function(t){var r=[];var n=0;var i=e.versions;while(n<i.length){var s=i[n];++n;var a=te.parse(s.name);var l;if(a._hx_index==0){var o=a.data;if(t==null||t(o)){l=o}else{continue}}else{continue}r.push(l)}var u=r;u.sort((function(e,t){return te.compare(t,e)}));return u};var s=getVersions((function(e){return e.preview==null}));if(s.length==0){t=getVersions()[0].toString()}else{var c=s;t=c[0].toString()}}else{var h=false;var s=0;var d=e.versions;while(s<d.length){var c=d[s];++s;if(c.name==t){h=true;break}}if(!h){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Library "+o+" has no version "+t,{fileName:"src/lix/client/sources/Haxelib.hx",lineNumber:84,className:"lix.client.sources.Haxelib",methodName:"getArchive"}))))}}var v=n.resolve(G.fromString("/files/3.0/"+StringTools.replace(o,".",",")+"-"+StringTools.replace(t,".",",")+".zip"),r);var m;if(i._hx_index==0){var c=i.v;m=c}else{m=null}var p=G.make({scheme:"haxelib",host:m,path:ie.ofString("/"+o),hash:t,query:l?le.ofObj({url:n.baseURL}):null});var _=t;var m;if(l){var g=G.toString(n.getBaseUrl(r));m="@"+encodeURIComponent(g)}else{m=""}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success({url:v,normalized:p,dest:L.Fixed([o,_,"haxelib"+m]),kind:F.Zip,lib:new lix_client_LibVersion(u.Some(o),u.Some(t))})))}))},getInfos:function(e,t){var r=this;var f=function(n,i){var s=haxe_remoting_HttpAsyncConnection.urlConnect(G.toString(r.resolve(G.fromString("/api/3.0/index.n"),t)));s.setErrorHandler((function(e){i(tink_core_TypedError.withData(null,"Failed to get version information from haxelib because "+e,e,{fileName:"src/lix/client/sources/Haxelib.hx",lineNumber:105,className:"lix.client.sources.Haxelib",methodName:"getInfos"}))}));var a=new lix_client_sources_haxelib_Proxy(s.resolve("api"));a.infos(e,n)};var f1=function(e,t){f(e,t);return null};var wakeup=function(e){return f1((function(t){e(w.Success(t))}),(function(t){e(w.Failure(t))}))};return new tink_core__$Future_SuspendableFuture((function(e,t){return wakeup(e)}))},__class__:lix_client_sources_Haxelib};var lix_client_sources_Web=function(e){this.interceptors=e};t["lix.client.sources.Web"]=lix_client_sources_Web;lix_client_sources_Web.__name__="lix.client.sources.Web";lix_client_sources_Web.prototype={schemes:function(){return["http","https"]},processUrl:function(e){var t=0;var r=this.interceptors;while(t<r.length){var n=r[t];++t;var i=n(e);if(i._hx_index==0){var s=i.v;return s}}var a=L.Computed((function(t){return[t.name,t.version,G.toString(e)]}));return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success({url:e,dest:a,normalized:e,lib:null})))},__class__:lix_client_sources_Web};var lix_client_sources_haxelib_Async_$Repo=function(e){this.__cnx=e};t["lix.client.sources.haxelib.Async_Repo"]=lix_client_sources_haxelib_Async_$Repo;lix_client_sources_haxelib_Async_$Repo.__name__="lix.client.sources.haxelib.Async_Repo";lix_client_sources_haxelib_Async_$Repo.prototype={infos:function(e,t){this.__cnx.resolve("infos").call([e],t)},__class__:lix_client_sources_haxelib_Async_$Repo};var lix_client_sources_haxelib_Proxy=function(e){lix_client_sources_haxelib_Async_$Repo.call(this,e)};t["lix.client.sources.haxelib.Proxy"]=lix_client_sources_haxelib_Proxy;lix_client_sources_haxelib_Proxy.__name__="lix.client.sources.haxelib.Proxy";lix_client_sources_haxelib_Proxy.__super__=lix_client_sources_haxelib_Async_$Repo;lix_client_sources_haxelib_Proxy.prototype=$extend(lix_client_sources_haxelib_Async_$Repo.prototype,{__class__:lix_client_sources_haxelib_Proxy});var lix_client_uncompress_Tar=function(){};t["lix.client.uncompress.Tar"]=lix_client_uncompress_Tar;lix_client_uncompress_Tar.__name__="lix.client.uncompress.Tar";lix_client_uncompress_Tar.parse=function(e,t){return Y.async((function(r){var n=0;var i=0;var s=new V({onentry:function(e){n+=1;t(e)}});s.on("warn",(function(){i+=1}));s.on("end",(function(){r(n==0&&i!=0?w.Failure(new tink_core_TypedError(422,"Invalid tar archive.",{fileName:"src/lix/client/uncompress/Tar.hx",lineNumber:23,className:"lix.client.uncompress.Tar",methodName:"parse"})):w.Success(null))}));s.on("error",(function(e){r(w.Failure(new tink_core_TypedError(null,e.message,{fileName:"src/lix/client/uncompress/Tar.hx",lineNumber:26,className:"lix.client.uncompress.Tar",methodName:"parse"})))}));e.pipe(s,{end:true})}))};var V=r(4674).Parse;var sys_io_File=function(){};t["sys.io.File"]=sys_io_File;sys_io_File.__name__="sys.io.File";sys_io_File.copy=function(e,t){var r=g.openSync(e,"r");var n=g.fstatSync(r);var i=g.openSync(t,"w",n.mode);var s;var a=0;while(true){s=g.readSync(r,sys_io_File.copyBuf,0,65536,a);if(!(s>0)){break}g.writeSync(i,sys_io_File.copyBuf,0,s);a+=s}g.closeSync(r);g.closeSync(i)};var sys_io_FileInput=function(e){this.hasReachedEof=false;this.fd=e;this.pos=0};t["sys.io.FileInput"]=sys_io_FileInput;sys_io_FileInput.__name__="sys.io.FileInput";sys_io_FileInput.__super__=haxe_io_Input;sys_io_FileInput.prototype=$extend(haxe_io_Input.prototype,{readByte:function(){var e=O.alloc(1);var t;try{t=g.readSync(this.fd,e,0,1,this.pos)}catch(e){var r=haxe_Exception.caught(e).unwrap();if(r.code=="EOF"){this.hasReachedEof=true;throw haxe_Exception.thrown(new haxe_io_Eof)}throw haxe_Exception.thrown(h.Custom(r))}if(t==0){this.hasReachedEof=true;throw haxe_Exception.thrown(new haxe_io_Eof)}this.pos++;return e[0]},readBytes:function(e,t,r){var n=e.b;var i=O.from(n.buffer,n.byteOffset,e.length);var s;try{s=g.readSync(this.fd,i,t,r,this.pos)}catch(e){var a=haxe_Exception.caught(e).unwrap();if(a.code=="EOF"){this.hasReachedEof=true;throw haxe_Exception.thrown(new haxe_io_Eof)}throw haxe_Exception.thrown(h.Custom(a))}if(s==0){this.hasReachedEof=true;throw haxe_Exception.thrown(new haxe_io_Eof)}this.pos+=s;return s},__class__:sys_io_FileInput});var G={};G.resolve=function(e,t){if(t.scheme!=null){return t}else if(t.host!=null){if(t.scheme!=null){return t}else{var r=Reflect.copy(t);r.scheme=e.scheme;return r}}else{var n={path:ie.join(e.path,t.path),payload:"",scheme:e.scheme,query:t.query,auth:e.auth,host:e.host,hash:t.hash};G.makePayload(n);return n}};G.makePayload=function(e){var t="";var r=e.auth;var n=e.hash;var n=e.host;var i=e.hosts;var i=e.path;var i=e.payload;var i=e.query;var i=e.scheme;if(r==null){if(n!=null){var s=n;t+="//"+(s==null?"null":s)}}else if(n==null){var a=r;t+="//"+(a==null?"null":a==null?"":""+a+"@")}else{var a=r;var s=n;t+="//"+(a==null?"null":a==null?"":""+a+"@")+(s==null?"null":s)}t+=e.path==null?"null":e.path;var r=e.query;if(r!=null){var l=r;t+="?"+(l==null?"null":l)}var r=e.hash;if(r!=null){var l=r;t+="#"+l}e.payload=t.toString()};G.toString=function(e){if(e.scheme==null){return e.payload}else{return""+e.scheme+":"+e.payload}};G.fromString=function(e){return G.parse(e)};G.noop=function(e){};G.parse=function(e,t){if(e==null){return G.parse("")}if(t==null){t=G.noop}e=StringTools.trim(e);if(StringTools.startsWith(e,"data:")){return{scheme:"data",payload:HxOverrides.substr(e,5,null)}}var r=new EReg("^(([a-zA-Z][a-zA-Z0-9\\-+.]*):)?((//(([^@/]+)@)?([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?)$","");var n=new EReg("^(\\[(.*)\\]|([^:]*))(:(.*))?$","");r.match(e);var i;var s=r.matched(7);if(s==null){i=[]}else{var a=s;var s=[];var l=0;var o=a.split(",");while(l<o.length){var u=o[l];++l;n.match(u);var c;var h=n.matched(3);var d=n.matched(2);if(d==null){var v=h;c=v}else if(h==null){var m=d;c="["+m+"]"}else{t("invalid host "+u);c=null}var p;var _=n.matched(5);if(_==null){p=null}else{var a=_;var g=Std.parseInt(a);if(g==null){t("invalid port "+a);p=null}else{var w=g;p=w}}s.push(ne._new(c,p))}i=s}var x=r.matched(8);if(i.length>0&&x.charAt(0)!="/"){x="/"+x}return{scheme:r.matched(2),payload:r.matched(3),host:i[0],hosts:i,auth:r.matched(6),path:ie.ofString(x),query:r.matched(10),hash:r.matched(12)}};G.make=function(e){var t={payload:"",path:e.path,query:e.query,host:e.host,hosts:e.hosts,auth:e.auth,scheme:e.scheme,hash:e.hash};G.makePayload(t);return t};var $={};$.invoke=function(e,t){if($.depth<500){$.depth++;e(t);$.depth--}else{$.defer((function(){e(t)}))}};$.defer=function(e){global.setImmediate(e)};var tink_core_LinkObject=function(){};t["tink.core.LinkObject"]=tink_core_LinkObject;tink_core_LinkObject.__name__="tink.core.LinkObject";tink_core_LinkObject.__isInterface__=true;tink_core_LinkObject.prototype={__class__:tink_core_LinkObject};var tink_core_CallbackLinkRef=function(){};t["tink.core.CallbackLinkRef"]=tink_core_CallbackLinkRef;tink_core_CallbackLinkRef.__name__="tink.core.CallbackLinkRef";tink_core_CallbackLinkRef.__interfaces__=[tink_core_LinkObject];tink_core_CallbackLinkRef.prototype={cancel:function(){var e=this.link;if(e!=null){e.cancel()}},__class__:tink_core_CallbackLinkRef};var q={};q.fromMany=function(e){return new tink_core_SimpleLink((function(){if(e!=null){var t=0;while(t<e.length){var r=e[t];++t;if(r!=null){r.cancel()}}}else{e=null}}))};var tink_core_SimpleLink=function(e){this.f=e};t["tink.core.SimpleLink"]=tink_core_SimpleLink;tink_core_SimpleLink.__name__="tink.core.SimpleLink";tink_core_SimpleLink.__interfaces__=[tink_core_LinkObject];tink_core_SimpleLink.prototype={cancel:function(){if(this.f!=null){this.f();this.f=null}},__class__:tink_core_SimpleLink};var tink_core__$Callback_LinkPair=function(e,t){this.dissolved=false;this.a=e;this.b=t};t["tink.core._Callback.LinkPair"]=tink_core__$Callback_LinkPair;tink_core__$Callback_LinkPair.__name__="tink.core._Callback.LinkPair";tink_core__$Callback_LinkPair.__interfaces__=[tink_core_LinkObject];tink_core__$Callback_LinkPair.prototype={cancel:function(){if(!this.dissolved){this.dissolved=true;var e=this.a;if(e!=null){e.cancel()}var e=this.b;if(e!=null){e.cancel()}this.a=null;this.b=null}},__class__:tink_core__$Callback_LinkPair};var tink_core__$Callback_ListCell=function(e,t){if(e==null){throw haxe_Exception.thrown("callback expected but null received")}this.cb=e;this.list=t};t["tink.core._Callback.ListCell"]=tink_core__$Callback_ListCell;tink_core__$Callback_ListCell.__name__="tink.core._Callback.ListCell";tink_core__$Callback_ListCell.__interfaces__=[tink_core_LinkObject];tink_core__$Callback_ListCell.prototype={cancel:function(){if(this.list!=null){var e=this.list;this.cb=null;this.list=null;if(--e.used<=e.cells.length>>1){e.compact()}}},__class__:tink_core__$Callback_ListCell};var tink_core_Disposable=function(){};t["tink.core.Disposable"]=tink_core_Disposable;tink_core_Disposable.__name__="tink.core.Disposable";tink_core_Disposable.__isInterface__=true;var tink_core_OwnedDisposable=function(){};t["tink.core.OwnedDisposable"]=tink_core_OwnedDisposable;tink_core_OwnedDisposable.__name__="tink.core.OwnedDisposable";tink_core_OwnedDisposable.__isInterface__=true;tink_core_OwnedDisposable.__interfaces__=[tink_core_Disposable];var tink_core_SimpleDisposable=function(e){this.disposeHandlers=[];this.f=e};t["tink.core.SimpleDisposable"]=tink_core_SimpleDisposable;tink_core_SimpleDisposable.__name__="tink.core.SimpleDisposable";tink_core_SimpleDisposable.__interfaces__=[tink_core_OwnedDisposable];tink_core_SimpleDisposable.noop=function(){};tink_core_SimpleDisposable.prototype={dispose:function(){var e=this.disposeHandlers;if(e!=null){var t=e;this.disposeHandlers=null;var r=this.f;this.f=tink_core_SimpleDisposable.noop;r();var e=0;while(e<t.length){var n=t[e];++e;n()}}},__class__:tink_core_SimpleDisposable};var tink_core_CallbackList=function(e){if(e==null){e=false}this.onfill=function(){};this.ondrain=function(){};this.busy=false;this.queue=[];this.used=0;var t=this;tink_core_SimpleDisposable.call(this,(function(){if(!t.busy){t.destroy()}}));this.destructive=e;this.cells=[]};t["tink.core.CallbackList"]=tink_core_CallbackList;tink_core_CallbackList.__name__="tink.core.CallbackList";tink_core_CallbackList.__super__=tink_core_SimpleDisposable;tink_core_CallbackList.prototype=$extend(tink_core_SimpleDisposable.prototype,{destroy:function(){var e=0;var t=this.cells;while(e<t.length){var r=t[e];++e;r.cb=null;r.list=null}this.queue=null;this.cells=null;if(this.used>0){this.used=0;var n=this.ondrain;if($.depth<500){$.depth++;n();$.depth--}else{$.defer(n)}}},invoke:function(e){var t=this;if($.depth<500){$.depth++;if(t.disposeHandlers!=null){if(t.busy){if(t.destructive!=true){var r=t;var n=e;var tmp=function(){r.invoke(n)};t.queue.push(tmp)}}else{t.busy=true;if(t.destructive){t.dispose()}var i=t.cells.length;var s=0;var a=i;while(s<a){var l=s++;var o=t.cells[l];if(o.list!=null){o.cb(e)}}t.busy=false;if(t.disposeHandlers==null){t.destroy()}else{if(t.used<t.cells.length){t.compact()}if(t.queue.length>0){t.queue.shift()()}}}}$.depth--}else{$.defer((function(){if(t.disposeHandlers!=null){if(t.busy){if(t.destructive!=true){var r=t;var n=e;var tmp=function(){r.invoke(n)};t.queue.push(tmp)}}else{t.busy=true;if(t.destructive){t.dispose()}var i=t.cells.length;var s=0;var a=i;while(s<a){var l=s++;var o=t.cells[l];if(o.list!=null){o.cb(e)}}t.busy=false;if(t.disposeHandlers==null){t.destroy()}else{if(t.used<t.cells.length){t.compact()}if(t.queue.length>0){t.queue.shift()()}}}}}))}},compact:function(){if(this.busy){return}else if(this.used==0){this.resize(0);var e=this.ondrain;if($.depth<500){$.depth++;e();$.depth--}else{$.defer(e)}}else{var t=0;var r=0;var n=this.cells.length;while(r<n){var i=r++;var s=this.cells[i];var a=s.list;if(s.cb!=null){var l=s;if(t!=i){this.cells[t]=l}if(++t==this.used){break}}}this.resize(this.used)}},resize:function(e){this.cells.length=e},__class__:tink_core_CallbackList});var tink_core_TypedError=function(e,t,r){if(e==null){e=500}this.isTinkError=true;this.code=e;this.message=t;this.pos=r;this.exceptionStack=[];this.callStack=[]};t["tink.core.TypedError"]=tink_core_TypedError;tink_core_TypedError.__name__="tink.core.TypedError";tink_core_TypedError.withData=function(e,t,r,n){return tink_core_TypedError.typed(e,t,r,n)};tink_core_TypedError.typed=function(e,t,r,n){var i=new tink_core_TypedError(e,t,n);i.data=r;return i};tink_core_TypedError.asError=function(e){if(e!=null&&e.isTinkError){return e}else{return null}};tink_core_TypedError.catchExceptions=function(e,t,r){try{return w.Success(e())}catch(e){var n=haxe_Exception.caught(e).unwrap();var i=tink_core_TypedError.asError(n);var s;if(i==null){s=t==null?tink_core_TypedError.withData(null,"Unexpected Error",n,r):t(n)}else{var a=i;s=a}return w.Failure(s)}};tink_core_TypedError.tryFinally=function(e,t){try{return e()}finally{t()}return null};tink_core_TypedError.prototype={printPos:function(){return this.pos.className+"."+this.pos.methodName+":"+this.pos.lineNumber},toString:function(){var e="Error#"+this.code+": "+this.message;if(this.pos!=null){e+=" @ "+this.printPos()}return e},throwSelf:function(){var e=this;throw haxe_Exception.thrown(e)},__class__:tink_core_TypedError};var tink_core__$Future_FutureObject=function(){};t["tink.core._Future.FutureObject"]=tink_core__$Future_FutureObject;tink_core__$Future_FutureObject.__name__="tink.core._Future.FutureObject";tink_core__$Future_FutureObject.prototype={getStatus:function(){return Z.NeverEver},handle:function(e){return null},eager:function(){},__class__:tink_core__$Future_FutureObject};var tink_core__$Future_SyncFuture=function(e){tink_core__$Future_FutureObject.call(this);this.value=e};t["tink.core._Future.SyncFuture"]=tink_core__$Future_SyncFuture;tink_core__$Future_SyncFuture.__name__="tink.core._Future.SyncFuture";tink_core__$Future_SyncFuture.__super__=tink_core__$Future_FutureObject;tink_core__$Future_SyncFuture.prototype=$extend(tink_core__$Future_FutureObject.prototype,{getStatus:function(){return Z.Ready(this.value)},handle:function(e){$.invoke(e,_.get(this.value));return null},eager:function(){if(!this.value.isComputed()){_.get(this.value)}},__class__:tink_core__$Future_SyncFuture});var Y={};Y.never=function(){return Y.NEVER_INST};Y.map=function(e,t,r){var n=e.getStatus();switch(n._hx_index){case 3:var i=n.result;var s=i;var a=t;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyFunc((function(){return a(s.get())}),s));case 4:return Y.never();default:return new tink_core__$Future_SuspendableFuture((function(r,n){return e.handle((function(e){r(t(e))}))}))}};Y.flatMap=function(e,t,r){var n=e.getStatus();switch(n._hx_index){case 3:var i=n.result;return new tink_core__$Future_SuspendableFuture((function(e,r){return t(_.get(i)).handle((function(t){e(t)}))}));case 4:return Y.never();default:return new tink_core__$Future_SuspendableFuture((function(r,n){var i=new tink_core_CallbackLinkRef;var s=e.handle((function(e){var s=t(e);if(s.getStatus()._hx_index==4){n()}else{var a=s;var l=a.handle(r);var o=i.link;if(o!=null){o.cancel()}i.link=l}}));return new tink_core__$Callback_LinkPair(s,i)}))}};Y.inSequence=function(e){return Y.many(e,1)};Y.many=function(e,t){return Y.processMany(e,t,w.Success,(function(e){return tink_core_OutcomeTools.orNull(e)}))};Y.processMany=function(e,t,r,n){if(e.length==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(n(w.Success([]))))}else{var wakeup=function(i){var s=[];var a=[];var l=0;while(l<e.length){var o=e[l];++l;a.push(null)}var u=a;var c=0;var h=0;var d=false;var v;if(t==null){v=e.length}else{var m=t;v=m<1?1:m>e.length?e.length:m}var fireWhenReady=function(){if(c==u.length){if(h==0){var e=n(w.Success(u));d=true;i(e);return true}else{return false}}else{return false}};var p=null;p=function(){if(!d&&!fireWhenReady()){while(c<u.length){c+=1;var t=[c-1];var a=e[t[0]];var l=[function(e){return function(t){var a=r(t);switch(a._hx_index){case 0:var l=a.data;u[e[0]]=l;fireWhenReady();break;case 1:var o=a.failure;var a=0;while(a<s.length){var c=s[a];++a;if(c!=null){c.cancel()}}var l=n(w.Failure(o));d=true;i(l);break}}}(t)];var o=a.getStatus();if(o._hx_index==3){var v;v=_.get(o.result);var m=v;l[0](m);if(!d){continue}}else{h+=1;s.push(a.handle(function(e){return function(t){h-=1;e[0](t);if(!d){p()}}}(l)))}break}}};var a=0;var l=v;while(a<l){var g=a++;p()}return q.fromMany(s)};return new tink_core__$Future_SuspendableFuture((function(e,t){return wakeup(e)}))}};Y.async=function(e,t){if(t==null){t=false}var r=Y.irreversible(e);if(t){return r}else{r.eager();return r}};Y.irreversible=function(e){return new tink_core__$Future_SuspendableFuture((function(t,r){e(t);return null}))};Y.delay=function(e,t){var r=Y.irreversible((function(r){haxe_Timer.delay((function(){r(_.get(t))}),e)}));r.eager();return r};var Z=n["tink.core.FutureStatus"]={__ename__:"tink.core.FutureStatus",__constructs__:null,Suspended:{_hx_name:"Suspended",_hx_index:0,__enum__:"tink.core.FutureStatus",toString:$estr},Awaited:{_hx_name:"Awaited",_hx_index:1,__enum__:"tink.core.FutureStatus",toString:$estr},EagerlyAwaited:{_hx_name:"EagerlyAwaited",_hx_index:2,__enum__:"tink.core.FutureStatus",toString:$estr},Ready:(i=function(e){return{_hx_index:3,result:e,__enum__:"tink.core.FutureStatus",toString:$estr}},i._hx_name="Ready",i.__params__=["result"],i),NeverEver:{_hx_name:"NeverEver",_hx_index:4,__enum__:"tink.core.FutureStatus",toString:$estr}};Z.__constructs__=[Z.Suspended,Z.Awaited,Z.EagerlyAwaited,Z.Ready,Z.NeverEver];var tink_core__$Future_SuspendableFuture=function(e){this.status=Z.Suspended;var t=this;tink_core__$Future_FutureObject.call(this);this.wakeup=e;this.callbacks=new tink_core_CallbackList(true);this.callbacks.ondrain=function(){if(t.status==Z.Awaited){t.status=Z.Suspended;var e=t.link;if(e!=null){e.cancel()}t.link=null}};this.callbacks.onfill=function(){if(t.status==Z.Suspended){t.status=Z.Awaited;t.arm()}}};t["tink.core._Future.SuspendableFuture"]=tink_core__$Future_SuspendableFuture;tink_core__$Future_SuspendableFuture.__name__="tink.core._Future.SuspendableFuture";tink_core__$Future_SuspendableFuture.__super__=tink_core__$Future_FutureObject;tink_core__$Future_SuspendableFuture.prototype=$extend(tink_core__$Future_FutureObject.prototype,{getStatus:function(){return this.status},trigger:function(e){var t=this.status;if(t._hx_index==3){var r=t.result}else{this.status=Z.Ready(new tink_core__$Lazy_LazyConst(e));var n=this.link;this.link=null;this.wakeup=null;this.callbacks.invoke(e);if(n!=null){n.cancel()}}},handle:function(e){var t=this.status;if(t._hx_index==3){var r=t.result;$.invoke(e,_.get(r));return null}else{var n=this.callbacks;if(n.disposeHandlers==null){return null}else{var i=new tink_core__$Callback_ListCell(e,n);n.cells.push(i);if(n.used++==0){var s=n.onfill;if($.depth<500){$.depth++;s();$.depth--}else{$.defer(s)}}return i}}},destroy:function(){this.callbacks.dispose();this.status=Z.NeverEver},arm:function(){var e=this;this.link=this.wakeup((function(t){e.trigger(t)}),$bind(this,this.destroy))},eager:function(){switch(this.status._hx_index){case 0:this.status=Z.EagerlyAwaited;this.arm();break;case 1:this.status=Z.EagerlyAwaited;break;default:}},__class__:tink_core__$Future_SuspendableFuture});var tink_core__$Lazy_LazyFunc=function(e,t){this.f=e;this.from=t};t["tink.core._Lazy.LazyFunc"]=tink_core__$Lazy_LazyFunc;tink_core__$Lazy_LazyFunc.__name__="tink.core._Lazy.LazyFunc";tink_core__$Lazy_LazyFunc.__interfaces__=[tink_core__$Lazy_LazyObject];tink_core__$Lazy_LazyFunc.prototype={underlying:function(){return this.from},isComputed:function(){return this.f==null},get:function(){return this.result},compute:function(){var e=this.f;if(e!=null){var t=e;this.f=null;var e=this.from;if(e!=null){var r=e;this.from=null;var n=[];while(r!=null&&!r.isComputed()){n.push(r);r=r.underlying()}n.reverse();var e=0;while(e<n.length){var i=n[e];++e;i.compute()}}this.result=t()}},__class__:tink_core__$Lazy_LazyFunc};var tink_core_NamedWith=function(e,t){this.name=e;this.value=t};t["tink.core.NamedWith"]=tink_core_NamedWith;tink_core_NamedWith.__name__="tink.core.NamedWith";tink_core_NamedWith.prototype={__class__:tink_core_NamedWith};var tink_core_OutcomeTools=function(){};t["tink.core.OutcomeTools"]=tink_core_OutcomeTools;tink_core_OutcomeTools.__name__="tink.core.OutcomeTools";tink_core_OutcomeTools.sure=function(e){switch(e._hx_index){case 0:var t=e.data;return t;case 1:var r=e.failure;var n=tink_core_TypedError.asError(r);if(n==null){throw haxe_Exception.thrown(r)}else{var i=n;return i.throwSelf()}break}};tink_core_OutcomeTools.orNull=function(e){switch(e._hx_index){case 0:var t=e.data;return t;case 1:var r=e.failure;return null}};tink_core_OutcomeTools.map=function(e,t){switch(e._hx_index){case 0:var r=e.data;return w.Success(t(r));case 1:var n=e.failure;return w.Failure(n)}};var X={};X.never=function(){return Y.never()};X.mapError=function(e,t){return Y.map(e,(function(e){switch(e._hx_index){case 0:var r=e.data;return e;case 1:var n=e.failure;return w.Failure(t(n))}}))};X.noise=function(e){if(e.getStatus()._hx_index==4){return X.never()}else{return X.next(e,(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}))}};X.next=function(e,t,r){return Y.flatMap(e,(function(e){switch(e._hx_index){case 0:var r=e.data;return t(r);case 1:var n=e.failure;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(n)))}}))};X.inParallel=function(e,t){return X.many(e,t)};X.many=function(e,t){return Y.processMany(e,t,(function(e){return e}),(function(e){return e}))};X.inSequence=function(e){return X.many(e,1)};var K={};K.ofSafeSync=function(e){return function(t){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e(t))))}};var J={};J.ofSync=function(e){return function(t){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(e(t)))}};var tink_parse_Char=function(){};t["tink.parse.Char"]=tink_parse_Char;tink_parse_Char.__name__="tink.parse.Char";var tink_parse_ParserBase=function(e){this.source=e;this.max=e.length;this.pos=0};t["tink.parse.ParserBase"]=tink_parse_ParserBase;tink_parse_ParserBase.__name__="tink.parse.ParserBase";tink_parse_ParserBase.prototype={skipIgnored:function(){while(this.lastSkip!=this.pos){this.lastSkip=this.pos;this.doSkipIgnored()}this.lastSkip=this.pos;return null},doSkipIgnored:function(){},allowHere:function(e){if(Q.hasSub(this.source,e,this.pos)){this.pos+=e.length;return true}else{return false}},die:function(e,t){if(t==null){t=new IntIterator(this.pos,this.pos+1)}var r=t.min;var n=t.max;throw haxe_Exception.thrown(this.makeError(e,this.doMakePos(r,n==null?r+1:n)))},makeError:function(e,t){throw haxe_Exception.thrown("ni")},doMakePos:function(e,t){throw haxe_Exception.thrown("ni")},__class__:tink_parse_ParserBase};var tink_parse__$StringSlice_Data=function(e,t,r){this.string=e;this.start=t;this.end=r;if((this.length=r-t)<0){this.length=0;this.end=this.start}};t["tink.parse._StringSlice.Data"]=tink_parse__$StringSlice_Data;tink_parse__$StringSlice_Data.__name__="tink.parse._StringSlice.Data";tink_parse__$StringSlice_Data.prototype={toString:function(){if(this.representation==null){this.representation=this.string.substring(this.start,this.end)}return this.representation},__class__:tink_parse__$StringSlice_Data};var Q={};Q._new=function(e,t,r){return new tink_parse__$StringSlice_Data(e,t==e.length?t:t<0?t%e.length+e.length:t%e.length,r==e.length?r:r<0?r%e.length+e.length:r%e.length)};Q.clamp=function(e,t){if(t<0){if(-t>e.length){return 0}else{return t+e.length}}else if(t>e.length){return e.length}else{return t}};Q.wrap=function(e,t){if(e.length==0){return 0}else if(t<0){return t%e.length+e.length}else{return t%e.length}};Q.ofString=function(e){if(e==null||e==""){return Q.EMPTY}else if(e.length==1){var t=e.charCodeAt(0);if(t<Q.CHARS.length){return Q.CHARS[t]}else{return new tink_parse__$StringSlice_Data(e,0,e.length)}}else{return new tink_parse__$StringSlice_Data(e,0,e.length)}};Q.hasSub=function(e,t,r){if(r==null){r=0}r=Q.wrap(e,r);if(r+t.length>e.length){return false}var n=e;var i=t;return Q.isEqual(n.string,n.start+r,t.length,i.string,i.start,i.length)};Q.isEqual=function(e,t,r,n,i,s){if(s!=r){return false}var a=0;var l=s;while(a<l){var o=a++;if(e.charCodeAt(t+o)!=n.charCodeAt(i+o)){return false}}return true};var tink_semver_Parser=function(e){tink_parse_ParserBase.call(this,e)};t["tink.semver.Parser"]=tink_semver_Parser;tink_semver_Parser.__name__="tink.semver.Parser";tink_semver_Parser.__super__=tink_parse_ParserBase;tink_semver_Parser.prototype=$extend(tink_parse_ParserBase.prototype,{doSkipIgnored:function(){var e=tink_parse_Char.WHITE;while(true){var t;if(this.pos<this.max){var r=this.source;var n=r.string.charCodeAt(this.pos+r.start);t=e==null||e(n)}else{t=false}if(!t){break}this.pos++}},num:function(){var e=tink_parse_Char.DIGIT;this.skipIgnored();var t=this.pos;while(true){var r;if(this.pos<this.max){var n=this.source;var i=n.string.charCodeAt(this.pos+n.start);r=e==null||e(i)}else{r=false}if(!r){break}this.pos++}var n=this.source;var s=t;var a=this.pos;var r=Std.parseInt(Q._new(n.string,Q.wrap(n,s)+n.start,Q.clamp(n,a)+n.start).toString());if(r==null){return-1}else{var l=r;return l}},parseVersion:function(){var e=this.parseInlineVersion();this.skipIgnored();if(this.pos==this.max){return e}else{return this.die("Unexpected string",new IntIterator(this.pos,this.max))}},parsePartial:function(){var e=this;var t=this.pos;var next=function(){if(e.allowHere(Q.ofString("."))){return e.num()}else{return-1}};var r=this.num();var n=next();var i=next();var s=null;var a=-1;if(i>=0&&this.allowHere(tink_semver_Parser.HYPHEN)){var l=tink_parse_Char.LOWER;this.skipIgnored();var o=this.pos;while(true){var u;if(this.pos<this.max){var c=this.source;var h=c.string.charCodeAt(this.pos+c.start);u=l==null||l(h)}else{u=false}if(!u){break}this.pos++}var c=this.source;var d=o;var v=this.pos;s=tink_core_OutcomeTools.sure(ee.ofString(Q._new(c.string,Q.wrap(c,d)+c.start,Q.clamp(c,v)+c.start).toString()));if(this.allowHere(tink_semver_Parser.DOT)){a=this.num()}}return{major:r,minor:n,patch:i,preview:s,previewNum:a,pos:new IntIterator(t,this.pos)}},clamp:function(e){if(e<0){return 0}else{return e}},full:function(e,t){if(t!=true&&e.patch<0){this.die("Partial version not allowed",e.pos)}var r=te._new(e.major,this.clamp(e.minor),this.clamp(e.patch));if(e.preview!=null){return new tink_semver__$Version_Data(r.major,r.minor,r.patch,e.preview,e.previewNum)}else{return r}},parseInlineVersion:function(){return this.full(this.parsePartial())},makeError:function(e,t){var r=this.source;var n=Q._new(r.string,Q.wrap(r,t.min)+r.start,Q.clamp(r,t.max)+r.start);return new tink_core_TypedError(null,""+e+" at "+('"'+(n==null?"null":n.toString())+'"('+t.min+"-"+t.max+")")+(' in "'+(this.source==null?"null":this.source.toString())+'"'),{fileName:"tink/semver/Parser.hx",lineNumber:149,className:"tink.semver.Parser",methodName:"makeError"})},doMakePos:function(e,t){return new IntIterator(e,t)},__class__:tink_semver_Parser});var ee={};ee.ofString=function(e){switch(e){case"alpha":return w.Success("alpha");case"beta":return w.Success("beta");case"rc":return w.Success("rc");default:return w.Failure(new tink_core_TypedError(422,""+e+" should be alpha | beta | rc",{fileName:"tink/semver/Preview.hx",lineNumber:14,className:"tink.semver._Preview.Preview_Impl_",methodName:"ofString"}))}};var te={};te._new=function(e,t,r){if(r==null){r=0}if(t==null){t=0}return new tink_semver__$Version_Data(e,t,r)};te.compare=function(e,t){var r=e.major-t.major;var n=e.minor-t.minor;var i=re.chain(r>0?1:r<0?-1:0,n>0?1:n<0?-1:0);var r=e.patch-t.patch;var s=re.chain(i,r>0?1:r<0?-1:0);var r=te.idx(e,e.preview)-te.idx(e,t.preview);var i=re.chain(s,r>0?1:r<0?-1:0);var r=e.previewNum-t.previewNum;return re.chain(i,r>0?1:r<0?-1:0)};te.idx=function(e,t){if(t==null){return 100}else{switch(t){case"alpha":return 1;case"beta":return 2;case"rc":return 3}}};te.parse=function(e){return tink_core_TypedError.catchExceptions((i=new tink_semver_Parser(Q.ofString(e)),$bind(i,i.parseVersion)),te.reportError,{fileName:"tink/semver/Version.hx",lineNumber:97,className:"tink.semver._Version.Version_Impl_",methodName:"parse"})};te.reportError=function(e){if(typeof e=="string"){return new tink_core_TypedError(422,e,{fileName:"tink/semver/Version.hx",lineNumber:103,className:"tink.semver._Version.Version_Impl_",methodName:"reportError"})}else{return tink_core_TypedError.withData(422,Std.string(e),e,{fileName:"tink/semver/Version.hx",lineNumber:105,className:"tink.semver._Version.Version_Impl_",methodName:"reportError"})}};var tink_semver__$Version_Data=function(e,t,r,n,i){if(i==null){i=-1}if(e<0||t<0||r<0){throw haxe_Exception.thrown("version components must not be negative")}this.major=e;this.minor=t;this.patch=r;this.preview=n;this.previewNum=i};t["tink.semver._Version.Data"]=tink_semver__$Version_Data;tink_semver__$Version_Data.__name__="tink.semver._Version.Data";tink_semver__$Version_Data.prototype={toString:function(){var e=""+this.major+"."+this.minor+"."+this.patch;if(this.preview!=null){e+="-"+this.preview;if(this.previewNum!=-1){e+="."+this.previewNum}}return e},__class__:tink_semver__$Version_Data};var re={};re.chain=function(e,t){if(e==0){return t}else{return e}};var ne={};ne._new=function(e,t){var r;if(t==null){r=e}else if(t>65535||t<=0){throw haxe_Exception.thrown("Invalid port")}else{r=""+e+":"+t}return r};ne.get_name=function(e){if(e==null){return null}else{var t=e.split("]");switch(t.length){case 1:var r=t[0];return r.split(":")[0];case 2:var n=t[1];var r=t[0];return r+"]";default:throw haxe_Exception.thrown("assert")}}};ne.get_port=function(e){if(e==null){return null}else{var t=e.split("]");switch(t.length){case 1:var r=t[0];var n=r.split(":")[1];if(n==null){return null}else{var i=n;return Std.parseInt(i)}break;case 2:var n=t[0];var r=t[1];var t=r.split(":")[1];if(t==null){return null}else{var i=t;return Std.parseInt(i)}break;default:throw haxe_Exception.thrown("assert")}}};var ie={};ie.parts=function(e){var t=[];var r=0;var n=e.split("/");while(r<n.length){var i=n[r];++r;if(i!=""){t.push(i)}}return t};ie.join=function(e,t){if(t==""){return e}else if(t.charAt(0)=="/"){return t}else if(e.charAt(e.length-1)=="/"){return ie.ofString(e+t)}else{var r=e.lastIndexOf("/");if(r==-1){return t}else{var n=r;return ie.ofString(HxOverrides.substr(e,0,n+1)+(t==null?"null":t))}}};ie.ofString=function(e){return ie.normalize(e)};ie.normalize=function(e){e=StringTools.trim(StringTools.replace(e,"\\","/"));if(e=="."){return"./"}var t=StringTools.endsWith(e,"/..")||StringTools.endsWith(e,"/")||StringTools.endsWith(e,"/.");var r=[];var n=StringTools.startsWith(e,"/");var i=0;var s=0;var a=e.split("/");while(s<a.length){var l=a[s];++s;var o=StringTools.trim(l);switch(o){case"":break;case".":break;case"..":if(r.pop()==null){++i}break;default:var u=o;r.push(u)}}if(n){r.unshift("")}else{var s=0;var a=i;while(s<a){var c=s++;r.unshift("..")}}if(t){r.push("")}return r.join("/")};var se={};se.toString=function(e){if(e==null){return null}else{return decodeURIComponent(e.split("+").join(" "))}};se.ofString=function(e){return e==null?"":encodeURIComponent(e)};var ae={};ae.toStringArray=function(e){var t=[];var r=0;while(r<e.length){var n=e[r];++r;t.push(se.toString(n))}return t};var le={};le.toMap=function(e){var t=new haxe_ds_StringMap;var r=new tink_url__$Query_QueryStringParser(e,"&","=",0);while(r.hasNext()){var n=r.next();t.h[n.name.toString()]=n.value}return t};le.ofObj=function(e){var t=[];var r=e;var n=0;var i=Reflect.fields(r);while(n<i.length){var s=i[n];++n;t.push(se.ofString(s)+"="+se.ofString(r[s]))}return t.join("&")};var tink_url__$Query_QueryStringParser=function(e,t,r,n){this.s=e==null?"":e;this.sep=t;this.set=r;this.pos=n};t["tink.url._Query.QueryStringParser"]=tink_url__$Query_QueryStringParser;tink_url__$Query_QueryStringParser.__name__="tink.url._Query.QueryStringParser";tink_url__$Query_QueryStringParser.trimmedSub=function(e,t,r){if(t>=e.length){return""}while(e.charCodeAt(t)<33)++t;if(r<e.length-1){while(e.charCodeAt(r-1)<33)--r}return e.substring(t,r)};tink_url__$Query_QueryStringParser.prototype={hasNext:function(){return this.pos<this.s.length},next:function(){var e=this.s.indexOf(this.sep,this.pos);if(e==-1){e=this.s.length}var t=this.s.indexOf(this.set,this.pos);var r=this.pos;this.pos=e+this.sep.length;if(t==-1||t>e){return new tink_core_NamedWith(se.toString(tink_url__$Query_QueryStringParser.trimmedSub(this.s,r,e)),se.ofString(""))}else{return new tink_core_NamedWith(se.toString(tink_url__$Query_QueryStringParser.trimmedSub(this.s,r,t)),tink_url__$Query_QueryStringParser.trimmedSub(this.s,t+this.set.length,e))}},__class__:tink_url__$Query_QueryStringParser};function $keyValueIterator(e){if(e instanceof Array)return function(){return HxOverrides.keyValueIter(e)};return typeof e.keyValueIterator=="function"?$bind(e,e.keyValueIterator):e.keyValueIterator}function $getIterator(e){if(e instanceof Array)return new haxe_iterators_ArrayIterator(e);else return e.iterator()}function $bind(t,r){if(r==null)return null;if(r.__id__==null)r.__id__=e.$haxeUID++;var n;if(t.hx__closures__==null)t.hx__closures__={};else n=t.hx__closures__[r.__id__];if(n==null){n=r.bind(t);t.hx__closures__[r.__id__]=n}return n}function $arrayPush(e){return this.push(e)}e.$haxeUID|=0;js_Boot.__toStr={}.toString;if(String.fromCodePoint==null)String.fromCodePoint=function(e){return e<65536?String.fromCharCode(e):String.fromCharCode((e>>10)+55232)+String.fromCharCode((e&1023)+56320)};Object.defineProperty(String.prototype,"__class__",{value:t["String"]=String,enumerable:false,writable:true});String.__name__="String";t["Array"]=Array;Array.__name__="Array";Date.prototype.__class__=t["Date"]=Date;Date.__name__="Date";var oe={};var ue={};var ce=Number;var he=Boolean;var fe={};var de={};if(typeof performance!="undefined"?typeof performance.now=="function":false){HxOverrides.now=performance.now.bind(performance)}t["Math"]=Math;if(ArrayBuffer.prototype.slice==null){ArrayBuffer.prototype.slice=js_lib__$ArrayBuffer_ArrayBufferCompat.sliceImpl}ANSI.values=function(e){var t;var r=new haxe_ds_EnumValueMap;r.set(s.Off,0);r.set(s.Bold,1);r.set(s.Underline,4);r.set(s.Blink,5);r.set(s.ReverseVideo,7);r.set(s.Concealed,8);r.set(s.BoldOff,22);r.set(s.UnderlineOff,24);r.set(s.BlinkOff,25);r.set(s.NormalVideo,27);r.set(s.ConcealedOff,28);r.set(s.Black,30);r.set(s.Red,31);r.set(s.Green,32);r.set(s.Yellow,33);r.set(s.Blue,34);r.set(s.Magenta,35);r.set(s.Cyan,36);r.set(s.White,37);r.set(s.DefaultForeground,39);r.set(s.BlackBack,40);r.set(s.RedBack,41);r.set(s.GreenBack,42);r.set(s.YellowBack,43);r.set(s.BlueBack,44);r.set(s.MagentaBack,45);r.set(s.CyanBack,46);r.set(s.WhiteBack,47);r.set(s.DefaultBackground,49);t=r;return t}(this);ANSI.available=ANSI.detectSupport();ANSI.strip=false;ANSI.stripIfUnavailable=true;DateTools.DAY_SHORT_NAMES=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];DateTools.DAY_NAMES=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];DateTools.MONTH_SHORT_NAMES=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];DateTools.MONTH_NAMES=["January","February","March","April","May","June","July","August","September","October","November","December"];haxe_SysTools.winMetaCharacters=[32,40,41,37,33,94,34,60,62,38,124,10,13,44,59];haxe_Serializer.USE_CACHE=false;haxe_Serializer.USE_ENUM_INDEX=false;haxe_Serializer.BASE64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";haxe_Unserializer.DEFAULT_RESOLVER=new haxe__$Unserializer_DefaultResolver;haxe_Unserializer.BASE64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";haxeshim__$Logger_SysLogger.isTTY=process.stderr.isTTY;haxeshim__$Logger_SysLogger.out=function(e){var t;ANSI.available=haxeshim__$Logger_SysLogger.isTTY;t=new _$Sys_FileOutput(2);return t}(this);haxeshim_sys_Os.IS_WINDOWS=Sys.systemName()=="Windows";haxeshim_sys_Os.DELIMITER=haxeshim_sys_Os.IS_WINDOWS?";":":";haxeshim_sys_Os.EXECUTABLE_EXTENSION=haxeshim_sys_Os.IS_WINDOWS?".exe":"";haxeshim_scope_Scope.CONFIG_FILE=".haxerc";haxeshim_scope_Scope.fs={isDirectory:function(e){try{return sys_FileSystem.isDirectory(e)}catch(e){return false}},readFile:function(e){try{return w.Success(g.readFileSync(e,{encoding:"utf8"}))}catch(r){var t=haxe_Exception.caught(r).unwrap();return w.Failure("Cannot read "+e+" because "+Std.string(t))}}};haxeshim_scope_Scope.DEFAULT_ROOT=function(e){var t;var r=haxeshim_scope_Scope.env("HAXE_ROOT");var n=haxeshim_scope_Scope.env("HAXESHIM_ROOT");var i=haxeshim_sys_Os.IS_WINDOWS?"APPDATA":"HOME";var s=new tink_core__$Lazy_LazyConst(process.env[i]+"/haxe");var a;if(n._hx_index==0){var l=n.v;a=l}else{a=_.get(s)}var s=new tink_core__$Lazy_LazyConst(a);t=r._hx_index==0?function(e){var t;var n=r.v;t=n;return t}(e):_.get(s);return t}(this);lix_client_DownloadedArchive.RESERVED="!#$&'()*+,/:;=?@[]";lix_client_Download.initZip=function(e){var t;var r=P.validateFileName;P.validateFileName=function(e){return null};t=true;return t}(this);lix_client_Download.USER_AGENT="lix";lix_client_LibVersion.UNDEFINED=new lix_client_LibVersion(u.None,u.None);lix_client_haxe_Switcher.VERSION_INFO="version.json";j.hex=function(e){var t;var r=new haxe_ds_IntMap;{var n=0;var i="0123456789abcdefABCDEF".split("");while(n<i.length){var s=i[n];++n;r.h[HxOverrides.cca(s,0)]=true}}t=r;return t}(this);sys_io_File.copyBuf=O.alloc(65536);$.depth=0;Y.NEVER_INST=new tink_core__$Future_FutureObject;X.NOISE=new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)));tink_parse_Char.WHITE=function(e){return e<33};tink_parse_Char.LOWER=function(e){if(e>=97){return e<=122}else{return false}};tink_parse_Char.DIGIT=function(e){if(e>=48){return e<=57}else{return false}};Q.CHARS=function(e){var t;var r=[];{var n=0;while(n<128){var i=n++;r.push(new tink_parse__$StringSlice_Data(String.fromCodePoint(i),0,1))}}t=r;return t}(this);Q.EMPTY=new tink_parse__$StringSlice_Data("",0,0);tink_semver_Parser.DOT=Q.ofString(".");tink_semver_Parser.HYPHEN=Q.ofString("-");lix_cli_Cli.main()})(typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:this)},4794:(e,t,r)=>{var n=r(4300).Buffer;var i=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];if(typeof Int32Array!=="undefined"){i=new Int32Array(i)}function ensureBuffer(e){if(n.isBuffer(e)){return e}var t=typeof n.alloc==="function"&&typeof n.from==="function";if(typeof e==="number"){return t?n.alloc(e):new n(e)}else if(typeof e==="string"){return t?n.from(e):new n(e)}else{throw new Error("input must be buffer, number, or string, received "+typeof e)}}function bufferizeInt(e){var t=ensureBuffer(4);t.writeInt32BE(e,0);return t}function _crc32(e,t){e=ensureBuffer(e);if(n.isBuffer(t)){t=t.readUInt32BE(0)}var r=~~t^-1;for(var s=0;s<e.length;s++){r=i[(r^e[s])&255]^r>>>8}return r^-1}function crc32(){return bufferizeInt(_crc32.apply(null,arguments))}crc32.signed=function(){return _crc32.apply(null,arguments)};crc32.unsigned=function(){return _crc32.apply(null,arguments)>>>0};e.exports=crc32},9051:(e,t,r)=>{"use strict";const n=r(7147);const i=r(1017);const s=n.lchown?"lchown":"chown";const a=n.lchownSync?"lchownSync":"chownSync";const l=n.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/);const lchownSync=(e,t,r)=>{try{return n[a](e,t,r)}catch(e){if(e.code!=="ENOENT")throw e}};const chownSync=(e,t,r)=>{try{return n.chownSync(e,t,r)}catch(e){if(e.code!=="ENOENT")throw e}};const o=l?(e,t,r,i)=>s=>{if(!s||s.code!=="EISDIR")i(s);else n.chown(e,t,r,i)}:(e,t,r,n)=>n;const u=l?(e,t,r)=>{try{return lchownSync(e,t,r)}catch(n){if(n.code!=="EISDIR")throw n;chownSync(e,t,r)}}:(e,t,r)=>lchownSync(e,t,r);const c=process.version;let readdir=(e,t,r)=>n.readdir(e,t,r);let readdirSync=(e,t)=>n.readdirSync(e,t);if(/^v4\./.test(c))readdir=(e,t,r)=>n.readdir(e,r);const chown=(e,t,r,i)=>{n[s](e,t,r,o(e,t,r,(e=>{i(e&&e.code!=="ENOENT"?e:null)})))};const chownrKid=(e,t,r,s,a)=>{if(typeof t==="string")return n.lstat(i.resolve(e,t),((n,i)=>{if(n)return a(n.code!=="ENOENT"?n:null);i.name=t;chownrKid(e,i,r,s,a)}));if(t.isDirectory()){chownr(i.resolve(e,t.name),r,s,(n=>{if(n)return a(n);const l=i.resolve(e,t.name);chown(l,r,s,a)}))}else{const n=i.resolve(e,t.name);chown(n,r,s,a)}};const chownr=(e,t,r,n)=>{readdir(e,{withFileTypes:true},((i,s)=>{if(i){if(i.code==="ENOENT")return n();else if(i.code!=="ENOTDIR"&&i.code!=="ENOTSUP")return n(i)}if(i||!s.length)return chown(e,t,r,n);let a=s.length;let l=null;const then=i=>{if(l)return;if(i)return n(l=i);if(--a===0)return chown(e,t,r,n)};s.forEach((n=>chownrKid(e,n,t,r,then)))}))};const chownrKidSync=(e,t,r,s)=>{if(typeof t==="string"){try{const r=n.lstatSync(i.resolve(e,t));r.name=t;t=r}catch(e){if(e.code==="ENOENT")return;else throw e}}if(t.isDirectory())chownrSync(i.resolve(e,t.name),r,s);u(i.resolve(e,t.name),r,s)};const chownrSync=(e,t,r)=>{let n;try{n=readdirSync(e,{withFileTypes:true})}catch(n){if(n.code==="ENOENT")return;else if(n.code==="ENOTDIR"||n.code==="ENOTSUP")return u(e,t,r);else throw n}if(n&&n.length)n.forEach((n=>chownrKidSync(e,n,t,r)));return u(e,t,r)};e.exports=chownr;chownr.sync=chownrSync},5010:(e,t,r)=>{var n=r(7147);var i=r(3837);var s=r(2781);var a=s.Readable;var l=s.Writable;var o=s.PassThrough;var u=r(4833);var c=r(2361).EventEmitter;t.createFromBuffer=createFromBuffer;t.createFromFd=createFromFd;t.BufferSlicer=BufferSlicer;t.FdSlicer=FdSlicer;i.inherits(FdSlicer,c);function FdSlicer(e,t){t=t||{};c.call(this);this.fd=e;this.pend=new u;this.pend.max=1;this.refCount=0;this.autoClose=!!t.autoClose}FdSlicer.prototype.read=function(e,t,r,i,s){var a=this;a.pend.go((function(l){n.read(a.fd,e,t,r,i,(function(e,t,r){l();s(e,t,r)}))}))};FdSlicer.prototype.write=function(e,t,r,i,s){var a=this;a.pend.go((function(l){n.write(a.fd,e,t,r,i,(function(e,t,r){l();s(e,t,r)}))}))};FdSlicer.prototype.createReadStream=function(e){return new ReadStream(this,e)};FdSlicer.prototype.createWriteStream=function(e){return new WriteStream(this,e)};FdSlicer.prototype.ref=function(){this.refCount+=1};FdSlicer.prototype.unref=function(){var e=this;e.refCount-=1;if(e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");if(e.autoClose){n.close(e.fd,onCloseDone)}function onCloseDone(t){if(t){e.emit("error",t)}else{e.emit("close")}}};i.inherits(ReadStream,a);function ReadStream(e,t){t=t||{};a.call(this,t);this.context=e;this.context.ref();this.start=t.start||0;this.endOffset=t.end;this.pos=this.start;this.destroyed=false}ReadStream.prototype._read=function(e){var t=this;if(t.destroyed)return;var r=Math.min(t._readableState.highWaterMark,e);if(t.endOffset!=null){r=Math.min(r,t.endOffset-t.pos)}if(r<=0){t.destroyed=true;t.push(null);t.context.unref();return}t.context.pend.go((function(e){if(t.destroyed)return e();var i=new Buffer(r);n.read(t.context.fd,i,0,r,t.pos,(function(r,n){if(r){t.destroy(r)}else if(n===0){t.destroyed=true;t.push(null);t.context.unref()}else{t.pos+=n;t.push(i.slice(0,n))}e()}))}))};ReadStream.prototype.destroy=function(e){if(this.destroyed)return;e=e||new Error("stream destroyed");this.destroyed=true;this.emit("error",e);this.context.unref()};i.inherits(WriteStream,l);function WriteStream(e,t){t=t||{};l.call(this,t);this.context=e;this.context.ref();this.start=t.start||0;this.endOffset=t.end==null?Infinity:+t.end;this.bytesWritten=0;this.pos=this.start;this.destroyed=false;this.on("finish",this.destroy.bind(this))}WriteStream.prototype._write=function(e,t,r){var i=this;if(i.destroyed)return;if(i.pos+e.length>i.endOffset){var s=new Error("maximum file length exceeded");s.code="ETOOBIG";i.destroy();r(s);return}i.context.pend.go((function(t){if(i.destroyed)return t();n.write(i.context.fd,e,0,e.length,i.pos,(function(e,n){if(e){i.destroy();t();r(e)}else{i.bytesWritten+=n;i.pos+=n;i.emit("progress");t();r()}}))}))};WriteStream.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this.context.unref()};i.inherits(BufferSlicer,c);function BufferSlicer(e,t){c.call(this);t=t||{};this.refCount=0;this.buffer=e;this.maxChunkSize=t.maxChunkSize||Number.MAX_SAFE_INTEGER}BufferSlicer.prototype.read=function(e,t,r,n,i){var s=n+r;var a=s-this.buffer.length;var l=a>0?a:r;this.buffer.copy(e,t,n,s);setImmediate((function(){i(null,l)}))};BufferSlicer.prototype.write=function(e,t,r,n,i){e.copy(this.buffer,n,t,t+r);setImmediate((function(){i(null,r,e)}))};BufferSlicer.prototype.createReadStream=function(e){e=e||{};var t=new o(e);t.destroyed=false;t.start=e.start||0;t.endOffset=e.end;t.pos=t.endOffset||this.buffer.length;var r=this.buffer.slice(t.start,t.pos);var n=0;while(true){var i=n+this.maxChunkSize;if(i>=r.length){if(n<r.length){t.write(r.slice(n,r.length))}break}t.write(r.slice(n,i));n=i}t.end();t.destroy=function(){t.destroyed=true};return t};BufferSlicer.prototype.createWriteStream=function(e){var t=this;e=e||{};var r=new l(e);r.start=e.start||0;r.endOffset=e.end==null?this.buffer.length:+e.end;r.bytesWritten=0;r.pos=r.start;r.destroyed=false;r._write=function(e,n,i){if(r.destroyed)return;var s=r.pos+e.length;if(s>r.endOffset){var a=new Error("maximum file length exceeded");a.code="ETOOBIG";r.destroyed=true;i(a);return}e.copy(t.buffer,r.pos,0,e.length);r.bytesWritten+=e.length;r.pos=s;r.emit("progress");i()};r.destroy=function(){r.destroyed=true};return r};BufferSlicer.prototype.ref=function(){this.refCount+=1};BufferSlicer.prototype.unref=function(){this.refCount-=1;if(this.refCount<0){throw new Error("invalid unref")}};function createFromBuffer(e,t){return new BufferSlicer(e,t)}function createFromFd(e,t){return new FdSlicer(e,t)}},7714:(e,t,r)=>{"use strict";const n=r(1077);const i=r(2361).EventEmitter;const s=r(7147);let a=s.writev;if(!a){const e=process.binding("fs");const t=e.FSReqWrap||e.FSReqCallback;a=(r,n,i,s)=>{const done=(e,t)=>s(e,t,n);const a=new t;a.oncomplete=done;e.writeBuffers(r,n,i,a)}}const l=Symbol("_autoClose");const o=Symbol("_close");const u=Symbol("_ended");const c=Symbol("_fd");const h=Symbol("_finished");const d=Symbol("_flags");const v=Symbol("_flush");const m=Symbol("_handleChunk");const p=Symbol("_makeBuf");const _=Symbol("_mode");const g=Symbol("_needDrain");const w=Symbol("_onerror");const x=Symbol("_onopen");const b=Symbol("_onread");const y=Symbol("_onwrite");const S=Symbol("_open");const E=Symbol("_path");const N=Symbol("_pos");const k=Symbol("_queue");const O=Symbol("_read");const R=Symbol("_readSize");const C=Symbol("_reading");const A=Symbol("_remain");const I=Symbol("_size");const F=Symbol("_write");const L=Symbol("_writing");const D=Symbol("_defaultFlag");const T=Symbol("_errored");class ReadStream extends n{constructor(e,t){t=t||{};super(t);this.readable=true;this.writable=false;if(typeof e!=="string")throw new TypeError("path must be a string");this[T]=false;this[c]=typeof t.fd==="number"?t.fd:null;this[E]=e;this[R]=t.readSize||16*1024*1024;this[C]=false;this[I]=typeof t.size==="number"?t.size:Infinity;this[A]=this[I];this[l]=typeof t.autoClose==="boolean"?t.autoClose:true;if(typeof this[c]==="number")this[O]();else this[S]()}get fd(){return this[c]}get path(){return this[E]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[S](){s.open(this[E],"r",((e,t)=>this[x](e,t)))}[x](e,t){if(e)this[w](e);else{this[c]=t;this.emit("open",t);this[O]()}}[p](){return Buffer.allocUnsafe(Math.min(this[R],this[A]))}[O](){if(!this[C]){this[C]=true;const e=this[p]();if(e.length===0)return process.nextTick((()=>this[b](null,0,e)));s.read(this[c],e,0,e.length,null,((e,t,r)=>this[b](e,t,r)))}}[b](e,t,r){this[C]=false;if(e)this[w](e);else if(this[m](t,r))this[O]()}[o](){if(this[l]&&typeof this[c]==="number"){const e=this[c];this[c]=null;s.close(e,(e=>e?this.emit("error",e):this.emit("close")))}}[w](e){this[C]=true;this[o]();this.emit("error",e)}[m](e,t){let r=false;this[A]-=e;if(e>0)r=super.write(e<t.length?t.slice(0,e):t);if(e===0||this[A]<=0){r=false;this[o]();super.end()}return r}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":if(typeof this[c]==="number")this[O]();break;case"error":if(this[T])return;this[T]=true;return super.emit(e,t);default:return super.emit(e,t)}}}class ReadStreamSync extends ReadStream{[S](){let e=true;try{this[x](null,s.openSync(this[E],"r"));e=false}finally{if(e)this[o]()}}[O](){let e=true;try{if(!this[C]){this[C]=true;do{const e=this[p]();const t=e.length===0?0:s.readSync(this[c],e,0,e.length,null);if(!this[m](t,e))break}while(true);this[C]=false}e=false}finally{if(e)this[o]()}}[o](){if(this[l]&&typeof this[c]==="number"){const e=this[c];this[c]=null;s.closeSync(e);this.emit("close")}}}class WriteStream extends i{constructor(e,t){t=t||{};super(t);this.readable=false;this.writable=true;this[T]=false;this[L]=false;this[u]=false;this[g]=false;this[k]=[];this[E]=e;this[c]=typeof t.fd==="number"?t.fd:null;this[_]=t.mode===undefined?438:t.mode;this[N]=typeof t.start==="number"?t.start:null;this[l]=typeof t.autoClose==="boolean"?t.autoClose:true;const r=this[N]!==null?"r+":"w";this[D]=t.flags===undefined;this[d]=this[D]?r:t.flags;if(this[c]===null)this[S]()}emit(e,t){if(e==="error"){if(this[T])return;this[T]=true}return super.emit(e,t)}get fd(){return this[c]}get path(){return this[E]}[w](e){this[o]();this[L]=true;this.emit("error",e)}[S](){s.open(this[E],this[d],this[_],((e,t)=>this[x](e,t)))}[x](e,t){if(this[D]&&this[d]==="r+"&&e&&e.code==="ENOENT"){this[d]="w";this[S]()}else if(e)this[w](e);else{this[c]=t;this.emit("open",t);this[v]()}}end(e,t){if(e)this.write(e,t);this[u]=true;if(!this[L]&&!this[k].length&&typeof this[c]==="number")this[y](null,0);return this}write(e,t){if(typeof e==="string")e=Buffer.from(e,t);if(this[u]){this.emit("error",new Error("write() after end()"));return false}if(this[c]===null||this[L]||this[k].length){this[k].push(e);this[g]=true;return false}this[L]=true;this[F](e);return true}[F](e){s.write(this[c],e,0,e.length,this[N],((e,t)=>this[y](e,t)))}[y](e,t){if(e)this[w](e);else{if(this[N]!==null)this[N]+=t;if(this[k].length)this[v]();else{this[L]=false;if(this[u]&&!this[h]){this[h]=true;this[o]();this.emit("finish")}else if(this[g]){this[g]=false;this.emit("drain")}}}}[v](){if(this[k].length===0){if(this[u])this[y](null,0)}else if(this[k].length===1)this[F](this[k].pop());else{const e=this[k];this[k]=[];a(this[c],e,this[N],((e,t)=>this[y](e,t)))}}[o](){if(this[l]&&typeof this[c]==="number"){const e=this[c];this[c]=null;s.close(e,(e=>e?this.emit("error",e):this.emit("close")))}}}class WriteStreamSync extends WriteStream{[S](){let e;if(this[D]&&this[d]==="r+"){try{e=s.openSync(this[E],this[d],this[_])}catch(e){if(e.code==="ENOENT"){this[d]="w";return this[S]()}else throw e}}else e=s.openSync(this[E],this[d],this[_]);this[x](null,e)}[o](){if(this[l]&&typeof this[c]==="number"){const e=this[c];this[c]=null;s.closeSync(e);this.emit("close")}}[F](e){let t=true;try{this[y](null,s.writeSync(this[c],e,0,e.length,this[N]));t=false}finally{if(t)try{this[o]()}catch(e){}}}}t.ReadStream=ReadStream;t.ReadStreamSync=ReadStreamSync;t.WriteStream=WriteStream;t.WriteStreamSync=WriteStreamSync},7356:e=>{"use strict";e.exports=clone;function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var t={__proto__:e.__proto__};else var t=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}));return t}},7758:(e,t,r)=>{var n=r(7147);var i=r(263);var s=r(3086);var a=r(7356);var l=r(3837);var o;var u;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){o=Symbol.for("graceful-fs.queue");u=Symbol.for("graceful-fs.previous")}else{o="___graceful-fs.queue";u="___graceful-fs.previous"}function noop(){}var c=noop;if(l.debuglog)c=l.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))c=function(){var e=l.format.apply(l,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!global[o]){var h=[];Object.defineProperty(global,o,{get:function(){return h}});n.close=function(e){function close(t,r){return e.call(n,t,(function(e){if(!e){retry()}if(typeof r==="function")r.apply(this,arguments)}))}Object.defineProperty(close,u,{value:e});return close}(n.close);n.closeSync=function(e){function closeSync(t){e.apply(n,arguments);retry()}Object.defineProperty(closeSync,u,{value:e});return closeSync}(n.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){c(global[o]);r(9491).equal(global[o].length,0)}))}}e.exports=patch(a(n));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched){e.exports=patch(n);n.__patched=true}function patch(e){i(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,r,n){if(typeof r==="function")n=r,r=null;return go$readFile(e,r,n);function go$readFile(e,r,n){return t(e,r,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,r,n]]);else{if(typeof n==="function")n.apply(this,arguments);retry()}}))}}var r=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,n,i){if(typeof n==="function")i=n,n=null;return go$writeFile(e,t,n,i);function go$writeFile(e,t,n,i){return r(e,t,n,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$writeFile,[e,t,n,i]]);else{if(typeof i==="function")i.apply(this,arguments);retry()}}))}}var n=e.appendFile;if(n)e.appendFile=appendFile;function appendFile(e,t,r,i){if(typeof r==="function")i=r,r=null;return go$appendFile(e,t,r,i);function go$appendFile(e,t,r,i){return n(e,t,r,(function(n){if(n&&(n.code==="EMFILE"||n.code==="ENFILE"))enqueue([go$appendFile,[e,t,r,i]]);else{if(typeof i==="function")i.apply(this,arguments);retry()}}))}}var a=e.readdir;e.readdir=readdir;function readdir(e,t,r){var n=[e];if(typeof t!=="function"){n.push(t)}else{r=t}n.push(go$readdir$cb);return go$readdir(n);function go$readdir$cb(e,t){if(t&&t.sort)t.sort();if(e&&(e.code==="EMFILE"||e.code==="ENFILE"))enqueue([go$readdir,[n]]);else{if(typeof r==="function")r.apply(this,arguments);retry()}}}function go$readdir(t){return a.apply(e,t)}if(process.version.substr(0,4)==="v0.8"){var l=s(e);ReadStream=l.ReadStream;WriteStream=l.WriteStream}var o=e.ReadStream;if(o){ReadStream.prototype=Object.create(o.prototype);ReadStream.prototype.open=ReadStream$open}var u=e.WriteStream;if(u){WriteStream.prototype=Object.create(u.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var c=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return c},set:function(e){c=e},enumerable:true,configurable:true});var h=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return h},set:function(e){h=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return o.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return u.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r)}}))}function createReadStream(t,r){return new e.ReadStream(t,r)}function createWriteStream(t,r){return new e.WriteStream(t,r)}var d=e.open;e.open=open;function open(e,t,r,n){if(typeof r==="function")n=r,r=null;return go$open(e,t,r,n);function go$open(e,t,r,n){return d(e,t,r,(function(i,s){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$open,[e,t,r,n]]);else{if(typeof n==="function")n.apply(this,arguments);retry()}}))}}return e}function enqueue(e){c("ENQUEUE",e[0].name,e[1]);global[o].push(e)}function retry(){var e=global[o].shift();if(e){c("RETRY",e[0].name,e[1]);e[0].apply(null,e[1])}}},3086:(e,t,r)=>{var n=r(2781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,r){if(!(this instanceof ReadStream))return new ReadStream(t,r);n.call(this);var i=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;r=r||{};var s=Object.keys(r);for(var a=0,l=s.length;a<l;a++){var o=s[a];this[o]=r[o]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){i._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){i.emit("error",e);i.readable=false;return}i.fd=t;i.emit("open",t);i._read()}))}function WriteStream(t,r){if(!(this instanceof WriteStream))return new WriteStream(t,r);n.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;r=r||{};var i=Object.keys(r);for(var s=0,a=i.length;s<a;s++){var l=i[s];this[l]=r[l]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},263:(e,t,r)=>{var n=r(2057);var i=process.cwd;var s=null;var a=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!s)s=i.call(process);return s};try{process.cwd()}catch(e){}var l=process.chdir;process.chdir=function(e){s=null;l.call(process,e)};e.exports=patch;function patch(e){if(n.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(!e.lchmod){e.lchmod=function(e,t,r){if(r)process.nextTick(r)};e.lchmodSync=function(){}}if(!e.lchown){e.lchown=function(e,t,r,n){if(n)process.nextTick(n)};e.lchownSync=function(){}}if(a==="win32"){e.rename=function(t){return function(r,n,i){var s=Date.now();var a=0;t(r,n,(function CB(l){if(l&&(l.code==="EACCES"||l.code==="EPERM")&&Date.now()-s<6e4){setTimeout((function(){e.stat(n,(function(e,s){if(e&&e.code==="ENOENT")t(r,n,CB);else i(l)}))}),a);if(a<100)a+=10;return}if(i)i(l)}))}}(e.rename)}e.read=function(t){function read(r,n,i,s,a,l){var o;if(l&&typeof l==="function"){var u=0;o=function(c,h,d){if(c&&c.code==="EAGAIN"&&u<10){u++;return t.call(e,r,n,i,s,a,o)}l.apply(this,arguments)}}return t.call(e,r,n,i,s,a,o)}read.__proto__=t;return read}(e.read);e.readSync=function(t){return function(r,n,i,s,a){var l=0;while(true){try{return t.call(e,r,n,i,s,a)}catch(e){if(e.code==="EAGAIN"&&l<10){l++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,r,i){e.open(t,n.O_WRONLY|n.O_SYMLINK,r,(function(t,n){if(t){if(i)i(t);return}e.fchmod(n,r,(function(t){e.close(n,(function(e){if(i)i(t||e)}))}))}))};e.lchmodSync=function(t,r){var i=e.openSync(t,n.O_WRONLY|n.O_SYMLINK,r);var s=true;var a;try{a=e.fchmodSync(i,r);s=false}finally{if(s){try{e.closeSync(i)}catch(e){}}else{e.closeSync(i)}}return a}}function patchLutimes(e){if(n.hasOwnProperty("O_SYMLINK")){e.lutimes=function(t,r,i,s){e.open(t,n.O_SYMLINK,(function(t,n){if(t){if(s)s(t);return}e.futimes(n,r,i,(function(t){e.close(n,(function(e){if(s)s(t||e)}))}))}))};e.lutimesSync=function(t,r,i){var s=e.openSync(t,n.O_SYMLINK);var a;var l=true;try{a=e.futimesSync(s,r,i);l=false}finally{if(l){try{e.closeSync(s)}catch(e){}}else{e.closeSync(s)}}return a}}else{e.lutimes=function(e,t,r,n){if(n)process.nextTick(n)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(r,n,i){return t.call(e,r,n,(function(e){if(chownErOk(e))e=null;if(i)i.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(r,n){try{return t.call(e,r,n)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(r,n,i,s){return t.call(e,r,n,i,(function(e){if(chownErOk(e))e=null;if(s)s.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(r,n,i){try{return t.call(e,r,n,i)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(r,n,i){if(typeof n==="function"){i=n;n=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(i)i.apply(this,arguments)}return n?t.call(e,r,n,callback):t.call(e,r,callback)}}function statFixSync(t){if(!t)return t;return function(r,n){var i=n?t.call(e,r,n):t.call(e,r);if(i.uid<0)i.uid+=4294967296;if(i.gid<0)i.gid+=4294967296;return i}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},1077:(e,t,r)=>{"use strict";const n=r(2361);const i=r(2781);const s=r(665);const a=r(1576).StringDecoder;const l=Symbol("EOF");const o=Symbol("maybeEmitEnd");const u=Symbol("emittedEnd");const c=Symbol("emittingEnd");const h=Symbol("closed");const d=Symbol("read");const v=Symbol("flush");const m=Symbol("flushChunk");const p=Symbol("encoding");const _=Symbol("decoder");const g=Symbol("flowing");const w=Symbol("paused");const x=Symbol("resume");const b=Symbol("bufferLength");const y=Symbol("bufferPush");const S=Symbol("bufferShift");const E=Symbol("objectMode");const N=Symbol("destroyed");const k=global._MP_NO_ITERATOR_SYMBOLS_!=="1";const O=k&&Symbol.asyncIterator||Symbol("asyncIterator not implemented");const R=k&&Symbol.iterator||Symbol("iterator not implemented");const isEndish=e=>e==="end"||e==="finish"||e==="prefinish";const isArrayBuffer=e=>e instanceof ArrayBuffer||typeof e==="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0;const isArrayBufferView=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e);e.exports=class Minipass extends i{constructor(e){super();this[g]=false;this[w]=false;this.pipes=new s;this.buffer=new s;this[E]=e&&e.objectMode||false;if(this[E])this[p]=null;else this[p]=e&&e.encoding||null;if(this[p]==="buffer")this[p]=null;this[_]=this[p]?new a(this[p]):null;this[l]=false;this[u]=false;this[c]=false;this[h]=false;this.writable=true;this.readable=true;this[b]=0;this[N]=false}get bufferLength(){return this[b]}get encoding(){return this[p]}set encoding(e){if(this[E])throw new Error("cannot set encoding in objectMode");if(this[p]&&e!==this[p]&&(this[_]&&this[_].lastNeed||this[b]))throw new Error("cannot change encoding");if(this[p]!==e){this[_]=e?new a(e):null;if(this.buffer.length)this.buffer=this.buffer.map((e=>this[_].write(e)))}this[p]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[E]}set objectMode(e){this[E]=this[E]||!!e}write(e,t,r){if(this[l])throw new Error("write after end");if(this[N]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof t==="function")r=t,t="utf8";if(!t)t="utf8";if(!this[E]&&!Buffer.isBuffer(e)){if(isArrayBufferView(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(isArrayBuffer(e))e=Buffer.from(e);else if(typeof e!=="string")this.objectMode=true}if(!this.objectMode&&!e.length){const e=this.flowing;if(this[b]!==0)this.emit("readable");if(r)r();return e}if(typeof e==="string"&&!this[E]&&!(t===this[p]&&!this[_].lastNeed)){e=Buffer.from(e,t)}if(Buffer.isBuffer(e)&&this[p])e=this[_].write(e);try{return this.flowing?(this.emit("data",e),this.flowing):(this[y](e),false)}finally{if(this[b]!==0)this.emit("readable");if(r)r()}}read(e){if(this[N])return null;try{if(this[b]===0||e===0||e>this[b])return null;if(this[E])e=null;if(this.buffer.length>1&&!this[E]){if(this.encoding)this.buffer=new s([Array.from(this.buffer).join("")]);else this.buffer=new s([Buffer.concat(Array.from(this.buffer),this[b])])}return this[d](e||null,this.buffer.head.value)}finally{this[o]()}}[d](e,t){if(e===t.length||e===null)this[S]();else{this.buffer.head.value=t.slice(e);t=t.slice(0,e);this[b]-=e}this.emit("data",t);if(!this.buffer.length&&!this[l])this.emit("drain");return t}end(e,t,r){if(typeof e==="function")r=e,e=null;if(typeof t==="function")r=t,t="utf8";if(e)this.write(e,t);if(r)this.once("end",r);this[l]=true;this.writable=false;if(this.flowing||!this[w])this[o]();return this}[x](){if(this[N])return;this[w]=false;this[g]=true;this.emit("resume");if(this.buffer.length)this[v]();else if(this[l])this[o]();else this.emit("drain")}resume(){return this[x]()}pause(){this[g]=false;this[w]=true}get destroyed(){return this[N]}get flowing(){return this[g]}get paused(){return this[w]}[y](e){if(this[E])this[b]+=1;else this[b]+=e.length;return this.buffer.push(e)}[S](){if(this.buffer.length){if(this[E])this[b]-=1;else this[b]-=this.buffer.head.value.length}return this.buffer.shift()}[v](){do{}while(this[m](this[S]()));if(!this.buffer.length&&!this[l])this.emit("drain")}[m](e){return e?(this.emit("data",e),this.flowing):false}pipe(e,t){if(this[N])return;const r=this[u];t=t||{};if(e===process.stdout||e===process.stderr)t.end=false;else t.end=t.end!==false;const n={dest:e,opts:t,ondrain:e=>this[x]()};this.pipes.push(n);e.on("drain",n.ondrain);this[x]();if(r&&n.opts.end)n.dest.end();return e}addListener(e,t){return this.on(e,t)}on(e,t){try{return super.on(e,t)}finally{if(e==="data"&&!this.pipes.length&&!this.flowing)this[x]();else if(isEndish(e)&&this[u]){super.emit(e);this.removeAllListeners(e)}}}get emittedEnd(){return this[u]}[o](){if(!this[c]&&!this[u]&&!this[N]&&this.buffer.length===0&&this[l]){this[c]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[h])this.emit("close");this[c]=false}}emit(e,t){if(e!=="error"&&e!=="close"&&e!==N&&this[N])return;else if(e==="data"){if(!t)return;if(this.pipes.length)this.pipes.forEach((e=>e.dest.write(t)===false&&this.pause()))}else if(e==="end"){if(this[u]===true)return;this[u]=true;this.readable=false;if(this[_]){t=this[_].end();if(t){this.pipes.forEach((e=>e.dest.write(t)));super.emit("data",t)}}this.pipes.forEach((e=>{e.dest.removeListener("drain",e.ondrain);if(e.opts.end)e.dest.end()}))}else if(e==="close"){this[h]=true;if(!this[u]&&!this[N])return}const r=new Array(arguments.length);r[0]=e;r[1]=t;if(arguments.length>2){for(let e=2;e<arguments.length;e++){r[e]=arguments[e]}}try{return super.emit.apply(this,r)}finally{if(!isEndish(e))this[o]();else this.removeAllListeners(e)}}collect(){const e=[];if(!this[E])e.dataLength=0;const t=this.promise();this.on("data",(t=>{e.push(t);if(!this[E])e.dataLength+=t.length}));return t.then((()=>e))}concat(){return this[E]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then((e=>this[E]?Promise.reject(new Error("cannot concat in objectMode")):this[p]?e.join(""):Buffer.concat(e,e.dataLength)))}promise(){return new Promise(((e,t)=>{this.on(N,(()=>t(new Error("stream destroyed"))));this.on("end",(()=>e()));this.on("error",(e=>t(e)))}))}[O](){const next=()=>{const e=this.read();if(e!==null)return Promise.resolve({done:false,value:e});if(this[l])return Promise.resolve({done:true});let t=null;let r=null;const onerr=e=>{this.removeListener("data",ondata);this.removeListener("end",onend);r(e)};const ondata=e=>{this.removeListener("error",onerr);this.removeListener("end",onend);this.pause();t({value:e,done:!!this[l]})};const onend=()=>{this.removeListener("error",onerr);this.removeListener("data",ondata);t({done:true})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((e,n)=>{r=n;t=e;this.once(N,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next}}[R](){const next=()=>{const e=this.read();const t=e===null;return{value:e,done:t}};return{next:next}}destroy(e){if(this[N]){if(e)this.emit("error",e);else this.emit(N);return this}this[N]=true;this.buffer=new s;this[b]=0;if(typeof this.close==="function"&&!this[h])this.close();if(e)this.emit("error",e);else this.emit(N);return this}static isStream(e){return!!e&&(e instanceof Minipass||e instanceof i||e instanceof n&&(typeof e.pipe==="function"||typeof e.write==="function"&&typeof e.end==="function"))}}},6769:(e,t,r)=>{const n=r(9796).constants||{ZLIB_VERNUM:4736};e.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:Infinity,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},n))},3486:(e,t,r)=>{"use strict";const n=r(9491);const i=r(4300).Buffer;const s=r(9796);const a=t.constants=r(6769);const l=r(1077);const o=i.concat;const u=Symbol("_superWrite");class ZlibError extends Error{constructor(e){super("zlib: "+e.message);this.code=e.code;this.errno=e.errno;if(!this.code)this.code="ZLIB_ERROR";this.message="zlib: "+e.message;Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const c=Symbol("opts");const h=Symbol("flushFlag");const d=Symbol("finishFlushFlag");const v=Symbol("fullFlushFlag");const m=Symbol("handle");const p=Symbol("onError");const _=Symbol("sawError");const g=Symbol("level");const w=Symbol("strategy");const x=Symbol("ended");const b=Symbol("_defaultFullFlush");class ZlibBase extends l{constructor(e,t){if(!e||typeof e!=="object")throw new TypeError("invalid options for ZlibBase constructor");super(e);this[x]=false;this[c]=e;this[h]=e.flush;this[d]=e.finishFlush;try{this[m]=new s[t](e)}catch(e){throw new ZlibError(e)}this[p]=e=>{this[_]=true;this.close();this.emit("error",e)};this[m].on("error",(e=>this[p](new ZlibError(e))));this.once("end",(()=>this.close))}close(){if(this[m]){this[m].close();this[m]=null;this.emit("close")}}reset(){if(!this[_]){n(this[m],"zlib binding closed");return this[m].reset()}}flush(e){if(this.ended)return;if(typeof e!=="number")e=this[v];this.write(Object.assign(i.alloc(0),{[h]:e}))}end(e,t,r){if(e)this.write(e,t);this.flush(this[d]);this[x]=true;return super.end(null,null,r)}get ended(){return this[x]}write(e,t,r){if(typeof t==="function")r=t,t="utf8";if(typeof e==="string")e=i.from(e,t);if(this[_])return;n(this[m],"zlib binding closed");const s=this[m]._handle;const a=s.close;s.close=()=>{};const l=this[m].close;this[m].close=()=>{};i.concat=e=>e;let c;try{const t=typeof e[h]==="number"?e[h]:this[h];c=this[m]._processChunk(e,t);i.concat=o}catch(e){i.concat=o;this[p](new ZlibError(e))}finally{if(this[m]){this[m]._handle=s;s.close=a;this[m].close=l;this[m].removeAllListeners("error")}}let d;if(c){if(Array.isArray(c)&&c.length>0){d=this[u](i.from(c[0]));for(let e=1;e<c.length;e++){d=this[u](c[e])}}else{d=this[u](i.from(c))}}if(r)r();return d}[u](e){return super.write(e)}}class Zlib extends ZlibBase{constructor(e,t){e=e||{};e.flush=e.flush||a.Z_NO_FLUSH;e.finishFlush=e.finishFlush||a.Z_FINISH;super(e,t);this[v]=a.Z_FULL_FLUSH;this[g]=e.level;this[w]=e.strategy}params(e,t){if(this[_])return;if(!this[m])throw new Error("cannot switch params when binding is closed");if(!this[m].params)throw new Error("not supported in this implementation");if(this[g]!==e||this[w]!==t){this.flush(a.Z_SYNC_FLUSH);n(this[m],"zlib binding closed");const r=this[m].flush;this[m].flush=(e,t)=>{this.flush(e);t()};try{this[m].params(e,t)}finally{this[m].flush=r}if(this[m]){this[g]=e;this[w]=t}}}}class Deflate extends Zlib{constructor(e){super(e,"Deflate")}}class Inflate extends Zlib{constructor(e){super(e,"Inflate")}}const y=Symbol("_portable");class Gzip extends Zlib{constructor(e){super(e,"Gzip");this[y]=e&&!!e.portable}[u](e){if(!this[y])return super[u](e);this[y]=false;e[9]=255;return super[u](e)}}class Gunzip extends Zlib{constructor(e){super(e,"Gunzip")}}class DeflateRaw extends Zlib{constructor(e){super(e,"DeflateRaw")}}class InflateRaw extends Zlib{constructor(e){super(e,"InflateRaw")}}class Unzip extends Zlib{constructor(e){super(e,"Unzip")}}class Brotli extends ZlibBase{constructor(e,t){e=e||{};e.flush=e.flush||a.BROTLI_OPERATION_PROCESS;e.finishFlush=e.finishFlush||a.BROTLI_OPERATION_FINISH;super(e,t);this[v]=a.BROTLI_OPERATION_FLUSH}}class BrotliCompress extends Brotli{constructor(e){super(e,"BrotliCompress")}}class BrotliDecompress extends Brotli{constructor(e){super(e,"BrotliDecompress")}}t.Deflate=Deflate;t.Inflate=Inflate;t.Gzip=Gzip;t.Gunzip=Gunzip;t.DeflateRaw=DeflateRaw;t.InflateRaw=InflateRaw;t.Unzip=Unzip;if(typeof s.BrotliCompress==="function"){t.BrotliCompress=BrotliCompress;t.BrotliDecompress=BrotliDecompress}else{t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}},6186:(e,t,r)=>{const n=r(2853);const i=r(2930);const{mkdirpNative:s,mkdirpNativeSync:a}=r(4983);const{mkdirpManual:l,mkdirpManualSync:o}=r(356);const{useNative:u,useNativeSync:c}=r(4518);const mkdirp=(e,t)=>{e=i(e);t=n(t);return u(t)?s(e,t):l(e,t)};const mkdirpSync=(e,t)=>{e=i(e);t=n(t);return c(t)?a(e,t):o(e,t)};mkdirp.sync=mkdirpSync;mkdirp.native=(e,t)=>s(i(e),n(t));mkdirp.manual=(e,t)=>l(i(e),n(t));mkdirp.nativeSync=(e,t)=>a(i(e),n(t));mkdirp.manualSync=(e,t)=>o(i(e),n(t));e.exports=mkdirp},4992:(e,t,r)=>{const{dirname:n}=r(1017);const findMade=(e,t,r=undefined)=>{if(r===t)return Promise.resolve();return e.statAsync(t).then((e=>e.isDirectory()?r:undefined),(r=>r.code==="ENOENT"?findMade(e,n(t),t):undefined))};const findMadeSync=(e,t,r=undefined)=>{if(r===t)return undefined;try{return e.statSync(t).isDirectory()?r:undefined}catch(r){return r.code==="ENOENT"?findMadeSync(e,n(t),t):undefined}};e.exports={findMade:findMade,findMadeSync:findMadeSync}},356:(e,t,r)=>{const{dirname:n}=r(1017);const mkdirpManual=(e,t,r)=>{t.recursive=false;const i=n(e);if(i===e){return t.mkdirAsync(e,t).catch((e=>{if(e.code!=="EISDIR")throw e}))}return t.mkdirAsync(e,t).then((()=>r||e),(n=>{if(n.code==="ENOENT")return mkdirpManual(i,t).then((r=>mkdirpManual(e,t,r)));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;return t.statAsync(e).then((e=>{if(e.isDirectory())return r;else throw n}),(()=>{throw n}))}))};const mkdirpManualSync=(e,t,r)=>{const i=n(e);t.recursive=false;if(i===e){try{return t.mkdirSync(e,t)}catch(e){if(e.code!=="EISDIR")throw e;else return}}try{t.mkdirSync(e,t);return r||e}catch(n){if(n.code==="ENOENT")return mkdirpManualSync(e,t,mkdirpManualSync(i,t,r));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;try{if(!t.statSync(e).isDirectory())throw n}catch(e){throw n}}};e.exports={mkdirpManual:mkdirpManual,mkdirpManualSync:mkdirpManualSync}},4983:(e,t,r)=>{const{dirname:n}=r(1017);const{findMade:i,findMadeSync:s}=r(4992);const{mkdirpManual:a,mkdirpManualSync:l}=r(356);const mkdirpNative=(e,t)=>{t.recursive=true;const r=n(e);if(r===e)return t.mkdirAsync(e,t);return i(t,e).then((r=>t.mkdirAsync(e,t).then((()=>r)).catch((r=>{if(r.code==="ENOENT")return a(e,t);else throw r}))))};const mkdirpNativeSync=(e,t)=>{t.recursive=true;const r=n(e);if(r===e)return t.mkdirSync(e,t);const i=s(t,e);try{t.mkdirSync(e,t);return i}catch(r){if(r.code==="ENOENT")return l(e,t);else throw r}};e.exports={mkdirpNative:mkdirpNative,mkdirpNativeSync:mkdirpNativeSync}},2853:(e,t,r)=>{const{promisify:n}=r(3837);const i=r(7147);const optsArg=e=>{if(!e)e={mode:511&~process.umask(),fs:i};else if(typeof e==="object")e={mode:511&~process.umask(),fs:i,...e};else if(typeof e==="number")e={mode:e,fs:i};else if(typeof e==="string")e={mode:parseInt(e,8),fs:i};else throw new TypeError("invalid options argument");e.mkdir=e.mkdir||e.fs.mkdir||i.mkdir;e.mkdirAsync=n(e.mkdir);e.stat=e.stat||e.fs.stat||i.stat;e.statAsync=n(e.stat);e.statSync=e.statSync||e.fs.statSync||i.statSync;e.mkdirSync=e.mkdirSync||e.fs.mkdirSync||i.mkdirSync;return e};e.exports=optsArg},2930:(e,t,r)=>{const n=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform;const{resolve:i,parse:s}=r(1017);const pathArg=e=>{if(/\0/.test(e)){throw Object.assign(new TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"})}e=i(e);if(n==="win32"){const t=/[*|"<>?:]/;const{root:r}=s(e);if(t.test(e.substr(r.length))){throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}}return e};e.exports=pathArg},4518:(e,t,r)=>{const n=r(7147);const i=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version;const s=i.replace(/^v/,"").split(".");const a=+s[0]>10||+s[0]===10&&+s[1]>=12;const l=!a?()=>false:e=>e.mkdir===n.mkdir;const o=!a?()=>false:e=>e.mkdirSync===n.mkdirSync;e.exports={useNative:l,useNativeSync:o}},4833:e=>{e.exports=Pend;function Pend(){this.pending=0;this.max=Infinity;this.listeners=[];this.waiting=[];this.error=null}Pend.prototype.go=function(e){if(this.pending<this.max){pendGo(this,e)}else{this.waiting.push(e)}};Pend.prototype.wait=function(e){if(this.pending===0){e(this.error)}else{this.listeners.push(e)}};Pend.prototype.hold=function(){return pendHold(this)};function pendHold(e){e.pending+=1;var t=false;return onCb;function onCb(r){if(t)throw new Error("callback called twice");t=true;e.error=e.error||r;e.pending-=1;if(e.waiting.length>0&&e.pending<e.max){pendGo(e,e.waiting.shift())}else if(e.pending===0){var n=e.listeners;e.listeners=[];n.forEach(cbListener)}}function cbListener(t){t(e.error)}}function pendGo(e,t){t(pendHold(e))}},4674:(e,t,r)=>{"use strict";var n;n=r(4016);n=r(5923);n=r(1525);n=r(4404);n=r(5317);r(7900);r(7628);t.Parse=r(8917);r(8116);r(5450);r(6043);r(7996);r(4173)},4016:(e,t,r)=>{"use strict";const n=r(5274);const i=r(7900);const s=r(7147);const a=r(7714);const l=r(1525);const o=r(1017);const u=e.exports=(e,t,r)=>{if(typeof t==="function")r=t;if(Array.isArray(e))t=e,e={};if(!t||!Array.isArray(t)||!t.length)throw new TypeError("no files or directories specified");t=Array.from(t);const i=n(e);if(i.sync&&typeof r==="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof r==="function")throw new TypeError("callback only supported with file option");return i.file&&i.sync?createFileSync(i,t):i.file?createFile(i,t,r):i.sync?createSync(i,t):create(i,t)};const createFileSync=(e,t)=>{const r=new i.Sync(e);const n=new a.WriteStreamSync(e.file,{mode:e.mode||438});r.pipe(n);addFilesSync(r,t)};const createFile=(e,t,r)=>{const n=new i(e);const s=new a.WriteStream(e.file,{mode:e.mode||438});n.pipe(s);const l=new Promise(((e,t)=>{s.on("error",t);s.on("close",e);n.on("error",t)}));addFilesAsync(n,t);return r?l.then(r,r):l};const addFilesSync=(e,t)=>{t.forEach((t=>{if(t.charAt(0)==="@")l({file:o.resolve(e.cwd,t.substr(1)),sync:true,noResume:true,onentry:t=>e.add(t)});else e.add(t)}));e.end()};const addFilesAsync=(e,t)=>{while(t.length){const r=t.shift();if(r.charAt(0)==="@")return l({file:o.resolve(e.cwd,r.substr(1)),noResume:true,onentry:t=>e.add(t)}).then((r=>addFilesAsync(e,t)));else e.add(r)}e.end()};const createSync=(e,t)=>{const r=new i.Sync(e);addFilesSync(r,t);return r};const create=(e,t)=>{const r=new i(e);addFilesAsync(r,t);return r}},5317:(e,t,r)=>{"use strict";const n=r(5274);const i=r(7628);const s=r(7147);const a=r(7714);const l=r(1017);const o=e.exports=(e,t,r)=>{if(typeof e==="function")r=e,t=null,e={};else if(Array.isArray(e))t=e,e={};if(typeof t==="function")r=t,t=null;if(!t)t=[];else t=Array.from(t);const i=n(e);if(i.sync&&typeof r==="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof r==="function")throw new TypeError("callback only supported with file option");if(t.length)filesFilter(i,t);return i.file&&i.sync?extractFileSync(i):i.file?extractFile(i,r):i.sync?extractSync(i):extract(i)};const filesFilter=(e,t)=>{const r=new Map(t.map((e=>[e.replace(/\/+$/,""),true])));const n=e.filter;const mapHas=(e,t)=>{const n=t||l.parse(e).root||".";const i=e===n?false:r.has(e)?r.get(e):mapHas(l.dirname(e),n);r.set(e,i);return i};e.filter=n?(e,t)=>n(e,t)&&mapHas(e.replace(/\/+$/,"")):e=>mapHas(e.replace(/\/+$/,""))};const extractFileSync=e=>{const t=new i.Sync(e);const r=e.file;let n=true;let l;const o=s.statSync(r);const u=e.maxReadSize||16*1024*1024;const c=new a.ReadStreamSync(r,{readSize:u,size:o.size});c.pipe(t)};const extractFile=(e,t)=>{const r=new i(e);const n=e.maxReadSize||16*1024*1024;const l=e.file;const o=new Promise(((e,t)=>{r.on("error",t);r.on("close",e);s.stat(l,((e,i)=>{if(e)t(e);else{const e=new a.ReadStream(l,{readSize:n,size:i.size});e.on("error",t);e.pipe(r)}}))}));return t?o.then(t,t):o};const extractSync=e=>new i.Sync(e);const extract=e=>new i(e)},1172:(e,t,r)=>{const n=process.env.__FAKE_PLATFORM__||process.platform;const i=n==="win32";const s=global.__FAKE_TESTING_FS__||r(7147);const{O_CREAT:a,O_TRUNC:l,O_WRONLY:o,UV_FS_O_FILEMAP:u=0}=s.constants;const c=i&&!!u;const h=512*1024;const d=u|l|a|o;e.exports=!c?()=>"w":e=>e<h?d:"w"},6043:(e,t,r)=>{"use strict";const n=r(4173);const i=r(1017).posix;const s=r(2370);const a=Symbol("slurp");const l=Symbol("type");class Header{constructor(e,t,r,n){this.cksumValid=false;this.needPax=false;this.nullBlock=false;this.block=null;this.path=null;this.mode=null;this.uid=null;this.gid=null;this.size=null;this.mtime=null;this.cksum=null;this[l]="0";this.linkpath=null;this.uname=null;this.gname=null;this.devmaj=0;this.devmin=0;this.atime=null;this.ctime=null;if(Buffer.isBuffer(e))this.decode(e,t||0,r,n);else if(e)this.set(e)}decode(e,t,r,n){if(!t)t=0;if(!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");this.path=decString(e,t,100);this.mode=decNumber(e,t+100,8);this.uid=decNumber(e,t+108,8);this.gid=decNumber(e,t+116,8);this.size=decNumber(e,t+124,12);this.mtime=decDate(e,t+136,12);this.cksum=decNumber(e,t+148,12);this[a](r);this[a](n,true);this[l]=decString(e,t+156,1);if(this[l]==="")this[l]="0";if(this[l]==="0"&&this.path.substr(-1)==="/")this[l]="5";if(this[l]==="5")this.size=0;this.linkpath=decString(e,t+157,100);if(e.slice(t+257,t+265).toString()==="ustar\x0000"){this.uname=decString(e,t+265,32);this.gname=decString(e,t+297,32);this.devmaj=decNumber(e,t+329,8);this.devmin=decNumber(e,t+337,8);if(e[t+475]!==0){const r=decString(e,t+345,155);this.path=r+"/"+this.path}else{const r=decString(e,t+345,130);if(r)this.path=r+"/"+this.path;this.atime=decDate(e,t+476,12);this.ctime=decDate(e,t+488,12)}}let i=8*32;for(let r=t;r<t+148;r++){i+=e[r]}for(let r=t+156;r<t+512;r++){i+=e[r]}this.cksumValid=i===this.cksum;if(this.cksum===null&&i===8*32)this.nullBlock=true}[a](e,t){for(let r in e){if(e[r]!==null&&e[r]!==undefined&&!(t&&r==="path"))this[r]=e[r]}}encode(e,t){if(!e){e=this.block=Buffer.alloc(512);t=0}if(!t)t=0;if(!(e.length>=t+512))throw new Error("need 512 bytes for header");const r=this.ctime||this.atime?130:155;const n=splitPrefix(this.path||"",r);const i=n[0];const s=n[1];this.needPax=n[2];this.needPax=encString(e,t,100,i)||this.needPax;this.needPax=encNumber(e,t+100,8,this.mode)||this.needPax;this.needPax=encNumber(e,t+108,8,this.uid)||this.needPax;this.needPax=encNumber(e,t+116,8,this.gid)||this.needPax;this.needPax=encNumber(e,t+124,12,this.size)||this.needPax;this.needPax=encDate(e,t+136,12,this.mtime)||this.needPax;e[t+156]=this[l].charCodeAt(0);this.needPax=encString(e,t+157,100,this.linkpath)||this.needPax;e.write("ustar\x0000",t+257,8);this.needPax=encString(e,t+265,32,this.uname)||this.needPax;this.needPax=encString(e,t+297,32,this.gname)||this.needPax;this.needPax=encNumber(e,t+329,8,this.devmaj)||this.needPax;this.needPax=encNumber(e,t+337,8,this.devmin)||this.needPax;this.needPax=encString(e,t+345,r,s)||this.needPax;if(e[t+475]!==0)this.needPax=encString(e,t+345,155,s)||this.needPax;else{this.needPax=encString(e,t+345,130,s)||this.needPax;this.needPax=encDate(e,t+476,12,this.atime)||this.needPax;this.needPax=encDate(e,t+488,12,this.ctime)||this.needPax}let a=8*32;for(let r=t;r<t+148;r++){a+=e[r]}for(let r=t+156;r<t+512;r++){a+=e[r]}this.cksum=a;encNumber(e,t+148,8,this.cksum);this.cksumValid=true;return this.needPax}set(e){for(let t in e){if(e[t]!==null&&e[t]!==undefined)this[t]=e[t]}}get type(){return n.name.get(this[l])||this[l]}get typeKey(){return this[l]}set type(e){if(n.code.has(e))this[l]=n.code.get(e);else this[l]=e}}const splitPrefix=(e,t)=>{const r=100;let n=e;let s="";let a;const l=i.parse(e).root||".";if(Buffer.byteLength(n)<r)a=[n,s,false];else{s=i.dirname(n);n=i.basename(n);do{if(Buffer.byteLength(n)<=r&&Buffer.byteLength(s)<=t)a=[n,s,false];else if(Buffer.byteLength(n)>r&&Buffer.byteLength(s)<=t)a=[n.substr(0,r-1),s,true];else{n=i.join(i.basename(s),n);s=i.dirname(s)}}while(s!==l&&!a);if(!a)a=[e.substr(0,r-1),"",true]}return a};const decString=(e,t,r)=>e.slice(t,t+r).toString("utf8").replace(/\0.*/,"");const decDate=(e,t,r)=>numToDate(decNumber(e,t,r));const numToDate=e=>e===null?null:new Date(e*1e3);const decNumber=(e,t,r)=>e[t]&128?s.parse(e.slice(t,t+r)):decSmallNumber(e,t,r);const nanNull=e=>isNaN(e)?null:e;const decSmallNumber=(e,t,r)=>nanNull(parseInt(e.slice(t,t+r).toString("utf8").replace(/\0.*$/,"").trim(),8));const o={12:8589934591,8:2097151};const encNumber=(e,t,r,n)=>n===null?false:n>o[r]||n<0?(s.encode(n,e.slice(t,t+r)),true):(encSmallNumber(e,t,r,n),false);const encSmallNumber=(e,t,r,n)=>e.write(octalString(n,r),t,r,"ascii");const octalString=(e,t)=>padOctal(Math.floor(e).toString(8),t);const padOctal=(e,t)=>(e.length===t-1?e:new Array(t-e.length-1).join("0")+e+" ")+"\0";const encDate=(e,t,r,n)=>n===null?false:encNumber(e,t,r,n.getTime()/1e3);const u=new Array(156).join("\0");const encString=(e,t,r,n)=>n===null?false:(e.write(n+u,t,r,"utf8"),n.length!==Buffer.byteLength(n)||n.length>r);e.exports=Header},5274:e=>{"use strict";const t=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);const r=e.exports=e=>e?Object.keys(e).map((r=>[t.has(r)?t.get(r):r,e[r]])).reduce(((e,t)=>(e[t[0]]=t[1],e)),Object.create(null)):{}},2370:(e,t)=>{"use strict";const r=t.encode=(e,t)=>{if(!Number.isSafeInteger(e))throw Error("cannot encode number outside of javascript safe integer range");else if(e<0)encodeNegative(e,t);else encodePositive(e,t);return t};const encodePositive=(e,t)=>{t[0]=128;for(var r=t.length;r>1;r--){t[r-1]=e&255;e=Math.floor(e/256)}};const encodeNegative=(e,t)=>{t[0]=255;var r=false;e=e*-1;for(var n=t.length;n>1;n--){var i=e&255;e=Math.floor(e/256);if(r)t[n-1]=onesComp(i);else if(i===0)t[n-1]=0;else{r=true;t[n-1]=twosComp(i)}}};const n=t.parse=e=>{var t=e[e.length-1];var r=e[0];var n;if(r===128)n=pos(e.slice(1,e.length));else if(r===255)n=twos(e);else throw Error("invalid base256 encoding");if(!Number.isSafeInteger(n))throw Error("parsed number outside of javascript safe integer range");return n};const twos=e=>{var t=e.length;var r=0;var n=false;for(var i=t-1;i>-1;i--){var s=e[i];var a;if(n)a=onesComp(s);else if(s===0)a=s;else{n=true;a=twosComp(s)}if(a!==0)r-=a*Math.pow(256,t-i-1)}return r};const pos=e=>{var t=e.length;var r=0;for(var n=t-1;n>-1;n--){var i=e[n];if(i!==0)r+=i*Math.pow(256,t-n-1)}return r};const onesComp=e=>(255^e)&255;const twosComp=e=>(255^e)+1&255},1525:(e,t,r)=>{"use strict";const n=r(5274);const i=r(8917);const s=r(7147);const a=r(7714);const l=r(1017);const o=e.exports=(e,t,r)=>{if(typeof e==="function")r=e,t=null,e={};else if(Array.isArray(e))t=e,e={};if(typeof t==="function")r=t,t=null;if(!t)t=[];else t=Array.from(t);const i=n(e);if(i.sync&&typeof r==="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof r==="function")throw new TypeError("callback only supported with file option");if(t.length)filesFilter(i,t);if(!i.noResume)onentryFunction(i);return i.file&&i.sync?listFileSync(i):i.file?listFile(i,r):list(i)};const onentryFunction=e=>{const t=e.onentry;e.onentry=t?e=>{t(e);e.resume()}:e=>e.resume()};const filesFilter=(e,t)=>{const r=new Map(t.map((e=>[e.replace(/\/+$/,""),true])));const n=e.filter;const mapHas=(e,t)=>{const n=t||l.parse(e).root||".";const i=e===n?false:r.has(e)?r.get(e):mapHas(l.dirname(e),n);r.set(e,i);return i};e.filter=n?(e,t)=>n(e,t)&&mapHas(e.replace(/\/+$/,"")):e=>mapHas(e.replace(/\/+$/,""))};const listFileSync=e=>{const t=list(e);const r=e.file;let n=true;let i;try{const a=s.statSync(r);const l=e.maxReadSize||16*1024*1024;if(a.size<l){t.end(s.readFileSync(r))}else{let e=0;const n=Buffer.allocUnsafe(l);i=s.openSync(r,"r");while(e<a.size){let r=s.readSync(i,n,0,l,e);e+=r;t.write(n.slice(0,r))}t.end()}n=false}finally{if(n&&i)try{s.closeSync(i)}catch(e){}}};const listFile=(e,t)=>{const r=new i(e);const n=e.maxReadSize||16*1024*1024;const l=e.file;const o=new Promise(((e,t)=>{r.on("error",t);r.on("end",e);s.stat(l,((e,i)=>{if(e)t(e);else{const e=new a.ReadStream(l,{readSize:n,size:i.size});e.on("error",t);e.pipe(r)}}))}));return t?o.then(t,t):o};const list=e=>new i(e)},9624:(e,t,r)=>{"use strict";const n=r(6186);const i=r(7147);const s=r(1017);const a=r(9051);class SymlinkError extends Error{constructor(e,t){super("Cannot extract through symbolic link");this.path=t;this.symlink=e}get name(){return"SylinkError"}}class CwdError extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'");this.path=e;this.code=t}get name(){return"CwdError"}}const l=e.exports=(e,t,r)=>{const l=t.umask;const o=t.mode|448;const u=(o&l)!==0;const c=t.uid;const h=t.gid;const d=typeof c==="number"&&typeof h==="number"&&(c!==t.processUid||h!==t.processGid);const v=t.preserve;const m=t.unlink;const p=t.cache;const _=t.cwd;const done=(t,n)=>{if(t)r(t);else{p.set(e,true);if(n&&d)a(n,c,h,(e=>done(e)));else if(u)i.chmod(e,o,r);else r()}};if(p&&p.get(e)===true)return done();if(e===_)return i.stat(e,((t,r)=>{if(t||!r.isDirectory())t=new CwdError(e,t&&t.code||"ENOTDIR");done(t)}));if(v)return n(e,{mode:o}).then((e=>done(null,e)),done);const g=s.relative(_,e);const w=g.split(/\/|\\/);mkdir_(_,w,o,p,m,_,null,done)};const mkdir_=(e,t,r,n,s,a,l,o)=>{if(!t.length)return o(null,l);const u=t.shift();const c=e+"/"+u;if(n.get(c))return mkdir_(c,t,r,n,s,a,l,o);i.mkdir(c,r,onmkdir(c,t,r,n,s,a,l,o))};const onmkdir=(e,t,r,n,a,l,o,u)=>c=>{if(c){if(c.path&&s.dirname(c.path)===l&&(c.code==="ENOTDIR"||c.code==="ENOENT"))return u(new CwdError(l,c.code));i.lstat(e,((s,h)=>{if(s)u(s);else if(h.isDirectory())mkdir_(e,t,r,n,a,l,o,u);else if(a)i.unlink(e,(s=>{if(s)return u(s);i.mkdir(e,r,onmkdir(e,t,r,n,a,l,o,u))}));else if(h.isSymbolicLink())return u(new SymlinkError(e,e+"/"+t.join("/")));else u(c)}))}else{o=o||e;mkdir_(e,t,r,n,a,l,o,u)}};const o=e.exports.sync=(e,t)=>{const r=t.umask;const l=t.mode|448;const o=(l&r)!==0;const u=t.uid;const c=t.gid;const h=typeof u==="number"&&typeof c==="number"&&(u!==t.processUid||c!==t.processGid);const d=t.preserve;const v=t.unlink;const m=t.cache;const p=t.cwd;const done=t=>{m.set(e,true);if(t&&h)a.sync(t,u,c);if(o)i.chmodSync(e,l)};if(m&&m.get(e)===true)return done();if(e===p){let t=false;let r="ENOTDIR";try{t=i.statSync(e).isDirectory()}catch(e){r=e.code}finally{if(!t)throw new CwdError(e,r)}done();return}if(d)return done(n.sync(e,l));const _=s.relative(p,e);const g=_.split(/\/|\\/);let w=null;for(let e=g.shift(),t=p;e&&(t+="/"+e);e=g.shift()){if(m.get(t))continue;try{i.mkdirSync(t,l);w=w||t;m.set(t,true)}catch(e){if(e.path&&s.dirname(e.path)===p&&(e.code==="ENOTDIR"||e.code==="ENOENT"))return new CwdError(p,e.code);const r=i.lstatSync(t);if(r.isDirectory()){m.set(t,true);continue}else if(v){i.unlinkSync(t);i.mkdirSync(t,l);w=w||t;m.set(t,true);continue}else if(r.isSymbolicLink())return new SymlinkError(t,t+"/"+g.join("/"))}}return done(w)}},8371:e=>{"use strict";e.exports=(e,t,r)=>{e&=4095;if(r){e=(e|384)&~18}if(t){if(e&256)e|=64;if(e&32)e|=8;if(e&4)e|=1}return e}},7900:(e,t,r)=>{"use strict";class PackJob{constructor(e,t){this.path=e||"./";this.absolute=t;this.entry=null;this.stat=null;this.readdir=null;this.pending=false;this.ignore=false;this.piped=false}}const n=r(1077);const i=r(3486);const s=r(8116);const a=r(5450);const l=a.Sync;const o=a.Tar;const u=r(665);const c=Buffer.alloc(1024);const h=Symbol("onStat");const d=Symbol("ended");const v=Symbol("queue");const m=Symbol("current");const p=Symbol("process");const _=Symbol("processing");const g=Symbol("processJob");const w=Symbol("jobs");const x=Symbol("jobDone");const b=Symbol("addFSEntry");const y=Symbol("addTarEntry");const S=Symbol("stat");const E=Symbol("readdir");const N=Symbol("onreaddir");const k=Symbol("pipe");const O=Symbol("entry");const R=Symbol("entryOpt");const C=Symbol("writeEntryClass");const A=Symbol("write");const I=Symbol("ondrain");const F=r(7147);const L=r(1017);const D=r(5899);const T=D(class Pack extends n{constructor(e){super(e);e=e||Object.create(null);this.opt=e;this.file=e.file||"";this.cwd=e.cwd||process.cwd();this.maxReadSize=e.maxReadSize;this.preservePaths=!!e.preservePaths;this.strict=!!e.strict;this.noPax=!!e.noPax;this.prefix=(e.prefix||"").replace(/(\\|\/)+$/,"");this.linkCache=e.linkCache||new Map;this.statCache=e.statCache||new Map;this.readdirCache=e.readdirCache||new Map;this[C]=a;if(typeof e.onwarn==="function")this.on("warn",e.onwarn);this.portable=!!e.portable;this.zip=null;if(e.gzip){if(typeof e.gzip!=="object")e.gzip={};if(this.portable)e.gzip.portable=true;this.zip=new i.Gzip(e.gzip);this.zip.on("data",(e=>super.write(e)));this.zip.on("end",(e=>super.end()));this.zip.on("drain",(e=>this[I]()));this.on("resume",(e=>this.zip.resume()))}else this.on("drain",this[I]);this.noDirRecurse=!!e.noDirRecurse;this.follow=!!e.follow;this.noMtime=!!e.noMtime;this.mtime=e.mtime||null;this.filter=typeof e.filter==="function"?e.filter:e=>true;this[v]=new u;this[w]=0;this.jobs=+e.jobs||4;this[_]=false;this[d]=false}[A](e){return super.write(e)}add(e){this.write(e);return this}end(e){if(e)this.write(e);this[d]=true;this[p]();return this}write(e){if(this[d])throw new Error("write after end");if(e instanceof s)this[y](e);else this[b](e);return this.flowing}[y](e){const t=L.resolve(this.cwd,e.path);if(this.prefix)e.path=this.prefix+"/"+e.path.replace(/^\.(\/+|$)/,"");if(!this.filter(e.path,e))e.resume();else{const r=new PackJob(e.path,t,false);r.entry=new o(e,this[R](r));r.entry.on("end",(e=>this[x](r)));this[w]+=1;this[v].push(r)}this[p]()}[b](e){const t=L.resolve(this.cwd,e);if(this.prefix)e=this.prefix+"/"+e.replace(/^\.(\/+|$)/,"");this[v].push(new PackJob(e,t));this[p]()}[S](e){e.pending=true;this[w]+=1;const t=this.follow?"stat":"lstat";F[t](e.absolute,((t,r)=>{e.pending=false;this[w]-=1;if(t)this.emit("error",t);else this[h](e,r)}))}[h](e,t){this.statCache.set(e.absolute,t);e.stat=t;if(!this.filter(e.path,t))e.ignore=true;this[p]()}[E](e){e.pending=true;this[w]+=1;F.readdir(e.absolute,((t,r)=>{e.pending=false;this[w]-=1;if(t)return this.emit("error",t);this[N](e,r)}))}[N](e,t){this.readdirCache.set(e.absolute,t);e.readdir=t;this[p]()}[p](){if(this[_])return;this[_]=true;for(let e=this[v].head;e!==null&&this[w]<this.jobs;e=e.next){this[g](e.value);if(e.value.ignore){const t=e.next;this[v].removeNode(e);e.next=t}}this[_]=false;if(this[d]&&!this[v].length&&this[w]===0){if(this.zip)this.zip.end(c);else{super.write(c);super.end()}}}get[m](){return this[v]&&this[v].head&&this[v].head.value}[x](e){this[v].shift();this[w]-=1;this[p]()}[g](e){if(e.pending)return;if(e.entry){if(e===this[m]&&!e.piped)this[k](e);return}if(!e.stat){if(this.statCache.has(e.absolute))this[h](e,this.statCache.get(e.absolute));else this[S](e)}if(!e.stat)return;if(e.ignore)return;if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){if(this.readdirCache.has(e.absolute))this[N](e,this.readdirCache.get(e.absolute));else this[E](e);if(!e.readdir)return}e.entry=this[O](e);if(!e.entry){e.ignore=true;return}if(e===this[m]&&!e.piped)this[k](e)}[R](e){return{onwarn:(e,t,r)=>this.warn(e,t,r),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime}}[O](e){this[w]+=1;try{return new this[C](e.path,this[R](e)).on("end",(()=>this[x](e))).on("error",(e=>this.emit("error",e)))}catch(e){this.emit("error",e)}}[I](){if(this[m]&&this[m].entry)this[m].entry.resume()}[k](e){e.piped=true;if(e.readdir)e.readdir.forEach((t=>{const r=this.prefix?e.path.slice(this.prefix.length+1)||"./":e.path;const n=r==="./"?"":r.replace(/\/*$/,"/");this[b](n+t)}));const t=e.entry;const r=this.zip;if(r)t.on("data",(e=>{if(!r.write(e))t.pause()}));else t.on("data",(e=>{if(!super.write(e))t.pause()}))}pause(){if(this.zip)this.zip.pause();return super.pause()}});class PackSync extends T{constructor(e){super(e);this[C]=l}pause(){}resume(){}[S](e){const t=this.follow?"statSync":"lstatSync";this[h](e,F[t](e.absolute))}[E](e,t){this[N](e,F.readdirSync(e.absolute))}[k](e){const t=e.entry;const r=this.zip;if(e.readdir)e.readdir.forEach((t=>{const r=this.prefix?e.path.slice(this.prefix.length+1)||"./":e.path;const n=r==="./"?"":r.replace(/\/*$/,"/");this[b](n+t)}));if(r)t.on("data",(e=>{r.write(e)}));else t.on("data",(e=>{super[A](e)}))}}T.Sync=PackSync;e.exports=T},8917:(e,t,r)=>{"use strict";const n=r(5899);const i=r(1017);const s=r(6043);const a=r(2361);const l=r(665);const o=1024*1024;const u=r(8116);const c=r(7996);const h=r(3486);const d=Buffer.from([31,139]);const v=Symbol("state");const m=Symbol("writeEntry");const p=Symbol("readEntry");const _=Symbol("nextEntry");const g=Symbol("processEntry");const w=Symbol("extendedHeader");const x=Symbol("globalExtendedHeader");const b=Symbol("meta");const y=Symbol("emitMeta");const S=Symbol("buffer");const E=Symbol("queue");const N=Symbol("ended");const k=Symbol("emittedEnd");const O=Symbol("emit");const R=Symbol("unzip");const C=Symbol("consumeChunk");const A=Symbol("consumeChunkSub");const I=Symbol("consumeBody");const F=Symbol("consumeMeta");const L=Symbol("consumeHeader");const D=Symbol("consuming");const T=Symbol("bufferConcat");const B=Symbol("maybeEnd");const P=Symbol("writing");const M=Symbol("aborted");const z=Symbol("onDone");const U=Symbol("sawValidEntry");const H=Symbol("sawNullBlock");const j=Symbol("sawEOF");const noop=e=>true;e.exports=n(class Parser extends a{constructor(e){e=e||{};super(e);this.file=e.file||"";this[U]=null;this.on(z,(e=>{if(this[v]==="begin"||this[U]===false){this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}}));if(e.ondone)this.on(z,e.ondone);else this.on(z,(e=>{this.emit("prefinish");this.emit("finish");this.emit("end");this.emit("close")}));this.strict=!!e.strict;this.maxMetaEntrySize=e.maxMetaEntrySize||o;this.filter=typeof e.filter==="function"?e.filter:noop;this.writable=true;this.readable=false;this[E]=new l;this[S]=null;this[p]=null;this[m]=null;this[v]="begin";this[b]="";this[w]=null;this[x]=null;this[N]=false;this[R]=null;this[M]=false;this[H]=false;this[j]=false;if(typeof e.onwarn==="function")this.on("warn",e.onwarn);if(typeof e.onentry==="function")this.on("entry",e.onentry)}[L](e,t){if(this[U]===null)this[U]=false;let r;try{r=new s(e,t,this[w],this[x])}catch(e){return this.warn("TAR_ENTRY_INVALID",e)}if(r.nullBlock){if(this[H]){this[j]=true;if(this[v]==="begin")this[v]="header";this[O]("eof")}else{this[H]=true;this[O]("nullBlock")}}else{this[H]=false;if(!r.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:r});else if(!r.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:r});else{const e=r.type;if(/^(Symbolic)?Link$/.test(e)&&!r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:r});else if(!/^(Symbolic)?Link$/.test(e)&&r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:r});else{const e=this[m]=new u(r,this[w],this[x]);if(!this[U]){if(e.remain){const onend=()=>{if(!e.invalid)this[U]=true};e.on("end",onend)}else{this[U]=true}}if(e.meta){if(e.size>this.maxMetaEntrySize){e.ignore=true;this[O]("ignoredEntry",e);this[v]="ignore";e.resume()}else if(e.size>0){this[b]="";e.on("data",(e=>this[b]+=e));this[v]="meta"}}else{this[w]=null;e.ignore=e.ignore||!this.filter(e.path,e);if(e.ignore){this[O]("ignoredEntry",e);this[v]=e.remain?"ignore":"header";e.resume()}else{if(e.remain)this[v]="body";else{this[v]="header";e.end()}if(!this[p]){this[E].push(e);this[_]()}else this[E].push(e)}}}}}}[g](e){let t=true;if(!e){this[p]=null;t=false}else if(Array.isArray(e))this.emit.apply(this,e);else{this[p]=e;this.emit("entry",e);if(!e.emittedEnd){e.on("end",(e=>this[_]()));t=false}}return t}[_](){do{}while(this[g](this[E].shift()));if(!this[E].length){const e=this[p];const t=!e||e.flowing||e.size===e.remain;if(t){if(!this[P])this.emit("drain")}else e.once("drain",(e=>this.emit("drain")))}}[I](e,t){const r=this[m];const n=r.blockRemain;const i=n>=e.length&&t===0?e:e.slice(t,t+n);r.write(i);if(!r.blockRemain){this[v]="header";this[m]=null;r.end()}return i.length}[F](e,t){const r=this[m];const n=this[I](e,t);if(!this[m])this[y](r);return n}[O](e,t,r){if(!this[E].length&&!this[p])this.emit(e,t,r);else this[E].push([e,t,r])}[y](e){this[O]("meta",this[b]);switch(e.type){case"ExtendedHeader":case"OldExtendedHeader":this[w]=c.parse(this[b],this[w],false);break;case"GlobalExtendedHeader":this[x]=c.parse(this[b],this[x],true);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[w]=this[w]||Object.create(null);this[w].path=this[b].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[w]=this[w]||Object.create(null);this[w].linkpath=this[b].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[M]=true;this.emit("abort",e);this.warn("TAR_ABORT",e,{recoverable:false})}write(e){if(this[M])return;if(this[R]===null&&e){if(this[S]){e=Buffer.concat([this[S],e]);this[S]=null}if(e.length<d.length){this[S]=e;return true}for(let t=0;this[R]===null&&t<d.length;t++){if(e[t]!==d[t])this[R]=false}if(this[R]===null){const t=this[N];this[N]=false;this[R]=new h.Unzip;this[R].on("data",(e=>this[C](e)));this[R].on("error",(e=>this.abort(e)));this[R].on("end",(e=>{this[N]=true;this[C]()}));this[P]=true;const r=this[R][t?"end":"write"](e);this[P]=false;return r}}this[P]=true;if(this[R])this[R].write(e);else this[C](e);this[P]=false;const t=this[E].length?false:this[p]?this[p].flowing:true;if(!t&&!this[E].length)this[p].once("drain",(e=>this.emit("drain")));return t}[T](e){if(e&&!this[M])this[S]=this[S]?Buffer.concat([this[S],e]):e}[B](){if(this[N]&&!this[k]&&!this[M]&&!this[D]){this[k]=true;const e=this[m];if(e&&e.blockRemain){const t=this[S]?this[S].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e});if(this[S])e.write(this[S]);e.end()}this[O](z)}}[C](e){if(this[D])this[T](e);else if(!e&&!this[S])this[B]();else{this[D]=true;if(this[S]){this[T](e);const t=this[S];this[S]=null;this[A](t)}else{this[A](e)}while(this[S]&&this[S].length>=512&&!this[M]&&!this[j]){const e=this[S];this[S]=null;this[A](e)}this[D]=false}if(!this[S]||this[N])this[B]()}[A](e){let t=0;let r=e.length;while(t+512<=r&&!this[M]&&!this[j]){switch(this[v]){case"begin":case"header":this[L](e,t);t+=512;break;case"ignore":case"body":t+=this[I](e,t);break;case"meta":t+=this[F](e,t);break;default:throw new Error("invalid state: "+this[v])}}if(t<r){if(this[S])this[S]=Buffer.concat([e.slice(t),this[S]]);else this[S]=e.slice(t)}}end(e){if(!this[M]){if(this[R])this[R].end(e);else{this[N]=true;this.write(e)}}}})},9587:(e,t,r)=>{const n=r(9491);e.exports=()=>{const e=new Map;const t=new Map;const{join:i}=r(1017);const getDirs=e=>i(e).split(/[\\\/]/).slice(0,-1).reduce(((e,t)=>e.length?e.concat(i(e[e.length-1],t)):[t]),[]);const s=new Set;const getQueues=r=>{const n=t.get(r);if(!n)throw new Error("function does not have any path reservations");return{paths:n.paths.map((t=>e.get(t))),dirs:[...n.dirs].map((t=>e.get(t)))}};const check=e=>{const{paths:t,dirs:r}=getQueues(e);return t.every((t=>t[0]===e))&&r.every((t=>t[0]instanceof Set&&t[0].has(e)))};const run=e=>{if(s.has(e)||!check(e))return false;s.add(e);e((()=>clear(e)));return true};const clear=r=>{if(!s.has(r))return false;const{paths:i,dirs:a}=t.get(r);const l=new Set;i.forEach((t=>{const i=e.get(t);n.equal(i[0],r);if(i.length===1)e.delete(t);else{i.shift();if(typeof i[0]==="function")l.add(i[0]);else i[0].forEach((e=>l.add(e)))}}));a.forEach((t=>{const i=e.get(t);n(i[0]instanceof Set);if(i[0].size===1&&i.length===1){e.delete(t)}else if(i[0].size===1){i.shift();l.add(i[0])}else i[0].delete(r)}));s.delete(r);l.forEach((e=>run(e)));return true};const reserve=(r,n)=>{const i=new Set(r.map((e=>getDirs(e))).reduce(((e,t)=>e.concat(t))));t.set(n,{dirs:i,paths:r});r.forEach((t=>{const r=e.get(t);if(!r)e.set(t,[n]);else r.push(n)}));i.forEach((t=>{const r=e.get(t);if(!r)e.set(t,[new Set([n])]);else if(r[r.length-1]instanceof Set)r[r.length-1].add(n);else r.push(new Set([n]))}));return run(n)};return{check:check,reserve:reserve}}},7996:(e,t,r)=>{"use strict";const n=r(6043);const i=r(1017);class Pax{constructor(e,t){this.atime=e.atime||null;this.charset=e.charset||null;this.comment=e.comment||null;this.ctime=e.ctime||null;this.gid=e.gid||null;this.gname=e.gname||null;this.linkpath=e.linkpath||null;this.mtime=e.mtime||null;this.path=e.path||null;this.size=e.size||null;this.uid=e.uid||null;this.uname=e.uname||null;this.dev=e.dev||null;this.ino=e.ino||null;this.nlink=e.nlink||null;this.global=t||false}encode(){const e=this.encodeBody();if(e==="")return null;const t=Buffer.byteLength(e);const r=512*Math.ceil(1+t/512);const s=Buffer.allocUnsafe(r);for(let e=0;e<512;e++){s[e]=0}new n({path:("PaxHeader/"+i.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(s);s.write(e,512,t,"utf8");for(let e=t+512;e<s.length;e++){s[e]=0}return s}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===null||this[e]===undefined)return"";const t=this[e]instanceof Date?this[e].getTime()/1e3:this[e];const r=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+t+"\n";const n=Buffer.byteLength(r);let i=Math.floor(Math.log(n)/Math.log(10))+1;if(n+i>=Math.pow(10,i))i+=1;const s=i+n;return s+r}}Pax.parse=(e,t,r)=>new Pax(merge(parseKV(e),t),r);const merge=(e,t)=>t?Object.keys(e).reduce(((t,r)=>(t[r]=e[r],t)),t):e;const parseKV=e=>e.replace(/\n$/,"").split("\n").reduce(parseKVLine,Object.create(null));const parseKVLine=(e,t)=>{const r=parseInt(t,10);if(r!==Buffer.byteLength(t)+1)return e;t=t.substr((r+" ").length);const n=t.split("=");const i=n.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!i)return e;const s=n.join("=");e[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(s*1e3):/^[0-9]+$/.test(s)?+s:s;return e};e.exports=Pax},8116:(e,t,r)=>{"use strict";const n=r(4173);const i=r(1077);const s=Symbol("slurp");e.exports=class ReadEntry extends i{constructor(e,t,r){super();this.pause();this.extended=t;this.globalExtended=r;this.header=e;this.startBlockSize=512*Math.ceil(e.size/512);this.blockRemain=this.startBlockSize;this.remain=e.size;this.type=e.type;this.meta=false;this.ignore=false;switch(this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=true;break;default:this.ignore=true}this.path=e.path;this.mode=e.mode;if(this.mode)this.mode=this.mode&4095;this.uid=e.uid;this.gid=e.gid;this.uname=e.uname;this.gname=e.gname;this.size=e.size;this.mtime=e.mtime;this.atime=e.atime;this.ctime=e.ctime;this.linkpath=e.linkpath;this.uname=e.uname;this.gname=e.gname;if(t)this[s](t);if(r)this[s](r,true)}write(e){const t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");const r=this.remain;const n=this.blockRemain;this.remain=Math.max(0,r-t);this.blockRemain=Math.max(0,n-t);if(this.ignore)return true;if(r>=t)return super.write(e);return super.write(e.slice(0,r))}[s](e,t){for(let r in e){if(e[r]!==null&&e[r]!==undefined&&!(t&&r==="path"))this[r]=e[r]}}}},5923:(e,t,r)=>{"use strict";const n=r(5274);const i=r(7900);const s=r(8917);const a=r(7147);const l=r(7714);const o=r(1525);const u=r(1017);const c=r(6043);const h=e.exports=(e,t,r)=>{const i=n(e);if(!i.file)throw new TypeError("file is required");if(i.gzip)throw new TypeError("cannot append to compressed archives");if(!t||!Array.isArray(t)||!t.length)throw new TypeError("no files or directories specified");t=Array.from(t);return i.sync?replaceSync(i,t):replace(i,t,r)};const replaceSync=(e,t)=>{const r=new i.Sync(e);let n=true;let s;let l;try{try{s=a.openSync(e.file,"r+")}catch(t){if(t.code==="ENOENT")s=a.openSync(e.file,"w+");else throw t}const i=a.fstatSync(s);const o=Buffer.alloc(512);e:for(l=0;l<i.size;l+=512){for(let e=0,t=0;e<512;e+=t){t=a.readSync(s,o,e,o.length-e,l+e);if(l===0&&o[0]===31&&o[1]===139)throw new Error("cannot append to compressed archives");if(!t)break e}let t=new c(o);if(!t.cksumValid)break;let r=512*Math.ceil(t.size/512);if(l+r+512>i.size)break;l+=r;if(e.mtimeCache)e.mtimeCache.set(t.path,t.mtime)}n=false;streamSync(e,r,l,s,t)}finally{if(n)try{a.closeSync(s)}catch(e){}}};const streamSync=(e,t,r,n,i)=>{const s=new l.WriteStreamSync(e.file,{fd:n,start:r});t.pipe(s);addFilesSync(t,i)};const replace=(e,t,r)=>{t=Array.from(t);const n=new i(e);const getPos=(t,r,n)=>{const cb=(e,r)=>{if(e)a.close(t,(t=>n(e)));else n(null,r)};let i=0;if(r===0)return cb(null,0);let s=0;const l=Buffer.alloc(512);const onread=(n,o)=>{if(n)return cb(n);s+=o;if(s<512&&o)return a.read(t,l,s,l.length-s,i+s,onread);if(i===0&&l[0]===31&&l[1]===139)return cb(new Error("cannot append to compressed archives"));if(s<512)return cb(null,i);const u=new c(l);if(!u.cksumValid)return cb(null,i);const h=512*Math.ceil(u.size/512);if(i+h+512>r)return cb(null,i);i+=h+512;if(i>=r)return cb(null,i);if(e.mtimeCache)e.mtimeCache.set(u.path,u.mtime);s=0;a.read(t,l,0,512,i,onread)};a.read(t,l,0,512,i,onread)};const s=new Promise(((r,i)=>{n.on("error",i);let s="r+";const onopen=(o,u)=>{if(o&&o.code==="ENOENT"&&s==="r+"){s="w+";return a.open(e.file,s,onopen)}if(o)return i(o);a.fstat(u,((s,a)=>{if(s)return i(s);getPos(u,a.size,((s,a)=>{if(s)return i(s);const o=new l.WriteStream(e.file,{fd:u,start:a});n.pipe(o);o.on("error",i);o.on("close",r);addFilesAsync(n,t)}))}))};a.open(e.file,s,onopen)}));return r?s.then(r,r):s};const addFilesSync=(e,t)=>{t.forEach((t=>{if(t.charAt(0)==="@")o({file:u.resolve(e.cwd,t.substr(1)),sync:true,noResume:true,onentry:t=>e.add(t)});else e.add(t)}));e.end()};const addFilesAsync=(e,t)=>{while(t.length){const r=t.shift();if(r.charAt(0)==="@")return o({file:u.resolve(e.cwd,r.substr(1)),noResume:true,onentry:t=>e.add(t)}).then((r=>addFilesAsync(e,t)));else e.add(r)}e.end()}},4173:(e,t)=>{"use strict";t.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);t.code=new Map(Array.from(t.name).map((e=>[e[1],e[0]])))},7628:(e,t,r)=>{"use strict";const n=r(9491);const i=r(2361).EventEmitter;const s=r(8917);const a=r(7147);const l=r(7714);const o=r(1017);const u=r(9624);const c=u.sync;const h=r(4808);const d=r(9587);const v=Symbol("onEntry");const m=Symbol("checkFs");const p=Symbol("checkFs2");const _=Symbol("isReusable");const g=Symbol("makeFs");const w=Symbol("file");const x=Symbol("directory");const b=Symbol("link");const y=Symbol("symlink");const S=Symbol("hardlink");const E=Symbol("unsupported");const N=Symbol("unknown");const k=Symbol("checkPath");const O=Symbol("mkdir");const R=Symbol("onError");const C=Symbol("pending");const A=Symbol("pend");const I=Symbol("unpend");const F=Symbol("ended");const L=Symbol("maybeClose");const D=Symbol("skip");const T=Symbol("doChown");const B=Symbol("uid");const P=Symbol("gid");const M=r(6113);const z=r(1172);const neverCalled=()=>{throw new Error("sync function called cb somehow?!?")};const unlinkFile=(e,t)=>{if(process.platform!=="win32")return a.unlink(e,t);const r=e+".DELETE."+M.randomBytes(16).toString("hex");a.rename(e,r,(e=>{if(e)return t(e);a.unlink(r,t)}))};const unlinkFileSync=e=>{if(process.platform!=="win32")return a.unlinkSync(e);const t=e+".DELETE."+M.randomBytes(16).toString("hex");a.renameSync(e,t);a.unlinkSync(t)};const uint32=(e,t,r)=>e===e>>>0?e:t===t>>>0?t:r;class Unpack extends s{constructor(e){if(!e)e={};e.ondone=e=>{this[F]=true;this[L]()};super(e);this.reservations=d();this.transform=typeof e.transform==="function"?e.transform:null;this.writable=true;this.readable=false;this[C]=0;this[F]=false;this.dirCache=e.dirCache||new Map;if(typeof e.uid==="number"||typeof e.gid==="number"){if(typeof e.uid!=="number"||typeof e.gid!=="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid;this.gid=e.gid;this.setOwner=true}else{this.uid=null;this.gid=null;this.setOwner=false}if(e.preserveOwner===undefined&&typeof e.uid!=="number")this.preserveOwner=process.getuid&&process.getuid()===0;else this.preserveOwner=!!e.preserveOwner;this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null;this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null;this.forceChown=e.forceChown===true;this.win32=!!e.win32||process.platform==="win32";this.newer=!!e.newer;this.keep=!!e.keep;this.noMtime=!!e.noMtime;this.preservePaths=!!e.preservePaths;this.unlink=!!e.unlink;this.cwd=o.resolve(e.cwd||process.cwd());this.strip=+e.strip||0;this.processUmask=process.umask();this.umask=typeof e.umask==="number"?e.umask:this.processUmask;this.dmode=e.dmode||511&~this.umask;this.fmode=e.fmode||438&~this.umask;this.on("entry",(e=>this[v](e)))}warn(e,t,r={}){if(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")r.recoverable=false;return super.warn(e,t,r)}[L](){if(this[F]&&this[C]===0){this.emit("prefinish");this.emit("finish");this.emit("end");this.emit("close")}}[k](e){if(this.strip){const t=e.path.split(/\/|\\/);if(t.length<this.strip)return false;e.path=t.slice(this.strip).join("/");if(e.type==="Link"){const t=e.linkpath.split(/\/|\\/);if(t.length>=this.strip)e.linkpath=t.slice(this.strip).join("/")}}if(!this.preservePaths){const t=e.path;if(t.match(/(^|\/|\\)\.\.(\\|\/|$)/)){this.warn("TAR_ENTRY_ERROR",`path contains '..'`,{entry:e,path:t});return false}if(o.win32.isAbsolute(t)){const r=o.win32.parse(t);e.path=t.substr(r.root.length);const n=r.root;this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:e,path:t})}}if(this.win32){const t=o.win32.parse(e.path);e.path=t.root===""?h.encode(e.path):t.root+h.encode(e.path.substr(t.root.length))}if(o.isAbsolute(e.path))e.absolute=e.path;else e.absolute=o.resolve(this.cwd,e.path);return true}[v](e){if(!this[k](e))return e.resume();n.equal(typeof e.absolute,"string");switch(e.type){case"Directory":case"GNUDumpDir":if(e.mode)e.mode=e.mode|448;case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[m](e);case"CharacterDevice":case"BlockDevice":case"FIFO":return this[E](e)}}[R](e,t){if(e.name==="CwdError")this.emit("error",e);else{this.warn("TAR_ENTRY_ERROR",e,{entry:t});this[I]();t.resume()}}[O](e,t,r){u(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t},r)}[T](e){return this.forceChown||this.preserveOwner&&(typeof e.uid==="number"&&e.uid!==this.processUid||typeof e.gid==="number"&&e.gid!==this.processGid)||(typeof this.uid==="number"&&this.uid!==this.processUid||typeof this.gid==="number"&&this.gid!==this.processGid)}[B](e){return uint32(this.uid,e.uid,this.processUid)}[P](e){return uint32(this.gid,e.gid,this.processGid)}[w](e,t){const r=e.mode&4095||this.fmode;const n=new l.WriteStream(e.absolute,{flags:z(e.size),mode:r,autoClose:false});n.on("error",(t=>this[R](t,e)));let i=1;const done=r=>{if(r)return this[R](r,e);if(--i===0){a.close(n.fd,(r=>{t();r?this[R](r,e):this[I]()}))}};n.on("finish",(t=>{const r=e.absolute;const s=n.fd;if(e.mtime&&!this.noMtime){i++;const t=e.atime||new Date;const n=e.mtime;a.futimes(s,t,n,(e=>e?a.utimes(r,t,n,(t=>done(t&&e))):done()))}if(this[T](e)){i++;const t=this[B](e);const n=this[P](e);a.fchown(s,t,n,(e=>e?a.chown(r,t,n,(t=>done(t&&e))):done()))}done()}));const s=this.transform?this.transform(e)||e:e;if(s!==e){s.on("error",(t=>this[R](t,e)));e.pipe(s)}s.pipe(n)}[x](e,t){const r=e.mode&4095||this.dmode;this[O](e.absolute,r,(r=>{if(r){t();return this[R](r,e)}let n=1;const done=r=>{if(--n===0){t();this[I]();e.resume()}};if(e.mtime&&!this.noMtime){n++;a.utimes(e.absolute,e.atime||new Date,e.mtime,done)}if(this[T](e)){n++;a.chown(e.absolute,this[B](e),this[P](e),done)}done()}))}[E](e){e.unsupported=true;this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e});e.resume()}[y](e,t){this[b](e,e.linkpath,"symlink",t)}[S](e,t){this[b](e,o.resolve(this.cwd,e.linkpath),"link",t)}[A](){this[C]++}[I](){this[C]--;this[L]()}[D](e){this[I]();e.resume()}[_](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&process.platform!=="win32"}[m](e){this[A]();const t=[e.path];if(e.linkpath)t.push(e.linkpath);this.reservations.reserve(t,(t=>this[p](e,t)))}[p](e,t){this[O](o.dirname(e.absolute),this.dmode,(r=>{if(r){t();return this[R](r,e)}a.lstat(e.absolute,((r,n)=>{if(n&&(this.keep||this.newer&&n.mtime>e.mtime)){this[D](e);t()}else if(r||this[_](e,n)){this[g](null,e,t)}else if(n.isDirectory()){if(e.type==="Directory"){if(!e.mode||(n.mode&4095)===e.mode)this[g](null,e,t);else a.chmod(e.absolute,e.mode,(r=>this[g](r,e,t)))}else a.rmdir(e.absolute,(r=>this[g](r,e,t)))}else unlinkFile(e.absolute,(r=>this[g](r,e,t)))}))}))}[g](e,t,r){if(e)return this[R](e,t);switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[w](t,r);case"Link":return this[S](t,r);case"SymbolicLink":return this[y](t,r);case"Directory":case"GNUDumpDir":return this[x](t,r)}}[b](e,t,r,n){a[r](t,e.absolute,(t=>{if(t)return this[R](t,e);n();this[I]();e.resume()}))}}class UnpackSync extends Unpack{constructor(e){super(e)}[m](e){const t=this[O](o.dirname(e.absolute),this.dmode,neverCalled);if(t)return this[R](t,e);try{const r=a.lstatSync(e.absolute);if(this.keep||this.newer&&r.mtime>e.mtime)return this[D](e);else if(this[_](e,r))return this[g](null,e,neverCalled);else{try{if(r.isDirectory()){if(e.type==="Directory"){if(e.mode&&(r.mode&4095)!==e.mode)a.chmodSync(e.absolute,e.mode)}else a.rmdirSync(e.absolute)}else unlinkFileSync(e.absolute);return this[g](null,e,neverCalled)}catch(t){return this[R](t,e)}}}catch(t){return this[g](null,e,neverCalled)}}[w](e,t){const r=e.mode&4095||this.fmode;const oner=t=>{let r;try{a.closeSync(i)}catch(e){r=e}if(t||r)this[R](t||r,e)};let n;let i;try{i=a.openSync(e.absolute,z(e.size),r)}catch(e){return oner(e)}const s=this.transform?this.transform(e)||e:e;if(s!==e){s.on("error",(t=>this[R](t,e)));e.pipe(s)}s.on("data",(e=>{try{a.writeSync(i,e,0,e.length)}catch(e){oner(e)}}));s.on("end",(t=>{let r=null;if(e.mtime&&!this.noMtime){const t=e.atime||new Date;const n=e.mtime;try{a.futimesSync(i,t,n)}catch(i){try{a.utimesSync(e.absolute,t,n)}catch(e){r=i}}}if(this[T](e)){const t=this[B](e);const n=this[P](e);try{a.fchownSync(i,t,n)}catch(i){try{a.chownSync(e.absolute,t,n)}catch(e){r=r||i}}}oner(r)}))}[x](e,t){const r=e.mode&4095||this.dmode;const n=this[O](e.absolute,r);if(n)return this[R](n,e);if(e.mtime&&!this.noMtime){try{a.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch(n){}}if(this[T](e)){try{a.chownSync(e.absolute,this[B](e),this[P](e))}catch(n){}}e.resume()}[O](e,t){try{return u.sync(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(e){return e}}[b](e,t,r,n){try{a[r+"Sync"](t,e.absolute);e.resume()}catch(t){return this[R](t,e)}}}Unpack.Sync=UnpackSync;e.exports=Unpack},4404:(e,t,r)=>{"use strict";const n=r(5274);const i=r(5923);const s=e.exports=(e,t,r)=>{const s=n(e);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!t||!Array.isArray(t)||!t.length)throw new TypeError("no files or directories specified");t=Array.from(t);mtimeFilter(s);return i(s,t,r)};const mtimeFilter=e=>{const t=e.filter;if(!e.mtimeCache)e.mtimeCache=new Map;e.filter=t?(r,n)=>t(r,n)&&!(e.mtimeCache.get(r)>n.mtime):(t,r)=>!(e.mtimeCache.get(t)>r.mtime)}},5899:e=>{"use strict";e.exports=e=>class extends e{warn(e,t,r={}){if(this.file)r.file=this.file;if(this.cwd)r.cwd=this.cwd;r.code=t instanceof Error&&t.code||e;r.tarCode=e;if(!this.strict&&r.recoverable!==false){if(t instanceof Error){r=Object.assign(t,r);t=t.message}this.emit("warn",r.tarCode,t,r)}else if(t instanceof Error){this.emit("error",Object.assign(t,r))}else this.emit("error",Object.assign(new Error(`${e}: ${t}`),r))}}},4808:e=>{"use strict";const t=["|","<",">","?",":"];const r=t.map((e=>String.fromCharCode(61440+e.charCodeAt(0))));const n=new Map(t.map(((e,t)=>[e,r[t]])));const i=new Map(r.map(((e,r)=>[e,t[r]])));e.exports={encode:e=>t.reduce(((e,t)=>e.split(t).join(n.get(t))),e),decode:e=>r.reduce(((e,t)=>e.split(t).join(i.get(t))),e)}},5450:(e,t,r)=>{"use strict";const n=r(1077);const i=r(7996);const s=r(6043);const a=r(8116);const l=r(7147);const o=r(1017);const u=r(4173);const c=16*1024*1024;const h=Symbol("process");const d=Symbol("file");const v=Symbol("directory");const m=Symbol("symlink");const p=Symbol("hardlink");const _=Symbol("header");const g=Symbol("read");const w=Symbol("lstat");const x=Symbol("onlstat");const b=Symbol("onread");const y=Symbol("onreadlink");const S=Symbol("openfile");const E=Symbol("onopenfile");const N=Symbol("close");const k=Symbol("mode");const O=r(5899);const R=r(4808);const C=r(8371);const A=O(class WriteEntry extends n{constructor(e,t){t=t||{};super(t);if(typeof e!=="string")throw new TypeError("path is required");this.path=e;this.portable=!!t.portable;this.myuid=process.getuid&&process.getuid();this.myuser=process.env.USER||"";this.maxReadSize=t.maxReadSize||c;this.linkCache=t.linkCache||new Map;this.statCache=t.statCache||new Map;this.preservePaths=!!t.preservePaths;this.cwd=t.cwd||process.cwd();this.strict=!!t.strict;this.noPax=!!t.noPax;this.noMtime=!!t.noMtime;this.mtime=t.mtime||null;if(typeof t.onwarn==="function")this.on("warn",t.onwarn);let r=false;if(!this.preservePaths&&o.win32.isAbsolute(e)){const t=o.win32.parse(e);this.path=e.substr(t.root.length);r=t.root}this.win32=!!t.win32||process.platform==="win32";if(this.win32){this.path=R.decode(this.path.replace(/\\/g,"/"));e=e.replace(/\\/g,"/")}this.absolute=t.absolute||o.resolve(this.cwd,e);if(this.path==="")this.path="./";if(r){this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path})}if(this.statCache.has(this.absolute))this[x](this.statCache.get(this.absolute));else this[w]()}[w](){l.lstat(this.absolute,((e,t)=>{if(e)return this.emit("error",e);this[x](t)}))}[x](e){this.statCache.set(this.absolute,e);this.stat=e;if(!e.isFile())e.size=0;this.type=getType(e);this.emit("stat",e);this[h]()}[h](){switch(this.type){case"File":return this[d]();case"Directory":return this[v]();case"SymbolicLink":return this[m]();default:return this.end()}}[k](e){return C(e,this.type==="Directory",this.portable)}[_](){if(this.type==="Directory"&&this.portable)this.noMtime=true;this.header=new s({path:this.path,linkpath:this.linkpath,mode:this[k](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime});if(this.header.encode()&&!this.noPax)this.write(new i({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this.path,linkpath:this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode());this.write(this.header.block)}[v](){if(this.path.substr(-1)!=="/")this.path+="/";this.stat.size=0;this[_]();this.end()}[m](){l.readlink(this.absolute,((e,t)=>{if(e)return this.emit("error",e);this[y](t)}))}[y](e){this.linkpath=e.replace(/\\/g,"/");this[_]();this.end()}[p](e){this.type="Link";this.linkpath=o.relative(this.cwd,e).replace(/\\/g,"/");this.stat.size=0;this[_]();this.end()}[d](){if(this.stat.nlink>1){const e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){const t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[p](t)}this.linkCache.set(e,this.absolute)}this[_]();if(this.stat.size===0)return this.end();this[S]()}[S](){l.open(this.absolute,"r",((e,t)=>{if(e)return this.emit("error",e);this[E](t)}))}[E](e){const t=512*Math.ceil(this.stat.size/512);const r=Math.min(t,this.maxReadSize);const n=Buffer.allocUnsafe(r);this[g](e,n,0,n.length,0,this.stat.size,t)}[g](e,t,r,n,i,s,a){l.read(e,t,r,n,i,((l,o)=>{if(l){return this[N](e,(()=>this.emit("error",l)))}this[b](e,t,r,n,i,s,a,o)}))}[N](e,t){l.close(e,t)}[b](e,t,r,n,i,s,a,l){if(l<=0&&s>0){const t=new Error("encountered unexpected EOF");t.path=this.absolute;t.syscall="read";t.code="EOF";return this[N](e,(()=>this.emit("error",t)))}if(l>s){const t=new Error("did not encounter expected EOF");t.path=this.absolute;t.syscall="read";t.code="EOF";return this[N](e,(()=>this.emit("error",t)))}if(l===s){for(let e=l;e<n&&l<a;e++){t[e+r]=0;l++;s++}}const o=r===0&&l===t.length?t:t.slice(r,r+l);s-=l;a-=l;i+=l;r+=l;this.write(o);if(!s){if(a)this.write(Buffer.alloc(a));return this[N](e,(e=>e?this.emit("error",e):this.end()))}if(r>=n){t=Buffer.allocUnsafe(n);r=0}n=t.length-r;this[g](e,t,r,n,i,s,a)}});class WriteEntrySync extends A{constructor(e,t){super(e,t)}[w](){this[x](l.lstatSync(this.absolute))}[m](){this[y](l.readlinkSync(this.absolute))}[S](){this[E](l.openSync(this.absolute,"r"))}[g](e,t,r,n,i,s,a){let o=true;try{const u=l.readSync(e,t,r,n,i);this[b](e,t,r,n,i,s,a,u);o=false}finally{if(o)try{this[N](e,(()=>{}))}catch(e){}}}[N](e,t){l.closeSync(e);t()}}const I=O(class WriteEntryTar extends n{constructor(e,t){t=t||{};super(t);this.preservePaths=!!t.preservePaths;this.portable=!!t.portable;this.strict=!!t.strict;this.noPax=!!t.noPax;this.noMtime=!!t.noMtime;this.readEntry=e;this.type=e.type;if(this.type==="Directory"&&this.portable)this.noMtime=true;this.path=e.path;this.mode=this[k](e.mode);this.uid=this.portable?null:e.uid;this.gid=this.portable?null:e.gid;this.uname=this.portable?null:e.uname;this.gname=this.portable?null:e.gname;this.size=e.size;this.mtime=this.noMtime?null:t.mtime||e.mtime;this.atime=this.portable?null:e.atime;this.ctime=this.portable?null:e.ctime;this.linkpath=e.linkpath;if(typeof t.onwarn==="function")this.on("warn",t.onwarn);let r=false;if(o.isAbsolute(this.path)&&!this.preservePaths){const e=o.parse(this.path);r=e.root;this.path=this.path.substr(e.root.length)}this.remain=e.size;this.blockRemain=e.startBlockSize;this.header=new s({path:this.path,linkpath:this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime});if(r){this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path})}if(this.header.encode()&&!this.noPax)super.write(new i({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this.path,linkpath:this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode());super.write(this.header.block);e.pipe(this)}[k](e){return C(e,this.type==="Directory",this.portable)}write(e){const t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");this.blockRemain-=t;return super.write(e)}end(){if(this.blockRemain)this.write(Buffer.alloc(this.blockRemain));return super.end()}});A.Sync=WriteEntrySync;A.Tar=I;const getType=e=>e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":"Unsupported";e.exports=A},4091:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next){yield e.value}}}},665:(e,t,r)=>{"use strict";e.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(e){var t=this;if(!(t instanceof Yallist)){t=new Yallist}t.tail=null;t.head=null;t.length=0;if(e&&typeof e.forEach==="function"){e.forEach((function(e){t.push(e)}))}else if(arguments.length>0){for(var r=0,n=arguments.length;r<n;r++){t.push(arguments[r])}}return t}Yallist.prototype.removeNode=function(e){if(e.list!==this){throw new Error("removing node which does not belong to this list")}var t=e.next;var r=e.prev;if(t){t.prev=r}if(r){r.next=t}if(e===this.head){this.head=t}if(e===this.tail){this.tail=r}e.list.length--;e.next=null;e.prev=null;e.list=null;return t};Yallist.prototype.unshiftNode=function(e){if(e===this.head){return}if(e.list){e.list.removeNode(e)}var t=this.head;e.list=this;e.next=t;if(t){t.prev=e}this.head=e;if(!this.tail){this.tail=e}this.length++};Yallist.prototype.pushNode=function(e){if(e===this.tail){return}if(e.list){e.list.removeNode(e)}var t=this.tail;e.list=this;e.prev=t;if(t){t.next=e}this.tail=e;if(!this.head){this.head=e}this.length++};Yallist.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++){push(this,arguments[e])}return this.length};Yallist.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++){unshift(this,arguments[e])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var e=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return e};Yallist.prototype.shift=function(){if(!this.head){return undefined}var e=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return e};Yallist.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++){e.call(t,r.value,n,this);r=r.next}};Yallist.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--){e.call(t,r.value,n,this);r=r.prev}};Yallist.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++){r=r.next}if(t===e&&r!==null){return r.value}};Yallist.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++){r=r.prev}if(t===e&&r!==null){return r.value}};Yallist.prototype.map=function(e,t){t=t||this;var r=new Yallist;for(var n=this.head;n!==null;){r.push(e.call(t,n.value,this));n=n.next}return r};Yallist.prototype.mapReverse=function(e,t){t=t||this;var r=new Yallist;for(var n=this.tail;n!==null;){r.push(e.call(t,n.value,this));n=n.prev}return r};Yallist.prototype.reduce=function(e,t){var r;var n=this.head;if(arguments.length>1){r=t}else if(this.head){n=this.head.next;r=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var i=0;n!==null;i++){r=e(r,n.value,i);n=n.next}return r};Yallist.prototype.reduceReverse=function(e,t){var r;var n=this.tail;if(arguments.length>1){r=t}else if(this.tail){n=this.tail.prev;r=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var i=this.length-1;n!==null;i--){r=e(r,n.value,i);n=n.prev}return r};Yallist.prototype.toArray=function(){var e=new Array(this.length);for(var t=0,r=this.head;r!==null;t++){e[t]=r.value;r=r.next}return e};Yallist.prototype.toArrayReverse=function(){var e=new Array(this.length);for(var t=0,r=this.tail;r!==null;t++){e[t]=r.value;r=r.prev}return e};Yallist.prototype.slice=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var n=0,i=this.head;i!==null&&n<e;n++){i=i.next}for(;i!==null&&n<t;n++,i=i.next){r.push(i.value)}return r};Yallist.prototype.sliceReverse=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var n=this.length,i=this.tail;i!==null&&n>t;n--){i=i.prev}for(;i!==null&&n>e;n--,i=i.prev){r.push(i.value)}return r};Yallist.prototype.splice=function(e,t,...r){if(e>this.length){e=this.length-1}if(e<0){e=this.length+e}for(var n=0,i=this.head;i!==null&&n<e;n++){i=i.next}var s=[];for(var n=0;i&&n<t;n++){s.push(i.value);i=this.removeNode(i)}if(i===null){i=this.tail}if(i!==this.head&&i!==this.tail){i=i.prev}for(var n=0;n<r.length;n++){i=insert(this,i,r[n])}return s};Yallist.prototype.reverse=function(){var e=this.head;var t=this.tail;for(var r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next;r.next=n}this.head=t;this.tail=e;return this};function insert(e,t,r){var n=t===e.head?new Node(r,null,t,e):new Node(r,t,t.next,e);if(n.next===null){e.tail=n}if(n.prev===null){e.head=n}e.length++;return n}function push(e,t){e.tail=new Node(t,e.tail,null,e);if(!e.head){e.head=e.tail}e.length++}function unshift(e,t){e.head=new Node(t,null,e.head,e);if(!e.tail){e.tail=e.head}e.length++}function Node(e,t,r,n){if(!(this instanceof Node)){return new Node(e,t,r,n)}this.list=n;this.value=e;if(t){t.next=this;this.prev=t}else{this.prev=null}if(r){r.prev=this;this.next=r}else{this.next=null}}try{r(4091)(Yallist)}catch(e){}},8781:(e,t,r)=>{var n=r(7147);var i=r(9796);var s=r(5010);var a=r(4794);var l=r(3837);var o=r(2361).EventEmitter;var u=r(2781).Transform;var c=r(2781).PassThrough;var h=r(2781).Writable;t.open=open;t.fromFd=fromFd;t.fromBuffer=fromBuffer;t.fromRandomAccessReader=fromRandomAccessReader;t.dosDateTimeToDate=dosDateTimeToDate;t.validateFileName=validateFileName;t.ZipFile=ZipFile;t.Entry=Entry;t.RandomAccessReader=RandomAccessReader;function open(e,t,r){if(typeof t==="function"){r=t;t=null}if(t==null)t={};if(t.autoClose==null)t.autoClose=true;if(t.lazyEntries==null)t.lazyEntries=false;if(t.decodeStrings==null)t.decodeStrings=true;if(t.validateEntrySizes==null)t.validateEntrySizes=true;if(t.strictFileNames==null)t.strictFileNames=false;if(r==null)r=defaultCallback;n.open(e,"r",(function(e,i){if(e)return r(e);fromFd(i,t,(function(e,t){if(e)n.close(i,defaultCallback);r(e,t)}))}))}function fromFd(e,t,r){if(typeof t==="function"){r=t;t=null}if(t==null)t={};if(t.autoClose==null)t.autoClose=false;if(t.lazyEntries==null)t.lazyEntries=false;if(t.decodeStrings==null)t.decodeStrings=true;if(t.validateEntrySizes==null)t.validateEntrySizes=true;if(t.strictFileNames==null)t.strictFileNames=false;if(r==null)r=defaultCallback;n.fstat(e,(function(n,i){if(n)return r(n);var a=s.createFromFd(e,{autoClose:true});fromRandomAccessReader(a,i.size,t,r)}))}function fromBuffer(e,t,r){if(typeof t==="function"){r=t;t=null}if(t==null)t={};t.autoClose=false;if(t.lazyEntries==null)t.lazyEntries=false;if(t.decodeStrings==null)t.decodeStrings=true;if(t.validateEntrySizes==null)t.validateEntrySizes=true;if(t.strictFileNames==null)t.strictFileNames=false;var n=s.createFromBuffer(e,{maxChunkSize:65536});fromRandomAccessReader(n,e.length,t,r)}function fromRandomAccessReader(e,t,r,n){if(typeof r==="function"){n=r;r=null}if(r==null)r={};if(r.autoClose==null)r.autoClose=true;if(r.lazyEntries==null)r.lazyEntries=false;if(r.decodeStrings==null)r.decodeStrings=true;var i=!!r.decodeStrings;if(r.validateEntrySizes==null)r.validateEntrySizes=true;if(r.strictFileNames==null)r.strictFileNames=false;if(n==null)n=defaultCallback;if(typeof t!=="number")throw new Error("expected totalSize parameter to be a number");if(t>Number.MAX_SAFE_INTEGER){throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.")}e.ref();var s=22;var a=65535;var l=Math.min(s+a,t);var o=v(l);var u=t-o.length;readAndAssertNoEof(e,o,0,l,u,(function(a){if(a)return n(a);for(var c=l-s;c>=0;c-=1){if(o.readUInt32LE(c)!==101010256)continue;var h=o.slice(c);var d=h.readUInt16LE(4);if(d!==0){return n(new Error("multi-disk zip files are not supported: found disk number: "+d))}var m=h.readUInt16LE(10);var p=h.readUInt32LE(16);var _=h.readUInt16LE(20);var g=h.length-s;if(_!==g){return n(new Error("invalid comment length. expected: "+g+". found: "+_))}var w=i?decodeBuffer(h,22,h.length,false):h.slice(22);if(!(m===65535||p===4294967295)){return n(null,new ZipFile(e,p,t,m,w,r.autoClose,r.lazyEntries,i,r.validateEntrySizes,r.strictFileNames))}var x=v(20);var b=u+c-x.length;readAndAssertNoEof(e,x,0,x.length,b,(function(s){if(s)return n(s);if(x.readUInt32LE(0)!==117853008){return n(new Error("invalid zip64 end of central directory locator signature"))}var a=readUInt64LE(x,8);var l=v(56);readAndAssertNoEof(e,l,0,l.length,a,(function(s){if(s)return n(s);if(l.readUInt32LE(0)!==101075792){return n(new Error("invalid zip64 end of central directory record signature"))}m=readUInt64LE(l,32);p=readUInt64LE(l,48);return n(null,new ZipFile(e,p,t,m,w,r.autoClose,r.lazyEntries,i,r.validateEntrySizes,r.strictFileNames))}))}));return}n(new Error("end of central directory record signature not found"))}))}l.inherits(ZipFile,o);function ZipFile(e,t,r,n,i,s,a,l,u,c){var h=this;o.call(h);h.reader=e;h.reader.on("error",(function(e){emitError(h,e)}));h.reader.once("close",(function(){h.emit("close")}));h.readEntryCursor=t;h.fileSize=r;h.entryCount=n;h.comment=i;h.entriesRead=0;h.autoClose=!!s;h.lazyEntries=!!a;h.decodeStrings=!!l;h.validateEntrySizes=!!u;h.strictFileNames=!!c;h.isOpen=true;h.emittedError=false;if(!h.lazyEntries)h._readEntry()}ZipFile.prototype.close=function(){if(!this.isOpen)return;this.isOpen=false;this.reader.unref()};function emitErrorAndAutoClose(e,t){if(e.autoClose)e.close();emitError(e,t)}function emitError(e,t){if(e.emittedError)return;e.emittedError=true;e.emit("error",t)}ZipFile.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};ZipFile.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead){setImmediate((function(){if(e.autoClose)e.close();if(e.emittedError)return;e.emit("end")}));return}if(e.emittedError)return;var r=v(46);readAndAssertNoEof(e.reader,r,0,r.length,e.readEntryCursor,(function(n){if(n)return emitErrorAndAutoClose(e,n);if(e.emittedError)return;var i=new Entry;var s=r.readUInt32LE(0);if(s!==33639248)return emitErrorAndAutoClose(e,new Error("invalid central directory file header signature: 0x"+s.toString(16)));i.versionMadeBy=r.readUInt16LE(4);i.versionNeededToExtract=r.readUInt16LE(6);i.generalPurposeBitFlag=r.readUInt16LE(8);i.compressionMethod=r.readUInt16LE(10);i.lastModFileTime=r.readUInt16LE(12);i.lastModFileDate=r.readUInt16LE(14);i.crc32=r.readUInt32LE(16);i.compressedSize=r.readUInt32LE(20);i.uncompressedSize=r.readUInt32LE(24);i.fileNameLength=r.readUInt16LE(28);i.extraFieldLength=r.readUInt16LE(30);i.fileCommentLength=r.readUInt16LE(32);i.internalFileAttributes=r.readUInt16LE(36);i.externalFileAttributes=r.readUInt32LE(38);i.relativeOffsetOfLocalHeader=r.readUInt32LE(42);if(i.generalPurposeBitFlag&64)return emitErrorAndAutoClose(e,new Error("strong encryption is not supported"));e.readEntryCursor+=46;r=v(i.fileNameLength+i.extraFieldLength+i.fileCommentLength);readAndAssertNoEof(e.reader,r,0,r.length,e.readEntryCursor,(function(n){if(n)return emitErrorAndAutoClose(e,n);if(e.emittedError)return;var s=(i.generalPurposeBitFlag&2048)!==0;i.fileName=e.decodeStrings?decodeBuffer(r,0,i.fileNameLength,s):r.slice(0,i.fileNameLength);var l=i.fileNameLength+i.extraFieldLength;var o=r.slice(i.fileNameLength,l);i.extraFields=[];var u=0;while(u<o.length-3){var c=o.readUInt16LE(u+0);var h=o.readUInt16LE(u+2);var d=u+4;var m=d+h;if(m>o.length)return emitErrorAndAutoClose(e,new Error("extra field length exceeds extra field buffer size"));var p=v(h);o.copy(p,0,d,m);i.extraFields.push({id:c,data:p});u=m}i.fileComment=e.decodeStrings?decodeBuffer(r,l,l+i.fileCommentLength,s):r.slice(l,l+i.fileCommentLength);i.comment=i.fileComment;e.readEntryCursor+=r.length;e.entriesRead+=1;if(i.uncompressedSize===4294967295||i.compressedSize===4294967295||i.relativeOffsetOfLocalHeader===4294967295){var _=null;for(var u=0;u<i.extraFields.length;u++){var g=i.extraFields[u];if(g.id===1){_=g.data;break}}if(_==null){return emitErrorAndAutoClose(e,new Error("expected zip64 extended information extra field"))}var w=0;if(i.uncompressedSize===4294967295){if(w+8>_.length){return emitErrorAndAutoClose(e,new Error("zip64 extended information extra field does not include uncompressed size"))}i.uncompressedSize=readUInt64LE(_,w);w+=8}if(i.compressedSize===4294967295){if(w+8>_.length){return emitErrorAndAutoClose(e,new Error("zip64 extended information extra field does not include compressed size"))}i.compressedSize=readUInt64LE(_,w);w+=8}if(i.relativeOffsetOfLocalHeader===4294967295){if(w+8>_.length){return emitErrorAndAutoClose(e,new Error("zip64 extended information extra field does not include relative header offset"))}i.relativeOffsetOfLocalHeader=readUInt64LE(_,w);w+=8}}if(e.decodeStrings){for(var u=0;u<i.extraFields.length;u++){var g=i.extraFields[u];if(g.id===28789){if(g.data.length<6){continue}if(g.data.readUInt8(0)!==1){continue}var x=g.data.readUInt32LE(1);if(a.unsigned(r.slice(0,i.fileNameLength))!==x){continue}i.fileName=decodeBuffer(g.data,5,g.data.length,true);break}}}if(e.validateEntrySizes&&i.compressionMethod===0){var b=i.uncompressedSize;if(i.isEncrypted()){b+=12}if(i.compressedSize!==b){var y="compressed/uncompressed size mismatch for stored file: "+i.compressedSize+" != "+i.uncompressedSize;return emitErrorAndAutoClose(e,new Error(y))}}if(e.decodeStrings){if(!e.strictFileNames){i.fileName=i.fileName.replace(/\\/g,"/")}var S=t.validateFileName(i.fileName);if(S!=null)return emitErrorAndAutoClose(e,new Error(S))}e.emit("entry",i);if(!e.lazyEntries)e._readEntry()}))}))};ZipFile.prototype.openReadStream=function(e,t,r){var n=this;var s=0;var a=e.compressedSize;if(r==null){r=t;t={}}else{if(t.decrypt!=null){if(!e.isEncrypted()){throw new Error("options.decrypt can only be specified for encrypted entries")}if(t.decrypt!==false)throw new Error("invalid options.decrypt value: "+t.decrypt);if(e.isCompressed()){if(t.decompress!==false)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}}if(t.decompress!=null){if(!e.isCompressed()){throw new Error("options.decompress can only be specified for compressed entries")}if(!(t.decompress===false||t.decompress===true)){throw new Error("invalid options.decompress value: "+t.decompress)}}if(t.start!=null||t.end!=null){if(e.isCompressed()&&t.decompress!==false){throw new Error("start/end range not allowed for compressed entry without options.decompress === false")}if(e.isEncrypted()&&t.decrypt!==false){throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}}if(t.start!=null){s=t.start;if(s<0)throw new Error("options.start < 0");if(s>e.compressedSize)throw new Error("options.start > entry.compressedSize")}if(t.end!=null){a=t.end;if(a<0)throw new Error("options.end < 0");if(a>e.compressedSize)throw new Error("options.end > entry.compressedSize");if(a<s)throw new Error("options.end < options.start")}}if(!n.isOpen)return r(new Error("closed"));if(e.isEncrypted()){if(t.decrypt!==false)return r(new Error("entry is encrypted, and options.decrypt !== false"))}n.reader.ref();var l=v(30);readAndAssertNoEof(n.reader,l,0,l.length,e.relativeOffsetOfLocalHeader,(function(o){try{if(o)return r(o);var u=l.readUInt32LE(0);if(u!==67324752){return r(new Error("invalid local file header signature: 0x"+u.toString(16)))}var c=l.readUInt16LE(26);var h=l.readUInt16LE(28);var d=e.relativeOffsetOfLocalHeader+l.length+c+h;var v;if(e.compressionMethod===0){v=false}else if(e.compressionMethod===8){v=t.decompress!=null?t.decompress:true}else{return r(new Error("unsupported compression method: "+e.compressionMethod))}var m=d;var p=m+e.compressedSize;if(e.compressedSize!==0){if(p>n.fileSize){return r(new Error("file data overflows file bounds: "+m+" + "+e.compressedSize+" > "+n.fileSize))}}var _=n.reader.createReadStream({start:m+s,end:m+a});var g=_;if(v){var w=false;var x=i.createInflateRaw();_.on("error",(function(e){setImmediate((function(){if(!w)x.emit("error",e)}))}));_.pipe(x);if(n.validateEntrySizes){g=new AssertByteCountStream(e.uncompressedSize);x.on("error",(function(e){setImmediate((function(){if(!w)g.emit("error",e)}))}));x.pipe(g)}else{g=x}g.destroy=function(){w=true;if(x!==g)x.unpipe(g);_.unpipe(x);_.destroy()}}r(null,g)}finally{n.reader.unref()}}))};function Entry(){}Entry.prototype.getLastModDate=function(){return dosDateTimeToDate(this.lastModFileDate,this.lastModFileTime)};Entry.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};Entry.prototype.isCompressed=function(){return this.compressionMethod===8};function dosDateTimeToDate(e,t){var r=e&31;var n=(e>>5&15)-1;var i=(e>>9&127)+1980;var s=0;var a=(t&31)*2;var l=t>>5&63;var o=t>>11&31;return new Date(i,n,r,o,l,a,s)}function validateFileName(e){if(e.indexOf("\\")!==-1){return"invalid characters in fileName: "+e}if(/^[a-zA-Z]:/.test(e)||/^\//.test(e)){return"absolute path: "+e}if(e.split("/").indexOf("..")!==-1){return"invalid relative path: "+e}return null}function readAndAssertNoEof(e,t,r,n,i,s){if(n===0){return setImmediate((function(){s(null,v(0))}))}e.read(t,r,n,i,(function(e,t){if(e)return s(e);if(t<n){return s(new Error("unexpected EOF"))}s()}))}l.inherits(AssertByteCountStream,u);function AssertByteCountStream(e){u.call(this);this.actualByteCount=0;this.expectedByteCount=e}AssertByteCountStream.prototype._transform=function(e,t,r){this.actualByteCount+=e.length;if(this.actualByteCount>this.expectedByteCount){var n="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return r(new Error(n))}r(null,e)};AssertByteCountStream.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return e(new Error(t))}e()};l.inherits(RandomAccessReader,o);function RandomAccessReader(){o.call(this);this.refCount=0}RandomAccessReader.prototype.ref=function(){this.refCount+=1};RandomAccessReader.prototype.unref=function(){var e=this;e.refCount-=1;if(e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");e.close(onCloseDone);function onCloseDone(t){if(t)return e.emit("error",t);e.emit("close")}};RandomAccessReader.prototype.createReadStream=function(e){var t=e.start;var r=e.end;if(t===r){var n=new c;setImmediate((function(){n.end()}));return n}var i=this._readStreamForRange(t,r);var s=false;var a=new RefUnrefFilter(this);i.on("error",(function(e){setImmediate((function(){if(!s)a.emit("error",e)}))}));a.destroy=function(){i.unpipe(a);a.unref();i.destroy()};var l=new AssertByteCountStream(r-t);a.on("error",(function(e){setImmediate((function(){if(!s)l.emit("error",e)}))}));l.destroy=function(){s=true;a.unpipe(l);a.destroy()};return i.pipe(a).pipe(l)};RandomAccessReader.prototype._readStreamForRange=function(e,t){throw new Error("not implemented")};RandomAccessReader.prototype.read=function(e,t,r,n,i){var s=this.createReadStream({start:n,end:n+r});var a=new h;var l=0;a._write=function(r,n,i){r.copy(e,t+l,0,r.length);l+=r.length;i()};a.on("finish",i);s.on("error",(function(e){i(e)}));s.pipe(a)};RandomAccessReader.prototype.close=function(e){setImmediate(e)};l.inherits(RefUnrefFilter,c);function RefUnrefFilter(e){c.call(this);this.context=e;this.context.ref();this.unreffedYet=false}RefUnrefFilter.prototype._flush=function(e){this.unref();e()};RefUnrefFilter.prototype.unref=function(e){if(this.unreffedYet)return;this.unreffedYet=true;this.context.unref()};var d="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function decodeBuffer(e,t,r,n){if(n){return e.toString("utf8",t,r)}else{var i="";for(var s=t;s<r;s++){i+=d[e[s]]}return i}}function readUInt64LE(e,t){var r=e.readUInt32LE(t);var n=e.readUInt32LE(t+4);return n*4294967296+r}var v;if(typeof Buffer.allocUnsafe==="function"){v=function(e){return Buffer.allocUnsafe(e)}}else{v=function(e){return new Buffer(e)}}function defaultCallback(e){if(e)throw e}},9491:e=>{"use strict";e.exports=require("assert")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},2057:e=>{"use strict";e.exports=require("constants")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},1017:e=>{"use strict";e.exports=require("path")},2781:e=>{"use strict";e.exports=require("stream")},1576:e=>{"use strict";e.exports=require("string_decoder")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},9796:e=>{"use strict";e.exports=require("zlib")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={exports:{}};var s=true;try{e[r].call(i.exports,i,i.exports,__nccwpck_require__);s=false}finally{if(s)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(6732);module.exports=r})();
2
+ (()=>{var e={6732:function(e,t,r){(function(e){"use strict";var t={},$estr=function(){return js_Boot.__string_rec(this,"")},n=n||{},i;function $extend(e,t){var r=Object.create(e);for(var n in t)r[n]=t[n];if(t.toString!==Object.prototype.toString)r.toString=t.toString;return r}var s=n["Attribute"]={__ename__:"Attribute",__constructs__:null,Off:{_hx_name:"Off",_hx_index:0,__enum__:"Attribute",toString:$estr},Bold:{_hx_name:"Bold",_hx_index:1,__enum__:"Attribute",toString:$estr},Underline:{_hx_name:"Underline",_hx_index:2,__enum__:"Attribute",toString:$estr},Blink:{_hx_name:"Blink",_hx_index:3,__enum__:"Attribute",toString:$estr},ReverseVideo:{_hx_name:"ReverseVideo",_hx_index:4,__enum__:"Attribute",toString:$estr},Concealed:{_hx_name:"Concealed",_hx_index:5,__enum__:"Attribute",toString:$estr},BoldOff:{_hx_name:"BoldOff",_hx_index:6,__enum__:"Attribute",toString:$estr},UnderlineOff:{_hx_name:"UnderlineOff",_hx_index:7,__enum__:"Attribute",toString:$estr},BlinkOff:{_hx_name:"BlinkOff",_hx_index:8,__enum__:"Attribute",toString:$estr},NormalVideo:{_hx_name:"NormalVideo",_hx_index:9,__enum__:"Attribute",toString:$estr},ConcealedOff:{_hx_name:"ConcealedOff",_hx_index:10,__enum__:"Attribute",toString:$estr},Black:{_hx_name:"Black",_hx_index:11,__enum__:"Attribute",toString:$estr},Red:{_hx_name:"Red",_hx_index:12,__enum__:"Attribute",toString:$estr},Green:{_hx_name:"Green",_hx_index:13,__enum__:"Attribute",toString:$estr},Yellow:{_hx_name:"Yellow",_hx_index:14,__enum__:"Attribute",toString:$estr},Blue:{_hx_name:"Blue",_hx_index:15,__enum__:"Attribute",toString:$estr},Magenta:{_hx_name:"Magenta",_hx_index:16,__enum__:"Attribute",toString:$estr},Cyan:{_hx_name:"Cyan",_hx_index:17,__enum__:"Attribute",toString:$estr},White:{_hx_name:"White",_hx_index:18,__enum__:"Attribute",toString:$estr},DefaultForeground:{_hx_name:"DefaultForeground",_hx_index:19,__enum__:"Attribute",toString:$estr},BlackBack:{_hx_name:"BlackBack",_hx_index:20,__enum__:"Attribute",toString:$estr},RedBack:{_hx_name:"RedBack",_hx_index:21,__enum__:"Attribute",toString:$estr},GreenBack:{_hx_name:"GreenBack",_hx_index:22,__enum__:"Attribute",toString:$estr},YellowBack:{_hx_name:"YellowBack",_hx_index:23,__enum__:"Attribute",toString:$estr},BlueBack:{_hx_name:"BlueBack",_hx_index:24,__enum__:"Attribute",toString:$estr},MagentaBack:{_hx_name:"MagentaBack",_hx_index:25,__enum__:"Attribute",toString:$estr},CyanBack:{_hx_name:"CyanBack",_hx_index:26,__enum__:"Attribute",toString:$estr},WhiteBack:{_hx_name:"WhiteBack",_hx_index:27,__enum__:"Attribute",toString:$estr},DefaultBackground:{_hx_name:"DefaultBackground",_hx_index:28,__enum__:"Attribute",toString:$estr}};s.__constructs__=[s.Off,s.Bold,s.Underline,s.Blink,s.ReverseVideo,s.Concealed,s.BoldOff,s.UnderlineOff,s.BlinkOff,s.NormalVideo,s.ConcealedOff,s.Black,s.Red,s.Green,s.Yellow,s.Blue,s.Magenta,s.Cyan,s.White,s.DefaultForeground,s.BlackBack,s.RedBack,s.GreenBack,s.YellowBack,s.BlueBack,s.MagentaBack,s.CyanBack,s.WhiteBack,s.DefaultBackground];var Sys=function(){};t["Sys"]=Sys;Sys.__name__="Sys";Sys.systemName=function(){var e=process.platform;switch(e){case"darwin":return"Mac";case"freebsd":return"BSD";case"linux":return"Linux";case"win32":return"Windows";default:var t=e;return t}};var a=r(2081);var Reflect=function(){};t["Reflect"]=Reflect;Reflect.__name__="Reflect";Reflect.field=function(e,t){try{return e[t]}catch(e){return null}};Reflect.fields=function(e){var t=[];if(e!=null){var r=Object.prototype.hasOwnProperty;for(var n in e){if(n!="__id__"&&n!="hx__closures__"&&r.call(e,n)){t.push(n)}}}return t};Reflect.isFunction=function(e){if(typeof e=="function"){return!(e.__name__||e.__ename__)}else{return false}};Reflect.compare=function(e,t){if(e==t){return 0}else if(e>t){return 1}else{return-1}};Reflect.isEnumValue=function(e){if(e!=null){return e.__enum__!=null}else{return false}};Reflect.deleteField=function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t)){return false}delete e[t];return true};Reflect.copy=function(e){if(e==null){return null}var t={};var r=0;var n=Reflect.fields(e);while(r<n.length){var i=n[r];++r;t[i]=Reflect.field(e,i)}return t};var js_Boot=function(){};t["js.Boot"]=js_Boot;js_Boot.__name__="js.Boot";js_Boot.getClass=function(e){if(e==null){return null}else if(e instanceof Array){return Array}else{var t=e.__class__;if(t!=null){return t}var r=js_Boot.__nativeClassName(e);if(r!=null){return js_Boot.__resolveNativeClass(r)}return null}};js_Boot.__string_rec=function(e,t){if(e==null){return"null"}if(t.length>=5){return"<...>"}var r=typeof e;if(r=="function"&&(e.__name__||e.__ename__)){r="object"}switch(r){case"function":return"<function>";case"object":if(e.__enum__){var i=n[e.__enum__];var s=i.__constructs__[e._hx_index];var a=s._hx_name;if(s.__params__){t=t+"\t";return a+"("+function(r){var n;var i=[];{var a=0;var l=s.__params__;while(true){if(!(a<l.length)){break}var o=l[a];a=a+1;i.push(js_Boot.__string_rec(e[o],t))}}n=i;return n}(this).join(",")+")"}else{return a}}if(e instanceof Array){var l="[";t+="\t";var o=0;var u=e.length;while(o<u){var c=o++;l+=(c>0?",":"")+js_Boot.__string_rec(e[c],t)}l+="]";return l}var h;try{h=e.toString}catch(o){return"???"}if(h!=null&&h!=Object.toString&&typeof h=="function"){var d=e.toString();if(d!="[object Object]"){return d}}var l="{\n";t+="\t";var v=e.hasOwnProperty!=null;var m=null;for(m in e){if(v&&!e.hasOwnProperty(m)){continue}if(m=="prototype"||m=="__class__"||m=="__super__"||m=="__interfaces__"||m=="__properties__"){continue}if(l.length!=2){l+=", \n"}l+=t+m+" : "+js_Boot.__string_rec(e[m],t)}t=t.substring(1);l+="\n"+t+"}";return l;case"string":return e;default:return String(e)}};js_Boot.__interfLoop=function(e,t){if(e==null){return false}if(e==t){return true}var r=e.__interfaces__;if(r!=null){var n=0;var i=r.length;while(n<i){var s=n++;var a=r[s];if(a==t||js_Boot.__interfLoop(a,t)){return true}}}return js_Boot.__interfLoop(e.__super__,t)};js_Boot.__instanceof=function(e,t){if(t==null){return false}switch(t){case Array:return e instanceof Array;case he:return typeof e=="boolean";case ue:return e!=null;case ce:return typeof e=="number";case oe:if(typeof e=="number"){return(e|0)===e}else{return false}break;case String:return typeof e=="string";default:if(e!=null){if(typeof t=="function"){if(js_Boot.__downcastCheck(e,t)){return true}}else if(typeof t=="object"&&js_Boot.__isNativeObj(t)){if(e instanceof t){return true}}}else{return false}if(t==fe?e.__name__!=null:false){return true}if(t==de?e.__ename__!=null:false){return true}return e.__enum__!=null?n[e.__enum__]==t:false}};js_Boot.__downcastCheck=function(e,t){if(!(e instanceof t)){if(t.__isInterface__){return js_Boot.__interfLoop(js_Boot.getClass(e),t)}else{return false}}else{return true}};js_Boot.__nativeClassName=function(e){var t=js_Boot.__toStr.call(e).slice(8,-1);if(t=="Object"||t=="Function"||t=="Math"||t=="JSON"){return null}return t};js_Boot.__isNativeObj=function(e){return js_Boot.__nativeClassName(e)!=null};js_Boot.__resolveNativeClass=function(t){return e[t]};var Std=function(){};t["Std"]=Std;Std.__name__="Std";Std.string=function(e){return js_Boot.__string_rec(e,"")};Std.parseInt=function(e){var t=parseInt(e);if(isNaN(t)){return null}return t};var ANSI=function(){};t["ANSI"]=ANSI;ANSI.__name__="ANSI";ANSI.aset=function(e){if(ANSI.strip||ANSI.stripIfUnavailable&&!ANSI.available){return""}var t=""+"[";var r=[];var n=0;while(n<e.length){var i=e[n];++n;if(!js_Boot.__instanceof(i,s)){throw haxe_Exception.thrown("Set argument is not an Attribute: "+Std.string(i))}r.push(ANSI.values.get(i))}return t+r.join(";")+"m"};ANSI.detectSupport=function(){if(Sys.systemName().toLowerCase().indexOf("window")==-1){var e=-1;try{e=a.spawnSync("tput",["colors"]).error==null?0:125}catch(e){}return e==0}else{return process.env["ANSICON"]!=null}};var DateTools=function(){};t["DateTools"]=DateTools;DateTools.__name__="DateTools";DateTools.__format_get=function(e,t){switch(t){case"%":return"%";case"A":return DateTools.DAY_NAMES[e.getDay()];case"B":return DateTools.MONTH_NAMES[e.getMonth()];case"C":return StringTools.lpad(Std.string(e.getFullYear()/100|0),"0",2);case"D":return DateTools.__format(e,"%m/%d/%y");case"F":return DateTools.__format(e,"%Y-%m-%d");case"M":return StringTools.lpad(Std.string(e.getMinutes()),"0",2);case"R":return DateTools.__format(e,"%H:%M");case"S":return StringTools.lpad(Std.string(e.getSeconds()),"0",2);case"T":return DateTools.__format(e,"%H:%M:%S");case"Y":return Std.string(e.getFullYear());case"a":return DateTools.DAY_SHORT_NAMES[e.getDay()];case"d":return StringTools.lpad(Std.string(e.getDate()),"0",2);case"e":return Std.string(e.getDate());case"b":case"h":return DateTools.MONTH_SHORT_NAMES[e.getMonth()];case"H":case"k":return StringTools.lpad(Std.string(e.getHours()),t=="H"?"0":" ",2);case"I":case"l":var r=e.getHours()%12;return StringTools.lpad(Std.string(r==0?12:r),t=="I"?"0":" ",2);case"m":return StringTools.lpad(Std.string(e.getMonth()+1),"0",2);case"n":return"\n";case"p":if(e.getHours()>11){return"PM"}else{return"AM"}break;case"r":return DateTools.__format(e,"%I:%M:%S %p");case"s":return Std.string(e.getTime()/1e3|0);case"t":return"\t";case"u":var n=e.getDay();if(n==0){return"7"}else if(n==null){return"null"}else{return""+n}break;case"w":return Std.string(e.getDay());case"y":return StringTools.lpad(Std.string(e.getFullYear()%100),"0",2);default:throw new haxe_exceptions_NotImplementedException("Date.format %"+t+"- not implemented yet.",null,{fileName:"DateTools.hx",lineNumber:101,className:"DateTools",methodName:"__format_get"})}};DateTools.__format=function(e,t){var r="";var n=0;while(true){var i=t.indexOf("%",n);if(i<0){break}var s=i-n;r+=s==null?HxOverrides.substr(t,n,null):HxOverrides.substr(t,n,s);r+=Std.string(DateTools.__format_get(e,HxOverrides.substr(t,i+1,1)));n=i+2}var s=t.length-n;r+=s==null?HxOverrides.substr(t,n,null):HxOverrides.substr(t,n,s);return r};DateTools.format=function(e,t){return DateTools.__format(e,t)};var EReg=function(e,t){this.r=new RegExp(e,t.split("u").join(""))};t["EReg"]=EReg;EReg.__name__="EReg";EReg.prototype={match:function(e){if(this.r.global){this.r.lastIndex=0}this.r.m=this.r.exec(e);this.r.s=e;return this.r.m!=null},matched:function(e){if(this.r.m!=null&&e>=0&&e<this.r.m.length){return this.r.m[e]}else{throw haxe_Exception.thrown("EReg::matched")}},matchedLeft:function(){if(this.r.m==null){throw haxe_Exception.thrown("No string matched")}return HxOverrides.substr(this.r.s,0,this.r.m.index)},matchedRight:function(){if(this.r.m==null){throw haxe_Exception.thrown("No string matched")}var e=this.r.m.index+this.r.m[0].length;return HxOverrides.substr(this.r.s,e,this.r.s.length-e)},matchedPos:function(){if(this.r.m==null){throw haxe_Exception.thrown("No string matched")}return{pos:this.r.m.index,len:this.r.m[0].length}},matchSub:function(e,t,r){if(r==null){r=-1}if(this.r.global){this.r.lastIndex=t;this.r.m=this.r.exec(r<0?e:HxOverrides.substr(e,0,t+r));var n=this.r.m!=null;if(n){this.r.s=e}return n}else{var n=this.match(r<0?HxOverrides.substr(e,t,null):HxOverrides.substr(e,t,r));if(n){this.r.s=e;this.r.m.index+=t}return n}},map:function(e,t){var r=0;var n="";do{if(r>=e.length){break}else if(!this.matchSub(e,r)){n+=Std.string(HxOverrides.substr(e,r,null));break}var i=this.matchedPos();n+=Std.string(HxOverrides.substr(e,r,i.pos-r));n+=Std.string(t(this));if(i.len==0){n+=Std.string(HxOverrides.substr(e,i.pos,1));r=i.pos+1}else{r=i.pos+i.len}}while(this.r.global);if(!this.r.global&&r>0&&r<e.length){n+=Std.string(HxOverrides.substr(e,r,null))}return n},__class__:EReg};var HxOverrides=function(){};t["HxOverrides"]=HxOverrides;HxOverrides.__name__="HxOverrides";HxOverrides.dateStr=function(e){var t=e.getMonth()+1;var r=e.getDate();var n=e.getHours();var i=e.getMinutes();var s=e.getSeconds();return e.getFullYear()+"-"+(t<10?"0"+t:""+t)+"-"+(r<10?"0"+r:""+r)+" "+(n<10?"0"+n:""+n)+":"+(i<10?"0"+i:""+i)+":"+(s<10?"0"+s:""+s)};HxOverrides.strDate=function(e){switch(e.length){case 8:var t=e.split(":");var r=new Date;r["setTime"](0);r["setUTCHours"](t[0]);r["setUTCMinutes"](t[1]);r["setUTCSeconds"](t[2]);return r;case 10:var t=e.split("-");return new Date(t[0],t[1]-1,t[2],0,0,0);case 19:var t=e.split(" ");var n=t[0].split("-");var i=t[1].split(":");return new Date(n[0],n[1]-1,n[2],i[0],i[1],i[2]);default:throw haxe_Exception.thrown("Invalid date format : "+e)}};HxOverrides.cca=function(e,t){var r=e.charCodeAt(t);if(r!=r){return undefined}return r};HxOverrides.substr=function(e,t,r){if(r==null){r=e.length}else if(r<0){if(t==0){r=e.length+r}else{return""}}return e.substr(t,r)};HxOverrides.remove=function(e,t){var r=e.indexOf(t);if(r==-1){return false}e.splice(r,1);return true};HxOverrides.now=function(){return Date.now()};var IntIterator=function(e,t){this.min=e;this.max=t};t["IntIterator"]=IntIterator;IntIterator.__name__="IntIterator";IntIterator.prototype={__class__:IntIterator};var Lambda=function(){};t["Lambda"]=Lambda;Lambda.__name__="Lambda";Lambda.has=function(e,t){var r=$getIterator(e);while(r.hasNext()){var n=r.next();if(n==t){return true}}return false};Math.__name__="Math";var StringBuf=function(){this.b=""};t["StringBuf"]=StringBuf;StringBuf.__name__="StringBuf";StringBuf.prototype={__class__:StringBuf};var haxe_SysTools=function(){};t["haxe.SysTools"]=haxe_SysTools;haxe_SysTools.__name__="haxe.SysTools";haxe_SysTools.quoteUnixArg=function(e){if(e==""){return"''"}if(!new EReg("[^a-zA-Z0-9_@%+=:,./-]","").match(e)){return e}return"'"+StringTools.replace(e,"'","'\"'\"'")+"'"};haxe_SysTools.quoteWinArg=function(e,t){if(!new EReg('^(/)?[^ \t/\\\\"]+$',"").match(e)){var r="";var n=e.indexOf(" ")!=-1||e.indexOf("\t")!=-1||e==""||e.indexOf("/")>0;if(n){r+='"'}var i=new StringBuf;var s=0;var a=e.length;while(s<a){var l=s++;var o=HxOverrides.cca(e,l);if(o==null){var u=o;if(i.b.length>0){r+=Std.string(i.b);i=new StringBuf}r+=String.fromCodePoint(u)}else{switch(o){case 34:var c=i.b;r+=c==null?"null":""+c;r+=c==null?"null":""+c;i=new StringBuf;r+='\\"';break;case 92:i.b+="\\";break;default:var h=o;if(i.b.length>0){r+=Std.string(i.b);i=new StringBuf}r+=String.fromCodePoint(h)}}}r+=Std.string(i.b);if(n){r+=Std.string(i.b);r+='"'}e=r}if(t){var r="";var s=0;var a=e.length;while(s<a){var l=s++;var u=HxOverrides.cca(e,l);if(haxe_SysTools.winMetaCharacters.indexOf(u)>=0){r+=String.fromCodePoint(94)}r+=String.fromCodePoint(u)}return r}else{return e}};var StringTools=function(){};t["StringTools"]=StringTools;StringTools.__name__="StringTools";StringTools.startsWith=function(e,t){if(e.length>=t.length){return e.lastIndexOf(t,0)==0}else{return false}};StringTools.endsWith=function(e,t){var r=t.length;var n=e.length;if(n>=r){return e.indexOf(t,n-r)==n-r}else{return false}};StringTools.isSpace=function(e,t){var r=HxOverrides.cca(e,t);if(!(r>8&&r<14)){return r==32}else{return true}};StringTools.ltrim=function(e){var t=e.length;var r=0;while(r<t&&StringTools.isSpace(e,r))++r;if(r>0){return HxOverrides.substr(e,r,t-r)}else{return e}};StringTools.rtrim=function(e){var t=e.length;var r=0;while(r<t&&StringTools.isSpace(e,t-r-1))++r;if(r>0){return HxOverrides.substr(e,0,t-r)}else{return e}};StringTools.trim=function(e){return StringTools.ltrim(StringTools.rtrim(e))};StringTools.lpad=function(e,t,r){if(t.length<=0){return e}var n="";r-=e.length;while(n.length<r)n+=t==null?"null":""+t;n+=e==null?"null":""+e;return n};StringTools.replace=function(e,t,r){return e.split(t).join(r)};var haxe_io_Output=function(){};t["haxe.io.Output"]=haxe_io_Output;haxe_io_Output.__name__="haxe.io.Output";haxe_io_Output.prototype={writeByte:function(e){throw new haxe_exceptions_NotImplementedException(null,null,{fileName:"haxe/io/Output.hx",lineNumber:47,className:"haxe.io.Output",methodName:"writeByte"})},writeBytes:function(e,t,r){if(t<0||r<0||t+r>e.length){throw haxe_Exception.thrown(h.OutsideBounds)}var n=e.b;var i=r;while(i>0){this.writeByte(n[t]);++t;--i}return r},writeFullBytes:function(e,t,r){while(r>0){var n=this.writeBytes(e,t,r);t+=n;r-=n}},writeString:function(e,t){var r=haxe_io_Bytes.ofString(e,t);this.writeFullBytes(r,0,r.length)},__class__:haxe_io_Output};var _$Sys_FileOutput=function(e){this.fd=e};t["_Sys.FileOutput"]=_$Sys_FileOutput;_$Sys_FileOutput.__name__="_Sys.FileOutput";_$Sys_FileOutput.__super__=haxe_io_Output;_$Sys_FileOutput.prototype=$extend(haxe_io_Output.prototype,{writeByte:function(e){g.writeSync(this.fd,String.fromCodePoint(e))},writeBytes:function(e,t,r){var n=e.b;return g.writeSync(this.fd,O.from(n.buffer,n.byteOffset,e.length),t,r)},writeString:function(e,t){g.writeSync(this.fd,e)},__class__:_$Sys_FileOutput});var haxe_io_Input=function(){};t["haxe.io.Input"]=haxe_io_Input;haxe_io_Input.__name__="haxe.io.Input";haxe_io_Input.prototype={readByte:function(){throw new haxe_exceptions_NotImplementedException(null,null,{fileName:"haxe/io/Input.hx",lineNumber:53,className:"haxe.io.Input",methodName:"readByte"})},readBytes:function(e,t,r){var n=r;var i=e.b;if(t<0||r<0||t+r>e.length){throw haxe_Exception.thrown(h.OutsideBounds)}try{while(n>0){i[t]=this.readByte();++t;--n}}catch(e){if(!(haxe_Exception.caught(e).unwrap()instanceof haxe_io_Eof)){throw e}}return r-n},read:function(e){var t=new haxe_io_Bytes(new ArrayBuffer(e));var r=0;while(e>0){var n=this.readBytes(t,r,e);if(n==0){throw haxe_Exception.thrown(h.Blocked)}r+=n;e-=n}return t},__class__:haxe_io_Input};var l=n["ValueType"]={__ename__:"ValueType",__constructs__:null,TNull:{_hx_name:"TNull",_hx_index:0,__enum__:"ValueType",toString:$estr},TInt:{_hx_name:"TInt",_hx_index:1,__enum__:"ValueType",toString:$estr},TFloat:{_hx_name:"TFloat",_hx_index:2,__enum__:"ValueType",toString:$estr},TBool:{_hx_name:"TBool",_hx_index:3,__enum__:"ValueType",toString:$estr},TObject:{_hx_name:"TObject",_hx_index:4,__enum__:"ValueType",toString:$estr},TFunction:{_hx_name:"TFunction",_hx_index:5,__enum__:"ValueType",toString:$estr},TClass:(i=function(e){return{_hx_index:6,c:e,__enum__:"ValueType",toString:$estr}},i._hx_name="TClass",i.__params__=["c"],i),TEnum:(i=function(e){return{_hx_index:7,e:e,__enum__:"ValueType",toString:$estr}},i._hx_name="TEnum",i.__params__=["e"],i),TUnknown:{_hx_name:"TUnknown",_hx_index:8,__enum__:"ValueType",toString:$estr}};l.__constructs__=[l.TNull,l.TInt,l.TFloat,l.TBool,l.TObject,l.TFunction,l.TClass,l.TEnum,l.TUnknown];var Type=function(){};t["Type"]=Type;Type.__name__="Type";Type.createEnum=function(e,t,r){var n=Reflect.field(e,t);if(n==null){throw haxe_Exception.thrown("No such constructor "+t)}if(Reflect.isFunction(n)){if(r==null){throw haxe_Exception.thrown("Constructor "+t+" need parameters")}return n.apply(e,r)}if(r!=null&&r.length!=0){throw haxe_Exception.thrown("Constructor "+t+" does not need parameters")}return n};Type.typeof=function(e){switch(typeof e){case"boolean":return l.TBool;case"function":if(e.__name__||e.__ename__){return l.TObject}return l.TFunction;case"number":if(Math.ceil(e)==e%2147483648){return l.TInt}return l.TFloat;case"object":if(e==null){return l.TNull}var t=e.__enum__;if(t!=null){return l.TEnum(n[t])}var r=js_Boot.getClass(e);if(r!=null){return l.TClass(r)}return l.TObject;case"string":return l.TClass(String);case"undefined":return l.TNull;default:return l.TUnknown}};Type.enumParameters=function(e){var t=n[e.__enum__];var r=t.__constructs__[e._hx_index].__params__;if(r!=null){var i=[];var s=0;while(s<r.length){var a=r[s];++s;i.push(e[a])}return i}else{return[]}};var o=n["haxe.StackItem"]={__ename__:"haxe.StackItem",__constructs__:null,CFunction:{_hx_name:"CFunction",_hx_index:0,__enum__:"haxe.StackItem",toString:$estr},Module:(i=function(e){return{_hx_index:1,m:e,__enum__:"haxe.StackItem",toString:$estr}},i._hx_name="Module",i.__params__=["m"],i),FilePos:(i=function(e,t,r,n){return{_hx_index:2,s:e,file:t,line:r,column:n,__enum__:"haxe.StackItem",toString:$estr}},i._hx_name="FilePos",i.__params__=["s","file","line","column"],i),Method:(i=function(e,t){return{_hx_index:3,classname:e,method:t,__enum__:"haxe.StackItem",toString:$estr}},i._hx_name="Method",i.__params__=["classname","method"],i),LocalFunction:(i=function(e){return{_hx_index:4,v:e,__enum__:"haxe.StackItem",toString:$estr}},i._hx_name="LocalFunction",i.__params__=["v"],i)};o.__constructs__=[o.CFunction,o.Module,o.FilePos,o.Method,o.LocalFunction];var haxe_IMap=function(){};t["haxe.IMap"]=haxe_IMap;haxe_IMap.__name__="haxe.IMap";haxe_IMap.__isInterface__=true;var haxe_Exception=function(e,t,r){Error.call(this,e);this.message=e;this.__previousException=t;this.__nativeException=r!=null?r:this};t["haxe.Exception"]=haxe_Exception;haxe_Exception.__name__="haxe.Exception";haxe_Exception.caught=function(e){if(e instanceof haxe_Exception){return e}else if(e instanceof Error){return new haxe_Exception(e.message,null,e)}else{return new haxe_ValueException(e,null,e)}};haxe_Exception.thrown=function(e){if(e instanceof haxe_Exception){return e.get_native()}else if(e instanceof Error){return e}else{var t=new haxe_ValueException(e);return t}};haxe_Exception.__super__=Error;haxe_Exception.prototype=$extend(Error.prototype,{unwrap:function(){return this.__nativeException},toString:function(){return this.get_message()},get_message:function(){return this.message},get_native:function(){return this.__nativeException},__class__:haxe_Exception});var haxe_Http=function(e){this.params=[];this.headers={};this.url=G.fromString(e)};t["haxe.Http"]=haxe_Http;haxe_Http.__name__="haxe.Http";haxe_Http.prototype={setHeader:function(e,t){var r=this.headers[e];if(r==null){this.headers[e]=[t]}else{var n=r;n.push(t)}return this},setParameter:function(e,t){this.params.push(se.ofString(e)+"="+se.ofString(t));return this},onData:function(e){},onError:function(e){},request:function(e){var t=this;if(this.rawPostData!=null){e=true}if(e==null){e=false}var r=this.params.join("&");var n=this.url.scheme;var i=ne.get_name(this.url.host);var s=ne.get_port(this.url.host);var a=this.url;var l;if(r==""){l=""}else if(e==null){var o=r;l=(this.url.query==null?"?":"&")+o}else if(e==true){l=""}else{var o=r;l=(this.url.query==null?"?":"&")+o}var u=this.rawPostData;var c;if(u==null){c=e?r:null}else{var o=u;c=o}(n==null?S.request:n=="https"?E.request:S.request)({hostname:i,port:s,protocol:this.url.scheme+":",method:e?"POST":"GET",path:(a.query==null?a.path:(a.path==null?"null":a.path)+"?"+(a.query==null?"null":a.query))+l,headers:this.headers},(function(e){var r=[];e.on("end",(function(){var e=StringTools.replace(O.concat(r).toString(),"%F6","%6f");t.onData(e)}));e.on("data",$bind(r,$arrayPush));e.on("error",(function(e){t.onError(Std.string(e))}))})).on("error",(function(e){t.onError(Std.string(e))})).end(c)},__class__:haxe_Http};var haxe_Serializer=function(){this.buf=new StringBuf;this.cache=[];this.useCache=haxe_Serializer.USE_CACHE;this.useEnumIndex=haxe_Serializer.USE_ENUM_INDEX;this.shash=new haxe_ds_StringMap;this.scount=0};t["haxe.Serializer"]=haxe_Serializer;haxe_Serializer.__name__="haxe.Serializer";haxe_Serializer.prototype={toString:function(){return this.buf.b},serializeString:function(e){var t=this.shash.h[e];if(t!=null){this.buf.b+="R";this.buf.b+=t==null?"null":""+t;return}this.shash.h[e]=this.scount++;this.buf.b+="y";e=encodeURIComponent(e);this.buf.b+=Std.string(e.length);this.buf.b+=":";this.buf.b+=e==null?"null":""+e},serializeRef:function(e){var t=typeof e;var r=0;var n=this.cache.length;while(r<n){var i=r++;var s=this.cache[i];if(typeof s==t&&s==e){this.buf.b+="r";this.buf.b+=i==null?"null":""+i;return true}}this.cache.push(e);return false},serializeFields:function(e){var t=0;var r=Reflect.fields(e);while(t<r.length){var n=r[t];++t;this.serializeString(n);this.serialize(Reflect.field(e,n))}this.buf.b+="g"},serialize:function(e){var t=Type.typeof(e);switch(t._hx_index){case 0:this.buf.b+="n";break;case 1:var r=e;if(r==0){this.buf.b+="z";return}this.buf.b+="i";this.buf.b+=r==null?"null":""+r;break;case 2:var r=e;if(isNaN(r)){this.buf.b+="k"}else if(!isFinite(r)){this.buf.b+=r<0?"m":"p"}else{this.buf.b+="d";this.buf.b+=r==null?"null":""+r}break;case 3:this.buf.b+=e?"t":"f";break;case 4:if(js_Boot.__instanceof(e,fe)){var i=e.__name__;this.buf.b+="A";this.serializeString(i)}else if(js_Boot.__instanceof(e,de)){this.buf.b+="B";this.serializeString(e.__ename__)}else{if(this.useCache&&this.serializeRef(e)){return}this.buf.b+="o";this.serializeFields(e)}break;case 5:throw haxe_Exception.thrown("Cannot serialize function");case 6:var s=t.c;if(s==String){this.serializeString(e);return}if(this.useCache&&this.serializeRef(e)){return}switch(s){case Array:var a=0;this.buf.b+="a";var l=e["length"];var o=0;var u=l;while(o<u){var c=o++;if(e[c]==null){++a}else{if(a>0){if(a==1){this.buf.b+="n"}else{this.buf.b+="u";this.buf.b+=a==null?"null":""+a}a=0}this.serialize(e[c])}}if(a>0){if(a==1){this.buf.b+="n"}else{this.buf.b+="u";this.buf.b+=a==null?"null":""+a}}this.buf.b+="h";break;case Date:var h=e;this.buf.b+="v";this.buf.b+=Std.string(h.getTime());break;case haxe_ds_IntMap:this.buf.b+="q";var r=e;var d=r.keys();while(d.hasNext()){var v=d.next();this.buf.b+=":";this.buf.b+=v==null?"null":""+v;this.serialize(r.h[v])}this.buf.b+="h";break;case haxe_ds_List:this.buf.b+="l";var r=e;var m=r.h;while(m!=null){var p=m.item;m=m.next;var c=p;this.serialize(c)}this.buf.b+="h";break;case haxe_ds_ObjectMap:this.buf.b+="M";var r=e;var d=r.keys();while(d.hasNext()){var v=d.next();var _=Reflect.field(v,"__id__");Reflect.deleteField(v,"__id__");this.serialize(v);v["__id__"]=_;this.serialize(r.h[v.__id__])}this.buf.b+="h";break;case haxe_ds_StringMap:this.buf.b+="b";var r=e;var g=r.h;var w=g;var x=Object.keys(g);var b=x.length;var y=0;while(y<b){var d=x[y++];this.serializeString(d);this.serialize(r.h[d])}this.buf.b+="h";break;case haxe_io_Bytes:var r=e;this.buf.b+="s";this.buf.b+=Std.string(Math.ceil(r.length*8/6));this.buf.b+=":";var c=0;var S=r.length-2;var E=haxe_Serializer.BASE64_CODES;if(E==null){E=new Array(haxe_Serializer.BASE64.length);var o=0;var u=haxe_Serializer.BASE64.length;while(o<u){var N=o++;E[N]=HxOverrides.cca(haxe_Serializer.BASE64,N)}haxe_Serializer.BASE64_CODES=E}while(c<S){var k=r.b[c++];var O=r.b[c++];var R=r.b[c++];this.buf.b+=String.fromCodePoint(E[k>>2]);this.buf.b+=String.fromCodePoint(E[(k<<4|O>>4)&63]);this.buf.b+=String.fromCodePoint(E[(O<<2|R>>6)&63]);this.buf.b+=String.fromCodePoint(E[R&63])}if(c==S){var k=r.b[c++];var O=r.b[c++];this.buf.b+=String.fromCodePoint(E[k>>2]);this.buf.b+=String.fromCodePoint(E[(k<<4|O>>4)&63]);this.buf.b+=String.fromCodePoint(E[O<<2&63])}else if(c==S+1){var k=r.b[c++];this.buf.b+=String.fromCodePoint(E[k>>2]);this.buf.b+=String.fromCodePoint(E[k<<4&63])}break;default:if(this.useCache){this.cache.pop()}if(e.hxSerialize!=null){this.buf.b+="C";this.serializeString(s.__name__);if(this.useCache){this.cache.push(e)}e.hxSerialize(this);this.buf.b+="g"}else{this.buf.b+="c";this.serializeString(s.__name__);if(this.useCache){this.cache.push(e)}this.serializeFields(e)}}break;case 7:var C=t.e;if(this.useCache){if(this.serializeRef(e)){return}this.cache.pop()}this.buf.b+=Std.string(this.useEnumIndex?"j":"w");this.serializeString(C.__ename__);if(this.useEnumIndex){this.buf.b+=":";this.buf.b+=Std.string(e._hx_index)}else{var C=e;this.serializeString(n[C.__enum__].__constructs__[C._hx_index]._hx_name)}this.buf.b+=":";var A=Type.enumParameters(e);this.buf.b+=Std.string(A.length);var t=0;while(t<A.length){var I=A[t];++t;this.serialize(I)}if(this.useCache){this.cache.push(e)}break;default:throw haxe_Exception.thrown("Cannot serialize "+Std.string(e))}},__class__:haxe_Serializer};var haxe_Timer=function(e){var t=this;this.id=setInterval((function(){t.run()}),e)};t["haxe.Timer"]=haxe_Timer;haxe_Timer.__name__="haxe.Timer";haxe_Timer.delay=function(e,t){var r=new haxe_Timer(t);r.run=function(){r.stop();e()};return r};haxe_Timer.prototype={stop:function(){if(this.id==null){return}clearInterval(this.id);this.id=null},run:function(){},__class__:haxe_Timer};var haxe__$Unserializer_DefaultResolver=function(){};t["haxe._Unserializer.DefaultResolver"]=haxe__$Unserializer_DefaultResolver;haxe__$Unserializer_DefaultResolver.__name__="haxe._Unserializer.DefaultResolver";haxe__$Unserializer_DefaultResolver.prototype={resolveClass:function(e){return t[e]},resolveEnum:function(e){return n[e]},__class__:haxe__$Unserializer_DefaultResolver};var haxe_Unserializer=function(e){this.buf=e;this.length=this.buf.length;this.pos=0;this.scache=[];this.cache=[];var t=haxe_Unserializer.DEFAULT_RESOLVER;if(t==null){t=new haxe__$Unserializer_DefaultResolver;haxe_Unserializer.DEFAULT_RESOLVER=t}this.resolver=t};t["haxe.Unserializer"]=haxe_Unserializer;haxe_Unserializer.__name__="haxe.Unserializer";haxe_Unserializer.initCodes=function(){var e=[];var t=0;var r=haxe_Unserializer.BASE64.length;while(t<r){var n=t++;e[haxe_Unserializer.BASE64.charCodeAt(n)]=n}return e};haxe_Unserializer.prototype={readDigits:function(){var e=0;var t=false;var r=this.pos;while(true){var n=this.buf.charCodeAt(this.pos);if(n!=n){break}if(n==45){if(this.pos!=r){break}t=true;this.pos++;continue}if(n<48||n>57){break}e=e*10+(n-48);this.pos++}if(t){e*=-1}return e},readFloat:function(){var e=this.pos;while(true){var t=this.buf.charCodeAt(this.pos);if(t!=t){break}if(t>=43&&t<58||t==101||t==69){this.pos++}else{break}}return parseFloat(HxOverrides.substr(this.buf,e,this.pos-e))},unserializeObject:function(e){while(true){if(this.pos>=this.length){throw haxe_Exception.thrown("Invalid object")}if(this.buf.charCodeAt(this.pos)==103){break}var t=this.unserialize();if(typeof t!="string"){throw haxe_Exception.thrown("Invalid object key")}var r=this.unserialize();e[t]=r}this.pos++},unserializeEnum:function(e,t){if(this.buf.charCodeAt(this.pos++)!=58){throw haxe_Exception.thrown("Invalid enum format")}var r=this.readDigits();if(r==0){return Type.createEnum(e,t)}var n=[];while(r-- >0)n.push(this.unserialize());return Type.createEnum(e,t,n)},unserialize:function(){switch(this.buf.charCodeAt(this.pos++)){case 65:var e=this.unserialize();var t=this.resolver.resolveClass(e);if(t==null){throw haxe_Exception.thrown("Class not found "+e)}return t;case 66:var e=this.unserialize();var r=this.resolver.resolveEnum(e);if(r==null){throw haxe_Exception.thrown("Enum not found "+e)}return r;case 67:var e=this.unserialize();var t=this.resolver.resolveClass(e);if(t==null){throw haxe_Exception.thrown("Class not found "+e)}var n=Object.create(t.prototype);this.cache.push(n);n.hxUnserialize(this);if(this.buf.charCodeAt(this.pos++)!=103){throw haxe_Exception.thrown("Invalid custom data")}return n;case 77:var i=new haxe_ds_ObjectMap;this.cache.push(i);var s=this.buf;while(this.buf.charCodeAt(this.pos)!=104){var a=this.unserialize();i.set(a,this.unserialize())}this.pos++;return i;case 82:var l=this.readDigits();if(l<0||l>=this.scache.length){throw haxe_Exception.thrown("Invalid string reference")}return this.scache[l];case 97:var s=this.buf;var o=[];this.cache.push(o);while(true){var u=this.buf.charCodeAt(this.pos);if(u==104){this.pos++;break}if(u==117){this.pos++;var l=this.readDigits();o[o.length+l-1]=null}else{o.push(this.unserialize())}}return o;case 98:var i=new haxe_ds_StringMap;this.cache.push(i);var s=this.buf;while(this.buf.charCodeAt(this.pos)!=104){var a=this.unserialize();var c=this.unserialize();i.h[a]=c}this.pos++;return i;case 99:var e=this.unserialize();var t=this.resolver.resolveClass(e);if(t==null){throw haxe_Exception.thrown("Class not found "+e)}var n=Object.create(t.prototype);this.cache.push(n);this.unserializeObject(n);return n;case 100:return this.readFloat();case 102:return false;case 105:return this.readDigits();case 106:var e=this.unserialize();var h=this.resolver.resolveEnum(e);if(h==null){throw haxe_Exception.thrown("Enum not found "+e)}this.pos++;var d=this.readDigits();var v=h.__constructs__;var m=new Array(v.length);var p=0;var _=v.length;while(p<_){var g=p++;m[g]=v[g]._hx_name}var w=m[d];if(w==null){throw haxe_Exception.thrown("Unknown enum index "+e+"@"+d)}var r=this.unserializeEnum(h,w);this.cache.push(r);return r;case 107:return NaN;case 108:var x=new haxe_ds_List;this.cache.push(x);var s=this.buf;while(this.buf.charCodeAt(this.pos)!=104)x.add(this.unserialize());this.pos++;return x;case 109:return-Infinity;case 110:return null;case 111:var n={};this.cache.push(n);this.unserializeObject(n);return n;case 112:return Infinity;case 113:var i=new haxe_ds_IntMap;this.cache.push(i);var s=this.buf;var u=this.buf.charCodeAt(this.pos++);while(u==58){var g=this.readDigits();var c=this.unserialize();i.h[g]=c;u=this.buf.charCodeAt(this.pos++)}if(u!=104){throw haxe_Exception.thrown("Invalid IntMap format")}return i;case 114:var l=this.readDigits();if(l<0||l>=this.cache.length){throw haxe_Exception.thrown("Invalid reference")}return this.cache[l];case 115:var b=this.readDigits();var s=this.buf;if(this.buf.charCodeAt(this.pos++)!=58||this.length-this.pos<b){throw haxe_Exception.thrown("Invalid bytes length")}var y=haxe_Unserializer.CODES;if(y==null){y=haxe_Unserializer.initCodes();haxe_Unserializer.CODES=y}var g=this.pos;var S=b&3;var E=(b>>2)*3+(S>=2?S-1:0);var N=g+(b-S);var k=new haxe_io_Bytes(new ArrayBuffer(E));var O=0;while(g<N){var R=y[s.charCodeAt(g++)];var C=y[s.charCodeAt(g++)];k.b[O++]=R<<2|C>>4;var A=y[s.charCodeAt(g++)];k.b[O++]=C<<4|A>>2;var I=y[s.charCodeAt(g++)];k.b[O++]=A<<6|I}if(S>=2){var R=y[s.charCodeAt(g++)];var C=y[s.charCodeAt(g++)];k.b[O++]=R<<2|C>>4;if(S==3){var A=y[s.charCodeAt(g++)];k.b[O++]=C<<4|A>>2}}this.pos+=b;this.cache.push(k);return k;case 116:return true;case 118:var F;if(this.buf.charCodeAt(this.pos)>=48&&this.buf.charCodeAt(this.pos)<=57&&this.buf.charCodeAt(this.pos+1)>=48&&this.buf.charCodeAt(this.pos+1)<=57&&this.buf.charCodeAt(this.pos+2)>=48&&this.buf.charCodeAt(this.pos+2)<=57&&this.buf.charCodeAt(this.pos+3)>=48&&this.buf.charCodeAt(this.pos+3)<=57&&this.buf.charCodeAt(this.pos+4)==45){F=HxOverrides.strDate(HxOverrides.substr(this.buf,this.pos,19));this.pos+=19}else{F=new Date(this.readFloat())}this.cache.push(F);return F;case 119:var e=this.unserialize();var h=this.resolver.resolveEnum(e);if(h==null){throw haxe_Exception.thrown("Enum not found "+e)}var r=this.unserializeEnum(h,this.unserialize());this.cache.push(r);return r;case 120:throw haxe_Exception.thrown(this.unserialize());case 121:var b=this.readDigits();if(this.buf.charCodeAt(this.pos++)!=58||this.length-this.pos<b){throw haxe_Exception.thrown("Invalid string length")}var a=HxOverrides.substr(this.buf,this.pos,b);this.pos+=b;a=decodeURIComponent(a.split("+").join(" "));this.scache.push(a);return a;case 122:return 0;default:}this.pos--;throw haxe_Exception.thrown("Invalid char "+this.buf.charAt(this.pos)+" at position "+this.pos)},__class__:haxe_Unserializer};var haxe_ValueException=function(e,t,r){haxe_Exception.call(this,String(e),t,r);this.value=e};t["haxe.ValueException"]=haxe_ValueException;haxe_ValueException.__name__="haxe.ValueException";haxe_ValueException.__super__=haxe_Exception;haxe_ValueException.prototype=$extend(haxe_Exception.prototype,{unwrap:function(){return this.value},__class__:haxe_ValueException});var haxe_ds_BalancedTree=function(){};t["haxe.ds.BalancedTree"]=haxe_ds_BalancedTree;haxe_ds_BalancedTree.__name__="haxe.ds.BalancedTree";haxe_ds_BalancedTree.__interfaces__=[haxe_IMap];haxe_ds_BalancedTree.prototype={set:function(e,t){this.root=this.setLoop(e,t,this.root)},get:function(e){var t=this.root;while(t!=null){var r=this.compare(e,t.key);if(r==0){return t.value}if(r<0){t=t.left}else{t=t.right}}return null},setLoop:function(e,t,r){if(r==null){return new haxe_ds_TreeNode(null,e,t,null)}var n=this.compare(e,r.key);if(n==0){return new haxe_ds_TreeNode(r.left,e,t,r.right,r==null?0:r._height)}else if(n<0){var i=this.setLoop(e,t,r.left);return this.balance(i,r.key,r.value,r.right)}else{var s=this.setLoop(e,t,r.right);return this.balance(r.left,r.key,r.value,s)}},balance:function(e,t,r,n){var i=e==null?0:e._height;var s=n==null?0:n._height;if(i>s+2){var a=e.left;var l=e.right;if((a==null?0:a._height)>=(l==null?0:l._height)){return new haxe_ds_TreeNode(e.left,e.key,e.value,new haxe_ds_TreeNode(e.right,t,r,n))}else{return new haxe_ds_TreeNode(new haxe_ds_TreeNode(e.left,e.key,e.value,e.right.left),e.right.key,e.right.value,new haxe_ds_TreeNode(e.right.right,t,r,n))}}else if(s>i+2){var a=n.right;var l=n.left;if((a==null?0:a._height)>(l==null?0:l._height)){return new haxe_ds_TreeNode(new haxe_ds_TreeNode(e,t,r,n.left),n.key,n.value,n.right)}else{return new haxe_ds_TreeNode(new haxe_ds_TreeNode(e,t,r,n.left.left),n.left.key,n.left.value,new haxe_ds_TreeNode(n.left.right,n.key,n.value,n.right))}}else{return new haxe_ds_TreeNode(e,t,r,n,(i>s?i:s)+1)}},compare:function(e,t){return Reflect.compare(e,t)},__class__:haxe_ds_BalancedTree};var haxe_ds_TreeNode=function(e,t,r,n,i){if(i==null){i=-1}this.left=e;this.key=t;this.value=r;this.right=n;if(i==-1){var s;var a=this.left;var l=this.right;if((a==null?0:a._height)>(l==null?0:l._height)){var a=this.left;s=a==null?0:a._height}else{var a=this.right;s=a==null?0:a._height}this._height=s+1}else{this._height=i}};t["haxe.ds.TreeNode"]=haxe_ds_TreeNode;haxe_ds_TreeNode.__name__="haxe.ds.TreeNode";haxe_ds_TreeNode.prototype={__class__:haxe_ds_TreeNode};var haxe_ds_EnumValueMap=function(){haxe_ds_BalancedTree.call(this)};t["haxe.ds.EnumValueMap"]=haxe_ds_EnumValueMap;haxe_ds_EnumValueMap.__name__="haxe.ds.EnumValueMap";haxe_ds_EnumValueMap.__interfaces__=[haxe_IMap];haxe_ds_EnumValueMap.__super__=haxe_ds_BalancedTree;haxe_ds_EnumValueMap.prototype=$extend(haxe_ds_BalancedTree.prototype,{compare:function(e,t){var r=e._hx_index-t._hx_index;if(r!=0){return r}var n=Type.enumParameters(e);var i=Type.enumParameters(t);if(n.length==0&&i.length==0){return 0}return this.compareArgs(n,i)},compareArgs:function(e,t){var r=e.length-t.length;if(r!=0){return r}var n=0;var i=e.length;while(n<i){var s=n++;var a=this.compareArg(e[s],t[s]);if(a!=0){return a}}return 0},compareArg:function(e,t){if(Reflect.isEnumValue(e)&&Reflect.isEnumValue(t)){return this.compare(e,t)}else if(e instanceof Array&&t instanceof Array){return this.compareArgs(e,t)}else{return Reflect.compare(e,t)}},__class__:haxe_ds_EnumValueMap});var haxe_ds_IntMap=function(){this.h={}};t["haxe.ds.IntMap"]=haxe_ds_IntMap;haxe_ds_IntMap.__name__="haxe.ds.IntMap";haxe_ds_IntMap.__interfaces__=[haxe_IMap];haxe_ds_IntMap.prototype={keys:function(){var e=[];for(var t in this.h)if(this.h.hasOwnProperty(t))e.push(+t);return new haxe_iterators_ArrayIterator(e)},__class__:haxe_ds_IntMap};var haxe_ds_List=function(){this.length=0};t["haxe.ds.List"]=haxe_ds_List;haxe_ds_List.__name__="haxe.ds.List";haxe_ds_List.prototype={add:function(e){var t=new haxe_ds__$List_ListNode(e,null);if(this.h==null){this.h=t}else{this.q.next=t}this.q=t;this.length++},iterator:function(){return new haxe_ds__$List_ListIterator(this.h)},__class__:haxe_ds_List};var haxe_ds__$List_ListNode=function(e,t){this.item=e;this.next=t};t["haxe.ds._List.ListNode"]=haxe_ds__$List_ListNode;haxe_ds__$List_ListNode.__name__="haxe.ds._List.ListNode";haxe_ds__$List_ListNode.prototype={__class__:haxe_ds__$List_ListNode};var haxe_ds__$List_ListIterator=function(e){this.head=e};t["haxe.ds._List.ListIterator"]=haxe_ds__$List_ListIterator;haxe_ds__$List_ListIterator.__name__="haxe.ds._List.ListIterator";haxe_ds__$List_ListIterator.prototype={hasNext:function(){return this.head!=null},next:function(){var e=this.head.item;this.head=this.head.next;return e},__class__:haxe_ds__$List_ListIterator};var haxe_ds_ObjectMap=function(){this.h={__keys__:{}}};t["haxe.ds.ObjectMap"]=haxe_ds_ObjectMap;haxe_ds_ObjectMap.__name__="haxe.ds.ObjectMap";haxe_ds_ObjectMap.__interfaces__=[haxe_IMap];haxe_ds_ObjectMap.prototype={set:function(t,r){var n=t.__id__;if(n==null){n=t.__id__=e.$haxeUID++}this.h[n]=r;this.h.__keys__[n]=t},keys:function(){var e=[];for(var t in this.h.__keys__){if(this.h.hasOwnProperty(t)){e.push(this.h.__keys__[t])}}return new haxe_iterators_ArrayIterator(e)},__class__:haxe_ds_ObjectMap};var u=n["haxe.ds.Option"]={__ename__:"haxe.ds.Option",__constructs__:null,Some:(i=function(e){return{_hx_index:0,v:e,__enum__:"haxe.ds.Option",toString:$estr}},i._hx_name="Some",i.__params__=["v"],i),None:{_hx_name:"None",_hx_index:1,__enum__:"haxe.ds.Option",toString:$estr}};u.__constructs__=[u.Some,u.None];var haxe_ds_StringMap=function(){this.h=Object.create(null)};t["haxe.ds.StringMap"]=haxe_ds_StringMap;haxe_ds_StringMap.__name__="haxe.ds.StringMap";haxe_ds_StringMap.__interfaces__=[haxe_IMap];haxe_ds_StringMap.prototype={__class__:haxe_ds_StringMap};var haxe_ds__$StringMap_StringMapKeyValueIterator=function(e){this.h=e;this.keys=Object.keys(e);this.length=this.keys.length;this.current=0};t["haxe.ds._StringMap.StringMapKeyValueIterator"]=haxe_ds__$StringMap_StringMapKeyValueIterator;haxe_ds__$StringMap_StringMapKeyValueIterator.__name__="haxe.ds._StringMap.StringMapKeyValueIterator";haxe_ds__$StringMap_StringMapKeyValueIterator.prototype={hasNext:function(){return this.current<this.length},next:function(){var e=this.keys[this.current++];return{key:e,value:this.h[e]}},__class__:haxe_ds__$StringMap_StringMapKeyValueIterator};var haxe_exceptions_PosException=function(e,t,r){haxe_Exception.call(this,e,t);if(r==null){this.posInfos={fileName:"(unknown)",lineNumber:0,className:"(unknown)",methodName:"(unknown)"}}else{this.posInfos=r}};t["haxe.exceptions.PosException"]=haxe_exceptions_PosException;haxe_exceptions_PosException.__name__="haxe.exceptions.PosException";haxe_exceptions_PosException.__super__=haxe_Exception;haxe_exceptions_PosException.prototype=$extend(haxe_Exception.prototype,{toString:function(){return""+haxe_Exception.prototype.toString.call(this)+" in "+this.posInfos.className+"."+this.posInfos.methodName+" at "+this.posInfos.fileName+":"+this.posInfos.lineNumber},__class__:haxe_exceptions_PosException});var haxe_exceptions_NotImplementedException=function(e,t,r){if(e==null){e="Not implemented"}haxe_exceptions_PosException.call(this,e,t,r)};t["haxe.exceptions.NotImplementedException"]=haxe_exceptions_NotImplementedException;haxe_exceptions_NotImplementedException.__name__="haxe.exceptions.NotImplementedException";haxe_exceptions_NotImplementedException.__super__=haxe_exceptions_PosException;haxe_exceptions_NotImplementedException.prototype=$extend(haxe_exceptions_PosException.prototype,{__class__:haxe_exceptions_NotImplementedException});var haxe_io_Bytes=function(e){this.length=e.byteLength;this.b=new Uint8Array(e);this.b.bufferValue=e;e.hxBytes=this;e.bytes=this.b};t["haxe.io.Bytes"]=haxe_io_Bytes;haxe_io_Bytes.__name__="haxe.io.Bytes";haxe_io_Bytes.ofString=function(e,t){if(t==c.RawNative){var r=new Uint8Array(e.length<<1);var n=0;var i=e.length;while(n<i){var s=n++;var a=e.charCodeAt(s);r[s<<1]=a&255;r[s<<1|1]=a>>8}return new haxe_io_Bytes(r.buffer)}var l=[];var s=0;while(s<e.length){var a=e.charCodeAt(s++);if(55296<=a&&a<=56319){a=a-55232<<10|e.charCodeAt(s++)&1023}if(a<=127){l.push(a)}else if(a<=2047){l.push(192|a>>6);l.push(128|a&63)}else if(a<=65535){l.push(224|a>>12);l.push(128|a>>6&63);l.push(128|a&63)}else{l.push(240|a>>18);l.push(128|a>>12&63);l.push(128|a>>6&63);l.push(128|a&63)}}return new haxe_io_Bytes(new Uint8Array(l).buffer)};haxe_io_Bytes.prototype={sub:function(e,t){if(e<0||t<0||e+t>this.length){throw haxe_Exception.thrown(h.OutsideBounds)}return new haxe_io_Bytes(this.b.buffer.slice(e+this.b.byteOffset,e+this.b.byteOffset+t))},getInt32:function(e){if(this.data==null){this.data=new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength)}return this.data.getInt32(e,true)},getString:function(e,t,r){if(e<0||t<0||e+t>this.length){throw haxe_Exception.thrown(h.OutsideBounds)}if(r==null){r=c.UTF8}var n="";var i=this.b;var s=e;var a=e+t;switch(r._hx_index){case 0:var l=e>0;while(s<a){var o=i[s++];if(o<128){if(o==0){break}n+=String.fromCodePoint(o)}else if(o<224){var u=(o&63)<<6|i[s++]&127;n+=String.fromCodePoint(u)}else if(o<240){var d=i[s++];var v=(o&31)<<12|(d&127)<<6|i[s++]&127;n+=String.fromCodePoint(v)}else{var m=i[s++];var p=i[s++];var _=(o&15)<<18|(m&127)<<12|(p&127)<<6|i[s++]&127;n+=String.fromCodePoint(_)}}break;case 1:while(s<a){var o=i[s++]|i[s++]<<8;n+=String.fromCodePoint(o)}break}return n},toString:function(){return this.getString(0,this.length)},__class__:haxe_io_Bytes};var c=n["haxe.io.Encoding"]={__ename__:"haxe.io.Encoding",__constructs__:null,UTF8:{_hx_name:"UTF8",_hx_index:0,__enum__:"haxe.io.Encoding",toString:$estr},RawNative:{_hx_name:"RawNative",_hx_index:1,__enum__:"haxe.io.Encoding",toString:$estr}};c.__constructs__=[c.UTF8,c.RawNative];var haxe_io_Eof=function(){};t["haxe.io.Eof"]=haxe_io_Eof;haxe_io_Eof.__name__="haxe.io.Eof";haxe_io_Eof.prototype={toString:function(){return"Eof"},__class__:haxe_io_Eof};var h=n["haxe.io.Error"]={__ename__:"haxe.io.Error",__constructs__:null,Blocked:{_hx_name:"Blocked",_hx_index:0,__enum__:"haxe.io.Error",toString:$estr},Overflow:{_hx_name:"Overflow",_hx_index:1,__enum__:"haxe.io.Error",toString:$estr},OutsideBounds:{_hx_name:"OutsideBounds",_hx_index:2,__enum__:"haxe.io.Error",toString:$estr},Custom:(i=function(e){return{_hx_index:3,e:e,__enum__:"haxe.io.Error",toString:$estr}},i._hx_name="Custom",i.__params__=["e"],i)};h.__constructs__=[h.Blocked,h.Overflow,h.OutsideBounds,h.Custom];var haxe_io_Path=function(e){switch(e){case".":case"..":this.dir=e;this.file="";return}var t=e.lastIndexOf("/");var r=e.lastIndexOf("\\");if(t<r){this.dir=HxOverrides.substr(e,0,r);e=HxOverrides.substr(e,r+1,null);this.backslash=true}else if(r<t){this.dir=HxOverrides.substr(e,0,t);e=HxOverrides.substr(e,t+1,null)}else{this.dir=null}var n=e.lastIndexOf(".");if(n!=-1){this.ext=HxOverrides.substr(e,n+1,null);this.file=HxOverrides.substr(e,0,n)}else{this.ext=null;this.file=e}};t["haxe.io.Path"]=haxe_io_Path;haxe_io_Path.__name__="haxe.io.Path";haxe_io_Path.withoutExtension=function(e){var t=new haxe_io_Path(e);t.ext=null;return t.toString()};haxe_io_Path.withoutDirectory=function(e){var t=new haxe_io_Path(e);t.dir=null;return t.toString()};haxe_io_Path.directory=function(e){var t=new haxe_io_Path(e);if(t.dir==null){return""}return t.dir};haxe_io_Path.extension=function(e){var t=new haxe_io_Path(e);if(t.ext==null){return""}return t.ext};haxe_io_Path.withExtension=function(e,t){var r=new haxe_io_Path(e);r.ext=t;return r.toString()};haxe_io_Path.join=function(e){var t=[];var r=0;var n=e;while(r<n.length){var i=n[r];++r;if(i!=null&&i!=""){t.push(i)}}var e=t;if(e.length==0){return""}var s=e[0];var t=1;var r=e.length;while(t<r){var a=t++;s=haxe_io_Path.addTrailingSlash(s);s+=e[a]}return haxe_io_Path.normalize(s)};haxe_io_Path.normalize=function(e){var t="/";e=e.split("\\").join(t);if(e==t){return t}var r=[];var n=0;var i=e.split(t);while(n<i.length){var s=i[n];++n;if(s==".."&&r.length>0&&r[r.length-1]!=".."){r.pop()}else if(s==""){if(r.length>0||HxOverrides.cca(e,0)==47){r.push(s)}}else if(s!="."){r.push(s)}}var a=r.join(t);var l="";var o=false;var u=false;var c=0;var h=a;while(c<h.length){var d=h;var v=c++;var m=d.charCodeAt(v);if(m>=55296&&m<=56319){m=m-55232<<10|d.charCodeAt(v+1)&1023}var p=m;if(p>=65536){++c}var _=p;switch(_){case 47:if(!o){u=true}else{var g=_;o=false;if(u){l+="/";u=false}l+=String.fromCodePoint(g)}break;case 58:l+=":";o=true;break;default:var w=_;o=false;if(u){l+="/";u=false}l+=String.fromCodePoint(w)}}return l};haxe_io_Path.addTrailingSlash=function(e){if(e.length==0){return"/"}var t=e.lastIndexOf("/");var r=e.lastIndexOf("\\");if(t<r){if(r!=e.length-1){return e+"\\"}else{return e}}else if(t!=e.length-1){return e+"/"}else{return e}};haxe_io_Path.removeTrailingSlashes=function(e){e:while(true){var t=HxOverrides.cca(e,e.length-1);if(t==null){break}else{switch(t){case 47:case 92:e=HxOverrides.substr(e,0,-1);break;default:break e}}}return e};haxe_io_Path.isAbsolute=function(e){if(StringTools.startsWith(e,"/")){return true}if(e.charAt(1)==":"){return true}if(StringTools.startsWith(e,"\\\\")){return true}return false};haxe_io_Path.prototype={toString:function(){return(this.dir==null?"":this.dir+(this.backslash?"\\":"/"))+this.file+(this.ext==null?"":"."+this.ext)},__class__:haxe_io_Path};var haxe_iterators_ArrayIterator=function(e){this.current=0;this.array=e};t["haxe.iterators.ArrayIterator"]=haxe_iterators_ArrayIterator;haxe_iterators_ArrayIterator.__name__="haxe.iterators.ArrayIterator";haxe_iterators_ArrayIterator.prototype={hasNext:function(){return this.current<this.array.length},next:function(){return this.array[this.current++]},__class__:haxe_iterators_ArrayIterator};var haxe_remoting_AsyncConnection=function(){};t["haxe.remoting.AsyncConnection"]=haxe_remoting_AsyncConnection;haxe_remoting_AsyncConnection.__name__="haxe.remoting.AsyncConnection";haxe_remoting_AsyncConnection.__isInterface__=true;haxe_remoting_AsyncConnection.prototype={__class__:haxe_remoting_AsyncConnection};var haxe_remoting_HttpAsyncConnection=function(e,t){this.__data=e;this.__path=t};t["haxe.remoting.HttpAsyncConnection"]=haxe_remoting_HttpAsyncConnection;haxe_remoting_HttpAsyncConnection.__name__="haxe.remoting.HttpAsyncConnection";haxe_remoting_HttpAsyncConnection.__interfaces__=[haxe_remoting_AsyncConnection];haxe_remoting_HttpAsyncConnection.urlConnect=function(e){return new haxe_remoting_HttpAsyncConnection({url:e,error:function(e){throw haxe_Exception.thrown(e)}},[])};haxe_remoting_HttpAsyncConnection.prototype={resolve:function(e){var t=new haxe_remoting_HttpAsyncConnection(this.__data,this.__path.slice());t.__path.push(e);return t},setErrorHandler:function(e){this.__data.error=e},call:function(e,t){var r=new haxe_Http(this.__data.url);var n=new haxe_Serializer;n.serialize(this.__path);n.serialize(e);r.setHeader("X-Haxe-Remoting","1");r.setParameter("__x",n.toString());var i=this.__data.error;r.onData=function(e){var r=true;var n;try{if(HxOverrides.substr(e,0,3)!="hxr"){throw haxe_Exception.thrown("Invalid response : '"+e+"'")}var s=new haxe_Unserializer(HxOverrides.substr(e,3,null));n=s.unserialize()}catch(e){var a=haxe_Exception.caught(e).unwrap();n=null;r=false;i(a)}if(r&&t!=null){t(n)}};r.onError=i;r.request(true)},__class__:haxe_remoting_HttpAsyncConnection};var haxeshim_Args=function(e,t){this.cwd=e;this.args=t};t["haxeshim.Args"]=haxeshim_Args;haxeshim_Args.__name__="haxeshim.Args";haxeshim_Args.interpolate=function(e,t){if(e.indexOf("${")==-1){return w.Success(e)}var r="";var n=0;while(n<e.length){var i=e.indexOf("${",n);if(i==-1){var s=null;r+=s==null?HxOverrides.substr(e,n,null):HxOverrides.substr(e,n,s);break}else{var a=i;var l=a-n;r+=l==null?HxOverrides.substr(e,n,null):HxOverrides.substr(e,n,l);var o=a+2;var u;var c=e.indexOf("}",o);if(c==-1){return w.Failure("unclosed interpolation in "+e)}else{var h=c;u=h}var d=HxOverrides.substr(e,o,u-o);var v;var m=t(d);if(m==null){return w.Failure("unknown variable "+d)}else{var p=m;if(p=="$"+"{"+d+"}"){v=p}else{var _=haxeshim_Args.interpolate(p,t);if(_._hx_index==0){var g=_.data;v=g}else{var x=_;return x}}}r+=Std.string(v);n=u+1}}return w.Success(r)};haxeshim_Args.fromMultilineString=function(e,t,r,n){if(n==null){n=false}var i=[];var s=new haxeshim_Errors;var getVar1=function(e){if(e=="__dirname"){return haxe_io_Path.directory(t)}else{return r(e)}};var add=function(e,r){var add=function(e){i.push({pos:m.File(t,r),val:e})};if(e.charAt(0)=="-"){add(e)}else{var n=haxeshim_Args.interpolate(e,getVar1);switch(n._hx_index){case 0:var a=n.data;add(a);break;case 1:var l=n.failure;s.fail(l,m.File(t,r));break}}};var a=e.split("\n");var l=StringTools.trim;var o=new Array(a.length);var u=0;var c=a.length;while(u<c){var h=u++;o[h]=l(a[h])}var d=o;var u=0;var c=d.length;while(u<c){var v=u++;var p=d[v];var _=function(e){return function(t){add(t,e[0])}}([v]);var g=p.charAt(0);if(g!=null){switch(g){case"#":break;case"-":var w=p.indexOf(" ");if(w==-1){_(p)}else{var x=w;_(HxOverrides.substr(p,0,x));_(StringTools.trim(HxOverrides.substr(p,x,null)))}break;default:var b=StringTools.trim(p);if(b!=""){var y=b;if(n){_("-cp")}_(y)}}}}return s.produce(i)};haxeshim_Args.getNdll=function(e){if(StringTools.startsWith(e,"ndll:")){return u.Some(HxOverrides.substr(e,5,null))}else{return u.None}};haxeshim_Args.makeNdll=function(e){return"ndll:"+e};haxeshim_Args.split=function(e,t,r,n){var i=[];var s=0;var a=e.length;while(s<a){var l=s++;i.push({val:e[l],pos:m.Cmd(l)})}var e=i;var o=[];var u=[];var c=[];var h=new haxeshim_Errors;var resolvePath=function(e){if(haxe_io_Path.isAbsolute(e)){return e}else{return haxe_io_Path.join([t,e])}};var flush=function(){if(u.length>0){var e=new haxeshim_Args(t,o.concat(u));u=[];c.push(e)}};while(true){var i=e.shift();if(i==null){flush();break}else{var d=i;var s=d.val;switch(s){case"--each":o=u;u=[];break;case"--next":flush();break;case"--cwd":case"-C":var a=e.shift();if(a==null){h.fail(""+d.val+" without argument",d.pos)}else{var v=a;t=resolvePath(v.val);if(!r.isDirectory(t)){h.fail("Cannot use "+t+" as working directory",v.pos);e=[]}}break;case"--run":case"-x":u=u.concat([d].concat(e));e=[];flush();break;default:var p=s;if(haxe_io_Path.extension(p)=="hxml"){e=haxeshim_Args.readHxml(resolvePath(p),r,n,h,d.pos).concat(e)}else{var _=s;if(StringTools.startsWith(_,"${")){var g=haxeshim_Args.interpolate(_,n);switch(g._hx_index){case 0:var w=g.data;u.push({val:w,pos:d.pos});break;case 1:var x=g.failure;h.fail(x,d.pos);break}}else{u.push(d)}}}}}return h.produce(c)};haxeshim_Args.readHxml=function(e,t,r,n,i){var s=t.readFile(e);switch(s._hx_index){case 0:var a=s.data;return n.getResult(haxeshim_Args.fromMultilineString(a,e,r));case 1:var l=s.failure;n.fail(l,i);return[]}};haxeshim_Args.prototype={__class__:haxeshim_Args};var haxeshim_Attempt=function(){};t["haxeshim.Attempt"]=haxeshim_Attempt;haxeshim_Attempt.__name__="haxeshim.Attempt";haxeshim_Attempt.to=function(e,t,r){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyFunc((function(){return tink_core_TypedError.catchExceptions(t,(function(t){return tink_core_TypedError.withData(null,"Failed to "+e,t,r)}),{fileName:"haxeshim/Attempt.hx",lineNumber:8,className:"haxeshim.Attempt",methodName:"to"})})))};var d=n["haxeshim.ServerKind"]={__ename__:"haxeshim.ServerKind",__constructs__:null,Port:(i=function(e){return{_hx_index:0,num:e,__enum__:"haxeshim.ServerKind",toString:$estr}},i._hx_name="Port",i.__params__=["num"],i),Stdio:{_hx_name:"Stdio",_hx_index:1,__enum__:"haxeshim.ServerKind",toString:$estr}};d.__constructs__=[d.Port,d.Stdio];var v=n["haxeshim.StdioState"]={__ename__:"haxeshim.StdioState",__constructs__:null,AwaitingHeader:(i=function(e){return{_hx_index:0,buf:e,__enum__:"haxeshim.StdioState",toString:$estr}},i._hx_name="AwaitingHeader",i.__params__=["buf"],i),AwaitingData:(i=function(e,t){return{_hx_index:1,buf:e,total:t,__enum__:"haxeshim.StdioState",toString:$estr}},i._hx_name="AwaitingData",i.__params__=["buf","total"],i)};v.__constructs__=[v.AwaitingHeader,v.AwaitingData];var haxeshim_CompilerServer=function(e,t,r){this.freePort=Y.irreversible((function(e){var t=N.createServer();t.listen(0,(function(){var r=t.address().port;t.close((function(){e(w.Success(r))}))}))}));this.args=r;this.scope=t;switch(e._hx_index){case 0:var n=e.num;this.waitOnPort(n);break;case 1:this.stdio();break}};t["haxeshim.CompilerServer"]=haxeshim_CompilerServer;haxeshim_CompilerServer.__name__="haxeshim.CompilerServer";haxeshim_CompilerServer.prototype={handleIntSignals:function(){var cleanExit=function(){process.exit()};process.on("SIGINT",cleanExit);process.on("SIGTERM",cleanExit)},stdio:function(){var e=this;g.watch(this.scope.configFile,{persistent:false},(function(t,r){var n=10;var i=null;i=function(t){if(t==null){t=0}try{e.scope.reload()}catch(e){if(t>=n){haxeshim_Logger.get().error("Reloading .haxerc after change detected failed "+n+" times!");process.exit(500)}else{var r=t+1;haxe_Timer.delay((function(){i(r)}),100)}}};i()}));var t=null;var quit=function(){if(t!=null){t.kill()}};process.on("exit",quit);this.handleIntSignals();process.stdin.on("end",quit);process.stdin.on("close",quit);var r=v.AwaitingHeader(O.alloc(0));var frame=function(e){var t=O.alloc(4+e.length);t.writeInt32LE(e.length,0);e.copy(t,4);return t};var processData=function(r){var n=O.alloc(0);var i=e;var s=r.indexOf(1);var l;if(s==-1){l=r}else{var o=s;n=r.slice(o);l=r.slice(0,o)}var u=i.parseArgs(l);if(t==null||u.version!=e.lastVersion){if(t!=null){t.kill();t.stdout.unpipe(process.stdout);t.stderr.unpipe(process.stderr)}e.lastVersion=u.version;var c=e.scope.haxeInstallation;t=a.spawn(c.compiler,e.args.concat(["--wait","stdio"]),{cwd:e.scope.cwd,env:x.toVars(haxeshim_sys_Exec.mergeEnv(c.env)),stdio:"pipe"});var h=t;t.on("exit",(function(e,r){if(t==h){t=null}}));t.stdout.pipe(process.stdout);t.stderr.pipe(process.stderr)}var s=e.scope;var d=u.args;var v=tink_core_TypedError.catchExceptions((function(){return s.resolve(d)}),null,{fileName:"haxeshim/CompilerServer.hx",lineNumber:142,className:"haxeshim.CompilerServer",methodName:"stdio"});switch(v._hx_index){case 0:var m=v.data;var p=O.from(m.join("\n"));t.stdin.write(frame(O.concat([p,n])));break;case 1:var _=v.failure;haxeshim_sys_Exec.die(_.code,_.message);break}};var reduce=function(){while(true){var e;switch(r._hx_index){case 0:var t=r.buf;e=t.length>=4?v.AwaitingData(t.slice(4),t.readInt32LE(0)):r;break;case 1:var n=r.buf;var i=r.total;if(n.length>=i){processData(n.slice(0,i));e=v.AwaitingHeader(n.slice(i))}else{e=r}break;default:e=r}if(r==e){break}r=e}};process.stdin.on("data",(function(e){switch(r._hx_index){case 0:var t=r.buf;r=v.AwaitingHeader(O.concat([t,e]));break;case 1:var t=r.buf;var n=r.total;r=v.AwaitingData(O.concat([t,e]),n);break}reduce()}))},parseArgs:function(e){var t=e.toString().split("\n");var r;var n=t.indexOf("--haxe-version");if(n==-1){r=this.lastVersion==null?this.scope.haxeInstallation.version:this.lastVersion}else{var i=n;r=t.splice(i,2).pop()}return{version:r,args:t}},waitOnPort:function(e){var t=this;var quit=function(){if(t.waiting!=null){t.waiting.handle((function(e){if(e._hx_index==0){var t=e.data;t.kill()}}))}};process.on("exit",quit);this.handleIntSignals();var r=N.createServer((function(e){var r=[];e.on("data",(function(n){var i=n.indexOf(0);if(i==-1){r.push(n)}else{var s=i;r.push(n.slice(0,s));e.unshift(n.slice(s+1));var a=O.concat(r).toString().split("\n");r=[];var l;var i=a.indexOf("--haxe-version");if(i==-1){l=t.lastVersion==null?t.scope.haxeInstallation.version:t.lastVersion}else{var s=i;l=a.splice(s,2).pop()}t.connect(l).handle((function(t){switch(t._hx_index){case 0:var r=t.data;r.write(a.join("\n")+String.fromCodePoint(0));r.pipe(e,{end:true});break;case 1:var n=t.failure;e.end(n.message+"\n"+""+"\n","utf8");break}}))}}));e.on("error",(function(){}));e.on("end",(function(){}))}));r.listen(e)},disconnect:function(){if(this.waiting==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return X.next(this.waiting,(function(e){return Y.map(e.kill(),w.Success)}))}},connect:function(e){var t=this;if(e!=this.lastVersion||this.waiting==null){this.lastVersion=e;var r=this.waiting=X.next(this.disconnect(),(function(r){return X.next(t.freePort,K.ofSafeSync((function(r){var n=t.scope.getInstallation(e);var i=haxeshim_sys_Exec.async(n.compiler,t.scope.cwd,t.args.concat(["--wait",r==null?"null":""+r]),n.env);return{died:Y.irreversible((function(e){var t=e;var r=null;var nu=function(){t(r)};i.on("exit",nu);var n=e;var s=null;var nu=function(){n(s)};i.on("error",nu);var a=e;var l=null;var nu=function(){a(l)};i.on("disconnect",nu)})),version:e,socket:function(){var f=function(e,t){var n=10;var i=null;i=function(s){var a=N.createConnection(r,"127.0.0.1");a.on("error",(function(e){if(s>=n){t(new tink_core_TypedError(null,"Failed to connect to 127.0.0.1:"+r+" after "+n+" attempts because "+e,{fileName:"haxeshim/CompilerServer.hx",lineNumber:291,className:"haxeshim.CompilerServer",methodName:"connect"}))}else{var a=s+1;haxe_Timer.delay((function(){i(a)}),100)}})).on("connect",(function(){e(a)}))};i(1)};var f1=function(e,t){f(e,t);return null};var wakeup=function(e){return f1((function(t){e(w.Success(t))}),(function(t){e(w.Failure(t))}))};return new tink_core__$Future_SuspendableFuture((function(e,t){return wakeup(e)}))},kill:function(){i.kill();return Y.delay(500,new tink_core__$Lazy_LazyConst(null))}}})))}));this.waiting.handle((function(e){switch(e._hx_index){case 0:var n=e.data;n.died.handle((function(){if(t.waiting==r){t.waiting=null}}));break;case 1:var i=e.failure;t.waiting=null;break}}))}return X.next(this.waiting,(function(e){return e.socket()}))},__class__:haxeshim_CompilerServer};var haxeshim_Errors=function(){this.errors=[]};t["haxeshim.Errors"]=haxeshim_Errors;haxeshim_Errors.__name__="haxeshim.Errors";haxeshim_Errors.getCode=function(e){var t=0;var r=e;while(t<r.length){var n=r[t];++t;var i=n.code;if(i!=null){var s=i;return s}}return 500};haxeshim_Errors.prototype={fail:function(e,t,r){this.errors.push({message:e,pos:t,code:r})},produce:function(e){if(this.errors.length==0){return w.Success(e)}else{return w.Failure({result:e,errors:this.errors})}},getResult:function(e){switch(e._hx_index){case 0:var t=e.data;return t;case 1:var t=e.failure;var r=0;var n=t.errors;while(r<n.length){var i=n[r];++r;this.errors.push(i)}return t.result}},__class__:haxeshim_Errors};var m=n["haxeshim.Pos"]={__ename__:"haxeshim.Pos",__constructs__:null,File:(i=function(e,t){return{_hx_index:0,path:e,line:t,__enum__:"haxeshim.Pos",toString:$estr}},i._hx_name="File",i.__params__=["path","line"],i),Cmd:(i=function(e){return{_hx_index:1,index:e,__enum__:"haxeshim.Pos",toString:$estr}},i._hx_name="Cmd",i.__params__=["index"],i),Custom:(i=function(e){return{_hx_index:2,source:e,__enum__:"haxeshim.Pos",toString:$estr}},i._hx_name="Custom",i.__params__=["source"],i)};m.__constructs__=[m.File,m.Cmd,m.Custom];var haxeshim_PosTools=function(){};t["haxeshim.PosTools"]=haxeshim_PosTools;haxeshim_PosTools.__name__="haxeshim.PosTools";haxeshim_PosTools.toString=function(e){switch(e._hx_index){case 0:var t=e.path;var r=e.line;return""+t+":"+r;case 1:var n=e.index;return"CLI arg#"+n;case 2:var i=e.source;return i}};var haxeshim_Logger=function(){};t["haxeshim.Logger"]=haxeshim_Logger;haxeshim_Logger.__name__="haxeshim.Logger";haxeshim_Logger.get=function(e){if(e==null){e=false}if(e){if(haxeshim_Logger.SILENT==null){haxeshim_Logger.SILENT=new haxeshim_Logger}return haxeshim_Logger.SILENT}else{if(haxeshim_Logger.DEFAULT==null){haxeshim_Logger.DEFAULT=new haxeshim__$Logger_SysLogger}return haxeshim_Logger.DEFAULT}};haxeshim_Logger.prototype={error:function(e){},warning:function(e){},info:function(e){},success:function(e){},progress:function(e){},__class__:haxeshim_Logger};var haxeshim__$Logger_SysLogger=function(){haxeshim_Logger.call(this)};t["haxeshim._Logger.SysLogger"]=haxeshim__$Logger_SysLogger;haxeshim__$Logger_SysLogger.__name__="haxeshim._Logger.SysLogger";haxeshim__$Logger_SysLogger.__super__=haxeshim_Logger;haxeshim__$Logger_SysLogger.prototype=$extend(haxeshim_Logger.prototype,{log:function(e,t){this.progress("");var r=haxeshim__$Logger_SysLogger.out;var n;switch(e._hx_index){case 0:n=[s.Red];break;case 1:n=[s.Yellow];break;case 2:n=[s.DefaultForeground];break;case 3:n=[s.Green];break}r.writeString(ANSI.aset(n)+t+ANSI.aset([s.Off])+"\n")},error:function(e){this.log(p.Error,e)},warning:function(e){this.log(p.Warning,e)},info:function(e){this.log(p.Info,e)},success:function(e){this.log(p.Success,e)},progress:function(e){if(haxeshim__$Logger_SysLogger.isTTY){if(e.length>80){e=HxOverrides.substr(e,0,77)+"..."}haxeshim__$Logger_SysLogger.out.writeString((ANSI.strip||ANSI.stripIfUnavailable&&!ANSI.available?"":"")+(ANSI.strip||ANSI.stripIfUnavailable&&!ANSI.available?"":"["+1+"G")+e)}},__class__:haxeshim__$Logger_SysLogger});var p=n["haxeshim._Logger.Level"]={__ename__:"haxeshim._Logger.Level",__constructs__:null,Error:{_hx_name:"Error",_hx_index:0,__enum__:"haxeshim._Logger.Level",toString:$estr},Warning:{_hx_name:"Warning",_hx_index:1,__enum__:"haxeshim._Logger.Level",toString:$estr},Info:{_hx_name:"Info",_hx_index:2,__enum__:"haxeshim._Logger.Level",toString:$estr},Success:{_hx_name:"Success",_hx_index:3,__enum__:"haxeshim._Logger.Level",toString:$estr}};p.__constructs__=[p.Error,p.Warning,p.Info,p.Success];var haxeshim_cli_HaxeCli=function(e){this.scope=e};t["haxeshim.cli.HaxeCli"]=haxeshim_cli_HaxeCli;haxeshim_cli_HaxeCli.__name__="haxeshim.cli.HaxeCli";haxeshim_cli_HaxeCli.prototype={installLibs:function(e){return this.scope.withLogger(haxeshim_Logger.get(e),(i=this.scope,$bind(i,i.installLibs))).handle((function(e){if(e._hx_index==1){var t=e.failure;haxeshim_Logger.get().error(t.message);var r=t.code;process.exit(r)}}))},dispatch:function(e){var getScope=function(){var e={cwd:null};return haxeshim_sys_Exec.gracefully((function(){return haxeshim_scope_Scope.seek(e)}))};var t;var r;r=e.indexOf("--wait");var n=r;if(n>=0&&n<e.length-1){var i;var s=e.splice(n,2).pop();var r;if(s==null){r=Std.parseInt(s);var a=r;i=d.Port(a)}else if(s=="stdio"){i=d.Stdio}else{r=Std.parseInt(s);var a=r;i=d.Port(a)}new haxeshim_CompilerServer(i,getScope(),e)}else{t=e.slice(0,2);if(t.length==2){if(t[0]=="--run"){var l=t[1];if(l.indexOf("-")!=-1&&l.toLowerCase()==l){var o=e.slice(2);var u=getScope();switch(l){case"install-libs":var i;switch(o.length){case 0:i=false;break;case 1:i=o[0]=="--silent"?true:haxeshim_sys_Exec.die(422,"unexpected arguments "+Std.string(o));break;default:i=haxeshim_sys_Exec.die(422,"unexpected arguments "+Std.string(o))}this.installLibs(i);break;case"resolve-args":var s=u;var c=o;var h=haxeshim_sys_Exec.gracefully((function(){return s.resolve(c)})).join("\n");process.stdout.write(Std.string(h));process.stdout.write("\n");process.exit(0);break;case"show-version":if(o.length>0){haxeshim_sys_Exec.die(422,"too many arguments")}var v;var m=haxeshim_sys_Exec.eval(u.haxeInstallation.compiler,u.cwd,["-version"]);switch(m._hx_index){case 0:var h=m.data;v=StringTools.trim(h.stdout.toString()+h.stderr.toString());break;case 1:var p=m.failure;v=haxeshim_sys_Exec.die(p.code,p.message);break}process.stdout.write(Std.string("-D haxe-ver="+v));process.stdout.write("\n");var h="-cp "+u.haxeInstallation.stdLib;process.stdout.write(Std.string(h));process.stdout.write("\n");break;default:var h=l;haxeshim_sys_Exec.die(404,"Unknown extension "+h)}}else{var o=e;var u=getScope();var m=o.indexOf("--haxe-version");if(o.indexOf("--connect")==-1){var i=m==-1}else if(m==-1){o.push("--haxe-version");o.push(u.haxeInstallation.version)}var m=u.haxeInstallation.compiler;var _=m;if(sys_FileSystem.exists(_)){var get=function(e){switch(e._hx_index){case 0:var t=e.data;return t;case 1:var r=e.failure;var n=r.result;var i=r.errors;return haxeshim_sys_Exec.dieFromErrors(i)}};var callHaxe=function(e,t){var r=haxeshim_sys_Exec.sync(_,t,e,u.haxeInstallation.env);switch(r._hx_index){case 0:var n=r.data;if(n!=0){var i=n;haxeshim_sys_Exec.die(i)}break;case 1:var s=r.failure;haxeshim_sys_Exec.die(s.code,s.message);break}};if(o.length==0){callHaxe(o,u.cwd)}else{var g=0;var w=get(u.getBuilds(o));while(g<w.length){var x=w[g];++g;var b=get(x);get(b.checkClassPaths());var callHaxe1=callHaxe;var y=[];var S=0;var E=b.args;while(S<E.length){var N=E[S];++S;y.push(N.val)}callHaxe1(y,b.cwd)}}}else{var k=m;haxeshim_sys_Exec.die(404,'haxe compiler not found at the expected location "'+k+'"')}}}else{var o=e;var O=getScope();var m=o.indexOf("--haxe-version");if(o.indexOf("--connect")==-1){var i=m==-1}else if(m==-1){o.push("--haxe-version");o.push(O.haxeInstallation.version)}var m=O.haxeInstallation.compiler;var R=m;if(sys_FileSystem.exists(R)){var get1=function(e){switch(e._hx_index){case 0:var t=e.data;return t;case 1:var r=e.failure;var n=r.result;var i=r.errors;return haxeshim_sys_Exec.dieFromErrors(i)}};var callHaxe1=function(e,t){var r=haxeshim_sys_Exec.sync(R,t,e,O.haxeInstallation.env);switch(r._hx_index){case 0:var n=r.data;if(n!=0){var i=n;haxeshim_sys_Exec.die(i)}break;case 1:var s=r.failure;haxeshim_sys_Exec.die(s.code,s.message);break}};if(o.length==0){callHaxe1(o,O.cwd)}else{var g=0;var w=get1(O.getBuilds(o));while(g<w.length){var x=w[g];++g;var b=get1(x);get1(b.checkClassPaths());var callHaxe2=callHaxe1;var y=[];var S=0;var E=b.args;while(S<E.length){var N=E[S];++S;y.push(N.val)}callHaxe2(y,b.cwd)}}}else{var k=m;haxeshim_sys_Exec.die(404,'haxe compiler not found at the expected location "'+k+'"')}}}else{var o=e;var C=getScope();var m=o.indexOf("--haxe-version");if(o.indexOf("--connect")==-1){var i=m==-1}else if(m==-1){o.push("--haxe-version");o.push(C.haxeInstallation.version)}var m=C.haxeInstallation.compiler;var A=m;if(sys_FileSystem.exists(A)){var get2=function(e){switch(e._hx_index){case 0:var t=e.data;return t;case 1:var r=e.failure;var n=r.result;var i=r.errors;return haxeshim_sys_Exec.dieFromErrors(i)}};var callHaxe2=function(e,t){var r=haxeshim_sys_Exec.sync(A,t,e,C.haxeInstallation.env);switch(r._hx_index){case 0:var n=r.data;if(n!=0){var i=n;haxeshim_sys_Exec.die(i)}break;case 1:var s=r.failure;haxeshim_sys_Exec.die(s.code,s.message);break}};if(o.length==0){callHaxe2(o,C.cwd)}else{var g=0;var w=get2(C.getBuilds(o));while(g<w.length){var x=w[g];++g;var b=get2(x);get2(b.checkClassPaths());var I=callHaxe2;var y=[];var S=0;var E=b.args;while(S<E.length){var N=E[S];++S;y.push(N.val)}I(y,b.cwd)}}}else{var k=m;haxeshim_sys_Exec.die(404,'haxe compiler not found at the expected location "'+k+'"')}}}},__class__:haxeshim_cli_HaxeCli};var haxeshim_cli_HaxelibCli=function(e){this.scope=e;this.installation=e.haxeInstallation};t["haxeshim.cli.HaxelibCli"]=haxeshim_cli_HaxelibCli;haxeshim_cli_HaxelibCli.__name__="haxeshim.cli.HaxelibCli";haxeshim_cli_HaxelibCli.exit=function(e){switch(e._hx_index){case 0:var t=e.data;process.exit(0);break;case 1:var r=e.failure;haxeshim_sys_Exec.die(r.code,r.message);break}};haxeshim_cli_HaxelibCli.exitWithCode=function(e){switch(e._hx_index){case 0:var t=e.data;process.exit(t);break;case 1:var r=e.failure;haxeshim_sys_Exec.die(r.code,r.message);break}};haxeshim_cli_HaxelibCli.prototype={callHaxelib:function(e){haxeshim_cli_HaxelibCli.exitWithCode(haxeshim_sys_Exec.sync(this.installation.haxelib,haxe_io_Path.addTrailingSlash(process.cwd()),e,this.installation.env))},run:function(e){var t=this;this.scope.getLibCommand(e).handle((function(r){switch(r._hx_index){case 0:var n=r.data;haxeshim_cli_HaxelibCli.exit(n());break;case 1:var i=r.failure;t.callHaxelib(["run"].concat(e));break}}))},__class__:haxeshim_cli_HaxelibCli};var haxeshim_scope_HaxeInstallation=function(e,t,r,n){this.path=e;this.version=t;this.compiler=""+e+"/haxe"+haxeshim_sys_Os.EXECUTABLE_EXTENSION;this.haxelib=""+e+"/haxelib"+haxeshim_sys_Os.EXECUTABLE_EXTENSION;this.stdLib=""+e+"/std";this.haxelibRepo=r;this.neko=n;this.env=x.mergeInto(n.env,x.ofObj({HAXE_STD_PATH:this.stdLib,HAXEPATH:e,HAXELIB_PATH:r,HAXE_VERSION:t}))};t["haxeshim.scope.HaxeInstallation"]=haxeshim_scope_HaxeInstallation;haxeshim_scope_HaxeInstallation.__name__="haxeshim.scope.HaxeInstallation";haxeshim_scope_HaxeInstallation.at=function(e){var t=e.path;var r=e.version;var n=""+t+"/platform.txt";var i;if(sys_FileSystem.exists(n)){i=g.readFileSync(n,{encoding:"utf8"})}else if(!sys_FileSystem.exists(t)){i=haxeshim_sys_Os.get_platform()}else{var s=new sys_io_FileInput(g.openSync(""+t+"/haxe"+haxeshim_sys_Os.EXECUTABLE_EXTENSION,"r"));var a=s.read(1024);var l=y.detect(a);try{g.writeFileSync(n,l)}catch(e){var o=haxe_Exception.caught(e).unwrap();haxeshim_Logger.get().error("Failed to cache platform in info: "+Std.string(o))}i=l}var u=i;return new haxeshim_scope_HaxeInstallation(t,r,e.haxelibRepo,haxeshim_scope_NekoInstallation.get(e.root,u,r))};haxeshim_scope_HaxeInstallation.prototype={__class__:haxeshim_scope_HaxeInstallation};var haxeshim_scope_NekoInstallation=function(e){this.path=e.path;this.platform=e.platform;this.version=e.version;this.executable=""+this.path+"/neko"+haxeshim_sys_Os.EXECUTABLE_EXTENSION;var t;switch(Sys.systemName()){case"Mac":t="DYLD_LIBRARY_PATH";break;case"Windows":t="PATH";break;default:t="LD_LIBRARY_PATH"}var r=process.env[t];var n;if(r==null){var i=new haxe_ds_StringMap;i.h[t]=this.path;n=x.ofMap(i)}else{var s=r;if(s.indexOf(this.path)!=-1){n=x.ofObj({})}else{var a=r;var r=new haxe_ds_StringMap;r.h[t]=a+haxeshim_sys_Os.DELIMITER+this.path;n=x.ofMap(r)}}this.env=n};t["haxeshim.scope.NekoInstallation"]=haxeshim_scope_NekoInstallation;haxeshim_scope_NekoInstallation.__name__="haxeshim.scope.NekoInstallation";haxeshim_scope_NekoInstallation.get=function(e,t,r){var n="2.4.0";return new haxeshim_scope_NekoInstallation({platform:t,version:n,path:""+e+"/neko/versions/"+n+"-"+t})};haxeshim_scope_NekoInstallation.prototype={__class__:haxeshim_scope_NekoInstallation};var haxeshim_sys_Os=function(){};t["haxeshim.sys.Os"]=haxeshim_sys_Os;haxeshim_sys_Os.__name__="haxeshim.sys.Os";haxeshim_sys_Os.get_platform=function(){var e;if(haxeshim_sys_Os.platform!=null){e=haxeshim_sys_Os.platform}else{var t=process.platform;var r=process.arch;switch(t){case"darwin":switch(r){case"arm64":e="mac-arm";break;case"x64":e="mac64";break;default:e="unknown"}break;case"linux":switch(r){case"arm":e="linux-arm";break;case"arm64":e="linux-arm64";break;case"ia32":e="linux32";break;case"riscv64":e="linux-riscv";break;case"x64":e="linux64";break;default:e="unknown"}break;case"win32":switch(r){case"ia32":e="win32";break;case"x64":e="win64";break;default:e="unknown"}break;default:e="unknown"}}return haxeshim_sys_Os.platform=e};var tink_core__$Lazy_Computable=function(){};t["tink.core._Lazy.Computable"]=tink_core__$Lazy_Computable;tink_core__$Lazy_Computable.__name__="tink.core._Lazy.Computable";tink_core__$Lazy_Computable.__isInterface__=true;tink_core__$Lazy_Computable.prototype={__class__:tink_core__$Lazy_Computable};var tink_core__$Lazy_LazyObject=function(){};t["tink.core._Lazy.LazyObject"]=tink_core__$Lazy_LazyObject;tink_core__$Lazy_LazyObject.__name__="tink.core._Lazy.LazyObject";tink_core__$Lazy_LazyObject.__isInterface__=true;tink_core__$Lazy_LazyObject.__interfaces__=[tink_core__$Lazy_Computable];tink_core__$Lazy_LazyObject.prototype={__class__:tink_core__$Lazy_LazyObject};var tink_core__$Lazy_LazyConst=function(e){this.value=e};t["tink.core._Lazy.LazyConst"]=tink_core__$Lazy_LazyConst;tink_core__$Lazy_LazyConst.__name__="tink.core._Lazy.LazyConst";tink_core__$Lazy_LazyConst.__interfaces__=[tink_core__$Lazy_LazyObject];tink_core__$Lazy_LazyConst.prototype={isComputed:function(){return true},get:function(){return this.value},compute:function(){},underlying:function(){return null},__class__:tink_core__$Lazy_LazyConst};var _={};_.get=function(e){e.compute();return e.get()};var sys_FileSystem=function(){};t["sys.FileSystem"]=sys_FileSystem;sys_FileSystem.__name__="sys.FileSystem";sys_FileSystem.exists=function(e){try{g.accessSync(e);return true}catch(e){return false}};sys_FileSystem.isDirectory=function(e){try{return g.statSync(e).isDirectory()}catch(e){return false}};sys_FileSystem.createDirectory=function(e){try{g.mkdirSync(e)}catch(n){var t=haxe_Exception.caught(n).unwrap();if(t.code=="ENOENT"){sys_FileSystem.createDirectory(k.dirname(e));g.mkdirSync(e)}else{var r;try{r=g.statSync(e)}catch(e){throw t}if(!r.isDirectory()){throw t}}}};sys_FileSystem.deleteDirectory=function(e){if(sys_FileSystem.exists(e)){var t=0;var r=g.readdirSync(e);while(t<r.length){var n=r[t];++t;var i=e+"/"+n;if(sys_FileSystem.isDirectory(i)){sys_FileSystem.deleteDirectory(i)}else{g.unlinkSync(i)}}g.rmdirSync(e)}};var g=r(7147);var w=n["tink.core.Outcome"]={__ename__:"tink.core.Outcome",__constructs__:null,Success:(i=function(e){return{_hx_index:0,data:e,__enum__:"tink.core.Outcome",toString:$estr}},i._hx_name="Success",i.__params__=["data"],i),Failure:(i=function(e){return{_hx_index:1,failure:e,__enum__:"tink.core.Outcome",toString:$estr}},i._hx_name="Failure",i.__params__=["failure"],i)};w.__constructs__=[w.Success,w.Failure];var haxeshim_scope_Scope=function(e,t,r,n){this.logger=haxeshim_Logger.get(false);this.haxeshimRoot=e;this.isGlobal=t;this.scopeDir=r;this.scopeLibDir=""+r+"/haxe_libraries";this.cwd=n;this.configFile=""+r+"/"+haxeshim_scope_Scope.CONFIG_FILE;this.versionDir=""+e+"/versions";this.haxelibRepo=""+e+"/haxelib";var i=process.env["HAXESHIM_LIBCACHE"];var s=process.env["HAXE_LIBCACHE"];var a;if(i==null){if(s==null){a=""+e+"/haxe_libraries"}else{var l=s;a=l}}else{var l=i;a=l}this.libCache=a};t["haxeshim.scope.Scope"]=haxeshim_scope_Scope;haxeshim_scope_Scope.__name__="haxeshim.scope.Scope";haxeshim_scope_Scope.create=function(e,t){return haxeshim_sys_Fs.save(""+e+"/"+haxeshim_scope_Scope.CONFIG_FILE,b.ofString(JSON.stringify(t,null," ")),{fileName:"haxeshim/scope/Scope.hx",lineNumber:194,className:"haxeshim.scope.Scope",methodName:"create"})};haxeshim_scope_Scope.exists=function(e){return sys_FileSystem.exists(""+e+"/"+haxeshim_scope_Scope.CONFIG_FILE)};haxeshim_scope_Scope.seek=function(e){if(e==null){e={}}var t;var r=e.cwd;if(r==null){t=haxe_io_Path.addTrailingSlash(process.cwd())}else{var n=r;t=n}var i;var r=e.startLookingIn;if(r==null){i=t}else{var n=r;i=n}var s;var r=e.haxeshimRoot;if(r==null){s=haxeshim_scope_Scope.DEFAULT_ROOT}else{var n=r;s=n}var a=s;var l=t;var make=function(e,t){return new haxeshim_scope_Scope(a,e,t,l)};var o;var r=haxeshim_sys_Fs.findNearest(haxeshim_scope_Scope.CONFIG_FILE,haxe_io_Path.isAbsolute(i)?i:k.resolve(i));switch(r._hx_index){case 0:var n=r.v;o=make(false,haxe_io_Path.directory(n));break;case 1:o=make(true,s);break}o.reload();return o};haxeshim_scope_Scope.env=function(e){var t=process.env[e];if(t==null){return u.None}else if(t==""){return u.None}else{var r=t;return u.Some(r)}};haxeshim_scope_Scope.prototype={withLogger:function(e,t){var r=this;var n=this.logger;this.logger=e;return tink_core_TypedError.tryFinally(t,(function(){r.logger=n}))},installLibs:function(){var e=this;return haxeshim_Attempt.to("install libraries",(function(){var t=e.getInstallationInstructions();var r=0;var n=t.missing;if(n.length!=0){var i=n;r=404;var n=0;while(n<i.length){var s=i[n];++n;e.logger.error(""+s.lib+" has no install instruction for missing classpath "+s.cp+"\n")}}var a=t.instructions.install.length+t.instructions.postInstall.length;var l=0;var o=0;var u=t.instructions.install;var n=0;while(n<u.length){var c=u[n];++n;e.logger.progress("["+ ++l+"/"+a+"] "+c);var h=haxeshim_sys_Exec.shell(c,haxe_io_Path.addTrailingSlash(process.cwd()));if(h._hx_index==1){var d=h.failure;r=d.code}else{++o}}var u=t.instructions.postInstall;var n=0;while(n<u.length){var c=u[n];++n;e.logger.progress("["+ ++l+"/"+a+"] "+c);var h=haxeshim_sys_Exec.shell(c,haxe_io_Path.addTrailingSlash(process.cwd()));if(h._hx_index==1){var d=h.failure;r=d.code}else{++o}}var v=a==1?"library":"libraries";if(r!=0){throw haxe_Exception.thrown(new tink_core_TypedError(r,"Failed to install "+(a-o)+"/"+a+" "+v+".",{fileName:"haxeshim/scope/Scope.hx",lineNumber:117,className:"haxeshim.scope.Scope",methodName:"installLibs"}))}else if(a>0){e.logger.success("Installed "+a+" "+v+".")}return null}),{fileName:"haxeshim/scope/Scope.hx",lineNumber:83,className:"haxeshim.scope.Scope",methodName:"installLibs"})},reload:function(){var e;try{e=g.readFileSync(this.configFile,{encoding:"utf8"})}catch(e){var t=haxe_Exception.caught(e).unwrap();throw haxe_Exception.thrown(this.isGlobal?"Global config file "+this.configFile+" does not exist or cannot be opened":"Unable to open file "+this.configFile+" because "+Std.string(t))}var r;try{r=JSON.parse(e)}catch(r){var t=haxe_Exception.caught(r).unwrap();new _$Sys_FileOutput(2).writeString("Invalid JSON in file "+this.configFile+":\n\n"+e+"\n\n");throw haxe_Exception.thrown(t)}this.setConfig(r)},setConfig:function(e){if(e.version==null){throw haxe_Exception.thrown("No version set in "+this.configFile)}if(e.resolveLibs==null){e.resolveLibs=this.isGlobal?"mixed":"scoped"}var t=e.resolveLibs;switch(t){case"haxelib":case"mixed":case"scoped":break;default:var r=t;throw haxe_Exception.thrown("invalid value "+r+" for `resolveLibs` in "+this.configFile)}this.config=e;this.haxeInstallation=this.getInstallation(e.version)},getVar:function(e){var t=process.env[e];if(t==null){return this.getDefault(e)}else if(t==""){return this.getDefault(e)}else{var r=t;return r}},getDefault:function(e){switch(e){case"CWD":return this.cwd;case"HAXESHIM_LIBCACHE":case"HAXE_LIBCACHE":return this.libCache;case"SCOPE_DIR":return this.scopeDir;default:return null}},delete:function(){g.unlinkSync(this.configFile)},reconfigure:function(e){var t=this;return X.next(haxeshim_sys_Fs.save(this.configFile,b.ofString(JSON.stringify(e,null," ")),{fileName:"haxeshim/scope/Scope.hx",lineNumber:201,className:"haxeshim.scope.Scope",methodName:"reconfigure"}),(function(r){t.setConfig(e);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(r)))}))},path:function(e){if(haxe_io_Path.isAbsolute(e)){return u.Some(e)}else if(StringTools.startsWith(e,"./")||StringTools.startsWith(e,"../")){return u.Some(""+this.cwd+"/"+e)}else{return u.None}},getInstallation:function(e){var t=this.haxeshimRoot;var r=this.haxelibRepo;var n=this.path(e);var i;switch(n._hx_index){case 0:var s=n.v;i=s;break;case 1:i=""+this.versionDir+"/"+e;break}return haxeshim_scope_HaxeInstallation.at({root:t,version:e,haxelibRepo:r,path:i})},resolveThroughHaxelib:function(e){if(e.length==0){return w.Success([])}else{var t=this.haxeInstallation.haxelib;var r=this.cwd;var n=[];var i=0;while(i<e.length){var s=e[i];++i;n.push(s.val)}var i=haxeshim_sys_Exec.eval(t,r,["path"].concat(n),this.haxeInstallation.env);switch(i._hx_index){case 0:var t=i.data;var a;var r=t.stderr;if(t.status==0){var l=t.stdout;return tink_core_OutcomeTools.map(haxeshim_Args.fromMultilineString(l,"haxelib path",$bind(this,this.getVar),true),(function(e){var t=0;var r=e.length;while(t<r){var n=t++;if(e[n].val=="-L"){var set=function(t,r){e[t]={pos:e[t].pos,val:r(e[t].val)}};set(n,(function(e){return"-lib"}));set(n+1,(function(e){return"ndll:"+e}))}}return e}))}else{a=new tink_core_TypedError(t.status,t.stdout+t.stderr,{fileName:"haxeshim/scope/Scope.hx",lineNumber:251,className:"haxeshim.scope.Scope",methodName:"resolveThroughHaxelib"});var o=a;var u=new haxeshim_Errors;u.fail(o.message,m.Custom("haxelib path"),o.code);return u.produce([])}break;case 1:var o=i.failure;var u=new haxeshim_Errors;u.fail(o.message,m.Custom("haxelib path"),o.code);return u.produce([])}}},interpolate:function(e,t){var r=this;var n;if(t==null){n=$bind(this,this.getVar)}else{var i=t;n=function(e){var t=i(e);if(t==null){return r.getVar(e)}else{var n=t;return n}}}return tink_core_OutcomeTools.sure(haxeshim_Args.interpolate(e,n))},parseDirectives:function(e){var t=new haxe_ds_StringMap;var r=0;var n=e.split("\n");var i=StringTools.trim;var s=new Array(n.length);var a=0;var l=n.length;while(a<l){var o=a++;s[o]=i(n[o])}var a=s;while(r<a.length){var u=a[r];++r;if(StringTools.startsWith(u,"#")){var c=StringTools.ltrim(HxOverrides.substr(u,1,null));if(StringTools.startsWith(c,"@")){var l=c.indexOf(":");if(l!=-1){var h=l;var d=c.substring(1,h);var v;var m=t.h[d];if(m==null){var p=[];t.h[d]=p;v=p}else{var _=m;v=_}v.push(this.interpolate(StringTools.ltrim(HxOverrides.substr(c,h+1,null))))}}}}return t},libHxml:function(e){return""+this.scopeLibDir+"/"+e+".hxml"},getDirectives:function(e){return X.next(haxeshim_sys_Fs.get(this.libHxml(e),{fileName:"haxeshim/scope/Scope.hx",lineNumber:289,className:"haxeshim.scope.Scope",methodName:"getDirectives"}),K.ofSafeSync($bind(this,this.parseDirectives)))},getLibCommand:function(e){var t=this;var r=[];var n=0;while(n<e.length){var i=e[n];++n;r.push(this.interpolate(i))}e=r;var s=e.shift();return X.next(this.getDirectives(s),(function(r){var n=r.h["run"];if(n==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"no @run directive found for library "+s,{fileName:"haxeshim/scope/Scope.hx",lineNumber:298,className:"haxeshim.scope.Scope",methodName:"getLibCommand"}))))}else{switch(n.length){case 0:return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"no @run directive found for library "+s,{fileName:"haxeshim/scope/Scope.hx",lineNumber:298,className:"haxeshim.scope.Scope",methodName:"getLibCommand"}))));case 1:var i=n[0];var a=[t.interpolate(i)];var l;if(haxeshim_sys_Os.IS_WINDOWS){var o=true;l=function(e){return haxe_SysTools.quoteWinArg(e,o)}}else{l=haxe_SysTools.quoteUnixArg}var u=new Array(e.length);var n=0;var c=e.length;while(n<c){var h=n++;u[h]=l(e[h])}var i=a.concat(u).join(" ");var d=haxe_io_Path.addTrailingSlash(process.cwd());var v=t.haxeInstallation.env;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success((function(){return haxeshim_sys_Exec.shell(i,d,v)}))));default:return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"more than one @run directive for library "+s,{fileName:"haxeshim/scope/Scope.hx",lineNumber:303,className:"haxeshim.scope.Scope",methodName:"getLibCommand"}))))}}}))},getInstallationInstructions:function(){var e=[];var t={install:[],postInstall:[]};if(sys_FileSystem.exists(this.scopeLibDir)){var r=0;var n=g.readdirSync(this.scopeLibDir);while(r<n.length){var i=n[r];++r;var s=""+this.scopeLibDir+"/"+i;if(!sys_FileSystem.isDirectory(s)&&StringTools.endsWith(s,".hxml")){var a=g.readFileSync(s,{encoding:"utf8"});var l;var o=haxeshim_Args.fromMultilineString(a,s,$bind(this,this.getVar));switch(o._hx_index){case 0:var u=o.data;var c=[];var h=0;while(h<u.length){var d=u[h];++h;c.push(d.val)}l=c;break;case 1:var v=o.failure;var m=v.errors;var p=v.result;var _=[];var w=0;while(w<p.length){var x=p[w];++w;_.push(x.val)}l=_;break}var b=0;var y=l.length;while(b<y)switch(l[b++]){case"--class-path":case"-cp":case"-p":var S=l[b++];if(!sys_FileSystem.exists(S)){var E=this.parseDirectives(a);var N=E.h["install"];if(N==null){e.push({lib:i,cp:S})}else if(N.length==0){e.push({lib:i,cp:S})}else{var k=N;var O=0;while(O<k.length){var R=k[O];++O;t.install.push(R)}var C=E.h["post-install"];if(C!=null){var A=C;var I=0;while(I<A.length){var F=A[I];++I;t.postInstall.push(F)}}}b=y}break;default:}}}}return{missing:e,instructions:t}},resolveArgs:function(e){var t=this.cwd;var resolvePath=function(e){if(haxe_io_Path.isAbsolute(e)){return e}else{return haxe_io_Path.join([t,e])}};t=resolvePath(e.cwd);var r=[];var n=[];var i=new haxeshim_Errors;var s=[];var a=[];var l=[];var o=0;e:while(o<e.args.length){var u=e.args[o++];switch(u.val){case"--run":l=e.args.slice(o-1);break e;case"--connect":case"--display":case"--server-connect":case"--server-listen":a.push(u);var c=e.args[o++];if(c==null){i.fail(""+u.val+" requires argument",u.pos)}else{var h=c;a.push(h)}break;case"--wait":a.push(u);break;default:s.push(u)}}var d=Object.create(null);e:while(s.length>0){var u=[s.shift()];var v=function(e){return function(t){i.fail(t,e[0].pos)}}(u);var c=u[0].val;switch(c){case"--connect":case"--cwd":case"--each":case"--next":case"--run":case"--wait":case"-C":var m=c;if(StringTools.endsWith(m,".hxml")){s=haxeshim_Args.readHxml(resolvePath(m),haxeshim_scope_Scope.fs,$bind(this,this.getVar),i,u[0].pos).concat(s)}else{var p=c;v(""+p+" not allowed here");break e}break;case"--lib":case"-L":case"-lib":var _=s.shift();var g;if(_==null){v("-lib requires argument")}else{g=haxeshim_Args.getNdll(_.val);if(g._hx_index==0){var w=g.v;var h=_;r.push(u[0]);r.push(h)}else{var x=_;if(!d[x.val]){d[x.val]=true;var b=this.config.resolveLibs;var y;if(b=="haxelib"){n.push(x)}else{y=b=="mixed";var S=y;var E=this.libHxml(x.val);var N=haxeshim_scope_Scope.fs.readFile(E);switch(N._hx_index){case 0:var k=N.data;s=i.getResult(haxeshim_Args.fromMultilineString(k,E,$bind(this,this.getVar))).concat(s);break;case 1:var O=N.failure;if(sys_FileSystem.exists(E)){v(O)}else if(S){n.push(x)}else{v("-lib "+x.val+" is missing "+E)}break}}}}}break;default:var R=c;if(StringTools.endsWith(R,".hxml")){s=haxeshim_Args.readHxml(resolvePath(R),haxeshim_scope_Scope.fs,$bind(this,this.getVar),i,u[0].pos).concat(s)}else{r.push(u[0])}}}r=a.concat(r).concat(i.getResult(this.resolveThroughHaxelib(n))).concat(l);return i.produce(new haxeshim_scope_ResolvedArgs(t,r))},getBuilds:function(e){var t=new haxeshim_Errors;var r=[];var n=0;var i=t.getResult(haxeshim_Args.split(e,this.cwd,haxeshim_scope_Scope.fs,$bind(this,this.getVar)));while(n<i.length){var s=i[n];++n;if(s.args.length>0){r.push(this.resolveArgs(s))}}return t.produce(r)},resolve:function(e){var t=[];var r=new haxeshim_Errors;var n=0;var i=r.getResult(haxeshim_Args.split(e,this.cwd,haxeshim_scope_Scope.fs,$bind(this,this.getVar)));while(n<i.length){var s=i[n];++n;if(s.args.length>0){if(t.length!=0){t.push("--next")}if(s.cwd!=this.cwd){t.push("--cwd");t.push(s.cwd)}var a=0;var l=r.getResult(this.resolveArgs(s)).args;while(a<l.length){var o=l[a];++a;t.push(o.val)}}}var n=r.produce(42);if(n._hx_index==1){var u;u=n.failure.errors[0];var c=u;var h=c.message;process.stdout.write(Std.string(h));process.stdout.write("\n");var d;var n=c.code;if(n==null){d=500}else{var h=n;d=h}process.exit(d)}return t},__class__:haxeshim_scope_Scope};var haxeshim_scope_ResolvedArgs=function(e,t){haxeshim_Args.call(this,e,t)};t["haxeshim.scope.ResolvedArgs"]=haxeshim_scope_ResolvedArgs;haxeshim_scope_ResolvedArgs.__name__="haxeshim.scope.ResolvedArgs";haxeshim_scope_ResolvedArgs.__super__=haxeshim_Args;haxeshim_scope_ResolvedArgs.prototype=$extend(haxeshim_Args.prototype,{resolve:function(e){if(haxe_io_Path.isAbsolute(e)){return e}else{return haxe_io_Path.join([this.cwd,e])}},checkClassPaths:function(){var e=new haxeshim_Errors;var t=0;var r=this.args.length;while(t<r){var n=t++;switch(this.args[n].val){case"--class-path":case"-cp":case"-p":if(n+1<this.args.length){var i=this.args[n+1];try{g.readdirSync(this.resolve(i.val))}catch(t){e.fail("classpath "+i.val+" is not a directory or cannot be read from",i.pos)}}break;default:}}return e.produce(null)},__class__:haxeshim_scope_ResolvedArgs});var x={};x.ofObj=function(e){return x.ofVars(e)};x.ofVars=function(e){var t={};var r=0;var n=Reflect.fields(e);while(r<n.length){var i=n[r];++r;t[haxeshim_sys_Os.IS_WINDOWS?i.toUpperCase():i]=e[i]}return t};x.ofMap=function(e){var t={};var r=e.h;var n=r;var i=Object.keys(r);var s=i.length;var a=0;while(a<s){var l=i[a++];t[haxeshim_sys_Os.IS_WINDOWS?l.toUpperCase():l]=e.h[l]}return t};x.vars=function(e){return e};x.toVars=function(e){return Reflect.copy(e)};x.mergeInto=function(e,t){var r=x.vars(t);if(e==null){var n=r;return n}else if(r==null){var n=e;return n}else{var i=e;var s=r;var a={};var l=s;var r=0;var o=Reflect.fields(l);while(r<o.length){var u=o[r];++r;a[u]=l[u]}var l=i;var r=0;var o=Reflect.fields(l);while(r<o.length){var u=o[r];++r;a[u]=l[u]}return a}};var haxeshim_sys_Exec=function(){};t["haxeshim.sys.Exec"]=haxeshim_sys_Exec;haxeshim_sys_Exec.__name__="haxeshim.sys.Exec";haxeshim_sys_Exec.die=function(e,t){if(t!=null){haxeshim_Logger.get().error(t)}process.exit(e);throw haxe_Exception.thrown("unreachable")};haxeshim_sys_Exec.dieFromErrors=function(e){var t=null;var r=haxeshim_Logger.get();var n=0;var i=e;while(n<i.length){var s=i[n];++n;r.error(haxeshim_PosTools.toString(s.pos)+(": "+s.message))}var t=haxeshim_Errors.getCode(e);process.exit(t);throw haxe_Exception.thrown("unreachable")};haxeshim_sys_Exec.gracefully=function(e){try{return e()}catch(e){var t=haxe_Exception.caught(e).unwrap();if(t instanceof tink_core_TypedError){var r=t;return haxeshim_sys_Exec.die(r.code,r.message)}else{var r=t;return haxeshim_sys_Exec.die(500,Std.string(r))}}};haxeshim_sys_Exec.mergeEnv=function(e){return x.mergeInto(e,x.ofVars(process.env))};haxeshim_sys_Exec.async=function(e,t,r,n){return a.spawn(e,r,{cwd:t,stdio:"inherit",env:x.toVars(haxeshim_sys_Exec.mergeEnv(n))})};haxeshim_sys_Exec.shell=function(e,t,r){try{return w.Success(a.execSync(e,{cwd:t,stdio:"inherit",env:x.toVars(haxeshim_sys_Exec.mergeEnv(r))}))}catch(t){var n=haxe_Exception.caught(t).unwrap();return w.Failure(new tink_core_TypedError(n.status,"Failed to invoke `"+e+"` because "+Std.string(n),{fileName:"haxeshim/sys/Exec.hx",lineNumber:47,className:"haxeshim.sys.Exec",methodName:"shell"}))}};haxeshim_sys_Exec.sync=function(e,t,r,n){var i=a.spawnSync(e,r,{cwd:t,stdio:"inherit",env:x.toVars(haxeshim_sys_Exec.mergeEnv(n))});var s=i.error;var l=i.output;var l=i.pid;var l=i.signal;var l=i.status;var o=i.stderr;var o=i.stdout;if(s==null){var u=l;return w.Success(u)}else{var c=s;var u=l;return w.Failure(new tink_core_TypedError(u,"Failed to call "+e+" because "+Std.string(c),{fileName:"haxeshim/sys/Exec.hx",lineNumber:54,className:"haxeshim.sys.Exec",methodName:"sync"}))}};haxeshim_sys_Exec.eval=function(e,t,r,n){var i=a.spawnSync(e,r,{cwd:t,env:x.toVars(haxeshim_sys_Exec.mergeEnv(n))});var s=i;if(s.error==null){return w.Success({status:s.status,stdout:s.stdout.toString(),stderr:s.stderr.toString()})}else{var l=i.output;var l=i.pid;var l=i.signal;var l=i.status;var l=i.stderr;var l=i.stdout;var o=i.error;return w.Failure(new tink_core_TypedError(null,"Failed to call "+e+" because "+Std.string(o),{fileName:"haxeshim/sys/Exec.hx",lineNumber:66,className:"haxeshim.sys.Exec",methodName:"eval"}))}};var b={};b.ofString=function(e){return haxe_io_Bytes.ofString(e)};var haxeshim_sys_Fs=function(){};t["haxeshim.sys.Fs"]=haxeshim_sys_Fs;haxeshim_sys_Fs.__name__="haxeshim.sys.Fs";haxeshim_sys_Fs.get=function(e,t){var r=e;return haxeshim_Attempt.to("get content of "+e,(function(){return g.readFileSync(r,{encoding:"utf8"})}),t)};haxeshim_sys_Fs.save=function(e,t,r){return X.noise(X.next(haxeshim_sys_Fs.ensureDir(e),(function(n){var i=e;var _g=function(e){var t=e.b;g.writeFileSync(i,O.from(t.buffer,t.byteOffset,e.length))};var s=t;var tmp=function(){_g(s)};return haxeshim_Attempt.to("save to "+e,tmp,r)})))};haxeshim_sys_Fs.exists=function(e){var t=e;return haxeshim_Attempt.to("check the existence of "+e,(function(){return sys_FileSystem.exists(t)}),{fileName:"haxeshim/sys/Fs.hx",lineNumber:23,className:"haxeshim.sys.Fs",methodName:"exists"})};haxeshim_sys_Fs.ensureDir=function(e){var t=StringTools.endsWith(e,"/")||StringTools.endsWith(e,"\\");if(t){e=haxe_io_Path.removeTrailingSlashes(e)}var r=haxe_io_Path.directory(e);if(haxe_io_Path.removeTrailingSlashes(r)==e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return X.next(X.next(haxeshim_sys_Fs.exists(r),(function(e){if(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return haxeshim_sys_Fs.ensureDir(haxe_io_Path.addTrailingSlash(r))}})),(function(r){if(t){return X.next(haxeshim_sys_Fs.exists(e),(function(t){return haxeshim_Attempt.to("create directory "+e,(function(){if(!t){sys_FileSystem.createDirectory(e)}return null}),{fileName:"haxeshim/sys/Fs.hx",lineNumber:46,className:"haxeshim.sys.Fs",methodName:"ensureDir"})}))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}}))}};haxeshim_sys_Fs.isDirectory=function(e){var t=e;return haxeshim_Attempt.to("check if "+e+" is a directory",(function(){return sys_FileSystem.isDirectory(t)}),{fileName:"haxeshim/sys/Fs.hx",lineNumber:57,className:"haxeshim.sys.Fs",methodName:"isDirectory"})};haxeshim_sys_Fs.move=function(e,t){return X.noise(X.next(haxeshim_sys_Fs.ensureDir(t),(function(r){var n=e;var _g=function(e){g.renameSync(n,e)};var i=t;var tmp=function(){_g(i)};return haxeshim_Attempt.to("move "+e+" to "+t,tmp,{fileName:"haxeshim/sys/Fs.hx",lineNumber:64,className:"haxeshim.sys.Fs",methodName:"move"})})))};haxeshim_sys_Fs.copy=function(e,t,r,n){var i=null;i=function(e,t,s){if(r==null||r(e)){return X.next(haxeshim_sys_Fs.isDirectory(e),(function(r){if(r){return X.next(haxeshim_sys_Fs.ensureDir(haxe_io_Path.addTrailingSlash(t)),(function(r){var n=[];var s=0;var a=g.readdirSync(e);while(s<a.length){var l=a[s];++s;n.push(i(""+e+"/"+l,""+t+"/"+l,false))}return X.noise(X.inParallel(n))}))}else{return X.next(X.next(s?haxeshim_sys_Fs.ensureDir(t):X.NOISE,(function(r){if(n==null||n({src:e,dest:t})){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(false)))}else{return haxeshim_sys_Fs.exists(t)}})),(function(r){if(r){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{var n=e;var i=t;var copy=function(){sys_io_File.copy(n,i)};return X.noise(haxeshim_Attempt.to("copy "+e+" to "+t,copy,{fileName:"haxeshim/sys/Fs.hx",lineNumber:89,className:"haxeshim.sys.Fs",methodName:"copy"}))}}))}}))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}};return i(e,t,true)};haxeshim_sys_Fs.ls=function(e,t){var r=[];var n=0;var i=g.readdirSync(e);while(n<i.length){var s=i[n];++n;var a=""+e+"/"+s;var l;if(t==null||t(a)){l=a}else{continue}r.push(l)}return r};haxeshim_sys_Fs.delete=function(e){return haxeshim_Attempt.to("delete "+e,(function(){if(e!=null&&sys_FileSystem.exists(e)){if(sys_FileSystem.isDirectory(e)){var t=0;var r=g.readdirSync(e);while(t<r.length){var n=r[t];++t;haxeshim_sys_Fs.delete(""+e+"/"+n)}if(sys_FileSystem.exists(e)){var t=0;var r=g.readdirSync(e);while(t<r.length){var n=r[t];++t;var i=e+"/"+n;if(sys_FileSystem.isDirectory(i)){if(sys_FileSystem.exists(i)){var s=0;var a=g.readdirSync(i);while(s<a.length){var l=a[s];++s;var o=i+"/"+l;if(sys_FileSystem.isDirectory(o)){sys_FileSystem.deleteDirectory(o)}else{g.unlinkSync(o)}}g.rmdirSync(i)}}else{g.unlinkSync(i)}}g.rmdirSync(e)}}else{g.unlinkSync(e)}}}),{fileName:"haxeshim/sys/Fs.hx",lineNumber:104,className:"haxeshim.sys.Fs",methodName:"delete"})};haxeshim_sys_Fs.peel=function(e,t){var r=0;var n=0;var i=t;while(n<i){var s=n++;var a=e.indexOf("/",r);if(a==-1){return u.None}else{var l=a;r=l+1}}return u.Some(HxOverrides.substr(e,r,null))};haxeshim_sys_Fs.findNearest=function(e,t){while(true)if(sys_FileSystem.exists(""+t+"/"+e)){return u.Some(""+t+"/"+e)}else{var r=haxe_io_Path.directory(t);var n=r;if(t==n){return u.None}else{var i=r;t=i}}};var y={};y.detect=function(e){var t=e;if(t.length>=5&&t.b[0]==127&&t.b[1]==69&&t.b[2]==76&&t.b[3]==70){var r=t.b[4];var n=t.b[18]|t.b[19]<<8;switch(n){case 3:if(r==1){return"linux32"}else{return"linux64"}break;case 40:return"linux-arm";case 62:return"linux64";case 183:return"linux-arm64";case 243:return"linux-riscv";default:if(r==1){return"linux32"}else{return"linux64"}}}if(t.length>=64){var i=t.getInt32(60);if(t.b[i++]==80&&t.b[i++]==69&&t.b[i++]==0&&t.b[i++]==0){var s=t.b[i++]|t.b[i++]<<8;switch(s){case 332:return"win32";case 34404:return"win64";default:return"unknown"}}}if(t.length>=4){var a=t.b[0]<<24|t.b[1]<<16|t.b[2]<<8|t.b[3];if(a==-17958193||a==-805638658){switch(t.b[4]<<24|t.b[5]<<16|t.b[6]<<8|t.b[7]){case 16777223:return"mac64";case 16777228:return"mac-arm";default:return"mac64"}}if(a==-17958194||a==-822415874){return"mac64"}if(a==-889275714||a==-1095041334){return"mac-universal"}}return"unknown"};var js_lib__$ArrayBuffer_ArrayBufferCompat=function(){};t["js.lib._ArrayBuffer.ArrayBufferCompat"]=js_lib__$ArrayBuffer_ArrayBufferCompat;js_lib__$ArrayBuffer_ArrayBufferCompat.__name__="js.lib._ArrayBuffer.ArrayBufferCompat";js_lib__$ArrayBuffer_ArrayBufferCompat.sliceImpl=function(e,t){var r=new Uint8Array(this,e,t==null?null:t-e);var n=new Uint8Array(r.byteLength);n.set(r);return n.buffer};var S=r(3685);var E=r(5687);var N=r(1808);var k=r(1017);var O=r(4300).Buffer;var js_node_buffer__$Buffer_Helper=function(){};t["js.node.buffer._Buffer.Helper"]=js_node_buffer__$Buffer_Helper;js_node_buffer__$Buffer_Helper.__name__="js.node.buffer._Buffer.Helper";js_node_buffer__$Buffer_Helper.bytesOfBuffer=function(e){var t=Object.create(haxe_io_Bytes.prototype);t.length=e.byteLength;t.b=e;e.bufferValue=e;e.hxBytes=t;e.bytes=e;return t};var R=r(2781).PassThrough;var C=r(7310).URL;var lix_cli_Cli=function(){};t["lix.cli.Cli"]=lix_cli_Cli;lix_cli_Cli.__name__="lix.cli.Cli";lix_cli_Cli.main=function(){var e=lix_cli_HaxeCmd.ensureScope();var t=process.argv.slice(2);lix_cli_Command.attempt(e,(function(){lix_cli_Cli.dispatch(t)}))};lix_cli_Cli.dispatch=function(e){var t="haxe";var r="lix";var n="lix - Libraries for Haxe";var i="git+https://github.com/lix-pm/lix.git";var s="git";var a="https://github.com/lix-pm/lix#readme";var l={"@vercel/ncc":"^0.38.1",yauzl:"github:lix-pm/yauzl",tar:"^6.0.1","graceful-fs":"^4.1.15"};var o="bin";var c="16.0.2";var h="back2dos";var d="node bin/postinstall.js";var v="ncc";var m="haxe --run Build";var p="MIT";var _="https://github.com/lix-pm/lix/issues";var x="bin/haxeshim.js";var y="bin/lix.js";var S="bin/haxelibshim.js";var E="bin/nekoshim.js";var N=c;var k=HxOverrides.remove(e,"--silent");var O=HxOverrides.remove(e,"--force");var R=HxOverrides.remove(e,"--global")||HxOverrides.remove(e,"-g");var C=HxOverrides.remove(e,"--flat");var F=haxeshim_scope_Scope.seek({cwd:R?haxeshim_scope_Scope.DEFAULT_ROOT:null});e=lix_cli_Command.expand(e,[A.ofString("+tink install github:haxetink/tink_${0}"),A.ofString("+coco install github:MVCoconut/coconut.${0}"),A.ofString("+lib install haxelib:${0}")]);var grab=function(t){var r=e.indexOf(t);if(r==-1){return null}else{var n=r;return e.splice(n,2)[1]}};var L=new lix_client_sources_GitLab(grab("--gl-private-token"));var D=grab("--gh-credentials");var T;var B;if(D==null){B=null}else{T=D.split(":");if(T.length==2){var P=T[0];var M=T[1];B=""+P+":"+M}else{var z=D;B=haxeshim_sys_Exec.die(422,"`--gh-credentials "+z+"` should be `--gh-credentials <user>:<token>`")}}var U=new lix_client_sources_GitHub(B);var W=ne._new(grab("--haxelib-url"));var V=new lix_client_sources_Web([$bind(L,L.intercept),$bind(U,U.intercept)]);var $=[V,new lix_client_sources_Haxelib(W),U,L,new lix_client_sources_Git(F)];var q=Object.create(null);var D=0;while(D<$.length){var Z=$[D];++D;var K=0;var J=Z.schemes();while(K<J.length){var Q=J[K];++K;q[Q]=Z}}var resolve=function(e){var t=q[e.scheme];if(t==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Unknown scheme in url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/cli/Cli.hx",lineNumber:52,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{var r=t;return r.processUrl(e)}};var ee=haxeshim_Logger.get(k);var te=new lix_client_haxe_Switcher(F,ee);var re=new lix_client_Libraries(F,resolve,(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(501,"not implemented",{fileName:"src/lix/cli/Cli.hx",lineNumber:63,className:"lix.cli.Cli",methodName:"dispatch"}))))}),ee,O);lix_cli_Command.dispatch(e,"lix - Libraries for Haxe (v"+N+")",[new lix_cli_Command(I.ofString("install"),"<url> [as <lib[#ver]>]","install lib from specified url",(function(e){if(F.isGlobal&&!R){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Current scope is global. Please use --global if you intend to install globally, or create a local scope with `lix scope create`.",{fileName:"src/lix/cli/Cli.hx",lineNumber:73,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{switch(e.length){case 0:return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Missing url",{fileName:"src/lix/cli/Cli.hx",lineNumber:84,className:"lix.cli.Cli",methodName:"dispatch"}))));case 1:var t=e[0];var r=t;if(G.fromString(r).scheme==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Did you mean `lix install haxelib:"+r+"`?",{fileName:"src/lix/cli/Cli.hx",lineNumber:81,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{var n=t;return re.installUrl(G.fromString(n),null,{flat:C})}break;case 2:var t=e[0];if(t=="haxe"){var i=e[1];return te.install(i,{force:O})}else{var r=t;if(G.fromString(r).scheme==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Did you mean `lix install haxelib:"+r+"`?",{fileName:"src/lix/cli/Cli.hx",lineNumber:81,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{var s=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:85,className:"lix.cli.Cli",methodName:"dispatch"}))))}}break;case 3:if(e[1]=="as"){var n=e[0];var a=e[2];return re.installUrl(G.fromString(n),lix_client_LibVersion.parse(a),{flat:C})}else{var s=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:85,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;default:var s=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:85,className:"lix.cli.Cli",methodName:"dispatch"}))))}}})),new lix_cli_Command(I.ofString("install haxe"),"<version>|<alias>","install specified haxe version",null),new lix_cli_Command(I.ofString("use"),"haxe <version>|<alias>","use specified haxe version",(function(e){if(e.length==2){if(e[0]=="haxe"){var t=e[1];return X.next(te.resolveInstalled(j.ofString(t)),$bind(te,te.switchTo))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:91,className:"lix.cli.Cli",methodName:"dispatch"}))))}}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:91,className:"lix.cli.Cli",methodName:"dispatch"}))))}})),new lix_cli_Command(I.ofString("dev"),"<lib> <path>","use dev version of library",(function(e){if(e.length==2){var t=e[0];var r=e[1];return re.dev(t,r)}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:95,className:"lix.cli.Cli",methodName:"dispatch"}))))}})),new lix_cli_Command(I.ofString("download haxe"),"<version>|<alias>","download specified haxe version",null),new lix_cli_Command(I.ofString("scope"),"[create|delete]","creates or deletes the current scope or\ninspects it if no argument is supplied",(function(e){switch(e.length){case 0:ee.info((F.isGlobal?"[global]":"[local]")+(" "+F.scopeDir));return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)));case 1:switch(e[0]){case"create":return X.next(haxeshim_scope_Scope.create(F.cwd,{version:F.config.version,resolveLibs:F.isGlobal?"scoped":F.config.resolveLibs}),(function(e){ee.success("created scope in "+F.cwd);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}));case"delete":if(F.isGlobal){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Cannot delete global scope",{fileName:"src/lix/cli/Cli.hx",lineNumber:110,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{F.delete();ee.success("deleted scope in "+F.scopeDir);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}break;default:var t=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Invalid arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:122,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;default:var t=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Invalid arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:122,className:"lix.cli.Cli",methodName:"dispatch"}))))}})),new lix_cli_Command(I.ofString("haxe-versions"),"","lists currently downloaded versions",(function(e){if(e.length==0){return X.next(te.officialInstalled(H.IncludePrereleases),(function(e){return X.next(te.nightliesInstalled(),(function(t){var highlight=function(e){if(e==F.config.version){return" -> "+e}else{return" "+e}};process.stdout.write("");process.stdout.write("\n");process.stdout.write("Official releases:");process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var r=$getIterator(e);while(r.hasNext()){var n=r.next();var i=highlight(n);process.stdout.write(Std.string(i));process.stdout.write("\n")}if($getIterator(t).hasNext()){process.stdout.write("");process.stdout.write("\n");process.stdout.write("Nightly builds:");process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var r=$getIterator(t);while(r.hasNext()){var n=r.next();var i=highlight(n.hash)+DateTools.format(n.published," (%Y-%m-%d %H:%M)");process.stdout.write(Std.string(i));process.stdout.write("\n")}}process.stdout.write("");process.stdout.write("\n");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}))}))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"command `list` does expect arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:159,className:"lix.cli.Cli",methodName:"dispatch"}))))}})),new lix_cli_Command(I.ofString("download"),"[<url[#lib[#ver]]>]","download lib from url if specified,\notherwise download missing libs",(function(e){switch(e.length){case 0:return X.next(lix_client_haxe_Switcher.ensureNeko(F.haxeInstallation.neko,ee),(function(e){var t=te.resolveOnline(j.ofString(F.config.version));var r=te;var n={force:false};return X.next(X.next(t,(function(e){return r.download(e,n)})),(function(e){new haxeshim_cli_HaxeCli(F).installLibs(k);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}))}));case 1:var t=G.fromString(e[0]);return X.noise(re.downloadUrl(t));case 2:if(e[0]=="haxe"){var r=e[1];return X.noise(te.resolveAndDownload(r,{force:O}))}else{var n=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:205,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;case 3:var i=e[0];var s=e[2];switch(e[1]){case"as":var t=i;var a=s;var l=StringTools.replace(a,"#","/");var o=F.libCache+("/"+l);var shorten=function(e){if(e.length>40){return HxOverrides.substr(e,0,37)+"..."}else{return e}};if(sys_FileSystem.exists(o)){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"`download <url> as <ver>` is no longer supported",{fileName:"src/lix/cli/Cli.hx",lineNumber:175,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{var u=ee;var c=shorten;var h=new Array(e.length);var d=0;var v=e.length;while(d<v){var m=d++;h[m]=c(e[m])}u.warning("Warning: Processing obsolete `download "+h.join(" ")+"`.\n Please reinstall library in a timely manner!\n\n");return X.noise(X.next(X.next(re.downloadUrl(G.fromString(t),{into:l}),(function(e){var t=e;return X.next(haxeshim_sys_Fs.ensureDir(o),(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t)))}))})),(function(e){g.renameSync(lix_client_DownloadedArchive.getAbsRoot(e.storageRoot,e.relRoot),o);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e)))})))}break;case"into":var t=i;var p=s;return X.noise(re.downloadUrl(G.fromString(t),{into:p}));default:var n=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:205,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;default:var n=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:205,className:"lix.cli.Cli",methodName:"dispatch"}))))}})),new lix_cli_Command(I.ofString("run"),"lib ...args","run a library",(function(e){if(e.length==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"no library specified",{fileName:"src/lix/cli/Cli.hx",lineNumber:209,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{var t=e;return X.noise(X.next(F.getLibCommand(t),(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(e()))})))}})),new lix_cli_Command(["--version","-v"],"","print version",(function(e){if(e.length>0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"too many arguments",{fileName:"src/lix/cli/Cli.hx",lineNumber:215,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{process.stdout.write(Std.string(N));process.stdout.write("\n");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}})),new lix_cli_Command(I.ofString("run-haxelib"),"path ...args","invoke a haxelib at a given path following haxelib's conventions",(function(e){if(e.length==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"no path supplied",{fileName:"src/lix/cli/Cli.hx",lineNumber:223,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{new haxeshim_cli_HaxelibCli(F).run(e.slice(1));return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}}))],[],(function(e){var t=e[0];var r;if(t==null){return u.None}else{switch(t){case"--library":case"--run":case"-L":case"-lib":return u.Some((function(){new haxeshim_cli_HaxeCli(F).dispatch(e);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}));default:r=StringTools.endsWith(t,".hxml");if(r==true){return u.Some((function(){new haxeshim_cli_HaxeCli(F).dispatch(e);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}))}else{var n=t;if(sys_FileSystem.exists(F.libHxml(n))){return u.Some((function(){new haxeshim_cli_HaxelibCli(F).run(e);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}))}else{var i=t;if(lix_cli_Cli.isClassName(i)){return u.Some((function(){var absolute=function(e){return haxe_io_Path.join([F.scopeDir,e])};var f=function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst({classPath:"",name:haxe_io_Path.withoutDirectory(haxe_io_Path.removeTrailingSlashes(F.scopeDir)),dependencies:{}}))};return Y.flatMap(Y.flatMap(X.next(haxeshim_sys_Fs.get(absolute("haxelib.json"),{fileName:"src/lix/cli/Cli.hx",lineNumber:247,className:"lix.cli.Cli",methodName:"dispatch"}),(function(e){var t=e;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(tink_core_TypedError.catchExceptions((function(){return JSON.parse(t)}),null,{fileName:"src/lix/cli/Cli.hx",lineNumber:248,className:"lix.cli.Cli",methodName:"dispatch"})))})),(function(e){switch(e._hx_index){case 0:var t=e.data;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(t));case 1:var r=e.failure;return f(r)}})),(function(t){var r=StringTools.replace(i,".","/")+".hx";var n=[{file:r,args:["-cp",absolute("")]},{file:"scripts/"+r,args:["-cp",absolute("scripts")]}];var s=t.classPath;if(s!=null){if(s!=""){var a=s;var l=""+a+"/"+r;var o;if(sys_FileSystem.exists(F.libHxml(t.name))){o=["-lib",t.name]}else{var u=[];var s=t.dependencies;if(s!=null){var c=s;var h=c;var d=h;var v=Reflect.fields(h);var m=0;while(m<v.length){var p=v[m++];var _=d[p];var g=p;var x=g;var y=_;u.push("-lib");u.push(x)}}o=u.concat(["-cp",absolute(a)])}n.push({file:l,args:o})}}var s=0;while(s<n.length){var S=[n[s]];++s;var E=haxe_io_Path.join([F.scopeDir,S[0].file]);if(sys_FileSystem.exists(E)!=false){var N=[E];return X.next(haxeshim_sys_Fs.get(N[0],{fileName:"src/lix/cli/Cli.hx",lineNumber:290,className:"lix.cli.Cli",methodName:"dispatch"}),function(t,r){return function(n){var s=[];var a=n.split("\n");var l=0;if(StringTools.startsWith(a[0],"#!")){++l}while(true){var o=StringTools.trim(a[l++]);if(o!=""){var n=o;if(StringTools.startsWith(n,"//!")){var u=0;var c=HxOverrides.substr(n,3,null).split(" ");while(u<c.length){var h=c[u];++u;var d=StringTools.trim(h);if(d!=""){var v=d;s.push(v)}}}else{break}}}s=s.concat(r[0].args);var m=e.slice(1);var o=F.getBuilds(s);switch(o._hx_index){case 0:var u=o.data;if(u.length==1){var c=u[0];switch(c._hx_index){case 0:var u=c.data;var p=u.checkClassPaths();if(p._hx_index==1){var d=p.failure;var _=d.result;var g=d.errors;var x=g[0];return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(x.code,haxeshim_PosTools.toString(x.pos)+": "+x.message,{fileName:"src/lix/cli/Cli.hx",lineNumber:320,className:"lix.cli.Cli",methodName:"dispatch"}))))}else{var y=u.cwd;var S=u.args;var u=[];var d=0;var _=S;while(d<_.length){var E=_[d];++d;u.push(E.val)}var S=u;var N=null;var u=0;var d=S.length-1;e:while(u<d){var k=u++;switch(S[k]){case"--define":case"-D":var _=S[k+1];var p;if(_=="hxnodejs"){var O=S.indexOf("-js");if(O==-1){var R=haxe_io_Path.withExtension(haxe_io_Path.withoutExtension(t[0]),"js");S=S.concat(["-js",R]);N=R}else{var h=O;N=S[h+1]}break e}else{p=StringTools.startsWith(_,"hxnodejs=");if(p==true){var C=S.indexOf("-js");if(C==-1){var A=haxe_io_Path.withExtension(haxe_io_Path.withoutExtension(t[0]),"js");S=S.concat(["-js",A]);N=A}else{var v=C;N=S[v+1]}break e}}break;default:}}S=S.concat(N==null?["--run",i].concat(m):["-main",i]);var u=haxeshim_sys_Exec.sync(F.haxeInstallation.compiler,y,S,F.haxeInstallation.env);switch(u._hx_index){case 0:var d=u.data;if(d==0){if(N==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return X.next(X.next(haxeshim_sys_Fs.get(N,{fileName:"src/lix/cli/Cli.hx",lineNumber:354,className:"lix.cli.Cli",methodName:"dispatch"}),function(){return function(e){return haxeshim_sys_Fs.save(N,b.ofString(['try { require("fs").unlinkSync(__filename); } catch (e) {}',e].join("\n")),{fileName:"src/lix/cli/Cli.hx",lineNumber:356,className:"lix.cli.Cli",methodName:"dispatch"})}}()),function(){return function(e){var t=haxeshim_sys_Exec.sync("node",y,[N].concat(m));switch(t._hx_index){case 0:var r=t.data;if(r==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{var n=r;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(n,"node exited with code "+n,{fileName:"src/lix/cli/Cli.hx",lineNumber:364,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;case 1:var i=t.failure;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(i)))}}}())}}else{var h=d;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(h,"haxe exited with code "+h,{fileName:"src/lix/cli/Cli.hx",lineNumber:369,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;case 1:var x=u.failure;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(x)))}}break;case 1:var u=c.failure;var c=u.result;var g=u.errors;var x=g[0];return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(x.code,haxeshim_PosTools.toString(x.pos)+": "+x.message,{fileName:"src/lix/cli/Cli.hx",lineNumber:320,className:"lix.cli.Cli",methodName:"dispatch"}))))}}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"multiple builds defined",{fileName:"src/lix/cli/Cli.hx",lineNumber:373,className:"lix.cli.Cli",methodName:"dispatch"}))))}break;case 1:var u=o.failure;var o=u.result;var g=u.errors;var x=g[0];return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(x.code,haxeshim_PosTools.toString(x.pos)+": "+x.message,{fileName:"src/lix/cli/Cli.hx",lineNumber:320,className:"lix.cli.Cli",methodName:"dispatch"}))))}}}(N,S))}}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(404,"Class not found: "+i,{fileName:"src/lix/cli/Cli.hx",lineNumber:380,className:"lix.cli.Cli",methodName:"dispatch"}))))}))}))}else{return u.None}}}}}})).handle(lix_cli_Command.reportOutcome)};lix_cli_Cli.isClassName=function(e){var t=HxOverrides.cca(e.split(".").pop(),0);if(t>=65){return t<=90}else{return false}};var A={};A.ofString=function(e){var t=e.indexOf(" ");if(t==-1){throw haxe_Exception.thrown('invalid expander syntax in "'+e+'"')}else{var r=t;return A.make(HxOverrides.substr(e,0,r),HxOverrides.substr(e,r+1,null))}};A.make=function(e,t){var r=new EReg("\\$\\{([0-9]+)\\}","g");var n=[];var i=-1;r.map(t,(function(e){n.pop();var t=e.matchedLeft();var r=e.matchedRight();n.push((function(e){return t}));var s=Std.parseInt(e.matched(1));if(s>i){i=s}n.push((function(e){return e[s]}));n.push((function(e){return r}));return""}));var apply=function(e){var t=[];var r=0;var i=[];var s=0;while(s<n.length){var a=n[s];++s;i.push(a(e))}var s=i.join("").split(" ");while(r<s.length){var l=s[r];++r;var i=StringTools.trim(l);var o;if(i==""){continue}else{var u=i;o=u}t.push(o)}return t};return function(t){var r=0;var n=t.length;while(r<n){var s=r++;if(t[s]==e){return u.Some(t.slice(0,s).concat(apply(t.slice(s+1,s+i+2))).concat(t.slice(s+i+2)))}}return u.None}};var I={};I.ofString=function(e){return[e]};I.toString=function(e){if(e.length==1){var t=e[0];return t}else{var r=e;return r.join(" / ")}};I.eq=function(e,t){return e.indexOf(t)!=-1};var lix_cli_Command=function(e,t,r,n){this.name=e;this.args=t;this.doc=r;this.exec=n};t["lix.cli.Command"]=lix_cli_Command;lix_cli_Command.__name__="lix.cli.Command";lix_cli_Command.attempt=function(e,t){var r=J.ofSync(lix_cli_Command.reportError);Y.flatMap(e,(function(e){switch(e._hx_index){case 0:var t=e.data;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(t));case 1:var n=e.failure;return r(n)}})).handle(t)};lix_cli_Command.reportError=function(e){haxeshim_Logger.get().error(e.message);var t=e.code;process.exit(t);return null};lix_cli_Command.reportOutcome=function(e){if(e._hx_index==1){var t=e.failure;lix_cli_Command.reportError(t)}};lix_cli_Command.expand=function(e,t){var r=true;while(r){r=false;var n=0;while(n<t.length){var i=t[n];++n;var s=i(e);if(s._hx_index==0){var a=s.v;e=a;r=true}}}return e};lix_cli_Command.dispatch=function(e,t,r,n,i){var s=e.shift();if(s==null){process.stdout.write(Std.string(t));process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var a=0;var l=0;while(l<r.length){var o=r[l];++l;var u=0;var c=0;var h=o.args.split("\n");while(c<h.length){var d=h[c];++c;if(d.length>u){u=d.length}}var v=u;var m=I.toString(o.name).length+v;if(m>a){a=m}}a+=7;var pad=function(e){return StringTools.lpad(e," ",a)};process.stdout.write(" Supported commands:");process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var l=0;while(l<r.length){var o=r[l];++l;var p=o.args.split("\n");var _=o.name==null?"null":I.toString(o.name);var c=p[0];var g;if(c==null){g=""}else if(c==""){g=""}else{var u=c;g=" "+u}p[0]=" "+_+g+" : ";var h=1;var x=p.length;while(h<x){var b=h++;p[b]+=" "}var y=o.doc.split("\n");while(p.length<y.length)p.push("");while(p.length>y.length)y.push("");var S=0;var E=p.length;while(S<E){var N=S++;var k=pad(p[N])+y[N];process.stdout.write(Std.string(k));process.stdout.write("\n")}}var l=0;while(l<n.length){var O=n[l];++l;process.stdout.write("");process.stdout.write("\n");var u=" "+O.name;process.stdout.write(Std.string(u));process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var c=0;var h=O.value;while(c<h.length){var R=h[c];++c;var k=pad(""+R.name+" : ")+R.value;process.stdout.write(Std.string(k));process.stdout.write("\n")}}process.stdout.write("");process.stdout.write("\n");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{switch(s){case"--help":case"-help":case"/?":case"?":case"help":process.stdout.write(Std.string(t));process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var C=0;var l=0;while(l<r.length){var o=r[l];++l;var u=0;var c=0;var h=o.args.split("\n");while(c<h.length){var d=h[c];++c;if(d.length>u){u=d.length}}var v=u;var m=I.toString(o.name).length+v;if(m>C){C=m}}C+=7;var pad1=function(e){return StringTools.lpad(e," ",C)};process.stdout.write(" Supported commands:");process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var l=0;while(l<r.length){var o=r[l];++l;var p=o.args.split("\n");var _=o.name==null?"null":I.toString(o.name);var c=p[0];var g;if(c==null){g=""}else if(c==""){g=""}else{var u=c;g=" "+u}p[0]=" "+_+g+" : ";var h=1;var x=p.length;while(h<x){var b=h++;p[b]+=" "}var y=o.doc.split("\n");while(p.length<y.length)p.push("");while(p.length>y.length)y.push("");var S=0;var E=p.length;while(S<E){var N=S++;var k=pad1(p[N])+y[N];process.stdout.write(Std.string(k));process.stdout.write("\n")}}var l=0;while(l<n.length){var O=n[l];++l;process.stdout.write("");process.stdout.write("\n");var u=" "+O.name;process.stdout.write(Std.string(u));process.stdout.write("\n");process.stdout.write("");process.stdout.write("\n");var c=0;var h=O.value;while(c<h.length){var R=h[c];++c;var k=pad1(""+R.name+" : ")+R.value;process.stdout.write(Std.string(k));process.stdout.write("\n")}}process.stdout.write("");process.stdout.write("\n");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)));default:var A=s;var s=0;while(s<r.length){var F=r[s];++s;if(I.eq(F.name,A)){return F.exec(e)}}if(i!=null){e.unshift(A);var s=i(e);if(s._hx_index==0){var u=s.v;return u()}}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(404,"Unknown command "+A+". Try `lix help`.",{fileName:"src/lix/cli/Command.hx",lineNumber:201,className:"lix.cli.Command",methodName:"dispatch"}))))}}};lix_cli_Command.prototype={__class__:lix_cli_Command};var lix_cli_HaxeCmd=function(){};t["lix.cli.HaxeCmd"]=lix_cli_HaxeCmd;lix_cli_HaxeCmd.__name__="lix.cli.HaxeCmd";lix_cli_HaxeCmd.ensureScope=function(){if(haxeshim_scope_Scope.exists(haxeshim_scope_Scope.DEFAULT_ROOT)){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return haxeshim_scope_Scope.create(haxeshim_scope_Scope.DEFAULT_ROOT,{version:"stable",resolveLibs:"mixed"})}};var F=n["lix.client.ArchiveKind"]={__ename__:"lix.client.ArchiveKind",__constructs__:null,Zip:{_hx_name:"Zip",_hx_index:0,__enum__:"lix.client.ArchiveKind",toString:$estr},Tar:{_hx_name:"Tar",_hx_index:1,__enum__:"lix.client.ArchiveKind",toString:$estr},Custom:(i=function(e){return{_hx_index:2,load:e,__enum__:"lix.client.ArchiveKind",toString:$estr}},i._hx_name="Custom",i.__params__=["load"],i)};F.__constructs__=[F.Zip,F.Tar,F.Custom];var L=n["lix.client.ArchiveDestination"]={__ename__:"lix.client.ArchiveDestination",__constructs__:null,Fixed:(i=function(e){return{_hx_index:0,path:e,__enum__:"lix.client.ArchiveDestination",toString:$estr}},i._hx_name="Fixed",i.__params__=["path"],i),Computed:(i=function(e){return{_hx_index:1,f:e,__enum__:"lix.client.ArchiveDestination",toString:$estr}},i._hx_name="Computed",i.__params__=["f"],i)};L.__constructs__=[L.Fixed,L.Computed];var D=n["lix.client.ArchiveDependency"]={__ename__:"lix.client.ArchiveDependency",__constructs__:null,FromUrl:(i=function(e){return{_hx_index:0,u:e,__enum__:"lix.client.ArchiveDependency",toString:$estr}},i._hx_name="FromUrl",i.__params__=["u"],i),FromHxml:(i=function(e){return{_hx_index:1,path:e,__enum__:"lix.client.ArchiveDependency",toString:$estr}},i._hx_name="FromHxml",i.__params__=["path"],i)};D.__constructs__=[D.FromUrl,D.FromHxml];var lix_client_ArchiveInfos=function(e,t,r,n,i,s,a,l,o){this.name=e;this.version=t;this.classPath=r;this.hasNdll=n;this.runAs=i;this.dependencies=s;this.haxeshimDependencies=a;this.postDownload=l;this.postInstall=o};t["lix.client.ArchiveInfos"]=lix_client_ArchiveInfos;lix_client_ArchiveInfos.__name__="lix.client.ArchiveInfos";lix_client_ArchiveInfos.prototype={__class__:lix_client_ArchiveInfos};var T={};T.keyValueIterator=function(e){if(e==null){return new haxe_iterators_ArrayIterator([])}else{var t=e;return new haxe_ds__$StringMap_StringMapKeyValueIterator(t.h)}};var B={};B.ofHaxeshim=function(e){var t=[];var r=$keyValueIterator(T)(e);while(r.hasNext()){var n=r.next();var i=n.key;var s=n.value;t.push(new tink_core_NamedWith(i,D.FromHxml(s)))}var a=t;a.sort((function(e,t){return Reflect.compare(e.name,t.name)}));return a};B.ofMap=function(e){var t=[];var r=e.h;var n=r;var i=Object.keys(r);var s=i.length;var a=0;while(a<s){var l=i[a++];var o=l;var u=n[l];var c=o;var h=u;t.push(new tink_core_NamedWith(c,h))}var d=t;d.sort((function(e,t){return Reflect.compare(e.name,t.name)}));return d};var lix_client_DownloadedArchive=function(e,t,r,n){this.alreadyDownloaded=true;this.storageRoot=t;this.relRoot=e;this.job=r;this.infos=n};t["lix.client.DownloadedArchive"]=lix_client_DownloadedArchive;lix_client_DownloadedArchive.__name__="lix.client.DownloadedArchive";lix_client_DownloadedArchive.getAbsRoot=function(e,t){return haxe_io_Path.removeTrailingSlashes(""+e+"/"+t)};lix_client_DownloadedArchive.escape=function(e){if(e==null){return null}var t=0;var r=lix_client_DownloadedArchive.RESERVED.length;while(t<r){var n=t++;e=StringTools.replace(e,lix_client_DownloadedArchive.RESERVED.charAt(n),"_")}return e};lix_client_DownloadedArchive.path=function(e){var t=lix_client_DownloadedArchive.escape;var r=new Array(e.length);var n=0;var i=e.length;while(n<i){var s=n++;r[s]=t(e[s])}return r.join("/")};lix_client_DownloadedArchive.fresh=function(e,t,r,n){var i=""+e+"/"+lix_client_DownloadedArchive.seekRoot(e);return X.next(lix_client_DownloadedArchive.readInfos(i,n.lib),(function(s){var a;if(r==null){var l=n.dest;var o;switch(l._hx_index){case 0:var u=l.path;o=u;break;case 1:var c=l.f;o=c(s);break}a=lix_client_DownloadedArchive.path(o)}else{a=r}var h=new lix_client_DownloadedArchive(a,t,n,s);h.alreadyDownloaded=false;var d=lix_client_DownloadedArchive.getAbsRoot(h.storageRoot,h.relRoot);if(s.haxeshimDependencies!=null){var v=haxe_io_Path.removeTrailingSlashes(i).length;var l=s.name;var m=s.version;var p=s.classPath;var _=s.hasNdll;var g=s.runAs;var x=s.dependencies;var b=new haxe_ds_StringMap;var y=$keyValueIterator(T)(s.haxeshimDependencies);while(y.hasNext()){var S=y.next();var E=S.key;var u=S.value;b.h[E]=d+HxOverrides.substr(u,v,null)}var N=new lix_client_ArchiveInfos(l,m,p,_,g,x,b,s.postDownload,s.postInstall);h.infos=N}var k=null;var O=lix_client_DownloadedArchive.getAbsRoot(h.storageRoot,h.relRoot);var R=X.next(X.next(X.next(X.next(haxeshim_sys_Fs.exists(O),(function(e){if(e){var t=O;k=""+O+"-archived@"+(new Date).getTime();return haxeshim_sys_Fs.move(t,k)}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}})),(function(e){return haxeshim_sys_Fs.move(i,lix_client_DownloadedArchive.getAbsRoot(h.storageRoot,h.relRoot))})),(function(e){return haxeshim_sys_Fs.delete(k)})),(function(t){return haxeshim_sys_Fs.delete(e)}));var C=h;return X.next(R,(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(C)))}))}))};lix_client_DownloadedArchive.existent=function(e,t,r){return X.next(lix_client_DownloadedArchive.readInfos(lix_client_DownloadedArchive.getAbsRoot(t,e),r.lib),(function(n){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(new lix_client_DownloadedArchive(e,t,r,n))))}))};lix_client_DownloadedArchive.seekRoot=function(e){var t=g.readdirSync(e);if(t.length==1){var r=t[0];if(sys_FileSystem.isDirectory(""+e+"/"+r)){return""+r+"/"+lix_client_DownloadedArchive.seekRoot(""+e+"/"+r)}else{return""}}else{return""}};lix_client_DownloadedArchive.readInfos=function(e,t){var r=g.readdirSync(e);var guessClassPath=function(){if(r.indexOf("src")!=-1){return"src"}else if(r.indexOf("Sources")!=-1){return"Sources"}else if(r.indexOf("hx")!=-1){return"hx"}else{return""}};if(t==null){t=lix_client_LibVersion.UNDEFINED}var n;if(r.indexOf(".haxerc")!=-1&&r.indexOf("haxe_libraries")!=-1){var i=""+e+"/haxe_libraries";var s=new haxe_ds_StringMap;var a=0;var l=g.readdirSync(i);while(a<l.length){var o=l[a];++a;if(haxe_io_Path.extension(o)=="hxml"){var c=haxe_io_Path.withoutExtension(o);s.h[c]=""+i+"/"+o}}n=s}else{n=null}var h=r.indexOf("ndll")!=-1;var d;if(r.indexOf("haxelib.json")!=-1){var v=JSON.parse(g.readFileSync(""+e+"/haxelib.json",{encoding:"utf8"}));var s=v.name;var a=v.version;var l;var m=v.classPath;if(m==null){l=""}else{var p=m;l=p}var m=v.dependencies;var x;if(m==null){x=B.ofMap(new haxe_ds_StringMap)}else{var b=m;var m=new haxe_ds_StringMap;var y=b;var S=y;var E=Reflect.fields(y);var N=0;while(N<E.length){var c=E[N++];var k=S[c];var O=c;var R=O;var C=k;var A;var I;var F;switch(C){case"":case"*":F=G.fromString("haxelib:"+R);break;default:I=G.fromString(C).scheme;if(I==null){var L=C;F=G.fromString("haxelib:"+R+"#"+L)}else{A=G.fromString(C);var T=A.auth;var P=A.hash;var M=A.host;var z=A.hosts;var U=A.path;var H=A.payload;var j=A.query;var W=A.scheme;var V=A.query==null?A.path:(A.path==null?"null":A.path)+"?"+(A.query==null?"null":A.query);if(W==null){var $=C;F=G.fromString($)}else if(W=="git"){if(j==null){var q=G.fromString(H);var Y=q.auth;var Z=q.hash;var X=q.host;var K=q.hosts;var J=q.path;var Q=q.payload;var ee=q.query;var te=q.scheme;var re=q.query==null?q.path:(q.path==null?"null":q.path)+"?"+(q.query==null?"null":q.query);if(X==null){var ie=C;F=G.fromString(ie)}else{var se=ne.get_name(X);var ae=ne.get_port(X);if(se==null){var le=C;F=G.fromString(le)}else{switch(se){case"github.com":case"gitlab.com":if(te==null){var oe=C;F=G.fromString(oe)}else if(te=="https"){var ue=q;F=ue}else{var ce=C;F=G.fromString(ce)}break;default:var he=C;F=G.fromString(he)}}}}else{var fe=G.fromString(H);var de=fe.auth;var ve=fe.hash;var me=fe.host;var pe=fe.hosts;var _e=fe.path;var ge=fe.payload;var we=fe.query;var xe=fe.scheme;var be=fe.query==null?fe.path:(fe.path==null?"null":fe.path)+"?"+(fe.query==null?"null":fe.query);if(me==null){var ye=C;F=G.fromString(ye)}else{var Se=ne.get_name(me);var Ee=ne.get_port(me);if(Se==null){var Ne=C;F=G.fromString(Ne)}else{switch(Se){case"github.com":case"gitlab.com":if(xe==null){var ke=C;F=G.fromString(ke)}else if(xe=="https"){var Oe=fe;F=Oe}else{var Re=C;F=G.fromString(Re)}break;default:var Ce=C;F=G.fromString(Ce)}}}}}else{var Ae=C;F=G.fromString(Ae)}}}m.h[R]=D.FromUrl(F)}x=B.ofMap(m)}d=new lix_client_ArchiveInfos(s,a,l,h,(function(e){if(sys_FileSystem.exists(""+e.libRoot+"/run.n")||v.main!=null){return u.Some("haxelib run-dir "+v.name+' "$'+'{DOWNLOAD_LOCATION}"')}else{return u.None}}),x,n,v.postDownload,v.postInstall)}else if(r.indexOf("package.json")!=-1){var Ie=JSON.parse(g.readFileSync(""+e+"/package.json",{encoding:"utf8"}));d=new lix_client_ArchiveInfos(Ie.name,Ie.version,guessClassPath(),h,(function(e){return u.None}),B.ofHaxeshim(n),null,null,null)}else{var Fe=t.name;var Le=new tink_core__$Lazy_LazyConst("untitled");var s;if(Fe._hx_index==0){var p=Fe.v;s=p}else{s=_.get(Le)}var Fe=t.version;var Le=new tink_core__$Lazy_LazyConst("0.0.0");var a;if(Fe._hx_index==0){var p=Fe.v;a=p}else{a=_.get(Le)}d=new lix_client_ArchiveInfos(s,a,guessClassPath(),h,(function(e){return u.None}),B.ofHaxeshim(n),null,null,null)}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(d)))};lix_client_DownloadedArchive.prototype={__class__:lix_client_DownloadedArchive};var P=r(8781);var lix_client_Download=function(){};t["lix.client.Download"]=lix_client_Download;lix_client_Download.__name__="lix.client.Download";lix_client_Download.text=function(e){return X.next(lix_client_Download.bytes(e),(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e.toString())))}))};lix_client_Download.bytes=function(e){return lix_client_Download.download(e,(function(e,t,r){lix_client_Download.buffered(t).handle(r)}))};lix_client_Download.buffered=function(e){return Y.async((function(t){var r=[];e.on("data",$bind(r,$arrayPush));e.on("end",(function(){t(w.Success(js_node_buffer__$Buffer_Helper.bytesOfBuffer(O.concat(r))))}))}))};lix_client_Download.archive=function(e,t,r,n){return lix_client_Download.download(e,lix_client_Download.withLogger(n,(function(n,i,s){if(i.headers["content-type"]=="application/zip"||StringTools.endsWith(e,".zip")||StringTools.endsWith(n,".zip")){lix_client_Download.unzip(e,r,t,i,s)}else{lix_client_Download.untar(e,r,t,i,s)}})))};lix_client_Download.unzip=function(e,t,n,i,s){X.next(lix_client_Download.buffered(i),(function(i){return Y.async((function(a){var l=i.length-4;while(l-- >0)if(i.b[l]==80&&i.b[l+1]==75&&i.b[l+2]==5&&i.b[l+3]==6){i.b[l+20]=0;i.b[l+21]=0;i=i.sub(0,l+22);break}if(l==0){a(w.Failure(new tink_core_TypedError(422,"Unzip failed to find central directory in "+e,{fileName:"src/lix/client/Download.hx",lineNumber:65,className:"lix.client.Download",methodName:"unzip"})));return}var o=i.b;P.fromBuffer(O.from(o.buffer,o.byteOffset,i.length),(function(i,l){var o=-1;var done=function(){o+=1;s.onProgress(o,l.entryCount,false);if(o==l.entryCount){var e=a;var r=w.Success(t);haxe_Timer.delay((function(){e(r)}),100)}};if(i!=null){a(w.Failure(new tink_core_TypedError(422,"Failed to unzip "+e+" because "+Std.string(i),{fileName:"src/lix/client/Download.hx",lineNumber:78,className:"lix.client.Download",methodName:"unzip"})))}l.on("entry",(function(e){var i=haxeshim_sys_Fs.peel(lix_client_Download.stripLeadingSlashes(e.fileName),n);switch(i._hx_index){case 0:var s=i.v;var a=""+t+"/"+s;if(StringTools.endsWith(a,"/")){done()}else{haxeshim_sys_Fs.ensureDir(a).eager();l.openReadStream(e,(function(e,t){var n=r(7758).createWriteStream(a);t.pipe(n,{end:true});n.on("close",done)}))}break;case 1:break}}));l.on("end",(function(){l.close();done()}))}))}))})).handle($bind(s,s.done))};lix_client_Download.stripLeadingSlashes=function(e){if(e.charAt(0)=="/"){return lix_client_Download.stripLeadingSlashes(HxOverrides.substr(e,1,null))}else{return e}};lix_client_Download.untar=function(e,t,n,i,s){return Y.async((function(e){var a=0;var l=0;var o=[];var update=function(){s.onProgress(l,a+1,true)};var u=1;var done=function(r){if(r==null){r=0}l+=r;update();haxe_Timer.delay((function(){if((u-=1)<=0){s.onProgress(a,a,true);var r=[];var n=0;while(n<o.length){var i=[o[n]];++n;r.push(Y.async(function(e){return function(t){g.unlink(e[0].to,function(e){return function(r){g.symlink(e[0].from,e[0].to,function(){return function(e){t(e==null?w.Success(null):w.Failure(new tink_core_TypedError(null,e.message,{fileName:"src/lix/client/Download.hx",lineNumber:137,className:"lix.client.Download",methodName:"untar"})))}}())}}(e))}}(i)))}X.next(X.inParallel(r),(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t)))})).handle(e)}}),100)};var c=null;var fail=function(t){var r=e;c=new tink_core_TypedError(null,t,{fileName:"src/lix/client/Download.hx",lineNumber:149,className:"lix.client.Download",methodName:"untar"});r(w.Failure(c))};lix_client_uncompress_Tar.parse(i,(function(i){if(c!=null){return}a+=i.size;update();var skip=function(){i.on("data",(function(){}))};var s=haxeshim_sys_Fs.peel(lix_client_Download.stripLeadingSlashes(i.path),n);switch(s._hx_index){case 0:var l=s.v;var h=""+t+"/"+l;if(StringTools.endsWith(h,"/")){skip()}else{haxeshim_sys_Fs.ensureDir(h).handle((function(t){if(t._hx_index==1){var n=t.failure;c=n;e(w.Failure(c))}else if(i.type=="SymbolicLink"){skip();o.push({from:i.linkpath,to:h})}else{u+=1;var s=new R;var a=r(7758).createWriteStream(h,{mode:i.mode});i.pipe(s,{end:true});s.pipe(a,{end:true});var l=i.size;a.on("close",(function(){done(l)}))}}))}break;case 1:skip();break}})).handle((function(t){if(t._hx_index==1){var r=t.failure;e(w.Failure(r))}else{done()}}))})).handle($bind(s,s.done))};lix_client_Download.tar=function(e,t,r,n){var i=r;var s=t;return lix_client_Download.download(e,lix_client_Download.withLogger(n,(function(e,t,r){return lix_client_Download.untar(e,i,s,t,r)})))};lix_client_Download.zip=function(e,t,r,n){var i=r;var s=t;return lix_client_Download.download(e,lix_client_Download.withLogger(n,(function(e,t,r){lix_client_Download.unzip(e,i,s,t,r)})))};lix_client_Download.withLogger=function(e,t){return function(r,n,i){var s=Std.parseInt(n.headers["content-length"]);var a=0;var l=0;var o=1;var u=null;var progress=function(t){if(t==u){return}u=t;e.progress(t)};var pct=function(e){e=Math.min(1,Math.max(0,e));var t=Std.string(Math.round(1e3*e)/10);var r;if(t.indexOf(".")==-1){var n=t;r=""+n+".0"}else{var i=t;r=i}return StringTools.lpad(r," ",5)+"%"};var c=new Date(0).getTime();var update=function(){if(!(l==o||l/o>=1)){var e=(new Date).getTime();if(e>c+137){c=e;var t=[];if(a<s){t.push("Downloaded: "+pct(a/s))}if(l>0){t.push("Saved: "+pct(l/o))}progress(" "+t.join(" "))}}};n.on("data",(function(e){a+=e.length;update()}));var h=0;t(r,n,{onProgress:function(e,t,r){l=e;o=t;if(r){var n=a/s;var i=l/o;var u=n*i;if(u<h){u=h}h=u;l=Math.round(u*1e3);o=1e3}update()},done:function(t){e.success("-> Done!");i(t)}})}};lix_client_Download.download=function(e,t){return Y.async((function(r){var n=new C(e);var i=n.search;var s={protocol:n.protocol,host:n.host,path:""+n.pathname+(i!=null?i:"")};if(n.username!=null&&n.password!=null){s.auth=n.username+":"+n.password}var a=s;a.agent=false;if(a.headers==null){a.headers={}}a.headers["user-agent"]=lix_client_Download.USER_AGENT;var fail=function(t){r(w.Failure(tink_core_TypedError.withData(null,"Failed to download "+e+" because "+t.message,t,{fileName:"src/lix/client/Download.hx",lineNumber:300,className:"lix.client.Download",methodName:"download"})))};var l=StringTools.startsWith(e,"https:")?E.get(a):S.get(a);l.setTimeout(3e4);l.on("error",fail);l.on("response",(function(n){if(n.statusCode>=400){r(w.Failure(tink_core_TypedError.withData(n.statusCode,n.statusMessage,n,{fileName:"src/lix/client/Download.hx",lineNumber:311,className:"lix.client.Download",methodName:"download"})))}else{var i=n.headers["location"];if(i==null){n.on("error",fail);t(e,n,(function(e){switch(e._hx_index){case 0:var t=e.data;r(w.Success(t));break;case 1:var n=e.failure;r(w.Failure(n));break}}))}else{var s=i;lix_client_Download.download(new C(s,e).toString(),t).handle(r)}}}))}))};var lix_client_LibVersion=function(e,t){this.name=e;this.version=t};t["lix.client.LibVersion"]=lix_client_LibVersion;lix_client_LibVersion.__name__="lix.client.LibVersion";lix_client_LibVersion.parse=function(e){if(e==null){return null}else{var t=e.indexOf("#");if(t==-1){return new lix_client_LibVersion(u.Some(e),u.None)}else{var r=t;return new lix_client_LibVersion(u.Some(e.substring(0,r)),u.Some(e.substring(r+1)))}}};lix_client_LibVersion.prototype={__class__:lix_client_LibVersion};var lix_client_Libraries=function(e,t,r,n,i){this.scope=e;this.urlToJob=t;this.resolver=r;this.logger=n;this.force=i};t["lix.client.Libraries"]=lix_client_Libraries;lix_client_Libraries.__name__="lix.client.Libraries";lix_client_Libraries.prototype={downloadUrl:function(e,t){return this.downloadArchive(this.urlToJob(e),t)},downloadArchive:function(e,t){var r=this;return X.next(e,(function(e){var n=null;var i=t!=null?t.into:null;if(i==null){var s=e.dest;switch(s._hx_index){case 0:var a=s.path;i=lix_client_DownloadedArchive.path(a);break;case 1:var l=s.f;n=""+r.scope.libCache+"/.cache/libNames/"+lix_client_DownloadedArchive.escape(G.toString(e.normalized));if(sys_FileSystem.exists(n)){i=g.readFileSync(n,{encoding:"utf8"})}break}}var o=i!=null&&sys_FileSystem.exists(""+r.scope.libCache+"/"+i);if(o&&!r.force){r.logger.success("already downloaded: "+(e.normalized==null?"null":G.toString(e.normalized)));return lix_client_DownloadedArchive.existent(i,r.scope.libCache,e)}else{var u=r.logger;var c=e.normalized==null?"null":G.toString(e.normalized);u.info(""+(o?"forcedly redownloading":"downloading")+" "+c);var h=""+r.scope.haxeshimRoot+"/downloads/download@"+Math.floor((new Date).getTime())+"_"+process.pid;var s=e.kind;var c;if(s==null){c=lix_client_Download.archive(G.toString(e.url),0,h,r.logger)}else{switch(s._hx_index){case 0:c=lix_client_Download.zip(G.toString(e.url),0,h,r.logger);break;case 1:c=lix_client_Download.tar(G.toString(e.url),0,h,r.logger);break;case 2:var d=s.load;c=d({dest:h,logger:r.logger,source:e.normalized,scope:r.scope});break}}return X.next(X.next(c,(function(t){return lix_client_DownloadedArchive.fresh(t,r.scope.libCache,i,e)})),(function(e){if(n!=null){var t=e;return X.next(haxeshim_sys_Fs.save(n,b.ofString(e.relRoot),{fileName:"src/lix/client/Libraries.hx",lineNumber:65,className:"lix.client.Libraries",methodName:"downloadArchive"}),(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t)))}))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e)))}}))}}))},installUrl:function(e,t,r){return this.installArchive(this.urlToJob(e),t,r)},installFromLibHxml:function(e,t){var r=this;var n=this.scope.libHxml(e);return X.next(X.next(X.next(X.next(X.next(X.next(haxeshim_sys_Fs.copy(t,""+this.scope.scopeLibDir+"/"+e+".hxml"),(function(t){return r.scope.getDirectives(e)})),(function(e){var n=e.h["install"];if(n==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"No install directive in "+t,{fileName:"src/lix/client/Libraries.hx",lineNumber:81,className:"lix.client.Libraries",methodName:"installFromLibHxml"}))))}else if(n.length==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"No install directive in "+t,{fileName:"src/lix/client/Libraries.hx",lineNumber:81,className:"lix.client.Libraries",methodName:"installFromLibHxml"}))))}else{var i=n;var n=[];var s=0;while(s<i.length){var e=[i[s]];++s;n.push(X.next(X.NOISE,function(e){return function(t){r.logger.info(e[0]);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(haxeshim_sys_Exec.shell(e[0],r.scope.scopeDir)))}}(e)))}return X.inSequence(n)}})),(function(e){return haxeshim_sys_Fs.get(t,{fileName:"src/lix/client/Libraries.hx",lineNumber:90,className:"lix.client.Libraries",methodName:"installFromLibHxml"})})),(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(haxeshim_Args.fromMultilineString(e,n,(i=r.scope,$bind(i,i.getVar))))))})),(function(e){switch(e._hx_index){case 0:var t=e.data;var r=[];var n=0;while(n<t.length){var i=t[n];++n;r.push(i.val)}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(r)));case 1:var s=e.failure.errors[0];return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(s.code,s.message,{fileName:"src/lix/client/Libraries.hx",lineNumber:94,className:"lix.client.Libraries",methodName:"installFromLibHxml"}))))}})),(function(e){var t=[];var r=0;var n=e;while(r<n.length){var i=n[r];var s=r++;var a=s;var l=i;if(l=="-lib"&&haxeshim_Args.getNdll(e[a+1])==u.None){t.push(e[a+1])}}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t)))}))},dev:function(e,t){var r=this;var n=haxe_io_Path.isAbsolute(t);var i=n?t:haxe_io_Path.join([this.scope.scopeDir,t]);var s=n?t:"$"+"{SCOPE_DIR}/"+t;var a=i;var l=tink_core_TypedError.catchExceptions((function(){return g.readdirSync(a)}),null,{fileName:"src/lix/client/Libraries.hx",lineNumber:112,className:"lix.client.Libraries",methodName:"dev"});if(l._hx_index==0){var o=l.data;if(o.indexOf("haxelib.json")!=-1){var u=""+i+"/haxelib.json";return X.next(X.next(haxeshim_sys_Fs.get(u,{fileName:"src/lix/client/Libraries.hx",lineNumber:116,className:"lix.client.Libraries",methodName:"dev"}),(function(e){try{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(JSON.parse(e))))}catch(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"cannot parse "+u,{fileName:"src/lix/client/Libraries.hx",lineNumber:119,className:"lix.client.Libraries",methodName:"dev"}))))}})),(function(n){var i=[];if(n.dependencies!=null){var a=n.dependencies;var l=a;var u=Reflect.fields(a);var c=0;while(c<u.length){var h=u[c++];var d=l[h];var v=h;var m=v;var p=d;i.push("-lib "+m)}}var _=n.classPath;var g;if(_==null){g=t}else{var p=_;g=""+s+"/"+p}i.push("-cp "+g);var _=n.version;var g;if(_==null){g="dev"}else{var p=_;g=p}i.push("-D "+e+"="+g);var w=i.length;if(o.indexOf("extraParams.hxml")!=-1){i.push(""+s+"/extraParams.hxml")}i.push('--macro Sys.println("haxe_libraries/'+e+".hxml:"+w+": [Warning] Using dev version of library "+e+'")');return haxeshim_sys_Fs.save(r.scope.libHxml(e),b.ofString(i.join("\n")),{fileName:"src/lix/client/Libraries.hx",lineNumber:143,className:"lix.client.Libraries",methodName:"dev"})}))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,""+i+" does not contain haxelib.json",{fileName:"src/lix/client/Libraries.hx",lineNumber:147,className:"lix.client.Libraries",methodName:"dev"}))))}}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,""+i+" is not a readable directory",{fileName:"src/lix/client/Libraries.hx",lineNumber:149,className:"lix.client.Libraries",methodName:"dev"}))))}},installArchive:function(e,t,r){var n=this;return X.next(this.downloadArchive(e),(function(e){var i;var s=""+lix_client_DownloadedArchive.getAbsRoot(e.storageRoot,e.relRoot)+"/extraParams.hxml";i=sys_FileSystem.exists(s)?g.readFileSync(s,{encoding:"utf8"}):null;if(t==null){t=new lix_client_LibVersion(u.None,u.None)}var a=e.infos;if(r==null){r={}}var l=r.alreadyInstalled!=null?r.alreadyInstalled:new haxe_ds_StringMap;r.alreadyInstalled=l;var o=t.name;var c=new tink_core__$Lazy_LazyConst(a.name);var h;if(o._hx_index==0){var d=o.v;h=d}else{h=_.get(c)}var o=t.version;var c=new tink_core__$Lazy_LazyConst(a.version);var v;if(o._hx_index==0){var d=o.v;v=d}else{v=_.get(c)}if(h==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Could not determine library name for "+(e.job.normalized==null?"null":G.toString(e.job.normalized)),{fileName:"src/lix/client/Libraries.hx",lineNumber:182,className:"lix.client.Libraries",methodName:"installArchive"}))))}var m=n.scope.libHxml(h);var p="$"+"{"+"HAXE_LIBCACHE"+"}/"+e.relRoot;var interpolate=function(e){return n.scope.interpolate(e,(function(e){if(e=="DOWNLOAD_LOCATION"){return p}else{return null}}))};var exec=function(e,t,r){if(t!=null){t=interpolate(t);if(r==null){r=n.scope.cwd}n.logger.info("Running "+e+" hook:");n.logger.info("> "+t);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(tink_core_OutcomeTools.map(haxeshim_sys_Exec.shell(t,n.scope.interpolate(r),n.scope.haxeInstallation.env),(function(e){return null}))))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}};var saveHxml=function(t){var s=["# @"+"install"+': lix --silent download "'+(e.job.normalized==null?"null":G.toString(e.job.normalized))+'" into '+e.relRoot];var l=a.postDownload;if(l!=null){var o=l;s.push("# @"+"post-install"+": cd "+p+" && "+interpolate(o))}var l=a.runAs({libRoot:n.scope.interpolate(p)});switch(l._hx_index){case 0:var o=l.v;s.push("# @run: "+tink_core_OutcomeTools.sure(haxeshim_Args.interpolate(o,(function(e){if(e=="DOWNLOAD_LOCATION"){return p}else{var t=e;return"$"+"{"+t+"}"}}))));break;case 1:break}var lines=function(e){var t=[];var r=0;while(r<e.length){var n=e[r];++r;if(n!=null){t.push(n)}}return t.join("\n")};var u=m;var c=lines;var l=[];var d=0;var _=a.dependencies;while(d<_.length){var g=_[d];++d;l.push("-lib "+g.name)}return X.next(haxeshim_sys_Fs.save(u,b.ofString(c(s.concat(l).concat(["-cp "+p+"/"+a.classPath,"-D "+h+"="+v,i,a.hasNdll?"-lib "+haxeshim_Args.makeNdll(""+p+"/ndll/"):null]))),{fileName:"src/lix/client/Libraries.hx",lineNumber:237,className:"lix.client.Libraries",methodName:"installArchive"}),(function(e){r.alreadyInstalled.h[h]=true;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t)))}))};var installDependencies=function(){if(r.flat){return X.NOISE}else{var e=[];var t=0;var i=a.dependencies;while(t<i.length){var s=i[t];++t;var l=[s.name];var o=s.value;if(sys_FileSystem.exists(""+n.scope.scopeLibDir+"/"+l[0]+".hxml")&&r.alreadyInstalled.h[l[0]]){e.push(X.NOISE)}else{var c=a.haxeshimDependencies;var d;if(c==null){d=null}else{var v=c;d=v.h[l[0]]}var m;switch(o._hx_index){case 0:if(d==null){var p=o.u;m=X.next(n.installUrl(p,new lix_client_LibVersion(u.Some(l[0]),u.None),r),function(e){return function(t){r.alreadyInstalled.h[e[0]]=true;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t)))}}(l))}else{var _=d;var g=[null];g[0]=function(e){return function(t,i){if(r.alreadyInstalled.h[t]){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return X.noise(X.next(n.installFromLibHxml(t,i),function(e){return function(n){r.alreadyInstalled.h[t]=true;var i=[];var s=0;while(s<n.length){var l=n[s];++s;var o=a.haxeshimDependencies;var u;if(o==null){u=null}else{var c=o;u=c.h[l]}i.push(e[0](l,u))}return X.inSequence(i)}}(e)))}}}(g);m=g[0](l[0],_)}break;case 1:var x=o.path;var b=[null];b[0]=function(e){return function(t,i){if(r.alreadyInstalled.h[t]){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return X.noise(X.next(n.installFromLibHxml(t,i),function(e){return function(n){r.alreadyInstalled.h[t]=true;var i=[];var s=0;while(s<n.length){var l=n[s];++s;var o=a.haxeshimDependencies;var u;if(o==null){u=null}else{var c=o;u=c.h[l]}i.push(e[0](l,u))}return X.inSequence(i)}}(e)))}}}(b);m=b[0](l[0],x);break}e.push(m)}}return Y.flatMap(Y.inSequence(e),(function(e){var t=[];var r=0;while(r<e.length){var n=e[r];++r;var i;if(n._hx_index==1){var s=n.failure;i=s}else{continue}t.push(i)}var a=t;if(a.length==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{var l=a;var s="Failed to install dependencies of "+h+" :\n ";var o=new Array(l.length);var t=0;var r=l.length;while(t<r){var u=t++;o[u]=l[u].message}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(tink_core_TypedError.withData(null,s+o.join("\n "),l,{fileName:"src/lix/client/Libraries.hx",lineNumber:295,className:"lix.client.Libraries",methodName:"installArchive"}))))}}))}};return X.next(X.next(X.next(X.next(X.next(saveHxml(),(function(e){n.logger.success("-> mounted as "+h+"#"+v);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))})),(function(e){return installDependencies()})),(function(t){if(!e.alreadyDownloaded){return exec("post download",a.postDownload,p)}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}})),saveHxml),(function(e){return exec("post install",a.postInstall)}))}))},__class__:lix_client_Libraries};var M={};M.get_isPrerelease=function(e){return e.indexOf("-")!=-1};M.isNumber=function(e){return new EReg("^[0-9]*$","").match(e)};M.fragment=function(e,t){if(M.isNumber(e)&&M.isNumber(t)){return Std.parseInt(e)-Std.parseInt(t)}else{return Reflect.compare(e,t)}};M.compare=function(e,t){var r=e.split("-");var n=t.split("-");var i=0;while(i<r.length&&i<n.length){var e=r[i].split(".");var t=n[i++].split(".");var s=0;while(s<e.length&&s<t.length){var a=M.fragment(e[s],t[s]);if(a==0){++s}else{var l=a;return-l}}var o=e.length-t.length;if(o!=0){var u=o;return-u}}return(r.length-n.length)*(i==1?1:-1)};var z=n["lix.client.haxe.ResolvedUserVersionData"]={__ename__:"lix.client.haxe.ResolvedUserVersionData",__constructs__:null,RNightly:(i=function(e){return{_hx_index:0,nightly:e,__enum__:"lix.client.haxe.ResolvedUserVersionData",toString:$estr}},i._hx_name="RNightly",i.__params__=["nightly"],i),ROfficial:(i=function(e){return{_hx_index:1,version:e,__enum__:"lix.client.haxe.ResolvedUserVersionData",toString:$estr}},i._hx_name="ROfficial",i.__params__=["version"],i),RCustom:(i=function(e){return{_hx_index:2,path:e,__enum__:"lix.client.haxe.ResolvedUserVersionData",toString:$estr}},i._hx_name="RCustom",i.__params__=["path"],i)};z.__constructs__=[z.RNightly,z.ROfficial,z.RCustom];var U={};U.get_id=function(e){switch(e._hx_index){case 0:var t=e.nightly;var r=t.development;var r=t.file;var r=t.published;var n=t.hash;return n;case 1:var n=e.version;return n;case 2:var n=e.path;return n}};U.toString=function(e){switch(e._hx_index){case 0:var t=e.nightly;return t.hash;case 1:var r=e.version;return r;case 2:var n=e.path;return n}};var H=n["lix.client.haxe.PickOfficial"]={__ename__:"lix.client.haxe.PickOfficial",__constructs__:null,StableOnly:{_hx_name:"StableOnly",_hx_index:0,__enum__:"lix.client.haxe.PickOfficial",toString:$estr},IncludePrereleases:{_hx_name:"IncludePrereleases",_hx_index:1,__enum__:"lix.client.haxe.PickOfficial",toString:$estr}};H.__constructs__=[H.StableOnly,H.IncludePrereleases];var lix_client_haxe_Switcher=function(e,t){this.scope=e;this.logger=t;haxeshim_sys_Fs.ensureDir(haxe_io_Path.addTrailingSlash(e.versionDir)).eager();haxeshim_sys_Fs.ensureDir(haxe_io_Path.addTrailingSlash(e.haxelibRepo)).eager();haxeshim_sys_Fs.ensureDir(this.downloads=e.haxeshimRoot+"/downloads/").eager()};t["lix.client.haxe.Switcher"]=lix_client_haxe_Switcher;lix_client_haxe_Switcher.__name__="lix.client.haxe.Switcher";lix_client_haxe_Switcher.nightlies=function(){var e=haxeshim_sys_Os.get_platform();var t;switch(e){case"linux-arm64":t="linux-arm64";break;case"linux64":t="linux64";break;case"mac-arm":case"mac-universal":case"mac64":t="mac";break;case"win64":t="windows64";break;default:var r=e;t=r}return"https://build.haxe.org/builds/haxe/"+t};lix_client_haxe_Switcher.linkToNightly=function(e,t,r){if(r==null){r=DateTools.format(t,"haxe_%Y-%m-%d_development_"+e+".tar.gz")}return DateTools.format(t,""+lix_client_haxe_Switcher.nightlies()+"/"+r)};lix_client_haxe_Switcher.sortedOfficial=function(e,t){if(e==H.StableOnly){var r=[];var n=0;while(n<t.length){var i=t[n];++n;if(!M.get_isPrerelease(i)){r.push(i)}}t=r}t.sort(M.compare);return t};lix_client_haxe_Switcher.officialOnline=function(e){return X.next(lix_client_Download.text("https://haxe.org/website-content/downloads/versions.json"),(function(t){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(lix_client_haxe_Switcher.sortedOfficial(e,JSON.parse(t).versions.map((function(e){return e.version}))))))}))};lix_client_haxe_Switcher.sortedNightlies=function(e){e.sort((function(e,t){return Reflect.compare(t.published.getTime(),e.published.getTime())}));return e};lix_client_haxe_Switcher.nightliesOnline=function(){return X.next(X.next(new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(lix_client_haxe_Switcher.nightlies()))),lix_client_Download.text),K.ofSafeSync((function(e){var t=e.split("------------------\n").pop().split("\n");var r=[];var parseDate=function(e){try{return u.Some(HxOverrides.strDate(e))}catch(e){return u.None}};var n=0;while(n<t.length){var i=t[n];++n;var s=StringTools.trim(i).split('<a href="');if(s.length==2){var a=s[1];var l=parseDate(s[0].split(" ")[0]);if(l._hx_index==0){var o;var c=l.v;o=a.split('"')[0];var h=o;var d=h.split(".")[0].split("_").pop();if(d==null){var v=d;r.push({hash:v,file:h,development:h.indexOf("_development_")!=-1,published:c})}else if(d!="latest"){var m=d;r.push({hash:m,file:h,development:h.indexOf("_development_")!=-1,published:c})}}}}return lix_client_haxe_Switcher.sortedNightlies(r)})))};lix_client_haxe_Switcher.attempt=function(e,t){try{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(_.get(t))))}catch(t){var r=haxe_Exception.caught(t).unwrap();return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Failed to "+e+" because "+Std.string(r),{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:103,className:"lix.client.haxe.Switcher",methodName:"attempt"}))))}};lix_client_haxe_Switcher.pickFirst=function(e,t,r){if(r==null){return lix_client_haxe_Switcher.pickFirst(e,t,(function(e){return true}))}else{return function(n){var i=$getIterator(n);while(i.hasNext()){var s=i.next();if(r(s)){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(t(s))))}}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(404,"No "+e+" build found",{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:137,className:"lix.client.haxe.Switcher",methodName:"pickFirst"}))))}}};lix_client_haxe_Switcher.ensureNeko=function(e,t){var r=e.path;if(sys_FileSystem.exists(r)){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(r)))}else{t.info("Neko seems to be missing. Attempting download ...");var n=lix_client_haxe_Switcher.getNekoUrl(e);switch(n._hx_index){case 0:var i=n.data;var s=StringTools.startsWith(e.platform,"win")?lix_client_Download.zip:lix_client_Download.tar;return X.next(s(i,1,r,t),(function(e){t.success("done");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e)))}));case 1:var a=n.failure;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(a)))}}};lix_client_haxe_Switcher.getNekoUrl=function(e){var t;var r=e.platform;switch(r){case"linux-arm64":t="linux-arm64";break;case"linux64":t="linux64";break;case"mac-arm":case"mac-universal":case"mac64":t="osx-universal";break;case"win32":t="win";break;case"win64":t="win64";break;default:var n=r;return w.Failure(new tink_core_TypedError(null,"Unsupported platform: "+n,{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:319,className:"lix.client.haxe.Switcher",methodName:"getNekoUrl"}))}return w.Success("https://github.com/HaxeFoundation/neko/releases/download/v"+StringTools.replace(e.version,".","-")+"/neko-"+e.version+"-"+t+"."+(StringTools.startsWith(e.platform,"win")?"zip":"tar.gz"))};lix_client_haxe_Switcher.prototype={officialInstalled:function(e){var t=[];var r=0;var n=g.readdirSync(this.scope.versionDir);while(r<n.length){var i=n[r];++r;if(!j.isHash(i)&&sys_FileSystem.isDirectory(this.versionDir(i))){t.push(i)}}return lix_client_haxe_Switcher.attempt("Get installed Haxe versions",new tink_core__$Lazy_LazyConst(lix_client_haxe_Switcher.sortedOfficial(e,t)))},nightliesInstalled:function(){var e=[];var t=0;var r=j.isHash;var n=[];var i=0;var s=g.readdirSync(this.scope.versionDir);while(i<s.length){var a=s[i];++i;if(r(a)){n.push(a)}}var i=n;while(t<i.length){var a=i[t];++t;e.push({hash:a,published:HxOverrides.strDate(JSON.parse(g.readFileSync(""+this.versionDir(a)+"/"+lix_client_haxe_Switcher.VERSION_INFO,{encoding:"utf8"})).published)})}return lix_client_haxe_Switcher.attempt("get installed Haxe versions",new tink_core__$Lazy_LazyConst(lix_client_haxe_Switcher.sortedNightlies(e)))},switchTo:function(e){var t=this;if(U.get_id(e)==this.scope.config.version){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return X.noise(X.next(this.scope.reconfigure({version:U.get_id(e),resolveLibs:this.scope.config.resolveLibs}),(function(e){return lix_client_haxe_Switcher.ensureNeko(t.scope.haxeInstallation.neko,t.logger)})))}},resolveInstalled:function(e){return this.resolve(e,$bind(this,this.officialInstalled),$bind(this,this.nightliesInstalled))},resolveOnline:function(e){return this.resolve(e,lix_client_haxe_Switcher.officialOnline,lix_client_haxe_Switcher.nightliesOnline)},resolve:function(e,t,r){switch(e._hx_index){case 0:return X.next(r(),lix_client_haxe_Switcher.pickFirst("nightly",z.RNightly,(function(e){return e.development!=false})));case 1:return X.next(t(H.IncludePrereleases),lix_client_haxe_Switcher.pickFirst("official",z.ROfficial));case 2:return X.next(t(H.StableOnly),lix_client_haxe_Switcher.pickFirst("stable",z.ROfficial));case 3:var n=e.hash;return X.next(r(),(function(e){var t=$getIterator(e);while(t.hasNext()){var r=t.next();if(r.hash==n){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(z.RNightly(r))))}}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(404,"Unable to resolve nightly version "+n+" locally, install it first with `lix install haxe "+n+"`",{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:162,className:"lix.client.haxe.Switcher",methodName:"resolve"}))))}));case 4:var i=e.version;return X.next(t(H.IncludePrereleases),(function(e){if(Lambda.has(e,i)){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(z.ROfficial(i))))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(404,"Unable to resolve version "+i+" locally, install it first with `lix install haxe "+i+"`",{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:170,className:"lix.client.haxe.Switcher",methodName:"resolve"}))))}}));case 5:var s=e.path;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(z.RCustom(s))))}},versionDir:function(e){return this.scope.getInstallation(e).path},isDownloaded:function(e){return sys_FileSystem.exists(this.versionDir(U.get_id(e)))},linkToOfficial:function(e){var t="https://haxe.org/website-content/downloads/"+e+"/downloads/haxe-"+e+"-";var r;switch(Sys.systemName()){case"Mac":r="osx.tar.gz";break;case"Windows":r="win"+(e<"5"?"":"64")+".zip";break;default:r="linux"+(e<"3"?"":"64")+".tar.gz"}return t+r},replace:function(e,t,r,n){var i=t;while(true){var s=haxeshim_sys_Fs.ls(t);if(s.length==1){var a=s[0];t=a}else{break}}if(n!=null){n(t)}if(sys_FileSystem.exists(e)){var l=""+this.downloads+"/"+r+"@"+Math.floor(g.statSync(e).ctime.getTime());g.renameSync(e,l);g.renameSync(t,e)}else{g.renameSync(t,e)}if(sys_FileSystem.exists(i)){haxeshim_sys_Fs.delete(i)}},install:function(e,t){return X.next(this.resolveAndDownload(e,t),$bind(this,this.switchTo))},resolveAndDownload:function(e,t){var r=this;var n;var i=j.ofString(e);if(i._hx_index==4){var s=i.version;n=this.resolveInstalled(j.ofString(e))}else{n=new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,""+e+" needs to be resolved online",{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:226,className:"lix.client.haxe.Switcher",methodName:"resolveAndDownload"}))))}var f=function(t){r.logger.info('Looking up Haxe version "'+e+'" online');return X.next(r.resolveOnline(j.ofString(e)),(function(e){r.logger.info(" Resolved to "+(e==null?"null":U.toString(e))+". Downloading ...");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e)))}))};return X.next(Y.flatMap(n,(function(e){switch(e._hx_index){case 0:var t=e.data;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(e));case 1:var r=e.failure;return f(r)}})),(function(e){return X.next(r.download(e,t),(function(t){r.logger.success(!t?" ... already downloaded!":" ... download complete!");return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e)))}))}))},download:function(e,t){var r=this;var getDownloadDir=function(e){return""+r.downloads+"/"+e+"@"+Math.floor((new Date).getTime())+"_"+process.pid};if(this.isDownloaded(e)==true){if(t.force!=true){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(false)))}else{switch(e._hx_index){case 0:var n=e.nightly;var i=n.development;var s=n.file;var a=n.hash;var l=n.published;var o=lix_client_haxe_Switcher.linkToNightly(a,l,s);var u=getDownloadDir(a);r.logger.info("Downloading Haxe: "+(e==null?"null":U.toString(e)));return X.next(lix_client_Download.archive(o,0,u,r.logger),(function(e){r.replace(r.versionDir(a),e,a,(function(e){g.writeFileSync(""+e+"/"+lix_client_haxe_Switcher.VERSION_INFO,JSON.stringify({published:HxOverrides.dateStr(l)}))}));return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(true)))}));case 1:var c=e.version;var o=this.linkToOfficial(c);var u=getDownloadDir(c);r.logger.info("Downloading Haxe: "+(e==null?"null":U.toString(e)));return X.next(lix_client_Download.archive(o,0,u,r.logger),(function(e){r.replace(r.versionDir(c),e,c);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(true)))}));case 2:var n=e.path;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Cannot download custom version",{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:265,className:"lix.client.haxe.Switcher",methodName:"download"}))))}}}else{switch(e._hx_index){case 0:var n=e.nightly;var i=n.development;var s=n.file;var h=n.hash;var d=n.published;var o=lix_client_haxe_Switcher.linkToNightly(h,d,s);var u=getDownloadDir(h);r.logger.info("Downloading Haxe: "+(e==null?"null":U.toString(e)));return X.next(lix_client_Download.archive(o,0,u,r.logger),(function(e){r.replace(r.versionDir(h),e,h,(function(e){g.writeFileSync(""+e+"/"+lix_client_haxe_Switcher.VERSION_INFO,JSON.stringify({published:HxOverrides.dateStr(d)}))}));return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(true)))}));case 1:var v=e.version;var o=this.linkToOfficial(v);var u=getDownloadDir(v);r.logger.info("Downloading Haxe: "+(e==null?"null":U.toString(e)));return X.next(lix_client_Download.archive(o,0,u,r.logger),(function(e){r.replace(r.versionDir(v),e,v);return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(true)))}));case 2:var n=e.path;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Cannot download custom version",{fileName:"src/lix/client/haxe/Switcher.hx",lineNumber:265,className:"lix.client.haxe.Switcher",methodName:"download"}))))}}},__class__:lix_client_haxe_Switcher};var j={};j.isHash=function(e){var t=0;var r=e.length;while(t<r){var n=t++;var i=j.hex;var s=e.charCodeAt(n);if(!i.h[s]){return false}}return true};j.isPath=function(e){if(!haxe_io_Path.isAbsolute(e)){return e.charAt(0)=="."}else{return true}};j.ofString=function(e){if(e==null){return null}else{var t;var r;if(e==null){r=j.isHash(e);if(r==true){return W.UNightly(e)}else{t=j.isPath(e);if(t==true){return W.UCustom(e)}else{return W.UOfficial(e)}}}else{switch(e){case"auto":return null;case"latest":return W.ULatest;case"edge":case"nightly":return W.UEdge;case"stable":return W.UStable;default:r=j.isHash(e);if(r==true){return W.UNightly(e)}else{t=j.isPath(e);if(t==true){return W.UCustom(e)}else{return W.UOfficial(e)}}}}}};var W=n["lix.client.haxe.UserVersionData"]={__ename__:"lix.client.haxe.UserVersionData",__constructs__:null,UEdge:{_hx_name:"UEdge",_hx_index:0,__enum__:"lix.client.haxe.UserVersionData",toString:$estr},ULatest:{_hx_name:"ULatest",_hx_index:1,__enum__:"lix.client.haxe.UserVersionData",toString:$estr},UStable:{_hx_name:"UStable",_hx_index:2,__enum__:"lix.client.haxe.UserVersionData",toString:$estr},UNightly:(i=function(e){return{_hx_index:3,hash:e,__enum__:"lix.client.haxe.UserVersionData",toString:$estr}},i._hx_name="UNightly",i.__params__=["hash"],i),UOfficial:(i=function(e){return{_hx_index:4,version:e,__enum__:"lix.client.haxe.UserVersionData",toString:$estr}},i._hx_name="UOfficial",i.__params__=["version"],i),UCustom:(i=function(e){return{_hx_index:5,path:e,__enum__:"lix.client.haxe.UserVersionData",toString:$estr}},i._hx_name="UCustom",i.__params__=["path"],i)};W.__constructs__=[W.UEdge,W.ULatest,W.UStable,W.UNightly,W.UOfficial,W.UCustom];var lix_client_sources_Git=function(e){this.scope=e};t["lix.client.sources.Git"]=lix_client_sources_Git;lix_client_sources_Git.__name__="lix.client.sources.Git";lix_client_sources_Git.strip=function(e){if(StringTools.endsWith(e,".git")){return haxe_io_Path.withoutExtension(e)}else{return e}};lix_client_sources_Git.eval=function(e,t,r,n){var i=a.spawnSync(e,r,{cwd:t,stdio:["inherit","pipe","inherit"],env:x.toVars(haxeshim_sys_Exec.mergeEnv(n))});var s=i;if(s.error==null){return w.Success({status:s.status,stdout:s.stdout.toString()})}else{var l=i.output;var l=i.pid;var l=i.signal;var l=i.status;var l=i.stderr;var l=i.stdout;var o=i.error;return w.Failure(new tink_core_TypedError(null,"Failed to call "+e+" because "+Std.string(o),{fileName:"src/lix/client/sources/Git.hx",lineNumber:25,className:"lix.client.sources.Git",methodName:"eval"}))}};lix_client_sources_Git.cli=function(e){haxeshim_sys_Fs.ensureDir(haxe_io_Path.addTrailingSlash(e)).eager();return{call:function(t){return X.next(new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(haxeshim_sys_Exec.sync("git",e,t))),(function(e){if(e==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(e,"git "+t[0]+" failed",{fileName:"src/lix/client/sources/Git.hx",lineNumber:33,className:"lix.client.sources.Git",methodName:"cli"}))))}}))},eval:function(t){return X.next(new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(lix_client_sources_Git.eval("git",e,t))),(function(e){var r=e.stdout;if(e.status==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e.stdout.toString())))}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(e.status,"git "+t[0]+" failed",{fileName:"src/lix/client/sources/Git.hx",lineNumber:40,className:"lix.client.sources.Git",methodName:"cli"}))))}}))}}};lix_client_sources_Git.prototype={schemes:function(){return["git"]},processUrl:function(e){var t=this;var r=G.fromString(e.payload);var n=G.resolve(r,G.fromString(""));var i;var s=r.hash;if(s==null){i="HEAD"}else if(s==""){i="HEAD"}else{var a=s;i=a}var l=lix_client_sources_Git.cli(".");var o=i.length!=40?X.next(l.eval(["ls-remote",G.toString(n),i]),(function(e){var t=StringTools.trim(e);if(t==""){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Cannot resolve version "+i,{fileName:"src/lix/client/sources/Git.hx",lineNumber:63,className:"lix.client.sources.Git",methodName:"processUrl"}))))}else{var r=t;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(HxOverrides.substr(r,0,40))))}})):new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(i)));return X.next(o,K.ofSafeSync((function(i){var s=e;var a=e.scheme+":";var l=G.resolve(r,G.fromString("#"+i));var o=L.Computed((function(e){return[e.name,e.version,"git",i]}));var c=F.Custom((function(e){var r=haxe_io_Path.join([t.scope.libCache,".gitrepos",lix_client_DownloadedArchive.escape(G.toString(n))]);var s=lix_client_sources_Git.cli(r);var a=s;var l=sys_FileSystem.exists(""+r+"/.git")?["fetch"]:["clone",G.toString(n),"."];return X.next(X.next(X.next(X.next(a.call(l),(function(e){return s.call(["-c","advice.detachedHead=false","checkout",i])})),(function(e){return s.call(["submodule","update","--init","--recursive"])})),(function(t){return haxeshim_sys_Fs.copy(r,e.dest,(function(e){return e!=""+r+"/.git"}))})),(function(t){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e.dest)))}))}));return{url:s,normalized:G.fromString(a+(l==null?"null":G.toString(l))),dest:o,lib:new lix_client_LibVersion(u.None,u.None),kind:c}})))},__class__:lix_client_sources_Git};var lix_client_sources_GitHub=function(e){this.credentials=e};t["lix.client.sources.GitHub"]=lix_client_sources_GitHub;lix_client_sources_GitHub.__name__="lix.client.sources.GitHub";lix_client_sources_GitHub.isArchive=function(e){var t=ie.parts(e);if(t.length==4){var r=t[0];var r=t[1];var r=t[3];if(se.toString(t[2])=="archive"){return true}else{return false}}else{return false}};lix_client_sources_GitHub.prototype={intercept:function(e){var t=e.auth;var t=e.hash;var t=e.host;var r=e.hosts;var r=e.path;var n=e.payload;var n=e.query;var i=e.scheme;var s=e.query==null?e.path:(e.path==null?"null":e.path)+"?"+(e.query==null?"null":e.query);if(t==null){return u.None}else{var s=ne.get_name(t);var a=ne.get_port(t);if(s==null){return u.None}else if(s=="github.com"){if(i==null){return u.None}else if(i=="https"){if(n==null){if(lix_client_sources_GitHub.isArchive(r)==false){return u.Some(this.processUrl(e))}else{return u.None}}else if(lix_client_sources_GitHub.isArchive(r)==false){return u.Some(this.processUrl(e))}else{return u.None}}else{return u.None}}else{return u.None}}},schemes:function(){return["github","gh"]},grabCommit:function(e,t,r){if(this.credentials==null&&(r==""||!j.isHash(r))){return X.next(X.mapError(lix_client_Download.bytes("https://github.com/"+e+"/"+t+".git/info/refs?service=git-upload-pack"),(function(r){if(r.code==401){return new tink_core_TypedError(r.code,r.message+(' - Possible typo in "'+e+"/"+t+'"'),{fileName:"src/lix/client/sources/GitHub.hx",lineNumber:35,className:"lix.client.sources.GitHub",methodName:"grabCommit"})}else{return r}})),(function(n){if(r==""){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(HxOverrides.substr(n.toString().split(" HEAD")[0],-40,null))))}var i="";var s=n.b.bufferValue;var a=0;var l=n.length;while(a<l){var o=a++;var u=s.bytes[o];if(u!=0){var c=u;i+=String.fromCodePoint(c)}}var a=0;var l=i.split("\n");while(a<l.length){var h=l[a];++a;var u=h.split(" ");if(u.length==2){var d;d=HxOverrides.substr(u[0],-40,null);var v=d;var m=u[1];if(v.length==40&&StringTools.endsWith(m,"/"+r)){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(v)))}}}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Failed to lookup sha for github:"+e+"/"+t+Std.string(n),{fileName:"src/lix/client/sources/GitHub.hx",lineNumber:60,className:"lix.client.sources.GitHub",methodName:"grabCommit"}))))}))}else{var n;if(this.credentials==null){n="null"}else{var i=this.credentials;n=i==null?"":""+i+"@"}return X.next(lix_client_Download.text("https://"+n+"api.github.com/repos/"+e+"/"+t+"/commits?sha="+r),(function(n){try{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(JSON.parse(n)[0].sha)))}catch(s){var n;if(r==null){n=""}else if(r==""){n=""}else{var i=r;n="#"+i}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Failed to lookup sha for github:"+e+"/"+t+n,{fileName:"src/lix/client/sources/GitHub.hx",lineNumber:73,className:"lix.client.sources.GitHub",methodName:"grabCommit"}))))}}))}},getArchive:function(e,t,r,n){var i=this;var doGet=function(r){return i.getArchive(e,t,r,n)};if(r==null){return X.next(this.grabCommit(e,t,""),doGet)}else{var s=r;if(s.length==40){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success({normalized:G.fromString("gh://"+(n==null?"":""+n+"@")+"github.com/"+e+"/"+t+"#"+s),dest:L.Computed((function(e){return[e.name,e.version,"github",s]})),url:G.fromString("https://"+(n==null?"":""+n+"@")+"github.com/"+e+"/"+t+"/archive/"+s+".tar.gz"),lib:new lix_client_LibVersion(u.Some(t),u.None)})))}else{var a=r;return X.next(this.grabCommit(e,t,a),doGet)}}},processUrl:function(e){var t=e.path;var r;if(t==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid github url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/client/sources/GitHub.hx",lineNumber:99,className:"lix.client.sources.GitHub",methodName:"processUrl"}))))}else{r=ae.toStringArray(ie.parts(t));if(r.length==2){var n=r[0];var i=r[1];return this.getArchive(n,lix_client_sources_Git.strip(i),e.hash,e.auth)}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid github url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/client/sources/GitHub.hx",lineNumber:102,className:"lix.client.sources.GitHub",methodName:"processUrl"}))))}}},__class__:lix_client_sources_GitHub};var lix_client_sources_GitLab=function(e){if(e==null){e=""}var t=StringTools.trim(e);var r;if(t==""){r=""}else{var n=t;r="private_token="+n}this.privateToken=r};t["lix.client.sources.GitLab"]=lix_client_sources_GitLab;lix_client_sources_GitLab.__name__="lix.client.sources.GitLab";lix_client_sources_GitLab.host=function(e){if(e==null){return"gitlab.com"}else{var t=e.host;if(t==null){return"gitlab.com"}else{var r=t;return r}}};lix_client_sources_GitLab.prototype={intercept:function(e){var t=e.auth;var t=e.hash;var t=e.host;var r=e.hosts;var r=e.path;var n=e.payload;var n=e.query;var i=e.scheme;var s=e.query==null?e.path:(e.path==null?"null":e.path)+"?"+(e.query==null?"null":e.query);if(t==null){return u.None}else{var s=ne.get_name(t);var a=ne.get_port(t);if(s==null){return u.None}else if(s=="gitlab.com"){if(i==null){return u.None}else if(i=="https"){if(n==null){if(se.toString(ie.parts(r)[0])=="api"==false){return u.Some(this.processUrl(e))}else{return u.None}}else if(se.toString(ie.parts(r)[0])=="api"==false){return u.Some(this.processUrl(e))}else{return u.None}}else{return u.None}}else{return u.None}}},schemes:function(){return["gitlab"]},grabCommit:function(e,t,r,n){return X.next(lix_client_Download.text("https://"+lix_client_sources_GitLab.host(n)+"/api/v4/projects/"+e+"%2F"+t+"/repository/commits/"+r+"?"+this.privateToken),(function(n){try{var i=JSON.parse(n);if(r==""){i=i[0]}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(i.id)))}catch(i){var n;if(r==null){n=""}else if(r==""){n=""}else{var s=r;n="#"+s}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Failed to lookup sha for gitlab:"+e+"/"+t+n,{fileName:"src/lix/client/sources/GitLab.hx",lineNumber:43,className:"lix.client.sources.GitLab",methodName:"grabCommit"}))))}}))},getArchive:function(e,t,r,n){if(r==null){var i=this;var s=e;var a=t;var l=n;var tmp=function(e){return i.getArchive(s,a,e,l)};return X.next(this.grabCommit(e,t,"",n),tmp)}else{var o=r;if(o.length==40){var c="https://"+lix_client_sources_GitLab.host(n)+"/api/v4/projects/"+e+"%2F"+t+"/repository/archive.zip?sha="+o+"&"+this.privateToken;var h=L.Computed((function(e){return[e.name,e.version,"gitlab",o]}));return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success({normalized:G.fromString(c),dest:h,url:G.fromString(c),lib:new lix_client_LibVersion(u.Some(t),u.None)})))}else{var d=r;var v=this;var m=e;var p=t;var _=n;var tmp=function(e){return v.getArchive(m,p,e,_)};return X.next(this.grabCommit(e,t,d,n),tmp)}}},processUrl:function(e){var t=e.path;var r;if(t==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid gitlab url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/client/sources/GitLab.hx",lineNumber:65,className:"lix.client.sources.GitLab",methodName:"processUrl"}))))}else{r=ae.toStringArray(ie.parts(t));if(r.length==2){var n=r[0];var i=r[1];return this.getArchive(n,lix_client_sources_Git.strip(i),e.hash,{host:e.host})}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid gitlab url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/client/sources/GitLab.hx",lineNumber:67,className:"lix.client.sources.GitLab",methodName:"processUrl"}))))}}},__class__:lix_client_sources_GitLab};var lix_client_sources_Haxelib=function(e){if(e==null){e="https://lib.haxe.org/"}this.baseURL=e};t["lix.client.sources.Haxelib"]=lix_client_sources_Haxelib;lix_client_sources_Haxelib.__name__="lix.client.sources.Haxelib";lix_client_sources_Haxelib.prototype={get_isOfficial:function(){return this.isOfficial=this.isOfficial!=null?this.isOfficial:"https://lib.haxe.org/"==this.baseURL},getBaseUrl:function(e){if(e==null){return G.fromString(this.baseURL)}else{var t=e.host;if(t==null){return G.fromString(this.baseURL)}else{var r=t;return G.fromString(""+(ne.get_port(r)==null?"https":"http")+"://"+(r==null?"null":r)+"/")}}},resolve:function(e,t){return G.resolve(this.getBaseUrl(t),e)},schemes:function(){return["haxelib"]},processUrl:function(e){var t=se.toString(le.toMap(e.query).h["url"]);if((t==null||t==this.baseURL)==true){var r=e.path;var n;if(r==null){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid haxelib url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/client/sources/Haxelib.hx",lineNumber:37,className:"lix.client.sources.Haxelib",methodName:"processUrl"}))))}else{n=ae.toStringArray(ie.parts(r));if(n.length==1){var i=n[0];return this.getArchive(i,e.hash,{host:e.host})}else{return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"invalid haxelib url "+(e==null?"null":G.toString(e)),{fileName:"src/lix/client/sources/Haxelib.hx",lineNumber:39,className:"lix.client.sources.Haxelib",methodName:"processUrl"}))))}}}else{var i=t;return new lix_client_sources_Haxelib(i).processUrl(e)}},getArchive:function(e,t,r){var n=this;return X.next(this.getInfos(e,r),(function(e){var i;if(r==null){i=u.None}else{var s=r.host;if(s==null){i=u.None}else{var a=s;i=u.Some(a)}}var l=!(i==u.None&&n.get_isOfficial());var o=e.name;if(t==null){var getVersions=function(t){var r=[];var n=0;var i=e.versions;while(n<i.length){var s=i[n];++n;var a=te.parse(s.name);var l;if(a._hx_index==0){var o=a.data;if(t==null||t(o)){l=o}else{continue}}else{continue}r.push(l)}var u=r;u.sort((function(e,t){return te.compare(t,e)}));return u};var s=getVersions((function(e){return e.preview==null}));if(s.length==0){t=getVersions()[0].toString()}else{var c=s;t=c[0].toString()}}else{var h=false;var s=0;var d=e.versions;while(s<d.length){var c=d[s];++s;if(c.name==t){h=true;break}}if(!h){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(new tink_core_TypedError(null,"Library "+o+" has no version "+t,{fileName:"src/lix/client/sources/Haxelib.hx",lineNumber:84,className:"lix.client.sources.Haxelib",methodName:"getArchive"}))))}}var v=n.resolve(G.fromString("/files/3.0/"+StringTools.replace(o,".",",")+"-"+StringTools.replace(t,".",",")+".zip"),r);var m;if(i._hx_index==0){var c=i.v;m=c}else{m=null}var p=G.make({scheme:"haxelib",host:m,path:ie.ofString("/"+o),hash:t,query:l?le.ofObj({url:n.baseURL}):null});var _=t;var m;if(l){var g=G.toString(n.getBaseUrl(r));m="@"+encodeURIComponent(g)}else{m=""}return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success({url:v,normalized:p,dest:L.Fixed([o,_,"haxelib"+m]),kind:F.Zip,lib:new lix_client_LibVersion(u.Some(o),u.Some(t))})))}))},getInfos:function(e,t){var r=this;var f=function(n,i){var s=haxe_remoting_HttpAsyncConnection.urlConnect(G.toString(r.resolve(G.fromString("/api/3.0/index.n"),t)));s.setErrorHandler((function(e){i(tink_core_TypedError.withData(null,"Failed to get version information from haxelib because "+e,e,{fileName:"src/lix/client/sources/Haxelib.hx",lineNumber:105,className:"lix.client.sources.Haxelib",methodName:"getInfos"}))}));var a=new lix_client_sources_haxelib_Proxy(s.resolve("api"));a.infos(e,n)};var f1=function(e,t){f(e,t);return null};var wakeup=function(e){return f1((function(t){e(w.Success(t))}),(function(t){e(w.Failure(t))}))};return new tink_core__$Future_SuspendableFuture((function(e,t){return wakeup(e)}))},__class__:lix_client_sources_Haxelib};var lix_client_sources_Web=function(e){this.interceptors=e};t["lix.client.sources.Web"]=lix_client_sources_Web;lix_client_sources_Web.__name__="lix.client.sources.Web";lix_client_sources_Web.prototype={schemes:function(){return["http","https"]},processUrl:function(e){var t=0;var r=this.interceptors;while(t<r.length){var n=r[t];++t;var i=n(e);if(i._hx_index==0){var s=i.v;return s}}var a=L.Computed((function(t){return[t.name,t.version,G.toString(e)]}));return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success({url:e,dest:a,normalized:e,lib:null})))},__class__:lix_client_sources_Web};var lix_client_sources_haxelib_Async_$Repo=function(e){this.__cnx=e};t["lix.client.sources.haxelib.Async_Repo"]=lix_client_sources_haxelib_Async_$Repo;lix_client_sources_haxelib_Async_$Repo.__name__="lix.client.sources.haxelib.Async_Repo";lix_client_sources_haxelib_Async_$Repo.prototype={infos:function(e,t){this.__cnx.resolve("infos").call([e],t)},__class__:lix_client_sources_haxelib_Async_$Repo};var lix_client_sources_haxelib_Proxy=function(e){lix_client_sources_haxelib_Async_$Repo.call(this,e)};t["lix.client.sources.haxelib.Proxy"]=lix_client_sources_haxelib_Proxy;lix_client_sources_haxelib_Proxy.__name__="lix.client.sources.haxelib.Proxy";lix_client_sources_haxelib_Proxy.__super__=lix_client_sources_haxelib_Async_$Repo;lix_client_sources_haxelib_Proxy.prototype=$extend(lix_client_sources_haxelib_Async_$Repo.prototype,{__class__:lix_client_sources_haxelib_Proxy});var lix_client_uncompress_Tar=function(){};t["lix.client.uncompress.Tar"]=lix_client_uncompress_Tar;lix_client_uncompress_Tar.__name__="lix.client.uncompress.Tar";lix_client_uncompress_Tar.parse=function(e,t){return Y.async((function(r){var n=0;var i=0;var s=new V({onentry:function(e){n+=1;t(e)}});s.on("warn",(function(){i+=1}));s.on("end",(function(){r(n==0&&i!=0?w.Failure(new tink_core_TypedError(422,"Invalid tar archive.",{fileName:"src/lix/client/uncompress/Tar.hx",lineNumber:23,className:"lix.client.uncompress.Tar",methodName:"parse"})):w.Success(null))}));s.on("error",(function(e){r(w.Failure(new tink_core_TypedError(null,e.message,{fileName:"src/lix/client/uncompress/Tar.hx",lineNumber:26,className:"lix.client.uncompress.Tar",methodName:"parse"})))}));e.pipe(s,{end:true})}))};var V=r(4674).Parse;var sys_io_File=function(){};t["sys.io.File"]=sys_io_File;sys_io_File.__name__="sys.io.File";sys_io_File.copy=function(e,t){var r=g.openSync(e,"r");var n=g.fstatSync(r);var i=g.openSync(t,"w",n.mode);var s;var a=0;while(true){s=g.readSync(r,sys_io_File.copyBuf,0,65536,a);if(!(s>0)){break}g.writeSync(i,sys_io_File.copyBuf,0,s);a+=s}g.closeSync(r);g.closeSync(i)};var sys_io_FileInput=function(e){this.hasReachedEof=false;this.fd=e;this.pos=0};t["sys.io.FileInput"]=sys_io_FileInput;sys_io_FileInput.__name__="sys.io.FileInput";sys_io_FileInput.__super__=haxe_io_Input;sys_io_FileInput.prototype=$extend(haxe_io_Input.prototype,{readByte:function(){var e=O.alloc(1);var t;try{t=g.readSync(this.fd,e,0,1,this.pos)}catch(e){var r=haxe_Exception.caught(e).unwrap();if(r.code=="EOF"){this.hasReachedEof=true;throw haxe_Exception.thrown(new haxe_io_Eof)}throw haxe_Exception.thrown(h.Custom(r))}if(t==0){this.hasReachedEof=true;throw haxe_Exception.thrown(new haxe_io_Eof)}this.pos++;return e[0]},readBytes:function(e,t,r){var n=e.b;var i=O.from(n.buffer,n.byteOffset,e.length);var s;try{s=g.readSync(this.fd,i,t,r,this.pos)}catch(e){var a=haxe_Exception.caught(e).unwrap();if(a.code=="EOF"){this.hasReachedEof=true;throw haxe_Exception.thrown(new haxe_io_Eof)}throw haxe_Exception.thrown(h.Custom(a))}if(s==0){this.hasReachedEof=true;throw haxe_Exception.thrown(new haxe_io_Eof)}this.pos+=s;return s},__class__:sys_io_FileInput});var G={};G.resolve=function(e,t){if(t.scheme!=null){return t}else if(t.host!=null){if(t.scheme!=null){return t}else{var r=Reflect.copy(t);r.scheme=e.scheme;return r}}else{var n={path:ie.join(e.path,t.path),payload:"",scheme:e.scheme,query:t.query,auth:e.auth,host:e.host,hash:t.hash};G.makePayload(n);return n}};G.makePayload=function(e){var t="";var r=e.auth;var n=e.hash;var n=e.host;var i=e.hosts;var i=e.path;var i=e.payload;var i=e.query;var i=e.scheme;if(r==null){if(n!=null){var s=n;t+="//"+(s==null?"null":s)}}else if(n==null){var a=r;t+="//"+(a==null?"null":a==null?"":""+a+"@")}else{var a=r;var s=n;t+="//"+(a==null?"null":a==null?"":""+a+"@")+(s==null?"null":s)}t+=e.path==null?"null":e.path;var r=e.query;if(r!=null){var l=r;t+="?"+(l==null?"null":l)}var r=e.hash;if(r!=null){var l=r;t+="#"+l}e.payload=t.toString()};G.toString=function(e){if(e.scheme==null){return e.payload}else{return""+e.scheme+":"+e.payload}};G.fromString=function(e){return G.parse(e)};G.noop=function(e){};G.parse=function(e,t){if(e==null){return G.parse("")}if(t==null){t=G.noop}e=StringTools.trim(e);if(StringTools.startsWith(e,"data:")){return{scheme:"data",payload:HxOverrides.substr(e,5,null)}}var r=new EReg("^(([a-zA-Z][a-zA-Z0-9\\-+.]*):)?((//(([^@/]+)@)?([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?)$","");var n=new EReg("^(\\[(.*)\\]|([^:]*))(:(.*))?$","");r.match(e);var i;var s=r.matched(7);if(s==null){i=[]}else{var a=s;var s=[];var l=0;var o=a.split(",");while(l<o.length){var u=o[l];++l;n.match(u);var c;var h=n.matched(3);var d=n.matched(2);if(d==null){var v=h;c=v}else if(h==null){var m=d;c="["+m+"]"}else{t("invalid host "+u);c=null}var p;var _=n.matched(5);if(_==null){p=null}else{var a=_;var g=Std.parseInt(a);if(g==null){t("invalid port "+a);p=null}else{var w=g;p=w}}s.push(ne._new(c,p))}i=s}var x=r.matched(8);if(i.length>0&&x.charAt(0)!="/"){x="/"+x}return{scheme:r.matched(2),payload:r.matched(3),host:i[0],hosts:i,auth:r.matched(6),path:ie.ofString(x),query:r.matched(10),hash:r.matched(12)}};G.make=function(e){var t={payload:"",path:e.path,query:e.query,host:e.host,hosts:e.hosts,auth:e.auth,scheme:e.scheme,hash:e.hash};G.makePayload(t);return t};var $={};$.invoke=function(e,t){if($.depth<500){$.depth++;e(t);$.depth--}else{$.defer((function(){e(t)}))}};$.defer=function(e){global.setImmediate(e)};var tink_core_LinkObject=function(){};t["tink.core.LinkObject"]=tink_core_LinkObject;tink_core_LinkObject.__name__="tink.core.LinkObject";tink_core_LinkObject.__isInterface__=true;tink_core_LinkObject.prototype={__class__:tink_core_LinkObject};var tink_core_CallbackLinkRef=function(){};t["tink.core.CallbackLinkRef"]=tink_core_CallbackLinkRef;tink_core_CallbackLinkRef.__name__="tink.core.CallbackLinkRef";tink_core_CallbackLinkRef.__interfaces__=[tink_core_LinkObject];tink_core_CallbackLinkRef.prototype={cancel:function(){var e=this.link;if(e!=null){e.cancel()}},__class__:tink_core_CallbackLinkRef};var q={};q.fromMany=function(e){return new tink_core_SimpleLink((function(){if(e!=null){var t=0;while(t<e.length){var r=e[t];++t;if(r!=null){r.cancel()}}}else{e=null}}))};var tink_core_SimpleLink=function(e){this.f=e};t["tink.core.SimpleLink"]=tink_core_SimpleLink;tink_core_SimpleLink.__name__="tink.core.SimpleLink";tink_core_SimpleLink.__interfaces__=[tink_core_LinkObject];tink_core_SimpleLink.prototype={cancel:function(){if(this.f!=null){this.f();this.f=null}},__class__:tink_core_SimpleLink};var tink_core__$Callback_LinkPair=function(e,t){this.dissolved=false;this.a=e;this.b=t};t["tink.core._Callback.LinkPair"]=tink_core__$Callback_LinkPair;tink_core__$Callback_LinkPair.__name__="tink.core._Callback.LinkPair";tink_core__$Callback_LinkPair.__interfaces__=[tink_core_LinkObject];tink_core__$Callback_LinkPair.prototype={cancel:function(){if(!this.dissolved){this.dissolved=true;var e=this.a;if(e!=null){e.cancel()}var e=this.b;if(e!=null){e.cancel()}this.a=null;this.b=null}},__class__:tink_core__$Callback_LinkPair};var tink_core__$Callback_ListCell=function(e,t){if(e==null){throw haxe_Exception.thrown("callback expected but null received")}this.cb=e;this.list=t};t["tink.core._Callback.ListCell"]=tink_core__$Callback_ListCell;tink_core__$Callback_ListCell.__name__="tink.core._Callback.ListCell";tink_core__$Callback_ListCell.__interfaces__=[tink_core_LinkObject];tink_core__$Callback_ListCell.prototype={cancel:function(){if(this.list!=null){var e=this.list;this.cb=null;this.list=null;if(--e.used<=e.cells.length>>1){e.compact()}}},__class__:tink_core__$Callback_ListCell};var tink_core_Disposable=function(){};t["tink.core.Disposable"]=tink_core_Disposable;tink_core_Disposable.__name__="tink.core.Disposable";tink_core_Disposable.__isInterface__=true;var tink_core_OwnedDisposable=function(){};t["tink.core.OwnedDisposable"]=tink_core_OwnedDisposable;tink_core_OwnedDisposable.__name__="tink.core.OwnedDisposable";tink_core_OwnedDisposable.__isInterface__=true;tink_core_OwnedDisposable.__interfaces__=[tink_core_Disposable];var tink_core_SimpleDisposable=function(e){this.disposeHandlers=[];this.f=e};t["tink.core.SimpleDisposable"]=tink_core_SimpleDisposable;tink_core_SimpleDisposable.__name__="tink.core.SimpleDisposable";tink_core_SimpleDisposable.__interfaces__=[tink_core_OwnedDisposable];tink_core_SimpleDisposable.noop=function(){};tink_core_SimpleDisposable.prototype={dispose:function(){var e=this.disposeHandlers;if(e!=null){var t=e;this.disposeHandlers=null;var r=this.f;this.f=tink_core_SimpleDisposable.noop;r();var e=0;while(e<t.length){var n=t[e];++e;n()}}},__class__:tink_core_SimpleDisposable};var tink_core_CallbackList=function(e){if(e==null){e=false}this.onfill=function(){};this.ondrain=function(){};this.busy=false;this.queue=[];this.used=0;var t=this;tink_core_SimpleDisposable.call(this,(function(){if(!t.busy){t.destroy()}}));this.destructive=e;this.cells=[]};t["tink.core.CallbackList"]=tink_core_CallbackList;tink_core_CallbackList.__name__="tink.core.CallbackList";tink_core_CallbackList.__super__=tink_core_SimpleDisposable;tink_core_CallbackList.prototype=$extend(tink_core_SimpleDisposable.prototype,{destroy:function(){var e=0;var t=this.cells;while(e<t.length){var r=t[e];++e;r.cb=null;r.list=null}this.queue=null;this.cells=null;if(this.used>0){this.used=0;var n=this.ondrain;if($.depth<500){$.depth++;n();$.depth--}else{$.defer(n)}}},invoke:function(e){var t=this;if($.depth<500){$.depth++;if(t.disposeHandlers!=null){if(t.busy){if(t.destructive!=true){var r=t;var n=e;var tmp=function(){r.invoke(n)};t.queue.push(tmp)}}else{t.busy=true;if(t.destructive){t.dispose()}var i=t.cells.length;var s=0;var a=i;while(s<a){var l=s++;var o=t.cells[l];if(o.list!=null){o.cb(e)}}t.busy=false;if(t.disposeHandlers==null){t.destroy()}else{if(t.used<t.cells.length){t.compact()}if(t.queue.length>0){t.queue.shift()()}}}}$.depth--}else{$.defer((function(){if(t.disposeHandlers!=null){if(t.busy){if(t.destructive!=true){var r=t;var n=e;var tmp=function(){r.invoke(n)};t.queue.push(tmp)}}else{t.busy=true;if(t.destructive){t.dispose()}var i=t.cells.length;var s=0;var a=i;while(s<a){var l=s++;var o=t.cells[l];if(o.list!=null){o.cb(e)}}t.busy=false;if(t.disposeHandlers==null){t.destroy()}else{if(t.used<t.cells.length){t.compact()}if(t.queue.length>0){t.queue.shift()()}}}}}))}},compact:function(){if(this.busy){return}else if(this.used==0){this.resize(0);var e=this.ondrain;if($.depth<500){$.depth++;e();$.depth--}else{$.defer(e)}}else{var t=0;var r=0;var n=this.cells.length;while(r<n){var i=r++;var s=this.cells[i];var a=s.list;if(s.cb!=null){var l=s;if(t!=i){this.cells[t]=l}if(++t==this.used){break}}}this.resize(this.used)}},resize:function(e){this.cells.length=e},__class__:tink_core_CallbackList});var tink_core_TypedError=function(e,t,r){if(e==null){e=500}this.isTinkError=true;this.code=e;this.message=t;this.pos=r;this.exceptionStack=[];this.callStack=[]};t["tink.core.TypedError"]=tink_core_TypedError;tink_core_TypedError.__name__="tink.core.TypedError";tink_core_TypedError.withData=function(e,t,r,n){return tink_core_TypedError.typed(e,t,r,n)};tink_core_TypedError.typed=function(e,t,r,n){var i=new tink_core_TypedError(e,t,n);i.data=r;return i};tink_core_TypedError.asError=function(e){if(e!=null&&e.isTinkError){return e}else{return null}};tink_core_TypedError.catchExceptions=function(e,t,r){try{return w.Success(e())}catch(e){var n=haxe_Exception.caught(e).unwrap();var i=tink_core_TypedError.asError(n);var s;if(i==null){s=t==null?tink_core_TypedError.withData(null,"Unexpected Error",n,r):t(n)}else{var a=i;s=a}return w.Failure(s)}};tink_core_TypedError.tryFinally=function(e,t){try{return e()}finally{t()}return null};tink_core_TypedError.prototype={printPos:function(){return this.pos.className+"."+this.pos.methodName+":"+this.pos.lineNumber},toString:function(){var e="Error#"+this.code+": "+this.message;if(this.pos!=null){e+=" @ "+this.printPos()}return e},throwSelf:function(){var e=this;throw haxe_Exception.thrown(e)},__class__:tink_core_TypedError};var tink_core__$Future_FutureObject=function(){};t["tink.core._Future.FutureObject"]=tink_core__$Future_FutureObject;tink_core__$Future_FutureObject.__name__="tink.core._Future.FutureObject";tink_core__$Future_FutureObject.prototype={getStatus:function(){return Z.NeverEver},handle:function(e){return null},eager:function(){},__class__:tink_core__$Future_FutureObject};var tink_core__$Future_SyncFuture=function(e){tink_core__$Future_FutureObject.call(this);this.value=e};t["tink.core._Future.SyncFuture"]=tink_core__$Future_SyncFuture;tink_core__$Future_SyncFuture.__name__="tink.core._Future.SyncFuture";tink_core__$Future_SyncFuture.__super__=tink_core__$Future_FutureObject;tink_core__$Future_SyncFuture.prototype=$extend(tink_core__$Future_FutureObject.prototype,{getStatus:function(){return Z.Ready(this.value)},handle:function(e){$.invoke(e,_.get(this.value));return null},eager:function(){if(!this.value.isComputed()){_.get(this.value)}},__class__:tink_core__$Future_SyncFuture});var Y={};Y.never=function(){return Y.NEVER_INST};Y.map=function(e,t,r){var n=e.getStatus();switch(n._hx_index){case 3:var i=n.result;var s=i;var a=t;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyFunc((function(){return a(s.get())}),s));case 4:return Y.never();default:return new tink_core__$Future_SuspendableFuture((function(r,n){return e.handle((function(e){r(t(e))}))}))}};Y.flatMap=function(e,t,r){var n=e.getStatus();switch(n._hx_index){case 3:var i=n.result;return new tink_core__$Future_SuspendableFuture((function(e,r){return t(_.get(i)).handle((function(t){e(t)}))}));case 4:return Y.never();default:return new tink_core__$Future_SuspendableFuture((function(r,n){var i=new tink_core_CallbackLinkRef;var s=e.handle((function(e){var s=t(e);if(s.getStatus()._hx_index==4){n()}else{var a=s;var l=a.handle(r);var o=i.link;if(o!=null){o.cancel()}i.link=l}}));return new tink_core__$Callback_LinkPair(s,i)}))}};Y.inSequence=function(e){return Y.many(e,1)};Y.many=function(e,t){return Y.processMany(e,t,w.Success,(function(e){return tink_core_OutcomeTools.orNull(e)}))};Y.processMany=function(e,t,r,n){if(e.length==0){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(n(w.Success([]))))}else{var wakeup=function(i){var s=[];var a=[];var l=0;while(l<e.length){var o=e[l];++l;a.push(null)}var u=a;var c=0;var h=0;var d=false;var v;if(t==null){v=e.length}else{var m=t;v=m<1?1:m>e.length?e.length:m}var fireWhenReady=function(){if(c==u.length){if(h==0){var e=n(w.Success(u));d=true;i(e);return true}else{return false}}else{return false}};var p=null;p=function(){if(!d&&!fireWhenReady()){while(c<u.length){c+=1;var t=[c-1];var a=e[t[0]];var l=[function(e){return function(t){var a=r(t);switch(a._hx_index){case 0:var l=a.data;u[e[0]]=l;fireWhenReady();break;case 1:var o=a.failure;var a=0;while(a<s.length){var c=s[a];++a;if(c!=null){c.cancel()}}var l=n(w.Failure(o));d=true;i(l);break}}}(t)];var o=a.getStatus();if(o._hx_index==3){var v;v=_.get(o.result);var m=v;l[0](m);if(!d){continue}}else{h+=1;s.push(a.handle(function(e){return function(t){h-=1;e[0](t);if(!d){p()}}}(l)))}break}}};var a=0;var l=v;while(a<l){var g=a++;p()}return q.fromMany(s)};return new tink_core__$Future_SuspendableFuture((function(e,t){return wakeup(e)}))}};Y.async=function(e,t){if(t==null){t=false}var r=Y.irreversible(e);if(t){return r}else{r.eager();return r}};Y.irreversible=function(e){return new tink_core__$Future_SuspendableFuture((function(t,r){e(t);return null}))};Y.delay=function(e,t){var r=Y.irreversible((function(r){haxe_Timer.delay((function(){r(_.get(t))}),e)}));r.eager();return r};var Z=n["tink.core.FutureStatus"]={__ename__:"tink.core.FutureStatus",__constructs__:null,Suspended:{_hx_name:"Suspended",_hx_index:0,__enum__:"tink.core.FutureStatus",toString:$estr},Awaited:{_hx_name:"Awaited",_hx_index:1,__enum__:"tink.core.FutureStatus",toString:$estr},EagerlyAwaited:{_hx_name:"EagerlyAwaited",_hx_index:2,__enum__:"tink.core.FutureStatus",toString:$estr},Ready:(i=function(e){return{_hx_index:3,result:e,__enum__:"tink.core.FutureStatus",toString:$estr}},i._hx_name="Ready",i.__params__=["result"],i),NeverEver:{_hx_name:"NeverEver",_hx_index:4,__enum__:"tink.core.FutureStatus",toString:$estr}};Z.__constructs__=[Z.Suspended,Z.Awaited,Z.EagerlyAwaited,Z.Ready,Z.NeverEver];var tink_core__$Future_SuspendableFuture=function(e){this.status=Z.Suspended;var t=this;tink_core__$Future_FutureObject.call(this);this.wakeup=e;this.callbacks=new tink_core_CallbackList(true);this.callbacks.ondrain=function(){if(t.status==Z.Awaited){t.status=Z.Suspended;var e=t.link;if(e!=null){e.cancel()}t.link=null}};this.callbacks.onfill=function(){if(t.status==Z.Suspended){t.status=Z.Awaited;t.arm()}}};t["tink.core._Future.SuspendableFuture"]=tink_core__$Future_SuspendableFuture;tink_core__$Future_SuspendableFuture.__name__="tink.core._Future.SuspendableFuture";tink_core__$Future_SuspendableFuture.__super__=tink_core__$Future_FutureObject;tink_core__$Future_SuspendableFuture.prototype=$extend(tink_core__$Future_FutureObject.prototype,{getStatus:function(){return this.status},trigger:function(e){var t=this.status;if(t._hx_index==3){var r=t.result}else{this.status=Z.Ready(new tink_core__$Lazy_LazyConst(e));var n=this.link;this.link=null;this.wakeup=null;this.callbacks.invoke(e);if(n!=null){n.cancel()}}},handle:function(e){var t=this.status;if(t._hx_index==3){var r=t.result;$.invoke(e,_.get(r));return null}else{var n=this.callbacks;if(n.disposeHandlers==null){return null}else{var i=new tink_core__$Callback_ListCell(e,n);n.cells.push(i);if(n.used++==0){var s=n.onfill;if($.depth<500){$.depth++;s();$.depth--}else{$.defer(s)}}return i}}},destroy:function(){this.callbacks.dispose();this.status=Z.NeverEver},arm:function(){var e=this;this.link=this.wakeup((function(t){e.trigger(t)}),$bind(this,this.destroy))},eager:function(){switch(this.status._hx_index){case 0:this.status=Z.EagerlyAwaited;this.arm();break;case 1:this.status=Z.EagerlyAwaited;break;default:}},__class__:tink_core__$Future_SuspendableFuture});var tink_core__$Lazy_LazyFunc=function(e,t){this.f=e;this.from=t};t["tink.core._Lazy.LazyFunc"]=tink_core__$Lazy_LazyFunc;tink_core__$Lazy_LazyFunc.__name__="tink.core._Lazy.LazyFunc";tink_core__$Lazy_LazyFunc.__interfaces__=[tink_core__$Lazy_LazyObject];tink_core__$Lazy_LazyFunc.prototype={underlying:function(){return this.from},isComputed:function(){return this.f==null},get:function(){return this.result},compute:function(){var e=this.f;if(e!=null){var t=e;this.f=null;var e=this.from;if(e!=null){var r=e;this.from=null;var n=[];while(r!=null&&!r.isComputed()){n.push(r);r=r.underlying()}n.reverse();var e=0;while(e<n.length){var i=n[e];++e;i.compute()}}this.result=t()}},__class__:tink_core__$Lazy_LazyFunc};var tink_core_NamedWith=function(e,t){this.name=e;this.value=t};t["tink.core.NamedWith"]=tink_core_NamedWith;tink_core_NamedWith.__name__="tink.core.NamedWith";tink_core_NamedWith.prototype={__class__:tink_core_NamedWith};var tink_core_OutcomeTools=function(){};t["tink.core.OutcomeTools"]=tink_core_OutcomeTools;tink_core_OutcomeTools.__name__="tink.core.OutcomeTools";tink_core_OutcomeTools.sure=function(e){switch(e._hx_index){case 0:var t=e.data;return t;case 1:var r=e.failure;var n=tink_core_TypedError.asError(r);if(n==null){throw haxe_Exception.thrown(r)}else{var i=n;return i.throwSelf()}break}};tink_core_OutcomeTools.orNull=function(e){switch(e._hx_index){case 0:var t=e.data;return t;case 1:var r=e.failure;return null}};tink_core_OutcomeTools.map=function(e,t){switch(e._hx_index){case 0:var r=e.data;return w.Success(t(r));case 1:var n=e.failure;return w.Failure(n)}};var X={};X.never=function(){return Y.never()};X.mapError=function(e,t){return Y.map(e,(function(e){switch(e._hx_index){case 0:var r=e.data;return e;case 1:var n=e.failure;return w.Failure(t(n))}}))};X.noise=function(e){if(e.getStatus()._hx_index==4){return X.never()}else{return X.next(e,(function(e){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)))}))}};X.next=function(e,t,r){return Y.flatMap(e,(function(e){switch(e._hx_index){case 0:var r=e.data;return t(r);case 1:var n=e.failure;return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Failure(n)))}}))};X.inParallel=function(e,t){return X.many(e,t)};X.many=function(e,t){return Y.processMany(e,t,(function(e){return e}),(function(e){return e}))};X.inSequence=function(e){return X.many(e,1)};var K={};K.ofSafeSync=function(e){return function(t){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(e(t))))}};var J={};J.ofSync=function(e){return function(t){return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(e(t)))}};var tink_parse_Char=function(){};t["tink.parse.Char"]=tink_parse_Char;tink_parse_Char.__name__="tink.parse.Char";var tink_parse_ParserBase=function(e){this.source=e;this.max=e.length;this.pos=0};t["tink.parse.ParserBase"]=tink_parse_ParserBase;tink_parse_ParserBase.__name__="tink.parse.ParserBase";tink_parse_ParserBase.prototype={skipIgnored:function(){while(this.lastSkip!=this.pos){this.lastSkip=this.pos;this.doSkipIgnored()}this.lastSkip=this.pos;return null},doSkipIgnored:function(){},allowHere:function(e){if(Q.hasSub(this.source,e,this.pos)){this.pos+=e.length;return true}else{return false}},die:function(e,t){if(t==null){t=new IntIterator(this.pos,this.pos+1)}var r=t.min;var n=t.max;throw haxe_Exception.thrown(this.makeError(e,this.doMakePos(r,n==null?r+1:n)))},makeError:function(e,t){throw haxe_Exception.thrown("ni")},doMakePos:function(e,t){throw haxe_Exception.thrown("ni")},__class__:tink_parse_ParserBase};var tink_parse__$StringSlice_Data=function(e,t,r){this.string=e;this.start=t;this.end=r;if((this.length=r-t)<0){this.length=0;this.end=this.start}};t["tink.parse._StringSlice.Data"]=tink_parse__$StringSlice_Data;tink_parse__$StringSlice_Data.__name__="tink.parse._StringSlice.Data";tink_parse__$StringSlice_Data.prototype={toString:function(){if(this.representation==null){this.representation=this.string.substring(this.start,this.end)}return this.representation},__class__:tink_parse__$StringSlice_Data};var Q={};Q._new=function(e,t,r){return new tink_parse__$StringSlice_Data(e,t==e.length?t:t<0?t%e.length+e.length:t%e.length,r==e.length?r:r<0?r%e.length+e.length:r%e.length)};Q.clamp=function(e,t){if(t<0){if(-t>e.length){return 0}else{return t+e.length}}else if(t>e.length){return e.length}else{return t}};Q.wrap=function(e,t){if(e.length==0){return 0}else if(t<0){return t%e.length+e.length}else{return t%e.length}};Q.ofString=function(e){if(e==null||e==""){return Q.EMPTY}else if(e.length==1){var t=e.charCodeAt(0);if(t<Q.CHARS.length){return Q.CHARS[t]}else{return new tink_parse__$StringSlice_Data(e,0,e.length)}}else{return new tink_parse__$StringSlice_Data(e,0,e.length)}};Q.hasSub=function(e,t,r){if(r==null){r=0}r=Q.wrap(e,r);if(r+t.length>e.length){return false}var n=e;var i=t;return Q.isEqual(n.string,n.start+r,t.length,i.string,i.start,i.length)};Q.isEqual=function(e,t,r,n,i,s){if(s!=r){return false}var a=0;var l=s;while(a<l){var o=a++;if(e.charCodeAt(t+o)!=n.charCodeAt(i+o)){return false}}return true};var tink_semver_Parser=function(e){tink_parse_ParserBase.call(this,e)};t["tink.semver.Parser"]=tink_semver_Parser;tink_semver_Parser.__name__="tink.semver.Parser";tink_semver_Parser.__super__=tink_parse_ParserBase;tink_semver_Parser.prototype=$extend(tink_parse_ParserBase.prototype,{doSkipIgnored:function(){var e=tink_parse_Char.WHITE;while(true){var t;if(this.pos<this.max){var r=this.source;var n=r.string.charCodeAt(this.pos+r.start);t=e==null||e(n)}else{t=false}if(!t){break}this.pos++}},num:function(){var e=tink_parse_Char.DIGIT;this.skipIgnored();var t=this.pos;while(true){var r;if(this.pos<this.max){var n=this.source;var i=n.string.charCodeAt(this.pos+n.start);r=e==null||e(i)}else{r=false}if(!r){break}this.pos++}var n=this.source;var s=t;var a=this.pos;var r=Std.parseInt(Q._new(n.string,Q.wrap(n,s)+n.start,Q.clamp(n,a)+n.start).toString());if(r==null){return-1}else{var l=r;return l}},parseVersion:function(){var e=this.parseInlineVersion();this.skipIgnored();if(this.pos==this.max){return e}else{return this.die("Unexpected string",new IntIterator(this.pos,this.max))}},parsePartial:function(){var e=this;var t=this.pos;var next=function(){if(e.allowHere(Q.ofString("."))){return e.num()}else{return-1}};var r=this.num();var n=next();var i=next();var s=null;var a=-1;if(i>=0&&this.allowHere(tink_semver_Parser.HYPHEN)){var l=tink_parse_Char.LOWER;this.skipIgnored();var o=this.pos;while(true){var u;if(this.pos<this.max){var c=this.source;var h=c.string.charCodeAt(this.pos+c.start);u=l==null||l(h)}else{u=false}if(!u){break}this.pos++}var c=this.source;var d=o;var v=this.pos;s=tink_core_OutcomeTools.sure(ee.ofString(Q._new(c.string,Q.wrap(c,d)+c.start,Q.clamp(c,v)+c.start).toString()));if(this.allowHere(tink_semver_Parser.DOT)){a=this.num()}}return{major:r,minor:n,patch:i,preview:s,previewNum:a,pos:new IntIterator(t,this.pos)}},clamp:function(e){if(e<0){return 0}else{return e}},full:function(e,t){if(t!=true&&e.patch<0){this.die("Partial version not allowed",e.pos)}var r=te._new(e.major,this.clamp(e.minor),this.clamp(e.patch));if(e.preview!=null){return new tink_semver__$Version_Data(r.major,r.minor,r.patch,e.preview,e.previewNum)}else{return r}},parseInlineVersion:function(){return this.full(this.parsePartial())},makeError:function(e,t){var r=this.source;var n=Q._new(r.string,Q.wrap(r,t.min)+r.start,Q.clamp(r,t.max)+r.start);return new tink_core_TypedError(null,""+e+" at "+('"'+(n==null?"null":n.toString())+'"('+t.min+"-"+t.max+")")+(' in "'+(this.source==null?"null":this.source.toString())+'"'),{fileName:"tink/semver/Parser.hx",lineNumber:149,className:"tink.semver.Parser",methodName:"makeError"})},doMakePos:function(e,t){return new IntIterator(e,t)},__class__:tink_semver_Parser});var ee={};ee.ofString=function(e){switch(e){case"alpha":return w.Success("alpha");case"beta":return w.Success("beta");case"rc":return w.Success("rc");default:return w.Failure(new tink_core_TypedError(422,""+e+" should be alpha | beta | rc",{fileName:"tink/semver/Preview.hx",lineNumber:14,className:"tink.semver._Preview.Preview_Impl_",methodName:"ofString"}))}};var te={};te._new=function(e,t,r){if(r==null){r=0}if(t==null){t=0}return new tink_semver__$Version_Data(e,t,r)};te.compare=function(e,t){var r=e.major-t.major;var n=e.minor-t.minor;var i=re.chain(r>0?1:r<0?-1:0,n>0?1:n<0?-1:0);var r=e.patch-t.patch;var s=re.chain(i,r>0?1:r<0?-1:0);var r=te.idx(e,e.preview)-te.idx(e,t.preview);var i=re.chain(s,r>0?1:r<0?-1:0);var r=e.previewNum-t.previewNum;return re.chain(i,r>0?1:r<0?-1:0)};te.idx=function(e,t){if(t==null){return 100}else{switch(t){case"alpha":return 1;case"beta":return 2;case"rc":return 3}}};te.parse=function(e){return tink_core_TypedError.catchExceptions((i=new tink_semver_Parser(Q.ofString(e)),$bind(i,i.parseVersion)),te.reportError,{fileName:"tink/semver/Version.hx",lineNumber:97,className:"tink.semver._Version.Version_Impl_",methodName:"parse"})};te.reportError=function(e){if(typeof e=="string"){return new tink_core_TypedError(422,e,{fileName:"tink/semver/Version.hx",lineNumber:103,className:"tink.semver._Version.Version_Impl_",methodName:"reportError"})}else{return tink_core_TypedError.withData(422,Std.string(e),e,{fileName:"tink/semver/Version.hx",lineNumber:105,className:"tink.semver._Version.Version_Impl_",methodName:"reportError"})}};var tink_semver__$Version_Data=function(e,t,r,n,i){if(i==null){i=-1}if(e<0||t<0||r<0){throw haxe_Exception.thrown("version components must not be negative")}this.major=e;this.minor=t;this.patch=r;this.preview=n;this.previewNum=i};t["tink.semver._Version.Data"]=tink_semver__$Version_Data;tink_semver__$Version_Data.__name__="tink.semver._Version.Data";tink_semver__$Version_Data.prototype={toString:function(){var e=""+this.major+"."+this.minor+"."+this.patch;if(this.preview!=null){e+="-"+this.preview;if(this.previewNum!=-1){e+="."+this.previewNum}}return e},__class__:tink_semver__$Version_Data};var re={};re.chain=function(e,t){if(e==0){return t}else{return e}};var ne={};ne._new=function(e,t){var r;if(t==null){r=e}else if(t>65535||t<=0){throw haxe_Exception.thrown("Invalid port")}else{r=""+e+":"+t}return r};ne.get_name=function(e){if(e==null){return null}else{var t=e.split("]");switch(t.length){case 1:var r=t[0];return r.split(":")[0];case 2:var n=t[1];var r=t[0];return r+"]";default:throw haxe_Exception.thrown("assert")}}};ne.get_port=function(e){if(e==null){return null}else{var t=e.split("]");switch(t.length){case 1:var r=t[0];var n=r.split(":")[1];if(n==null){return null}else{var i=n;return Std.parseInt(i)}break;case 2:var n=t[0];var r=t[1];var t=r.split(":")[1];if(t==null){return null}else{var i=t;return Std.parseInt(i)}break;default:throw haxe_Exception.thrown("assert")}}};var ie={};ie.parts=function(e){var t=[];var r=0;var n=e.split("/");while(r<n.length){var i=n[r];++r;if(i!=""){t.push(i)}}return t};ie.join=function(e,t){if(t==""){return e}else if(t.charAt(0)=="/"){return t}else if(e.charAt(e.length-1)=="/"){return ie.ofString(e+t)}else{var r=e.lastIndexOf("/");if(r==-1){return t}else{var n=r;return ie.ofString(HxOverrides.substr(e,0,n+1)+(t==null?"null":t))}}};ie.ofString=function(e){return ie.normalize(e)};ie.normalize=function(e){e=StringTools.trim(StringTools.replace(e,"\\","/"));if(e=="."){return"./"}var t=StringTools.endsWith(e,"/..")||StringTools.endsWith(e,"/")||StringTools.endsWith(e,"/.");var r=[];var n=StringTools.startsWith(e,"/");var i=0;var s=0;var a=e.split("/");while(s<a.length){var l=a[s];++s;var o=StringTools.trim(l);switch(o){case"":break;case".":break;case"..":if(r.pop()==null){++i}break;default:var u=o;r.push(u)}}if(n){r.unshift("")}else{var s=0;var a=i;while(s<a){var c=s++;r.unshift("..")}}if(t){r.push("")}return r.join("/")};var se={};se.toString=function(e){if(e==null){return null}else{return decodeURIComponent(e.split("+").join(" "))}};se.ofString=function(e){return e==null?"":encodeURIComponent(e)};var ae={};ae.toStringArray=function(e){var t=[];var r=0;while(r<e.length){var n=e[r];++r;t.push(se.toString(n))}return t};var le={};le.toMap=function(e){var t=new haxe_ds_StringMap;var r=new tink_url__$Query_QueryStringParser(e,"&","=",0);while(r.hasNext()){var n=r.next();t.h[n.name.toString()]=n.value}return t};le.ofObj=function(e){var t=[];var r=e;var n=0;var i=Reflect.fields(r);while(n<i.length){var s=i[n];++n;t.push(se.ofString(s)+"="+se.ofString(r[s]))}return t.join("&")};var tink_url__$Query_QueryStringParser=function(e,t,r,n){this.s=e==null?"":e;this.sep=t;this.set=r;this.pos=n};t["tink.url._Query.QueryStringParser"]=tink_url__$Query_QueryStringParser;tink_url__$Query_QueryStringParser.__name__="tink.url._Query.QueryStringParser";tink_url__$Query_QueryStringParser.trimmedSub=function(e,t,r){if(t>=e.length){return""}while(e.charCodeAt(t)<33)++t;if(r<e.length-1){while(e.charCodeAt(r-1)<33)--r}return e.substring(t,r)};tink_url__$Query_QueryStringParser.prototype={hasNext:function(){return this.pos<this.s.length},next:function(){var e=this.s.indexOf(this.sep,this.pos);if(e==-1){e=this.s.length}var t=this.s.indexOf(this.set,this.pos);var r=this.pos;this.pos=e+this.sep.length;if(t==-1||t>e){return new tink_core_NamedWith(se.toString(tink_url__$Query_QueryStringParser.trimmedSub(this.s,r,e)),se.ofString(""))}else{return new tink_core_NamedWith(se.toString(tink_url__$Query_QueryStringParser.trimmedSub(this.s,r,t)),tink_url__$Query_QueryStringParser.trimmedSub(this.s,t+this.set.length,e))}},__class__:tink_url__$Query_QueryStringParser};function $keyValueIterator(e){if(e instanceof Array)return function(){return HxOverrides.keyValueIter(e)};return typeof e.keyValueIterator=="function"?$bind(e,e.keyValueIterator):e.keyValueIterator}function $getIterator(e){if(e instanceof Array)return new haxe_iterators_ArrayIterator(e);else return e.iterator()}function $bind(t,r){if(r==null)return null;if(r.__id__==null)r.__id__=e.$haxeUID++;var n;if(t.hx__closures__==null)t.hx__closures__={};else n=t.hx__closures__[r.__id__];if(n==null){n=r.bind(t);t.hx__closures__[r.__id__]=n}return n}function $arrayPush(e){return this.push(e)}e.$haxeUID|=0;js_Boot.__toStr={}.toString;if(String.fromCodePoint==null)String.fromCodePoint=function(e){return e<65536?String.fromCharCode(e):String.fromCharCode((e>>10)+55232)+String.fromCharCode((e&1023)+56320)};Object.defineProperty(String.prototype,"__class__",{value:t["String"]=String,enumerable:false,writable:true});String.__name__="String";t["Array"]=Array;Array.__name__="Array";Date.prototype.__class__=t["Date"]=Date;Date.__name__="Date";var oe={};var ue={};var ce=Number;var he=Boolean;var fe={};var de={};if(typeof performance!="undefined"?typeof performance.now=="function":false){HxOverrides.now=performance.now.bind(performance)}t["Math"]=Math;if(ArrayBuffer.prototype.slice==null){ArrayBuffer.prototype.slice=js_lib__$ArrayBuffer_ArrayBufferCompat.sliceImpl}ANSI.values=function(e){var t;var r=new haxe_ds_EnumValueMap;r.set(s.Off,0);r.set(s.Bold,1);r.set(s.Underline,4);r.set(s.Blink,5);r.set(s.ReverseVideo,7);r.set(s.Concealed,8);r.set(s.BoldOff,22);r.set(s.UnderlineOff,24);r.set(s.BlinkOff,25);r.set(s.NormalVideo,27);r.set(s.ConcealedOff,28);r.set(s.Black,30);r.set(s.Red,31);r.set(s.Green,32);r.set(s.Yellow,33);r.set(s.Blue,34);r.set(s.Magenta,35);r.set(s.Cyan,36);r.set(s.White,37);r.set(s.DefaultForeground,39);r.set(s.BlackBack,40);r.set(s.RedBack,41);r.set(s.GreenBack,42);r.set(s.YellowBack,43);r.set(s.BlueBack,44);r.set(s.MagentaBack,45);r.set(s.CyanBack,46);r.set(s.WhiteBack,47);r.set(s.DefaultBackground,49);t=r;return t}(this);ANSI.available=ANSI.detectSupport();ANSI.strip=false;ANSI.stripIfUnavailable=true;DateTools.DAY_SHORT_NAMES=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];DateTools.DAY_NAMES=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];DateTools.MONTH_SHORT_NAMES=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];DateTools.MONTH_NAMES=["January","February","March","April","May","June","July","August","September","October","November","December"];haxe_SysTools.winMetaCharacters=[32,40,41,37,33,94,34,60,62,38,124,10,13,44,59];haxe_Serializer.USE_CACHE=false;haxe_Serializer.USE_ENUM_INDEX=false;haxe_Serializer.BASE64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";haxe_Unserializer.DEFAULT_RESOLVER=new haxe__$Unserializer_DefaultResolver;haxe_Unserializer.BASE64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";haxeshim__$Logger_SysLogger.isTTY=process.stderr.isTTY;haxeshim__$Logger_SysLogger.out=function(e){var t;ANSI.available=haxeshim__$Logger_SysLogger.isTTY;t=new _$Sys_FileOutput(2);return t}(this);haxeshim_sys_Os.IS_WINDOWS=Sys.systemName()=="Windows";haxeshim_sys_Os.DELIMITER=haxeshim_sys_Os.IS_WINDOWS?";":":";haxeshim_sys_Os.EXECUTABLE_EXTENSION=haxeshim_sys_Os.IS_WINDOWS?".exe":"";haxeshim_scope_Scope.CONFIG_FILE=".haxerc";haxeshim_scope_Scope.fs={isDirectory:function(e){try{return sys_FileSystem.isDirectory(e)}catch(e){return false}},readFile:function(e){try{return w.Success(g.readFileSync(e,{encoding:"utf8"}))}catch(r){var t=haxe_Exception.caught(r).unwrap();return w.Failure("Cannot read "+e+" because "+Std.string(t))}}};haxeshim_scope_Scope.DEFAULT_ROOT=function(e){var t;var r=haxeshim_scope_Scope.env("HAXE_ROOT");var n=haxeshim_scope_Scope.env("HAXESHIM_ROOT");var i=haxeshim_sys_Os.IS_WINDOWS?"APPDATA":"HOME";var s=new tink_core__$Lazy_LazyConst(process.env[i]+"/haxe");var a;if(n._hx_index==0){var l=n.v;a=l}else{a=_.get(s)}var s=new tink_core__$Lazy_LazyConst(a);t=r._hx_index==0?function(e){var t;var n=r.v;t=n;return t}(e):_.get(s);return t}(this);lix_client_DownloadedArchive.RESERVED="!#$&'()*+,/:;=?@[]";lix_client_Download.initZip=function(e){var t;var r=P.validateFileName;P.validateFileName=function(e){return null};t=true;return t}(this);lix_client_Download.USER_AGENT="lix";lix_client_LibVersion.UNDEFINED=new lix_client_LibVersion(u.None,u.None);lix_client_haxe_Switcher.VERSION_INFO="version.json";j.hex=function(e){var t;var r=new haxe_ds_IntMap;{var n=0;var i="0123456789abcdefABCDEF".split("");while(n<i.length){var s=i[n];++n;r.h[HxOverrides.cca(s,0)]=true}}t=r;return t}(this);sys_io_File.copyBuf=O.alloc(65536);$.depth=0;Y.NEVER_INST=new tink_core__$Future_FutureObject;X.NOISE=new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(w.Success(null)));tink_parse_Char.WHITE=function(e){return e<33};tink_parse_Char.LOWER=function(e){if(e>=97){return e<=122}else{return false}};tink_parse_Char.DIGIT=function(e){if(e>=48){return e<=57}else{return false}};Q.CHARS=function(e){var t;var r=[];{var n=0;while(n<128){var i=n++;r.push(new tink_parse__$StringSlice_Data(String.fromCodePoint(i),0,1))}}t=r;return t}(this);Q.EMPTY=new tink_parse__$StringSlice_Data("",0,0);tink_semver_Parser.DOT=Q.ofString(".");tink_semver_Parser.HYPHEN=Q.ofString("-");lix_cli_Cli.main()})(typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:this)},4794:(e,t,r)=>{var n=r(4300).Buffer;var i=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];if(typeof Int32Array!=="undefined"){i=new Int32Array(i)}function ensureBuffer(e){if(n.isBuffer(e)){return e}var t=typeof n.alloc==="function"&&typeof n.from==="function";if(typeof e==="number"){return t?n.alloc(e):new n(e)}else if(typeof e==="string"){return t?n.from(e):new n(e)}else{throw new Error("input must be buffer, number, or string, received "+typeof e)}}function bufferizeInt(e){var t=ensureBuffer(4);t.writeInt32BE(e,0);return t}function _crc32(e,t){e=ensureBuffer(e);if(n.isBuffer(t)){t=t.readUInt32BE(0)}var r=~~t^-1;for(var s=0;s<e.length;s++){r=i[(r^e[s])&255]^r>>>8}return r^-1}function crc32(){return bufferizeInt(_crc32.apply(null,arguments))}crc32.signed=function(){return _crc32.apply(null,arguments)};crc32.unsigned=function(){return _crc32.apply(null,arguments)>>>0};e.exports=crc32},9051:(e,t,r)=>{"use strict";const n=r(7147);const i=r(1017);const s=n.lchown?"lchown":"chown";const a=n.lchownSync?"lchownSync":"chownSync";const l=n.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/);const lchownSync=(e,t,r)=>{try{return n[a](e,t,r)}catch(e){if(e.code!=="ENOENT")throw e}};const chownSync=(e,t,r)=>{try{return n.chownSync(e,t,r)}catch(e){if(e.code!=="ENOENT")throw e}};const o=l?(e,t,r,i)=>s=>{if(!s||s.code!=="EISDIR")i(s);else n.chown(e,t,r,i)}:(e,t,r,n)=>n;const u=l?(e,t,r)=>{try{return lchownSync(e,t,r)}catch(n){if(n.code!=="EISDIR")throw n;chownSync(e,t,r)}}:(e,t,r)=>lchownSync(e,t,r);const c=process.version;let readdir=(e,t,r)=>n.readdir(e,t,r);let readdirSync=(e,t)=>n.readdirSync(e,t);if(/^v4\./.test(c))readdir=(e,t,r)=>n.readdir(e,r);const chown=(e,t,r,i)=>{n[s](e,t,r,o(e,t,r,(e=>{i(e&&e.code!=="ENOENT"?e:null)})))};const chownrKid=(e,t,r,s,a)=>{if(typeof t==="string")return n.lstat(i.resolve(e,t),((n,i)=>{if(n)return a(n.code!=="ENOENT"?n:null);i.name=t;chownrKid(e,i,r,s,a)}));if(t.isDirectory()){chownr(i.resolve(e,t.name),r,s,(n=>{if(n)return a(n);const l=i.resolve(e,t.name);chown(l,r,s,a)}))}else{const n=i.resolve(e,t.name);chown(n,r,s,a)}};const chownr=(e,t,r,n)=>{readdir(e,{withFileTypes:true},((i,s)=>{if(i){if(i.code==="ENOENT")return n();else if(i.code!=="ENOTDIR"&&i.code!=="ENOTSUP")return n(i)}if(i||!s.length)return chown(e,t,r,n);let a=s.length;let l=null;const then=i=>{if(l)return;if(i)return n(l=i);if(--a===0)return chown(e,t,r,n)};s.forEach((n=>chownrKid(e,n,t,r,then)))}))};const chownrKidSync=(e,t,r,s)=>{if(typeof t==="string"){try{const r=n.lstatSync(i.resolve(e,t));r.name=t;t=r}catch(e){if(e.code==="ENOENT")return;else throw e}}if(t.isDirectory())chownrSync(i.resolve(e,t.name),r,s);u(i.resolve(e,t.name),r,s)};const chownrSync=(e,t,r)=>{let n;try{n=readdirSync(e,{withFileTypes:true})}catch(n){if(n.code==="ENOENT")return;else if(n.code==="ENOTDIR"||n.code==="ENOTSUP")return u(e,t,r);else throw n}if(n&&n.length)n.forEach((n=>chownrKidSync(e,n,t,r)));return u(e,t,r)};e.exports=chownr;chownr.sync=chownrSync},5010:(e,t,r)=>{var n=r(7147);var i=r(3837);var s=r(2781);var a=s.Readable;var l=s.Writable;var o=s.PassThrough;var u=r(4833);var c=r(2361).EventEmitter;t.createFromBuffer=createFromBuffer;t.createFromFd=createFromFd;t.BufferSlicer=BufferSlicer;t.FdSlicer=FdSlicer;i.inherits(FdSlicer,c);function FdSlicer(e,t){t=t||{};c.call(this);this.fd=e;this.pend=new u;this.pend.max=1;this.refCount=0;this.autoClose=!!t.autoClose}FdSlicer.prototype.read=function(e,t,r,i,s){var a=this;a.pend.go((function(l){n.read(a.fd,e,t,r,i,(function(e,t,r){l();s(e,t,r)}))}))};FdSlicer.prototype.write=function(e,t,r,i,s){var a=this;a.pend.go((function(l){n.write(a.fd,e,t,r,i,(function(e,t,r){l();s(e,t,r)}))}))};FdSlicer.prototype.createReadStream=function(e){return new ReadStream(this,e)};FdSlicer.prototype.createWriteStream=function(e){return new WriteStream(this,e)};FdSlicer.prototype.ref=function(){this.refCount+=1};FdSlicer.prototype.unref=function(){var e=this;e.refCount-=1;if(e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");if(e.autoClose){n.close(e.fd,onCloseDone)}function onCloseDone(t){if(t){e.emit("error",t)}else{e.emit("close")}}};i.inherits(ReadStream,a);function ReadStream(e,t){t=t||{};a.call(this,t);this.context=e;this.context.ref();this.start=t.start||0;this.endOffset=t.end;this.pos=this.start;this.destroyed=false}ReadStream.prototype._read=function(e){var t=this;if(t.destroyed)return;var r=Math.min(t._readableState.highWaterMark,e);if(t.endOffset!=null){r=Math.min(r,t.endOffset-t.pos)}if(r<=0){t.destroyed=true;t.push(null);t.context.unref();return}t.context.pend.go((function(e){if(t.destroyed)return e();var i=new Buffer(r);n.read(t.context.fd,i,0,r,t.pos,(function(r,n){if(r){t.destroy(r)}else if(n===0){t.destroyed=true;t.push(null);t.context.unref()}else{t.pos+=n;t.push(i.slice(0,n))}e()}))}))};ReadStream.prototype.destroy=function(e){if(this.destroyed)return;e=e||new Error("stream destroyed");this.destroyed=true;this.emit("error",e);this.context.unref()};i.inherits(WriteStream,l);function WriteStream(e,t){t=t||{};l.call(this,t);this.context=e;this.context.ref();this.start=t.start||0;this.endOffset=t.end==null?Infinity:+t.end;this.bytesWritten=0;this.pos=this.start;this.destroyed=false;this.on("finish",this.destroy.bind(this))}WriteStream.prototype._write=function(e,t,r){var i=this;if(i.destroyed)return;if(i.pos+e.length>i.endOffset){var s=new Error("maximum file length exceeded");s.code="ETOOBIG";i.destroy();r(s);return}i.context.pend.go((function(t){if(i.destroyed)return t();n.write(i.context.fd,e,0,e.length,i.pos,(function(e,n){if(e){i.destroy();t();r(e)}else{i.bytesWritten+=n;i.pos+=n;i.emit("progress");t();r()}}))}))};WriteStream.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this.context.unref()};i.inherits(BufferSlicer,c);function BufferSlicer(e,t){c.call(this);t=t||{};this.refCount=0;this.buffer=e;this.maxChunkSize=t.maxChunkSize||Number.MAX_SAFE_INTEGER}BufferSlicer.prototype.read=function(e,t,r,n,i){var s=n+r;var a=s-this.buffer.length;var l=a>0?a:r;this.buffer.copy(e,t,n,s);setImmediate((function(){i(null,l)}))};BufferSlicer.prototype.write=function(e,t,r,n,i){e.copy(this.buffer,n,t,t+r);setImmediate((function(){i(null,r,e)}))};BufferSlicer.prototype.createReadStream=function(e){e=e||{};var t=new o(e);t.destroyed=false;t.start=e.start||0;t.endOffset=e.end;t.pos=t.endOffset||this.buffer.length;var r=this.buffer.slice(t.start,t.pos);var n=0;while(true){var i=n+this.maxChunkSize;if(i>=r.length){if(n<r.length){t.write(r.slice(n,r.length))}break}t.write(r.slice(n,i));n=i}t.end();t.destroy=function(){t.destroyed=true};return t};BufferSlicer.prototype.createWriteStream=function(e){var t=this;e=e||{};var r=new l(e);r.start=e.start||0;r.endOffset=e.end==null?this.buffer.length:+e.end;r.bytesWritten=0;r.pos=r.start;r.destroyed=false;r._write=function(e,n,i){if(r.destroyed)return;var s=r.pos+e.length;if(s>r.endOffset){var a=new Error("maximum file length exceeded");a.code="ETOOBIG";r.destroyed=true;i(a);return}e.copy(t.buffer,r.pos,0,e.length);r.bytesWritten+=e.length;r.pos=s;r.emit("progress");i()};r.destroy=function(){r.destroyed=true};return r};BufferSlicer.prototype.ref=function(){this.refCount+=1};BufferSlicer.prototype.unref=function(){this.refCount-=1;if(this.refCount<0){throw new Error("invalid unref")}};function createFromBuffer(e,t){return new BufferSlicer(e,t)}function createFromFd(e,t){return new FdSlicer(e,t)}},7714:(e,t,r)=>{"use strict";const n=r(1077);const i=r(2361).EventEmitter;const s=r(7147);let a=s.writev;if(!a){const e=process.binding("fs");const t=e.FSReqWrap||e.FSReqCallback;a=(r,n,i,s)=>{const done=(e,t)=>s(e,t,n);const a=new t;a.oncomplete=done;e.writeBuffers(r,n,i,a)}}const l=Symbol("_autoClose");const o=Symbol("_close");const u=Symbol("_ended");const c=Symbol("_fd");const h=Symbol("_finished");const d=Symbol("_flags");const v=Symbol("_flush");const m=Symbol("_handleChunk");const p=Symbol("_makeBuf");const _=Symbol("_mode");const g=Symbol("_needDrain");const w=Symbol("_onerror");const x=Symbol("_onopen");const b=Symbol("_onread");const y=Symbol("_onwrite");const S=Symbol("_open");const E=Symbol("_path");const N=Symbol("_pos");const k=Symbol("_queue");const O=Symbol("_read");const R=Symbol("_readSize");const C=Symbol("_reading");const A=Symbol("_remain");const I=Symbol("_size");const F=Symbol("_write");const L=Symbol("_writing");const D=Symbol("_defaultFlag");const T=Symbol("_errored");class ReadStream extends n{constructor(e,t){t=t||{};super(t);this.readable=true;this.writable=false;if(typeof e!=="string")throw new TypeError("path must be a string");this[T]=false;this[c]=typeof t.fd==="number"?t.fd:null;this[E]=e;this[R]=t.readSize||16*1024*1024;this[C]=false;this[I]=typeof t.size==="number"?t.size:Infinity;this[A]=this[I];this[l]=typeof t.autoClose==="boolean"?t.autoClose:true;if(typeof this[c]==="number")this[O]();else this[S]()}get fd(){return this[c]}get path(){return this[E]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[S](){s.open(this[E],"r",((e,t)=>this[x](e,t)))}[x](e,t){if(e)this[w](e);else{this[c]=t;this.emit("open",t);this[O]()}}[p](){return Buffer.allocUnsafe(Math.min(this[R],this[A]))}[O](){if(!this[C]){this[C]=true;const e=this[p]();if(e.length===0)return process.nextTick((()=>this[b](null,0,e)));s.read(this[c],e,0,e.length,null,((e,t,r)=>this[b](e,t,r)))}}[b](e,t,r){this[C]=false;if(e)this[w](e);else if(this[m](t,r))this[O]()}[o](){if(this[l]&&typeof this[c]==="number"){const e=this[c];this[c]=null;s.close(e,(e=>e?this.emit("error",e):this.emit("close")))}}[w](e){this[C]=true;this[o]();this.emit("error",e)}[m](e,t){let r=false;this[A]-=e;if(e>0)r=super.write(e<t.length?t.slice(0,e):t);if(e===0||this[A]<=0){r=false;this[o]();super.end()}return r}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":if(typeof this[c]==="number")this[O]();break;case"error":if(this[T])return;this[T]=true;return super.emit(e,t);default:return super.emit(e,t)}}}class ReadStreamSync extends ReadStream{[S](){let e=true;try{this[x](null,s.openSync(this[E],"r"));e=false}finally{if(e)this[o]()}}[O](){let e=true;try{if(!this[C]){this[C]=true;do{const e=this[p]();const t=e.length===0?0:s.readSync(this[c],e,0,e.length,null);if(!this[m](t,e))break}while(true);this[C]=false}e=false}finally{if(e)this[o]()}}[o](){if(this[l]&&typeof this[c]==="number"){const e=this[c];this[c]=null;s.closeSync(e);this.emit("close")}}}class WriteStream extends i{constructor(e,t){t=t||{};super(t);this.readable=false;this.writable=true;this[T]=false;this[L]=false;this[u]=false;this[g]=false;this[k]=[];this[E]=e;this[c]=typeof t.fd==="number"?t.fd:null;this[_]=t.mode===undefined?438:t.mode;this[N]=typeof t.start==="number"?t.start:null;this[l]=typeof t.autoClose==="boolean"?t.autoClose:true;const r=this[N]!==null?"r+":"w";this[D]=t.flags===undefined;this[d]=this[D]?r:t.flags;if(this[c]===null)this[S]()}emit(e,t){if(e==="error"){if(this[T])return;this[T]=true}return super.emit(e,t)}get fd(){return this[c]}get path(){return this[E]}[w](e){this[o]();this[L]=true;this.emit("error",e)}[S](){s.open(this[E],this[d],this[_],((e,t)=>this[x](e,t)))}[x](e,t){if(this[D]&&this[d]==="r+"&&e&&e.code==="ENOENT"){this[d]="w";this[S]()}else if(e)this[w](e);else{this[c]=t;this.emit("open",t);this[v]()}}end(e,t){if(e)this.write(e,t);this[u]=true;if(!this[L]&&!this[k].length&&typeof this[c]==="number")this[y](null,0);return this}write(e,t){if(typeof e==="string")e=Buffer.from(e,t);if(this[u]){this.emit("error",new Error("write() after end()"));return false}if(this[c]===null||this[L]||this[k].length){this[k].push(e);this[g]=true;return false}this[L]=true;this[F](e);return true}[F](e){s.write(this[c],e,0,e.length,this[N],((e,t)=>this[y](e,t)))}[y](e,t){if(e)this[w](e);else{if(this[N]!==null)this[N]+=t;if(this[k].length)this[v]();else{this[L]=false;if(this[u]&&!this[h]){this[h]=true;this[o]();this.emit("finish")}else if(this[g]){this[g]=false;this.emit("drain")}}}}[v](){if(this[k].length===0){if(this[u])this[y](null,0)}else if(this[k].length===1)this[F](this[k].pop());else{const e=this[k];this[k]=[];a(this[c],e,this[N],((e,t)=>this[y](e,t)))}}[o](){if(this[l]&&typeof this[c]==="number"){const e=this[c];this[c]=null;s.close(e,(e=>e?this.emit("error",e):this.emit("close")))}}}class WriteStreamSync extends WriteStream{[S](){let e;if(this[D]&&this[d]==="r+"){try{e=s.openSync(this[E],this[d],this[_])}catch(e){if(e.code==="ENOENT"){this[d]="w";return this[S]()}else throw e}}else e=s.openSync(this[E],this[d],this[_]);this[x](null,e)}[o](){if(this[l]&&typeof this[c]==="number"){const e=this[c];this[c]=null;s.closeSync(e);this.emit("close")}}[F](e){let t=true;try{this[y](null,s.writeSync(this[c],e,0,e.length,this[N]));t=false}finally{if(t)try{this[o]()}catch(e){}}}}t.ReadStream=ReadStream;t.ReadStreamSync=ReadStreamSync;t.WriteStream=WriteStream;t.WriteStreamSync=WriteStreamSync},7356:e=>{"use strict";e.exports=clone;function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var t={__proto__:e.__proto__};else var t=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}));return t}},7758:(e,t,r)=>{var n=r(7147);var i=r(263);var s=r(3086);var a=r(7356);var l=r(3837);var o;var u;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){o=Symbol.for("graceful-fs.queue");u=Symbol.for("graceful-fs.previous")}else{o="___graceful-fs.queue";u="___graceful-fs.previous"}function noop(){}var c=noop;if(l.debuglog)c=l.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))c=function(){var e=l.format.apply(l,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!global[o]){var h=[];Object.defineProperty(global,o,{get:function(){return h}});n.close=function(e){function close(t,r){return e.call(n,t,(function(e){if(!e){retry()}if(typeof r==="function")r.apply(this,arguments)}))}Object.defineProperty(close,u,{value:e});return close}(n.close);n.closeSync=function(e){function closeSync(t){e.apply(n,arguments);retry()}Object.defineProperty(closeSync,u,{value:e});return closeSync}(n.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){c(global[o]);r(9491).equal(global[o].length,0)}))}}e.exports=patch(a(n));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched){e.exports=patch(n);n.__patched=true}function patch(e){i(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,r,n){if(typeof r==="function")n=r,r=null;return go$readFile(e,r,n);function go$readFile(e,r,n){return t(e,r,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,r,n]]);else{if(typeof n==="function")n.apply(this,arguments);retry()}}))}}var r=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,n,i){if(typeof n==="function")i=n,n=null;return go$writeFile(e,t,n,i);function go$writeFile(e,t,n,i){return r(e,t,n,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$writeFile,[e,t,n,i]]);else{if(typeof i==="function")i.apply(this,arguments);retry()}}))}}var n=e.appendFile;if(n)e.appendFile=appendFile;function appendFile(e,t,r,i){if(typeof r==="function")i=r,r=null;return go$appendFile(e,t,r,i);function go$appendFile(e,t,r,i){return n(e,t,r,(function(n){if(n&&(n.code==="EMFILE"||n.code==="ENFILE"))enqueue([go$appendFile,[e,t,r,i]]);else{if(typeof i==="function")i.apply(this,arguments);retry()}}))}}var a=e.readdir;e.readdir=readdir;function readdir(e,t,r){var n=[e];if(typeof t!=="function"){n.push(t)}else{r=t}n.push(go$readdir$cb);return go$readdir(n);function go$readdir$cb(e,t){if(t&&t.sort)t.sort();if(e&&(e.code==="EMFILE"||e.code==="ENFILE"))enqueue([go$readdir,[n]]);else{if(typeof r==="function")r.apply(this,arguments);retry()}}}function go$readdir(t){return a.apply(e,t)}if(process.version.substr(0,4)==="v0.8"){var l=s(e);ReadStream=l.ReadStream;WriteStream=l.WriteStream}var o=e.ReadStream;if(o){ReadStream.prototype=Object.create(o.prototype);ReadStream.prototype.open=ReadStream$open}var u=e.WriteStream;if(u){WriteStream.prototype=Object.create(u.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var c=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return c},set:function(e){c=e},enumerable:true,configurable:true});var h=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return h},set:function(e){h=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return o.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return u.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r)}}))}function createReadStream(t,r){return new e.ReadStream(t,r)}function createWriteStream(t,r){return new e.WriteStream(t,r)}var d=e.open;e.open=open;function open(e,t,r,n){if(typeof r==="function")n=r,r=null;return go$open(e,t,r,n);function go$open(e,t,r,n){return d(e,t,r,(function(i,s){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$open,[e,t,r,n]]);else{if(typeof n==="function")n.apply(this,arguments);retry()}}))}}return e}function enqueue(e){c("ENQUEUE",e[0].name,e[1]);global[o].push(e)}function retry(){var e=global[o].shift();if(e){c("RETRY",e[0].name,e[1]);e[0].apply(null,e[1])}}},3086:(e,t,r)=>{var n=r(2781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,r){if(!(this instanceof ReadStream))return new ReadStream(t,r);n.call(this);var i=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;r=r||{};var s=Object.keys(r);for(var a=0,l=s.length;a<l;a++){var o=s[a];this[o]=r[o]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){i._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){i.emit("error",e);i.readable=false;return}i.fd=t;i.emit("open",t);i._read()}))}function WriteStream(t,r){if(!(this instanceof WriteStream))return new WriteStream(t,r);n.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;r=r||{};var i=Object.keys(r);for(var s=0,a=i.length;s<a;s++){var l=i[s];this[l]=r[l]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},263:(e,t,r)=>{var n=r(2057);var i=process.cwd;var s=null;var a=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!s)s=i.call(process);return s};try{process.cwd()}catch(e){}var l=process.chdir;process.chdir=function(e){s=null;l.call(process,e)};e.exports=patch;function patch(e){if(n.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(!e.lchmod){e.lchmod=function(e,t,r){if(r)process.nextTick(r)};e.lchmodSync=function(){}}if(!e.lchown){e.lchown=function(e,t,r,n){if(n)process.nextTick(n)};e.lchownSync=function(){}}if(a==="win32"){e.rename=function(t){return function(r,n,i){var s=Date.now();var a=0;t(r,n,(function CB(l){if(l&&(l.code==="EACCES"||l.code==="EPERM")&&Date.now()-s<6e4){setTimeout((function(){e.stat(n,(function(e,s){if(e&&e.code==="ENOENT")t(r,n,CB);else i(l)}))}),a);if(a<100)a+=10;return}if(i)i(l)}))}}(e.rename)}e.read=function(t){function read(r,n,i,s,a,l){var o;if(l&&typeof l==="function"){var u=0;o=function(c,h,d){if(c&&c.code==="EAGAIN"&&u<10){u++;return t.call(e,r,n,i,s,a,o)}l.apply(this,arguments)}}return t.call(e,r,n,i,s,a,o)}read.__proto__=t;return read}(e.read);e.readSync=function(t){return function(r,n,i,s,a){var l=0;while(true){try{return t.call(e,r,n,i,s,a)}catch(e){if(e.code==="EAGAIN"&&l<10){l++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,r,i){e.open(t,n.O_WRONLY|n.O_SYMLINK,r,(function(t,n){if(t){if(i)i(t);return}e.fchmod(n,r,(function(t){e.close(n,(function(e){if(i)i(t||e)}))}))}))};e.lchmodSync=function(t,r){var i=e.openSync(t,n.O_WRONLY|n.O_SYMLINK,r);var s=true;var a;try{a=e.fchmodSync(i,r);s=false}finally{if(s){try{e.closeSync(i)}catch(e){}}else{e.closeSync(i)}}return a}}function patchLutimes(e){if(n.hasOwnProperty("O_SYMLINK")){e.lutimes=function(t,r,i,s){e.open(t,n.O_SYMLINK,(function(t,n){if(t){if(s)s(t);return}e.futimes(n,r,i,(function(t){e.close(n,(function(e){if(s)s(t||e)}))}))}))};e.lutimesSync=function(t,r,i){var s=e.openSync(t,n.O_SYMLINK);var a;var l=true;try{a=e.futimesSync(s,r,i);l=false}finally{if(l){try{e.closeSync(s)}catch(e){}}else{e.closeSync(s)}}return a}}else{e.lutimes=function(e,t,r,n){if(n)process.nextTick(n)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(r,n,i){return t.call(e,r,n,(function(e){if(chownErOk(e))e=null;if(i)i.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(r,n){try{return t.call(e,r,n)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(r,n,i,s){return t.call(e,r,n,i,(function(e){if(chownErOk(e))e=null;if(s)s.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(r,n,i){try{return t.call(e,r,n,i)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(r,n,i){if(typeof n==="function"){i=n;n=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(i)i.apply(this,arguments)}return n?t.call(e,r,n,callback):t.call(e,r,callback)}}function statFixSync(t){if(!t)return t;return function(r,n){var i=n?t.call(e,r,n):t.call(e,r);if(i.uid<0)i.uid+=4294967296;if(i.gid<0)i.gid+=4294967296;return i}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},1077:(e,t,r)=>{"use strict";const n=r(2361);const i=r(2781);const s=r(665);const a=r(1576).StringDecoder;const l=Symbol("EOF");const o=Symbol("maybeEmitEnd");const u=Symbol("emittedEnd");const c=Symbol("emittingEnd");const h=Symbol("closed");const d=Symbol("read");const v=Symbol("flush");const m=Symbol("flushChunk");const p=Symbol("encoding");const _=Symbol("decoder");const g=Symbol("flowing");const w=Symbol("paused");const x=Symbol("resume");const b=Symbol("bufferLength");const y=Symbol("bufferPush");const S=Symbol("bufferShift");const E=Symbol("objectMode");const N=Symbol("destroyed");const k=global._MP_NO_ITERATOR_SYMBOLS_!=="1";const O=k&&Symbol.asyncIterator||Symbol("asyncIterator not implemented");const R=k&&Symbol.iterator||Symbol("iterator not implemented");const isEndish=e=>e==="end"||e==="finish"||e==="prefinish";const isArrayBuffer=e=>e instanceof ArrayBuffer||typeof e==="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0;const isArrayBufferView=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e);e.exports=class Minipass extends i{constructor(e){super();this[g]=false;this[w]=false;this.pipes=new s;this.buffer=new s;this[E]=e&&e.objectMode||false;if(this[E])this[p]=null;else this[p]=e&&e.encoding||null;if(this[p]==="buffer")this[p]=null;this[_]=this[p]?new a(this[p]):null;this[l]=false;this[u]=false;this[c]=false;this[h]=false;this.writable=true;this.readable=true;this[b]=0;this[N]=false}get bufferLength(){return this[b]}get encoding(){return this[p]}set encoding(e){if(this[E])throw new Error("cannot set encoding in objectMode");if(this[p]&&e!==this[p]&&(this[_]&&this[_].lastNeed||this[b]))throw new Error("cannot change encoding");if(this[p]!==e){this[_]=e?new a(e):null;if(this.buffer.length)this.buffer=this.buffer.map((e=>this[_].write(e)))}this[p]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[E]}set objectMode(e){this[E]=this[E]||!!e}write(e,t,r){if(this[l])throw new Error("write after end");if(this[N]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof t==="function")r=t,t="utf8";if(!t)t="utf8";if(!this[E]&&!Buffer.isBuffer(e)){if(isArrayBufferView(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(isArrayBuffer(e))e=Buffer.from(e);else if(typeof e!=="string")this.objectMode=true}if(!this.objectMode&&!e.length){const e=this.flowing;if(this[b]!==0)this.emit("readable");if(r)r();return e}if(typeof e==="string"&&!this[E]&&!(t===this[p]&&!this[_].lastNeed)){e=Buffer.from(e,t)}if(Buffer.isBuffer(e)&&this[p])e=this[_].write(e);try{return this.flowing?(this.emit("data",e),this.flowing):(this[y](e),false)}finally{if(this[b]!==0)this.emit("readable");if(r)r()}}read(e){if(this[N])return null;try{if(this[b]===0||e===0||e>this[b])return null;if(this[E])e=null;if(this.buffer.length>1&&!this[E]){if(this.encoding)this.buffer=new s([Array.from(this.buffer).join("")]);else this.buffer=new s([Buffer.concat(Array.from(this.buffer),this[b])])}return this[d](e||null,this.buffer.head.value)}finally{this[o]()}}[d](e,t){if(e===t.length||e===null)this[S]();else{this.buffer.head.value=t.slice(e);t=t.slice(0,e);this[b]-=e}this.emit("data",t);if(!this.buffer.length&&!this[l])this.emit("drain");return t}end(e,t,r){if(typeof e==="function")r=e,e=null;if(typeof t==="function")r=t,t="utf8";if(e)this.write(e,t);if(r)this.once("end",r);this[l]=true;this.writable=false;if(this.flowing||!this[w])this[o]();return this}[x](){if(this[N])return;this[w]=false;this[g]=true;this.emit("resume");if(this.buffer.length)this[v]();else if(this[l])this[o]();else this.emit("drain")}resume(){return this[x]()}pause(){this[g]=false;this[w]=true}get destroyed(){return this[N]}get flowing(){return this[g]}get paused(){return this[w]}[y](e){if(this[E])this[b]+=1;else this[b]+=e.length;return this.buffer.push(e)}[S](){if(this.buffer.length){if(this[E])this[b]-=1;else this[b]-=this.buffer.head.value.length}return this.buffer.shift()}[v](){do{}while(this[m](this[S]()));if(!this.buffer.length&&!this[l])this.emit("drain")}[m](e){return e?(this.emit("data",e),this.flowing):false}pipe(e,t){if(this[N])return;const r=this[u];t=t||{};if(e===process.stdout||e===process.stderr)t.end=false;else t.end=t.end!==false;const n={dest:e,opts:t,ondrain:e=>this[x]()};this.pipes.push(n);e.on("drain",n.ondrain);this[x]();if(r&&n.opts.end)n.dest.end();return e}addListener(e,t){return this.on(e,t)}on(e,t){try{return super.on(e,t)}finally{if(e==="data"&&!this.pipes.length&&!this.flowing)this[x]();else if(isEndish(e)&&this[u]){super.emit(e);this.removeAllListeners(e)}}}get emittedEnd(){return this[u]}[o](){if(!this[c]&&!this[u]&&!this[N]&&this.buffer.length===0&&this[l]){this[c]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[h])this.emit("close");this[c]=false}}emit(e,t){if(e!=="error"&&e!=="close"&&e!==N&&this[N])return;else if(e==="data"){if(!t)return;if(this.pipes.length)this.pipes.forEach((e=>e.dest.write(t)===false&&this.pause()))}else if(e==="end"){if(this[u]===true)return;this[u]=true;this.readable=false;if(this[_]){t=this[_].end();if(t){this.pipes.forEach((e=>e.dest.write(t)));super.emit("data",t)}}this.pipes.forEach((e=>{e.dest.removeListener("drain",e.ondrain);if(e.opts.end)e.dest.end()}))}else if(e==="close"){this[h]=true;if(!this[u]&&!this[N])return}const r=new Array(arguments.length);r[0]=e;r[1]=t;if(arguments.length>2){for(let e=2;e<arguments.length;e++){r[e]=arguments[e]}}try{return super.emit.apply(this,r)}finally{if(!isEndish(e))this[o]();else this.removeAllListeners(e)}}collect(){const e=[];if(!this[E])e.dataLength=0;const t=this.promise();this.on("data",(t=>{e.push(t);if(!this[E])e.dataLength+=t.length}));return t.then((()=>e))}concat(){return this[E]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then((e=>this[E]?Promise.reject(new Error("cannot concat in objectMode")):this[p]?e.join(""):Buffer.concat(e,e.dataLength)))}promise(){return new Promise(((e,t)=>{this.on(N,(()=>t(new Error("stream destroyed"))));this.on("end",(()=>e()));this.on("error",(e=>t(e)))}))}[O](){const next=()=>{const e=this.read();if(e!==null)return Promise.resolve({done:false,value:e});if(this[l])return Promise.resolve({done:true});let t=null;let r=null;const onerr=e=>{this.removeListener("data",ondata);this.removeListener("end",onend);r(e)};const ondata=e=>{this.removeListener("error",onerr);this.removeListener("end",onend);this.pause();t({value:e,done:!!this[l]})};const onend=()=>{this.removeListener("error",onerr);this.removeListener("data",ondata);t({done:true})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((e,n)=>{r=n;t=e;this.once(N,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next}}[R](){const next=()=>{const e=this.read();const t=e===null;return{value:e,done:t}};return{next:next}}destroy(e){if(this[N]){if(e)this.emit("error",e);else this.emit(N);return this}this[N]=true;this.buffer=new s;this[b]=0;if(typeof this.close==="function"&&!this[h])this.close();if(e)this.emit("error",e);else this.emit(N);return this}static isStream(e){return!!e&&(e instanceof Minipass||e instanceof i||e instanceof n&&(typeof e.pipe==="function"||typeof e.write==="function"&&typeof e.end==="function"))}}},6769:(e,t,r)=>{const n=r(9796).constants||{ZLIB_VERNUM:4736};e.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:Infinity,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},n))},3486:(e,t,r)=>{"use strict";const n=r(9491);const i=r(4300).Buffer;const s=r(9796);const a=t.constants=r(6769);const l=r(1077);const o=i.concat;const u=Symbol("_superWrite");class ZlibError extends Error{constructor(e){super("zlib: "+e.message);this.code=e.code;this.errno=e.errno;if(!this.code)this.code="ZLIB_ERROR";this.message="zlib: "+e.message;Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const c=Symbol("opts");const h=Symbol("flushFlag");const d=Symbol("finishFlushFlag");const v=Symbol("fullFlushFlag");const m=Symbol("handle");const p=Symbol("onError");const _=Symbol("sawError");const g=Symbol("level");const w=Symbol("strategy");const x=Symbol("ended");const b=Symbol("_defaultFullFlush");class ZlibBase extends l{constructor(e,t){if(!e||typeof e!=="object")throw new TypeError("invalid options for ZlibBase constructor");super(e);this[x]=false;this[c]=e;this[h]=e.flush;this[d]=e.finishFlush;try{this[m]=new s[t](e)}catch(e){throw new ZlibError(e)}this[p]=e=>{this[_]=true;this.close();this.emit("error",e)};this[m].on("error",(e=>this[p](new ZlibError(e))));this.once("end",(()=>this.close))}close(){if(this[m]){this[m].close();this[m]=null;this.emit("close")}}reset(){if(!this[_]){n(this[m],"zlib binding closed");return this[m].reset()}}flush(e){if(this.ended)return;if(typeof e!=="number")e=this[v];this.write(Object.assign(i.alloc(0),{[h]:e}))}end(e,t,r){if(e)this.write(e,t);this.flush(this[d]);this[x]=true;return super.end(null,null,r)}get ended(){return this[x]}write(e,t,r){if(typeof t==="function")r=t,t="utf8";if(typeof e==="string")e=i.from(e,t);if(this[_])return;n(this[m],"zlib binding closed");const s=this[m]._handle;const a=s.close;s.close=()=>{};const l=this[m].close;this[m].close=()=>{};i.concat=e=>e;let c;try{const t=typeof e[h]==="number"?e[h]:this[h];c=this[m]._processChunk(e,t);i.concat=o}catch(e){i.concat=o;this[p](new ZlibError(e))}finally{if(this[m]){this[m]._handle=s;s.close=a;this[m].close=l;this[m].removeAllListeners("error")}}let d;if(c){if(Array.isArray(c)&&c.length>0){d=this[u](i.from(c[0]));for(let e=1;e<c.length;e++){d=this[u](c[e])}}else{d=this[u](i.from(c))}}if(r)r();return d}[u](e){return super.write(e)}}class Zlib extends ZlibBase{constructor(e,t){e=e||{};e.flush=e.flush||a.Z_NO_FLUSH;e.finishFlush=e.finishFlush||a.Z_FINISH;super(e,t);this[v]=a.Z_FULL_FLUSH;this[g]=e.level;this[w]=e.strategy}params(e,t){if(this[_])return;if(!this[m])throw new Error("cannot switch params when binding is closed");if(!this[m].params)throw new Error("not supported in this implementation");if(this[g]!==e||this[w]!==t){this.flush(a.Z_SYNC_FLUSH);n(this[m],"zlib binding closed");const r=this[m].flush;this[m].flush=(e,t)=>{this.flush(e);t()};try{this[m].params(e,t)}finally{this[m].flush=r}if(this[m]){this[g]=e;this[w]=t}}}}class Deflate extends Zlib{constructor(e){super(e,"Deflate")}}class Inflate extends Zlib{constructor(e){super(e,"Inflate")}}const y=Symbol("_portable");class Gzip extends Zlib{constructor(e){super(e,"Gzip");this[y]=e&&!!e.portable}[u](e){if(!this[y])return super[u](e);this[y]=false;e[9]=255;return super[u](e)}}class Gunzip extends Zlib{constructor(e){super(e,"Gunzip")}}class DeflateRaw extends Zlib{constructor(e){super(e,"DeflateRaw")}}class InflateRaw extends Zlib{constructor(e){super(e,"InflateRaw")}}class Unzip extends Zlib{constructor(e){super(e,"Unzip")}}class Brotli extends ZlibBase{constructor(e,t){e=e||{};e.flush=e.flush||a.BROTLI_OPERATION_PROCESS;e.finishFlush=e.finishFlush||a.BROTLI_OPERATION_FINISH;super(e,t);this[v]=a.BROTLI_OPERATION_FLUSH}}class BrotliCompress extends Brotli{constructor(e){super(e,"BrotliCompress")}}class BrotliDecompress extends Brotli{constructor(e){super(e,"BrotliDecompress")}}t.Deflate=Deflate;t.Inflate=Inflate;t.Gzip=Gzip;t.Gunzip=Gunzip;t.DeflateRaw=DeflateRaw;t.InflateRaw=InflateRaw;t.Unzip=Unzip;if(typeof s.BrotliCompress==="function"){t.BrotliCompress=BrotliCompress;t.BrotliDecompress=BrotliDecompress}else{t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}},6186:(e,t,r)=>{const n=r(2853);const i=r(2930);const{mkdirpNative:s,mkdirpNativeSync:a}=r(4983);const{mkdirpManual:l,mkdirpManualSync:o}=r(356);const{useNative:u,useNativeSync:c}=r(4518);const mkdirp=(e,t)=>{e=i(e);t=n(t);return u(t)?s(e,t):l(e,t)};const mkdirpSync=(e,t)=>{e=i(e);t=n(t);return c(t)?a(e,t):o(e,t)};mkdirp.sync=mkdirpSync;mkdirp.native=(e,t)=>s(i(e),n(t));mkdirp.manual=(e,t)=>l(i(e),n(t));mkdirp.nativeSync=(e,t)=>a(i(e),n(t));mkdirp.manualSync=(e,t)=>o(i(e),n(t));e.exports=mkdirp},4992:(e,t,r)=>{const{dirname:n}=r(1017);const findMade=(e,t,r=undefined)=>{if(r===t)return Promise.resolve();return e.statAsync(t).then((e=>e.isDirectory()?r:undefined),(r=>r.code==="ENOENT"?findMade(e,n(t),t):undefined))};const findMadeSync=(e,t,r=undefined)=>{if(r===t)return undefined;try{return e.statSync(t).isDirectory()?r:undefined}catch(r){return r.code==="ENOENT"?findMadeSync(e,n(t),t):undefined}};e.exports={findMade:findMade,findMadeSync:findMadeSync}},356:(e,t,r)=>{const{dirname:n}=r(1017);const mkdirpManual=(e,t,r)=>{t.recursive=false;const i=n(e);if(i===e){return t.mkdirAsync(e,t).catch((e=>{if(e.code!=="EISDIR")throw e}))}return t.mkdirAsync(e,t).then((()=>r||e),(n=>{if(n.code==="ENOENT")return mkdirpManual(i,t).then((r=>mkdirpManual(e,t,r)));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;return t.statAsync(e).then((e=>{if(e.isDirectory())return r;else throw n}),(()=>{throw n}))}))};const mkdirpManualSync=(e,t,r)=>{const i=n(e);t.recursive=false;if(i===e){try{return t.mkdirSync(e,t)}catch(e){if(e.code!=="EISDIR")throw e;else return}}try{t.mkdirSync(e,t);return r||e}catch(n){if(n.code==="ENOENT")return mkdirpManualSync(e,t,mkdirpManualSync(i,t,r));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;try{if(!t.statSync(e).isDirectory())throw n}catch(e){throw n}}};e.exports={mkdirpManual:mkdirpManual,mkdirpManualSync:mkdirpManualSync}},4983:(e,t,r)=>{const{dirname:n}=r(1017);const{findMade:i,findMadeSync:s}=r(4992);const{mkdirpManual:a,mkdirpManualSync:l}=r(356);const mkdirpNative=(e,t)=>{t.recursive=true;const r=n(e);if(r===e)return t.mkdirAsync(e,t);return i(t,e).then((r=>t.mkdirAsync(e,t).then((()=>r)).catch((r=>{if(r.code==="ENOENT")return a(e,t);else throw r}))))};const mkdirpNativeSync=(e,t)=>{t.recursive=true;const r=n(e);if(r===e)return t.mkdirSync(e,t);const i=s(t,e);try{t.mkdirSync(e,t);return i}catch(r){if(r.code==="ENOENT")return l(e,t);else throw r}};e.exports={mkdirpNative:mkdirpNative,mkdirpNativeSync:mkdirpNativeSync}},2853:(e,t,r)=>{const{promisify:n}=r(3837);const i=r(7147);const optsArg=e=>{if(!e)e={mode:511&~process.umask(),fs:i};else if(typeof e==="object")e={mode:511&~process.umask(),fs:i,...e};else if(typeof e==="number")e={mode:e,fs:i};else if(typeof e==="string")e={mode:parseInt(e,8),fs:i};else throw new TypeError("invalid options argument");e.mkdir=e.mkdir||e.fs.mkdir||i.mkdir;e.mkdirAsync=n(e.mkdir);e.stat=e.stat||e.fs.stat||i.stat;e.statAsync=n(e.stat);e.statSync=e.statSync||e.fs.statSync||i.statSync;e.mkdirSync=e.mkdirSync||e.fs.mkdirSync||i.mkdirSync;return e};e.exports=optsArg},2930:(e,t,r)=>{const n=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform;const{resolve:i,parse:s}=r(1017);const pathArg=e=>{if(/\0/.test(e)){throw Object.assign(new TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"})}e=i(e);if(n==="win32"){const t=/[*|"<>?:]/;const{root:r}=s(e);if(t.test(e.substr(r.length))){throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}}return e};e.exports=pathArg},4518:(e,t,r)=>{const n=r(7147);const i=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version;const s=i.replace(/^v/,"").split(".");const a=+s[0]>10||+s[0]===10&&+s[1]>=12;const l=!a?()=>false:e=>e.mkdir===n.mkdir;const o=!a?()=>false:e=>e.mkdirSync===n.mkdirSync;e.exports={useNative:l,useNativeSync:o}},4833:e=>{e.exports=Pend;function Pend(){this.pending=0;this.max=Infinity;this.listeners=[];this.waiting=[];this.error=null}Pend.prototype.go=function(e){if(this.pending<this.max){pendGo(this,e)}else{this.waiting.push(e)}};Pend.prototype.wait=function(e){if(this.pending===0){e(this.error)}else{this.listeners.push(e)}};Pend.prototype.hold=function(){return pendHold(this)};function pendHold(e){e.pending+=1;var t=false;return onCb;function onCb(r){if(t)throw new Error("callback called twice");t=true;e.error=e.error||r;e.pending-=1;if(e.waiting.length>0&&e.pending<e.max){pendGo(e,e.waiting.shift())}else if(e.pending===0){var n=e.listeners;e.listeners=[];n.forEach(cbListener)}}function cbListener(t){t(e.error)}}function pendGo(e,t){t(pendHold(e))}},4674:(e,t,r)=>{"use strict";var n;n=r(4016);n=r(5923);n=r(1525);n=r(4404);n=r(5317);r(7900);r(7628);t.Parse=r(8917);r(8116);r(5450);r(6043);r(7996);r(4173)},4016:(e,t,r)=>{"use strict";const n=r(5274);const i=r(7900);const s=r(7147);const a=r(7714);const l=r(1525);const o=r(1017);const u=e.exports=(e,t,r)=>{if(typeof t==="function")r=t;if(Array.isArray(e))t=e,e={};if(!t||!Array.isArray(t)||!t.length)throw new TypeError("no files or directories specified");t=Array.from(t);const i=n(e);if(i.sync&&typeof r==="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof r==="function")throw new TypeError("callback only supported with file option");return i.file&&i.sync?createFileSync(i,t):i.file?createFile(i,t,r):i.sync?createSync(i,t):create(i,t)};const createFileSync=(e,t)=>{const r=new i.Sync(e);const n=new a.WriteStreamSync(e.file,{mode:e.mode||438});r.pipe(n);addFilesSync(r,t)};const createFile=(e,t,r)=>{const n=new i(e);const s=new a.WriteStream(e.file,{mode:e.mode||438});n.pipe(s);const l=new Promise(((e,t)=>{s.on("error",t);s.on("close",e);n.on("error",t)}));addFilesAsync(n,t);return r?l.then(r,r):l};const addFilesSync=(e,t)=>{t.forEach((t=>{if(t.charAt(0)==="@")l({file:o.resolve(e.cwd,t.substr(1)),sync:true,noResume:true,onentry:t=>e.add(t)});else e.add(t)}));e.end()};const addFilesAsync=(e,t)=>{while(t.length){const r=t.shift();if(r.charAt(0)==="@")return l({file:o.resolve(e.cwd,r.substr(1)),noResume:true,onentry:t=>e.add(t)}).then((r=>addFilesAsync(e,t)));else e.add(r)}e.end()};const createSync=(e,t)=>{const r=new i.Sync(e);addFilesSync(r,t);return r};const create=(e,t)=>{const r=new i(e);addFilesAsync(r,t);return r}},5317:(e,t,r)=>{"use strict";const n=r(5274);const i=r(7628);const s=r(7147);const a=r(7714);const l=r(1017);const o=e.exports=(e,t,r)=>{if(typeof e==="function")r=e,t=null,e={};else if(Array.isArray(e))t=e,e={};if(typeof t==="function")r=t,t=null;if(!t)t=[];else t=Array.from(t);const i=n(e);if(i.sync&&typeof r==="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof r==="function")throw new TypeError("callback only supported with file option");if(t.length)filesFilter(i,t);return i.file&&i.sync?extractFileSync(i):i.file?extractFile(i,r):i.sync?extractSync(i):extract(i)};const filesFilter=(e,t)=>{const r=new Map(t.map((e=>[e.replace(/\/+$/,""),true])));const n=e.filter;const mapHas=(e,t)=>{const n=t||l.parse(e).root||".";const i=e===n?false:r.has(e)?r.get(e):mapHas(l.dirname(e),n);r.set(e,i);return i};e.filter=n?(e,t)=>n(e,t)&&mapHas(e.replace(/\/+$/,"")):e=>mapHas(e.replace(/\/+$/,""))};const extractFileSync=e=>{const t=new i.Sync(e);const r=e.file;let n=true;let l;const o=s.statSync(r);const u=e.maxReadSize||16*1024*1024;const c=new a.ReadStreamSync(r,{readSize:u,size:o.size});c.pipe(t)};const extractFile=(e,t)=>{const r=new i(e);const n=e.maxReadSize||16*1024*1024;const l=e.file;const o=new Promise(((e,t)=>{r.on("error",t);r.on("close",e);s.stat(l,((e,i)=>{if(e)t(e);else{const e=new a.ReadStream(l,{readSize:n,size:i.size});e.on("error",t);e.pipe(r)}}))}));return t?o.then(t,t):o};const extractSync=e=>new i.Sync(e);const extract=e=>new i(e)},1172:(e,t,r)=>{const n=process.env.__FAKE_PLATFORM__||process.platform;const i=n==="win32";const s=global.__FAKE_TESTING_FS__||r(7147);const{O_CREAT:a,O_TRUNC:l,O_WRONLY:o,UV_FS_O_FILEMAP:u=0}=s.constants;const c=i&&!!u;const h=512*1024;const d=u|l|a|o;e.exports=!c?()=>"w":e=>e<h?d:"w"},6043:(e,t,r)=>{"use strict";const n=r(4173);const i=r(1017).posix;const s=r(2370);const a=Symbol("slurp");const l=Symbol("type");class Header{constructor(e,t,r,n){this.cksumValid=false;this.needPax=false;this.nullBlock=false;this.block=null;this.path=null;this.mode=null;this.uid=null;this.gid=null;this.size=null;this.mtime=null;this.cksum=null;this[l]="0";this.linkpath=null;this.uname=null;this.gname=null;this.devmaj=0;this.devmin=0;this.atime=null;this.ctime=null;if(Buffer.isBuffer(e))this.decode(e,t||0,r,n);else if(e)this.set(e)}decode(e,t,r,n){if(!t)t=0;if(!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");this.path=decString(e,t,100);this.mode=decNumber(e,t+100,8);this.uid=decNumber(e,t+108,8);this.gid=decNumber(e,t+116,8);this.size=decNumber(e,t+124,12);this.mtime=decDate(e,t+136,12);this.cksum=decNumber(e,t+148,12);this[a](r);this[a](n,true);this[l]=decString(e,t+156,1);if(this[l]==="")this[l]="0";if(this[l]==="0"&&this.path.substr(-1)==="/")this[l]="5";if(this[l]==="5")this.size=0;this.linkpath=decString(e,t+157,100);if(e.slice(t+257,t+265).toString()==="ustar\x0000"){this.uname=decString(e,t+265,32);this.gname=decString(e,t+297,32);this.devmaj=decNumber(e,t+329,8);this.devmin=decNumber(e,t+337,8);if(e[t+475]!==0){const r=decString(e,t+345,155);this.path=r+"/"+this.path}else{const r=decString(e,t+345,130);if(r)this.path=r+"/"+this.path;this.atime=decDate(e,t+476,12);this.ctime=decDate(e,t+488,12)}}let i=8*32;for(let r=t;r<t+148;r++){i+=e[r]}for(let r=t+156;r<t+512;r++){i+=e[r]}this.cksumValid=i===this.cksum;if(this.cksum===null&&i===8*32)this.nullBlock=true}[a](e,t){for(let r in e){if(e[r]!==null&&e[r]!==undefined&&!(t&&r==="path"))this[r]=e[r]}}encode(e,t){if(!e){e=this.block=Buffer.alloc(512);t=0}if(!t)t=0;if(!(e.length>=t+512))throw new Error("need 512 bytes for header");const r=this.ctime||this.atime?130:155;const n=splitPrefix(this.path||"",r);const i=n[0];const s=n[1];this.needPax=n[2];this.needPax=encString(e,t,100,i)||this.needPax;this.needPax=encNumber(e,t+100,8,this.mode)||this.needPax;this.needPax=encNumber(e,t+108,8,this.uid)||this.needPax;this.needPax=encNumber(e,t+116,8,this.gid)||this.needPax;this.needPax=encNumber(e,t+124,12,this.size)||this.needPax;this.needPax=encDate(e,t+136,12,this.mtime)||this.needPax;e[t+156]=this[l].charCodeAt(0);this.needPax=encString(e,t+157,100,this.linkpath)||this.needPax;e.write("ustar\x0000",t+257,8);this.needPax=encString(e,t+265,32,this.uname)||this.needPax;this.needPax=encString(e,t+297,32,this.gname)||this.needPax;this.needPax=encNumber(e,t+329,8,this.devmaj)||this.needPax;this.needPax=encNumber(e,t+337,8,this.devmin)||this.needPax;this.needPax=encString(e,t+345,r,s)||this.needPax;if(e[t+475]!==0)this.needPax=encString(e,t+345,155,s)||this.needPax;else{this.needPax=encString(e,t+345,130,s)||this.needPax;this.needPax=encDate(e,t+476,12,this.atime)||this.needPax;this.needPax=encDate(e,t+488,12,this.ctime)||this.needPax}let a=8*32;for(let r=t;r<t+148;r++){a+=e[r]}for(let r=t+156;r<t+512;r++){a+=e[r]}this.cksum=a;encNumber(e,t+148,8,this.cksum);this.cksumValid=true;return this.needPax}set(e){for(let t in e){if(e[t]!==null&&e[t]!==undefined)this[t]=e[t]}}get type(){return n.name.get(this[l])||this[l]}get typeKey(){return this[l]}set type(e){if(n.code.has(e))this[l]=n.code.get(e);else this[l]=e}}const splitPrefix=(e,t)=>{const r=100;let n=e;let s="";let a;const l=i.parse(e).root||".";if(Buffer.byteLength(n)<r)a=[n,s,false];else{s=i.dirname(n);n=i.basename(n);do{if(Buffer.byteLength(n)<=r&&Buffer.byteLength(s)<=t)a=[n,s,false];else if(Buffer.byteLength(n)>r&&Buffer.byteLength(s)<=t)a=[n.substr(0,r-1),s,true];else{n=i.join(i.basename(s),n);s=i.dirname(s)}}while(s!==l&&!a);if(!a)a=[e.substr(0,r-1),"",true]}return a};const decString=(e,t,r)=>e.slice(t,t+r).toString("utf8").replace(/\0.*/,"");const decDate=(e,t,r)=>numToDate(decNumber(e,t,r));const numToDate=e=>e===null?null:new Date(e*1e3);const decNumber=(e,t,r)=>e[t]&128?s.parse(e.slice(t,t+r)):decSmallNumber(e,t,r);const nanNull=e=>isNaN(e)?null:e;const decSmallNumber=(e,t,r)=>nanNull(parseInt(e.slice(t,t+r).toString("utf8").replace(/\0.*$/,"").trim(),8));const o={12:8589934591,8:2097151};const encNumber=(e,t,r,n)=>n===null?false:n>o[r]||n<0?(s.encode(n,e.slice(t,t+r)),true):(encSmallNumber(e,t,r,n),false);const encSmallNumber=(e,t,r,n)=>e.write(octalString(n,r),t,r,"ascii");const octalString=(e,t)=>padOctal(Math.floor(e).toString(8),t);const padOctal=(e,t)=>(e.length===t-1?e:new Array(t-e.length-1).join("0")+e+" ")+"\0";const encDate=(e,t,r,n)=>n===null?false:encNumber(e,t,r,n.getTime()/1e3);const u=new Array(156).join("\0");const encString=(e,t,r,n)=>n===null?false:(e.write(n+u,t,r,"utf8"),n.length!==Buffer.byteLength(n)||n.length>r);e.exports=Header},5274:e=>{"use strict";const t=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);const r=e.exports=e=>e?Object.keys(e).map((r=>[t.has(r)?t.get(r):r,e[r]])).reduce(((e,t)=>(e[t[0]]=t[1],e)),Object.create(null)):{}},2370:(e,t)=>{"use strict";const r=t.encode=(e,t)=>{if(!Number.isSafeInteger(e))throw Error("cannot encode number outside of javascript safe integer range");else if(e<0)encodeNegative(e,t);else encodePositive(e,t);return t};const encodePositive=(e,t)=>{t[0]=128;for(var r=t.length;r>1;r--){t[r-1]=e&255;e=Math.floor(e/256)}};const encodeNegative=(e,t)=>{t[0]=255;var r=false;e=e*-1;for(var n=t.length;n>1;n--){var i=e&255;e=Math.floor(e/256);if(r)t[n-1]=onesComp(i);else if(i===0)t[n-1]=0;else{r=true;t[n-1]=twosComp(i)}}};const n=t.parse=e=>{var t=e[e.length-1];var r=e[0];var n;if(r===128)n=pos(e.slice(1,e.length));else if(r===255)n=twos(e);else throw Error("invalid base256 encoding");if(!Number.isSafeInteger(n))throw Error("parsed number outside of javascript safe integer range");return n};const twos=e=>{var t=e.length;var r=0;var n=false;for(var i=t-1;i>-1;i--){var s=e[i];var a;if(n)a=onesComp(s);else if(s===0)a=s;else{n=true;a=twosComp(s)}if(a!==0)r-=a*Math.pow(256,t-i-1)}return r};const pos=e=>{var t=e.length;var r=0;for(var n=t-1;n>-1;n--){var i=e[n];if(i!==0)r+=i*Math.pow(256,t-n-1)}return r};const onesComp=e=>(255^e)&255;const twosComp=e=>(255^e)+1&255},1525:(e,t,r)=>{"use strict";const n=r(5274);const i=r(8917);const s=r(7147);const a=r(7714);const l=r(1017);const o=e.exports=(e,t,r)=>{if(typeof e==="function")r=e,t=null,e={};else if(Array.isArray(e))t=e,e={};if(typeof t==="function")r=t,t=null;if(!t)t=[];else t=Array.from(t);const i=n(e);if(i.sync&&typeof r==="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof r==="function")throw new TypeError("callback only supported with file option");if(t.length)filesFilter(i,t);if(!i.noResume)onentryFunction(i);return i.file&&i.sync?listFileSync(i):i.file?listFile(i,r):list(i)};const onentryFunction=e=>{const t=e.onentry;e.onentry=t?e=>{t(e);e.resume()}:e=>e.resume()};const filesFilter=(e,t)=>{const r=new Map(t.map((e=>[e.replace(/\/+$/,""),true])));const n=e.filter;const mapHas=(e,t)=>{const n=t||l.parse(e).root||".";const i=e===n?false:r.has(e)?r.get(e):mapHas(l.dirname(e),n);r.set(e,i);return i};e.filter=n?(e,t)=>n(e,t)&&mapHas(e.replace(/\/+$/,"")):e=>mapHas(e.replace(/\/+$/,""))};const listFileSync=e=>{const t=list(e);const r=e.file;let n=true;let i;try{const a=s.statSync(r);const l=e.maxReadSize||16*1024*1024;if(a.size<l){t.end(s.readFileSync(r))}else{let e=0;const n=Buffer.allocUnsafe(l);i=s.openSync(r,"r");while(e<a.size){let r=s.readSync(i,n,0,l,e);e+=r;t.write(n.slice(0,r))}t.end()}n=false}finally{if(n&&i)try{s.closeSync(i)}catch(e){}}};const listFile=(e,t)=>{const r=new i(e);const n=e.maxReadSize||16*1024*1024;const l=e.file;const o=new Promise(((e,t)=>{r.on("error",t);r.on("end",e);s.stat(l,((e,i)=>{if(e)t(e);else{const e=new a.ReadStream(l,{readSize:n,size:i.size});e.on("error",t);e.pipe(r)}}))}));return t?o.then(t,t):o};const list=e=>new i(e)},9624:(e,t,r)=>{"use strict";const n=r(6186);const i=r(7147);const s=r(1017);const a=r(9051);class SymlinkError extends Error{constructor(e,t){super("Cannot extract through symbolic link");this.path=t;this.symlink=e}get name(){return"SylinkError"}}class CwdError extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'");this.path=e;this.code=t}get name(){return"CwdError"}}const l=e.exports=(e,t,r)=>{const l=t.umask;const o=t.mode|448;const u=(o&l)!==0;const c=t.uid;const h=t.gid;const d=typeof c==="number"&&typeof h==="number"&&(c!==t.processUid||h!==t.processGid);const v=t.preserve;const m=t.unlink;const p=t.cache;const _=t.cwd;const done=(t,n)=>{if(t)r(t);else{p.set(e,true);if(n&&d)a(n,c,h,(e=>done(e)));else if(u)i.chmod(e,o,r);else r()}};if(p&&p.get(e)===true)return done();if(e===_)return i.stat(e,((t,r)=>{if(t||!r.isDirectory())t=new CwdError(e,t&&t.code||"ENOTDIR");done(t)}));if(v)return n(e,{mode:o}).then((e=>done(null,e)),done);const g=s.relative(_,e);const w=g.split(/\/|\\/);mkdir_(_,w,o,p,m,_,null,done)};const mkdir_=(e,t,r,n,s,a,l,o)=>{if(!t.length)return o(null,l);const u=t.shift();const c=e+"/"+u;if(n.get(c))return mkdir_(c,t,r,n,s,a,l,o);i.mkdir(c,r,onmkdir(c,t,r,n,s,a,l,o))};const onmkdir=(e,t,r,n,a,l,o,u)=>c=>{if(c){if(c.path&&s.dirname(c.path)===l&&(c.code==="ENOTDIR"||c.code==="ENOENT"))return u(new CwdError(l,c.code));i.lstat(e,((s,h)=>{if(s)u(s);else if(h.isDirectory())mkdir_(e,t,r,n,a,l,o,u);else if(a)i.unlink(e,(s=>{if(s)return u(s);i.mkdir(e,r,onmkdir(e,t,r,n,a,l,o,u))}));else if(h.isSymbolicLink())return u(new SymlinkError(e,e+"/"+t.join("/")));else u(c)}))}else{o=o||e;mkdir_(e,t,r,n,a,l,o,u)}};const o=e.exports.sync=(e,t)=>{const r=t.umask;const l=t.mode|448;const o=(l&r)!==0;const u=t.uid;const c=t.gid;const h=typeof u==="number"&&typeof c==="number"&&(u!==t.processUid||c!==t.processGid);const d=t.preserve;const v=t.unlink;const m=t.cache;const p=t.cwd;const done=t=>{m.set(e,true);if(t&&h)a.sync(t,u,c);if(o)i.chmodSync(e,l)};if(m&&m.get(e)===true)return done();if(e===p){let t=false;let r="ENOTDIR";try{t=i.statSync(e).isDirectory()}catch(e){r=e.code}finally{if(!t)throw new CwdError(e,r)}done();return}if(d)return done(n.sync(e,l));const _=s.relative(p,e);const g=_.split(/\/|\\/);let w=null;for(let e=g.shift(),t=p;e&&(t+="/"+e);e=g.shift()){if(m.get(t))continue;try{i.mkdirSync(t,l);w=w||t;m.set(t,true)}catch(e){if(e.path&&s.dirname(e.path)===p&&(e.code==="ENOTDIR"||e.code==="ENOENT"))return new CwdError(p,e.code);const r=i.lstatSync(t);if(r.isDirectory()){m.set(t,true);continue}else if(v){i.unlinkSync(t);i.mkdirSync(t,l);w=w||t;m.set(t,true);continue}else if(r.isSymbolicLink())return new SymlinkError(t,t+"/"+g.join("/"))}}return done(w)}},8371:e=>{"use strict";e.exports=(e,t,r)=>{e&=4095;if(r){e=(e|384)&~18}if(t){if(e&256)e|=64;if(e&32)e|=8;if(e&4)e|=1}return e}},7900:(e,t,r)=>{"use strict";class PackJob{constructor(e,t){this.path=e||"./";this.absolute=t;this.entry=null;this.stat=null;this.readdir=null;this.pending=false;this.ignore=false;this.piped=false}}const n=r(1077);const i=r(3486);const s=r(8116);const a=r(5450);const l=a.Sync;const o=a.Tar;const u=r(665);const c=Buffer.alloc(1024);const h=Symbol("onStat");const d=Symbol("ended");const v=Symbol("queue");const m=Symbol("current");const p=Symbol("process");const _=Symbol("processing");const g=Symbol("processJob");const w=Symbol("jobs");const x=Symbol("jobDone");const b=Symbol("addFSEntry");const y=Symbol("addTarEntry");const S=Symbol("stat");const E=Symbol("readdir");const N=Symbol("onreaddir");const k=Symbol("pipe");const O=Symbol("entry");const R=Symbol("entryOpt");const C=Symbol("writeEntryClass");const A=Symbol("write");const I=Symbol("ondrain");const F=r(7147);const L=r(1017);const D=r(5899);const T=D(class Pack extends n{constructor(e){super(e);e=e||Object.create(null);this.opt=e;this.file=e.file||"";this.cwd=e.cwd||process.cwd();this.maxReadSize=e.maxReadSize;this.preservePaths=!!e.preservePaths;this.strict=!!e.strict;this.noPax=!!e.noPax;this.prefix=(e.prefix||"").replace(/(\\|\/)+$/,"");this.linkCache=e.linkCache||new Map;this.statCache=e.statCache||new Map;this.readdirCache=e.readdirCache||new Map;this[C]=a;if(typeof e.onwarn==="function")this.on("warn",e.onwarn);this.portable=!!e.portable;this.zip=null;if(e.gzip){if(typeof e.gzip!=="object")e.gzip={};if(this.portable)e.gzip.portable=true;this.zip=new i.Gzip(e.gzip);this.zip.on("data",(e=>super.write(e)));this.zip.on("end",(e=>super.end()));this.zip.on("drain",(e=>this[I]()));this.on("resume",(e=>this.zip.resume()))}else this.on("drain",this[I]);this.noDirRecurse=!!e.noDirRecurse;this.follow=!!e.follow;this.noMtime=!!e.noMtime;this.mtime=e.mtime||null;this.filter=typeof e.filter==="function"?e.filter:e=>true;this[v]=new u;this[w]=0;this.jobs=+e.jobs||4;this[_]=false;this[d]=false}[A](e){return super.write(e)}add(e){this.write(e);return this}end(e){if(e)this.write(e);this[d]=true;this[p]();return this}write(e){if(this[d])throw new Error("write after end");if(e instanceof s)this[y](e);else this[b](e);return this.flowing}[y](e){const t=L.resolve(this.cwd,e.path);if(this.prefix)e.path=this.prefix+"/"+e.path.replace(/^\.(\/+|$)/,"");if(!this.filter(e.path,e))e.resume();else{const r=new PackJob(e.path,t,false);r.entry=new o(e,this[R](r));r.entry.on("end",(e=>this[x](r)));this[w]+=1;this[v].push(r)}this[p]()}[b](e){const t=L.resolve(this.cwd,e);if(this.prefix)e=this.prefix+"/"+e.replace(/^\.(\/+|$)/,"");this[v].push(new PackJob(e,t));this[p]()}[S](e){e.pending=true;this[w]+=1;const t=this.follow?"stat":"lstat";F[t](e.absolute,((t,r)=>{e.pending=false;this[w]-=1;if(t)this.emit("error",t);else this[h](e,r)}))}[h](e,t){this.statCache.set(e.absolute,t);e.stat=t;if(!this.filter(e.path,t))e.ignore=true;this[p]()}[E](e){e.pending=true;this[w]+=1;F.readdir(e.absolute,((t,r)=>{e.pending=false;this[w]-=1;if(t)return this.emit("error",t);this[N](e,r)}))}[N](e,t){this.readdirCache.set(e.absolute,t);e.readdir=t;this[p]()}[p](){if(this[_])return;this[_]=true;for(let e=this[v].head;e!==null&&this[w]<this.jobs;e=e.next){this[g](e.value);if(e.value.ignore){const t=e.next;this[v].removeNode(e);e.next=t}}this[_]=false;if(this[d]&&!this[v].length&&this[w]===0){if(this.zip)this.zip.end(c);else{super.write(c);super.end()}}}get[m](){return this[v]&&this[v].head&&this[v].head.value}[x](e){this[v].shift();this[w]-=1;this[p]()}[g](e){if(e.pending)return;if(e.entry){if(e===this[m]&&!e.piped)this[k](e);return}if(!e.stat){if(this.statCache.has(e.absolute))this[h](e,this.statCache.get(e.absolute));else this[S](e)}if(!e.stat)return;if(e.ignore)return;if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){if(this.readdirCache.has(e.absolute))this[N](e,this.readdirCache.get(e.absolute));else this[E](e);if(!e.readdir)return}e.entry=this[O](e);if(!e.entry){e.ignore=true;return}if(e===this[m]&&!e.piped)this[k](e)}[R](e){return{onwarn:(e,t,r)=>this.warn(e,t,r),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime}}[O](e){this[w]+=1;try{return new this[C](e.path,this[R](e)).on("end",(()=>this[x](e))).on("error",(e=>this.emit("error",e)))}catch(e){this.emit("error",e)}}[I](){if(this[m]&&this[m].entry)this[m].entry.resume()}[k](e){e.piped=true;if(e.readdir)e.readdir.forEach((t=>{const r=this.prefix?e.path.slice(this.prefix.length+1)||"./":e.path;const n=r==="./"?"":r.replace(/\/*$/,"/");this[b](n+t)}));const t=e.entry;const r=this.zip;if(r)t.on("data",(e=>{if(!r.write(e))t.pause()}));else t.on("data",(e=>{if(!super.write(e))t.pause()}))}pause(){if(this.zip)this.zip.pause();return super.pause()}});class PackSync extends T{constructor(e){super(e);this[C]=l}pause(){}resume(){}[S](e){const t=this.follow?"statSync":"lstatSync";this[h](e,F[t](e.absolute))}[E](e,t){this[N](e,F.readdirSync(e.absolute))}[k](e){const t=e.entry;const r=this.zip;if(e.readdir)e.readdir.forEach((t=>{const r=this.prefix?e.path.slice(this.prefix.length+1)||"./":e.path;const n=r==="./"?"":r.replace(/\/*$/,"/");this[b](n+t)}));if(r)t.on("data",(e=>{r.write(e)}));else t.on("data",(e=>{super[A](e)}))}}T.Sync=PackSync;e.exports=T},8917:(e,t,r)=>{"use strict";const n=r(5899);const i=r(1017);const s=r(6043);const a=r(2361);const l=r(665);const o=1024*1024;const u=r(8116);const c=r(7996);const h=r(3486);const d=Buffer.from([31,139]);const v=Symbol("state");const m=Symbol("writeEntry");const p=Symbol("readEntry");const _=Symbol("nextEntry");const g=Symbol("processEntry");const w=Symbol("extendedHeader");const x=Symbol("globalExtendedHeader");const b=Symbol("meta");const y=Symbol("emitMeta");const S=Symbol("buffer");const E=Symbol("queue");const N=Symbol("ended");const k=Symbol("emittedEnd");const O=Symbol("emit");const R=Symbol("unzip");const C=Symbol("consumeChunk");const A=Symbol("consumeChunkSub");const I=Symbol("consumeBody");const F=Symbol("consumeMeta");const L=Symbol("consumeHeader");const D=Symbol("consuming");const T=Symbol("bufferConcat");const B=Symbol("maybeEnd");const P=Symbol("writing");const M=Symbol("aborted");const z=Symbol("onDone");const U=Symbol("sawValidEntry");const H=Symbol("sawNullBlock");const j=Symbol("sawEOF");const noop=e=>true;e.exports=n(class Parser extends a{constructor(e){e=e||{};super(e);this.file=e.file||"";this[U]=null;this.on(z,(e=>{if(this[v]==="begin"||this[U]===false){this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}}));if(e.ondone)this.on(z,e.ondone);else this.on(z,(e=>{this.emit("prefinish");this.emit("finish");this.emit("end");this.emit("close")}));this.strict=!!e.strict;this.maxMetaEntrySize=e.maxMetaEntrySize||o;this.filter=typeof e.filter==="function"?e.filter:noop;this.writable=true;this.readable=false;this[E]=new l;this[S]=null;this[p]=null;this[m]=null;this[v]="begin";this[b]="";this[w]=null;this[x]=null;this[N]=false;this[R]=null;this[M]=false;this[H]=false;this[j]=false;if(typeof e.onwarn==="function")this.on("warn",e.onwarn);if(typeof e.onentry==="function")this.on("entry",e.onentry)}[L](e,t){if(this[U]===null)this[U]=false;let r;try{r=new s(e,t,this[w],this[x])}catch(e){return this.warn("TAR_ENTRY_INVALID",e)}if(r.nullBlock){if(this[H]){this[j]=true;if(this[v]==="begin")this[v]="header";this[O]("eof")}else{this[H]=true;this[O]("nullBlock")}}else{this[H]=false;if(!r.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:r});else if(!r.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:r});else{const e=r.type;if(/^(Symbolic)?Link$/.test(e)&&!r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:r});else if(!/^(Symbolic)?Link$/.test(e)&&r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:r});else{const e=this[m]=new u(r,this[w],this[x]);if(!this[U]){if(e.remain){const onend=()=>{if(!e.invalid)this[U]=true};e.on("end",onend)}else{this[U]=true}}if(e.meta){if(e.size>this.maxMetaEntrySize){e.ignore=true;this[O]("ignoredEntry",e);this[v]="ignore";e.resume()}else if(e.size>0){this[b]="";e.on("data",(e=>this[b]+=e));this[v]="meta"}}else{this[w]=null;e.ignore=e.ignore||!this.filter(e.path,e);if(e.ignore){this[O]("ignoredEntry",e);this[v]=e.remain?"ignore":"header";e.resume()}else{if(e.remain)this[v]="body";else{this[v]="header";e.end()}if(!this[p]){this[E].push(e);this[_]()}else this[E].push(e)}}}}}}[g](e){let t=true;if(!e){this[p]=null;t=false}else if(Array.isArray(e))this.emit.apply(this,e);else{this[p]=e;this.emit("entry",e);if(!e.emittedEnd){e.on("end",(e=>this[_]()));t=false}}return t}[_](){do{}while(this[g](this[E].shift()));if(!this[E].length){const e=this[p];const t=!e||e.flowing||e.size===e.remain;if(t){if(!this[P])this.emit("drain")}else e.once("drain",(e=>this.emit("drain")))}}[I](e,t){const r=this[m];const n=r.blockRemain;const i=n>=e.length&&t===0?e:e.slice(t,t+n);r.write(i);if(!r.blockRemain){this[v]="header";this[m]=null;r.end()}return i.length}[F](e,t){const r=this[m];const n=this[I](e,t);if(!this[m])this[y](r);return n}[O](e,t,r){if(!this[E].length&&!this[p])this.emit(e,t,r);else this[E].push([e,t,r])}[y](e){this[O]("meta",this[b]);switch(e.type){case"ExtendedHeader":case"OldExtendedHeader":this[w]=c.parse(this[b],this[w],false);break;case"GlobalExtendedHeader":this[x]=c.parse(this[b],this[x],true);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[w]=this[w]||Object.create(null);this[w].path=this[b].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[w]=this[w]||Object.create(null);this[w].linkpath=this[b].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[M]=true;this.emit("abort",e);this.warn("TAR_ABORT",e,{recoverable:false})}write(e){if(this[M])return;if(this[R]===null&&e){if(this[S]){e=Buffer.concat([this[S],e]);this[S]=null}if(e.length<d.length){this[S]=e;return true}for(let t=0;this[R]===null&&t<d.length;t++){if(e[t]!==d[t])this[R]=false}if(this[R]===null){const t=this[N];this[N]=false;this[R]=new h.Unzip;this[R].on("data",(e=>this[C](e)));this[R].on("error",(e=>this.abort(e)));this[R].on("end",(e=>{this[N]=true;this[C]()}));this[P]=true;const r=this[R][t?"end":"write"](e);this[P]=false;return r}}this[P]=true;if(this[R])this[R].write(e);else this[C](e);this[P]=false;const t=this[E].length?false:this[p]?this[p].flowing:true;if(!t&&!this[E].length)this[p].once("drain",(e=>this.emit("drain")));return t}[T](e){if(e&&!this[M])this[S]=this[S]?Buffer.concat([this[S],e]):e}[B](){if(this[N]&&!this[k]&&!this[M]&&!this[D]){this[k]=true;const e=this[m];if(e&&e.blockRemain){const t=this[S]?this[S].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e});if(this[S])e.write(this[S]);e.end()}this[O](z)}}[C](e){if(this[D])this[T](e);else if(!e&&!this[S])this[B]();else{this[D]=true;if(this[S]){this[T](e);const t=this[S];this[S]=null;this[A](t)}else{this[A](e)}while(this[S]&&this[S].length>=512&&!this[M]&&!this[j]){const e=this[S];this[S]=null;this[A](e)}this[D]=false}if(!this[S]||this[N])this[B]()}[A](e){let t=0;let r=e.length;while(t+512<=r&&!this[M]&&!this[j]){switch(this[v]){case"begin":case"header":this[L](e,t);t+=512;break;case"ignore":case"body":t+=this[I](e,t);break;case"meta":t+=this[F](e,t);break;default:throw new Error("invalid state: "+this[v])}}if(t<r){if(this[S])this[S]=Buffer.concat([e.slice(t),this[S]]);else this[S]=e.slice(t)}}end(e){if(!this[M]){if(this[R])this[R].end(e);else{this[N]=true;this.write(e)}}}})},9587:(e,t,r)=>{const n=r(9491);e.exports=()=>{const e=new Map;const t=new Map;const{join:i}=r(1017);const getDirs=e=>i(e).split(/[\\\/]/).slice(0,-1).reduce(((e,t)=>e.length?e.concat(i(e[e.length-1],t)):[t]),[]);const s=new Set;const getQueues=r=>{const n=t.get(r);if(!n)throw new Error("function does not have any path reservations");return{paths:n.paths.map((t=>e.get(t))),dirs:[...n.dirs].map((t=>e.get(t)))}};const check=e=>{const{paths:t,dirs:r}=getQueues(e);return t.every((t=>t[0]===e))&&r.every((t=>t[0]instanceof Set&&t[0].has(e)))};const run=e=>{if(s.has(e)||!check(e))return false;s.add(e);e((()=>clear(e)));return true};const clear=r=>{if(!s.has(r))return false;const{paths:i,dirs:a}=t.get(r);const l=new Set;i.forEach((t=>{const i=e.get(t);n.equal(i[0],r);if(i.length===1)e.delete(t);else{i.shift();if(typeof i[0]==="function")l.add(i[0]);else i[0].forEach((e=>l.add(e)))}}));a.forEach((t=>{const i=e.get(t);n(i[0]instanceof Set);if(i[0].size===1&&i.length===1){e.delete(t)}else if(i[0].size===1){i.shift();l.add(i[0])}else i[0].delete(r)}));s.delete(r);l.forEach((e=>run(e)));return true};const reserve=(r,n)=>{const i=new Set(r.map((e=>getDirs(e))).reduce(((e,t)=>e.concat(t))));t.set(n,{dirs:i,paths:r});r.forEach((t=>{const r=e.get(t);if(!r)e.set(t,[n]);else r.push(n)}));i.forEach((t=>{const r=e.get(t);if(!r)e.set(t,[new Set([n])]);else if(r[r.length-1]instanceof Set)r[r.length-1].add(n);else r.push(new Set([n]))}));return run(n)};return{check:check,reserve:reserve}}},7996:(e,t,r)=>{"use strict";const n=r(6043);const i=r(1017);class Pax{constructor(e,t){this.atime=e.atime||null;this.charset=e.charset||null;this.comment=e.comment||null;this.ctime=e.ctime||null;this.gid=e.gid||null;this.gname=e.gname||null;this.linkpath=e.linkpath||null;this.mtime=e.mtime||null;this.path=e.path||null;this.size=e.size||null;this.uid=e.uid||null;this.uname=e.uname||null;this.dev=e.dev||null;this.ino=e.ino||null;this.nlink=e.nlink||null;this.global=t||false}encode(){const e=this.encodeBody();if(e==="")return null;const t=Buffer.byteLength(e);const r=512*Math.ceil(1+t/512);const s=Buffer.allocUnsafe(r);for(let e=0;e<512;e++){s[e]=0}new n({path:("PaxHeader/"+i.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(s);s.write(e,512,t,"utf8");for(let e=t+512;e<s.length;e++){s[e]=0}return s}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===null||this[e]===undefined)return"";const t=this[e]instanceof Date?this[e].getTime()/1e3:this[e];const r=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+t+"\n";const n=Buffer.byteLength(r);let i=Math.floor(Math.log(n)/Math.log(10))+1;if(n+i>=Math.pow(10,i))i+=1;const s=i+n;return s+r}}Pax.parse=(e,t,r)=>new Pax(merge(parseKV(e),t),r);const merge=(e,t)=>t?Object.keys(e).reduce(((t,r)=>(t[r]=e[r],t)),t):e;const parseKV=e=>e.replace(/\n$/,"").split("\n").reduce(parseKVLine,Object.create(null));const parseKVLine=(e,t)=>{const r=parseInt(t,10);if(r!==Buffer.byteLength(t)+1)return e;t=t.substr((r+" ").length);const n=t.split("=");const i=n.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!i)return e;const s=n.join("=");e[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(s*1e3):/^[0-9]+$/.test(s)?+s:s;return e};e.exports=Pax},8116:(e,t,r)=>{"use strict";const n=r(4173);const i=r(1077);const s=Symbol("slurp");e.exports=class ReadEntry extends i{constructor(e,t,r){super();this.pause();this.extended=t;this.globalExtended=r;this.header=e;this.startBlockSize=512*Math.ceil(e.size/512);this.blockRemain=this.startBlockSize;this.remain=e.size;this.type=e.type;this.meta=false;this.ignore=false;switch(this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=true;break;default:this.ignore=true}this.path=e.path;this.mode=e.mode;if(this.mode)this.mode=this.mode&4095;this.uid=e.uid;this.gid=e.gid;this.uname=e.uname;this.gname=e.gname;this.size=e.size;this.mtime=e.mtime;this.atime=e.atime;this.ctime=e.ctime;this.linkpath=e.linkpath;this.uname=e.uname;this.gname=e.gname;if(t)this[s](t);if(r)this[s](r,true)}write(e){const t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");const r=this.remain;const n=this.blockRemain;this.remain=Math.max(0,r-t);this.blockRemain=Math.max(0,n-t);if(this.ignore)return true;if(r>=t)return super.write(e);return super.write(e.slice(0,r))}[s](e,t){for(let r in e){if(e[r]!==null&&e[r]!==undefined&&!(t&&r==="path"))this[r]=e[r]}}}},5923:(e,t,r)=>{"use strict";const n=r(5274);const i=r(7900);const s=r(8917);const a=r(7147);const l=r(7714);const o=r(1525);const u=r(1017);const c=r(6043);const h=e.exports=(e,t,r)=>{const i=n(e);if(!i.file)throw new TypeError("file is required");if(i.gzip)throw new TypeError("cannot append to compressed archives");if(!t||!Array.isArray(t)||!t.length)throw new TypeError("no files or directories specified");t=Array.from(t);return i.sync?replaceSync(i,t):replace(i,t,r)};const replaceSync=(e,t)=>{const r=new i.Sync(e);let n=true;let s;let l;try{try{s=a.openSync(e.file,"r+")}catch(t){if(t.code==="ENOENT")s=a.openSync(e.file,"w+");else throw t}const i=a.fstatSync(s);const o=Buffer.alloc(512);e:for(l=0;l<i.size;l+=512){for(let e=0,t=0;e<512;e+=t){t=a.readSync(s,o,e,o.length-e,l+e);if(l===0&&o[0]===31&&o[1]===139)throw new Error("cannot append to compressed archives");if(!t)break e}let t=new c(o);if(!t.cksumValid)break;let r=512*Math.ceil(t.size/512);if(l+r+512>i.size)break;l+=r;if(e.mtimeCache)e.mtimeCache.set(t.path,t.mtime)}n=false;streamSync(e,r,l,s,t)}finally{if(n)try{a.closeSync(s)}catch(e){}}};const streamSync=(e,t,r,n,i)=>{const s=new l.WriteStreamSync(e.file,{fd:n,start:r});t.pipe(s);addFilesSync(t,i)};const replace=(e,t,r)=>{t=Array.from(t);const n=new i(e);const getPos=(t,r,n)=>{const cb=(e,r)=>{if(e)a.close(t,(t=>n(e)));else n(null,r)};let i=0;if(r===0)return cb(null,0);let s=0;const l=Buffer.alloc(512);const onread=(n,o)=>{if(n)return cb(n);s+=o;if(s<512&&o)return a.read(t,l,s,l.length-s,i+s,onread);if(i===0&&l[0]===31&&l[1]===139)return cb(new Error("cannot append to compressed archives"));if(s<512)return cb(null,i);const u=new c(l);if(!u.cksumValid)return cb(null,i);const h=512*Math.ceil(u.size/512);if(i+h+512>r)return cb(null,i);i+=h+512;if(i>=r)return cb(null,i);if(e.mtimeCache)e.mtimeCache.set(u.path,u.mtime);s=0;a.read(t,l,0,512,i,onread)};a.read(t,l,0,512,i,onread)};const s=new Promise(((r,i)=>{n.on("error",i);let s="r+";const onopen=(o,u)=>{if(o&&o.code==="ENOENT"&&s==="r+"){s="w+";return a.open(e.file,s,onopen)}if(o)return i(o);a.fstat(u,((s,a)=>{if(s)return i(s);getPos(u,a.size,((s,a)=>{if(s)return i(s);const o=new l.WriteStream(e.file,{fd:u,start:a});n.pipe(o);o.on("error",i);o.on("close",r);addFilesAsync(n,t)}))}))};a.open(e.file,s,onopen)}));return r?s.then(r,r):s};const addFilesSync=(e,t)=>{t.forEach((t=>{if(t.charAt(0)==="@")o({file:u.resolve(e.cwd,t.substr(1)),sync:true,noResume:true,onentry:t=>e.add(t)});else e.add(t)}));e.end()};const addFilesAsync=(e,t)=>{while(t.length){const r=t.shift();if(r.charAt(0)==="@")return o({file:u.resolve(e.cwd,r.substr(1)),noResume:true,onentry:t=>e.add(t)}).then((r=>addFilesAsync(e,t)));else e.add(r)}e.end()}},4173:(e,t)=>{"use strict";t.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);t.code=new Map(Array.from(t.name).map((e=>[e[1],e[0]])))},7628:(e,t,r)=>{"use strict";const n=r(9491);const i=r(2361).EventEmitter;const s=r(8917);const a=r(7147);const l=r(7714);const o=r(1017);const u=r(9624);const c=u.sync;const h=r(4808);const d=r(9587);const v=Symbol("onEntry");const m=Symbol("checkFs");const p=Symbol("checkFs2");const _=Symbol("isReusable");const g=Symbol("makeFs");const w=Symbol("file");const x=Symbol("directory");const b=Symbol("link");const y=Symbol("symlink");const S=Symbol("hardlink");const E=Symbol("unsupported");const N=Symbol("unknown");const k=Symbol("checkPath");const O=Symbol("mkdir");const R=Symbol("onError");const C=Symbol("pending");const A=Symbol("pend");const I=Symbol("unpend");const F=Symbol("ended");const L=Symbol("maybeClose");const D=Symbol("skip");const T=Symbol("doChown");const B=Symbol("uid");const P=Symbol("gid");const M=r(6113);const z=r(1172);const neverCalled=()=>{throw new Error("sync function called cb somehow?!?")};const unlinkFile=(e,t)=>{if(process.platform!=="win32")return a.unlink(e,t);const r=e+".DELETE."+M.randomBytes(16).toString("hex");a.rename(e,r,(e=>{if(e)return t(e);a.unlink(r,t)}))};const unlinkFileSync=e=>{if(process.platform!=="win32")return a.unlinkSync(e);const t=e+".DELETE."+M.randomBytes(16).toString("hex");a.renameSync(e,t);a.unlinkSync(t)};const uint32=(e,t,r)=>e===e>>>0?e:t===t>>>0?t:r;class Unpack extends s{constructor(e){if(!e)e={};e.ondone=e=>{this[F]=true;this[L]()};super(e);this.reservations=d();this.transform=typeof e.transform==="function"?e.transform:null;this.writable=true;this.readable=false;this[C]=0;this[F]=false;this.dirCache=e.dirCache||new Map;if(typeof e.uid==="number"||typeof e.gid==="number"){if(typeof e.uid!=="number"||typeof e.gid!=="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid;this.gid=e.gid;this.setOwner=true}else{this.uid=null;this.gid=null;this.setOwner=false}if(e.preserveOwner===undefined&&typeof e.uid!=="number")this.preserveOwner=process.getuid&&process.getuid()===0;else this.preserveOwner=!!e.preserveOwner;this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null;this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null;this.forceChown=e.forceChown===true;this.win32=!!e.win32||process.platform==="win32";this.newer=!!e.newer;this.keep=!!e.keep;this.noMtime=!!e.noMtime;this.preservePaths=!!e.preservePaths;this.unlink=!!e.unlink;this.cwd=o.resolve(e.cwd||process.cwd());this.strip=+e.strip||0;this.processUmask=process.umask();this.umask=typeof e.umask==="number"?e.umask:this.processUmask;this.dmode=e.dmode||511&~this.umask;this.fmode=e.fmode||438&~this.umask;this.on("entry",(e=>this[v](e)))}warn(e,t,r={}){if(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")r.recoverable=false;return super.warn(e,t,r)}[L](){if(this[F]&&this[C]===0){this.emit("prefinish");this.emit("finish");this.emit("end");this.emit("close")}}[k](e){if(this.strip){const t=e.path.split(/\/|\\/);if(t.length<this.strip)return false;e.path=t.slice(this.strip).join("/");if(e.type==="Link"){const t=e.linkpath.split(/\/|\\/);if(t.length>=this.strip)e.linkpath=t.slice(this.strip).join("/")}}if(!this.preservePaths){const t=e.path;if(t.match(/(^|\/|\\)\.\.(\\|\/|$)/)){this.warn("TAR_ENTRY_ERROR",`path contains '..'`,{entry:e,path:t});return false}if(o.win32.isAbsolute(t)){const r=o.win32.parse(t);e.path=t.substr(r.root.length);const n=r.root;this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:e,path:t})}}if(this.win32){const t=o.win32.parse(e.path);e.path=t.root===""?h.encode(e.path):t.root+h.encode(e.path.substr(t.root.length))}if(o.isAbsolute(e.path))e.absolute=e.path;else e.absolute=o.resolve(this.cwd,e.path);return true}[v](e){if(!this[k](e))return e.resume();n.equal(typeof e.absolute,"string");switch(e.type){case"Directory":case"GNUDumpDir":if(e.mode)e.mode=e.mode|448;case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[m](e);case"CharacterDevice":case"BlockDevice":case"FIFO":return this[E](e)}}[R](e,t){if(e.name==="CwdError")this.emit("error",e);else{this.warn("TAR_ENTRY_ERROR",e,{entry:t});this[I]();t.resume()}}[O](e,t,r){u(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t},r)}[T](e){return this.forceChown||this.preserveOwner&&(typeof e.uid==="number"&&e.uid!==this.processUid||typeof e.gid==="number"&&e.gid!==this.processGid)||(typeof this.uid==="number"&&this.uid!==this.processUid||typeof this.gid==="number"&&this.gid!==this.processGid)}[B](e){return uint32(this.uid,e.uid,this.processUid)}[P](e){return uint32(this.gid,e.gid,this.processGid)}[w](e,t){const r=e.mode&4095||this.fmode;const n=new l.WriteStream(e.absolute,{flags:z(e.size),mode:r,autoClose:false});n.on("error",(t=>this[R](t,e)));let i=1;const done=r=>{if(r)return this[R](r,e);if(--i===0){a.close(n.fd,(r=>{t();r?this[R](r,e):this[I]()}))}};n.on("finish",(t=>{const r=e.absolute;const s=n.fd;if(e.mtime&&!this.noMtime){i++;const t=e.atime||new Date;const n=e.mtime;a.futimes(s,t,n,(e=>e?a.utimes(r,t,n,(t=>done(t&&e))):done()))}if(this[T](e)){i++;const t=this[B](e);const n=this[P](e);a.fchown(s,t,n,(e=>e?a.chown(r,t,n,(t=>done(t&&e))):done()))}done()}));const s=this.transform?this.transform(e)||e:e;if(s!==e){s.on("error",(t=>this[R](t,e)));e.pipe(s)}s.pipe(n)}[x](e,t){const r=e.mode&4095||this.dmode;this[O](e.absolute,r,(r=>{if(r){t();return this[R](r,e)}let n=1;const done=r=>{if(--n===0){t();this[I]();e.resume()}};if(e.mtime&&!this.noMtime){n++;a.utimes(e.absolute,e.atime||new Date,e.mtime,done)}if(this[T](e)){n++;a.chown(e.absolute,this[B](e),this[P](e),done)}done()}))}[E](e){e.unsupported=true;this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e});e.resume()}[y](e,t){this[b](e,e.linkpath,"symlink",t)}[S](e,t){this[b](e,o.resolve(this.cwd,e.linkpath),"link",t)}[A](){this[C]++}[I](){this[C]--;this[L]()}[D](e){this[I]();e.resume()}[_](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&process.platform!=="win32"}[m](e){this[A]();const t=[e.path];if(e.linkpath)t.push(e.linkpath);this.reservations.reserve(t,(t=>this[p](e,t)))}[p](e,t){this[O](o.dirname(e.absolute),this.dmode,(r=>{if(r){t();return this[R](r,e)}a.lstat(e.absolute,((r,n)=>{if(n&&(this.keep||this.newer&&n.mtime>e.mtime)){this[D](e);t()}else if(r||this[_](e,n)){this[g](null,e,t)}else if(n.isDirectory()){if(e.type==="Directory"){if(!e.mode||(n.mode&4095)===e.mode)this[g](null,e,t);else a.chmod(e.absolute,e.mode,(r=>this[g](r,e,t)))}else a.rmdir(e.absolute,(r=>this[g](r,e,t)))}else unlinkFile(e.absolute,(r=>this[g](r,e,t)))}))}))}[g](e,t,r){if(e)return this[R](e,t);switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[w](t,r);case"Link":return this[S](t,r);case"SymbolicLink":return this[y](t,r);case"Directory":case"GNUDumpDir":return this[x](t,r)}}[b](e,t,r,n){a[r](t,e.absolute,(t=>{if(t)return this[R](t,e);n();this[I]();e.resume()}))}}class UnpackSync extends Unpack{constructor(e){super(e)}[m](e){const t=this[O](o.dirname(e.absolute),this.dmode,neverCalled);if(t)return this[R](t,e);try{const r=a.lstatSync(e.absolute);if(this.keep||this.newer&&r.mtime>e.mtime)return this[D](e);else if(this[_](e,r))return this[g](null,e,neverCalled);else{try{if(r.isDirectory()){if(e.type==="Directory"){if(e.mode&&(r.mode&4095)!==e.mode)a.chmodSync(e.absolute,e.mode)}else a.rmdirSync(e.absolute)}else unlinkFileSync(e.absolute);return this[g](null,e,neverCalled)}catch(t){return this[R](t,e)}}}catch(t){return this[g](null,e,neverCalled)}}[w](e,t){const r=e.mode&4095||this.fmode;const oner=t=>{let r;try{a.closeSync(i)}catch(e){r=e}if(t||r)this[R](t||r,e)};let n;let i;try{i=a.openSync(e.absolute,z(e.size),r)}catch(e){return oner(e)}const s=this.transform?this.transform(e)||e:e;if(s!==e){s.on("error",(t=>this[R](t,e)));e.pipe(s)}s.on("data",(e=>{try{a.writeSync(i,e,0,e.length)}catch(e){oner(e)}}));s.on("end",(t=>{let r=null;if(e.mtime&&!this.noMtime){const t=e.atime||new Date;const n=e.mtime;try{a.futimesSync(i,t,n)}catch(i){try{a.utimesSync(e.absolute,t,n)}catch(e){r=i}}}if(this[T](e)){const t=this[B](e);const n=this[P](e);try{a.fchownSync(i,t,n)}catch(i){try{a.chownSync(e.absolute,t,n)}catch(e){r=r||i}}}oner(r)}))}[x](e,t){const r=e.mode&4095||this.dmode;const n=this[O](e.absolute,r);if(n)return this[R](n,e);if(e.mtime&&!this.noMtime){try{a.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch(n){}}if(this[T](e)){try{a.chownSync(e.absolute,this[B](e),this[P](e))}catch(n){}}e.resume()}[O](e,t){try{return u.sync(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(e){return e}}[b](e,t,r,n){try{a[r+"Sync"](t,e.absolute);e.resume()}catch(t){return this[R](t,e)}}}Unpack.Sync=UnpackSync;e.exports=Unpack},4404:(e,t,r)=>{"use strict";const n=r(5274);const i=r(5923);const s=e.exports=(e,t,r)=>{const s=n(e);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!t||!Array.isArray(t)||!t.length)throw new TypeError("no files or directories specified");t=Array.from(t);mtimeFilter(s);return i(s,t,r)};const mtimeFilter=e=>{const t=e.filter;if(!e.mtimeCache)e.mtimeCache=new Map;e.filter=t?(r,n)=>t(r,n)&&!(e.mtimeCache.get(r)>n.mtime):(t,r)=>!(e.mtimeCache.get(t)>r.mtime)}},5899:e=>{"use strict";e.exports=e=>class extends e{warn(e,t,r={}){if(this.file)r.file=this.file;if(this.cwd)r.cwd=this.cwd;r.code=t instanceof Error&&t.code||e;r.tarCode=e;if(!this.strict&&r.recoverable!==false){if(t instanceof Error){r=Object.assign(t,r);t=t.message}this.emit("warn",r.tarCode,t,r)}else if(t instanceof Error){this.emit("error",Object.assign(t,r))}else this.emit("error",Object.assign(new Error(`${e}: ${t}`),r))}}},4808:e=>{"use strict";const t=["|","<",">","?",":"];const r=t.map((e=>String.fromCharCode(61440+e.charCodeAt(0))));const n=new Map(t.map(((e,t)=>[e,r[t]])));const i=new Map(r.map(((e,r)=>[e,t[r]])));e.exports={encode:e=>t.reduce(((e,t)=>e.split(t).join(n.get(t))),e),decode:e=>r.reduce(((e,t)=>e.split(t).join(i.get(t))),e)}},5450:(e,t,r)=>{"use strict";const n=r(1077);const i=r(7996);const s=r(6043);const a=r(8116);const l=r(7147);const o=r(1017);const u=r(4173);const c=16*1024*1024;const h=Symbol("process");const d=Symbol("file");const v=Symbol("directory");const m=Symbol("symlink");const p=Symbol("hardlink");const _=Symbol("header");const g=Symbol("read");const w=Symbol("lstat");const x=Symbol("onlstat");const b=Symbol("onread");const y=Symbol("onreadlink");const S=Symbol("openfile");const E=Symbol("onopenfile");const N=Symbol("close");const k=Symbol("mode");const O=r(5899);const R=r(4808);const C=r(8371);const A=O(class WriteEntry extends n{constructor(e,t){t=t||{};super(t);if(typeof e!=="string")throw new TypeError("path is required");this.path=e;this.portable=!!t.portable;this.myuid=process.getuid&&process.getuid();this.myuser=process.env.USER||"";this.maxReadSize=t.maxReadSize||c;this.linkCache=t.linkCache||new Map;this.statCache=t.statCache||new Map;this.preservePaths=!!t.preservePaths;this.cwd=t.cwd||process.cwd();this.strict=!!t.strict;this.noPax=!!t.noPax;this.noMtime=!!t.noMtime;this.mtime=t.mtime||null;if(typeof t.onwarn==="function")this.on("warn",t.onwarn);let r=false;if(!this.preservePaths&&o.win32.isAbsolute(e)){const t=o.win32.parse(e);this.path=e.substr(t.root.length);r=t.root}this.win32=!!t.win32||process.platform==="win32";if(this.win32){this.path=R.decode(this.path.replace(/\\/g,"/"));e=e.replace(/\\/g,"/")}this.absolute=t.absolute||o.resolve(this.cwd,e);if(this.path==="")this.path="./";if(r){this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path})}if(this.statCache.has(this.absolute))this[x](this.statCache.get(this.absolute));else this[w]()}[w](){l.lstat(this.absolute,((e,t)=>{if(e)return this.emit("error",e);this[x](t)}))}[x](e){this.statCache.set(this.absolute,e);this.stat=e;if(!e.isFile())e.size=0;this.type=getType(e);this.emit("stat",e);this[h]()}[h](){switch(this.type){case"File":return this[d]();case"Directory":return this[v]();case"SymbolicLink":return this[m]();default:return this.end()}}[k](e){return C(e,this.type==="Directory",this.portable)}[_](){if(this.type==="Directory"&&this.portable)this.noMtime=true;this.header=new s({path:this.path,linkpath:this.linkpath,mode:this[k](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime});if(this.header.encode()&&!this.noPax)this.write(new i({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this.path,linkpath:this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode());this.write(this.header.block)}[v](){if(this.path.substr(-1)!=="/")this.path+="/";this.stat.size=0;this[_]();this.end()}[m](){l.readlink(this.absolute,((e,t)=>{if(e)return this.emit("error",e);this[y](t)}))}[y](e){this.linkpath=e.replace(/\\/g,"/");this[_]();this.end()}[p](e){this.type="Link";this.linkpath=o.relative(this.cwd,e).replace(/\\/g,"/");this.stat.size=0;this[_]();this.end()}[d](){if(this.stat.nlink>1){const e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){const t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[p](t)}this.linkCache.set(e,this.absolute)}this[_]();if(this.stat.size===0)return this.end();this[S]()}[S](){l.open(this.absolute,"r",((e,t)=>{if(e)return this.emit("error",e);this[E](t)}))}[E](e){const t=512*Math.ceil(this.stat.size/512);const r=Math.min(t,this.maxReadSize);const n=Buffer.allocUnsafe(r);this[g](e,n,0,n.length,0,this.stat.size,t)}[g](e,t,r,n,i,s,a){l.read(e,t,r,n,i,((l,o)=>{if(l){return this[N](e,(()=>this.emit("error",l)))}this[b](e,t,r,n,i,s,a,o)}))}[N](e,t){l.close(e,t)}[b](e,t,r,n,i,s,a,l){if(l<=0&&s>0){const t=new Error("encountered unexpected EOF");t.path=this.absolute;t.syscall="read";t.code="EOF";return this[N](e,(()=>this.emit("error",t)))}if(l>s){const t=new Error("did not encounter expected EOF");t.path=this.absolute;t.syscall="read";t.code="EOF";return this[N](e,(()=>this.emit("error",t)))}if(l===s){for(let e=l;e<n&&l<a;e++){t[e+r]=0;l++;s++}}const o=r===0&&l===t.length?t:t.slice(r,r+l);s-=l;a-=l;i+=l;r+=l;this.write(o);if(!s){if(a)this.write(Buffer.alloc(a));return this[N](e,(e=>e?this.emit("error",e):this.end()))}if(r>=n){t=Buffer.allocUnsafe(n);r=0}n=t.length-r;this[g](e,t,r,n,i,s,a)}});class WriteEntrySync extends A{constructor(e,t){super(e,t)}[w](){this[x](l.lstatSync(this.absolute))}[m](){this[y](l.readlinkSync(this.absolute))}[S](){this[E](l.openSync(this.absolute,"r"))}[g](e,t,r,n,i,s,a){let o=true;try{const u=l.readSync(e,t,r,n,i);this[b](e,t,r,n,i,s,a,u);o=false}finally{if(o)try{this[N](e,(()=>{}))}catch(e){}}}[N](e,t){l.closeSync(e);t()}}const I=O(class WriteEntryTar extends n{constructor(e,t){t=t||{};super(t);this.preservePaths=!!t.preservePaths;this.portable=!!t.portable;this.strict=!!t.strict;this.noPax=!!t.noPax;this.noMtime=!!t.noMtime;this.readEntry=e;this.type=e.type;if(this.type==="Directory"&&this.portable)this.noMtime=true;this.path=e.path;this.mode=this[k](e.mode);this.uid=this.portable?null:e.uid;this.gid=this.portable?null:e.gid;this.uname=this.portable?null:e.uname;this.gname=this.portable?null:e.gname;this.size=e.size;this.mtime=this.noMtime?null:t.mtime||e.mtime;this.atime=this.portable?null:e.atime;this.ctime=this.portable?null:e.ctime;this.linkpath=e.linkpath;if(typeof t.onwarn==="function")this.on("warn",t.onwarn);let r=false;if(o.isAbsolute(this.path)&&!this.preservePaths){const e=o.parse(this.path);r=e.root;this.path=this.path.substr(e.root.length)}this.remain=e.size;this.blockRemain=e.startBlockSize;this.header=new s({path:this.path,linkpath:this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime});if(r){this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path})}if(this.header.encode()&&!this.noPax)super.write(new i({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this.path,linkpath:this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode());super.write(this.header.block);e.pipe(this)}[k](e){return C(e,this.type==="Directory",this.portable)}write(e){const t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");this.blockRemain-=t;return super.write(e)}end(){if(this.blockRemain)this.write(Buffer.alloc(this.blockRemain));return super.end()}});A.Sync=WriteEntrySync;A.Tar=I;const getType=e=>e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":"Unsupported";e.exports=A},4091:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next){yield e.value}}}},665:(e,t,r)=>{"use strict";e.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(e){var t=this;if(!(t instanceof Yallist)){t=new Yallist}t.tail=null;t.head=null;t.length=0;if(e&&typeof e.forEach==="function"){e.forEach((function(e){t.push(e)}))}else if(arguments.length>0){for(var r=0,n=arguments.length;r<n;r++){t.push(arguments[r])}}return t}Yallist.prototype.removeNode=function(e){if(e.list!==this){throw new Error("removing node which does not belong to this list")}var t=e.next;var r=e.prev;if(t){t.prev=r}if(r){r.next=t}if(e===this.head){this.head=t}if(e===this.tail){this.tail=r}e.list.length--;e.next=null;e.prev=null;e.list=null;return t};Yallist.prototype.unshiftNode=function(e){if(e===this.head){return}if(e.list){e.list.removeNode(e)}var t=this.head;e.list=this;e.next=t;if(t){t.prev=e}this.head=e;if(!this.tail){this.tail=e}this.length++};Yallist.prototype.pushNode=function(e){if(e===this.tail){return}if(e.list){e.list.removeNode(e)}var t=this.tail;e.list=this;e.prev=t;if(t){t.next=e}this.tail=e;if(!this.head){this.head=e}this.length++};Yallist.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++){push(this,arguments[e])}return this.length};Yallist.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++){unshift(this,arguments[e])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var e=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return e};Yallist.prototype.shift=function(){if(!this.head){return undefined}var e=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return e};Yallist.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++){e.call(t,r.value,n,this);r=r.next}};Yallist.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--){e.call(t,r.value,n,this);r=r.prev}};Yallist.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++){r=r.next}if(t===e&&r!==null){return r.value}};Yallist.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++){r=r.prev}if(t===e&&r!==null){return r.value}};Yallist.prototype.map=function(e,t){t=t||this;var r=new Yallist;for(var n=this.head;n!==null;){r.push(e.call(t,n.value,this));n=n.next}return r};Yallist.prototype.mapReverse=function(e,t){t=t||this;var r=new Yallist;for(var n=this.tail;n!==null;){r.push(e.call(t,n.value,this));n=n.prev}return r};Yallist.prototype.reduce=function(e,t){var r;var n=this.head;if(arguments.length>1){r=t}else if(this.head){n=this.head.next;r=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var i=0;n!==null;i++){r=e(r,n.value,i);n=n.next}return r};Yallist.prototype.reduceReverse=function(e,t){var r;var n=this.tail;if(arguments.length>1){r=t}else if(this.tail){n=this.tail.prev;r=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var i=this.length-1;n!==null;i--){r=e(r,n.value,i);n=n.prev}return r};Yallist.prototype.toArray=function(){var e=new Array(this.length);for(var t=0,r=this.head;r!==null;t++){e[t]=r.value;r=r.next}return e};Yallist.prototype.toArrayReverse=function(){var e=new Array(this.length);for(var t=0,r=this.tail;r!==null;t++){e[t]=r.value;r=r.prev}return e};Yallist.prototype.slice=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var n=0,i=this.head;i!==null&&n<e;n++){i=i.next}for(;i!==null&&n<t;n++,i=i.next){r.push(i.value)}return r};Yallist.prototype.sliceReverse=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var n=this.length,i=this.tail;i!==null&&n>t;n--){i=i.prev}for(;i!==null&&n>e;n--,i=i.prev){r.push(i.value)}return r};Yallist.prototype.splice=function(e,t,...r){if(e>this.length){e=this.length-1}if(e<0){e=this.length+e}for(var n=0,i=this.head;i!==null&&n<e;n++){i=i.next}var s=[];for(var n=0;i&&n<t;n++){s.push(i.value);i=this.removeNode(i)}if(i===null){i=this.tail}if(i!==this.head&&i!==this.tail){i=i.prev}for(var n=0;n<r.length;n++){i=insert(this,i,r[n])}return s};Yallist.prototype.reverse=function(){var e=this.head;var t=this.tail;for(var r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next;r.next=n}this.head=t;this.tail=e;return this};function insert(e,t,r){var n=t===e.head?new Node(r,null,t,e):new Node(r,t,t.next,e);if(n.next===null){e.tail=n}if(n.prev===null){e.head=n}e.length++;return n}function push(e,t){e.tail=new Node(t,e.tail,null,e);if(!e.head){e.head=e.tail}e.length++}function unshift(e,t){e.head=new Node(t,null,e.head,e);if(!e.tail){e.tail=e.head}e.length++}function Node(e,t,r,n){if(!(this instanceof Node)){return new Node(e,t,r,n)}this.list=n;this.value=e;if(t){t.next=this;this.prev=t}else{this.prev=null}if(r){r.prev=this;this.next=r}else{this.next=null}}try{r(4091)(Yallist)}catch(e){}},8781:(e,t,r)=>{var n=r(7147);var i=r(9796);var s=r(5010);var a=r(4794);var l=r(3837);var o=r(2361).EventEmitter;var u=r(2781).Transform;var c=r(2781).PassThrough;var h=r(2781).Writable;t.open=open;t.fromFd=fromFd;t.fromBuffer=fromBuffer;t.fromRandomAccessReader=fromRandomAccessReader;t.dosDateTimeToDate=dosDateTimeToDate;t.validateFileName=validateFileName;t.ZipFile=ZipFile;t.Entry=Entry;t.RandomAccessReader=RandomAccessReader;function open(e,t,r){if(typeof t==="function"){r=t;t=null}if(t==null)t={};if(t.autoClose==null)t.autoClose=true;if(t.lazyEntries==null)t.lazyEntries=false;if(t.decodeStrings==null)t.decodeStrings=true;if(t.validateEntrySizes==null)t.validateEntrySizes=true;if(t.strictFileNames==null)t.strictFileNames=false;if(r==null)r=defaultCallback;n.open(e,"r",(function(e,i){if(e)return r(e);fromFd(i,t,(function(e,t){if(e)n.close(i,defaultCallback);r(e,t)}))}))}function fromFd(e,t,r){if(typeof t==="function"){r=t;t=null}if(t==null)t={};if(t.autoClose==null)t.autoClose=false;if(t.lazyEntries==null)t.lazyEntries=false;if(t.decodeStrings==null)t.decodeStrings=true;if(t.validateEntrySizes==null)t.validateEntrySizes=true;if(t.strictFileNames==null)t.strictFileNames=false;if(r==null)r=defaultCallback;n.fstat(e,(function(n,i){if(n)return r(n);var a=s.createFromFd(e,{autoClose:true});fromRandomAccessReader(a,i.size,t,r)}))}function fromBuffer(e,t,r){if(typeof t==="function"){r=t;t=null}if(t==null)t={};t.autoClose=false;if(t.lazyEntries==null)t.lazyEntries=false;if(t.decodeStrings==null)t.decodeStrings=true;if(t.validateEntrySizes==null)t.validateEntrySizes=true;if(t.strictFileNames==null)t.strictFileNames=false;var n=s.createFromBuffer(e,{maxChunkSize:65536});fromRandomAccessReader(n,e.length,t,r)}function fromRandomAccessReader(e,t,r,n){if(typeof r==="function"){n=r;r=null}if(r==null)r={};if(r.autoClose==null)r.autoClose=true;if(r.lazyEntries==null)r.lazyEntries=false;if(r.decodeStrings==null)r.decodeStrings=true;var i=!!r.decodeStrings;if(r.validateEntrySizes==null)r.validateEntrySizes=true;if(r.strictFileNames==null)r.strictFileNames=false;if(n==null)n=defaultCallback;if(typeof t!=="number")throw new Error("expected totalSize parameter to be a number");if(t>Number.MAX_SAFE_INTEGER){throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.")}e.ref();var s=22;var a=65535;var l=Math.min(s+a,t);var o=v(l);var u=t-o.length;readAndAssertNoEof(e,o,0,l,u,(function(a){if(a)return n(a);for(var c=l-s;c>=0;c-=1){if(o.readUInt32LE(c)!==101010256)continue;var h=o.slice(c);var d=h.readUInt16LE(4);if(d!==0){return n(new Error("multi-disk zip files are not supported: found disk number: "+d))}var m=h.readUInt16LE(10);var p=h.readUInt32LE(16);var _=h.readUInt16LE(20);var g=h.length-s;if(_!==g){return n(new Error("invalid comment length. expected: "+g+". found: "+_))}var w=i?decodeBuffer(h,22,h.length,false):h.slice(22);if(!(m===65535||p===4294967295)){return n(null,new ZipFile(e,p,t,m,w,r.autoClose,r.lazyEntries,i,r.validateEntrySizes,r.strictFileNames))}var x=v(20);var b=u+c-x.length;readAndAssertNoEof(e,x,0,x.length,b,(function(s){if(s)return n(s);if(x.readUInt32LE(0)!==117853008){return n(new Error("invalid zip64 end of central directory locator signature"))}var a=readUInt64LE(x,8);var l=v(56);readAndAssertNoEof(e,l,0,l.length,a,(function(s){if(s)return n(s);if(l.readUInt32LE(0)!==101075792){return n(new Error("invalid zip64 end of central directory record signature"))}m=readUInt64LE(l,32);p=readUInt64LE(l,48);return n(null,new ZipFile(e,p,t,m,w,r.autoClose,r.lazyEntries,i,r.validateEntrySizes,r.strictFileNames))}))}));return}n(new Error("end of central directory record signature not found"))}))}l.inherits(ZipFile,o);function ZipFile(e,t,r,n,i,s,a,l,u,c){var h=this;o.call(h);h.reader=e;h.reader.on("error",(function(e){emitError(h,e)}));h.reader.once("close",(function(){h.emit("close")}));h.readEntryCursor=t;h.fileSize=r;h.entryCount=n;h.comment=i;h.entriesRead=0;h.autoClose=!!s;h.lazyEntries=!!a;h.decodeStrings=!!l;h.validateEntrySizes=!!u;h.strictFileNames=!!c;h.isOpen=true;h.emittedError=false;if(!h.lazyEntries)h._readEntry()}ZipFile.prototype.close=function(){if(!this.isOpen)return;this.isOpen=false;this.reader.unref()};function emitErrorAndAutoClose(e,t){if(e.autoClose)e.close();emitError(e,t)}function emitError(e,t){if(e.emittedError)return;e.emittedError=true;e.emit("error",t)}ZipFile.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};ZipFile.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead){setImmediate((function(){if(e.autoClose)e.close();if(e.emittedError)return;e.emit("end")}));return}if(e.emittedError)return;var r=v(46);readAndAssertNoEof(e.reader,r,0,r.length,e.readEntryCursor,(function(n){if(n)return emitErrorAndAutoClose(e,n);if(e.emittedError)return;var i=new Entry;var s=r.readUInt32LE(0);if(s!==33639248)return emitErrorAndAutoClose(e,new Error("invalid central directory file header signature: 0x"+s.toString(16)));i.versionMadeBy=r.readUInt16LE(4);i.versionNeededToExtract=r.readUInt16LE(6);i.generalPurposeBitFlag=r.readUInt16LE(8);i.compressionMethod=r.readUInt16LE(10);i.lastModFileTime=r.readUInt16LE(12);i.lastModFileDate=r.readUInt16LE(14);i.crc32=r.readUInt32LE(16);i.compressedSize=r.readUInt32LE(20);i.uncompressedSize=r.readUInt32LE(24);i.fileNameLength=r.readUInt16LE(28);i.extraFieldLength=r.readUInt16LE(30);i.fileCommentLength=r.readUInt16LE(32);i.internalFileAttributes=r.readUInt16LE(36);i.externalFileAttributes=r.readUInt32LE(38);i.relativeOffsetOfLocalHeader=r.readUInt32LE(42);if(i.generalPurposeBitFlag&64)return emitErrorAndAutoClose(e,new Error("strong encryption is not supported"));e.readEntryCursor+=46;r=v(i.fileNameLength+i.extraFieldLength+i.fileCommentLength);readAndAssertNoEof(e.reader,r,0,r.length,e.readEntryCursor,(function(n){if(n)return emitErrorAndAutoClose(e,n);if(e.emittedError)return;var s=(i.generalPurposeBitFlag&2048)!==0;i.fileName=e.decodeStrings?decodeBuffer(r,0,i.fileNameLength,s):r.slice(0,i.fileNameLength);var l=i.fileNameLength+i.extraFieldLength;var o=r.slice(i.fileNameLength,l);i.extraFields=[];var u=0;while(u<o.length-3){var c=o.readUInt16LE(u+0);var h=o.readUInt16LE(u+2);var d=u+4;var m=d+h;if(m>o.length)return emitErrorAndAutoClose(e,new Error("extra field length exceeds extra field buffer size"));var p=v(h);o.copy(p,0,d,m);i.extraFields.push({id:c,data:p});u=m}i.fileComment=e.decodeStrings?decodeBuffer(r,l,l+i.fileCommentLength,s):r.slice(l,l+i.fileCommentLength);i.comment=i.fileComment;e.readEntryCursor+=r.length;e.entriesRead+=1;if(i.uncompressedSize===4294967295||i.compressedSize===4294967295||i.relativeOffsetOfLocalHeader===4294967295){var _=null;for(var u=0;u<i.extraFields.length;u++){var g=i.extraFields[u];if(g.id===1){_=g.data;break}}if(_==null){return emitErrorAndAutoClose(e,new Error("expected zip64 extended information extra field"))}var w=0;if(i.uncompressedSize===4294967295){if(w+8>_.length){return emitErrorAndAutoClose(e,new Error("zip64 extended information extra field does not include uncompressed size"))}i.uncompressedSize=readUInt64LE(_,w);w+=8}if(i.compressedSize===4294967295){if(w+8>_.length){return emitErrorAndAutoClose(e,new Error("zip64 extended information extra field does not include compressed size"))}i.compressedSize=readUInt64LE(_,w);w+=8}if(i.relativeOffsetOfLocalHeader===4294967295){if(w+8>_.length){return emitErrorAndAutoClose(e,new Error("zip64 extended information extra field does not include relative header offset"))}i.relativeOffsetOfLocalHeader=readUInt64LE(_,w);w+=8}}if(e.decodeStrings){for(var u=0;u<i.extraFields.length;u++){var g=i.extraFields[u];if(g.id===28789){if(g.data.length<6){continue}if(g.data.readUInt8(0)!==1){continue}var x=g.data.readUInt32LE(1);if(a.unsigned(r.slice(0,i.fileNameLength))!==x){continue}i.fileName=decodeBuffer(g.data,5,g.data.length,true);break}}}if(e.validateEntrySizes&&i.compressionMethod===0){var b=i.uncompressedSize;if(i.isEncrypted()){b+=12}if(i.compressedSize!==b){var y="compressed/uncompressed size mismatch for stored file: "+i.compressedSize+" != "+i.uncompressedSize;return emitErrorAndAutoClose(e,new Error(y))}}if(e.decodeStrings){if(!e.strictFileNames){i.fileName=i.fileName.replace(/\\/g,"/")}var S=t.validateFileName(i.fileName);if(S!=null)return emitErrorAndAutoClose(e,new Error(S))}e.emit("entry",i);if(!e.lazyEntries)e._readEntry()}))}))};ZipFile.prototype.openReadStream=function(e,t,r){var n=this;var s=0;var a=e.compressedSize;if(r==null){r=t;t={}}else{if(t.decrypt!=null){if(!e.isEncrypted()){throw new Error("options.decrypt can only be specified for encrypted entries")}if(t.decrypt!==false)throw new Error("invalid options.decrypt value: "+t.decrypt);if(e.isCompressed()){if(t.decompress!==false)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}}if(t.decompress!=null){if(!e.isCompressed()){throw new Error("options.decompress can only be specified for compressed entries")}if(!(t.decompress===false||t.decompress===true)){throw new Error("invalid options.decompress value: "+t.decompress)}}if(t.start!=null||t.end!=null){if(e.isCompressed()&&t.decompress!==false){throw new Error("start/end range not allowed for compressed entry without options.decompress === false")}if(e.isEncrypted()&&t.decrypt!==false){throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}}if(t.start!=null){s=t.start;if(s<0)throw new Error("options.start < 0");if(s>e.compressedSize)throw new Error("options.start > entry.compressedSize")}if(t.end!=null){a=t.end;if(a<0)throw new Error("options.end < 0");if(a>e.compressedSize)throw new Error("options.end > entry.compressedSize");if(a<s)throw new Error("options.end < options.start")}}if(!n.isOpen)return r(new Error("closed"));if(e.isEncrypted()){if(t.decrypt!==false)return r(new Error("entry is encrypted, and options.decrypt !== false"))}n.reader.ref();var l=v(30);readAndAssertNoEof(n.reader,l,0,l.length,e.relativeOffsetOfLocalHeader,(function(o){try{if(o)return r(o);var u=l.readUInt32LE(0);if(u!==67324752){return r(new Error("invalid local file header signature: 0x"+u.toString(16)))}var c=l.readUInt16LE(26);var h=l.readUInt16LE(28);var d=e.relativeOffsetOfLocalHeader+l.length+c+h;var v;if(e.compressionMethod===0){v=false}else if(e.compressionMethod===8){v=t.decompress!=null?t.decompress:true}else{return r(new Error("unsupported compression method: "+e.compressionMethod))}var m=d;var p=m+e.compressedSize;if(e.compressedSize!==0){if(p>n.fileSize){return r(new Error("file data overflows file bounds: "+m+" + "+e.compressedSize+" > "+n.fileSize))}}var _=n.reader.createReadStream({start:m+s,end:m+a});var g=_;if(v){var w=false;var x=i.createInflateRaw();_.on("error",(function(e){setImmediate((function(){if(!w)x.emit("error",e)}))}));_.pipe(x);if(n.validateEntrySizes){g=new AssertByteCountStream(e.uncompressedSize);x.on("error",(function(e){setImmediate((function(){if(!w)g.emit("error",e)}))}));x.pipe(g)}else{g=x}g.destroy=function(){w=true;if(x!==g)x.unpipe(g);_.unpipe(x);_.destroy()}}r(null,g)}finally{n.reader.unref()}}))};function Entry(){}Entry.prototype.getLastModDate=function(){return dosDateTimeToDate(this.lastModFileDate,this.lastModFileTime)};Entry.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};Entry.prototype.isCompressed=function(){return this.compressionMethod===8};function dosDateTimeToDate(e,t){var r=e&31;var n=(e>>5&15)-1;var i=(e>>9&127)+1980;var s=0;var a=(t&31)*2;var l=t>>5&63;var o=t>>11&31;return new Date(i,n,r,o,l,a,s)}function validateFileName(e){if(e.indexOf("\\")!==-1){return"invalid characters in fileName: "+e}if(/^[a-zA-Z]:/.test(e)||/^\//.test(e)){return"absolute path: "+e}if(e.split("/").indexOf("..")!==-1){return"invalid relative path: "+e}return null}function readAndAssertNoEof(e,t,r,n,i,s){if(n===0){return setImmediate((function(){s(null,v(0))}))}e.read(t,r,n,i,(function(e,t){if(e)return s(e);if(t<n){return s(new Error("unexpected EOF"))}s()}))}l.inherits(AssertByteCountStream,u);function AssertByteCountStream(e){u.call(this);this.actualByteCount=0;this.expectedByteCount=e}AssertByteCountStream.prototype._transform=function(e,t,r){this.actualByteCount+=e.length;if(this.actualByteCount>this.expectedByteCount){var n="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return r(new Error(n))}r(null,e)};AssertByteCountStream.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return e(new Error(t))}e()};l.inherits(RandomAccessReader,o);function RandomAccessReader(){o.call(this);this.refCount=0}RandomAccessReader.prototype.ref=function(){this.refCount+=1};RandomAccessReader.prototype.unref=function(){var e=this;e.refCount-=1;if(e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");e.close(onCloseDone);function onCloseDone(t){if(t)return e.emit("error",t);e.emit("close")}};RandomAccessReader.prototype.createReadStream=function(e){var t=e.start;var r=e.end;if(t===r){var n=new c;setImmediate((function(){n.end()}));return n}var i=this._readStreamForRange(t,r);var s=false;var a=new RefUnrefFilter(this);i.on("error",(function(e){setImmediate((function(){if(!s)a.emit("error",e)}))}));a.destroy=function(){i.unpipe(a);a.unref();i.destroy()};var l=new AssertByteCountStream(r-t);a.on("error",(function(e){setImmediate((function(){if(!s)l.emit("error",e)}))}));l.destroy=function(){s=true;a.unpipe(l);a.destroy()};return i.pipe(a).pipe(l)};RandomAccessReader.prototype._readStreamForRange=function(e,t){throw new Error("not implemented")};RandomAccessReader.prototype.read=function(e,t,r,n,i){var s=this.createReadStream({start:n,end:n+r});var a=new h;var l=0;a._write=function(r,n,i){r.copy(e,t+l,0,r.length);l+=r.length;i()};a.on("finish",i);s.on("error",(function(e){i(e)}));s.pipe(a)};RandomAccessReader.prototype.close=function(e){setImmediate(e)};l.inherits(RefUnrefFilter,c);function RefUnrefFilter(e){c.call(this);this.context=e;this.context.ref();this.unreffedYet=false}RefUnrefFilter.prototype._flush=function(e){this.unref();e()};RefUnrefFilter.prototype.unref=function(e){if(this.unreffedYet)return;this.unreffedYet=true;this.context.unref()};var d="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function decodeBuffer(e,t,r,n){if(n){return e.toString("utf8",t,r)}else{var i="";for(var s=t;s<r;s++){i+=d[e[s]]}return i}}function readUInt64LE(e,t){var r=e.readUInt32LE(t);var n=e.readUInt32LE(t+4);return n*4294967296+r}var v;if(typeof Buffer.allocUnsafe==="function"){v=function(e){return Buffer.allocUnsafe(e)}}else{v=function(e){return new Buffer(e)}}function defaultCallback(e){if(e)throw e}},9491:e=>{"use strict";e.exports=require("assert")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},2057:e=>{"use strict";e.exports=require("constants")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},1017:e=>{"use strict";e.exports=require("path")},2781:e=>{"use strict";e.exports=require("stream")},1576:e=>{"use strict";e.exports=require("string_decoder")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},9796:e=>{"use strict";e.exports=require("zlib")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={exports:{}};var s=true;try{e[r].call(i.exports,i,i.exports,__nccwpck_require__);s=false}finally{if(s)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(6732);module.exports=r})();