encoding-tools 0.0.10 → 0.0.12

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.
@@ -1,2 +0,0 @@
1
- /*! For license information please see encoding-tools.js.LICENSE.txt */
2
- (()=>{var e={127(e,t,n){const r=n(808)._bin2txt,i=n(160)._txt2bin;e.exports={_bin2txt:r,_txt2bin:i}},808(e,t,n){const r=n(368),i=r._cat,o=(r._dirname,r._error_display,r._ext_rm,r._file_exists),s=(r._file_read,r._file_write),a=r._fs_worker_start,c=(r._json_read,r._ls,r._mkdir,r._msg_info),l=r._msg_error,u=(r._printf,r._rm),f=r._seq,h=r._stat,p=n(179)._split;async function d(e,t,r,o,a,u){let h;const p=await async function(e){let t;const r=i(e,{encoding:null,flag:"r"});return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(t=await btoa(r)),t}(e);if(h=`Block '${e}' encoded length: ${p.length}.`,c(h),"false"===u)t=await async function(e,t,n,r,i){let o,a,l,u,h;const p=e.length,d=Math.ceil(t+p/n);if(console.log("prefix",r),d<2)return h=r,s(h,e),0;for(o of(u=`Chunking '${p}' letters into '${d}' chunks of length '${n}'.`,c(u),f(t+1,d)))a=(o-t)*n-n,l=e.substring(a,a+n),h=`${r}.${o}`,u=`Writing chunk ${o} in file '${h}' of length ${l.length} out of ${d}.`,c(u),o<d?s(h,l):o==d&&("true"==i?s(h,l):"false"==i&&(u="Last chunk of non-last block, adding a newline character at the end (nope).",c(u),s(h,`${l}\n`)));return t=d,u="Finished encoding block.",c(u),t}(p,t,r,o,a);else if("true"===u){const e=Math.ceil(e+p.length/r);t=e}else h=`Value of the 'amount_only' can be true or false. Current: '${u}'.`,l(h,1);return h=`Finished encoding block '${e}'.`,c(h),t}e.exports={_bin2txt:async function(e,t,n,r,i,s){let f,y,_,g,v,m;"undefined"!=typeof window&&(m=`OPFS worker '${await a("fs-worker.js")}' started.`,c(m)),async function(e){o(e)||l(`File '${e}' does not exist.`,1)}(e);const w=await async function(e,t,n){let r,i;const o=h(e).size;r=`File '${e}' has size '${o}' bytes.`,c(r);const s=Math.ceil(o/n);if(1<s){r=`Splitting file '${e}' in '${s}' blocks of '${n}' bytes.`,c(r);const o=[e,`${t}.block.`,s,0];i=await p.apply(null,o),r="Done.",c(r)}else i=[e];return i}(e,t,i),b=w.length;for(f of(g=0,y=1,w))m=`Reading block '${f}' ('${y}' of '${b}').`,c(m),y<b?_="false":y==b&&(_="true"),"base64"===n?(g=await d(f,g,r,t,_,s),c(`Current chunk: '${g}'.`),y+=1):(m=`Unknown encoding format ${n}.`,l(m,1));const E=[];for(f of w)f!=e&&E.push(f);if(0<E.length&&u.apply(null,E),"true"===s)return v=g,m=`File '${e}' is base64 encoded and split in '${v}' files of length '${r}'.`,c(m),v;"false"===s&&(m=`Finished '${n}' encoding input file '${e}'.`,c(m))}}},160(e,t,n){const r=n(917),i=n(816),o=(i.createWriteStream,i.createReadStream,i.stat,n(104)),s=(o.reject,o.resolve,o.promisify,o.mapSeries,n(368)),a=s._cat,c=(s._ext_rm,s._file_append),l=s._file_read,u=s._fs_worker_start,f=(s._json_read,s._ls,s._mkdir,s._mktemp),h=s._msg_info,p=s._msg_error,d=s._path_join;e.exports={_txt2bin:function(e,t,n,i){if("list"==n){const e=i[0];i=a(e).split("\n")}"base64"==t&&function(e,t,n){let i,o;void 0!==t&&t!=[]&&""!=t||(i="No input files given in input.",p(i,1)),o=t[0],0<t.length&&(o=d([f(),"merge.base64"]),async function(e,t,n){let r,i,o;for(i of("list"==n?o=`Merging files from list at '${e[0]}' into '${t}'.`:"file"==n&&(o=`Merging '${e}' into '${t}'.`),h(o),await u("fs-worker.js"),e))r=l(i),c(r,t);o="Merging finished.",h(o)}(o,t,n)),i=`Decoding '${o}' into '${e}'`,h(i),console.log(r),console.log(r.Base64Encode)}(e,i,n)}}},526(e,t){"use strict";t.byteLength=function(e){var t=a(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=a(e),s=o[0],c=o[1],l=new i(function(e,t,n){return 3*(t+n)/4-n}(0,s,c)),u=0,f=c>0?s-4:s;for(n=0;n<f;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],l[u++]=t>>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===c&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,l[u++]=255&t),1===c&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=16383,a=0,c=r-i;a<c;a+=s)o.push(l(e,a,a+s>c?c:a+s));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=o[s],r[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function l(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(c(r));return i.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},917(e,t,n){const r=n(67),i=n(668);e.exports={Base64Encode:r,Base64Decode:i}},668(e,t,n){const{Transform:r}=n(310);e.exports=class extends r{constructor(){super({decodeStrings:!1}),this.extra=""}_transform(e,t,n){e=""+e;const r=(e=this.extra+e.replace(/(\r\n|\n|\r)/gm,"")).length%4;this.extra=e.slice(e.length-r),e=e.slice(0,e.length-r);const i=Buffer.from(e,"base64");this.push(i),n()}_flush(e){this.extra.length&&this.push(Buffer.from(this.extra,"base64")),e()}}},67(e,t,n){const{Transform:r}=n(310);e.exports=class extends r{constructor(e){super(e),this.extra=null,this.lineLength=e&&e.lineLength,this.currLineLength=0,e&&e.prefix&&this.push(e.prefix);const t=e&&e.inputEncoding;this.setDefaultEncoding(t||"utf8");const n=e&&e.outputEncoding;null!==n&&this.setEncoding(n||"utf8")}_fixLineLength(e){if(!this.lineLength)return e;const t=e.length;let n,r,i="";for(n=0,r=this.lineLength-this.currLineLength;r<t;n=r,r+=this.lineLength)i+=e.slice(n,r),i+="\r\n";const o=e.slice(n);return this.currLineLength=o.length,i+=o,i}_transform(e,t,n){this.extra&&(e=Buffer.concat([this.extra,e]),this.extra=null);const r=e.length%3;0!==r&&(this.extra=e.slice(e.length-r),e=e.slice(0,e.length-r)),e=e.toString("base64"),this.push(Buffer.from(this._fixLineLength(e))),n()}_flush(e){this.extra&&this.push(Buffer.from(this._fixLineLength(this.extra.toString("base64")))),e()}}},104(e,t,n){e.exports=function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var c="function"==typeof _dereq_&&_dereq_;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){return i(t[s][1][e]||e)},u,u.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){"use strict";t.exports=function(e){var t=e._SomePromiseArray;function n(e){var n=new t(e),r=n.promise();return n.setHowMany(1),n.setUnwrap(),n.init(),r}e.any=function(e){return n(e)},e.prototype.any=function(){return n(this)}}},{}],2:[function(e,t,n){"use strict";var r;try{throw new Error}catch(e){r=e}var i=e("./schedule"),o=e("./queue");function s(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new o(16),this._normalQueue=new o(16),this._haveDrainedQueues=!1;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=i}function a(e){for(;e.length()>0;)c(e)}function c(e){var t=e.shift();if("function"!=typeof t)t._settlePromises();else{var n=e.shift(),r=e.shift();t.call(n,r)}}s.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},s.prototype.hasCustomScheduler=function(){return this._customScheduler},s.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},s.prototype.fatalError=function(e,t){t?(process.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),process.exit(2)):this.throwLater(e)},s.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.prototype.invokeLater=function(e,t,n){this._lateQueue.push(e,t,n),this._queueTick()},s.prototype.invoke=function(e,t,n){this._normalQueue.push(e,t,n),this._queueTick()},s.prototype.settlePromises=function(e){this._normalQueue._pushOne(e),this._queueTick()},s.prototype._drainQueues=function(){a(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,a(this._lateQueue)},s.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},s.prototype._reset=function(){this._isTickUsed=!1},t.exports=s,t.exports.firstLineError=r},{"./queue":26,"./schedule":29}],3:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){var i=!1,o=function(e,t){this._reject(t)},s=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(o,o,null,this,e)},a=function(e,t){50397184&this._bitField||this._resolveCallback(t.target)},c=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(o){i||(i=!0,e.prototype._propagateFrom=r.propagateFromFunction(),e.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new e(t);u._propagateFrom(this,1);var f=this._target();if(u._setBoundTo(l),l instanceof e){var h={promiseRejectionQueued:!1,promise:u,target:f,bindingPromise:l};f._then(t,s,void 0,u,h),l._then(a,c,void 0,u,h),u._setOnCancel(l)}else u._resolveCallback(f);return u},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return!(2097152&~this._bitField)},e.bind=function(t,n){return e.resolve(n).bind(t)}}},{}],4:[function(e,t,n){"use strict";var r;"undefined"!=typeof Promise&&(r=Promise);var i=e("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=r)}catch(e){}return i},t.exports=i},{"./promise":22}],5:[function(e,t,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}t.exports=function(t){var n=e("./util"),r=n.canEvaluate;function i(e){return function(e,r){var i;if(null!=e&&(i=e[r]),"function"!=typeof i){var o="Object "+n.classString(e)+" has no method '"+n.toString(r)+"'";throw new t.TypeError(o)}return i}(e,this.pop()).apply(e,this)}function o(e){return e[this]}function s(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}n.isIdentifier,t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(i,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t;if("number"==typeof e)t=s;else if(r){var n=(void 0)(e);t=null!==n?n:o}else t=o;return this._then(t,void 0,void 0,e,void 0)}}},{"./util":36}],6:[function(e,t,n){"use strict";t.exports=function(t,n,r,i){var o=e("./util"),s=o.tryCatch,a=o.errorObj,c=t._async;t.prototype.break=t.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var n=e._cancellationParent;if(null==n||!n._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=n}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(o.isArray(e))for(var n=0;n<e.length;++n)this._doInvokeOnCancel(e[n],t);else if(void 0!==e)if("function"==typeof e){if(!t){var r=s(e).call(this._boundValue());r===a&&(this._attachExtraTrace(r.e),c.throwLater(r.e))}}else e._resultCancelled(this)},t.prototype._invokeOnCancel=function(){var e=this._onCancel();this._unsetOnCancel(),c.invoke(this._doInvokeOnCancel,this,e)},t.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},t.prototype._resultCancelled=function(){this.cancel()}}},{"./util":36}],7:[function(e,t,n){"use strict";t.exports=function(t){var n=e("./util"),r=e("./es5").keys,i=n.tryCatch,o=n.errorObj;return function(e,s,a){return function(c){var l=a._boundValue();e:for(var u=0;u<e.length;++u){var f=e[u];if(f===Error||null!=f&&f.prototype instanceof Error){if(c instanceof f)return i(s).call(l,c)}else if("function"==typeof f){var h=i(f).call(l,c);if(h===o)return h;if(h)return i(s).call(l,c)}else if(n.isObject(c)){for(var p=r(f),d=0;d<p.length;++d){var y=p[d];if(f[y]!=c[y])continue e}return i(s).call(l,c)}}return t}}}},{"./es5":13,"./util":36}],8:[function(e,t,n){"use strict";t.exports=function(e){var t=!1,n=[];function r(){this._trace=new r.CapturedTrace(i())}function i(){var e=n.length-1;if(e>=0)return n[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},r.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,n.push(this._trace))},r.prototype._popContext=function(){if(void 0!==this._trace){var e=n.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},r.CapturedTrace=null,r.create=function(){if(t)return new r},r.deactivateLongStackTraces=function(){},r.activateLongStackTraces=function(){var n=e.prototype._pushContext,o=e.prototype._popContext,s=e._peekContext,a=e.prototype._peekContext,c=e.prototype._promiseCreated;r.deactivateLongStackTraces=function(){e.prototype._pushContext=n,e.prototype._popContext=o,e._peekContext=s,e.prototype._peekContext=a,e.prototype._promiseCreated=c,t=!1},t=!0,e.prototype._pushContext=r.prototype._pushContext,e.prototype._popContext=r.prototype._popContext,e._peekContext=e.prototype._peekContext=i,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},r}},{}],9:[function(e,t,n){"use strict";t.exports=function(t,n,r,i){var o,s,a,c,l=t._async,u=e("./errors").Warning,f=e("./util"),h=e("./es5"),p=f.canAttachTrace,d=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,y=/\((?:timers\.js):\d+:\d+\)/,_=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,g=null,v=null,m=!1,w=!(0==f.env("BLUEBIRD_DEBUG")),b=!(0==f.env("BLUEBIRD_WARNINGS")||!w&&!f.env("BLUEBIRD_WARNINGS")),E=!(0==f.env("BLUEBIRD_LONG_STACK_TRACES")||!w&&!f.env("BLUEBIRD_LONG_STACK_TRACES")),S=0!=f.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(b||!!f.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){var e=[];function n(){for(var t=0;t<e.length;++t)e[t]._notifyUnhandledRejection();r()}function r(){e.length=0}c=function(t){e.push(t),setTimeout(n,1)},h.defineProperty(t,"_unhandledRejectionCheck",{value:n}),h.defineProperty(t,"_unhandledRejectionClear",{value:r})}(),t.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},t.prototype._ensurePossibleRejectionHandled=function(){524288&this._bitField||(this._setRejectionIsUnhandled(),c(this))},t.prototype._notifyUnhandledRejectionIsHandled=function(){Z("rejectionHandled",o,void 0,this)},t.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},t.prototype._returnedNonUndefined=function(){return!!(268435456&this._bitField)},t.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),Z("unhandledRejection",s,e,this)}},t.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},t.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},t.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},t.prototype._warn=function(e,t,n){return H(e,t,n||this)},t.onPossiblyUnhandledRejection=function(e){var n=t._getContext();s=f.contextBind(n,e)},t.onUnhandledRejectionHandled=function(e){var n=t._getContext();o=f.contextBind(n,e)};var k=function(){};t.longStackTraces=function(){if(l.haveItemsQueued()&&!te.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!te.longStackTraces&&q()){var e=t.prototype._captureStackTrace,r=t.prototype._attachExtraTrace,i=t.prototype._dereferenceTrace;te.longStackTraces=!0,k=function(){if(l.haveItemsQueued()&&!te.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");t.prototype._captureStackTrace=e,t.prototype._attachExtraTrace=r,t.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),te.longStackTraces=!1},t.prototype._captureStackTrace=$,t.prototype._attachExtraTrace=D,t.prototype._dereferenceTrace=W,n.activateLongStackTraces()}},t.hasLongStackTraces=function(){return te.longStackTraces&&q()};var C={unhandledrejection:{before:function(){var e=f.global.onunhandledrejection;return f.global.onunhandledrejection=null,e},after:function(e){f.global.onunhandledrejection=e}},rejectionhandled:{before:function(){var e=f.global.onrejectionhandled;return f.global.onrejectionhandled=null,e},after:function(e){f.global.onrejectionhandled=e}}},R=function(){var e=function(e,t){if(!e)return!f.global.dispatchEvent(t);var n;try{return n=e.before(),!f.global.dispatchEvent(t)}finally{e.after(n)}};try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return f.global.dispatchEvent(t),function(t,n){t=t.toLowerCase();var r=new CustomEvent(t,{detail:n,cancelable:!0});return h.defineProperty(r,"promise",{value:n.promise}),h.defineProperty(r,"reason",{value:n.reason}),e(C[t],r)}}return"function"==typeof Event?(t=new Event("CustomEvent"),f.global.dispatchEvent(t),function(t,n){t=t.toLowerCase();var r=new Event(t,{cancelable:!0});return r.detail=n,h.defineProperty(r,"promise",{value:n.promise}),h.defineProperty(r,"reason",{value:n.reason}),e(C[t],r)}):((t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),f.global.dispatchEvent(t),function(t,n){t=t.toLowerCase();var r=document.createEvent("CustomEvent");return r.initCustomEvent(t,!1,!0,n),e(C[t],r)})}catch(e){}return function(){return!1}}(),T=f.isNode?function(){return process.emit.apply(process,arguments)}:f.global?function(e){var t="on"+e.toLowerCase(),n=f.global[t];return!!n&&(n.apply(f.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function A(e,t){return{promise:t}}var x={promiseCreated:A,promiseFulfilled:A,promiseRejected:A,promiseResolved:A,promiseCancelled:A,promiseChained:function(e,t,n){return{promise:t,child:n}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,n){return{reason:t,promise:n}},rejectionHandled:A},j=function(e){var t=!1;try{t=T.apply(null,arguments)}catch(e){l.throwLater(e),t=!0}var n=!1;try{n=R(e,x[e].apply(null,arguments))}catch(e){l.throwLater(e),n=!0}return n||t};function O(){return!1}function F(e,t,n){var r=this;try{e(t,n,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+f.toString(e));r._attachCancellationCallback(e)})}catch(e){return e}}function P(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?f.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function L(){return this._onCancelField}function I(e){this._onCancelField=e}function B(){this._cancellationParent=void 0,this._onCancelField=void 0}function U(e,t){if(1&t){this._cancellationParent=e;var n=e._branchesRemainingToCancel;void 0===n&&(n=0),e._branchesRemainingToCancel=n+1}2&t&&e._isBound()&&this._setBoundTo(e._boundTo)}t.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?t.longStackTraces():!e.longStackTraces&&t.hasLongStackTraces()&&k()),"warnings"in e){var n=e.warnings;te.warnings=!!n,S=te.warnings,f.isObject(n)&&"wForgottenReturn"in n&&(S=!!n.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!te.cancellation){if(l.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");t.prototype._clearCancellationData=B,t.prototype._propagateFrom=U,t.prototype._onCancel=L,t.prototype._setOnCancel=I,t.prototype._attachCancellationCallback=P,t.prototype._execute=F,M=U,te.cancellation=!0}if("monitoring"in e&&(e.monitoring&&!te.monitoring?(te.monitoring=!0,t.prototype._fireEvent=j):!e.monitoring&&te.monitoring&&(te.monitoring=!1,t.prototype._fireEvent=O)),"asyncHooks"in e&&f.nodeSupportsAsyncResource){var o=te.asyncHooks,s=!!e.asyncHooks;o!==s&&(te.asyncHooks=s,s?r():i())}return t},t.prototype._fireEvent=O,t.prototype._execute=function(e,t,n){try{e(t,n)}catch(e){return e}},t.prototype._onCancel=function(){},t.prototype._setOnCancel=function(e){},t.prototype._attachCancellationCallback=function(e){},t.prototype._captureStackTrace=function(){},t.prototype._attachExtraTrace=function(){},t.prototype._dereferenceTrace=function(){},t.prototype._clearCancellationData=function(){},t.prototype._propagateFrom=function(e,t){};var M=function(e,t){2&t&&e._isBound()&&this._setBoundTo(e._boundTo)};function N(){var e=this._boundTo;return void 0!==e&&e instanceof t?e.isFulfilled()?e.value():void 0:e}function $(){this._trace=new K(this._peekContext())}function D(e,t){if(p(e)){var n=this._trace;if(void 0!==n&&t&&(n=n._parent),void 0!==n)n.attachExtraTrace(e);else if(!e.__stackCleaned__){var r=z(e);f.notEnumerableProp(e,"stack",r.message+"\n"+r.stack.join("\n")),f.notEnumerableProp(e,"__stackCleaned__",!0)}}}function W(){this._trace=void 0}function H(e,n,r){if(te.warnings){var i,o=new u(e);if(n)r._attachExtraTrace(o);else if(te.longStackTraces&&(i=t._peekContext()))i.attachExtraTrace(o);else{var s=z(o);o.stack=s.message+"\n"+s.stack.join("\n")}j("warning",o)||G(o,"",!0)}}function V(e){for(var t=[],n=0;n<e.length;++n){var r=e[n],i=" (No stack trace)"===r||g.test(r),o=i&&X(r);i&&!o&&(m&&" "!==r.charAt(0)&&(r=" "+r),t.push(r))}return t}function z(e){var t=e.stack,n=e.toString();return t="string"==typeof t&&t.length>0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),n=0;n<t.length;++n){var r=t[n];if(" (No stack trace)"===r||g.test(r))break}return n>0&&"SyntaxError"!=e.name&&(t=t.slice(n)),t}(e):[" (No stack trace)"],{message:n,stack:"SyntaxError"==e.name?t:V(t)}}function G(e,t,n){if("undefined"!=typeof console){var r;if(f.isObject(e)){var i=e.stack;r=t+v(i,e)}else r=t+String(e);"function"==typeof a?a(r,n):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(r)}}function Z(e,t,n,r){var i=!1;try{"function"==typeof t&&(i=!0,"rejectionHandled"===e?t(r):t(n,r))}catch(e){l.throwLater(e)}"unhandledRejection"===e?j(e,n,r)||i||G(n,"Unhandled rejection "):j(e,r)}function Y(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{if(t=e&&"function"==typeof e.toString?e.toString():f.toString(e),/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){var t=41;return e.length<t?e:e.substr(0,t-3)+"..."}(t)+">, no stack trace)"}function q(){return"function"==typeof ee}var X=function(){return!1},Q=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function J(e){var t=e.match(Q);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function K(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);ee(this,K),t>32&&this.uncycle()}f.inherits(K,Error),n.CapturedTrace=K,K.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],n={},r=0,i=this;void 0!==i;++r)t.push(i),i=i._parent;for(r=(e=this._length=r)-1;r>=0;--r){var o=t[r].stack;void 0===n[o]&&(n[o]=r)}for(r=0;r<e;++r){var s=n[t[r].stack];if(void 0!==s&&s!==r){s>0&&(t[s-1]._parent=void 0,t[s-1]._length=1),t[r]._parent=void 0,t[r]._length=1;var a=r>0?t[r-1]:this;s<e-1?(a._parent=t[s+1],a._parent.uncycle(),a._length=a._parent._length+1):(a._parent=void 0,a._length=1);for(var c=a._length+1,l=r-2;l>=0;--l)t[l]._length=c,c++;return}}}},K.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=z(e),n=t.message,r=[t.stack],i=this;void 0!==i;)r.push(V(i.stack.split("\n"))),i=i._parent;(function(e){for(var t=e[0],n=1;n<e.length;++n){for(var r=e[n],i=t.length-1,o=t[i],s=-1,a=r.length-1;a>=0;--a)if(r[a]===o){s=a;break}for(a=s;a>=0;--a){var c=r[a];if(t[i]!==c)break;t.pop(),i--}t=r}})(r),function(e){for(var t=0;t<e.length;++t)(0===e[t].length||t+1<e.length&&e[t][0]===e[t+1][0])&&(e.splice(t,1),t--)}(r),f.notEnumerableProp(e,"stack",function(e,t){for(var n=0;n<t.length-1;++n)t[n].push("From previous event:"),t[n]=t[n].join("\n");return n<t.length&&(t[n]=t[n].join("\n")),e+"\n"+t.join("\n")}(n,r)),f.notEnumerableProp(e,"__stackCleaned__",!0)}};var ee=function(){var e=/^\s*at\s*/,t=function(e,t){return"string"==typeof e?e:void 0!==t.name&&void 0!==t.message?t.toString():Y(t)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,g=e,v=t;var n=Error.captureStackTrace;return X=function(e){return d.test(e)},function(e,t){Error.stackTraceLimit+=6,n(e,t),Error.stackTraceLimit-=6}}var r,i=new Error;if("string"==typeof i.stack&&i.stack.split("\n")[0].indexOf("stackDetection@")>=0)return g=/@/,v=t,m=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){r="stack"in e}return!("stack"in i)&&r&&"number"==typeof Error.stackTraceLimit?(g=e,v=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6}):(v=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?Y(t):t.toString()},null)}();"undefined"!=typeof console&&void 0!==console.warn&&(a=function(e){console.warn(e)},f.isNode&&process.stderr.isTTY?a=function(e,t){var n=t?"":"";console.warn(n+e+"\n")}:f.isNode||"string"!=typeof(new Error).stack||(a=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var te={warnings:b,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return E&&t.longStackTraces(),{asyncHooks:function(){return te.asyncHooks},longStackTraces:function(){return te.longStackTraces},warnings:function(){return te.warnings},cancellation:function(){return te.cancellation},monitoring:function(){return te.monitoring},propagateFromFunction:function(){return M},boundValueFunction:function(){return N},checkForgottenReturns:function(e,t,n,r,i){if(void 0===e&&null!==t&&S){if(void 0!==i&&i._returnedNonUndefined())return;if(!(65535&r._bitField))return;n&&(n+=" ");var o="",s="";if(t._trace){for(var a=t._trace.stack.split("\n"),c=V(a),l=c.length-1;l>=0;--l){var u=c[l];if(!y.test(u)){var f=u.match(_);f&&(o="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(c.length>0){var h=c[0];for(l=0;l<a.length;++l)if(a[l]===h){l>0&&(s="\n"+a[l-1]);break}}}var p="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+s;r._warn(p,!0,t)}},setBounds:function(e,t){if(q()){for(var n,r,i=(e.stack||"").split("\n"),o=(t.stack||"").split("\n"),s=-1,a=-1,c=0;c<i.length;++c)if(l=J(i[c])){n=l.fileName,s=l.line;break}for(c=0;c<o.length;++c){var l;if(l=J(o[c])){r=l.fileName,a=l.line;break}}s<0||a<0||!n||!r||n!==r||s>=a||(X=function(e){if(d.test(e))return!0;var t=J(e);return!!(t&&t.fileName===n&&s<=t.line&&t.line<=a)})}},warn:H,deprecated:function(e,t){var n=e+" is deprecated and will be removed in a future version.";return t&&(n+=" Use "+t+" instead."),H(n)},CapturedTrace:K,fireDomEvent:R,fireGlobalEvent:T}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(e,t,n){"use strict";t.exports=function(e){function t(){return this.value}function n(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(n){return n instanceof e&&n.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:n},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(n,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof e&&n.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:n},void 0);var r=arguments[1];r instanceof e&&r.suppressUnhandledRejections();return this.caught(n,function(){return r})}}},{}],11:[function(e,t,n){"use strict";t.exports=function(e,t){var n=e.reduce,r=e.all;function i(){return r(this)}e.prototype.each=function(e){return n(this,e,t,0)._then(i,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return n(this,e,t,t)},e.each=function(e,r){return n(e,r,t,0)._then(i,void 0,void 0,e,void 0)},e.mapSeries=function(e,r){return n(e,r,t,t)}}},{}],12:[function(e,t,n){"use strict";var r,i,o=e("./es5"),s=o.freeze,a=e("./util"),c=a.inherits,l=a.notEnumerableProp;function u(e,t){function n(r){if(!(this instanceof n))return new n(r);l(this,"message","string"==typeof r?r:t),l(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return c(n,Error),n}var f=u("Warning","warning"),h=u("CancellationError","cancellation error"),p=u("TimeoutError","timeout error"),d=u("AggregateError","aggregate error");try{r=TypeError,i=RangeError}catch(e){r=u("TypeError","type error"),i=u("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),_=0;_<y.length;++_)"function"==typeof Array.prototype[y[_]]&&(d.prototype[y[_]]=Array.prototype[y[_]]);o.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var g=0;function v(e){if(!(this instanceof v))return new v(e);l(this,"name","OperationalError"),l(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(l(this,"message",e.message),l(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}d.prototype.toString=function(){var e=Array(4*g+1).join(" "),t="\n"+e+"AggregateError of:\n";g++,e=Array(4*g+1).join(" ");for(var n=0;n<this.length;++n){for(var r=this[n]===this?"[Circular AggregateError]":this[n]+"",i=r.split("\n"),o=0;o<i.length;++o)i[o]=e+i[o];t+=(r=i.join("\n"))+"\n"}return g--,t},c(v,Error);var m=Error.__BluebirdErrorTypes__;m||(m=s({CancellationError:h,TimeoutError:p,OperationalError:v,RejectionError:v,AggregateError:d}),o.defineProperty(Error,"__BluebirdErrorTypes__",{value:m,writable:!1,enumerable:!1,configurable:!1})),t.exports={Error,TypeError:r,RangeError:i,CancellationError:m.CancellationError,OperationalError:m.OperationalError,TimeoutError:m.TimeoutError,AggregateError:m.AggregateError,Warning:f}},{"./es5":13,"./util":36}],13:[function(e,t,n){var r=function(){"use strict";return void 0===this}();if(r)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!(n&&!n.writable&&!n.set)}};else{var i={}.hasOwnProperty,o={}.toString,s={}.constructor.prototype,a=function(e){var t=[];for(var n in e)i.call(e,n)&&t.push(n);return t};t.exports={isArray:function(e){try{return"[object Array]"===o.call(e)}catch(e){return!1}},keys:a,names:a,defineProperty:function(e,t,n){return e[t]=n.value,e},getDescriptor:function(e,t){return{value:e[t]}},freeze:function(e){return e},getPrototypeOf:function(e){try{return Object(e).constructor.prototype}catch(e){return s}},isES5:r,propertyIsWritable:function(){return!0}}}},{}],14:[function(e,t,n){"use strict";t.exports=function(e,t){var n=e.map;e.prototype.filter=function(e,r){return n(this,e,r,t)},e.filter=function(e,r,i){return n(e,r,i,t)}}},{}],15:[function(e,t,n){"use strict";t.exports=function(t,n,r){var i=e("./util"),o=t.CancellationError,s=i.errorObj,a=e("./catch_filter")(r);function c(e,t,n){this.promise=e,this.type=t,this.handler=n,this.called=!1,this.cancelPromise=null}function l(e){this.finallyHandler=e}function u(e,t){return null!=e.cancelPromise&&(arguments.length>1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function f(){return p.call(this,this.promise._target()._settledValue())}function h(e){if(!u(this,e))return s.e=e,s}function p(e){var i=this.promise,a=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?a.call(i._boundValue()):a.call(i._boundValue(),e);if(c===r)return c;if(void 0!==c){i._setReturnedNonUndefined();var p=n(c,i);if(p instanceof t){if(null!=this.cancelPromise){if(p._isCancelled()){var d=new o("late cancellation observer");return i._attachExtraTrace(d),s.e=d,s}p.isPending()&&p._attachCancellationCallback(new l(this))}return p._then(f,h,void 0,this,void 0)}}}return i.isRejected()?(u(this),s.e=e,s):(u(this),e)}return c.prototype.isFinallyHandler=function(){return 0===this.type},l.prototype._resultCancelled=function(){u(this.finallyHandler)},t.prototype._passThrough=function(e,t,n,r){return"function"!=typeof e?this.then():this._then(n,r,void 0,new c(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,p,p)},t.prototype.tap=function(e){return this._passThrough(e,1,p)},t.prototype.tapCatch=function(e){var n=arguments.length;if(1===n)return this._passThrough(e,1,void 0,p);var r,o=new Array(n-1),s=0;for(r=0;r<n-1;++r){var c=arguments[r];if(!i.isObject(c))return t.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+i.classString(c)));o[s++]=c}o.length=s;var l=arguments[r];return this._passThrough(a(o,l,this),1,void 0,p)},c}},{"./catch_filter":7,"./util":36}],16:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o,s){var a=e("./errors").TypeError,c=e("./util"),l=c.errorObj,u=c.tryCatch,f=[];function h(e,n,i,o){if(s.cancellation()){var a=new t(r),c=this._finallyPromise=new t(r);this._promise=a.lastly(function(){return c}),a._captureStackTrace(),a._setOnCancel(this)}else(this._promise=new t(r))._captureStackTrace();this._stack=o,this._generatorFunction=e,this._receiver=n,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(f):f,this._yieldedPromise=null,this._cancellationPhase=!1}c.inherits(h,o),h.prototype._isResolved=function(){return null===this._promise},h.prototype._cleanup=function(){this._promise=this._generator=null,s.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},h.prototype._promiseCancelled=function(){if(!this._isResolved()){var e;if(void 0!==this._generator.return)this._promise._pushContext(),e=u(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var n=new t.CancellationError("generator .return() sentinel");t.coroutine.returnSentinel=n,this._promise._attachExtraTrace(n),this._promise._pushContext(),e=u(this._generator.throw).call(this._generator,n),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(e)}},h.prototype._promiseFulfilled=function(e){this._yieldedPromise=null,this._promise._pushContext();var t=u(this._generator.next).call(this._generator,e);this._promise._popContext(),this._continue(t)},h.prototype._promiseRejected=function(e){this._yieldedPromise=null,this._promise._attachExtraTrace(e),this._promise._pushContext();var t=u(this._generator.throw).call(this._generator,e);this._promise._popContext(),this._continue(t)},h.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof t){var e=this._yieldedPromise;this._yieldedPromise=null,e.cancel()}},h.prototype.promise=function(){return this._promise},h.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},h.prototype._continue=function(e){var n=this._promise;if(e===l)return this._cleanup(),this._cancellationPhase?n.cancel():n._rejectCallback(e.e,!1);var r=e.value;if(!0===e.done)return this._cleanup(),this._cancellationPhase?n.cancel():n._resolveCallback(r);var o=i(r,this._promise);if(o instanceof t||null!==(o=function(e,n,r){for(var o=0;o<n.length;++o){r._pushContext();var s=u(n[o])(e);if(r._popContext(),s===l){r._pushContext();var a=t.reject(l.e);return r._popContext(),a}var c=i(s,r);if(c instanceof t)return c}return null}(o,this._yieldHandlers,this._promise))){var s=(o=o._target())._bitField;50397184&s?33554432&s?t._async.invoke(this._promiseFulfilled,this,o._value()):16777216&s?t._async.invoke(this._promiseRejected,this,o._reason()):this._promiseCancelled():(this._yieldedPromise=o,o._proxy(this,null))}else this._promiseRejected(new a("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",String(r))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")))},t.coroutine=function(e,t){if("function"!=typeof e)throw new a("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=Object(t).yieldHandler,r=h,i=(new Error).stack;return function(){var t=e.apply(this,arguments),o=new r(void 0,void 0,n,i),s=o.promise();return o._generator=t,o._promiseFulfilled(void 0),s}},t.coroutine.addYieldHandler=function(e){if("function"!=typeof e)throw new a("expecting a function but got "+c.classString(e));f.push(e)},t.spawn=function(e){if(s.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof e)return n("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=new h(e,this),i=r.promise();return r._run(t.spawn),i}}},{"./errors":12,"./util":36}],17:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o){var s=e("./util");s.canEvaluate,s.tryCatch,s.errorObj,t.join=function(){var e,t=arguments.length-1;t>0&&"function"==typeof arguments[t]&&(e=arguments[t]);var r=[].slice.call(arguments);e&&r.pop();var i=new n(r).promise();return void 0!==e?i.spread(e):i}}},{"./util":36}],18:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o,s){var a=e("./util"),c=a.tryCatch,l=a.errorObj,u=t._async;function f(e,n,r,i){this.constructor$(e),this._promise._captureStackTrace();var s=t._getContext();if(this._callback=a.contextBind(s,n),this._preservedValues=i===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],u.invoke(this._asyncInit,this,void 0),a.isArray(e))for(var c=0;c<e.length;++c){var l=e[c];l instanceof t&&l.suppressUnhandledRejections()}}function h(e,n,i,o){if("function"!=typeof n)return r("expecting a function but got "+a.classString(n));var s=0;if(void 0!==i){if("object"!=typeof i||null===i)return t.reject(new TypeError("options argument must be an object but it is "+a.classString(i)));if("number"!=typeof i.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+a.classString(i.concurrency)));s=i.concurrency}return new f(e,n,s="number"==typeof s&&isFinite(s)&&s>=1?s:0,o).promise()}a.inherits(f,n),f.prototype._asyncInit=function(){this._init$(void 0,-2)},f.prototype._init=function(){},f.prototype._promiseFulfilled=function(e,n){var r=this._values,o=this.length(),a=this._preservedValues,u=this._limit;if(n<0){if(r[n=-1*n-1]=e,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return r[n]=e,this._queue.push(n),!1;null!==a&&(a[n]=e);var f=this._promise,h=this._callback,p=f._boundValue();f._pushContext();var d=c(h).call(p,e,n,o),y=f._popContext();if(s.checkForgottenReturns(d,y,null!==a?"Promise.filter":"Promise.map",f),d===l)return this._reject(d.e),!0;var _=i(d,this._promise);if(_ instanceof t){var g=(_=_._target())._bitField;if(!(50397184&g))return u>=1&&this._inFlight++,r[n]=_,_._proxy(this,-1*(n+1)),!1;if(!(33554432&g))return 16777216&g?(this._reject(_._reason()),!0):(this._cancel(),!0);d=_._value()}r[n]=d}return++this._totalResolved>=o&&(null!==a?this._filter(r,a):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,n=this._values;e.length>0&&this._inFlight<t;){if(this._isResolved())return;var r=e.pop();this._promiseFulfilled(n[r],r)}},f.prototype._filter=function(e,t){for(var n=t.length,r=new Array(n),i=0,o=0;o<n;++o)e[o]&&(r[i++]=t[o]);r.length=i,this._resolve(r)},f.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(e,t){return h(this,e,t,null)},t.map=function(e,t,n,r){return h(e,t,n,r)}}},{"./util":36}],19:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o){var s=e("./util"),a=s.tryCatch;t.method=function(e){if("function"!=typeof e)throw new t.TypeError("expecting a function but got "+s.classString(e));return function(){var r=new t(n);r._captureStackTrace(),r._pushContext();var i=a(e).apply(this,arguments),s=r._popContext();return o.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},t.attempt=t.try=function(e){if("function"!=typeof e)return i("expecting a function but got "+s.classString(e));var r,c=new t(n);if(c._captureStackTrace(),c._pushContext(),arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];r=s.isArray(l)?a(e).apply(u,l):a(e).call(u,l)}else r=a(e)();var f=c._popContext();return o.checkForgottenReturns(r,f,"Promise.try",c),c._resolveFromSyncValue(r),c},t.prototype._resolveFromSyncValue=function(e){e===s.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":36}],20:[function(e,t,n){"use strict";var r=e("./util"),i=r.maybeWrapAsError,o=e("./errors").OperationalError,s=e("./es5");var a=/^(?:name|message|stack|cause)$/;function c(e){var t;if(function(e){return e instanceof Error&&s.getPrototypeOf(e)===Error.prototype}(e)){(t=new o(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var n=s.keys(e),i=0;i<n.length;++i){var c=n[i];a.test(c)||(t[c]=e[c])}return t}return r.markAsOriginatingFromRejection(e),e}t.exports=function(e,t){return function(n,r){if(null!==e){if(n){var o=c(i(n));e._attachExtraTrace(o),e._reject(o)}else if(t){var s=[].slice.call(arguments,1);e._fulfill(s)}else e._fulfill(r);e=null}}}},{"./errors":12,"./es5":13,"./util":36}],21:[function(e,t,n){"use strict";t.exports=function(t){var n=e("./util"),r=t._async,i=n.tryCatch,o=n.errorObj;function s(e,t){if(!n.isArray(e))return a.call(this,e,t);var s=i(t).apply(this._boundValue(),[null].concat(e));s===o&&r.throwLater(s.e)}function a(e,t){var n=this._boundValue(),s=void 0===e?i(t).call(n,null):i(t).call(n,null,e);s===o&&r.throwLater(s.e)}function c(e,t){if(!e){var n=new Error(e+"");n.cause=e,e=n}var s=i(t).call(this._boundValue(),e);s===o&&r.throwLater(s.e)}t.prototype.asCallback=t.prototype.nodeify=function(e,t){if("function"==typeof e){var n=a;void 0!==t&&Object(t).spread&&(n=s),this._then(n,c,void 0,this,e)}return this}}},{"./util":36}],22:[function(e,t,n){"use strict";t.exports=function(){var n=function(){return new g("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},r=function(){return new F.PromiseInspection(this._target())},i=function(e){return F.reject(new g(e))};function o(){}var s={},a=e("./util");a.setReflectHandler(r);var c=function(){var e=process.domain;return void 0===e?null:e},l=function(){return{domain:c(),async:null}},u=a.isNode&&a.nodeSupportsAsyncResource?e("async_hooks").AsyncResource:null,f=function(){return{domain:c(),async:new u("Bluebird::Promise")}},h=a.isNode?l:function(){return null};a.notEnumerableProp(F,"_getContext",h);var p=e("./es5"),d=e("./async"),y=new d;p.defineProperty(F,"_async",{value:y});var _=e("./errors"),g=F.TypeError=_.TypeError;F.RangeError=_.RangeError;var v=F.CancellationError=_.CancellationError;F.TimeoutError=_.TimeoutError,F.OperationalError=_.OperationalError,F.RejectionError=_.OperationalError,F.AggregateError=_.AggregateError;var m=function(){},w={},b={},E=e("./thenables")(F,m),S=e("./promise_array")(F,m,E,i,o),k=e("./context")(F),C=k.create,R=e("./debuggability")(F,k,function(){h=f,a.notEnumerableProp(F,"_getContext",f)},function(){h=l,a.notEnumerableProp(F,"_getContext",l)}),T=(R.CapturedTrace,e("./finally")(F,E,b)),A=e("./catch_filter")(b),x=e("./nodeback"),j=a.errorObj,O=a.tryCatch;function F(e){e!==m&&function(e,t){if(null==e||e.constructor!==F)throw new g("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeof t)throw new g("expecting a function but got "+a.classString(t))}(this,e),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(e),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function P(e){this.promise._resolveCallback(e)}function L(e){this.promise._rejectCallback(e,!1)}function I(e){var t=new F(m);t._fulfillmentHandler0=e,t._rejectionHandler0=e,t._promise0=e,t._receiver0=e}return F.prototype.toString=function(){return"[object Promise]"},F.prototype.caught=F.prototype.catch=function(e){var t=arguments.length;if(t>1){var n,r=new Array(t-1),o=0;for(n=0;n<t-1;++n){var s=arguments[n];if(!a.isObject(s))return i("Catch statement predicate: expecting an object but got "+a.classString(s));r[o++]=s}if(r.length=o,"function"!=typeof(e=arguments[n]))throw new g("The last argument to .catch() must be a function, got "+a.toString(e));return this.then(void 0,A(r,e,this))}return this.then(void 0,e)},F.prototype.reflect=function(){return this._then(r,r,void 0,this,void 0)},F.prototype.then=function(e,t){if(R.warnings()&&arguments.length>0&&"function"!=typeof e&&"function"!=typeof t){var n=".then() only accepts functions but was passed: "+a.classString(e);arguments.length>1&&(n+=", "+a.classString(t)),this._warn(n)}return this._then(e,t,void 0,void 0,void 0)},F.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},F.prototype.spread=function(e){return"function"!=typeof e?i("expecting a function but got "+a.classString(e)):this.all()._then(e,void 0,void 0,w,void 0)},F.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},F.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new S(this).promise()},F.prototype.error=function(e){return this.caught(a.originatesFromRejection,e)},F.getNewLibraryCopy=t.exports,F.is=function(e){return e instanceof F},F.fromNode=F.fromCallback=function(e){var t=new F(m);t._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,r=O(e)(x(t,n));return r===j&&t._rejectCallback(r.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},F.all=function(e){return new S(e).promise()},F.cast=function(e){var t=E(e);return t instanceof F||((t=new F(m))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},F.resolve=F.fulfilled=F.cast,F.reject=F.rejected=function(e){var t=new F(m);return t._captureStackTrace(),t._rejectCallback(e,!0),t},F.setScheduler=function(e){if("function"!=typeof e)throw new g("expecting a function but got "+a.classString(e));return y.setScheduler(e)},F.prototype._then=function(e,t,n,r,i){var o=void 0!==i,s=o?i:new F(m),c=this._target(),l=c._bitField;o||(s._propagateFrom(this,3),s._captureStackTrace(),void 0===r&&2097152&this._bitField&&(r=50397184&l?this._boundValue():c===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,s));var u=h();if(50397184&l){var f,p,d=c._settlePromiseCtx;33554432&l?(p=c._rejectionHandler0,f=e):16777216&l?(p=c._fulfillmentHandler0,f=t,c._unsetRejectionIsUnhandled()):(d=c._settlePromiseLateCancellationObserver,p=new v("late cancellation observer"),c._attachExtraTrace(p),f=t),y.invoke(d,c,{handler:a.contextBind(u,f),promise:s,receiver:r,value:p})}else c._addCallbacks(e,t,s,r,u);return s},F.prototype._length=function(){return 65535&this._bitField},F.prototype._isFateSealed=function(){return!!(117506048&this._bitField)},F.prototype._isFollowing=function(){return!(67108864&~this._bitField)},F.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},F.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},F.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},F.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},F.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},F.prototype._isFinal=function(){return(4194304&this._bitField)>0},F.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},F.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},F.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},F.prototype._setAsyncGuaranteed=function(){if(!y.hasCustomScheduler()){var e=this._bitField;this._bitField=e|(536870912&e)>>2^134217728}},F.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&this._bitField|536870912},F.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==s)return void 0===t&&this._isBound()?this._boundValue():t},F.prototype._promiseAt=function(e){return this[4*e-4+2]},F.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},F.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},F.prototype._boundValue=function(){},F.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,n=e._rejectionHandler0,r=e._promise0,i=e._receiverAt(0);void 0===i&&(i=s),this._addCallbacks(t,n,r,i,null)},F.prototype._migrateCallbackAt=function(e,t){var n=e._fulfillmentHandlerAt(t),r=e._rejectionHandlerAt(t),i=e._promiseAt(t),o=e._receiverAt(t);void 0===o&&(o=s),this._addCallbacks(n,r,i,o,null)},F.prototype._addCallbacks=function(e,t,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof e&&(this._fulfillmentHandler0=a.contextBind(i,e)),"function"==typeof t&&(this._rejectionHandler0=a.contextBind(i,t));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeof e&&(this[s+0]=a.contextBind(i,e)),"function"==typeof t&&(this[s+1]=a.contextBind(i,t))}return this._setLength(o+1),o},F.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},F.prototype._resolveCallback=function(e,t){if(!(117506048&this._bitField)){if(e===this)return this._rejectCallback(n(),!1);var r=E(e,this);if(!(r instanceof F))return this._fulfill(e);t&&this._propagateFrom(r,2);var i=r._target();if(i!==this){var o=i._bitField;if(50397184&o)if(33554432&o)this._fulfill(i._value());else if(16777216&o)this._reject(i._reason());else{var s=new v("late cancellation observer");i._attachExtraTrace(s),this._reject(s)}else{var a=this._length();a>0&&i._migrateCallback0(this);for(var c=1;c<a;++c)i._migrateCallbackAt(this,c);this._setFollowing(),this._setLength(0),this._setFollowee(r)}}else this._reject(n())}},F.prototype._rejectCallback=function(e,t,n){var r=a.ensureErrorObject(e),i=r===e;if(!i&&!n&&R.warnings()){var o="a promise was rejected with a non-error: "+a.classString(e);this._warn(o,!0)}this._attachExtraTrace(r,!!t&&i),this._reject(e)},F.prototype._resolveFromExecutor=function(e){if(e!==m){var t=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(e,function(e){t._resolveCallback(e)},function(e){t._rejectCallback(e,n)});n=!1,this._popContext(),void 0!==r&&t._rejectCallback(r,!0)}},F.prototype._settlePromiseFromHandler=function(e,t,n,r){var i=r._bitField;if(!(65536&i)){var o;r._pushContext(),t===w?n&&"number"==typeof n.length?o=O(e).apply(this._boundValue(),n):(o=j).e=new g("cannot .spread() a non-array: "+a.classString(n)):o=O(e).call(t,n);var s=r._popContext();65536&(i=r._bitField)||(o===b?r._reject(n):o===j?r._rejectCallback(o.e,!1):(R.checkForgottenReturns(o,s,"",r,this),r._resolveCallback(o)))}},F.prototype._target=function(){for(var e=this;e._isFollowing();)e=e._followee();return e},F.prototype._followee=function(){return this._rejectionHandler0},F.prototype._setFollowee=function(e){this._rejectionHandler0=e},F.prototype._settlePromise=function(e,t,n,i){var s=e instanceof F,a=this._bitField,c=!!(134217728&a);65536&a?(s&&e._invokeInternalOnCancel(),n instanceof T&&n.isFinallyHandler()?(n.cancelPromise=e,O(t).call(n,i)===j&&e._reject(j.e)):t===r?e._fulfill(r.call(n)):n instanceof o?n._promiseCancelled(e):s||e instanceof S?e._cancel():n.cancel()):"function"==typeof t?s?(c&&e._setAsyncGuaranteed(),this._settlePromiseFromHandler(t,n,i,e)):t.call(n,i,e):n instanceof o?n._isResolved()||(33554432&a?n._promiseFulfilled(i,e):n._promiseRejected(i,e)):s&&(c&&e._setAsyncGuaranteed(),33554432&a?e._fulfill(i):e._reject(i))},F.prototype._settlePromiseLateCancellationObserver=function(e){var t=e.handler,n=e.promise,r=e.receiver,i=e.value;"function"==typeof t?n instanceof F?this._settlePromiseFromHandler(t,r,i,n):t.call(r,i,n):n instanceof F&&n._reject(i)},F.prototype._settlePromiseCtx=function(e){this._settlePromise(e.promise,e.handler,e.receiver,e.value)},F.prototype._settlePromise0=function(e,t,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,e,i,t)},F.prototype._clearCallbackDataAtIndex=function(e){var t=4*e-4;this[t+2]=this[t+3]=this[t+0]=this[t+1]=void 0},F.prototype._fulfill=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(e===this){var r=n();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(134217728&t?this._settlePromises():y.settlePromises(this),this._dereferenceTrace())}},F.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return y.fatalError(e,a.isNode);(65535&t)>0?y.settlePromises(this):this._ensurePossibleRejectionHandled()}},F.prototype._fulfillPromises=function(e,t){for(var n=1;n<e;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,t)}},F.prototype._rejectPromises=function(e,t){for(var n=1;n<e;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,t)}},F.prototype._settlePromises=function(){var e=this._bitField,t=65535&e;if(t>0){if(16842752&e){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,e),this._rejectPromises(t,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,e),this._fulfillPromises(t,r)}this._setLength(0)}this._clearCancellationData()},F.prototype._settledValue=function(){var e=this._bitField;return 33554432&e?this._rejectionHandler0:16777216&e?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&p.defineProperty(F.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),F.defer=F.pending=function(){return R.deprecated("Promise.defer","new Promise"),{promise:new F(m),resolve:P,reject:L}},a.notEnumerableProp(F,"_makeSelfResolutionError",n),e("./method")(F,m,E,i,R),e("./bind")(F,m,E,R),e("./cancel")(F,S,i,R),e("./direct_resolve")(F),e("./synchronous_inspection")(F),e("./join")(F,S,E,m,y),F.Promise=F,F.version="3.7.2",e("./call_get.js")(F),e("./generators.js")(F,i,m,E,o,R),e("./map.js")(F,S,i,E,m,R),e("./nodeify.js")(F),e("./promisify.js")(F,m),e("./props.js")(F,S,E,i),e("./race.js")(F,m,E,i),e("./reduce.js")(F,S,i,E,m,R),e("./settle.js")(F,S,R),e("./some.js")(F,S,i),e("./timers.js")(F,m,R),e("./using.js")(F,i,E,C,m,R),e("./any.js")(F),e("./each.js")(F,m),e("./filter.js")(F,m),a.toFastProperties(F),a.toFastProperties(F.prototype),I({a:1}),I({b:2}),I({c:3}),I(1),I(function(){}),I(void 0),I(!1),I(new F(m)),R.setBounds(d.firstLineError,a.lastLineError),F}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36,async_hooks:void 0}],23:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o){var s=e("./util");function a(e){var r=this._promise=new t(n);e instanceof t&&(r._propagateFrom(e,3),e.suppressUnhandledRejections()),r._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return s.isArray,s.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function e(n,o){var a=r(this._values,this._promise);if(a instanceof t){var c=(a=a._target())._bitField;if(this._values=a,!(50397184&c))return this._promise._setAsyncGuaranteed(),a._then(e,this._reject,void 0,this,o);if(!(33554432&c))return 16777216&c?this._reject(a._reason()):this._cancel();a=a._value()}if(null!==(a=s.asArray(a)))0!==a.length?this._iterate(a):-5===o?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}(o));else{var l=i("expecting an array or an iterable object but got "+s.classString(a)).reason();this._promise._rejectCallback(l,!1)}},a.prototype._iterate=function(e){var n=this.getActualLength(e.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;a<n;++a){var c=r(e[a],i);s=c instanceof t?(c=c._target())._bitField:null,o?null!==s&&c.suppressUnhandledRejections():null!==s?50397184&s?o=33554432&s?this._promiseFulfilled(c._value(),a):16777216&s?this._promiseRejected(c._reason(),a):this._promiseCancelled(a):(c._proxy(this,a),this._values[a]=c):o=this._promiseFulfilled(c,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(e){this._values=null,this._promise._fulfill(e)},a.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(e){this._values=null,this._promise._rejectCallback(e,!1)},a.prototype._promiseFulfilled=function(e,t){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var n=0;n<e.length;++n)e[n]instanceof t&&e[n].cancel()}},a.prototype.shouldCopyValues=function(){return!0},a.prototype.getActualLength=function(e){return e},a}},{"./util":36}],24:[function(e,t,n){"use strict";t.exports=function(t,n){var r={},i=e("./util"),o=e("./nodeback"),s=i.withAppended,a=i.maybeWrapAsError,c=i.canEvaluate,l=e("./errors").TypeError,u={__isPromisified__:!0},f=new RegExp("^(?:"+["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"].join("|")+")$"),h=function(e){return i.isIdentifier(e)&&"_"!==e.charAt(0)&&"constructor"!==e};function p(e){return!f.test(e)}function d(e){try{return!0===e.__isPromisified__}catch(e){return!1}}function y(e,t,n){var r=i.getDataPropertyOrDefault(e,t+n,u);return!!r&&d(r)}function _(e,t,n,r){for(var o=i.inheritedDataKeys(e),s=[],a=0;a<o.length;++a){var c=o[a],u=e[c],f=r===h||h(c);"function"!=typeof u||d(u)||y(e,c,t)||!r(c,u,e,f)||s.push(c,u)}return function(e,t,n){for(var r=0;r<e.length;r+=2){var i=e[r];if(n.test(i))for(var o=i.replace(n,""),s=0;s<e.length;s+=2)if(e[s]===o)throw new l("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",t))}}(s,t,n),s}var g=c?void 0:function(e,c,l,u,f,h){var p=function(){return this}(),d=e;function y(){var i=c;c===r&&(i=this);var l=new t(n);l._captureStackTrace();var u="string"==typeof d&&this!==p?this[d]:e,f=o(l,h);try{u.apply(i,s(arguments,f))}catch(e){l._rejectCallback(a(e),!0,!0)}return l._isFateSealed()||l._setAsyncGuaranteed(),l}return"string"==typeof d&&(e=u),i.notEnumerableProp(y,"__isPromisified__",!0),y};function v(e,t,n,o,s){for(var a=new RegExp(t.replace(/([$])/,"\\$")+"$"),c=_(e,t,a,n),l=0,u=c.length;l<u;l+=2){var f=c[l],h=c[l+1],p=f+t;if(o===g)e[p]=g(f,r,f,h,t,s);else{var d=o(h,function(){return g(f,r,f,h,t,s)});i.notEnumerableProp(d,"__isPromisified__",!0),e[p]=d}}return i.toFastProperties(e),e}t.promisify=function(e,t){if("function"!=typeof e)throw new l("expecting a function but got "+i.classString(e));if(d(e))return e;var n,o,s,a=(n=e,o=void 0===(t=Object(t)).context?r:t.context,s=!!t.multiArgs,g(n,o,void 0,n,null,s));return i.copyDescriptors(e,a,p),a},t.promisifyAll=function(e,t){if("function"!=typeof e&&"object"!=typeof e)throw new l("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");var n=!!(t=Object(t)).multiArgs,r=t.suffix;"string"!=typeof r&&(r="Async");var o=t.filter;"function"!=typeof o&&(o=h);var s=t.promisifier;if("function"!=typeof s&&(s=g),!i.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var a=i.inheritedDataKeys(e),c=0;c<a.length;++c){var u=e[a[c]];"constructor"!==a[c]&&i.isClass(u)&&(v(u.prototype,r,o,s,n),v(u,r,o,s,n))}return v(e,r,o,s,n)}}},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(e,t,n){"use strict";t.exports=function(t,n,r,i){var o,s=e("./util"),a=s.isObject,c=e("./es5");"function"==typeof Map&&(o=Map);var l=function(){var e=0,t=0;function n(n,r){this[e]=n,this[e+t]=r,e++}return function(r){t=r.size,e=0;var i=new Array(2*r.size);return r.forEach(n,i),i}}();function u(e){var t,n=!1;if(void 0!==o&&e instanceof o)t=l(e),n=!0;else{var r=c.keys(e),i=r.length;t=new Array(2*i);for(var s=0;s<i;++s){var a=r[s];t[s]=e[a],t[s+i]=a}}this.constructor$(t),this._isMap=n,this._init$(void 0,n?-6:-3)}function f(e){var n,o=r(e);return a(o)?(n=o instanceof t?o._then(t.props,void 0,void 0,void 0,void 0):new u(o).promise(),o instanceof t&&n._propagateFrom(o,2),n):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}s.inherits(u,n),u.prototype._init=function(){},u.prototype._promiseFulfilled=function(e,t){if(this._values[t]=e,++this._totalResolved>=this._length){var n;if(this._isMap)n=function(e){for(var t=new o,n=e.length/2|0,r=0;r<n;++r){var i=e[n+r],s=e[r];t.set(i,s)}return t}(this._values);else{n={};for(var r=this.length(),i=0,s=this.length();i<s;++i)n[this._values[i+r]]=this._values[i]}return this._resolve(n),!0}return!1},u.prototype.shouldCopyValues=function(){return!1},u.prototype.getActualLength=function(e){return e>>1},t.prototype.props=function(){return f(this)},t.props=function(e){return f(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,n){"use strict";function r(e){this._capacity=e,this._length=0,this._front=0}r.prototype._willBeOverCapacity=function(e){return this._capacity<e},r.prototype._pushOne=function(e){var t=this.length();this._checkCapacity(t+1),this[this._front+t&this._capacity-1]=e,this._length=t+1},r.prototype.push=function(e,t,n){var r=this.length()+3;if(this._willBeOverCapacity(r))return this._pushOne(e),this._pushOne(t),void this._pushOne(n);var i=this._front+r-3;this._checkCapacity(r);var o=this._capacity-1;this[i+0&o]=e,this[i+1&o]=t,this[i+2&o]=n,this._length=r},r.prototype.shift=function(){var e=this._front,t=this[e];return this[e]=void 0,this._front=e+1&this._capacity-1,this._length--,t},r.prototype.length=function(){return this._length},r.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(this._capacity<<1)},r.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e,function(e,t,n,r,i){for(var o=0;o<i;++o)n[o+r]=e[o+t],e[o+t]=void 0}(this,0,this,t,this._front+this._length&t-1)},t.exports=r},{}],27:[function(e,t,n){"use strict";t.exports=function(t,n,r,i){var o=e("./util");function s(e,a){var c,l=r(e);if(l instanceof t)return(c=l).then(function(e){return s(e,c)});if(null===(e=o.asArray(e)))return i("expecting an array or an iterable object but got "+o.classString(e));var u=new t(n);void 0!==a&&u._propagateFrom(a,3);for(var f=u._fulfill,h=u._reject,p=0,d=e.length;p<d;++p){var y=e[p];(void 0!==y||p in e)&&t.cast(y)._then(f,h,void 0,u,null)}return u}t.race=function(e){return s(e,void 0)},t.prototype.race=function(){return s(this,void 0)}}},{"./util":36}],28:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o,s){var a=e("./util"),c=a.tryCatch;function l(e,n,r,i){this.constructor$(e);var s=t._getContext();this._fn=a.contextBind(s,n),void 0!==r&&(r=t.resolve(r))._attachCancellationCallback(this),this._initialValue=r,this._currentCancellable=null,this._eachValues=i===o?Array(this._length):0===i?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function u(e,t){this.isFulfilled()?t._resolve(e):t._reject(e)}function f(e,t,n,i){return"function"!=typeof t?r("expecting a function but got "+a.classString(t)):new l(e,t,n,i).promise()}function h(e){this.accum=e,this.array._gotAccum(e);var n=i(this.value,this.array._promise);return n instanceof t?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(e){var n,r=this.array,i=r._promise,o=c(r._fn);i._pushContext(),(n=void 0!==r._eachValues?o.call(i._boundValue(),e,this.index,this.length):o.call(i._boundValue(),this.accum,e,this.index,this.length))instanceof t&&(r._currentCancellable=n);var a=i._popContext();return s.checkForgottenReturns(n,a,void 0!==r._eachValues?"Promise.each":"Promise.reduce",i),n}a.inherits(l,n),l.prototype._gotAccum=function(e){void 0!==this._eachValues&&null!==this._eachValues&&e!==o&&this._eachValues.push(e)},l.prototype._eachComplete=function(e){return null!==this._eachValues&&this._eachValues.push(e),this._eachValues},l.prototype._init=function(){},l.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},l.prototype.shouldCopyValues=function(){return!1},l.prototype._resolve=function(e){this._promise._resolveCallback(e),this._values=null},l.prototype._resultCancelled=function(e){if(e===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof t&&this._currentCancellable.cancel(),this._initialValue instanceof t&&this._initialValue.cancel())},l.prototype._iterate=function(e){var n,r;this._values=e;var i=e.length;void 0!==this._initialValue?(n=this._initialValue,r=0):(n=t.resolve(e[0]),r=1),this._currentCancellable=n;for(var o=r;o<i;++o){var s=e[o];s instanceof t&&s.suppressUnhandledRejections()}if(!n.isRejected())for(;r<i;++r){var a={accum:null,value:e[r],index:r,length:i,array:this};n=n._then(h,void 0,void 0,a,void 0),127&r||n._setNoAsyncGuarantee()}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(u,u,void 0,n,this)},t.prototype.reduce=function(e,t){return f(this,e,t,null)},t.reduce=function(e,t,n,r){return f(e,t,n,r)}}},{"./util":36}],29:[function(e,t,r){"use strict";var i,o=e("./util"),s=o.getNativePromise();if(o.isNode&&"undefined"==typeof MutationObserver){var a=n.g.setImmediate,c=process.nextTick;i=o.isRecentNode?function(e){a.call(n.g,e)}:function(e){c.call(process,e)}}else if("function"==typeof s&&"function"==typeof s.resolve){var l=s.resolve();i=function(e){l.then(e)}}else i="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)||!("classList"in document.documentElement)?"undefined"!=typeof setImmediate?function(e){setImmediate(e)}:"undefined"!=typeof setTimeout?function(e){setTimeout(e,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}:function(){var e=document.createElement("div"),t={attributes:!0},n=!1,r=document.createElement("div");new MutationObserver(function(){e.classList.toggle("foo"),n=!1}).observe(r,t);return function(i){var o=new MutationObserver(function(){o.disconnect(),i()});o.observe(e,t),n||(n=!0,r.classList.toggle("foo"))}}();t.exports=i},{"./util":36}],30:[function(e,t,n){"use strict";t.exports=function(t,n,r){var i=t.PromiseInspection;function o(e){this.constructor$(e)}e("./util").inherits(o,n),o.prototype._promiseResolved=function(e,t){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(e,t){var n=new i;return n._bitField=33554432,n._settledValueField=e,this._promiseResolved(t,n)},o.prototype._promiseRejected=function(e,t){var n=new i;return n._bitField=16777216,n._settledValueField=e,this._promiseResolved(t,n)},t.settle=function(e){return r.deprecated(".settle()",".reflect()"),new o(e).promise()},t.allSettled=function(e){return new o(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t,n){"use strict";t.exports=function(t,n,r){var i=e("./util"),o=e("./errors").RangeError,s=e("./errors").AggregateError,a=i.isArray,c={};function l(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(e,t){if((0|t)!==t||t<0)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new l(e),i=n.promise();return n.setHowMany(t),n.init(),i}i.inherits(l,n),l.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=a(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},l.prototype.init=function(){this._initialized=!0,this._init()},l.prototype.setUnwrap=function(){this._unwrap=!0},l.prototype.howMany=function(){return this._howMany},l.prototype.setHowMany=function(e){this._howMany=e},l.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},l.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},l.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(c),this._checkOutcome())},l.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new s,t=this.length();t<this._values.length;++t)this._values[t]!==c&&e.push(this._values[t]);return e.length>0?this._reject(e):this._cancel(),!0}return!1},l.prototype._fulfilled=function(){return this._totalResolved},l.prototype._rejected=function(){return this._values.length-this.length()},l.prototype._addRejected=function(e){this._values.push(e)},l.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},l.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},l.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new o(t)},l.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(e,t){return u(e,t)},t.prototype.some=function(e){return u(this,e)},t._SomePromiseArray=l}},{"./errors":12,"./util":36}],32:[function(e,t,n){"use strict";t.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var n=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=t.prototype.isFulfilled=function(){return!!(33554432&this._bitField)},o=t.prototype.isRejected=function(){return!!(16777216&this._bitField)},s=t.prototype.isPending=function(){return!(50397184&this._bitField)},a=t.prototype.isResolved=function(){return!!(50331648&this._bitField)};t.prototype.isCancelled=function(){return!!(8454144&this._bitField)},e.prototype.__isCancelled=function(){return!(65536&~this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return!!(8454144&this._target()._bitField)},e.prototype.isPending=function(){return s.call(this._target())},e.prototype.isRejected=function(){return o.call(this._target())},e.prototype.isFulfilled=function(){return i.call(this._target())},e.prototype.isResolved=function(){return a.call(this._target())},e.prototype.value=function(){return n.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),r.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},{}],33:[function(e,t,n){"use strict";t.exports=function(t,n){var r=e("./util"),i=r.errorObj,o=r.isObject;var s={}.hasOwnProperty;return function(e,a){if(o(e)){if(e instanceof t)return e;var c=function(e){try{return function(e){return e.then}(e)}catch(e){return i.e=e,i}}(e);if(c===i){a&&a._pushContext();var l=t.reject(c.e);return a&&a._popContext(),l}if("function"==typeof c)return function(e){try{return s.call(e,"_promise0")}catch(e){return!1}}(e)?(l=new t(n),e._then(l._fulfill,l._reject,void 0,l,null),l):function(e,o,s){var a=new t(n),c=a;s&&s._pushContext(),a._captureStackTrace(),s&&s._popContext();var l=!0,u=r.tryCatch(o).call(e,f,h);function f(e){a&&(a._resolveCallback(e),a=null)}function h(e){a&&(a._rejectCallback(e,l,!0),a=null)}return l=!1,a&&u===i&&(a._rejectCallback(u.e,!0,!0),a=null),c}(e,c,a)}return e}}},{"./util":36}],34:[function(e,t,n){"use strict";t.exports=function(t,n,r){var i=e("./util"),o=t.TimeoutError;function s(e){this.handle=e}s.prototype._resultCancelled=function(){clearTimeout(this.handle)};var a=function(e){return c(+this).thenReturn(e)},c=t.delay=function(e,i){var o,c;return void 0!==i?(o=t.resolve(i)._then(a,null,null,e,void 0),r.cancellation()&&i instanceof t&&o._setOnCancel(i)):(o=new t(n),c=setTimeout(function(){o._fulfill()},+e),r.cancellation()&&o._setOnCancel(new s(c)),o._captureStackTrace()),o._setAsyncGuaranteed(),o};t.prototype.delay=function(e){return c(e,this)};function l(e){return clearTimeout(this.handle),e}function u(e){throw clearTimeout(this.handle),e}t.prototype.timeout=function(e,t){var n,a;e=+e;var c=new s(setTimeout(function(){n.isPending()&&function(e,t,n){var r;r="string"!=typeof t?t instanceof Error?t:new o("operation timed out"):new o(t),i.markAsOriginatingFromRejection(r),e._attachExtraTrace(r),e._reject(r),null!=n&&n.cancel()}(n,t,a)},e));return r.cancellation()?(a=this.then(),(n=a._then(l,u,void 0,c,void 0))._setOnCancel(c)):n=this._then(l,u,void 0,c,void 0),n}}},{"./util":36}],35:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o,s){var a=e("./util"),c=e("./errors").TypeError,l=e("./util").inherits,u=a.errorObj,f=a.tryCatch,h={};function p(e){setTimeout(function(){throw e},0)}function d(e,n){var i=0,s=e.length,a=new t(o);return function o(){if(i>=s)return a._fulfill();var c=function(e){var t=r(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}(e[i++]);if(c instanceof t&&c._isDisposable()){try{c=r(c._getDisposer().tryDispose(n),e.promise)}catch(e){return p(e)}if(c instanceof t)return c._then(o,p,null,null,null)}o()}(),a}function y(e,t,n){this._data=e,this._promise=t,this._context=n}function _(e,t,n){this.constructor$(e,t,n)}function g(e){return y.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function v(e){this.length=e,this.promise=null,this[e-1]=null}y.prototype.data=function(){return this._data},y.prototype.promise=function(){return this._promise},y.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():h},y.prototype.tryDispose=function(e){var t=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=t!==h?this.doDispose(t,e):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},y.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},l(_,y),_.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},v.prototype._resultCancelled=function(){for(var e=this.length,n=0;n<e;++n){var r=this[n];r instanceof t&&r.cancel()}},t.using=function(){var e=arguments.length;if(e<2)return n("you must pass at least 2 arguments to Promise.using");var i,o=arguments[e-1];if("function"!=typeof o)return n("expecting a function but got "+a.classString(o));var c=!0;2===e&&Array.isArray(arguments[0])?(e=(i=arguments[0]).length,c=!1):(i=arguments,e--);for(var l=new v(e),h=0;h<e;++h){var p=i[h];if(y.isDisposer(p)){var _=p;(p=p.promise())._setDisposable(_)}else{var m=r(p);m instanceof t&&(p=m._then(g,null,null,{resources:l,index:h},void 0))}l[h]=p}var w=new Array(l.length);for(h=0;h<w.length;++h)w[h]=t.resolve(l[h]).reflect();var b=t.all(w).then(function(e){for(var t=0;t<e.length;++t){var n=e[t];if(n.isRejected())return u.e=n.error(),u;if(!n.isFulfilled())return void b.cancel();e[t]=n.value()}E._pushContext(),o=f(o);var r=c?o.apply(void 0,e):o(e),i=E._popContext();return s.checkForgottenReturns(r,i,"Promise.using",E),r}),E=b.lastly(function(){var e=new t.PromiseInspection(b);return d(l,e)});return l.promise=E,E._setOnCancel(l),E},t.prototype._setDisposable=function(e){this._bitField=131072|this._bitField,this._disposer=e},t.prototype._isDisposable=function(){return(131072&this._bitField)>0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(e){if("function"==typeof e)return new _(e,this,i());throw new c}}},{"./errors":12,"./util":36}],36:[function(e,t,r){"use strict";var i,o=e("./es5"),s="undefined"==typeof navigator,a={e:{}},c="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:void 0!==this?this:null;function l(){try{var e=i;return i=null,e.apply(this,arguments)}catch(e){return a.e=e,a}}function u(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function f(e,t,n){if(u(e))return e;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return o.defineProperty(e,t,r),e}var h=function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(t){for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1};if(o.isES5){var n=Object.getOwnPropertyNames;return function(e){for(var r=[],i=Object.create(null);null!=e&&!t(e);){var s;try{s=n(e)}catch(e){return r}for(var a=0;a<s.length;++a){var c=s[a];if(!i[c]){i[c]=!0;var l=Object.getOwnPropertyDescriptor(e,c);null!=l&&null==l.get&&null==l.set&&r.push(c)}}e=o.getPrototypeOf(e)}return r}}var r={}.hasOwnProperty;return function(n){if(t(n))return[];var i=[];e:for(var o in n)if(r.call(n,o))i.push(o);else{for(var s=0;s<e.length;++s)if(r.call(e[s],o))continue e;i.push(o)}return i}}(),p=/this\s*\.\s*\S+\s*=/;var d=/^[a-z$_][a-z$_0-9]*$/i;function y(e){try{return e+""}catch(e){return"[no string representation]"}}function _(e){return e instanceof Error||null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name}function g(e){return _(e)&&o.propertyIsWritable(e,"stack")}var v="stack"in new Error?function(e){return g(e)?e:new Error(y(e))}:function(e){if(g(e))return e;try{throw new Error(y(e))}catch(e){return e}};function m(e){return{}.toString.call(e)}var w=function(e){return o.isArray(e)?e:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var b="function"==typeof Array.from?function(e){return Array.from(e)}:function(e){for(var t,n=[],r=e[Symbol.iterator]();!(t=r.next()).done;)n.push(t.value);return n};w=function(e){return o.isArray(e)?e:null!=e&&"function"==typeof e[Symbol.iterator]?b(e):null}}var E,S="undefined"!=typeof process&&"[object process]"===m(process).toLowerCase(),k="undefined"!=typeof process&&void 0!==process.env;var C,R={setReflectHandler:function(e){E=e},isClass:function(e){try{if("function"==typeof e){var t=o.names(e.prototype),n=o.isES5&&t.length>1,r=t.length>0&&!(1===t.length&&"constructor"===t[0]),i=p.test(e+"")&&o.names(e).length>0;if(n||r||i)return!0}return!1}catch(e){return!1}},isIdentifier:function(e){return d.test(e)},inheritedDataKeys:h,getDataPropertyOrDefault:function(e,t,n){if(!o.isES5)return{}.hasOwnProperty.call(e,t)?e[t]:void 0;var r=Object.getOwnPropertyDescriptor(e,t);return null!=r?null==r.get&&null==r.set?r.value:n:void 0},thrower:function(e){throw e},isArray:o.isArray,asArray:w,notEnumerableProp:f,isPrimitive:u,isObject:function(e){return"function"==typeof e||"object"==typeof e&&null!==e},isError:_,canEvaluate:s,errorObj:a,tryCatch:function(e){return i=e,l},inherits:function(e,t){var n={}.hasOwnProperty;function r(){for(var r in this.constructor=e,this.constructor$=t,t.prototype)n.call(t.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=t.prototype[r])}return r.prototype=t.prototype,e.prototype=new r,e.prototype},withAppended:function(e,t){var n,r=e.length,i=new Array(r+1);for(n=0;n<r;++n)i[n]=e[n];return i[n]=t,i},maybeWrapAsError:function(e){return u(e)?new Error(y(e)):e},toFastProperties:function(e){function t(){}t.prototype=e;var n=new t;function r(){return typeof n.foo}return r(),r(),e},filledRange:function(e,t,n){for(var r=new Array(e),i=0;i<e;++i)r[i]=t+i+n;return r},toString:y,canAttachTrace:g,ensureErrorObject:v,originatesFromRejection:function(e){return null!=e&&(e instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===e.isOperational)},markAsOriginatingFromRejection:function(e){try{f(e,"isOperational",!0)}catch(e){}},classString:m,copyDescriptors:function(e,t,n){for(var r=o.names(e),i=0;i<r.length;++i){var s=r[i];if(n(s))try{o.defineProperty(t,s,o.getDescriptor(e,s))}catch(e){}}},isNode:S,hasEnvVariables:k,env:function(e){return k?process.env[e]:void 0},global:c,getNativePromise:function(){if("function"==typeof Promise)try{if("[object Promise]"===m(new Promise(function(){})))return Promise}catch(e){}},contextBind:function(e,t){if(null===e||"function"!=typeof t||t===E)return t;null!==e.domain&&(t=e.domain.bind(t));var n=e.async;if(null!==n){var r=t;t=function(){var e=new Array(2).concat([].slice.call(arguments));return e[0]=r,e[1]=this,n.runInAsyncScope.apply(n,e)}}return t}};R.isRecentNode=R.isNode&&(process.versions&&process.versions.node?C=process.versions.node.split(".").map(Number):process.version&&(C=process.version.split(".").map(Number)),0===C[0]&&C[1]>10||C[0]>0),R.nodeSupportsAsyncResource=R.isNode&&function(){var t=!1;try{t="function"==typeof e("async_hooks").AsyncResource.prototype.runInAsyncScope}catch(e){t=!1}return t}(),R.isNode&&R.toFastProperties(process);try{throw new Error}catch(e){R.lastLineError=e}t.exports=R},{"./es5":13,async_hooks:void 0}]},{},[4])(4),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)},287(e,t,n){"use strict";const r=n(526),i=n(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|y(e,t);let r=a(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const i=function(e){if(c.isBuffer(e)){const t=0|d(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||X(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return u(e),a(e<0?0:0|d(e))}function h(e){const t=e.length<0?0:0|d(e.length),n=a(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function p(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,c.prototype),r}function d(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Z(e).length;default:if(i)return r?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function _(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return R(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return x(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),X(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,i){let o,s=1,a=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let r=-1;for(o=n;o<a;o++)if(l(e,o)===l(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===c)return r*s}else-1!==r&&(o-=o-r),r=-1}else for(n+c>a&&(n=a-c),o=n;o>=0;o--){let n=!0;for(let r=0;r<c;r++)if(l(e,o+r)!==l(t,r)){n=!1;break}if(n)return o}return-1}function w(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=t.length;let s;for(r>o/2&&(r=o/2),s=0;s<r;++s){const r=parseInt(t.substr(2*s,2),16);if(X(r))return s;e[n+s]=r}return s}function b(e,t,n,r){return Y(G(t,e.length-n),e,n,r)}function E(e,t,n,r){return Y(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return Y(Z(t),e,n,r)}function k(e,t,n,r){return Y(function(e,t){let n,r,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function R(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=n){let n,r,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(o=c));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:n=e[i+1],r=e[i+2],a=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=T));return n}(r)}t.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,n){return function(e,t,n){return u(e),e<=0?a(e):void 0!==t?"string"==typeof n?a(e).fill(t,n):a(e).fill(t):a(e)}(e,t,n)},c.allocUnsafe=function(e){return f(e)},c.allocUnsafeSlow=function(e){return f(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=c.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if(q(t,Uint8Array))i+t.length>r.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?R(this,0,e):_.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,i){if(q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const a=Math.min(o,s),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<a;++e)if(l[e]!==u[e]){o=l[e],s=u[e];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},c.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function A(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function x(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function j(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=Q[e[r]];return i}function O(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function F(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function L(e,t,n,r,i){W(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,n}function I(e,t,n,r,i){W(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s>>=8,e[n+2]=s,s>>=8,e[n+1]=s,s>>=8,e[n]=s,n+8}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(e,t,n,r,o){return t=+t,n>>>=0,o||B(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,o){return t=+t,n>>>=0,o||B(e,0,n,8),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,c.prototype),r},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=J(function(e){H(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),c.prototype.readBigUInt64BE=J(function(e){H(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),c.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||F(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||F(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||F(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=J(function(e){H(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=J(function(e){H(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||F(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||F(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||F(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||F(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||P(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||P(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=J(function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=J(function(e,t=0){return I(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let i=0,o=1,s=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let i=n-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=J(function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=J(function(e,t=0){return I(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},c.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const o=c.isBuffer(e)?e:c.from(e,r),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=o[i%s]}return this};const N={};function $(e,t,n){N[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function W(e,t,n,r,i,o){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new N.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||V(t,e.length-(n+1))}(r,i,o)}function H(e,t){if("number"!=typeof e)throw new N.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,n){if(Math.floor(e)!==e)throw H(e,n),new N.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new N.ERR_BUFFER_OUT_OF_BOUNDS;throw new N.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}$("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),$("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),$("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=D(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r},RangeError);const z=/[^+/0-9A-Za-z-_]/g;function G(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let s=0;s<r;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Z(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const Q=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function J(e){return"undefined"==typeof BigInt?K:e}function K(){throw new Error("BigInt not supported")}},368(e,t,n){const r=n(70),i=r._argv_get,o=r._argv_url_get,s=r._child_process_spawn_get,a=s(),c=s("async"),l=(0,r._process_exit_get)(),u=(0,r._process_cwd_get)(),f=u,h=r._yargv_get,p=n(314),d=p._dirname,y=(p._file_append,p._file_exists,p._path_join),_=p._basename,g=p._stat;function v(e,t){let n;return void 0===t||""==t?n=`${e}: {_msg}`:"string"!=typeof t&&""==t||(n=`[${t}] ${e}: {_msg}`),n}function m(e){let t;"n"==quiet&&(_template=v("WARNING",app_name),t=_template.replaceAll("{_msg}",e),console.warn(t))}function w(e){let t;"undefined"!=typeof quiet&&""!=quiet||(quiet="y"),"n"==quiet&&(t=v("INFO",app_name).replaceAll("{_msg}",e),console.log(t))}function b(e,t){let n,r;"undefined"==typeof app_name||app_name,t=String(t),n=v("ERROR",app_name),r=n.replaceAll("{_msg}",e),"1"===t?(console.error(r),l(1)):"0"===t&&console.warn(r)}function E(e,t){let n;return void 0===t&&(t=e,e=0),n=t-e,n<0?(_msg="Second argument 'end' is greater than first argument 'start', returning empty list.",m(_msg),[]):Array(n).keys().map(t=>t+e)}function S(e){return new Promise(t=>setTimeout(t,e))}e.exports={_argv_get:i,_argv_url_get:o,_app_name_get:function(){let e;return e=_("/index.js"),e},_basename:p._basename,_cat:p._cat,_cmdline_check:function(e){let t,n,r;return"undefined"==typeof window&&(t=i(),n=t[1],void 0===n&&(n=t.$0),r=_(n),r==e)},_dirname:d,_echo:function(e){console.log(e)},_error_display:function(e){let t;"object"==typeof error?(t="error"in e&&null!=e.error&&"message"in e.error?e.error.message:"shortMessage"in e?e.shortMessage:e,console.error(e)):(t=e,console.error(e)),b(t,0)},_ext_rm:p._ext_rm,_file_append:p._file_append,_file_exists:p._file_exists,_file_read:p._file_read,_file_write:p._file_write,_fs_worker_new:p._fs_worker_new,_fs_worker_start:p._fs_worker_start,_get_date_human:function(){const e=new Date;return`${e.getFullYear()}-${e.getMonth()}-${e.getDay()}T${e.getHours()}:${e.getMinutes()}+0000`},_globals:function(){app_name="",quiet="y"},_homedir_get:function(){let e;return"undefined"==typeof window&&void 0!==n.g&&(n.g.global,n.g),"undefined"!=typeof window&&(e="/home/user"),e},_json_display:p._json_display,_json_read:p._json_read,_lib_get:async function(){let e;return new Set,"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e="/usr/lib"),e},_ls:p._ls,_mkdir:p._mkdir,_mktemp:p._mktemp,_msg_info:w,_msg_error:b,_msg_warning:m,_msg_info_obj:function(e,t){let n;n=`${e}: '${t}'`,w(n)},_mv:p._mv,_path_join:y,_printf:function(e){"undefined"==typeof window&&(_stdout=process.stdout),"undefined"!=typeof window&&(_stdout=n(310)),_stdout.write(e)},_process_exit:l,_process_cwd:u,_pwd:f,_range:E,_rm:p._rm,_run:async function(e,t,n,r,i,o){let s,l,u;void 0!==t&&""!=t&&t!=[]||(l="No command given in input.",b(l,1));const f=t[0],h=t.slice(1,t.length);if(void 0!==e&&""!=e||(e="sync"),void 0!==n&&""!=n||(n=""),void 0!==r&&""!=r||(r="0"),void 0!==i&&""!=i||(i="spawn"),void 0!==o&&""!=o||(o=""),l=`Running '${f}' with arguments '${h}'.`,w(l),u="","async"==e){const e=function(e){u+=e.toString()},t=function(e){let t,n;return 0!=e?(n=`Process exited with code '${e}'`,b(n,1)):(n="Process exited normally.",w(n)),t=u.split("\n"),t},n=c(f,h);return n.stdout.on("data",e),n.on("close",t),s=u.split("\n"),w(s.length),s}if("sync"==e){if("spawn"==i)return s=a(f,h,{encoding:"utf-8"}).stdout.split("\n"),s;if("native"==i){if(0<r){_msg_timeout=`Timeout of length '${r}' ms reached for task '${n}'.`,_time_over=!1;try{if(new Promise((e,t)=>{setTimeout(()=>{},r,"hurr")}),""!=o){if(u=await Promise.race([S(r),f[o].apply(f,h)]),void 0===u)throw _msg_timeout}else u=await f.apply(f,h)}catch(e){_time_over=!0}return _time_over?void m(_msg_timeout):u}u=await f[o].apply(f,h)}}},_seq:function(e,t){let n,r;if(r=[],t<e)return _msg="Second argument 'end' is greater than first argument 'start', returning empty list.",m(_msg),r;for(n of(void 0===t&&(t=e,e=1),E(e,t+1)))r.push(n);return r},_sleep:S,_stat:g,_yargv_get:h}},314(e,t,n){const r=n(70)._os_tmpdir_get,i=n(816),o=i.readdirSync,s=i.existsSync,a=i.appendFileSync,c=i.readFileSync,l=i.writeFileSync,u=i.fsWorkerNew,f=i.fsWorkerStart,h=i.mkdtemp,p=i.statSync,d=JSON.parse,y=JSON.stringify,_=n(503),g=_.basename,v=_.dirname,m=_.join,w=_.parse;function b(e,t){return void 0!==t&&t!={}&&""!=t||(t={encoding:"utf8",flag:"r"}),c(e,t)}function E(e){let t;return t=m.apply(null,e),t}e.exports={_basename:function(e){let t;return t=g(e),t},_cat:b,_dirname:function(e){let t;return t=v(e),t},_ext_rm:function(e){let t,n,r;return t=w(e).dir,n=w(e).name,r=[t,n],E(r)},_file_append:function(e,t,n){a(e,t)},_file_exists:function(e){let t,n;return n=!1,t=s(e),t&&(n=!0),n},_file_read:b,_file_write:function(e,t,n){l(e,t)},_fs_worker_new:u,_fs_worker_start:f,_json_display:y,_json_read:function(e){let t,n;return t=b(e),n=d(t),n},_ls:function(e){return o.apply(null,[e])},_mkdir:i.mkdirSync,_mktemp:async function(e,t){const n=typeof t;if(void 0!==e&&""!=e||(e=`${r()}/`),"undefined"!=n&&""!=t&&"true"!=t||(t=!0),"false"==t&&(t=!1),t)try{const t=await h(e);return _msg=`Created directory '${t}'.`,_msg_info(_msg),t}catch(e){throw e}else _msg="It only supports creating temporary directories.",_msg_error(_msg,1)},_mv:i.renameSync,_path_join:E,_rm:i.rmSync,_stat:p}},70(e,t,n){function r(e){let t,n,r,i,o,s,a,c,l;void 0===e&&(a="Getting all values.",_msg_info("Getting all values."),e=""),t=[],s=window.location,c=s.search.substring(1),r=c.split("&");for(let s=0;s<r.length;s++)n=r[s],o=n.split("="),i=o[0],i!=e&&""!=e||(l=o[1],t.push(l));return t}e.exports={_argv_get:function(e){let t;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(t=r()),t},_argv_url_get:r,_child_process_spawn_get:function(e){let t;return void 0!==e&&""!=e||(e="sync"),"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(t=function(e,t,n){return n}),t},_os_tmpdir_get:function(){let e;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e=function(){return"/tmp"}),e},_process_exit_get:function(){let e;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e=function(e){return e}),e},_process_cwd_get:function(){let e;return e="undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"==typeof n?process.cwd:function(){return"."},e},_yargv_get:function(e){let t;const r={},i={};void 0!==e&&e!={}&&""!=e||(e={booleans:[],string:!0});const o=e.booleans;if("undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g){const s=n(Object(function(){var e=new Error("Cannot find module 'yargs'");throw e.code="MODULE_NOT_FOUND",e}()));_yargs_helpers_module=n(Object(function(){var e=new Error("Cannot find module 'yargs/helpers'");throw e.code="MODULE_NOT_FOUND",e}()));const a=_yargs_helpers_module.hideBin;if("string"in e&&e.string&&(r._={type:"string",string:!0},i["parse-numbers"]=!1,i["parse-positional-numbers"]=!1),o.length>0)for(t of o)r[t]={demand:!1,default:!1,type:"boolean"};return 0<o.length||e.string?s(a(process.argv)).parserConfiguration(i).options(r).string("_").parse():s(a(process.argv))}}}},7(e){"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}y(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,o,s,l;if(a(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,l=u,console&&console.warn&&console.warn(l)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):d(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function d(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function y(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){r.once&&e.removeEventListener(t,i),n(o)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var l=c.length,u=d(c,l);for(n=0;n<l;++n)r(u[n],this,t)}return!0},o.prototype.addListener=function(e,t){return l(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return l(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,o,s;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},816(e,t,n){function r(){let e;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e=function(){let e;try{e=n(10)}catch(e){console.log(e);const t="Error importing the '@themartiancompany/opfs' module as 'opfs'. If you got this error while bundling a webpack for a project depending on this module double check its 'webpack.config.js' file or whether the 'opfs' module is listed in developer dependencies and install them.I'm sorry for this inconvenience but Node packagement system does not currently distinguish 'development' from 'build' dependencies.";throw console.error(t),e}return e}()),e}const i=r();e.exports=i,e.exports.getModule=function(e){let t;if(""==_module_name||"undefined"==typeof _module_name)t=r();else if("opfs"==_module_name)t=_opfs_module_auto_detect();else{if("fs"!=_module_name){const e="Unknown file system module "+`'${_module_name}'.`.const;throw _error={msg:e},console.error(e),_error}t=n(816)}return t}},251(e,t){t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,l=c>>1,u=-7,f=n?i-1:0,h=n?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+e[t+f],f+=h,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=r;u>0;s=256*s+e[t+f],f+=h,u-=8);if(0===o)o=1-l;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=l}return(p?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,c,l=8*o-i-1,u=(1<<l)-1,f=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+f>=1?h/c:h*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=u?(a=0,s=u):s+f>=1?(a=(t*c-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[n+p]=255&s,p+=d,s/=256,l-=8);e[n+p-d]|=128*y}},698(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},10(e,t,n){const r=n(805),i=n(866),o=n(12);function s(e){let t;return void 0===e&&(e="fs-worker.js"),t=new i(e),t}_file=o.file,_read_stream_create=function(e,t){return _file(e).createReader()},e.exports=r,e.exports.fsWorkerNew=s,e.exports.fsWorkerStart=async function(e,t,n){let r,i,o,a;return void 0===e&&(e="fs-worker.js"),"Number"!=typeof t&&(t=10485760),"Number"!=typeof t&&(n=10485760),i=_fs.connectSyncAgent,a=s(e),o={worker:a,bufferLength:t,opTimeout:n},r=i(o),r},e.exports.createReadStream=_read_stream_create,e.exports.createWriteStream=function(e,t){return _file(e).createWriter()},e.exports.mkdtemp=r.mkTemp,e.exports.readdirSync=function(e){const t=_fs.readDirSync;return _return=t.apply(null,[e]).unwrap(),_return},e.exports.renameSync=function(e){const t=_fs.moveSync;return _return=t.apply(null,e).unwrap(),_return},e.exports.rmSync=function(e){const t=_fs.removeSync;return _return=t.apply(null,e).unwrap(),_return}},48(e){"use strict";var t={};function n(e,n,r){r||(r=Error);var i=function(e){var t,r;function i(t,r,i){return e.call(this,function(e,t,r){return"string"==typeof n?n:n(e,t,r)}(t,r,i))||this}return r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,i}(r);i.prototype.name=r.name,i.prototype.code=e,t[e]=i}function r(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(e,t,n){var i,o,s,a,c;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-9,n)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(r(t,"type"));else{var l=("number"!=typeof c&&(c=0),c+1>(a=e).length||-1===a.indexOf(".",c)?"argument":"property");s='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(r(t,"type"))}return s+". Received type ".concat(typeof n)},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},382(e,t,n){"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=l;var i=n(412),o=n(708);n(698)(l,i);for(var s=r(o.prototype),a=0;a<s.length;a++){var c=s[a];l.prototype[c]||(l.prototype[c]=o.prototype[c])}function l(e){if(!(this instanceof l))return new l(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||process.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},600(e,t,n){"use strict";e.exports=i;var r=n(610);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}n(698)(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},412(e,t,n){"use strict";var r;e.exports=k,k.ReadableState=S,n(7).EventEmitter;var i,o=function(e,t){return e.listeners(t).length},s=n(345),a=n(287).Buffer,c=(void 0!==n.g?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},l=n(838);i=l&&l.debuglog?l.debuglog("stream"):function(){};var u,f,h,p=n(726),d=n(896),y=n(291).getHighWaterMark,_=n(48).F,g=_.ERR_INVALID_ARG_TYPE,v=_.ERR_STREAM_PUSH_AFTER_EOF,m=_.ERR_METHOD_NOT_IMPLEMENTED,w=_.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(698)(k,s);var b=d.errorOrDestroy,E=["error","close","destroy","pause","resume"];function S(e,t,i){r=r||n(382),e=e||{},"boolean"!=typeof i&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=n(141).I),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function k(e){if(r=r||n(382),!(this instanceof k))return new k(e);var t=this instanceof r;this._readableState=new S(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function C(e,t,n,r,o){i("readableAddChunk",t);var s,l=e._readableState;if(null===t)l.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?x(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,j(e)))}}(e,l);else if(o||(s=function(e,t){var n,r;return r=t,a.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new g("chunk",["string","Buffer","Uint8Array"],t)),n}(l,t)),s)b(e,s);else if(l.objectMode||t&&t.length>0)if("string"==typeof t||l.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),r)l.endEmitted?b(e,new w):R(e,l,t,!0);else if(l.ended)b(e,new v);else{if(l.destroyed)return!1;l.reading=!1,l.decoder&&!n?(t=l.decoder.write(t),l.objectMode||0!==t.length?R(e,l,t,!1):O(e,l)):R(e,l,t,!1)}else r||(l.reading=!1,O(e,l));return!l.ended&&(l.length<l.highWaterMark||0===l.length)}function R(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&x(e)),O(e,t)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=d.destroy,k.prototype._undestroy=d.undestroy,k.prototype._destroy=function(e,t){t(e)},k.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=a.from(e,t),t=""),n=!0),C(this,e,t,!1,n)},k.prototype.unshift=function(e){return C(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){u||(u=n(141).I);var t=new u(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var T=1073741824;function A(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function x(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(j,e))}function j(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function O(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(F,e,t))}function F(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(i("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function P(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){i("readable nexttick read 0"),e.read(0)}function I(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function M(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(N,t,e))}function N(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function $(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}k.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):x(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&M(this),null;var r,o=t.needReadable;return i("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",o=!0),t.ended||t.reading?i("reading or ended",o=!1):o&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=A(n,t))),null===(r=e>0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&M(this)),null!==r&&this.emit("data",r),r},k.prototype._read=function(e){b(this,new m("_read()"))},k.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,i("pipe count=%d opts=%j",r.pipesCount,t);var s=t&&!1===t.end||e===process.stdout||e===process.stderr?d:a;function a(){i("onend"),e.end()}r.endEmitted?process.nextTick(s):n.once("end",s),e.on("unpipe",function t(o,s){i("onunpipe"),o===n&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,i("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",f),e.removeListener("unpipe",t),n.removeListener("end",a),n.removeListener("end",d),n.removeListener("data",u),l=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,B(e))}}(n);e.on("drain",c);var l=!1;function u(t){i("ondata");var o=e.write(t);i("dest.write",o),!1===o&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==$(r.pipes,e))&&!l&&(i("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function f(t){i("onerror",t),d(),e.removeListener("error",f),0===o(e,"error")&&b(e,t)}function h(){e.removeListener("finish",p),d()}function p(){i("onfinish"),e.removeListener("close",h),d()}function d(){i("unpipe"),n.unpipe(e)}return n.on("data",u),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",f),e.once("close",h),e.once("finish",p),e.emit("pipe",n),r.flowing||(i("pipe resume"),n.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=$(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},k.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,i("on readable",r.length,r.reading),r.length?x(this):r.reading||process.nextTick(L,this))),n},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(P,this),n},k.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(P,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(I,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",function(){if(i("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){i("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){i("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=n(955)),f(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=U,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(e,t){return void 0===h&&(h=n(157)),h(k,e,t)})},610(e,t,n){"use strict";e.exports=u;var r=n(48).F,i=r.ERR_METHOD_NOT_IMPLEMENTED,o=r.ERR_MULTIPLE_CALLBACK,s=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=r.ERR_TRANSFORM_WITH_LENGTH_0,c=n(382);function l(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new o);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);c.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush(function(t,n){h(e,t,n)})}function h(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}n(698)(u,c),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,n){n(new i("_transform()"))},u.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,function(e){t(e)})}},708(e,t,n){"use strict";function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var n=e.entry;for(e.entry=null;n;){var r=n.callback;t.pendingcb--,r(void 0),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=k,k.WritableState=S;var o,s={deprecate:n(643)},a=n(345),c=n(287).Buffer,l=(void 0!==n.g?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=n(896),f=n(291).getHighWaterMark,h=n(48).F,p=h.ERR_INVALID_ARG_TYPE,d=h.ERR_METHOD_NOT_IMPLEMENTED,y=h.ERR_MULTIPLE_CALLBACK,_=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,v=h.ERR_STREAM_NULL_VALUES,m=h.ERR_STREAM_WRITE_AFTER_END,w=h.ERR_UNKNOWN_ENCODING,b=u.errorOrDestroy;function E(){}function S(e,t,o){i=i||n(382),e=e||{},"boolean"!=typeof o&&(o=t instanceof i),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(process.nextTick(i,r),process.nextTick(j,e,t),e._writableState.errorEmitted=!0,b(e,r)):(i(r),e._writableState.errorEmitted=!0,b(e,r),j(e,t))}(e,n,r,t,i);else{var o=A(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||T(e,n),r?process.nextTick(R,e,n,o,i):R(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function k(e){var t=this instanceof(i=i||n(382));if(!t&&!o.call(k,this))return new k(e);this._writableState=new S(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),a.call(this)}function C(e,t,n,r,i,o,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function R(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),j(e,t)}function T(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,o=new Array(i),s=t.corkedRequestsFree;s.entry=n;for(var a=0,c=!0;n;)o[a]=n,n.isBuf||(c=!1),n=n.next,a+=1;o.allBuffers=c,C(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,u=n.encoding,f=n.callback;if(C(e,t,!1,t.objectMode?1:l.length,l,u,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function A(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final(function(n){t.pendingcb--,n&&b(e,n),t.prefinished=!0,e.emit("prefinish"),j(e,t)})}function j(e,t){var n=A(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(x,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}n(698)(k,a),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return!!o.call(this,e)||this===k&&e&&e._writableState instanceof S}})):o=function(e){return e instanceof this},k.prototype.pipe=function(){b(this,new _)},k.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,s=!i.objectMode&&(r=e,c.isBuffer(r)||r instanceof l);return s&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=E),i.ending?function(e,t){var n=new m;b(e,n),process.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i;return null===n?i=new v:"string"==typeof n||t.objectMode||(i=new p("chunk",["string","Buffer"],n)),!i||(b(e,i),process.nextTick(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,o){if(!n){var s=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,n)),t}(t,r,i);r!==s&&(n=!0,i="buffer",r=s)}var a=t.objectMode?1:r.length;t.length+=a;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,a,r,i,o);return l}(this,i,s,e,t,n)),o},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||T(this,e))},k.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,n){n(new d("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,j(e,t),n&&(t.finished?process.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=u.destroy,k.prototype._undestroy=u.undestroy,k.prototype._destroy=function(e,t){t(e)}},955(e,t,n){"use strict";var r;function i(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(238),s=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function d(e){var t=e[s];if(null!==t){var n=e[h].read();null!==n&&(e[u]=null,e[s]=null,e[a]=null,t(p(n,!1)))}}function y(e){process.nextTick(d,e)}var _=Object.getPrototypeOf(function(){}),g=Object.setPrototypeOf((i(r={get stream(){return this[h]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise(function(t,n){process.nextTick(function(){e[c]?n(e[c]):t(p(void 0,!0))})});var n,r=this[u];if(r)n=new Promise(function(e,t){return function(n,r){e.then(function(){t[l]?n(p(void 0,!0)):t[f](n,r)},r)}}(r,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(p(i,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,function(){return this}),i(r,"return",function(){var e=this;return new Promise(function(t,n){e[h].destroy(null,function(e){e?n(e):t(p(void 0,!0))})})}),r),_);e.exports=function(e){var t,n=Object.create(g,(i(t={},h,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,l,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var r=n[h].read();r?(n[u]=null,n[s]=null,n[a]=null,e(p(r,!1))):(n[s]=e,n[a]=t)},writable:!0}),t));return n[u]=null,o(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[a];return null!==t&&(n[u]=null,n[s]=null,n[a]=null,t(e)),void(n[c]=e)}var r=n[s];null!==r&&(n[u]=null,n[s]=null,n[a]=null,r(p(void 0,!0))),n[l]=!0}),e.on("readable",y.bind(null,n)),n}},726(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function o(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var c=n(287).Buffer,l=n(340).inspect,u=l&&l.custom||"inspect";function f(e,t,n){c.prototype.copy.call(e,t,n)}e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,n;return t=e,(n=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t=c.allocUnsafe(e>>>0),n=this.head,r=0;n;)f(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0===(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:u,value:function(e,t){return l(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},896(e){"use strict";function t(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,e)):process.nextTick(r,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!i&&e?o._writableState?o._writableState.errorEmitted?process.nextTick(n,o):(o._writableState.errorEmitted=!0,process.nextTick(t,o,e)):process.nextTick(t,o,e):i?(process.nextTick(n,o),i(e)):process.nextTick(n,o)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}},238(e,t,n){"use strict";var r=n(48).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,n,o){if("function"==typeof n)return e(t,null,n);n||(n={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(o||i);var s=n.readable||!1!==n.readable&&t.readable,a=n.writable||!1!==n.writable&&t.writable,c=function(){t.writable||u()},l=t._writableState&&t._writableState.finished,u=function(){a=!1,l=!0,s||o.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,f=!0,a||o.call(t)},p=function(e){o.call(t,e)},d=function(){var e;return s&&!f?(t._readableState&&t._readableState.ended||(e=new r),o.call(t,e)):a&&!l?(t._writableState&&t._writableState.ended||(e=new r),o.call(t,e)):void 0},y=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",d),t.req?y():t.on("request",y)):a&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",h),t.on("finish",u),!1!==n.error&&t.on("error",p),t.on("close",d),function(){t.removeListener("complete",u),t.removeListener("abort",d),t.removeListener("request",y),t.req&&t.req.removeListener("finish",u),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",u),t.removeListener("end",h),t.removeListener("error",p),t.removeListener("close",d)}}},157(e){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},758(e,t,n){"use strict";var r,i=n(48).F,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function c(e){e()}function l(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var u,f=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var h=t.map(function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",function(){a=!0}),void 0===r&&(r=n(238)),r(e,{readable:t,writable:i},function(e){if(e)return o(e);a=!0,o()});var c=!1;return function(t){if(!a&&!c)return c=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,function(e){u||(u=e),e&&h.forEach(c),o||(h.forEach(c),f(u))})});return t.reduce(l)}},291(e,t,n){"use strict";var r=n(48).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,n,i){var o=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(i?n:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},345(e,t,n){e.exports=n(7).EventEmitter},861(e,t,n){var r=n(287),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function s(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},71(e,t,n){const r=n(816);_write_stream_create=r.createWriteStream,_read_stream_create=r.createReadStream,_stat=r.stat;const i=n(104);_promise_reject=i.reject,_promise_resolve=i.resolve,_promisify=i.promisify,_map_series=i.mapSeries;const o=n(503);_basename=o.basename,_resolve=o.resolve,resolve=_resolve;const s=Math.ceil,a=Math.floor,c=Math.round;var l=function(){};l.prototype._input_file_check=function(e){let t,n,r;return e.isFile?e.size?void 0:(n="File is empty.",t=new Error(n),r=_promise_reject(t),r):(n="Given file is not valid.",t=new Error(n),r=_promise_reject(t),r)},l.prototype._parts_amount_check=function(e){let t,n,r;if(e<1)return n="Parameter 'parts' is invalid, must contain an integer value.",t=new Error("Parameter 'parts' is invalid, must contain an integer value."),r=_promise_reject(t),r},l.prototype._input_files_check=function(e){let t,n,r;if(e.length<=0)return n="Make sure you input an array with files as first parameter.",t=new Error("Make sure you input an array with files as first parameter."),r=_promise_reject(t),r},l.prototype._split_size_check=function(e){let t,n,r;if(e<1)return n="Too many parts, or file too small.",t=new Error("Too many parts, or file too small."),r=_promise_reject(t),r},l.prototype._split_file_callback_get=function(e,t,n,r){let i;return i=function(i){let o,s,c,u,f;if(o=l.prototype._input_file_check(i),void 0!==o)return o;if(f=i.size,s=a(f/t),u=l.prototype._split_size_check(s),void 0!==u)return u;c=s+f%t;for(let e=0;e<t;e++)r[e]={number:e+1,start:e*s,end:e*s+s},e===t-1&&(r[e].end=e*s+c);return l.prototype._split_file_main(e,r,n)},i},l.prototype._split_file_by_size_callback_get=function(e,t,n,r){let i;return i=function(r){let i,o,a,u,f;if(i=l.prototype._input_file_check(r),void 0!==i)return i;if(o=r.size,f=s(o/t),a=c(t),u=l.prototype._split_size_check(a),void 0!==u)return u;_target_partitions=[];for(let e=0;e<f;e++)_target_partitions[e]={number:e+1,start:e*a,end:e*a+a};return _target_partitions[_target_partitions.length-1].end=o,l.prototype._split_file_main(e,_target_partitions,n)},i},l.prototype._split_file=function(e,t,n){let r,i,o,s,a;return a=[],r=l.prototype._parts_amount_check(t),void 0!==r?r:(s=_promisify(_stat),i=l.prototype._split_file_callback_get(e,t,n,a),o=s(e).then(i),o)},l.prototype._split_file_by_size=function(e,t,n){let r,i,o;o=_promisify(_stat),i=l.prototype._split_file_by_size_callback_get(e,t,n,void 0),r=o(e).then(i)},l.prototype._merge_files=function(e,t){let n,r,o,s;return n=l.prototype._input_files_check(e),void 0!==n?n:(s=_write_stream_create(t,{encoding:null}),r=function(e){let t;return t=_merge_files_read_write_stream_node_promise_get(e,s),t},_writer_opfs=_write_stream_create(t,{encoding:null}),r=function(e){let t;return t=function(e,t){let n,r;return n=function(n,r){let i;i=_read_stream_create(e,{encoding:null}),i.pipe(t,{end:!1}),i.on("error",r),i.on("end",n)},r=new i(n),r}(e,_writer_opfs),t},o=_map_series(e,r).then(function(e,t){let n;return n=function(){let n;return t.close(),n=_promise_resolve(e),n},n}(t,_writer_opfs)),o)},l.prototype._split_file_main=function(e,t,n){const r=[];return _map_series(t,function(o){return function(e,t,n,r,o){let s,a,c;return _read_write_stream_promise_function=function(i,c){let l,u,f,h,p,d,y;d={encoding:null,start:r.start,end:r.end-1},p=_read_stream_create(e,d),y=String(n.length).length,l="";for(let e=0;e<y;e++)l+="0";h=""+r.number,_pad=l.substring(0,l.length-h.length),u=_pad+h,f=e+".sf-part"+u,_file_write_stream=function(e,t,n){let r;return r=function(r){const i=_write_stream_create(r),o=e.pipe(i);o.on("error",t),o.on("finish",n)},r}(p,c,i),t?(a=_basename(f),"/"!==t.charAt(t.length-1)&&(t+="/"),s=t+a):s=f,_file_write_stream(s),o.push(s)},c=new i(_read_write_stream_promise_function),c}(e,n,t,o,r)}).then(function(e){let t;return t=function(){let t;return t=_promise_resolve(e),t},t}(r))},e.exports=new l},310(e,t,n){e.exports=i;var r=n(7).EventEmitter;function i(){r.call(this)}n(698)(i,r),i.Readable=n(412),i.Writable=n(708),i.Duplex=n(382),i.Transform=n(610),i.PassThrough=n(600),i.finished=n(238),i.pipeline=n(758),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(n.on("end",a),n.on("close",c));var s=!1;function a(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(u(),0===r.listenerCount(this,"error"))throw e}function u(){n.removeListener("data",i),e.removeListener("drain",o),n.removeListener("end",a),n.removeListener("close",c),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",u),n.removeListener("close",u),e.removeListener("close",u)}return n.on("error",l),e.on("error",l),n.on("end",u),n.on("close",u),e.on("close",u),e.emit("pipe",n),e}},141(e,t,n){"use strict";var r=n(861).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=l,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function u(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.I=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=s(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},179(e,t,n){const r=n(71),i=r._split_file,o=r._split_file_by_size,s=n(368),a=s._basename,c=s._dirname,l=s._ls,u=s._msg_info,f=s._msg_error,h=s._mv;e.exports={_split:async function(e,t,n,r){let s,p;return"number"!=typeof n&&(s="Chunks amount must be a number.",f(s,1)),s=`Splitting '${e}' into '${n}' of size '${r}' into files with prefix '${t}':`,u(s),r=Number(r),n>0?await i(e,n):r>0&&await o(e,r),p=async function(e,t){let n,r,i,o,s;o=[];const u=`${a(e)}.sf-part`,f=c(e),p=l(f);for(n of p)n.startsWith(u)&&(s=n.replace(u,""),i=`${t}${s}`,r=[`${e}.sf-part${s}`,i],h(r),o.push(i));return o}(e,t),p}}},643(e,t,n){function r(e){try{if(!n.g.localStorage)return!1}catch(e){return!1}var t=n.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}},866(){},340(){},838(){},12(e,t){!function(e){"use strict";var t,n,r,i,o,s,a,c,l,u,f,h,p=e=>{throw TypeError(e)},d=(e,t,n)=>t.has(e)||p("Cannot "+n),y=(e,t,n)=>(d(e,t,"read from private field"),n?n.call(e):t.get(e)),_=(e,t,n)=>t.has(e)?p("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),g=(e,t,n,r)=>(d(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);const v="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIHUobil7aWYobj09PSIvIilyZXR1cm57cGFyZW50Om51bGwsbmFtZToiIn07Y29uc3QgZT1uLnNwbGl0KCIvIikuZmlsdGVyKGk9PmkubGVuZ3RoPjApO2lmKGUubGVuZ3RoPT09MCl0aHJvdyBFcnJvcigiSW52YWxpZCBwYXRoIik7Y29uc3QgYT1lW2UubGVuZ3RoLTFdLHI9Ii8iK2Uuc2xpY2UoMCwtMSkuam9pbigiLyIpO3JldHVybntuYW1lOmEscGFyZW50OnJ9fWFzeW5jIGZ1bmN0aW9uIHcobixlKXtjb25zdHtwYXJlbnQ6YSxuYW1lOnJ9PXUobik7aWYoYT09bnVsbClyZXR1cm4gYXdhaXQgbmF2aWdhdG9yLnN0b3JhZ2UuZ2V0RGlyZWN0b3J5KCk7Y29uc3QgaT1hLnNwbGl0KCIvIikuZmlsdGVyKHQ9PnQubGVuZ3RoPjApO3RyeXtsZXQgdD1hd2FpdCBuYXZpZ2F0b3Iuc3RvcmFnZS5nZXREaXJlY3RvcnkoKTtmb3IoY29uc3QgcyBvZiBpKXQ9YXdhaXQgdC5nZXREaXJlY3RvcnlIYW5kbGUocyx7Y3JlYXRlOmUuY3JlYXRlfSk7aWYoZS5pc0ZpbGUpcmV0dXJuIGF3YWl0IHQuZ2V0RmlsZUhhbmRsZShyLHtjcmVhdGU6ZS5jcmVhdGV9KX1jYXRjaCh0KXtpZih0Lm5hbWU9PT0iTm90Rm91bmRFcnJvciIpcmV0dXJuIG51bGw7dGhyb3cgdH19Y29uc3QgZj17fTtzZWxmLm9ubWVzc2FnZT1hc3luYyBuPT57dmFyIGk7Y29uc3R7ZXZ0VHlwZTplLGFyZ3M6YX09bi5kYXRhO2xldCByPWZbYS5maWxlSWRdO3RyeXtsZXQgdDtjb25zdCBzPVtdO2lmKGU9PT0icmVnaXN0ZXIiKXtjb25zdCBsPWF3YWl0IHcoYS5maWxlUGF0aCx7Y3JlYXRlOiEwLGlzRmlsZTohMH0pO2lmKGw9PW51bGwpdGhyb3cgRXJyb3IoYG5vdCBmb3VuZCBmaWxlOiAke2EuZmlsZUlkfWApO3I9YXdhaXQgbC5jcmVhdGVTeW5jQWNjZXNzSGFuZGxlKHttb2RlOmEubW9kZX0pLGZbYS5maWxlSWRdPXJ9ZWxzZSBpZihlPT09ImNsb3NlIilhd2FpdCByLmNsb3NlKCksZGVsZXRlIGZbYS5maWxlSWRdO2Vsc2UgaWYoZT09PSJ0cnVuY2F0ZSIpYXdhaXQgci50cnVuY2F0ZShhLm5ld1NpemUpO2Vsc2UgaWYoZT09PSJ3cml0ZSIpe2NvbnN0e2RhdGE6bCxvcHRzOm99PW4uZGF0YS5hcmdzO3Q9YXdhaXQgci53cml0ZShsLG8pfWVsc2UgaWYoZT09PSJyZWFkIil7Y29uc3R7b2Zmc2V0Omwsc2l6ZTpvfT1uLmRhdGEuYXJncyxnPW5ldyBVaW50OEFycmF5KG8pLGQ9YXdhaXQgci5yZWFkKGcse2F0Omx9KSxjPWcuYnVmZmVyO3Q9ZD09PW8/YzooKGk9Yy50cmFuc2Zlcik9PW51bGw/dm9pZCAwOmkuY2FsbChjLGQpKT8/Yy5zbGljZSgwLGQpLHMucHVzaCh0KX1lbHNlIGU9PT0iZ2V0U2l6ZSI/dD1hd2FpdCByLmdldFNpemUoKTplPT09ImZsdXNoIiYmYXdhaXQgci5mbHVzaCgpO3NlbGYucG9zdE1lc3NhZ2Uoe2V2dFR5cGU6ImNhbGxiYWNrIixjYklkOm4uZGF0YS5jYklkLHJldHVyblZhbDp0fSxzKX1jYXRjaCh0KXtjb25zdCBzPXQ7c2VsZi5wb3N0TWVzc2FnZSh7ZXZ0VHlwZToidGhyb3dFcnJvciIsY2JJZDpuLmRhdGEuY2JJZCxlcnJNc2c6cy5uYW1lKyI6ICIrcy5tZXNzYWdlK2AKYCtKU09OLnN0cmluZ2lmeShuLmRhdGEpfSl9fX0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPW9wZnMtd29ya2VyLUY0UldscWNfLmpzLm1hcAo=",m=typeof self<"u"&&self.Blob&&new Blob([(w=v,Uint8Array.from(atob(w),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var w;function b(e){let t;try{if(t=m&&(self.URL||self.webkitURL).createObjectURL(m),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker("data:text/javascript;base64,"+v,{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}async function E(e,t,n){const r=function(){if(S.length<3){const t=e();return S.push(t),t}{const e=S[k];return k=(k+1)%S.length,e}function e(){const e=new b;let t=0,n={};return e.onmessage=({data:e})=>{var t,r;"callback"===e.evtType?null==(t=n[e.cbId])||t.resolve(e.returnVal):"throwError"===e.evtType&&(null==(r=n[e.cbId])||r.reject(Error(e.errMsg))),delete n[e.cbId]},async function(r,i,o=[]){t+=1;const s=new Promise((e,r)=>{n[t]={resolve:e,reject:r}});return e.postMessage({cbId:t,evtType:r,args:i},o),s}}}();return await r("register",{fileId:e,filePath:t,mode:n}),{read:async(t,n)=>await r("read",{fileId:e,offset:t,size:n}),write:async(t,n)=>await r("write",{fileId:e,data:t,opts:n},[ArrayBuffer.isView(t)?t.buffer:t]),close:async()=>await r("close",{fileId:e}),truncate:async t=>await r("truncate",{fileId:e,newSize:t}),getSize:async()=>await r("getSize",{fileId:e}),flush:async()=>await r("flush",{fileId:e})}}const S=[];let k=0;function C(e){if("/"===e)return{parent:null,name:""};const t=e.split("/").filter(e=>e.length>0);if(0===t.length)throw Error("Invalid path");return{name:t[t.length-1],parent:"/"+t.slice(0,-1).join("/")}}async function R(e,t){const{parent:n,name:r}=C(e);if(null==n)return await navigator.storage.getDirectory();const i=n.split("/").filter(e=>e.length>0);try{let e=await navigator.storage.getDirectory();for(const n of i)e=await e.getDirectoryHandle(n,{create:t.create});return t.isFile?await e.getFileHandle(r,{create:t.create}):await e.getDirectoryHandle(r,{create:t.create})}catch(e){if("NotFoundError"===e.name)return null;throw e}}async function T(e){const{parent:t,name:n}=C(e);if(null==t){const e=await navigator.storage.getDirectory();for await(const t of e.keys())await e.removeEntry(t,{recursive:!0});return}const r=await R(t,{create:!1,isFile:!1});if(null!=r)try{await r.removeEntry(n,{recursive:!0})}catch(e){if("NotFoundError"===e.name)return;throw e}}function A(e,t){return`${e}/${t}`.replace("//","/")}function x(e){return new j(e)}t=new WeakMap,n=new WeakMap,r=new WeakMap;let j=class e{constructor(e){_(this,t),_(this,n),_(this,r),g(this,t,e);const{parent:i,name:o}=C(e);g(this,n,o),g(this,r,i)}get kind(){return"dir"}get name(){return y(this,n)}get path(){return y(this,t)}get parent(){return null==y(this,r)?null:x(y(this,r))}async create(){return await R(y(this,t),{create:!0,isFile:!1}),x(y(this,t))}async exists(){return await R(y(this,t),{create:!1,isFile:!1})instanceof FileSystemDirectoryHandle}async remove(e={}){for(const t of await this.children())try{await t.remove(e)}catch(e){console.warn(e)}try{await T(y(this,t))}catch(e){console.warn(e)}}async children(){const e=await R(y(this,t),{create:!1,isFile:!1});if(null==e)return[];const n=[];for await(const r of e.values())n.push(("file"===r.kind?F:x)(A(y(this,t),r.name)));return n}async copyTo(t){if(!await this.exists())throw Error(`dir ${this.path} not exists`);if(t instanceof e){const e=await t.exists()?x(A(t.path,this.name)):t;return await e.create(),await Promise.all((await this.children()).map(t=>t.copyTo(e))),e}if(t instanceof FileSystemDirectoryHandle)return await Promise.all((await this.children()).map(async e=>{"file"===e.kind?await e.copyTo(await t.getFileHandle(e.name,{create:!0})):await e.copyTo(await t.getDirectoryHandle(e.name,{create:!0}))})),null;throw Error("Illegal target type")}async moveTo(e){const t=await this.copyTo(e);return await this.remove(),t}};const O=new Map;function F(e,t="rw"){if("rw"===t){const n=O.get(e)??new I(e,t);return O.set(e,n),n}return new I(e,t)}async function P(e,t,n={overwrite:!0}){if(t instanceof I)return void await P(e,await t.stream(),n);const r=await(e instanceof I?e:F(e,"rw")).createWriter();try{if(n.overwrite&&await r.truncate(0),t instanceof ReadableStream){const e=t.getReader();for(;;){const{done:t,value:n}=await e.read();if(t)break;await r.write(n)}}else await r.write(t)}catch(e){throw e}finally{await r.close()}}let L=0;i=new WeakMap,o=new WeakMap,s=new WeakMap,a=new WeakMap,c=new WeakMap,l=new WeakMap,u=new WeakMap,f=new WeakMap,h=new WeakMap;let I=class e{constructor(e,t){_(this,i),_(this,o),_(this,s),_(this,a),_(this,c),_(this,l,0),_(this,u,async()=>{}),_(this,f,(()=>{let e=null;return()=>(g(this,l,y(this,l)+1),null!=e||(e=new Promise(async(t,n)=>{try{const n=await E(y(this,c),y(this,i),y(this,a));g(this,u,async()=>{null!=e&&(e=null,g(this,l,0),await n.close().catch(console.error))}),t([n,async()=>{g(this,l,y(this,l)-1),!(y(this,l)>0)&&(e=null,await n.close())}])}catch(e){n(e)}})),e)})()),_(this,h,!1),g(this,c,++L),g(this,i,e),g(this,a,{r:"read-only",rw:"readwrite","rw-unsafe":"readwrite-unsafe"}[t]);const{parent:n,name:r}=C(e);if(null==n)throw Error("Invalid path");g(this,s,r),g(this,o,n)}get kind(){return"file"}get path(){return y(this,i)}get name(){return y(this,s)}get parent(){return null==y(this,o)?null:x(y(this,o))}async createWriter(){if("read-only"===y(this,a))throw Error("file is read-only");if(y(this,h))throw Error("Other writer have not been closed");g(this,h,!0);try{const e=new TextEncoder,[t,n]=await y(this,f).call(this);let r=await t.getSize(),i=!1;return{write:async(n,o={})=>{if(i)throw Error("Writer is closed");const s="string"==typeof n?e.encode(n):n,a=o.at??r,c=s.byteLength;return r=a+c,await t.write(s,{at:a})},truncate:async e=>{if(i)throw Error("Writer is closed");await t.truncate(e),r>e&&(r=e)},flush:async()=>{if(i)throw Error("Writer is closed");await t.flush()},close:async()=>{if(i)throw Error("Writer is closed");i=!0,g(this,h,!1),await n()}}}catch(e){throw g(this,h,!1),e}}async createReader(){const[e,t]=await y(this,f).call(this);let n=!1,r=0;return{read:async(t,i={})=>{if(n)throw Error("Reader is closed");const o=i.at??r,s=await e.read(o,t);return r=o+s.byteLength,s},getSize:async()=>{if(n)throw Error("Reader is closed");return await e.getSize()},close:async()=>{n||(n=!0,await t())}}}async text(){return(new TextDecoder).decode(await this.arrayBuffer())}async arrayBuffer(){const e=await R(y(this,i),{create:!1,isFile:!0});return null==e?new ArrayBuffer(0):(await e.getFile()).arrayBuffer()}async stream(){const e=await this.getOriginFile();return null==e?new ReadableStream({pull:e=>{e.close()}}):e.stream()}async getOriginFile(){var e;return null==(e=await R(y(this,i),{create:!1,isFile:!0}))?void 0:e.getFile()}async getSize(){const e=await R(y(this,i),{create:!1,isFile:!0});return null==e?0:(await e.getFile()).size}async exists(){return await R(y(this,i),{create:!1,isFile:!0})instanceof FileSystemFileHandle}async remove(e={}){if(!0===e.force)return await y(this,u).call(this),await T(y(this,i)),void O.delete(y(this,i));if(y(this,l)>0)throw Error("exists unclosed reader/writer");await T(y(this,i))}async copyTo(t){if(t instanceof e)return t.path===this.path?this:(await P(t,this),t);if(t instanceof j){if(!await this.exists())throw Error(`file ${this.path} not exists`);return await this.copyTo(F(A(t.path,this.name)))}if(t instanceof FileSystemFileHandle)return await(await this.stream()).pipeTo(await t.createWritable()),null;throw Error("Illegal target type")}async moveTo(e){const t=await this.copyTo(e);return await this.remove(),t}};const B="/.opfs-tools-temp-dir";async function U(e){try{if("file"===e.kind){if(!await e.exists())return!0;const t=await e.createWriter();await t.truncate(0),await t.close(),await e.remove()}else await e.remove();return!0}catch(e){return console.warn(e),!1}}const M=[];let N=!1;(async function(){var e;!0!==globalThis.__opfs_tools_tmpfile_init__&&(globalThis.__opfs_tools_tmpfile_init__=!0,null!=globalThis.FileSystemDirectoryHandle&&null!=globalThis.FileSystemFileHandle&&null!=(null==(e=globalThis.navigator)?void 0:e.storage.getDirectory)&&(setInterval(async()=>{for(const e of await x(B).children()){const t=/^\d+-(\d+)$/.exec(e.name);(null==t||Date.now()-Number(t[1])>2592e5)&&await U(e)}},6e4),await async function(){if(null==globalThis.localStorage)return;const e="OPFS_TOOLS_EXPIRES_TMP_FILES";N||(N=!0,globalThis.addEventListener("unload",()=>{0!==M.length&&localStorage.setItem(e,`${localStorage.getItem(e)??""},${M.join(",")}`)}));let t=localStorage.getItem(e)??"";for(const e of t.split(","))0!==e.length&&await U(F(`${B}/${e}`))&&(t=t.replace(e,""));localStorage.setItem(e,t.replace(/,{2,}/g,","))}()))})(),e.dir=x,e.file=F,e.rollfile=function(e,t){let n=F(e),r=0,i=n.createWriter(),o=n.createReader();return{append:async e=>{const n=await i;r+=await n.write(e),r>=t&&await(async e=>{const t=await(await o).read(r,{at:Math.round(.3*r)});r=await e.write(t,{at:0}),await e.truncate(r)})(n)},text:n.text.bind(n),remove:async()=>{await(await o).close(),await(await i).close(),await n.remove()},getSize:async()=>r}},e.tmpfile=function(){const e=`${Math.random().toString().slice(2)}-${Date.now()}`;return M.push(e),F(`${B}/${e}`)},e.write=P,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}(t)},805(e,t,n){"use strict";n.r(t),n.d(t,{ABORT_ERROR:()=>R,CURRENT_DIR:()=>Xe,NOT_FOUND_ERROR:()=>Ye,ROOT_DIR:()=>qe,TIMEOUT_ERROR:()=>T,TMP_DIR:()=>Qe,appendFile:()=>Ct,appendFileSync:()=>mn,assertAbsolutePath:()=>Je,assertFileUrl:()=>Ke,connectSyncAgent:()=>sn,copy:()=>Rt,copySync:()=>wn,createFile:()=>yt,createFileSync:()=>un,deleteTemp:()=>Lt,deleteTempSync:()=>Sn,downloadFile:()=>Et,emptyDir:()=>Tt,emptyDirSync:()=>bn,exists:()=>At,existsSync:()=>En,generateTempPath:()=>ct,getFileDataByHandle:()=>dt,getSyncMessenger:()=>an,isDirectoryHandle:()=>ht,isFileHandle:()=>ft,isFileHandleLike:()=>pt,isOPFSSupported:()=>Ht,isTempPath:()=>lt,mkTemp:()=>Pt,mkTempSync:()=>kn,mkdir:()=>_t,mkdirSync:()=>fn,move:()=>xt,moveSync:()=>hn,pruneTemp:()=>It,pruneTempSync:()=>Cn,readBlobFile:()=>jt,readBlobFileSync:()=>Rn,readDir:()=>gt,readDirSync:()=>pn,readFile:()=>vt,readFileSync:()=>dn,readJsonFile:()=>Ot,readJsonFileSync:()=>Tn,readTextFile:()=>Ft,readTextFileSync:()=>An,remove:()=>mt,removeSync:()=>yn,setSyncMessenger:()=>cn,startSyncAgent:()=>on,stat:()=>wt,statSync:()=>_n,toFileSystemHandleLike:()=>ut,unzip:()=>Ut,unzipFromUrl:()=>Mt,unzipSync:()=>xn,uploadFile:()=>Nt,writeFile:()=>bt,writeFileSync:()=>vn,zip:()=>Dt,zipFromUrl:()=>Wt,zipSync:()=>jn});function r(e,t){if(!e)throw new Error("Invariant failed")}function i(e){if("string"!=typeof e)throw new TypeError(`Path must be a string, received "${JSON.stringify(e)}"`)}function o(e){return e=function(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function s(e,t){if(e.length<=1)return e;let n=e.length;for(let r=e.length-1;r>0&&t(e.charCodeAt(r));r--)n=r;return e.slice(0,n)}function a(e){return 47===e}function c(e,t=""){e instanceof URL&&(e=o(e)),function(e,t){if(i(e),0===e.length)return e;if("string"!=typeof t)throw new TypeError(`Suffix must be a string, received "${JSON.stringify(t)}"`)}(e,t);const n=function(e,t,n=0){let r=!1,i=e.length;for(let o=e.length-1;o>=n;--o)if(t(e.charCodeAt(o))){if(r){n=o+1;break}}else r||(r=!0,i=o+1);return e.slice(n,i)}(e,a),r=s(n,a);return t?function(e,t){if(t.length>=e.length)return e;const n=e.length-t.length;for(let r=t.length-1;r>=0;--r)if(e.charCodeAt(n+r)!==t.charCodeAt(r))return e;return e.slice(0,-t.length)}(r,t):r}function l(e){e instanceof URL&&(e=o(e)),function(e){i(e),e.length}(e);let t=-1,n=!1;for(let r=e.length-1;r>=1;--r)if(a(e.charCodeAt(r))){if(n){t=r;break}}else n=!0;return-1===t?a(e.charCodeAt(0))?"/":".":s(e.slice(0,t),a)}function u(e){e instanceof URL&&(e=o(e)),i(e);let t=-1,n=0,r=-1,s=!0,c=0;for(let i=e.length-1;i>=0;--i){const o=e.charCodeAt(i);if(a(o)){if(!s){n=i+1;break}}else-1===r&&(s=!1,r=i+1),46===o?-1===t?t=i:1!==c&&(c=1):-1!==t&&(c=-1)}return-1===t||-1===r||0===c||1===c&&t===r-1&&t===n+1?"":e.slice(t,r)}function f(e,...t){if(void 0===e)return".";e instanceof URL&&(e=o(e)),(t=e?[e,...t]:t).forEach(e=>i(e));const n=t.filter(e=>e.length>0).join("/");return""===n?".":function(e){e instanceof URL&&(e=o(e)),function(e){i(e),e.length}(e);const t=a(e.charCodeAt(0)),n=a(e.charCodeAt(e.length-1));return e=function(e,t,n,r){let i,o="",s=0,a=-1,c=0;for(let l=0;l<=e.length;++l){if(l<e.length)i=e.charCodeAt(l);else{if(r(i))break;i=47}if(r(i)){if(a===l-1||1===c);else if(a!==l-1&&2===c){if(o.length<2||2!==s||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2)){if(o.length>2){const e=o.lastIndexOf(n);-1===e?(o="",s=0):(o=o.slice(0,e),s=o.length-1-o.lastIndexOf(n)),a=l,c=0;continue}if(2===o.length||1===o.length){o="",s=0,a=l,c=0;continue}}t&&(o.length>0?o+=`${n}..`:o="..",s=2)}else o.length>0?o+=n+e.slice(a+1,l):o=e.slice(a+1,l),s=l-a-1;a=l,c=0}else 46===i&&-1!==c?++c:c=-1}return o}(e,!t,"/",a),0!==e.length||t||(e="."),e.length>0&&n&&(e+="/"),t?`/${e}`:e}(n)}const h=Symbol("Option kind"),p=Symbol("Result kind"),d=Promise.resolve(!0),y=Promise.resolve(!1);function _(e){const t=Object.freeze({[Symbol.toStringTag]:"Option",[h]:"Some",*[Symbol.iterator](){yield e},toString:()=>`Some(${e})`,isSome:()=>!0,isNone:()=>!1,isSomeAnd:t=>t(e),isSomeAndAsync:t=>Promise.resolve(t(e)),isNoneOr:t=>t(e),isNoneOrAsync:t=>Promise.resolve(t(e)),expect:t=>e,unwrap:()=>e,unwrapOr:t=>e,unwrapOrElse:t=>e,unwrapOrElseAsync:t=>Promise.resolve(e),okOr:t=>m(e),okOrElse:t=>m(e),transpose:()=>(S(e),e.isOk()?m(_(e.unwrap())):w(e.unwrapErr())),filter:n=>n(e)?t:g,flatten:()=>(E(e),e),map:t=>_(t(e)),mapOr:(t,n)=>n(e),mapOrElse:(t,n)=>n(e),zip:t=>(E(t),t.isSome()?_([e,t.unwrap()]):g),zipWith:(t,n)=>(E(t),t.isSome()?_(n(e,t.unwrap())):g),unzip(){const t=e;if(!Array.isArray(t)||2!==t.length)throw new TypeError("Option::unzip() requires a 2-element tuple, received "+(Array.isArray(t)?`array with ${t.length} elements`:typeof t));const[n,r]=t;return[_(n),_(r)]},reduce:(n,r)=>(E(n),n.isSome()?_(r(e,n.unwrap())):t),and:e=>(E(e),e),andThen:t=>t(e),andThenAsync:t=>Promise.resolve(t(e)),or:e=>t,orElse:e=>t,orElseAsync:e=>Promise.resolve(t),xor:e=>(E(e),e.isSome()?g:t),inspect:n=>(n(e),t),eq:t=>(E(t),t.isSome()&&t.unwrap()===e)});return t}const g=Object.freeze({[Symbol.toStringTag]:"Option",[h]:"None",*[Symbol.iterator](){},toString:()=>"None",isSome:()=>!1,isNone:()=>!0,isSomeAnd:e=>!1,isSomeAndAsync:e=>y,isNoneOr:e=>!0,isNoneOrAsync:e=>d,expect(e){throw new TypeError(e)},unwrap(){throw new TypeError("Option::unwrap() called on a `None` value")},unwrapOr:e=>e,unwrapOrElse:e=>e(),unwrapOrElseAsync:e=>Promise.resolve(e()),okOr:e=>w(e),okOrElse:e=>w(e()),transpose:()=>m(g),filter:e=>g,flatten:()=>g,map:e=>g,mapOr:(e,t)=>e,mapOrElse:(e,t)=>e(),zip:e=>g,zipWith:(e,t)=>g,unzip:()=>[g,g],reduce:(e,t)=>(E(e),e),and:e=>g,andThen:e=>g,andThenAsync:e=>v,or:e=>(E(e),e),orElse:e=>e(),orElseAsync:e=>Promise.resolve(e()),xor:e=>(E(e),e.isSome()?e:g),inspect:e=>g,eq:e=>(E(e),e===g)}),v=Promise.resolve(g);function m(e){const t=Object.freeze({[Symbol.toStringTag]:"Result",[p]:"Ok",*[Symbol.iterator](){yield e},toString:()=>`Ok(${e})`,isOk:()=>!0,isErr:()=>!1,isOkAnd:t=>t(e),isOkAndAsync:t=>Promise.resolve(t(e)),isErrAnd:e=>!1,isErrAndAsync:e=>y,expect:t=>e,unwrap:()=>e,unwrapOr:t=>e,unwrapOrElse:t=>e,unwrapOrElseAsync:t=>Promise.resolve(e),expectErr(t){throw new TypeError(`${t}: ${e}`)},unwrapErr(){throw new TypeError("Result::unwrapErr() called on an `Ok` value")},intoOk:()=>e,intoErr(){throw new TypeError("Result::intoErr() called on an `Ok` value")},ok:()=>_(e),err:()=>g,transpose:()=>(E(e),e.isSome()?_(m(e.unwrap())):g),map:t=>m(t(e)),mapErr:e=>t,mapOr:(t,n)=>n(e),mapOrElse:(t,n)=>n(e),flatten:()=>(S(e),e),and:e=>(S(e),e),or:e=>t,andThen:t=>t(e),andThenAsync:t=>Promise.resolve(t(e)),orElse:e=>t,orElseAsync:e=>Promise.resolve(t),inspect:n=>(n(e),t),inspectErr:e=>t,eq:t=>(S(t),t.isOk()&&t.unwrap()===e),asOk:()=>t,asErr(){throw new TypeError("Result::asErr() called on an `Ok` value")},andTryAsync(t){try{const n=t(e);return Promise.resolve(n).then(m,w)}catch(e){return Promise.resolve(w(e))}},orTryAsync:e=>Promise.resolve(t)});return t}function w(e){const t=Object.freeze({[Symbol.toStringTag]:"Result",[p]:"Err",*[Symbol.iterator](){},toString:()=>`Err(${e})`,isOk:()=>!1,isErr:()=>!0,isOkAnd:e=>!1,isOkAndAsync:e=>y,isErrAnd:t=>t(e),isErrAndAsync:t=>Promise.resolve(t(e)),expect(t){throw new TypeError(`${t}: ${e}`)},unwrap(){throw new TypeError("Result::unwrap() called on an `Err` value")},unwrapOr:e=>e,unwrapOrElse:t=>t(e),unwrapOrElseAsync:t=>Promise.resolve(t(e)),expectErr:t=>e,unwrapErr:()=>e,intoOk(){throw new TypeError("Result::intoOk() called on an `Err` value")},intoErr:()=>e,ok:()=>g,err:()=>_(e),transpose:()=>_(t),map:e=>t,mapErr:t=>w(t(e)),mapOr:(e,t)=>e,mapOrElse:(t,n)=>t(e),flatten:()=>t,and:e=>t,or:e=>(S(e),e),andThen:e=>t,andThenAsync:e=>Promise.resolve(t),orElse:t=>t(e),orElseAsync:t=>Promise.resolve(t(e)),inspect:e=>t,inspectErr:n=>(n(e),t),eq:t=>(S(t),t.isErr()&&t.unwrapErr()===e),asOk(){throw new TypeError("Result::asOk() called on an `Err` value")},asErr:()=>t,andTryAsync:e=>Promise.resolve(t),orTryAsync(t){try{const n=t(e);return Promise.resolve(n).then(m,w)}catch(e){return Promise.resolve(w(e))}}});return t}function b(e){try{return null===e?"null":void 0===e?"undefined":"object"==typeof e?Object.prototype.toString.call(e):String(e)}catch{return"[unable to stringify]"}}function E(e){if(!function(e){return null!=e&&"object"==typeof e&&h in e}(e))throw new TypeError(`Expected an Option, but received: ${b(e)}`)}function S(e){if(!function(e){return null!=e&&"object"==typeof e&&p in e}(e))throw new TypeError(`Expected a Result, but received: ${b(e)}`)}const k=m(!1),C=m(),R="AbortError",T="TimeoutError";var A=class extends Error{name="FetchError";status;constructor(e,t){super(e),this.status=t}};function x(e,t){const n=function(e){if(e instanceof URL)return e;try{return new URL(e,"undefined"!=typeof location?location.href:void 0)}catch{throw new TypeError(`Invalid URL: ${e}`)}}(e),r=t??{},{retries:i,delay:o,when:s,onRetry:a}=function(e){const{responseType:t,timeout:n,retry:r=0,onProgress:i,onChunk:o}=e;if(null!=t){const e=["text","arraybuffer","blob","json","bytes","stream"];if(!e.includes(t))throw new TypeError(`responseType must be one of ${e.join(", ")} but received ${t}`)}if(null!=n){if("number"!=typeof n)throw new TypeError("timeout must be a number but received "+typeof n);if(n<=0)throw new Error(`timeout must be a number greater than 0 but received ${n}`)}if(null!=i&&"function"!=typeof i)throw new TypeError("onProgress callback must be a function but received "+typeof i);if(null!=o&&"function"!=typeof o)throw new TypeError("onChunk callback must be a function but received "+typeof o);let s,a,c=0,l=0;if("number"==typeof r?c=r:r&&"object"==typeof r&&(c=r.retries??0,l=r.delay??0,s=r.when,a=r.onRetry),!Number.isInteger(c))throw new TypeError(`Retry count must be an integer but received ${c}`);if(c<0)throw new Error(`Retry count must be non-negative but received ${c}`);if("number"==typeof l){if(l<0)throw new Error(`Retry delay must be a non-negative number but received ${l}`)}else if("function"!=typeof l)throw new TypeError("Retry delay must be a number or a function but received "+typeof l);if(null!=s&&!Array.isArray(s)&&"function"!=typeof s)throw new TypeError("Retry when condition must be an array of status codes or a function but received "+typeof s);if(null!=a&&"function"!=typeof a)throw new TypeError("Retry onRetry callback must be a function but received "+typeof a);return{retries:c,delay:l,when:s,onRetry:a}}(r),{abortable:c=!1,responseType:l,timeout:u,onProgress:f,onChunk:h,...p}=r,d=p.signal;let y;c&&(y=new AbortController);const _=(e,t)=>"AbortError"!==e.name&&(s?Array.isArray(s)?e instanceof A&&s.includes(e.status):s(e,t):!(e instanceof A)),g=e=>"function"==typeof o?o(e):o,v=()=>{const e=[];d&&e.push(d),y&&e.push(y.signal),"number"==typeof u&&e.push(function(e){if("function"==typeof AbortSignal.timeout)return AbortSignal.timeout(e);const t=new AbortController,n=function(){const e="The operation timed out.";try{return new DOMException(e,T)}catch{const t=new Error(e);return t.name=T,t}}(),r=setTimeout(()=>{t.abort(n)},e);return"function"==typeof r?.unref&&r.unref(),t.signal}(u)),e.length>0&&(p.signal=1===e.length?e[0]:function(e){if("function"==typeof AbortSignal.any)return AbortSignal.any(e);const t=new AbortController;for(const n of e)if(n.aborted)return t.abort(n.reason),t.signal;const n=e=>{t.abort(e.target.reason)};for(const t of e)t.addEventListener("abort",n);return t.signal.addEventListener("abort",()=>{for(const t of e)t.removeEventListener("abort",n)}),t.signal}(e))},b=async()=>{v();try{const e=await fetch(n,p);return e.ok?await E(e):(e.body?.cancel().catch(()=>{}),w(new A(e.statusText,e.status)))}catch(e){return w(e instanceof Error?e:O(e))}},E=async e=>{switch(e.body&&(f||h)&&(async e=>{let t,n=0;if(f){const n=e.headers.get("content-length");if(null==n)try{f(w(new Error("No content-length in response headers")))}catch{}else t=Number.parseInt(n,10)}const r=e.clone().body;try{for await(const e of r){if(h)try{h(e)}catch{}if(f&&null!=t){n+=e.byteLength;try{f(m({totalByteLength:t,completedByteLength:n}))}catch{}}}}catch{}})(e),l){case"json":if(null==e.body)return m(null);try{return m(await e.json())}catch{return w(new Error("Response is invalid json while responseType is json"))}case"text":return m(await e.text());case"bytes":return"function"==typeof e.bytes?m(await e.bytes()):m(new Uint8Array(await e.arrayBuffer()));case"arraybuffer":return m(await e.arrayBuffer());case"blob":return m(await e.blob());case"stream":return m(e.body);default:return m(e)}},S=(async()=>{let e,t=0;do{if(t>0){if(y?.signal.aborted)return w(y.signal.reason);const n=g(t);if(n>0&&(await j(n),y?.signal.aborted))return w(y.signal.reason);try{a?.(e,t)}catch{}}const n=await b();if(n.isOk())return n;e=n.unwrapErr(),t++}while(t<=i&&_(e,t));return w(e)})();return c&&y?{abort(e){e instanceof Error?y.abort(e):null!=e?y.abort(O(e)):y.abort()},get aborted(){return y.signal.aborted},get result(){return S}}:S}function j(e){return new Promise(t=>setTimeout(t,e))}function O(e){const t=new Error("string"==typeof e?e:String(e));return t.name=R,t.cause=e,t}var F={},P=Uint8Array,L=Uint16Array,I=Int32Array,B=new P([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),U=new P([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),M=new P([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),N=function(e,t){for(var n=new L(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new I(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},$=N(B,2),D=$.b,W=$.r;D[28]=258,W[258]=28;for(var H=N(U,0),V=H.b,z=H.r,G=new L(32768),Z=0;Z<32768;++Z){var Y=(43690&Z)>>1|(21845&Z)<<1;Y=(61680&(Y=(52428&Y)>>2|(13107&Y)<<2))>>4|(3855&Y)<<4,G[Z]=((65280&Y)>>8|(255&Y)<<8)>>1}var q=function(e,t,n){for(var r=e.length,i=0,o=new L(t);i<r;++i)e[i]&&++o[e[i]-1];var s,a=new L(t);for(i=1;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new L(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],f=a[e[i]-1]++<<u,h=f|(1<<u)-1;f<=h;++f)s[G[f]>>c]=l}else for(s=new L(r),i=0;i<r;++i)e[i]&&(s[i]=G[a[e[i]-1]++]>>15-e[i]);return s},X=new P(288);for(Z=0;Z<144;++Z)X[Z]=8;for(Z=144;Z<256;++Z)X[Z]=9;for(Z=256;Z<280;++Z)X[Z]=7;for(Z=280;Z<288;++Z)X[Z]=8;var Q=new P(32);for(Z=0;Z<32;++Z)Q[Z]=5;var J=q(X,9,0),K=q(X,9,1),ee=q(Q,5,0),te=q(Q,5,1),ne=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},re=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},ie=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},oe=function(e){return(e+7)/8|0},se=function(e,t,n){return(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length),new P(e.subarray(t,n))},ae=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ce=function(e,t,n){var r=new Error(t||ae[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,ce),!n)throw r;return r},le=function(e,t,n,r){var i=e.length,o=r?r.length:0;if(!i||t.f&&!t.l)return n||new P(0);var s=!n,a=s||2!=t.i,c=t.i;s&&(n=new P(3*i));var l=function(e){var t=n.length;if(e>t){var r=new P(Math.max(2*t,e));r.set(n),n=r}},u=t.f||0,f=t.p||0,h=t.b||0,p=t.l,d=t.d,y=t.m,_=t.n,g=8*i;do{if(!p){u=re(e,f,1);var v=re(e,f+1,3);if(f+=3,!v){var m=e[(j=oe(f)+4)-4]|e[j-3]<<8,w=j+m;if(w>i){c&&ce(0);break}a&&l(h+m),n.set(e.subarray(j,w),h),t.b=h+=m,t.p=f=8*w,t.f=u;continue}if(1==v)p=K,d=te,y=9,_=5;else if(2==v){var b=re(e,f,31)+257,E=re(e,f+10,15)+4,S=b+re(e,f+5,31)+1;f+=14;for(var k=new P(S),C=new P(19),R=0;R<E;++R)C[M[R]]=re(e,f+3*R,7);f+=3*E;var T=ne(C),A=(1<<T)-1,x=q(C,T,1);for(R=0;R<S;){var j,O=x[re(e,f,A)];if(f+=15&O,(j=O>>4)<16)k[R++]=j;else{var F=0,L=0;for(16==j?(L=3+re(e,f,3),f+=2,F=k[R-1]):17==j?(L=3+re(e,f,7),f+=3):18==j&&(L=11+re(e,f,127),f+=7);L--;)k[R++]=F}}var I=k.subarray(0,b),N=k.subarray(b);y=ne(I),_=ne(N),p=q(I,y,1),d=q(N,_,1)}else ce(1);if(f>g){c&&ce(0);break}}a&&l(h+131072);for(var $=(1<<y)-1,W=(1<<_)-1,H=f;;H=f){var z=(F=p[ie(e,f)&$])>>4;if((f+=15&F)>g){c&&ce(0);break}if(F||ce(2),z<256)n[h++]=z;else{if(256==z){H=f,p=null;break}var G=z-254;if(z>264){var Z=B[R=z-257];G=re(e,f,(1<<Z)-1)+D[R],f+=Z}var Y=d[ie(e,f)&W],X=Y>>4;if(Y||ce(3),f+=15&Y,N=V[X],X>3&&(Z=U[X],N+=ie(e,f)&(1<<Z)-1,f+=Z),f>g){c&&ce(0);break}a&&l(h+131072);var Q=h+G;if(h<N){var J=o-N,ee=Math.min(N,Q);for(J+h<0&&ce(3);h<ee;++h)n[h]=r[J+h]}for(;h<Q;++h)n[h]=n[h-N]}}t.l=p,t.p=H,t.b=h,t.f=u,p&&(u=1,t.m=y,t.d=d,t.n=_)}while(!u);return h!=n.length&&s?se(n,0,h):n.subarray(0,h)},ue=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},fe=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},he=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return{t:me,l:0};if(1==i){var s=new P(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],l=0,u=1,f=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=n[n[l].f<n[f].f?l++:f++],c=n[l!=u&&n[l].f<n[f].f?l++:f++],n[u++]={s:-1,f:a.f+c.f,l:a,r:c};var h=o[0].s;for(r=1;r<i;++r)o[r].s>h&&(h=o[r].s);var p=new L(h+1),d=pe(n[u-1],p,0);if(d>t){r=0;var y=0,_=d-t,g=1<<_;for(o.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<i;++r){var v=o[r].s;if(!(p[v]>t))break;y+=g-(1<<d-p[v]),p[v]=t}for(y>>=_;y>0;){var m=o[r].s;p[m]<t?y-=1<<t-p[m]++-1:++r}for(;r>=0&&y;--r){var w=o[r].s;p[w]==t&&(--p[w],++y)}d=t}return{t:new P(p),l:d}},pe=function(e,t,n){return-1==e.s?Math.max(pe(e.l,t,n+1),pe(e.r,t,n+1)):t[e.s]=n},de=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new L(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return{c:n.subarray(0,r),n:t}},ye=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},_e=function(e,t,n){var r=n.length,i=oe(t+2);e[i]=255&r,e[i+1]=r>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},ge=function(e,t,n,r,i,o,s,a,c,l,u){ue(t,u++,n),++i[256];for(var f=he(i,15),h=f.t,p=f.l,d=he(o,15),y=d.t,_=d.l,g=de(h),v=g.c,m=g.n,w=de(y),b=w.c,E=w.n,S=new L(19),k=0;k<v.length;++k)++S[31&v[k]];for(k=0;k<b.length;++k)++S[31&b[k]];for(var C=he(S,7),R=C.t,T=C.l,A=19;A>4&&!R[M[A-1]];--A);var x,j,O,F,P=l+5<<3,I=ye(i,X)+ye(o,Q)+s,N=ye(i,h)+ye(o,y)+s+14+3*A+ye(S,R)+2*S[16]+3*S[17]+7*S[18];if(c>=0&&P<=I&&P<=N)return _e(t,u,e.subarray(c,c+l));if(ue(t,u,1+(N<I)),u+=2,N<I){x=q(h,p,0),j=h,O=q(y,_,0),F=y;var $=q(R,T,0);for(ue(t,u,m-257),ue(t,u+5,E-1),ue(t,u+10,A-4),u+=14,k=0;k<A;++k)ue(t,u+3*k,R[M[k]]);u+=3*A;for(var D=[v,b],W=0;W<2;++W){var H=D[W];for(k=0;k<H.length;++k){var V=31&H[k];ue(t,u,$[V]),u+=R[V],V>15&&(ue(t,u,H[k]>>5&127),u+=H[k]>>12)}}}else x=J,j=X,O=ee,F=Q;for(k=0;k<a;++k){var z=r[k];if(z>255){fe(t,u,x[257+(V=z>>18&31)]),u+=j[V+257],V>7&&(ue(t,u,z>>23&31),u+=B[V]);var G=31&z;fe(t,u,O[G]),u+=F[G],G>3&&(fe(t,u,z>>5&8191),u+=U[G])}else fe(t,u,x[z]),u+=j[z]}return fe(t,u,x[256]),u+j[256]},ve=new I([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),me=new P(0),we=function(e,t,n,r,i,o){var s=o.z||e.length,a=new P(r+s+5*(1+Math.ceil(s/7e3))+i),c=a.subarray(r,a.length-i),l=o.l,u=7&(o.r||0);if(t){u&&(c[0]=o.r>>3);for(var f=ve[t-1],h=f>>13,p=8191&f,d=(1<<n)-1,y=o.p||new L(32768),_=o.h||new L(d+1),g=Math.ceil(n/3),v=2*g,m=function(t){return(e[t]^e[t+1]<<g^e[t+2]<<v)&d},w=new I(25e3),b=new L(288),E=new L(32),S=0,k=0,C=o.i||0,R=0,T=o.w||0,A=0;C+2<s;++C){var x=m(C),j=32767&C,O=_[x];if(y[j]=O,_[x]=j,T<=C){var F=s-C;if((S>7e3||R>24576)&&(F>423||!l)){u=ge(e,c,0,w,b,E,k,R,A,C-A,u),R=S=k=0,A=C;for(var M=0;M<286;++M)b[M]=0;for(M=0;M<30;++M)E[M]=0}var N=2,$=0,D=p,H=j-O&32767;if(F>2&&x==m(C-H))for(var V=Math.min(h,F)-1,G=Math.min(32767,C),Z=Math.min(258,F);H<=G&&--D&&j!=O;){if(e[C+N]==e[C+N-H]){for(var Y=0;Y<Z&&e[C+Y]==e[C+Y-H];++Y);if(Y>N){if(N=Y,$=H,Y>V)break;var q=Math.min(H,Y-2),X=0;for(M=0;M<q;++M){var Q=C-H+M&32767,J=Q-y[Q]&32767;J>X&&(X=J,O=Q)}}}H+=(j=O)-(O=y[j])&32767}if($){w[R++]=268435456|W[N]<<18|z[$];var K=31&W[N],ee=31&z[$];k+=B[K]+U[ee],++b[257+K],++E[ee],T=C+N,++S}else w[R++]=e[C],++b[e[C]]}}for(C=Math.max(C,T);C<s;++C)w[R++]=e[C],++b[e[C]];u=ge(e,c,l,w,b,E,k,R,A,C-A,u),l||(o.r=7&u|c[u/8|0]<<3,u-=7,o.h=_,o.p=y,o.i=C,o.w=T)}else{for(C=o.w||0;C<s+l;C+=65535){var te=C+65535;te>=s&&(c[u/8|0]=l,te=s),u=_e(c,u+1,e.subarray(C,te))}o.i=s}return se(a,0,r+oe(u)+i)},be=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&-306674912)^n>>>1;e[t]=n}return e}(),Ee=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new P(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return we(e,null==t.level?6:t.level,null==t.mem?i.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,n,r,i)},Se=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},ke=function(e,t,n){for(var r=e(),i=e.toString(),o=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<r.length;++s){var a=r[s],c=o[s];if("function"==typeof a){t+=";"+c+"=";var l=a.toString();if(a.prototype)if(-1!=l.indexOf("[native code]")){var u=l.indexOf(" ",8)+1;t+=l.slice(u,l.indexOf("(",u))}else for(var f in t+=l,a.prototype)t+=";"+c+".prototype."+f+"="+a.prototype[f].toString();else t+=l}else n[c]=a}return t},Ce=[],Re=function(){return[P,L,I,B,U,M,D,V,K,te,G,ae,q,ne,re,ie,oe,se,ce,le,Be,Ae,xe]},Te=function(){return[P,L,I,B,U,M,W,z,J,X,ee,Q,G,ve,me,q,ue,fe,he,pe,de,ye,_e,ge,oe,se,we,Ee,Ie,Ae]},Ae=function(e){return postMessage(e,[e.buffer])},xe=function(e){return e&&{out:e.size&&new P(e.size),dictionary:e.dictionary}},je=function(e,t,n,r,i,o){var s=function(e,t,n,r){if(!Ce[n]){for(var i="",o={},s=e.length-1,a=0;a<s;++a)i=ke(e[a],i,o);Ce[n]={c:ke(e[s],i,o),e:o}}var c=Se({},Ce[n].e);return function(e,t,n,r,i){var o=new Worker(F[t]||(F[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(e){var t=e.data,n=t.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],i(r,null)}else i(null,t)},o.postMessage(n,r),o}(Ce[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,c,function(e){var t=[];for(var n in e)e[n].buffer&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t}(c),r)}(n,r,i,function(e,t){s.terminate(),o(e,t)});return s.postMessage([e,t],t.consume?[e.buffer]:[]),function(){s.terminate()}},Oe=function(e,t){return e[t]|e[t+1]<<8},Fe=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},Pe=function(e,t){return Fe(e,t)+4294967296*Fe(e,t+4)},Le=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Ie(e,t){return Ee(e,t||{},0,0)}function Be(e,t){return le(e,{i:2},t&&t.out,t&&t.dictionary)}var Ue=function(e,t,n,r){for(var i in e){var o=e[i],s=t+i,a=r;Array.isArray(o)&&(a=Se(r,o[1]),o=o[0]),ArrayBuffer.isView(o)?n[s]=[o,a]:(n[s+="/"]=[new P(0),a],Ue(o,s,n,r))}},Me="undefined"!=typeof TextEncoder&&new TextEncoder,Ne="undefined"!=typeof TextDecoder&&new TextDecoder;try{Ne.decode(me,{stream:!0})}catch(e){}function $e(e,t){if(t){for(var n=new P(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(Me)return Me.encode(e);var i=e.length,o=new P(e.length+(e.length>>1)),s=0,a=function(e){o[s++]=e};for(r=0;r<i;++r){if(s+5>o.length){var c=new P(s+8+(i-r<<1));c.set(o),o=c}var l=e.charCodeAt(r);l<128||t?a(l):l<2048?(a(192|l>>6),a(128|63&l)):l>55295&&l<57344?(a(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++r))>>18),a(128|l>>12&63),a(128|l>>6&63),a(128|63&l)):(a(224|l>>12),a(128|l>>6&63),a(128|63&l))}return se(o,0,s)}function De(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(Ne)return Ne.decode(e);var i=function(e){for(var t="",n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:se(e,n-1)};i?3==i?(r=((15&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,t+=String.fromCharCode(55296|r>>10,56320|1023&r)):t+=1&i?String.fromCharCode((31&r)<<6|63&e[n++]):String.fromCharCode((15&r)<<12|(63&e[n++])<<6|63&e[n++]):t+=String.fromCharCode(r)}}(e),o=i.s;return(n=i.r).length&&ce(8),o}var We=function(e,t,n,r,i,o,s){var a=4294967295==i,c=4294967295==o,l=4294967295==s,u=t+n;if(r&&a+c+l){for(;t+4<u;t+=4+Oe(e,t+2))if(1==Oe(e,t))return[a?Pe(e,t+4+8*c):i,c?Pe(e,t+4):o,l?Pe(e,t+4+8*(c+a)):s,1];r<2&&ce(13)}return[i,o,s,0]},He=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&ce(9),t+=r+4}return t},Ve=function(e,t,n,r,i,o,s,a){var c=r.length,l=n.extra,u=a&&a.length,f=He(l);Le(e,t,null!=s?33639248:67324752),t+=4,null!=s&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(o<0&&8),e[t++]=i&&8,e[t++]=255&n.compression,e[t++]=n.compression>>8;var h=new Date(null==n.mtime?Date.now():n.mtime),p=h.getFullYear()-1980;if((p<0||p>119)&&ce(10),Le(e,t,p<<25|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>1),t+=4,-1!=o&&(Le(e,t,n.crc),Le(e,t+4,o<0?-o-2:o),Le(e,t+8,n.size)),Le(e,t+12,c),Le(e,t+14,f),t+=16,null!=s&&(Le(e,t,u),Le(e,t+6,n.attrs),Le(e,t+10,s),t+=14),e.set(r,t),t+=c,f)for(var d in l){var y=l[d],_=y.length;Le(e,t,+d),Le(e,t+2,_),e.set(y,t+4),t+=4+_}return u&&(e.set(a,t),t+=u),t};function ze(e,t,n){n||(n=t,t={}),"function"!=typeof n&&ce(7);var r={};Ue(e,"",r,t);var i=Object.keys(r),o=i.length,s=0,a=0,c=o,l=new Array(o),u=[],f=function(){for(var e=0;e<u.length;++e)u[e]()},h=function(e,t){Ge(function(){n(e,t)})};Ge(function(){h=n});var p=function(){var e=new P(a+22),t=s,n=a-s;a=0;for(var r=0;r<c;++r){var i=l[r];try{var o=i.c.length;Ve(e,a,i,i.f,i.u,o);var u=30+i.f.length+He(i.extra),f=a+u;e.set(i.c,f),Ve(e,s,i,i.f,i.u,o,a,i.m),s+=16+u+(i.m?i.m.length:0),a=f+o}catch(e){return h(e,null)}}(function(e,t,n,r,i){Le(e,t,101010256),Le(e,t+8,n),Le(e,t+10,n),Le(e,t+12,r),Le(e,t+16,i)})(e,s,l.length,n,t),h(null,e)};o||p();for(var d=function(e){var t=i[e],n=r[t],c=n[0],d=n[1],y=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=be[255&n^t[r]]^n>>>8;e=n},d:function(){return~e}}}(),_=c.length;y.p(c);var g=$e(t),v=g.length,m=d.comment,w=m&&$e(m),b=w&&w.length,E=He(d.extra),S=0==d.level?0:8,k=function(n,r){if(n)f(),h(n,null);else{var i=r.length;l[e]=Se(d,{size:_,crc:y.d(),c:r,f:g,m:w,u:v!=t.length||w&&m.length!=b,compression:S}),s+=30+v+E+i,a+=76+2*(v+E)+(b||0)+i,--o||p()}};if(v>65535&&k(ce(11,0,1),null),S)if(_<16e4)try{k(null,Ie(c,d))}catch(e){k(e,null)}else u.push(function(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&ce(7),je(e,t,[Te],function(e){return Ae(Ie(e.data[0],e.data[1]))},0,n)}(c,d,k));else k(null,c)},y=0;y<c;++y)d(y);return f}var Ge="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(e){e()};class Ze{resolve;reject;promise;constructor(){if("function"==typeof Promise.withResolvers){const{promise:e,resolve:t,reject:n}=Promise.withResolvers();this.promise=e,this.resolve=t,this.reject=n}else this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}const Ye="NotFoundError",qe="/",Xe=".",Qe="/tmp";function Je(e){r("string"==typeof e),r(e[0]===qe)}function Ke(e){r("string"==typeof e)}let et;function tt(e){return e===qe}async function nt(e,t,n){try{return m(await e.getDirectoryHandle(t,n))}catch(n){const r=n,i=new Error(`${r.name}: ${r.message} When get child directory '${t}' from directory '${e.name||qe}'.`);return i.name=r.name,w(i)}}async function rt(e,t){let n=await async function(){return et??=await navigator.storage.getDirectory(),et}();if(tt(e))return m(n);let r=e.slice(1);for(;r;){let e="";const i=r.indexOf("/");if(-1===i)e=r,r="";else if(e=r.slice(0,i),r=r.slice(i+1),0===i)continue;const o=await nt(n,e,t);if(o.isErr())return o;n=o.unwrap()}return m(n)}async function it(e,t){const n=t?.create??!1,r=l(e),i=c(e);return(await rt(r,{create:n})).andThenAsync(e=>async function(e,t,n){try{return m(await e.getFileHandle(t,n))}catch(n){const r=n,i=new Error(`${r.name}: ${r.message} When get child file '${t}' from directory '${e.name||qe}'.`);return i.name=r.name,w(i)}}(e,i,{create:n}))}function ot(e){return e.name===Ye}async function st(e){const t=(await Promise.all(e)).find(e=>e.isErr());return t??C}function at(){const e=new Error;return e.name=R,e}function ct(e){const{isDirectory:t=!1,basename:n="tmp",extname:r=""}=e??{},i=t?"":r;return f(Qe,`${n?`${n}-`:""}${crypto.randomUUID()}${i}`)}function lt(e){return e.startsWith(`${Qe}/`)}async function ut(e){const{name:t,kind:n}=e;if(ft(e)){const r=await e.getFile(),{size:i,lastModified:o,type:s}=r;return{name:t,kind:n,type:s,size:i,lastModified:o}}return{name:t,kind:n}}function ft(e){return"file"===e.kind}function ht(e){return"directory"===e.kind}function pt(e){return"file"===e.kind}async function dt(e){const t=await e.getFile(),n=await t.arrayBuffer();return new Uint8Array(n)}async function yt(e){return Je(e),(await it(e,{create:!0})).and(C)}async function _t(e){return Je(e),(await rt(e,{create:!0})).and(C)}async function gt(e,t){async function*n(r,i){const o=r.entries();for await(const[s,a]of o){const o=i===e?s:f(i,s);yield{path:o,handle:a},ht(a)&&t?.recursive&&(yield*n(await r.getDirectoryHandle(s),o))}}return Je(e),(await rt(e)).andThen(t=>m(n(t,e)))}async function vt(e,t){return Je(e),(await it(e)).andThenAsync(async e=>{const n=await e.getFile();switch(t?.encoding){case"blob":return m(n);case"utf8":return m(await n.text());default:return m(await n.arrayBuffer())}})}async function mt(e){Je(e);const t=l(e),n=c(e),r=await rt(t);return(await r.andThenAsync(async e=>{try{tt(t)&&tt(n)?await e.remove({recursive:!0}):await e.removeEntry(n,{recursive:!0})}catch(e){return w(e)}return C})).orElse(e=>ot(e)?C:w(e))}async function wt(e){Je(e);const t=l(e),n=c(e),r=await rt(t);return n?r.andThenAsync(async t=>{for await(const[e,r]of t.entries())if(e===n)return m(r);const r=new Error(`${Ye}: '${n}' does not exist. Full path is '${e}'.`);return r.name=Ye,w(r)}):r}async function bt(e,t,n){Je(e);const{append:r=!1,create:i=!0}=n??{};return(await it(e,{create:i})).andThenAsync(async e=>{const n=await e.createWritable({keepExistingData:r}),i={type:"write",data:t};if(r){const{size:t}=await e.getFile();i.position=t}return await n.write(i),await n.close(),C})}function Et(e,t,n){let r,i;Ke(e),i=!1,"string"==typeof t?Je(t):(n=t,t=ct({extname:u(e)}),i=!0),r=!1;const o=x(e,{redirect:"follow",...n,abortable:!0}),s=(async()=>(await o.response).andThenAsync(async e=>{const n=await e.blob();return r?w(at()):(await bt(t,n)).and(m(e))}))();return{abort(e){r=!0,o.abort(e)},get aborted(){return r},get response(){return i?s.then(e=>e.map(e=>({tempFilePath:t,rawResponse:e}))):s}}}async function St(e,t){const n=l(t);return(await rt(n,{create:!0})).andThenAsync(async n=>{const r=c(t);try{return await e.move(n,r),C}catch(e){return w(e)}})}async function kt(e,t,n,r=!0){return Je(t),(await wt(e)).andThenAsync(async i=>{let o;o=!1;const s=await wt(t);if(s.isErr()){if(!ot(s.unwrapErr()))return s.asErr()}else{o=!0;const e=s.unwrap();if(!(ft(i)&&ft(e)||ht(i)&&ht(e)))return w(new Error("Both 'srcPath' and 'destPath' must both be a file or directory."))}return ft(i)?r||!o?await n(i,t):C:(await gt(e,{recursive:!0})).andThenAsync(async e=>{const i=[_t(t)];for await(const{path:s,handle:a}of e){const e=f(t,s);let c=!1;if(o){const t=await At(e);if(t.isErr()){i.push(Promise.resolve(t.asErr()));continue}c=t.unwrap()}const l=ft(a)?r||!c?n(a,e):Promise.resolve(C):_t(e);i.push(l)}return st(i)})})}function Ct(e,t){return bt(e,t,{append:!0})}async function Rt(e,t,n){const{overwrite:r=!0}=n??{};return kt(e,t,async(e,t)=>await bt(t,await e.getFile()),r)}async function Tt(e){const t=await gt(e);if(t.isErr())return ot(t.unwrapErr())?_t(e):t.asErr();const n=[];for await(const{path:r}of t.unwrap())n.push(mt(f(e,r)));return st(n)}async function At(e,t){const{isDirectory:n=!1,isFile:i=!1}=t??{};r(!(n&&i));const o=await wt(e);return o.andThen(e=>m(!(n&&ft(e)||i&&ht(e)))).orElse(e=>ot(e)?k:o.asErr())}async function xt(e,t,n){const{overwrite:r=!0}=n??{};return(await kt(e,t,St,r)).andThenAsync(()=>mt(e))}function jt(e){return vt(e,{encoding:"blob"})}async function Ot(e){return(await Ft(e)).andThenAsync(async e=>{try{return m(JSON.parse(e))}catch(e){return w(e)}})}function Ft(e){return vt(e,{encoding:"utf8"})}async function Pt(e){const{isDirectory:t=!1}=e??{},n=ct(e);return(await(t?_t:yt)(n)).and(m(n))}function Lt(){return mt(Qe)}async function It(e){return r(e instanceof Date),(await gt(Qe,{recursive:!0})).andThenAsync(async t=>{try{for await(const{handle:n}of t)ft(n)&&(await n.getFile()).lastModified<=e.getTime()&&await n.remove()}catch(e){return w(e)}return C})}async function Bt(e,t){const n=new Uint8Array(e),r=new Ze;return function(e,t,n){n||(n=t,t={}),"function"!=typeof n&&ce(7);var r=[],i=function(){for(var e=0;e<r.length;++e)r[e]()},o={},s=function(e,t){Ge(function(){n(e,t)})};Ge(function(){s=n});for(var a=e.length-22;101010256!=Fe(e,a);--a)if(!a||e.length-a>65558)return s(ce(13,0,1),null),i;var c=Oe(e,a+8);if(c){var l=c,u=Fe(e,a+16),f=117853008==Fe(e,a-20);if(f){var h=Fe(e,a-12);(f=101075792==Fe(e,h))&&(l=c=Fe(e,h+32),u=Fe(e,h+48))}for(var p=t&&t.filter,d=function(t){var n=function(e,t,n){var r=Oe(e,t+28),i=Oe(e,t+30),o=De(e.subarray(t+46,t+46+r),!(2048&Oe(e,t+8))),s=t+46+r,a=We(e,s,i,n,Fe(e,t+20),Fe(e,t+24),Fe(e,t+42)),c=a[0],l=a[1],u=a[2];return[Oe(e,t+10),c,l,o,s+i+Oe(e,t+32),u]}(e,u,f),a=n[0],l=n[1],h=n[2],d=n[3],y=n[4],_=n[5],g=function(e,t){return t+30+Oe(e,t+26)+Oe(e,t+28)}(e,_);u=y;var v=function(e,t){e?(i(),s(e,null)):(t&&(o[d]=t),--c||s(null,o))};if(!p||p({name:d,size:l,originalSize:h,compression:a}))if(a)if(8==a){var m=e.subarray(g,g+l);if(h<524288||l>.8*h)try{v(null,Be(m,{out:new P(h)}))}catch(e){v(e,null)}else r.push(function(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&ce(7),je(e,t,[Re],function(e){return Ae(Be(e.data[0],xe(e.data[1])))},1,n)}(m,{size:h},v))}else v(ce(14,"unknown compression type "+a,1),null);else v(null,se(e,g,g+l));else v(null,null)},y=0;y<l;++y)d()}else s(null,{})}(n,async(e,n)=>{if(e)return void r.resolve(w(e));const i=[];for(const e in n)"/"!==e.at(-1)&&i.push(bt(f(t,e),n[e]));r.resolve(st(i))}),await r.promise}async function Ut(e,t){return Je(t),(await vt(e)).andThenAsync(e=>Bt(e,t))}async function Mt(e,t,n){return Ke(e),Je(t),(await x(e,{redirect:"follow",...n,responseType:"arraybuffer",abortable:!1})).andThenAsync(e=>Bt(e,t))}function Nt(e,t,n){let r,i;Ke(t),r=!1;const o=(async()=>(await jt(e)).andThenAsync(async o=>{if(r)return w(at());const{filename:s=c(e),...a}=n??{},l=new FormData;return l.append(s,o,s),i=x(t,{method:"POST",...a,abortable:!0,body:l}),i.response}))();return{abort(e){r=!0,i?.abort(e)},get aborted(){return r},get response(){return o}}}async function $t(e,t){const n=new Ze;return ze(e,{consume:!0},async(e,r)=>{if(e)n.resolve(w(e));else if(t){const e=await bt(t,r);n.resolve(e)}else n.resolve(m(r))}),await n.promise}async function Dt(e,t,n){return"string"==typeof t?Je(t):(n=t,t=void 0),(await wt(e)).andThenAsync(async r=>{const i=c(e),o={};if(ft(r)){const e=await dt(r);o[i]=e}else{const t=await gt(e,{recursive:!0});if(t.isErr())return t.asErr();const r=n?.preserveRoot??!0;for await(const{path:e,handle:n}of t.unwrap())if(ft(n)){const t=r?f(i,e):e,s=await dt(n);o[t]=s}}return $t(o,t)})}async function Wt(e,t,n){return Ke(e),"string"==typeof t?Je(t):(n=t,t=void 0),(await x(e,{redirect:"follow",...n,responseType:"arraybuffer",abortable:!1})).andThenAsync(n=>{const r={};return r[c(e)]=new Uint8Array(n),$t(r,t)})}function Ht(){return"function"==typeof navigator?.storage?.getDirectory}function Vt(e){return e?{name:e.name,message:e.message}:e}async function zt(e){const t=await e.arrayBuffer();return{name:e.name,type:e.type,lastModified:e.lastModified,size:t.byteLength,data:t}}let Gt=1e3;var Zt=(e=>(e[e.createFile=0]="createFile",e[e.mkdir=1]="mkdir",e[e.move=2]="move",e[e.readDir=3]="readDir",e[e.remove=4]="remove",e[e.stat=5]="stat",e[e.writeFile=6]="writeFile",e[e.appendFile=7]="appendFile",e[e.copy=8]="copy",e[e.emptyDir=9]="emptyDir",e[e.exists=10]="exists",e[e.deleteTemp=11]="deleteTemp",e[e.mkTemp=12]="mkTemp",e[e.pruneTemp=13]="pruneTemp",e[e.readBlobFile=14]="readBlobFile",e[e.unzip=15]="unzip",e[e.zip=16]="zip",e))(Zt||{});let Yt,qt;function Xt(e){const t=JSON.stringify(e);return(Yt??=new TextEncoder,Yt).encode(t)}function Qt(e){const t=Jt(e);return JSON.parse(t)}function Jt(e){return(qt??=new TextDecoder,qt).decode(e)}class Kt{i32a;u8a;headerLength=16;maxDataLength;constructor(e){this.i32a=new Int32Array(e),this.u8a=new Uint8Array(e),this.maxDataLength=e.byteLength-this.headerLength}}async function en(e,t){const{i32a:n,u8a:r,headerLength:i,maxDataLength:o}=e;for(;1!==Atomics.load(n,1););const s=n[2],a=r.slice(i,i+s);let c=await t(a);const l=c.byteLength;if(l>o){const e=`Response is too large: ${l} > ${o}. Consider grow the size of SharedArrayBuffer.`;if(c=Xt([{name:"RangeError",message:e}]),c.byteLength>o)throw Atomics.store(n,1,0),new RangeError(e)}n[2]=c.byteLength,r.set(c,i),Atomics.store(n,1,0),Atomics.store(n,0,0)}const tn={[Zt.createFile]:yt,[Zt.mkdir]:_t,[Zt.move]:xt,[Zt.readDir]:gt,[Zt.remove]:mt,[Zt.stat]:wt,[Zt.writeFile]:bt,[Zt.appendFile]:Ct,[Zt.copy]:Rt,[Zt.emptyDir]:Tt,[Zt.exists]:At,[Zt.deleteTemp]:Lt,[Zt.mkTemp]:Pt,[Zt.pruneTemp]:It,[Zt.readBlobFile]:jt,[Zt.unzip]:Ut,[Zt.zip]:Dt};let nn,rn;function on(){if("undefined"!=typeof window)throw new Error("Only can use in worker");if(nn)throw new Error("Worker messenger already started");addEventListener("message",e=>{const t=e.data;if(!(t instanceof SharedArrayBuffer))throw new TypeError("Only can post SharedArrayBuffer to Worker");nn=new Kt(t),postMessage(!0),async function(){for(;;)try{await en(nn,async e=>{const[t,...n]=Qt(e);let r;t===Zt.writeFile||t===Zt.appendFile?Array.isArray(n[1])&&(n[1]=new Uint8Array(n[1])):t===Zt.pruneTemp&&(n[0]=new Date(n[0]));const i=tn[t];try{const e=await i(...n);if(e.isErr())r=Xt([Vt(e.unwrapErr())]);else{let n;if(t===Zt.readBlobFile){const t=e.unwrap(),r=await zt(t);n={...r,data:[...new Uint8Array(r.data)]}}else if(t===Zt.readDir){const t=e.unwrap(),r=[];for await(const{path:e,handle:n}of t){const t=await ut(n);r.push({path:e,handle:t})}n=r}else if(t===Zt.stat){const t=e.unwrap();n=await ut(t)}else if(t===Zt.zip){const t=e.unwrap();n=t instanceof Uint8Array?[...t]:t}else n=e.unwrap();r=Xt([null,n])}}catch(e){r=Xt([Vt(e)])}return r})}catch(e){console.error(e instanceof Error?e.stack:e)}}()})}function sn(e){if("undefined"==typeof window)throw new Error("Only can use in main thread");if(rn)throw new Error("Main messenger already started");return new Promise(t=>{const{worker:n,bufferLength:i=1048576,opTimeout:o=1e3}=e;r(n instanceof Worker||n instanceof URL||"string"==typeof n&&n),r(i>16&&i%4==0),r(Number.isInteger(o)&&o>0),Gt=o;const s=n instanceof Worker?n:new Worker(n),a=new SharedArrayBuffer(i);s.addEventListener("message",e=>{e.data&&(rn=new Kt(a),t())}),s.postMessage(a)})}function an(){return rn}function cn(e){r(null!=e),rn=e}function ln(e,...t){if(!rn)return w(new Error("Worker not initialized. Come back later."));const n=Xt([e,...t]);try{const e=Qt(function(e,t){const{i32a:n,u8a:r,headerLength:i,maxDataLength:o}=e,s=t.byteLength;if(s>o)throw new RangeError(`Request is too large: ${s} > ${o}. Consider grow the size of SharedArrayBuffer.`);Atomics.store(n,0,1),n[2]=s,r.set(t,i),Atomics.store(n,1,1),function(e){const t=Date.now();for(;!e();)if(Date.now()-t>Gt){const e=new Error("Operating Timeout");throw e.name=T,e}}(()=>0===Atomics.load(n,0));const a=n[2];return r.slice(i,i+a)}(rn,n)),t=e[0],r=t?w(function(e){const t=new Error(e.message);return t.name=e.name,t}(t)):m(e[1]??void 0);return r}catch(e){return w(e)}}function un(e){return ln(Zt.createFile,e)}function fn(e){return ln(Zt.mkdir,e)}function hn(e,t,n){return ln(Zt.move,e,t,n)}function pn(e,t){return ln(Zt.readDir,e,t)}function dn(e,t){return ln(Zt.readBlobFile,e).map(e=>{const n=new Uint8Array(e.data);switch(e.data=n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength),t?.encoding){case"blob":return e;case"utf8":return Jt(new Uint8Array(e.data));default:return e.data}})}function yn(e){return ln(Zt.remove,e)}function _n(e){return ln(Zt.stat,e)}function gn(e){return e instanceof ArrayBuffer?[...new Uint8Array(e)]:ArrayBuffer.isView(e)?[...new Uint8Array(e.buffer)]:e}function vn(e,t,n){return ln(Zt.writeFile,e,gn(t),n)}function mn(e,t){return ln(Zt.appendFile,e,gn(t))}function wn(e,t,n){return ln(Zt.copy,e,t,n)}function bn(e){return ln(Zt.emptyDir,e)}function En(e,t){return ln(Zt.exists,e,t)}function Sn(){return ln(Zt.deleteTemp)}function kn(e){return ln(Zt.mkTemp,e)}function Cn(e){return ln(Zt.pruneTemp,e)}function Rn(e){return dn(e,{encoding:"blob"})}function Tn(e){return An(e).andThen(e=>{try{return m(JSON.parse(e))}catch(e){return w(e)}})}function An(e){return dn(e,{encoding:"utf8"})}function xn(e,t){return ln(Zt.unzip,e,t)}function jn(e,t,n){return ln(Zt.zip,e,t,n).map(e=>e?new Uint8Array(e):e)}},503(e,t,n){"use strict";n.r(t),n.d(t,{DELIMITER:()=>w,SEPARATOR:()=>b,SEPARATOR_PATTERN:()=>E,basename:()=>m,common:()=>Q,dirname:()=>k,extname:()=>C,format:()=>A,fromFileUrl:()=>x,globToRegExp:()=>re,isAbsolute:()=>F,isGlob:()=>ie,join:()=>N,joinGlobs:()=>le,normalize:()=>$,normalizeGlob:()=>ue,parse:()=>D,relative:()=>z,resolve:()=>G,toFileUrl:()=>q,toNamespacedPath:()=>X});const r=function(){const e=globalThis,t=e.Deno?.build?.os;return"string"==typeof t?"windows"===t:e.navigator?.platform?.startsWith("Win")??e.process?.platform?.startsWith("win")??!1}();function i(e){if("string"!=typeof e)throw new TypeError(`Path must be a string, received "${JSON.stringify(e)}"`)}function o(e,t){if(t.length>=e.length)return e;const n=e.length-t.length;for(let r=t.length-1;r>=0;--r)if(e.charCodeAt(n+r)!==t.charCodeAt(r))return e;return e.slice(0,-t.length)}function s(e,t,n=0){let r=!1,i=e.length;for(let o=e.length-1;o>=n;--o)if(t(e.charCodeAt(o))){if(r){n=o+1;break}}else r||(r=!0,i=o+1);return e.slice(n,i)}function a(e,t){if(i(e),0===e.length)return e;if("string"!=typeof t)throw new TypeError(`Suffix must be a string, received "${JSON.stringify(t)}"`)}function c(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function l(e){return e=c(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function u(e,t){if(e.length<=1)return e;let n=e.length;for(let r=e.length-1;r>0&&t(e.charCodeAt(r));r--)n=r;return e.slice(0,n)}const f=46,h=92,p=58;function d(e){return 47===e}function y(e){return 47===e}function _(e){return 47===e||e===h}function g(e){return e>=97&&e<=122||e>=65&&e<=90}function v(e){e=c(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}function m(e,t=""){return r?function(e,t=""){e instanceof URL&&(e=v(e)),a(e,t);let n=0;e.length>=2&&g(e.charCodeAt(0))&&e.charCodeAt(1)===p&&(n=2);const r=u(s(e,_,n),_);return t?o(r,t):r}(e,t):function(e,t=""){e instanceof URL&&(e=l(e)),a(e,t);const n=u(s(e,d),d);return t?o(n,t):n}(e,t)}const w=r?";":":",b=r?"\\":"/",E=r?/[\\/]+/:/\/+/;function S(e){if(i(e),0===e.length)return"."}function k(e){return r?function(e){e instanceof URL&&(e=v(e)),S(e);const t=e.length;let n=-1,r=-1,i=!0,o=0;const s=e.charCodeAt(0);if(t>1)if(_(s)){if(n=o=1,_(e.charCodeAt(1))){let r=2,i=r;for(;r<t&&!_(e.charCodeAt(r));++r);if(r<t&&r!==i){for(i=r;r<t&&_(e.charCodeAt(r));++r);if(r<t&&r!==i){for(i=r;r<t&&!_(e.charCodeAt(r));++r);if(r===t)return e;r!==i&&(n=o=r+1)}}}}else g(s)&&e.charCodeAt(1)===p&&(n=o=2,t>2&&_(e.charCodeAt(2))&&(n=o=3));else if(_(s))return e;for(let n=t-1;n>=o;--n)if(_(e.charCodeAt(n))){if(!i){r=n;break}}else i=!1;if(-1===r){if(-1===n)return".";r=n}return u(e.slice(0,r),y)}(e):function(e){e instanceof URL&&(e=l(e)),S(e);let t=-1,n=!1;for(let r=e.length-1;r>=1;--r)if(d(e.charCodeAt(r))){if(n){t=r;break}}else n=!0;return-1===t?d(e.charCodeAt(0))?"/":".":u(e.slice(0,t),d)}(e)}function C(e){return r?function(e){e instanceof URL&&(e=v(e)),i(e);let t=0,n=-1,r=0,o=-1,s=!0,a=0;e.length>=2&&e.charCodeAt(1)===p&&g(e.charCodeAt(0))&&(t=r=2);for(let i=e.length-1;i>=t;--i){const t=e.charCodeAt(i);if(_(t)){if(!s){r=i+1;break}}else-1===o&&(s=!1,o=i+1),t===f?-1===n?n=i:1!==a&&(a=1):-1!==n&&(a=-1)}return-1===n||-1===o||0===a||1===a&&n===o-1&&n===r+1?"":e.slice(n,o)}(e):function(e){e instanceof URL&&(e=l(e)),i(e);let t=-1,n=0,r=-1,o=!0,s=0;for(let i=e.length-1;i>=0;--i){const a=e.charCodeAt(i);if(d(a)){if(!o){n=i+1;break}}else-1===r&&(o=!1,r=i+1),a===f?-1===t?t=i:1!==s&&(s=1):-1!==t&&(s=-1)}return-1===t||-1===r||0===s||1===s&&t===r-1&&t===n+1?"":e.slice(t,r)}(e)}function R(e,t){const n=t.dir||t.root,r=t.base||(t.name??"")+(t.ext??"");return n?r===e?n:n===t.root?n+r:n+e+r:r}function T(e){if(null===e||"object"!=typeof e)throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof e}"`)}function A(e){return r?function(e){return T(e),R("\\",e)}(e):function(e){return T(e),R("/",e)}(e)}function x(e){return r?v(e):l(e)}function j(e){return i(e),e.length>0&&d(e.charCodeAt(0))}function O(e){i(e);const t=e.length;if(0===t)return!1;const n=e.charCodeAt(0);return!!_(n)||!!(g(n)&&t>2&&e.charCodeAt(1)===p&&_(e.charCodeAt(2)))}function F(e){return r?O(e):j(e)}function P(e){if(i(e),0===e.length)return"."}function L(e,t,n,r){let i,o="",s=0,a=-1,c=0;for(let l=0;l<=e.length;++l){if(l<e.length)i=e.charCodeAt(l);else{if(r(i))break;i=47}if(r(i)){if(a===l-1||1===c);else if(a!==l-1&&2===c){if(o.length<2||2!==s||o.charCodeAt(o.length-1)!==f||o.charCodeAt(o.length-2)!==f){if(o.length>2){const e=o.lastIndexOf(n);-1===e?(o="",s=0):(o=o.slice(0,e),s=o.length-1-o.lastIndexOf(n)),a=l,c=0;continue}if(2===o.length||1===o.length){o="",s=0,a=l,c=0;continue}}t&&(o.length>0?o+=`${n}..`:o="..",s=2)}else o.length>0?o+=n+e.slice(a+1,l):o=e.slice(a+1,l),s=l-a-1;a=l,c=0}else i===f&&-1!==c?++c:c=-1}return o}function I(e){e instanceof URL&&(e=l(e)),P(e);const t=d(e.charCodeAt(0)),n=d(e.charCodeAt(e.length-1));return 0!==(e=L(e,!t,"/",d)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?`/${e}`:e}function B(e,...t){if(void 0===e)return".";e instanceof URL&&(e=l(e)),(t=e?[e,...t]:t).forEach(e=>i(e));const n=t.filter(e=>e.length>0).join("/");return""===n?".":I(n)}function U(e){e instanceof URL&&(e=v(e)),P(e);const t=e.length;let n,r=0,i=!1;const o=e.charCodeAt(0);if(t>1)if(_(o))if(i=!0,_(e.charCodeAt(1))){let i=2,o=i;for(;i<t&&!_(e.charCodeAt(i));++i);if(i<t&&i!==o){const s=e.slice(o,i);for(o=i;i<t&&_(e.charCodeAt(i));++i);if(i<t&&i!==o){for(o=i;i<t&&!_(e.charCodeAt(i));++i);if(i===t)return`\\\\${s}\\${e.slice(o)}\\`;i!==o&&(n=`\\\\${s}\\${e.slice(o,i)}`,r=i)}}}else r=1;else g(o)&&e.charCodeAt(1)===p&&(n=e.slice(0,2),r=2,t>2&&_(e.charCodeAt(2))&&(i=!0,r=3));else if(_(o))return"\\";let s;return s=r<t?L(e.slice(r),!i,"\\",_):"",0!==s.length||i||(s="."),s.length>0&&_(e.charCodeAt(t-1))&&(s+="\\"),void 0===n?i?s.length>0?`\\${s}`:"\\":s:i?s.length>0?`${n}\\${s}`:`${n}\\`:n+s}function M(e,...t){if(e instanceof URL&&(e=v(e)),(t=e?[e,...t]:t).forEach(e=>i(e)),t=t.filter(e=>e.length>0),0===t.length)return".";let n=!0,r=0;const o=t[0];if(_(o.charCodeAt(0))){++r;const e=o.length;e>1&&_(o.charCodeAt(1))&&(++r,e>2&&(_(o.charCodeAt(2))?++r:n=!1))}let s=t.join("\\");if(n){for(;r<s.length&&_(s.charCodeAt(r));++r);r>=2&&(s=`\\${s.slice(r)}`)}return U(s)}function N(e,...t){return r?M(e,...t):B(e,...t)}function $(e){return r?U(e):I(e)}function D(e){return r?function(e){i(e);const t={root:"",dir:"",base:"",ext:"",name:""},n=e.length;if(0===n)return t;let r=0,o=e.charCodeAt(0);if(n>1){if(_(o)){if(r=1,_(e.charCodeAt(1))){let t=2,i=t;for(;t<n&&!_(e.charCodeAt(t));++t);if(t<n&&t!==i){for(i=t;t<n&&_(e.charCodeAt(t));++t);if(t<n&&t!==i){for(i=t;t<n&&!_(e.charCodeAt(t));++t);t===n?r=t:t!==i&&(r=t+1)}}}}else if(g(o)&&e.charCodeAt(1)===p){if(r=2,!(n>2))return t.root=t.dir=e,t;if(_(e.charCodeAt(2))){if(3===n)return t.root=t.dir=e,t.base="\\",t;r=3}}}else if(_(o))return t.root=t.dir=e,t.base="\\",t;r>0&&(t.root=e.slice(0,r));let s=-1,a=r,c=-1,l=!0,u=e.length-1,h=0;for(;u>=r;--u)if(o=e.charCodeAt(u),_(o)){if(!l){a=u+1;break}}else-1===c&&(l=!1,c=u+1),o===f?-1===s?s=u:1!==h&&(h=1):-1!==s&&(h=-1);return-1===s||-1===c||0===h||1===h&&s===c-1&&s===a+1?-1!==c&&(t.base=t.name=e.slice(a,c)):(t.name=e.slice(a,s),t.base=e.slice(a,c),t.ext=e.slice(s,c)),t.base=t.base||"\\",t.dir=a>0&&a!==r?e.slice(0,a-1):t.root,t}(e):function(e){i(e);const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const n=d(e.charCodeAt(0));let r;n?(t.root="/",r=1):r=0;let o=-1,s=0,a=-1,c=!0,l=e.length-1,h=0;for(;l>=r;--l){const t=e.charCodeAt(l);if(d(t)){if(!c){s=l+1;break}}else-1===a&&(c=!1,a=l+1),t===f?-1===o?o=l:1!==h&&(h=1):-1!==o&&(h=-1)}return-1===o||-1===a||0===h||1===h&&o===a-1&&o===s+1?(-1!==a&&(t.base=t.name=0===s&&n?e.slice(1,a):e.slice(s,a)),t.base=t.base||"/"):(0===s&&n?(t.name=e.slice(1,o),t.base=e.slice(1,a)):(t.name=e.slice(s,o),t.base=e.slice(s,a)),t.ext=e.slice(o,a)),s>0?t.dir=u(e.slice(0,s-1),d):n&&(t.dir="/"),t}(e)}function W(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let o;if(r>=0)o=e[r];else{const{Deno:e}=globalThis;if("function"!=typeof e?.cwd)throw new TypeError("Resolved a relative path without a current working directory (CWD)");o=e.cwd()}i(o),0!==o.length&&(t=`${o}/${t}`,n=d(o.charCodeAt(0)))}return t=L(t,!n,"/",d),n?t.length>0?`/${t}`:"/":t.length>0?t:"."}function H(e,t){if(i(e),i(t),e===t)return""}function V(...e){let t="",n="",r=!1;for(let o=e.length-1;o>=-1;o--){let s;const{Deno:a}=globalThis;if(o>=0)s=e[o];else if(t){if("function"!=typeof a?.env?.get||"function"!=typeof a?.cwd)throw new TypeError("Resolved a relative path without a current working directory (CWD)");s=a.cwd(),void 0!==s&&s.slice(0,3).toLowerCase()===`${t.toLowerCase()}\\`||(s=`${t}\\`)}else{if("function"!=typeof a?.cwd)throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)");s=a.cwd()}i(s);const c=s.length;if(0===c)continue;let l=0,u="",f=!1;const h=s.charCodeAt(0);if(c>1)if(_(h))if(f=!0,_(s.charCodeAt(1))){let e=2,t=e;for(;e<c&&!_(s.charCodeAt(e));++e);if(e<c&&e!==t){const n=s.slice(t,e);for(t=e;e<c&&_(s.charCodeAt(e));++e);if(e<c&&e!==t){for(t=e;e<c&&!_(s.charCodeAt(e));++e);e===c?(u=`\\\\${n}\\${s.slice(t)}`,l=e):e!==t&&(u=`\\\\${n}\\${s.slice(t,e)}`,l=e)}}}else l=1;else g(h)&&s.charCodeAt(1)===p&&(u=s.slice(0,2),l=2,c>2&&_(s.charCodeAt(2))&&(f=!0,l=3));else _(h)&&(l=1,f=!0);if(!(u.length>0&&t.length>0&&u.toLowerCase()!==t.toLowerCase())&&(0===t.length&&u.length>0&&(t=u),r||(n=`${s.slice(l)}\\${n}`,r=f),r&&t.length>0))break}return n=L(n,!r,"\\",_),t+(r?"\\":"")+n||"."}function z(e,t){return r?function(e,t){H(e,t);const n=V(e),r=V(t);if(n===r)return"";if((e=n.toLowerCase())===(t=r.toLowerCase()))return"";let i=0,o=e.length;for(;i<o&&e.charCodeAt(i)===h;++i);for(;o-1>i&&e.charCodeAt(o-1)===h;--o);const s=o-i;let a=0,c=t.length;for(;a<c&&t.charCodeAt(a)===h;++a);for(;c-1>a&&t.charCodeAt(c-1)===h;--c);const l=c-a,u=s<l?s:l;let f=-1,p=0;for(;p<=u;++p){if(p===u){if(l>u){if(t.charCodeAt(a+p)===h)return r.slice(a+p+1);if(2===p)return r.slice(a+p)}s>u&&(e.charCodeAt(i+p)===h?f=p:2===p&&(f=3));break}const n=e.charCodeAt(i+p);if(n!==t.charCodeAt(a+p))break;n===h&&(f=p)}if(p!==u&&-1===f)return r;let d="";for(-1===f&&(f=0),p=i+f+1;p<=o;++p)p!==o&&e.charCodeAt(p)!==h||(0===d.length?d+="..":d+="\\..");return d.length>0?d+r.slice(a+f,c):(a+=f,r.charCodeAt(a)===h&&++a,r.slice(a,c))}(e,t):function(e,t){if(H(e,t),(e=W(e))===(t=W(t)))return"";let n=1;const r=e.length;for(;n<r&&d(e.charCodeAt(n));++n);const i=r-n;let o=1;const s=t.length;for(;o<s&&d(t.charCodeAt(o));++o);const a=s-o,c=i<a?i:a;let l=-1,u=0;for(;u<=c;++u){if(u===c){if(a>c){if(d(t.charCodeAt(o+u)))return t.slice(o+u+1);if(0===u)return t.slice(o+u)}else i>c&&(d(e.charCodeAt(n+u))?l=u:0===u&&(l=0));break}const r=e.charCodeAt(n+u);if(r!==t.charCodeAt(o+u))break;d(r)&&(l=u)}let f="";for(u=n+l+1;u<=r;++u)(u===r||d(e.charCodeAt(u)))&&(0===f.length?f+="..":f+="/..");return f.length>0?f+t.slice(o+l):(o+=l,d(t.charCodeAt(o))&&++o,t.slice(o))}(e,t)}function G(...e){return r?V(...e):W(...e)}const Z={"\t":"%09","\n":"%0A","\v":"%0B","\f":"%0C","\r":"%0D"," ":"%20"};function Y(e){return e.replaceAll(/[\s]/g,e=>Z[e]??e)}function q(e){return r?function(e){if(!O(e))throw new TypeError(`Path must be absolute: received "${e}"`);const[,t,n]=e.match(/^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/),r=new URL("file:///");if(r.pathname=Y(n.replace(/%/g,"%25")),void 0!==t&&"localhost"!==t&&(r.hostname=t,!r.hostname))throw new TypeError(`Invalid hostname: "${r.hostname}"`);return r}(e):function(e){if(!j(e))throw new TypeError(`Path must be absolute: received "${e}"`);const t=new URL("file:///");return t.pathname=Y(e.replace(/%/g,"%25").replace(/\\/g,"%5C")),t}(e)}function X(e){return r?function(e){if("string"!=typeof e)return e;if(0===e.length)return"";const t=V(e);if(t.length>=3)if(t.charCodeAt(0)===h){if(t.charCodeAt(1)===h){const e=t.charCodeAt(2);if(63!==e&&e!==f)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(g(t.charCodeAt(0))&&t.charCodeAt(1)===p&&t.charCodeAt(2)===h)return`\\\\?\\${t}`;return e}(e):e}function Q(e){return function(e,t){const[n="",...r]=e,i=n.split(t);let o=i.length,s="";for(const e of r){const n=e.split(t);n.length<=o&&(o=n.length,s="");for(let e=0;e<o;e++)if(n[e]!==i[e]){o=e,s=0===e?"":t;break}}return i.slice(0,o).join(t)+s}(e,b)}const J=["!","$","(",")","*","+",".","=","?","[","\\","^","{","|"],K=["-","\\","]"];function ee(e,t,{extended:n=!0,globstar:r=!0,caseInsensitive:i=!1}={}){if(""===t)return/(?!)/;let o=t.length;for(;o>1&&e.seps.includes(t[o-1]);o--);t=t.slice(0,o);let s="";for(let i=0;i<t.length;){let o="";const a=[];let c=!1,l=!1,u=!1,f=i;for(;f<t.length&&!e.seps.includes(t[f]);f++)if(l)l=!1,o+=(c?K:J).includes(t[f])?`\\${t[f]}`:t[f];else if(t[f]!==e.escapePrefix){if("["===t[f]){if(!c){c=!0,o+="[","!"===t[f+1]?(f++,o+="^"):"^"===t[f+1]&&(f++,o+="\\^");continue}if(":"===t[f+1]){let e=f+1,n="";for(;void 0!==t[e+1]&&":"!==t[e+1];)n+=t[e+1],e++;if(":"===t[e+1]&&"]"===t[e+2]){f=e+2,"alnum"===n?o+="\\dA-Za-z":"alpha"===n?o+="A-Za-z":"ascii"===n?o+="\0-":"blank"===n?o+="\t ":"cntrl"===n?o+="\0-":"digit"===n?o+="\\d":"graph"===n?o+="!-~":"lower"===n?o+="a-z":"print"===n?o+=" -~":"punct"===n?o+="!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~":"space"===n?o+="\\s\v":"upper"===n?o+="A-Z":"word"===n?o+="\\w":"xdigit"===n&&(o+="\\dA-Fa-f");continue}}}if("]"===t[f]&&c)c=!1,o+="]";else if(c)o+=t[f];else{if(")"===t[f]&&a.length>0&&"BRACE"!==a[a.length-1]){o+=")";const t=a.pop();"!"===t?o+=e.wildcard:"@"!==t&&(o+=t);continue}if("|"===t[f]&&a.length>0&&"BRACE"!==a[a.length-1])o+="|";else if("+"===t[f]&&n&&"("===t[f+1])f++,a.push("+"),o+="(?:";else if("@"===t[f]&&n&&"("===t[f+1])f++,a.push("@"),o+="(?:";else if("?"!==t[f])if("!"===t[f]&&n&&"("===t[f+1])f++,a.push("!"),o+="(?!";else if("{"!==t[f])if("}"!==t[f]||"BRACE"!==a[a.length-1])if(","!==t[f]||"BRACE"!==a[a.length-1])if("*"!==t[f])o+=J.includes(t[f])?`\\${t[f]}`:t[f];else if(n&&"("===t[f+1])f++,a.push("*"),o+="(?:";else{const n=t[f-1];let i=1;for(;"*"===t[f+1];)f++,i++;const s=t[f+1];r&&2===i&&[...e.seps,void 0].includes(n)&&[...e.seps,void 0].includes(s)?(o+=e.globstar,u=!0):o+=e.wildcard}else o+="|";else a.pop(),o+=")";else a.push("BRACE"),o+="(?:";else n&&"("===t[f+1]?(f++,a.push("?"),o+="(?:"):o+="."}}else l=!0;if(a.length>0||c||l){o="";for(const e of t.slice(i,f))o+=J.includes(e)?`\\${e}`:e,u=!1}for(s+=o,u||(s+=f<t.length?e.sep:e.sepMaybe,u=!0);e.seps.includes(t[f]);)f++;i=f}return s=`^${s}$`,new RegExp(s,i?"i":"")}const te={sep:"/+",sepMaybe:"/*",seps:["/"],globstar:"(?:[^/]*(?:/|$)+)*",wildcard:"[^/]*",escapePrefix:"\\"},ne={sep:"(?:\\\\|/)+",sepMaybe:"(?:\\\\|/)*",seps:["\\","/"],globstar:"(?:[^\\\\/]*(?:\\\\|/|$)+)*",wildcard:"[^\\\\/]*",escapePrefix:"`"};function re(e,t={}){return r?function(e,t={}){return ee(ne,e,t)}(e,t):function(e,t={}){return ee(te,e,t)}(e,t)}function ie(e){const t={"{":"}","(":")","[":"]"},n=/\\(.)|(^!|\*|\?|[\].+)]\?|\[[^[\\\]]+\]|\{[^{\\}]+\}|\(\?[:!=][^\\)]+\)|\([^(|]+\|[^\\)]+\))/;if(""===e)return!1;let r;for(;r=n.exec(e);){if(r[2])return!0;let n=r.index+r[0].length;const i=r[1],o=i?t[i]:null;if(i&&o){const t=e.indexOf(o,n);-1!==t&&(n=t+1)}e=e.slice(n)}return!1}const oe=/\/+/;function se(e,t={}){const{globstar:n=!1}=t;if(e.match(/\0/g))throw new Error(`Glob contains invalid characters: "${e}"`);if(!n)return I(e);const r=oe.source,i=new RegExp(`(?<=(${r}|^)\\*\\*${r})\\.\\.(?=${r}|$)`,"g");return I(e.replace(i,"\0")).replace(/\0/g,"..")}const ae=/[\\/]+/;function ce(e,t={}){const{globstar:n=!1}=t;if(e.match(/\0/g))throw new Error(`Glob contains invalid characters: "${e}"`);if(!n)return U(e);const r=ae.source,i=new RegExp(`(?<=(${r}|^)\\*\\*${r})\\.\\.(?=${r}|$)`,"g");return U(e.replace(i,"\0")).replace(/\0/g,"..")}function le(e,t={}){return r?function(e,t={}){const{globstar:n=!1}=t;if(!n||0===e.length)return M(...e);let r;for(const t of e){const e=t;e.length>0&&(r?r+=`\\${e}`:r=e)}return r?ce(r,{globstar:n}):"."}(e,t):function(e,t={}){const{globstar:n=!1}=t;if(!n||0===e.length)return B(...e);let r;for(const t of e){const e=t;e.length>0&&(r?r+=`/${e}`:r=e)}return r?se(r,{globstar:n}):"."}(e,t)}function ue(e,t={}){return r?ce(e,t):se(e,t)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(127)})();