@dcrays/mbh-chat 0.3.2 → 0.3.4-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bridge/index.js +36 -36
- package/package.json +1 -1
package/bridge/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { createRequire as __mobookCreateRequire } from 'node:module'; const require = __mobookCreateRequire(import.meta.url);
|
|
2
|
-
var _Z=Object.create;var Dy=Object.defineProperty;var wZ=Object.getOwnPropertyDescriptor;var xZ=Object.getOwnPropertyNames;var SZ=Object.getPrototypeOf,EZ=Object.prototype.hasOwnProperty;var B=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var w=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Mn=(e,t)=>{for(var r in t)Dy(e,r,{get:t[r],enumerable:!0})},kZ=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of xZ(t))!EZ.call(e,n)&&n!==r&&Dy(e,n,{get:()=>t[n],enumerable:!(i=wZ(t,n))||i.enumerable});return e};var Vr=(e,t,r)=>(r=e!=null?_Z(SZ(e)):{},kZ(t||!e||!e.__esModule?Dy(r,"default",{value:e,enumerable:!0}):r,e));var ep=w((s0e,d$)=>{var Qd=B("stream"),f9=B("util"),d9="function";function ki(){if(!(this instanceof ki))return new ki;Qd.Duplex.call(this,{decodeStrings:!1,objectMode:!0}),this.buffer=Buffer.from("");let e=this;e.on("finish",function(){e.finished=!0,e.emit("chunk",!1)})}f9.inherits(ki,Qd.Duplex);ki.prototype._write=function(e,t,r){this.buffer=Buffer.concat([this.buffer,e]),this.cb=r,this.emit("chunk")};ki.prototype.stream=function(e,t){let r=Qd.PassThrough(),i,n=this;function o(){if(typeof n.cb===d9){let a=n.cb;return n.cb=void 0,a()}}function s(){let a;if(n.buffer&&n.buffer.length){if(typeof e=="number")a=n.buffer.slice(0,e),n.buffer=n.buffer.slice(e),e-=a.length,i=i||!e;else{let c=n.buffer.indexOf(e);if(c!==-1)n.match=c,t&&(c=c+e.length),a=n.buffer.slice(0,c),n.buffer=n.buffer.slice(c),i=!0;else{let u=n.buffer.length-e.length;u<=0?o():(a=n.buffer.slice(0,u),n.buffer=n.buffer.slice(u))}}a&&r.write(a,function(){(n.buffer.length===0||e.length&&n.buffer.length<=e.length)&&o()})}if(i)n.removeListener("chunk",s),r.end();else if(n.finished){n.removeListener("chunk",s),n.emit("error",new Error("FILE_ENDED"));return}}return n.on("chunk",s),s(),r};ki.prototype.pull=function(e,t){if(e===0)return Promise.resolve("");if(!isNaN(e)&&this.buffer.length>e){let a=this.buffer.slice(0,e);return this.buffer=this.buffer.slice(e),Promise.resolve(a)}let r=Buffer.from(""),i=this,n=new Qd.Transform;n._transform=function(a,c,u){r=Buffer.concat([r,a]),u()};let o,s;return new Promise(function(a,c){if(o=c,s=function(u){i.__emittedError=u,c(u)},i.finished)return c(new Error("FILE_ENDED"));i.once("error",s),i.stream(e,t).on("error",c).pipe(n).on("finish",function(){a(r)}).on("error",c)}).finally(function(){i.removeListener("error",o),i.removeListener("error",s)})};ki.prototype._read=function(){};d$.exports=ki});var m$=w((a0e,h$)=>{var p$=B("stream"),p9=B("util");function hu(){if(!(this instanceof hu))return new hu;p$.Transform.call(this)}p9.inherits(hu,p$.Transform);hu.prototype._transform=function(e,t,r){r()};h$.exports=hu});var tp=w((c0e,g$)=>{var h9=B("stream");g$.exports=function(e){return new Promise(function(t,r){let i=[],n=h9.Transform().on("finish",function(){t(Buffer.concat(i))}).on("error",r);n._transform=function(o,s,a){i.push(o),a()},e.on("error",r).pipe(n)})}});var mu=w((u0e,y$)=>{var m9=function(e,t,r){let i;switch(r){case 1:i=e.readUInt8(t);break;case 2:i=e.readUInt16LE(t);break;case 4:i=e.readUInt32LE(t);break;case 8:i=Number(e.readBigUInt64LE(t));break;default:throw new Error("Unsupported UInt LE size!")}return i},g9=function(e,t){let r={},i=0;for(let[n,o]of t)e.length>=i+o?r[n]=m9(e,i,o):r[n]=null,i+=o;return r};y$.exports={parse:g9}});var rp=w((l0e,b$)=>{var v$=mu();b$.exports=function(e,t){let r;for(;!r&&e&&e.length;){let i=v$.parse(e,[["signature",2],["partSize",2]]);if(i.signature===1){let n=[];t.uncompressedSize===4294967295&&n.push(["uncompressedSize",8]),t.compressedSize===4294967295&&n.push(["compressedSize",8]),t.offsetToLocalFileHeader===4294967295&&n.push(["offsetToLocalFileHeader",8]),r=v$.parse(e.slice(4),n)}else e=e.slice(i.partSize+4)}return r=r||{},t.compressedSize===4294967295&&(t.compressedSize=r.compressedSize),t.uncompressedSize===4294967295&&(t.uncompressedSize=r.uncompressedSize),t.offsetToLocalFileHeader===4294967295&&(t.offsetToLocalFileHeader=r.offsetToLocalFileHeader),r}});var np=w((f0e,_$)=>{_$.exports=function(t,r){let i=t&31,n=t>>5&15,o=(t>>9&127)+1980,s=r?(r&31)*2:0,a=r?r>>5&63:0,c=r?r>>11:0;return new Date(Date.UTC(o,n-1,i,c,a,s))}});var ip=w((d0e,S$)=>{var y9=B("util"),v9=B("zlib"),zx=B("stream"),w$=ep(),b9=m$(),_9=tp(),w9=rp(),x9=np(),S9=zx.pipeline,gu=mu(),x$=Buffer.alloc(4);x$.writeUInt32LE(101010256,0);function Kr(e){if(!(this instanceof Kr))return new Kr(e);let t=this;t._opts=e||{verbose:!1},w$.call(t,t._opts),t.on("finish",function(){t.emit("end"),t.emit("close")}),t._readRecord().catch(function(r){(!t.__emittedError||t.__emittedError!==r)&&t.emit("error",r)})}y9.inherits(Kr,w$);Kr.prototype._readRecord=function(){let e=this;return e.pull(4).then(function(t){if(t.length===0)return;let r=t.readUInt32LE(0);if(r===875721283)return e._readCrxHeader();if(r===67324752)return e._readFile();if(r===33639248)return e.reachedCD=!0,e._readCentralDirectoryFileHeader();if(r===101010256)return e._readEndOfCentralDirectoryRecord();if(e.reachedCD)return e.pull(x$,!0).then(function(){return e._readEndOfCentralDirectoryRecord()});e.emit("error",new Error("invalid signature: 0x"+r.toString(16)))}).then((function(t){if(t)return e._readRecord()}))};Kr.prototype._readCrxHeader=function(){let e=this;return e.pull(12).then(function(t){return e.crxHeader=gu.parse(t,[["version",4],["pubKeyLength",4],["signatureLength",4]]),e.pull(e.crxHeader.pubKeyLength+e.crxHeader.signatureLength)}).then(function(t){return e.crxHeader.publicKey=t.slice(0,e.crxHeader.pubKeyLength),e.crxHeader.signature=t.slice(e.crxHeader.pubKeyLength),e.emit("crx-header",e.crxHeader),!0})};Kr.prototype._readFile=function(){let e=this;return e.pull(26).then(function(t){let r=gu.parse(t,[["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2]]);return r.lastModifiedDateTime=x9(r.lastModifiedDate,r.lastModifiedTime),e.crxHeader&&(r.crxHeader=e.crxHeader),e.pull(r.fileNameLength).then(function(i){let n=i.toString("utf8"),o=zx.PassThrough(),s=!1;return o.autodrain=function(){s=!0;let a=o.pipe(b9());return a.promise=function(){return new Promise(function(c,u){a.on("finish",c),a.on("error",u)})},a},o.buffer=function(){return _9(o)},o.path=n,o.props={},o.props.path=n,o.props.pathBuffer=i,o.props.flags={isUnicode:(r.flags&2048)!=0},o.type=r.uncompressedSize===0&&/[/\\]$/.test(n)?"Directory":"File",e._opts.verbose&&(o.type==="Directory"?console.log(" creating:",n):o.type==="File"&&(r.compressionMethod===0?console.log(" extracting:",n):console.log(" inflating:",n))),e.pull(r.extraFieldLength).then(function(a){let c=w9(a,r);o.vars=r,o.extra=c,e._opts.forceStream?e.push(o):(e.emit("entry",o),(e._readableState.pipesCount||e._readableState.pipes&&e._readableState.pipes.length)&&e.push(o)),e._opts.verbose&&console.log({filename:n,vars:r,extra:c});let u=!(r.flags&8)||r.compressedSize>0,l;o.__autodraining=s;let f=r.compressionMethod&&!s?v9.createInflateRaw():zx.PassThrough();return u?(o.size=r.uncompressedSize,l=r.compressedSize):(l=Buffer.alloc(4),l.writeUInt32LE(134695760,0)),new Promise(function(p,d){S9(e.stream(l),f,o,function(h){return h?d(h):u?p(u):e._processDataDescriptor(o).then(p).catch(d)})})})})})};Kr.prototype._processDataDescriptor=function(e){return this.pull(16).then(function(r){let i=gu.parse(r,[["dataDescriptorSignature",4],["crc32",4],["compressedSize",4],["uncompressedSize",4]]);return e.size=i.uncompressedSize,!0})};Kr.prototype._readCentralDirectoryFileHeader=function(){let e=this;return e.pull(42).then(function(t){let r=gu.parse(t,[["versionMadeBy",2],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2],["fileCommentLength",2],["diskNumber",2],["internalFileAttributes",2],["externalFileAttributes",4],["offsetToLocalFileHeader",4]]);return e.pull(r.fileNameLength).then(function(i){return r.fileName=i.toString("utf8"),e.pull(r.extraFieldLength)}).then(function(){return e.pull(r.fileCommentLength)}).then(function(){return!0})})};Kr.prototype._readEndOfCentralDirectoryRecord=function(){let e=this;return e.pull(18).then(function(t){let r=gu.parse(t,[["diskNumber",2],["diskStart",2],["numberOfRecordsOnDisk",2],["numberOfRecords",2],["sizeOfCentralDirectory",4],["offsetToStartOfCentralDirectory",4],["commentLength",2]]);return e.pull(r.commentLength).then(function(){e.end(),e.push(null)})})};Kr.prototype.promise=function(){let e=this;return new Promise(function(t,r){e.on("finish",t),e.on("error",r)})};S$.exports=Kr});var yu=w((p0e,Ux)=>{"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Ux.exports={nextTick:E9}:Ux.exports=process;function E9(e,t,r,i){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,o,s;switch(n){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,r)});case 4:return process.nextTick(function(){e.call(null,t,r,i)});default:for(o=new Array(n-1),s=0;s<o.length;)o[s++]=arguments[s];return process.nextTick(function(){e.apply(null,o)})}}});var k$=w((h0e,E$)=>{var k9={}.toString;E$.exports=Array.isArray||function(e){return k9.call(e)=="[object Array]"}});var Bx=w((m0e,T$)=>{T$.exports=B("stream")});var vu=w((Wx,O$)=>{var op=B("buffer"),Bn=op.Buffer;function I$(e,t){for(var r in e)t[r]=e[r]}Bn.from&&Bn.alloc&&Bn.allocUnsafe&&Bn.allocUnsafeSlow?O$.exports=op:(I$(op,Wx),Wx.Buffer=Xs);function Xs(e,t,r){return Bn(e,t,r)}I$(Bn,Xs);Xs.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Bn(e,t,r)};Xs.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=Bn(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};Xs.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Bn(e)};Xs.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return op.SlowBuffer(e)}});var mo=w(er=>{function T9(e){return Array.isArray?Array.isArray(e):sp(e)==="[object Array]"}er.isArray=T9;function I9(e){return typeof e=="boolean"}er.isBoolean=I9;function O9(e){return e===null}er.isNull=O9;function C9(e){return e==null}er.isNullOrUndefined=C9;function A9(e){return typeof e=="number"}er.isNumber=A9;function $9(e){return typeof e=="string"}er.isString=$9;function R9(e){return typeof e=="symbol"}er.isSymbol=R9;function D9(e){return e===void 0}er.isUndefined=D9;function N9(e){return sp(e)==="[object RegExp]"}er.isRegExp=N9;function P9(e){return typeof e=="object"&&e!==null}er.isObject=P9;function q9(e){return sp(e)==="[object Date]"}er.isDate=q9;function j9(e){return sp(e)==="[object Error]"||e instanceof Error}er.isError=j9;function M9(e){return typeof e=="function"}er.isFunction=M9;function L9(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}er.isPrimitive=L9;er.isBuffer=B("buffer").Buffer.isBuffer;function sp(e){return Object.prototype.toString.call(e)}});var C$=w((y0e,Hx)=>{typeof Object.create=="function"?Hx.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Hx.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var Js=w((v0e,Zx)=>{try{if(Vx=B("util"),typeof Vx.inherits!="function")throw"";Zx.exports=Vx.inherits}catch{Zx.exports=C$()}var Vx});var $$=w((b0e,Gx)=>{"use strict";function F9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var A$=vu().Buffer,bu=B("util");function z9(e,t,r){e.copy(t,r)}Gx.exports=(function(){function e(){F9(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},e.prototype.unshift=function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},e.prototype.concat=function(r){if(this.length===0)return A$.alloc(0);for(var i=A$.allocUnsafe(r>>>0),n=this.head,o=0;n;)z9(n.data,i,o),o+=n.data.length,n=n.next;return i},e})();bu&&bu.inspect&&bu.inspect.custom&&(Gx.exports.prototype[bu.inspect.custom]=function(){var e=bu.inspect({length:this.length});return this.constructor.name+" "+e})});var Kx=w((_0e,R$)=>{"use strict";var ap=yu();function U9(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ap.nextTick(cp,this,e)):ap.nextTick(cp,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,ap.nextTick(cp,r,o)):ap.nextTick(cp,r,o):t&&t(o)}),this)}function B9(){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)}function cp(e,t){e.emit("error",t)}R$.exports={destroy:U9,undestroy:B9}});var N$=w((w0e,D$)=>{D$.exports=B("util").deprecate});var Jx=w((x0e,U$)=>{"use strict";var go=yu();U$.exports=At;function q$(e){var t=this;this.next=null,this.entry=null,this.finish=function(){aX(t,e)}}var W9=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:go.nextTick,Ys;At.WritableState=wu;var j$=Object.create(mo());j$.inherits=Js();var H9={deprecate:N$()},M$=Bx(),lp=vu().Buffer,V9=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Z9(e){return lp.from(e)}function G9(e){return lp.isBuffer(e)||e instanceof V9}var L$=Kx();j$.inherits(At,M$);function K9(){}function wu(e,t){Ys=Ys||yo(),e=e||{};var r=t instanceof Ys;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=e.writableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=e.decodeStrings===!1;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(a){rX(t,a)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new q$(this)}wu.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(wu.prototype,"buffer",{get:H9.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var up;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(up=Function.prototype[Symbol.hasInstance],Object.defineProperty(At,Symbol.hasInstance,{value:function(e){return up.call(this,e)?!0:this!==At?!1:e&&e._writableState instanceof wu}})):up=function(e){return e instanceof this};function At(e){if(Ys=Ys||yo(),!up.call(At,this)&&!(this instanceof Ys))return new At(e);this._writableState=new wu(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),M$.call(this)}At.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function X9(e,t){var r=new Error("write after end");e.emit("error",r),go.nextTick(t,r)}function J9(e,t,r,i){var n=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),go.nextTick(i,o),n=!1),n}At.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&G9(e);return o&&!lp.isBuffer(e)&&(e=Z9(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=K9),i.ended?X9(this,r):(o||J9(this,i,e,r))&&(i.pendingcb++,n=Q9(this,i,o,e,t,r)),n};At.prototype.cork=function(){var e=this._writableState;e.corked++};At.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&F$(this,e))};At.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function Y9(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=lp.from(t,r)),t}Object.defineProperty(At.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Q9(e,t,r,i,n,o){if(!r){var s=Y9(t,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=t.objectMode?1:i.length;t.length+=a;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Xx(e,t,!1,a,i,n,o);return c}function Xx(e,t,r,i,n,o,s){t.writelen=i,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function eX(e,t,r,i,n){--t.pendingcb,r?(go.nextTick(n,i),go.nextTick(_u,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(n(i),e._writableState.errorEmitted=!0,e.emit("error",i),_u(e,t))}function tX(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function rX(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(tX(r),t)eX(e,r,i,t,n);else{var o=z$(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&F$(e,r),i?W9(P$,e,r,o,n):P$(e,r,o,n)}}function P$(e,t,r,i){r||nX(e,t),t.pendingcb--,i(),_u(e,t)}function nX(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function F$(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)n[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;n.allBuffers=a,Xx(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new q$(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,u=r.encoding,l=r.callback,f=t.objectMode?1:c.length;if(Xx(e,t,!1,f,c,u,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}At.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};At.prototype._writev=null;At.prototype.end=function(e,t,r){var i=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||sX(this,i,r)};function z$(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function iX(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),_u(e,t)})}function oX(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,go.nextTick(iX,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function _u(e,t){var r=z$(t);return r&&(oX(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function sX(e,t,r){t.ending=!0,_u(e,t),r&&(t.finished?go.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function aX(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}Object.defineProperty(At.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});At.prototype.destroy=L$.destroy;At.prototype._undestroy=L$.undestroy;At.prototype._destroy=function(e,t){this.end(),t(e)}});var yo=w((S0e,V$)=>{"use strict";var B$=yu(),cX=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};V$.exports=Wn;var W$=Object.create(mo());W$.inherits=Js();var H$=eS(),Qx=Jx();W$.inherits(Wn,H$);for(Yx=cX(Qx.prototype),fp=0;fp<Yx.length;fp++)dp=Yx[fp],Wn.prototype[dp]||(Wn.prototype[dp]=Qx.prototype[dp]);var Yx,dp,fp;function Wn(e){if(!(this instanceof Wn))return new Wn(e);H$.call(this,e),Qx.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",uX)}Object.defineProperty(Wn.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function uX(){this.allowHalfOpen||this._writableState.ended||B$.nextTick(lX,this)}function lX(e){e.end()}Object.defineProperty(Wn.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});Wn.prototype._destroy=function(e,t){this.push(null),this.end(),B$.nextTick(t,e)}});var nS=w(G$=>{"use strict";var rS=vu().Buffer,Z$=rS.isEncoding||function(e){switch(e=""+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 fX(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}}function dX(e){var t=fX(e);if(typeof t!="string"&&(rS.isEncoding===Z$||!Z$(e)))throw new Error("Unknown encoding: "+e);return t||e}G$.StringDecoder=xu;function xu(e){this.encoding=dX(e);var t;switch(this.encoding){case"utf16le":this.text=vX,this.end=bX,t=4;break;case"utf8":this.fillLast=mX,t=4;break;case"base64":this.text=_X,this.end=wX,t=3;break;default:this.write=xX,this.end=SX;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=rS.allocUnsafe(t)}xu.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};xu.prototype.end=yX;xu.prototype.text=gX;xu.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};function tS(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function pX(e,t,r){var i=t.length-1;if(i<r)return 0;var n=tS(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=tS(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=tS(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function hX(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function mX(e){var t=this.lastTotal-this.lastNeed,r=hX(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function gX(e,t){var r=pX(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}function yX(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function vX(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function bX(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function _X(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?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-r))}function wX(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function xX(e){return e.toString(this.encoding)}function SX(e){return e&&e.length?this.write(e):""}});var eS=w((T0e,s1)=>{"use strict";var ea=yu();s1.exports=ct;var EX=k$(),Su;ct.ReadableState=t1;var k0e=B("events").EventEmitter,Y$=function(e,t){return e.listeners(t).length},cS=Bx(),Eu=vu().Buffer,kX=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function TX(e){return Eu.from(e)}function IX(e){return Eu.isBuffer(e)||e instanceof kX}var Q$=Object.create(mo());Q$.inherits=Js();var iS=B("util"),Be=void 0;iS&&iS.debuglog?Be=iS.debuglog("stream"):Be=function(){};var OX=$$(),e1=Kx(),Qs;Q$.inherits(ct,cS);var oS=["error","close","destroy","pause","resume"];function CX(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):EX(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function t1(e,t){Su=Su||yo(),e=e||{};var r=t instanceof Su;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,n=e.readableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new OX,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.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Qs||(Qs=nS().StringDecoder),this.decoder=new Qs(e.encoding),this.encoding=e.encoding)}function ct(e){if(Su=Su||yo(),!(this instanceof ct))return new ct(e);this._readableState=new t1(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),cS.call(this)}Object.defineProperty(ct.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});ct.prototype.destroy=e1.destroy;ct.prototype._undestroy=e1.undestroy;ct.prototype._destroy=function(e,t){this.push(null),t(e)};ct.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Eu.from(e,t),t=""),i=!0),r1(this,e,t,!1,i)};ct.prototype.unshift=function(e){return r1(this,e,null,!0,!1)};function r1(e,t,r,i,n){var o=e._readableState;if(t===null)o.reading=!1,DX(e,o);else{var s;n||(s=AX(o,t)),s?e.emit("error",s):o.objectMode||t&&t.length>0?(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==Eu.prototype&&(t=TX(t)),i?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):sS(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?sS(e,o,t,!1):n1(e,o)):sS(e,o,t,!1))):i||(o.reading=!1)}return $X(o)}function sS(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&pp(e)),n1(e,t)}function AX(e,t){var r;return!IX(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function $X(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}ct.prototype.isPaused=function(){return this._readableState.flowing===!1};ct.prototype.setEncoding=function(e){return Qs||(Qs=nS().StringDecoder),this._readableState.decoder=new Qs(e),this._readableState.encoding=e,this};var K$=8388608;function RX(e){return e>=K$?e=K$:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function X$(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=RX(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}ct.prototype.read=function(e){Be("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return Be("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?aS(this):pp(this),null;if(e=X$(e,t),e===0&&t.ended)return t.length===0&&aS(this),null;var i=t.needReadable;Be("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,Be("length less than watermark",i)),t.ended||t.reading?(i=!1,Be("reading or ended",i)):i&&(Be("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=X$(r,t)));var n;return e>0?n=i1(e,t):n=null,n===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&aS(this)),n!==null&&this.emit("data",n),n};function DX(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,pp(e)}}function pp(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Be("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?ea.nextTick(J$,e):J$(e))}function J$(e){Be("emit readable"),e.emit("readable"),uS(e)}function n1(e,t){t.readingMore||(t.readingMore=!0,ea.nextTick(NX,e,t))}function NX(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(Be("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}ct.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};ct.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,Be("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,o=n?a:_;i.endEmitted?ea.nextTick(o):r.once("end",o),e.on("unpipe",s);function s(k,S){Be("onunpipe"),k===r&&S&&S.hasUnpiped===!1&&(S.hasUnpiped=!0,l())}function a(){Be("onend"),e.end()}var c=PX(r);e.on("drain",c);var u=!1;function l(){Be("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",_),r.removeListener("data",p),u=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c()}var f=!1;r.on("data",p);function p(k){Be("ondata"),f=!1;var S=e.write(k);S===!1&&!f&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&o1(i.pipes,e)!==-1)&&!u&&(Be("false write response, pause",i.awaitDrain),i.awaitDrain++,f=!0),r.pause())}function d(k){Be("onerror",k),_(),e.removeListener("error",d),Y$(e,"error")===0&&e.emit("error",k)}CX(e,"error",d);function h(){e.removeListener("finish",m),_()}e.once("close",h);function m(){Be("onfinish"),e.removeListener("close",h),_()}e.once("finish",m);function _(){Be("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(Be("pipe resume"),r.resume()),e};function PX(e){return function(){var t=e._readableState;Be("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&Y$(e,"data")&&(t.flowing=!0,uS(e))}}ct.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=o1(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};ct.prototype.on=function(e,t){var r=cS.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var i=this._readableState;!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&pp(this):ea.nextTick(qX,this))}return r};ct.prototype.addListener=ct.prototype.on;function qX(e){Be("readable nexttick read 0"),e.read(0)}ct.prototype.resume=function(){var e=this._readableState;return e.flowing||(Be("resume"),e.flowing=!0,jX(this,e)),this};function jX(e,t){t.resumeScheduled||(t.resumeScheduled=!0,ea.nextTick(MX,e,t))}function MX(e,t){t.reading||(Be("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),uS(e),t.flowing&&!t.reading&&e.read(0)}ct.prototype.pause=function(){return Be("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Be("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function uS(e){var t=e._readableState;for(Be("flow",t.flowing);t.flowing&&e.read()!==null;);}ct.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(Be("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&t.push(s)}t.push(null)}),e.on("data",function(s){if(Be("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=t.push(s);a||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=(function(s){return function(){return e[s].apply(e,arguments)}})(n));for(var o=0;o<oS.length;o++)e.on(oS[o],this.emit.bind(this,oS[o]));return this._read=function(s){Be("wrapped _read",s),i&&(i=!1,e.resume())},this};Object.defineProperty(ct.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});ct._fromList=i1;function i1(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=LX(e,t.buffer,t.decoder),r}function LX(e,t,r){var i;return e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?i=t.shift():i=r?FX(e,t):zX(e,t),i}function FX(e,t){var r=t.head,i=1,n=r.data;for(e-=n.length;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(s===o.length?n+=o:n+=o.slice(0,e),e-=s,e===0){s===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(s));break}++i}return t.length-=i,n}function zX(e,t){var r=Eu.allocUnsafe(e),i=t.head,n=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var o=i.data,s=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,s),e-=s,e===0){s===o.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=o.slice(s));break}++n}return t.length-=n,r}function aS(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,ea.nextTick(UX,t,e))}function UX(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function o1(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var lS=w((I0e,u1)=>{"use strict";u1.exports=Hn;var hp=yo(),c1=Object.create(mo());c1.inherits=Js();c1.inherits(Hn,hp);function BX(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Hn(e){if(!(this instanceof Hn))return new Hn(e);hp.call(this,e),this._transformState={afterTransform:BX.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",WX)}function WX(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){a1(e,t,r)}):a1(this,null,null)}Hn.prototype.push=function(e,t){return this._transformState.needTransform=!1,hp.prototype.push.call(this,e,t)};Hn.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};Hn.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};Hn.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Hn.prototype._destroy=function(e,t){var r=this;hp.prototype._destroy.call(this,e,function(i){t(i),r.emit("close")})};function a1(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var p1=w((O0e,d1)=>{"use strict";d1.exports=ku;var l1=lS(),f1=Object.create(mo());f1.inherits=Js();f1.inherits(ku,l1);function ku(e){if(!(this instanceof ku))return new ku(e);l1.call(this,e)}ku.prototype._transform=function(e,t,r){r(null,e)}});var h1=w((Kt,mp)=>{var dn=B("stream");process.env.READABLE_STREAM==="disable"&&dn?(mp.exports=dn,Kt=mp.exports=dn.Readable,Kt.Readable=dn.Readable,Kt.Writable=dn.Writable,Kt.Duplex=dn.Duplex,Kt.Transform=dn.Transform,Kt.PassThrough=dn.PassThrough,Kt.Stream=dn):(Kt=mp.exports=eS(),Kt.Stream=dn||Kt,Kt.Readable=Kt,Kt.Writable=Jx(),Kt.Duplex=yo(),Kt.Transform=lS(),Kt.PassThrough=p1())});var pS=w((C0e,dS)=>{"use strict";var fS=h1();function ta(e,t,r){typeof r>"u"&&(r=t,t=e,e=null),fS.Duplex.call(this,e),typeof r.read!="function"&&(r=new fS.Readable(e).wrap(r)),this._writable=t,this._readable=r,this._waiting=!1;var i=this;t.once("finish",function(){i.end()}),this.once("finish",function(){t.end()}),r.on("readable",function(){i._waiting&&(i._waiting=!1,i._read())}),r.once("end",function(){i.push(null)}),(!e||typeof e.bubbleErrors>"u"||e.bubbleErrors)&&(t.on("error",function(n){i.emit("error",n)}),r.on("error",function(n){i.emit("error",n)}))}ta.prototype=Object.create(fS.Duplex.prototype,{constructor:{value:ta}});ta.prototype._write=function(t,r,i){this._writable.write(t,r,i)};ta.prototype._read=function(){for(var t,r=0;(t=this._readable.read())!==null;)this.push(t),r++;r===0&&(this._waiting=!0)};dS.exports=function(t,r,i){return new ta(t,r,i)};dS.exports.DuplexWrapper=ta});var g1=w((A0e,m1)=>{var hS=B("stream"),HX=ip(),VX=pS(),ZX=tp();function GX(e,t){let r=hS.PassThrough({objectMode:!0}),i=hS.PassThrough(),n=hS.Transform({objectMode:!0}),o=e instanceof RegExp?e:e&&new RegExp(e),s;n._transform=function(c,u,l){if(s||o&&!o.exec(c.path))return c.autodrain(),l();s=!0,a.emit("entry",c),c.on("error",function(f){i.emit("error",f)}),c.pipe(i).on("error",function(f){l(f)}).on("finish",function(f){l(null,f)})},r.pipe(HX(t)).on("error",function(c){i.emit("error",c)}).pipe(n).on("error",Object).on("finish",function(){s?i.end():i.emit("error",new Error("PATTERN_NOT_FOUND"))});let a=VX(r,i);return a.buffer=function(){return ZX(i)},a}m1.exports=GX});var Mt=w(mS=>{"use strict";mS.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]=="function")e.apply(this,t);else return new Promise((r,i)=>{t.push((n,o)=>n!=null?i(n):r(o)),e.apply(this,t)})},"name",{value:e.name})};mS.fromPromise=function(e){return Object.defineProperty(function(...t){let r=t[t.length-1];if(typeof r!="function")return e.apply(this,t);t.pop(),e.apply(this,t).then(i=>r(null,i),r)},"name",{value:e.name})}});var v1=w((R0e,y1)=>{var Ti=B("constants"),KX=process.cwd,gp=null,XX=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return gp||(gp=KX.call(process)),gp};try{process.cwd()}catch{}typeof process.chdir=="function"&&(gS=process.chdir,process.chdir=function(e){gp=null,gS.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,gS));var gS;y1.exports=JX;function JX(e){Ti.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=o(e.chown),e.fchown=o(e.fchown),e.lchown=o(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=s(e.chownSync),e.fchownSync=s(e.fchownSync),e.lchownSync=s(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=a(e.stat),e.fstat=a(e.fstat),e.lstat=a(e.lstat),e.statSync=c(e.statSync),e.fstatSync=c(e.fstatSync),e.lstatSync=c(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(l,f,p){p&&process.nextTick(p)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(l,f,p,d){d&&process.nextTick(d)},e.lchownSync=function(){}),XX==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(l){function f(p,d,h){var m=Date.now(),_=0;l(p,d,function k(S){if(S&&(S.code==="EACCES"||S.code==="EPERM"||S.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){e.stat(d,function(v,g){v&&v.code==="ENOENT"?l(p,d,k):h(S)})},_),_<100&&(_+=10);return}h&&h(S)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(l){function f(p,d,h,m,_,k){var S;if(k&&typeof k=="function"){var v=0;S=function(g,y,T){if(g&&g.code==="EAGAIN"&&v<10)return v++,l.call(e,p,d,h,m,_,S);k.apply(this,arguments)}}return l.call(e,p,d,h,m,_,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(l){return function(f,p,d,h,m){for(var _=0;;)try{return l.call(e,f,p,d,h,m)}catch(k){if(k.code==="EAGAIN"&&_<10){_++;continue}throw k}}})(e.readSync);function t(l){l.lchmod=function(f,p,d){l.open(f,Ti.O_WRONLY|Ti.O_SYMLINK,p,function(h,m){if(h){d&&d(h);return}l.fchmod(m,p,function(_){l.close(m,function(k){d&&d(_||k)})})})},l.lchmodSync=function(f,p){var d=l.openSync(f,Ti.O_WRONLY|Ti.O_SYMLINK,p),h=!0,m;try{m=l.fchmodSync(d,p),h=!1}finally{if(h)try{l.closeSync(d)}catch{}else l.closeSync(d)}return m}}function r(l){Ti.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,p,d,h){l.open(f,Ti.O_SYMLINK,function(m,_){if(m){h&&h(m);return}l.futimes(_,p,d,function(k){l.close(_,function(S){h&&h(k||S)})})})},l.lutimesSync=function(f,p,d){var h=l.openSync(f,Ti.O_SYMLINK),m,_=!0;try{m=l.futimesSync(h,p,d),_=!1}finally{if(_)try{l.closeSync(h)}catch{}else l.closeSync(h)}return m}):l.futimes&&(l.lutimes=function(f,p,d,h){h&&process.nextTick(h)},l.lutimesSync=function(){})}function i(l){return l&&function(f,p,d){return l.call(e,f,p,function(h){u(h)&&(h=null),d&&d.apply(this,arguments)})}}function n(l){return l&&function(f,p){try{return l.call(e,f,p)}catch(d){if(!u(d))throw d}}}function o(l){return l&&function(f,p,d,h){return l.call(e,f,p,d,function(m){u(m)&&(m=null),h&&h.apply(this,arguments)})}}function s(l){return l&&function(f,p,d){try{return l.call(e,f,p,d)}catch(h){if(!u(h))throw h}}}function a(l){return l&&function(f,p,d){typeof p=="function"&&(d=p,p=null);function h(m,_){_&&(_.uid<0&&(_.uid+=4294967296),_.gid<0&&(_.gid+=4294967296)),d&&d.apply(this,arguments)}return p?l.call(e,f,p,h):l.call(e,f,h)}}function c(l){return l&&function(f,p){var d=p?l.call(e,f,p):l.call(e,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function u(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var w1=w((D0e,_1)=>{var b1=B("stream").Stream;_1.exports=YX;function YX(e){return{ReadStream:t,WriteStream:r};function t(i,n){if(!(this instanceof t))return new t(i,n);b1.call(this);var o=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var s=Object.keys(n),a=0,c=s.length;a<c;a++){var u=s[a];this[u]=n[u]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}e.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(i,n){if(!(this instanceof r))return new r(i,n);b1.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var o=Object.keys(n),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=n[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var S1=w((N0e,x1)=>{"use strict";x1.exports=eJ;var QX=Object.getPrototypeOf||function(e){return e.__proto__};function eJ(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:QX(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var Ii=w((P0e,bS)=>{var ht=B("fs"),tJ=v1(),rJ=w1(),nJ=S1(),yp=B("util"),Xt,bp;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Xt=Symbol.for("graceful-fs.queue"),bp=Symbol.for("graceful-fs.previous")):(Xt="___graceful-fs.queue",bp="___graceful-fs.previous");function iJ(){}function T1(e,t){Object.defineProperty(e,Xt,{get:function(){return t}})}var vo=iJ;yp.debuglog?vo=yp.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(vo=function(){var e=yp.format.apply(yp,arguments);e="GFS4: "+e.split(/\n/).join(`
|
|
3
|
-
GFS4: `),console.error(e)});ht[Xt]||(E1=global[Xt]||[],T1(ht,E1),ht.close=(function(e){function t(r,i){return e.call(ht,r,function(n){n||k1(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(t,bp,{value:e}),t})(ht.close),ht.closeSync=(function(e){function t(r){e.apply(ht,arguments),k1()}return Object.defineProperty(t,bp,{value:e}),t})(ht.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){vo(ht[Xt]),B("assert").equal(ht[Xt].length,0)}));var E1;global[Xt]||T1(global,ht[Xt]);bS.exports=yS(nJ(ht));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ht.__patched&&(bS.exports=yS(ht),ht.__patched=!0);function yS(e){tJ(e),e.gracefulify=yS,e.createReadStream=y,e.createWriteStream=T;var t=e.readFile;e.readFile=r;function r(b,O,A){return typeof O=="function"&&(A=O,O=null),P(b,O,A);function P(D,V,$,U){return t(D,V,function(Z){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?ra([P,[D,V,$],Z,U||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=n;function n(b,O,A,P){return typeof A=="function"&&(P=A,A=null),D(b,O,A,P);function D(V,$,U,Z,J){return i(V,$,U,function(j){j&&(j.code==="EMFILE"||j.code==="ENFILE")?ra([D,[V,$,U,Z],j,J||Date.now(),Date.now()]):typeof Z=="function"&&Z.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=s);function s(b,O,A,P){return typeof A=="function"&&(P=A,A=null),D(b,O,A,P);function D(V,$,U,Z,J){return o(V,$,U,function(j){j&&(j.code==="EMFILE"||j.code==="ENFILE")?ra([D,[V,$,U,Z],j,J||Date.now(),Date.now()]):typeof Z=="function"&&Z.apply(this,arguments)})}}var a=e.copyFile;a&&(e.copyFile=c);function c(b,O,A,P){return typeof A=="function"&&(P=A,A=0),D(b,O,A,P);function D(V,$,U,Z,J){return a(V,$,U,function(j){j&&(j.code==="EMFILE"||j.code==="ENFILE")?ra([D,[V,$,U,Z],j,J||Date.now(),Date.now()]):typeof Z=="function"&&Z.apply(this,arguments)})}}var u=e.readdir;e.readdir=f;var l=/^v[0-5]\./;function f(b,O,A){typeof O=="function"&&(A=O,O=null);var P=l.test(process.version)?function($,U,Z,J){return u($,D($,U,Z,J))}:function($,U,Z,J){return u($,U,D($,U,Z,J))};return P(b,O,A);function D(V,$,U,Z){return function(J,j){J&&(J.code==="EMFILE"||J.code==="ENFILE")?ra([P,[V,$,U],J,Z||Date.now(),Date.now()]):(j&&j.sort&&j.sort(),typeof U=="function"&&U.call(this,J,j))}}}if(process.version.substr(0,4)==="v0.8"){var p=rJ(e);k=p.ReadStream,v=p.WriteStream}var d=e.ReadStream;d&&(k.prototype=Object.create(d.prototype),k.prototype.open=S);var h=e.WriteStream;h&&(v.prototype=Object.create(h.prototype),v.prototype.open=g),Object.defineProperty(e,"ReadStream",{get:function(){return k},set:function(b){k=b},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return v},set:function(b){v=b},enumerable:!0,configurable:!0});var m=k;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(b){m=b},enumerable:!0,configurable:!0});var _=v;Object.defineProperty(e,"FileWriteStream",{get:function(){return _},set:function(b){_=b},enumerable:!0,configurable:!0});function k(b,O){return this instanceof k?(d.apply(this,arguments),this):k.apply(Object.create(k.prototype),arguments)}function S(){var b=this;I(b.path,b.flags,b.mode,function(O,A){O?(b.autoClose&&b.destroy(),b.emit("error",O)):(b.fd=A,b.emit("open",A),b.read())})}function v(b,O){return this instanceof v?(h.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function g(){var b=this;I(b.path,b.flags,b.mode,function(O,A){O?(b.destroy(),b.emit("error",O)):(b.fd=A,b.emit("open",A))})}function y(b,O){return new e.ReadStream(b,O)}function T(b,O){return new e.WriteStream(b,O)}var R=e.open;e.open=I;function I(b,O,A,P){return typeof A=="function"&&(P=A,A=null),D(b,O,A,P);function D(V,$,U,Z,J){return R(V,$,U,function(j,pe){j&&(j.code==="EMFILE"||j.code==="ENFILE")?ra([D,[V,$,U,Z],j,J||Date.now(),Date.now()]):typeof Z=="function"&&Z.apply(this,arguments)})}}return e}function ra(e){vo("ENQUEUE",e[0].name,e[1]),ht[Xt].push(e),vS()}var vp;function k1(){for(var e=Date.now(),t=0;t<ht[Xt].length;++t)ht[Xt][t].length>2&&(ht[Xt][t][3]=e,ht[Xt][t][4]=e);vS()}function vS(){if(clearTimeout(vp),vp=void 0,ht[Xt].length!==0){var e=ht[Xt].shift(),t=e[0],r=e[1],i=e[2],n=e[3],o=e[4];if(n===void 0)vo("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-n>=6e4){vo("TIMEOUT",t.name,r);var s=r.pop();typeof s=="function"&&s.call(null,i)}else{var a=Date.now()-o,c=Math.max(o-n,1),u=Math.min(c*1.2,100);a>=u?(vo("RETRY",t.name,r),t.apply(null,r.concat([n]))):ht[Xt].push(e)}vp===void 0&&(vp=setTimeout(vS,0))}}});var lr=w(Vn=>{"use strict";var I1=Mt().fromCallback,ur=Ii(),oJ=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(e=>typeof ur[e]=="function");Object.assign(Vn,ur);oJ.forEach(e=>{Vn[e]=I1(ur[e])});Vn.exists=function(e,t){return typeof t=="function"?ur.exists(e,t):new Promise(r=>ur.exists(e,r))};Vn.read=function(e,t,r,i,n,o){return typeof o=="function"?ur.read(e,t,r,i,n,o):new Promise((s,a)=>{ur.read(e,t,r,i,n,(c,u,l)=>{if(c)return a(c);s({bytesRead:u,buffer:l})})})};Vn.write=function(e,t,...r){return typeof r[r.length-1]=="function"?ur.write(e,t,...r):new Promise((i,n)=>{ur.write(e,t,...r,(o,s,a)=>{if(o)return n(o);i({bytesWritten:s,buffer:a})})})};Vn.readv=function(e,t,...r){return typeof r[r.length-1]=="function"?ur.readv(e,t,...r):new Promise((i,n)=>{ur.readv(e,t,...r,(o,s,a)=>{if(o)return n(o);i({bytesRead:s,buffers:a})})})};Vn.writev=function(e,t,...r){return typeof r[r.length-1]=="function"?ur.writev(e,t,...r):new Promise((i,n)=>{ur.writev(e,t,...r,(o,s,a)=>{if(o)return n(o);i({bytesWritten:s,buffers:a})})})};typeof ur.realpath.native=="function"?Vn.realpath.native=I1(ur.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var C1=w((j0e,O1)=>{"use strict";var sJ=B("path");O1.exports.checkPath=function(t){if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(sJ.parse(t).root,""))){let i=new Error(`Path contains invalid characters: ${t}`);throw i.code="EINVAL",i}}});var D1=w((M0e,_S)=>{"use strict";var A1=lr(),{checkPath:$1}=C1(),R1=e=>{let t={mode:511};return typeof e=="number"?e:{...t,...e}.mode};_S.exports.makeDir=async(e,t)=>($1(e),A1.mkdir(e,{mode:R1(t),recursive:!0}));_S.exports.makeDirSync=(e,t)=>($1(e),A1.mkdirSync(e,{mode:R1(t),recursive:!0}))});var Xr=w((L0e,N1)=>{"use strict";var aJ=Mt().fromPromise,{makeDir:cJ,makeDirSync:wS}=D1(),xS=aJ(cJ);N1.exports={mkdirs:xS,mkdirsSync:wS,mkdirp:xS,mkdirpSync:wS,ensureDir:xS,ensureDirSync:wS}});var Oi=w((F0e,q1)=>{"use strict";var uJ=Mt().fromPromise,P1=lr();function lJ(e){return P1.access(e).then(()=>!0).catch(()=>!1)}q1.exports={pathExists:uJ(lJ),pathExistsSync:P1.existsSync}});var SS=w((z0e,j1)=>{"use strict";var na=lr(),fJ=Mt().fromPromise;async function dJ(e,t,r){let i=await na.open(e,"r+"),n=null;try{await na.futimes(i,t,r)}catch(o){n=o}finally{try{await na.close(i)}catch(o){n||(n=o)}}if(n)throw n}function pJ(e,t,r){let i=na.openSync(e,"r+"),n=null;try{na.futimesSync(i,t,r)}catch(o){n=o}finally{try{na.closeSync(i)}catch(o){n||(n=o)}}if(n)throw n}j1.exports={utimesMillis:fJ(dJ),utimesMillisSync:pJ}});var bo=w((U0e,L1)=>{"use strict";var ia=lr(),Lt=B("path"),M1=Mt().fromPromise;function hJ(e,t,r){let i=r.dereference?n=>ia.stat(n,{bigint:!0}):n=>ia.lstat(n,{bigint:!0});return Promise.all([i(e),i(t).catch(n=>{if(n.code==="ENOENT")return null;throw n})]).then(([n,o])=>({srcStat:n,destStat:o}))}function mJ(e,t,r){let i,n=r.dereference?s=>ia.statSync(s,{bigint:!0}):s=>ia.lstatSync(s,{bigint:!0}),o=n(e);try{i=n(t)}catch(s){if(s.code==="ENOENT")return{srcStat:o,destStat:null};throw s}return{srcStat:o,destStat:i}}async function gJ(e,t,r,i){let{srcStat:n,destStat:o}=await hJ(e,t,i);if(o){if(Tu(n,o)){let s=Lt.basename(e),a=Lt.basename(t);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return{srcStat:n,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!n.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(n.isDirectory()&&TS(e,t))throw new Error(_p(e,t,r));return{srcStat:n,destStat:o}}function yJ(e,t,r,i){let{srcStat:n,destStat:o}=mJ(e,t,i);if(o){if(Tu(n,o)){let s=Lt.basename(e),a=Lt.basename(t);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return{srcStat:n,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!n.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(n.isDirectory()&&TS(e,t))throw new Error(_p(e,t,r));return{srcStat:n,destStat:o}}async function ES(e,t,r,i){let n=Lt.resolve(Lt.dirname(e)),o=Lt.resolve(Lt.dirname(r));if(o===n||o===Lt.parse(o).root)return;let s;try{s=await ia.stat(o,{bigint:!0})}catch(a){if(a.code==="ENOENT")return ES(e,t,o,i);throw a}if(Tu(t,s))throw new Error(_p(e,r,i));return ES(e,t,o,i)}function kS(e,t,r,i){let n=Lt.resolve(Lt.dirname(e)),o=Lt.resolve(Lt.dirname(r));if(o===n||o===Lt.parse(o).root)return;let s;try{s=ia.statSync(o,{bigint:!0})}catch(a){if(a.code==="ENOENT")return kS(e,t,o,i);throw a}if(Tu(t,s))throw new Error(_p(e,r,i));return kS(e,t,o,i)}function Tu(e,t){return t.ino!==void 0&&t.dev!==void 0&&t.ino===e.ino&&t.dev===e.dev}function TS(e,t){let r=Lt.resolve(e).split(Lt.sep).filter(n=>n),i=Lt.resolve(t).split(Lt.sep).filter(n=>n);return r.every((n,o)=>i[o]===n)}function _p(e,t,r){return`Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}L1.exports={checkPaths:M1(gJ),checkPathsSync:yJ,checkParentPaths:M1(ES),checkParentPathsSync:kS,isSrcSubdir:TS,areIdentical:Tu}});var z1=w((B0e,F1)=>{"use strict";async function vJ(e,t){let r=[];for await(let i of e)r.push(t(i).then(()=>null,n=>n??new Error("unknown error")));await Promise.all(r.map(i=>i.then(n=>{if(n!==null)throw n})))}F1.exports={asyncIteratorConcurrentProcess:vJ}});var V1=w((W0e,H1)=>{"use strict";var tr=lr(),Iu=B("path"),{mkdirs:bJ}=Xr(),{pathExists:_J}=Oi(),{utimesMillis:wJ}=SS(),Ou=bo(),{asyncIteratorConcurrentProcess:xJ}=z1();async function SJ(e,t,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
2
|
+
var _Z=Object.create;var Dy=Object.defineProperty;var wZ=Object.getOwnPropertyDescriptor;var xZ=Object.getOwnPropertyNames;var SZ=Object.getPrototypeOf,EZ=Object.prototype.hasOwnProperty;var B=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var w=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Mn=(e,t)=>{for(var r in t)Dy(e,r,{get:t[r],enumerable:!0})},kZ=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of xZ(t))!EZ.call(e,n)&&n!==r&&Dy(e,n,{get:()=>t[n],enumerable:!(i=wZ(t,n))||i.enumerable});return e};var Vr=(e,t,r)=>(r=e!=null?_Z(SZ(e)):{},kZ(t||!e||!e.__esModule?Dy(r,"default",{value:e,enumerable:!0}):r,e));var ep=w((a0e,d$)=>{var Qd=B("stream"),f9=B("util"),d9="function";function ki(){if(!(this instanceof ki))return new ki;Qd.Duplex.call(this,{decodeStrings:!1,objectMode:!0}),this.buffer=Buffer.from("");let e=this;e.on("finish",function(){e.finished=!0,e.emit("chunk",!1)})}f9.inherits(ki,Qd.Duplex);ki.prototype._write=function(e,t,r){this.buffer=Buffer.concat([this.buffer,e]),this.cb=r,this.emit("chunk")};ki.prototype.stream=function(e,t){let r=Qd.PassThrough(),i,n=this;function o(){if(typeof n.cb===d9){let a=n.cb;return n.cb=void 0,a()}}function s(){let a;if(n.buffer&&n.buffer.length){if(typeof e=="number")a=n.buffer.slice(0,e),n.buffer=n.buffer.slice(e),e-=a.length,i=i||!e;else{let c=n.buffer.indexOf(e);if(c!==-1)n.match=c,t&&(c=c+e.length),a=n.buffer.slice(0,c),n.buffer=n.buffer.slice(c),i=!0;else{let u=n.buffer.length-e.length;u<=0?o():(a=n.buffer.slice(0,u),n.buffer=n.buffer.slice(u))}}a&&r.write(a,function(){(n.buffer.length===0||e.length&&n.buffer.length<=e.length)&&o()})}if(i)n.removeListener("chunk",s),r.end();else if(n.finished){n.removeListener("chunk",s),n.emit("error",new Error("FILE_ENDED"));return}}return n.on("chunk",s),s(),r};ki.prototype.pull=function(e,t){if(e===0)return Promise.resolve("");if(!isNaN(e)&&this.buffer.length>e){let a=this.buffer.slice(0,e);return this.buffer=this.buffer.slice(e),Promise.resolve(a)}let r=Buffer.from(""),i=this,n=new Qd.Transform;n._transform=function(a,c,u){r=Buffer.concat([r,a]),u()};let o,s;return new Promise(function(a,c){if(o=c,s=function(u){i.__emittedError=u,c(u)},i.finished)return c(new Error("FILE_ENDED"));i.once("error",s),i.stream(e,t).on("error",c).pipe(n).on("finish",function(){a(r)}).on("error",c)}).finally(function(){i.removeListener("error",o),i.removeListener("error",s)})};ki.prototype._read=function(){};d$.exports=ki});var m$=w((c0e,h$)=>{var p$=B("stream"),p9=B("util");function hu(){if(!(this instanceof hu))return new hu;p$.Transform.call(this)}p9.inherits(hu,p$.Transform);hu.prototype._transform=function(e,t,r){r()};h$.exports=hu});var tp=w((u0e,g$)=>{var h9=B("stream");g$.exports=function(e){return new Promise(function(t,r){let i=[],n=h9.Transform().on("finish",function(){t(Buffer.concat(i))}).on("error",r);n._transform=function(o,s,a){i.push(o),a()},e.on("error",r).pipe(n)})}});var mu=w((l0e,y$)=>{var m9=function(e,t,r){let i;switch(r){case 1:i=e.readUInt8(t);break;case 2:i=e.readUInt16LE(t);break;case 4:i=e.readUInt32LE(t);break;case 8:i=Number(e.readBigUInt64LE(t));break;default:throw new Error("Unsupported UInt LE size!")}return i},g9=function(e,t){let r={},i=0;for(let[n,o]of t)e.length>=i+o?r[n]=m9(e,i,o):r[n]=null,i+=o;return r};y$.exports={parse:g9}});var rp=w((f0e,b$)=>{var v$=mu();b$.exports=function(e,t){let r;for(;!r&&e&&e.length;){let i=v$.parse(e,[["signature",2],["partSize",2]]);if(i.signature===1){let n=[];t.uncompressedSize===4294967295&&n.push(["uncompressedSize",8]),t.compressedSize===4294967295&&n.push(["compressedSize",8]),t.offsetToLocalFileHeader===4294967295&&n.push(["offsetToLocalFileHeader",8]),r=v$.parse(e.slice(4),n)}else e=e.slice(i.partSize+4)}return r=r||{},t.compressedSize===4294967295&&(t.compressedSize=r.compressedSize),t.uncompressedSize===4294967295&&(t.uncompressedSize=r.uncompressedSize),t.offsetToLocalFileHeader===4294967295&&(t.offsetToLocalFileHeader=r.offsetToLocalFileHeader),r}});var np=w((d0e,_$)=>{_$.exports=function(t,r){let i=t&31,n=t>>5&15,o=(t>>9&127)+1980,s=r?(r&31)*2:0,a=r?r>>5&63:0,c=r?r>>11:0;return new Date(Date.UTC(o,n-1,i,c,a,s))}});var ip=w((p0e,S$)=>{var y9=B("util"),v9=B("zlib"),zx=B("stream"),w$=ep(),b9=m$(),_9=tp(),w9=rp(),x9=np(),S9=zx.pipeline,gu=mu(),x$=Buffer.alloc(4);x$.writeUInt32LE(101010256,0);function Kr(e){if(!(this instanceof Kr))return new Kr(e);let t=this;t._opts=e||{verbose:!1},w$.call(t,t._opts),t.on("finish",function(){t.emit("end"),t.emit("close")}),t._readRecord().catch(function(r){(!t.__emittedError||t.__emittedError!==r)&&t.emit("error",r)})}y9.inherits(Kr,w$);Kr.prototype._readRecord=function(){let e=this;return e.pull(4).then(function(t){if(t.length===0)return;let r=t.readUInt32LE(0);if(r===875721283)return e._readCrxHeader();if(r===67324752)return e._readFile();if(r===33639248)return e.reachedCD=!0,e._readCentralDirectoryFileHeader();if(r===101010256)return e._readEndOfCentralDirectoryRecord();if(e.reachedCD)return e.pull(x$,!0).then(function(){return e._readEndOfCentralDirectoryRecord()});e.emit("error",new Error("invalid signature: 0x"+r.toString(16)))}).then((function(t){if(t)return e._readRecord()}))};Kr.prototype._readCrxHeader=function(){let e=this;return e.pull(12).then(function(t){return e.crxHeader=gu.parse(t,[["version",4],["pubKeyLength",4],["signatureLength",4]]),e.pull(e.crxHeader.pubKeyLength+e.crxHeader.signatureLength)}).then(function(t){return e.crxHeader.publicKey=t.slice(0,e.crxHeader.pubKeyLength),e.crxHeader.signature=t.slice(e.crxHeader.pubKeyLength),e.emit("crx-header",e.crxHeader),!0})};Kr.prototype._readFile=function(){let e=this;return e.pull(26).then(function(t){let r=gu.parse(t,[["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2]]);return r.lastModifiedDateTime=x9(r.lastModifiedDate,r.lastModifiedTime),e.crxHeader&&(r.crxHeader=e.crxHeader),e.pull(r.fileNameLength).then(function(i){let n=i.toString("utf8"),o=zx.PassThrough(),s=!1;return o.autodrain=function(){s=!0;let a=o.pipe(b9());return a.promise=function(){return new Promise(function(c,u){a.on("finish",c),a.on("error",u)})},a},o.buffer=function(){return _9(o)},o.path=n,o.props={},o.props.path=n,o.props.pathBuffer=i,o.props.flags={isUnicode:(r.flags&2048)!=0},o.type=r.uncompressedSize===0&&/[/\\]$/.test(n)?"Directory":"File",e._opts.verbose&&(o.type==="Directory"?console.log(" creating:",n):o.type==="File"&&(r.compressionMethod===0?console.log(" extracting:",n):console.log(" inflating:",n))),e.pull(r.extraFieldLength).then(function(a){let c=w9(a,r);o.vars=r,o.extra=c,e._opts.forceStream?e.push(o):(e.emit("entry",o),(e._readableState.pipesCount||e._readableState.pipes&&e._readableState.pipes.length)&&e.push(o)),e._opts.verbose&&console.log({filename:n,vars:r,extra:c});let u=!(r.flags&8)||r.compressedSize>0,l;o.__autodraining=s;let f=r.compressionMethod&&!s?v9.createInflateRaw():zx.PassThrough();return u?(o.size=r.uncompressedSize,l=r.compressedSize):(l=Buffer.alloc(4),l.writeUInt32LE(134695760,0)),new Promise(function(p,d){S9(e.stream(l),f,o,function(h){return h?d(h):u?p(u):e._processDataDescriptor(o).then(p).catch(d)})})})})})};Kr.prototype._processDataDescriptor=function(e){return this.pull(16).then(function(r){let i=gu.parse(r,[["dataDescriptorSignature",4],["crc32",4],["compressedSize",4],["uncompressedSize",4]]);return e.size=i.uncompressedSize,!0})};Kr.prototype._readCentralDirectoryFileHeader=function(){let e=this;return e.pull(42).then(function(t){let r=gu.parse(t,[["versionMadeBy",2],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2],["fileCommentLength",2],["diskNumber",2],["internalFileAttributes",2],["externalFileAttributes",4],["offsetToLocalFileHeader",4]]);return e.pull(r.fileNameLength).then(function(i){return r.fileName=i.toString("utf8"),e.pull(r.extraFieldLength)}).then(function(){return e.pull(r.fileCommentLength)}).then(function(){return!0})})};Kr.prototype._readEndOfCentralDirectoryRecord=function(){let e=this;return e.pull(18).then(function(t){let r=gu.parse(t,[["diskNumber",2],["diskStart",2],["numberOfRecordsOnDisk",2],["numberOfRecords",2],["sizeOfCentralDirectory",4],["offsetToStartOfCentralDirectory",4],["commentLength",2]]);return e.pull(r.commentLength).then(function(){e.end(),e.push(null)})})};Kr.prototype.promise=function(){let e=this;return new Promise(function(t,r){e.on("finish",t),e.on("error",r)})};S$.exports=Kr});var yu=w((h0e,Ux)=>{"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Ux.exports={nextTick:E9}:Ux.exports=process;function E9(e,t,r,i){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,o,s;switch(n){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,r)});case 4:return process.nextTick(function(){e.call(null,t,r,i)});default:for(o=new Array(n-1),s=0;s<o.length;)o[s++]=arguments[s];return process.nextTick(function(){e.apply(null,o)})}}});var k$=w((m0e,E$)=>{var k9={}.toString;E$.exports=Array.isArray||function(e){return k9.call(e)=="[object Array]"}});var Bx=w((g0e,T$)=>{T$.exports=B("stream")});var vu=w((Wx,O$)=>{var op=B("buffer"),Bn=op.Buffer;function I$(e,t){for(var r in e)t[r]=e[r]}Bn.from&&Bn.alloc&&Bn.allocUnsafe&&Bn.allocUnsafeSlow?O$.exports=op:(I$(op,Wx),Wx.Buffer=Xs);function Xs(e,t,r){return Bn(e,t,r)}I$(Bn,Xs);Xs.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Bn(e,t,r)};Xs.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=Bn(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};Xs.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Bn(e)};Xs.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return op.SlowBuffer(e)}});var mo=w(er=>{function T9(e){return Array.isArray?Array.isArray(e):sp(e)==="[object Array]"}er.isArray=T9;function I9(e){return typeof e=="boolean"}er.isBoolean=I9;function O9(e){return e===null}er.isNull=O9;function C9(e){return e==null}er.isNullOrUndefined=C9;function A9(e){return typeof e=="number"}er.isNumber=A9;function $9(e){return typeof e=="string"}er.isString=$9;function R9(e){return typeof e=="symbol"}er.isSymbol=R9;function D9(e){return e===void 0}er.isUndefined=D9;function N9(e){return sp(e)==="[object RegExp]"}er.isRegExp=N9;function P9(e){return typeof e=="object"&&e!==null}er.isObject=P9;function q9(e){return sp(e)==="[object Date]"}er.isDate=q9;function j9(e){return sp(e)==="[object Error]"||e instanceof Error}er.isError=j9;function M9(e){return typeof e=="function"}er.isFunction=M9;function L9(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}er.isPrimitive=L9;er.isBuffer=B("buffer").Buffer.isBuffer;function sp(e){return Object.prototype.toString.call(e)}});var C$=w((v0e,Hx)=>{typeof Object.create=="function"?Hx.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Hx.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var Js=w((b0e,Zx)=>{try{if(Vx=B("util"),typeof Vx.inherits!="function")throw"";Zx.exports=Vx.inherits}catch{Zx.exports=C$()}var Vx});var $$=w((_0e,Gx)=>{"use strict";function F9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var A$=vu().Buffer,bu=B("util");function z9(e,t,r){e.copy(t,r)}Gx.exports=(function(){function e(){F9(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},e.prototype.unshift=function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},e.prototype.concat=function(r){if(this.length===0)return A$.alloc(0);for(var i=A$.allocUnsafe(r>>>0),n=this.head,o=0;n;)z9(n.data,i,o),o+=n.data.length,n=n.next;return i},e})();bu&&bu.inspect&&bu.inspect.custom&&(Gx.exports.prototype[bu.inspect.custom]=function(){var e=bu.inspect({length:this.length});return this.constructor.name+" "+e})});var Kx=w((w0e,R$)=>{"use strict";var ap=yu();function U9(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ap.nextTick(cp,this,e)):ap.nextTick(cp,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,ap.nextTick(cp,r,o)):ap.nextTick(cp,r,o):t&&t(o)}),this)}function B9(){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)}function cp(e,t){e.emit("error",t)}R$.exports={destroy:U9,undestroy:B9}});var N$=w((x0e,D$)=>{D$.exports=B("util").deprecate});var Jx=w((S0e,U$)=>{"use strict";var go=yu();U$.exports=At;function q$(e){var t=this;this.next=null,this.entry=null,this.finish=function(){aX(t,e)}}var W9=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:go.nextTick,Ys;At.WritableState=wu;var j$=Object.create(mo());j$.inherits=Js();var H9={deprecate:N$()},M$=Bx(),lp=vu().Buffer,V9=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Z9(e){return lp.from(e)}function G9(e){return lp.isBuffer(e)||e instanceof V9}var L$=Kx();j$.inherits(At,M$);function K9(){}function wu(e,t){Ys=Ys||yo(),e=e||{};var r=t instanceof Ys;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=e.writableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=e.decodeStrings===!1;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(a){rX(t,a)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new q$(this)}wu.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(wu.prototype,"buffer",{get:H9.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var up;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(up=Function.prototype[Symbol.hasInstance],Object.defineProperty(At,Symbol.hasInstance,{value:function(e){return up.call(this,e)?!0:this!==At?!1:e&&e._writableState instanceof wu}})):up=function(e){return e instanceof this};function At(e){if(Ys=Ys||yo(),!up.call(At,this)&&!(this instanceof Ys))return new At(e);this._writableState=new wu(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),M$.call(this)}At.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function X9(e,t){var r=new Error("write after end");e.emit("error",r),go.nextTick(t,r)}function J9(e,t,r,i){var n=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),go.nextTick(i,o),n=!1),n}At.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&G9(e);return o&&!lp.isBuffer(e)&&(e=Z9(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=K9),i.ended?X9(this,r):(o||J9(this,i,e,r))&&(i.pendingcb++,n=Q9(this,i,o,e,t,r)),n};At.prototype.cork=function(){var e=this._writableState;e.corked++};At.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&F$(this,e))};At.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function Y9(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=lp.from(t,r)),t}Object.defineProperty(At.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Q9(e,t,r,i,n,o){if(!r){var s=Y9(t,i,n);i!==s&&(r=!0,n="buffer",i=s)}var a=t.objectMode?1:i.length;t.length+=a;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Xx(e,t,!1,a,i,n,o);return c}function Xx(e,t,r,i,n,o,s){t.writelen=i,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function eX(e,t,r,i,n){--t.pendingcb,r?(go.nextTick(n,i),go.nextTick(_u,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(n(i),e._writableState.errorEmitted=!0,e.emit("error",i),_u(e,t))}function tX(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function rX(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(tX(r),t)eX(e,r,i,t,n);else{var o=z$(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&F$(e,r),i?W9(P$,e,r,o,n):P$(e,r,o,n)}}function P$(e,t,r,i){r||nX(e,t),t.pendingcb--,i(),_u(e,t)}function nX(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function F$(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)n[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;n.allBuffers=a,Xx(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new q$(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,u=r.encoding,l=r.callback,f=t.objectMode?1:c.length;if(Xx(e,t,!1,f,c,u,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}At.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};At.prototype._writev=null;At.prototype.end=function(e,t,r){var i=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||sX(this,i,r)};function z$(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function iX(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),_u(e,t)})}function oX(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,go.nextTick(iX,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function _u(e,t){var r=z$(t);return r&&(oX(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function sX(e,t,r){t.ending=!0,_u(e,t),r&&(t.finished?go.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function aX(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}Object.defineProperty(At.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});At.prototype.destroy=L$.destroy;At.prototype._undestroy=L$.undestroy;At.prototype._destroy=function(e,t){this.end(),t(e)}});var yo=w((E0e,V$)=>{"use strict";var B$=yu(),cX=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};V$.exports=Wn;var W$=Object.create(mo());W$.inherits=Js();var H$=eS(),Qx=Jx();W$.inherits(Wn,H$);for(Yx=cX(Qx.prototype),fp=0;fp<Yx.length;fp++)dp=Yx[fp],Wn.prototype[dp]||(Wn.prototype[dp]=Qx.prototype[dp]);var Yx,dp,fp;function Wn(e){if(!(this instanceof Wn))return new Wn(e);H$.call(this,e),Qx.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",uX)}Object.defineProperty(Wn.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function uX(){this.allowHalfOpen||this._writableState.ended||B$.nextTick(lX,this)}function lX(e){e.end()}Object.defineProperty(Wn.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});Wn.prototype._destroy=function(e,t){this.push(null),this.end(),B$.nextTick(t,e)}});var nS=w(G$=>{"use strict";var rS=vu().Buffer,Z$=rS.isEncoding||function(e){switch(e=""+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 fX(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}}function dX(e){var t=fX(e);if(typeof t!="string"&&(rS.isEncoding===Z$||!Z$(e)))throw new Error("Unknown encoding: "+e);return t||e}G$.StringDecoder=xu;function xu(e){this.encoding=dX(e);var t;switch(this.encoding){case"utf16le":this.text=vX,this.end=bX,t=4;break;case"utf8":this.fillLast=mX,t=4;break;case"base64":this.text=_X,this.end=wX,t=3;break;default:this.write=xX,this.end=SX;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=rS.allocUnsafe(t)}xu.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};xu.prototype.end=yX;xu.prototype.text=gX;xu.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};function tS(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function pX(e,t,r){var i=t.length-1;if(i<r)return 0;var n=tS(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=tS(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=tS(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function hX(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function mX(e){var t=this.lastTotal-this.lastNeed,r=hX(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function gX(e,t){var r=pX(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}function yX(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function vX(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function bX(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function _X(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?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-r))}function wX(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function xX(e){return e.toString(this.encoding)}function SX(e){return e&&e.length?this.write(e):""}});var eS=w((I0e,s1)=>{"use strict";var ea=yu();s1.exports=ct;var EX=k$(),Su;ct.ReadableState=t1;var T0e=B("events").EventEmitter,Y$=function(e,t){return e.listeners(t).length},cS=Bx(),Eu=vu().Buffer,kX=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function TX(e){return Eu.from(e)}function IX(e){return Eu.isBuffer(e)||e instanceof kX}var Q$=Object.create(mo());Q$.inherits=Js();var iS=B("util"),Be=void 0;iS&&iS.debuglog?Be=iS.debuglog("stream"):Be=function(){};var OX=$$(),e1=Kx(),Qs;Q$.inherits(ct,cS);var oS=["error","close","destroy","pause","resume"];function CX(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):EX(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function t1(e,t){Su=Su||yo(),e=e||{};var r=t instanceof Su;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,n=e.readableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new OX,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.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Qs||(Qs=nS().StringDecoder),this.decoder=new Qs(e.encoding),this.encoding=e.encoding)}function ct(e){if(Su=Su||yo(),!(this instanceof ct))return new ct(e);this._readableState=new t1(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),cS.call(this)}Object.defineProperty(ct.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});ct.prototype.destroy=e1.destroy;ct.prototype._undestroy=e1.undestroy;ct.prototype._destroy=function(e,t){this.push(null),t(e)};ct.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Eu.from(e,t),t=""),i=!0),r1(this,e,t,!1,i)};ct.prototype.unshift=function(e){return r1(this,e,null,!0,!1)};function r1(e,t,r,i,n){var o=e._readableState;if(t===null)o.reading=!1,DX(e,o);else{var s;n||(s=AX(o,t)),s?e.emit("error",s):o.objectMode||t&&t.length>0?(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==Eu.prototype&&(t=TX(t)),i?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):sS(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?sS(e,o,t,!1):n1(e,o)):sS(e,o,t,!1))):i||(o.reading=!1)}return $X(o)}function sS(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&pp(e)),n1(e,t)}function AX(e,t){var r;return!IX(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function $X(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}ct.prototype.isPaused=function(){return this._readableState.flowing===!1};ct.prototype.setEncoding=function(e){return Qs||(Qs=nS().StringDecoder),this._readableState.decoder=new Qs(e),this._readableState.encoding=e,this};var K$=8388608;function RX(e){return e>=K$?e=K$:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function X$(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=RX(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}ct.prototype.read=function(e){Be("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return Be("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?aS(this):pp(this),null;if(e=X$(e,t),e===0&&t.ended)return t.length===0&&aS(this),null;var i=t.needReadable;Be("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,Be("length less than watermark",i)),t.ended||t.reading?(i=!1,Be("reading or ended",i)):i&&(Be("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=X$(r,t)));var n;return e>0?n=i1(e,t):n=null,n===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&aS(this)),n!==null&&this.emit("data",n),n};function DX(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,pp(e)}}function pp(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Be("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?ea.nextTick(J$,e):J$(e))}function J$(e){Be("emit readable"),e.emit("readable"),uS(e)}function n1(e,t){t.readingMore||(t.readingMore=!0,ea.nextTick(NX,e,t))}function NX(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(Be("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}ct.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};ct.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,Be("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,o=n?a:_;i.endEmitted?ea.nextTick(o):r.once("end",o),e.on("unpipe",s);function s(k,S){Be("onunpipe"),k===r&&S&&S.hasUnpiped===!1&&(S.hasUnpiped=!0,l())}function a(){Be("onend"),e.end()}var c=PX(r);e.on("drain",c);var u=!1;function l(){Be("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",_),r.removeListener("data",p),u=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c()}var f=!1;r.on("data",p);function p(k){Be("ondata"),f=!1;var S=e.write(k);S===!1&&!f&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&o1(i.pipes,e)!==-1)&&!u&&(Be("false write response, pause",i.awaitDrain),i.awaitDrain++,f=!0),r.pause())}function d(k){Be("onerror",k),_(),e.removeListener("error",d),Y$(e,"error")===0&&e.emit("error",k)}CX(e,"error",d);function h(){e.removeListener("finish",m),_()}e.once("close",h);function m(){Be("onfinish"),e.removeListener("close",h),_()}e.once("finish",m);function _(){Be("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(Be("pipe resume"),r.resume()),e};function PX(e){return function(){var t=e._readableState;Be("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&Y$(e,"data")&&(t.flowing=!0,uS(e))}}ct.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=o1(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};ct.prototype.on=function(e,t){var r=cS.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var i=this._readableState;!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&pp(this):ea.nextTick(qX,this))}return r};ct.prototype.addListener=ct.prototype.on;function qX(e){Be("readable nexttick read 0"),e.read(0)}ct.prototype.resume=function(){var e=this._readableState;return e.flowing||(Be("resume"),e.flowing=!0,jX(this,e)),this};function jX(e,t){t.resumeScheduled||(t.resumeScheduled=!0,ea.nextTick(MX,e,t))}function MX(e,t){t.reading||(Be("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),uS(e),t.flowing&&!t.reading&&e.read(0)}ct.prototype.pause=function(){return Be("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Be("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function uS(e){var t=e._readableState;for(Be("flow",t.flowing);t.flowing&&e.read()!==null;);}ct.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(Be("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&t.push(s)}t.push(null)}),e.on("data",function(s){if(Be("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=t.push(s);a||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=(function(s){return function(){return e[s].apply(e,arguments)}})(n));for(var o=0;o<oS.length;o++)e.on(oS[o],this.emit.bind(this,oS[o]));return this._read=function(s){Be("wrapped _read",s),i&&(i=!1,e.resume())},this};Object.defineProperty(ct.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});ct._fromList=i1;function i1(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=LX(e,t.buffer,t.decoder),r}function LX(e,t,r){var i;return e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?i=t.shift():i=r?FX(e,t):zX(e,t),i}function FX(e,t){var r=t.head,i=1,n=r.data;for(e-=n.length;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(s===o.length?n+=o:n+=o.slice(0,e),e-=s,e===0){s===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(s));break}++i}return t.length-=i,n}function zX(e,t){var r=Eu.allocUnsafe(e),i=t.head,n=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var o=i.data,s=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,s),e-=s,e===0){s===o.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=o.slice(s));break}++n}return t.length-=n,r}function aS(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,ea.nextTick(UX,t,e))}function UX(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function o1(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var lS=w((O0e,u1)=>{"use strict";u1.exports=Hn;var hp=yo(),c1=Object.create(mo());c1.inherits=Js();c1.inherits(Hn,hp);function BX(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Hn(e){if(!(this instanceof Hn))return new Hn(e);hp.call(this,e),this._transformState={afterTransform:BX.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",WX)}function WX(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){a1(e,t,r)}):a1(this,null,null)}Hn.prototype.push=function(e,t){return this._transformState.needTransform=!1,hp.prototype.push.call(this,e,t)};Hn.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};Hn.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};Hn.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Hn.prototype._destroy=function(e,t){var r=this;hp.prototype._destroy.call(this,e,function(i){t(i),r.emit("close")})};function a1(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var p1=w((C0e,d1)=>{"use strict";d1.exports=ku;var l1=lS(),f1=Object.create(mo());f1.inherits=Js();f1.inherits(ku,l1);function ku(e){if(!(this instanceof ku))return new ku(e);l1.call(this,e)}ku.prototype._transform=function(e,t,r){r(null,e)}});var h1=w((Kt,mp)=>{var dn=B("stream");process.env.READABLE_STREAM==="disable"&&dn?(mp.exports=dn,Kt=mp.exports=dn.Readable,Kt.Readable=dn.Readable,Kt.Writable=dn.Writable,Kt.Duplex=dn.Duplex,Kt.Transform=dn.Transform,Kt.PassThrough=dn.PassThrough,Kt.Stream=dn):(Kt=mp.exports=eS(),Kt.Stream=dn||Kt,Kt.Readable=Kt,Kt.Writable=Jx(),Kt.Duplex=yo(),Kt.Transform=lS(),Kt.PassThrough=p1())});var pS=w((A0e,dS)=>{"use strict";var fS=h1();function ta(e,t,r){typeof r>"u"&&(r=t,t=e,e=null),fS.Duplex.call(this,e),typeof r.read!="function"&&(r=new fS.Readable(e).wrap(r)),this._writable=t,this._readable=r,this._waiting=!1;var i=this;t.once("finish",function(){i.end()}),this.once("finish",function(){t.end()}),r.on("readable",function(){i._waiting&&(i._waiting=!1,i._read())}),r.once("end",function(){i.push(null)}),(!e||typeof e.bubbleErrors>"u"||e.bubbleErrors)&&(t.on("error",function(n){i.emit("error",n)}),r.on("error",function(n){i.emit("error",n)}))}ta.prototype=Object.create(fS.Duplex.prototype,{constructor:{value:ta}});ta.prototype._write=function(t,r,i){this._writable.write(t,r,i)};ta.prototype._read=function(){for(var t,r=0;(t=this._readable.read())!==null;)this.push(t),r++;r===0&&(this._waiting=!0)};dS.exports=function(t,r,i){return new ta(t,r,i)};dS.exports.DuplexWrapper=ta});var g1=w(($0e,m1)=>{var hS=B("stream"),HX=ip(),VX=pS(),ZX=tp();function GX(e,t){let r=hS.PassThrough({objectMode:!0}),i=hS.PassThrough(),n=hS.Transform({objectMode:!0}),o=e instanceof RegExp?e:e&&new RegExp(e),s;n._transform=function(c,u,l){if(s||o&&!o.exec(c.path))return c.autodrain(),l();s=!0,a.emit("entry",c),c.on("error",function(f){i.emit("error",f)}),c.pipe(i).on("error",function(f){l(f)}).on("finish",function(f){l(null,f)})},r.pipe(HX(t)).on("error",function(c){i.emit("error",c)}).pipe(n).on("error",Object).on("finish",function(){s?i.end():i.emit("error",new Error("PATTERN_NOT_FOUND"))});let a=VX(r,i);return a.buffer=function(){return ZX(i)},a}m1.exports=GX});var Mt=w(mS=>{"use strict";mS.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]=="function")e.apply(this,t);else return new Promise((r,i)=>{t.push((n,o)=>n!=null?i(n):r(o)),e.apply(this,t)})},"name",{value:e.name})};mS.fromPromise=function(e){return Object.defineProperty(function(...t){let r=t[t.length-1];if(typeof r!="function")return e.apply(this,t);t.pop(),e.apply(this,t).then(i=>r(null,i),r)},"name",{value:e.name})}});var v1=w((D0e,y1)=>{var Ti=B("constants"),KX=process.cwd,gp=null,XX=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return gp||(gp=KX.call(process)),gp};try{process.cwd()}catch{}typeof process.chdir=="function"&&(gS=process.chdir,process.chdir=function(e){gp=null,gS.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,gS));var gS;y1.exports=JX;function JX(e){Ti.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=o(e.chown),e.fchown=o(e.fchown),e.lchown=o(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=s(e.chownSync),e.fchownSync=s(e.fchownSync),e.lchownSync=s(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=a(e.stat),e.fstat=a(e.fstat),e.lstat=a(e.lstat),e.statSync=c(e.statSync),e.fstatSync=c(e.fstatSync),e.lstatSync=c(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(l,f,p){p&&process.nextTick(p)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(l,f,p,d){d&&process.nextTick(d)},e.lchownSync=function(){}),XX==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(l){function f(p,d,h){var m=Date.now(),_=0;l(p,d,function k(S){if(S&&(S.code==="EACCES"||S.code==="EPERM"||S.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){e.stat(d,function(v,g){v&&v.code==="ENOENT"?l(p,d,k):h(S)})},_),_<100&&(_+=10);return}h&&h(S)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(l){function f(p,d,h,m,_,k){var S;if(k&&typeof k=="function"){var v=0;S=function(g,y,T){if(g&&g.code==="EAGAIN"&&v<10)return v++,l.call(e,p,d,h,m,_,S);k.apply(this,arguments)}}return l.call(e,p,d,h,m,_,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(l){return function(f,p,d,h,m){for(var _=0;;)try{return l.call(e,f,p,d,h,m)}catch(k){if(k.code==="EAGAIN"&&_<10){_++;continue}throw k}}})(e.readSync);function t(l){l.lchmod=function(f,p,d){l.open(f,Ti.O_WRONLY|Ti.O_SYMLINK,p,function(h,m){if(h){d&&d(h);return}l.fchmod(m,p,function(_){l.close(m,function(k){d&&d(_||k)})})})},l.lchmodSync=function(f,p){var d=l.openSync(f,Ti.O_WRONLY|Ti.O_SYMLINK,p),h=!0,m;try{m=l.fchmodSync(d,p),h=!1}finally{if(h)try{l.closeSync(d)}catch{}else l.closeSync(d)}return m}}function r(l){Ti.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,p,d,h){l.open(f,Ti.O_SYMLINK,function(m,_){if(m){h&&h(m);return}l.futimes(_,p,d,function(k){l.close(_,function(S){h&&h(k||S)})})})},l.lutimesSync=function(f,p,d){var h=l.openSync(f,Ti.O_SYMLINK),m,_=!0;try{m=l.futimesSync(h,p,d),_=!1}finally{if(_)try{l.closeSync(h)}catch{}else l.closeSync(h)}return m}):l.futimes&&(l.lutimes=function(f,p,d,h){h&&process.nextTick(h)},l.lutimesSync=function(){})}function i(l){return l&&function(f,p,d){return l.call(e,f,p,function(h){u(h)&&(h=null),d&&d.apply(this,arguments)})}}function n(l){return l&&function(f,p){try{return l.call(e,f,p)}catch(d){if(!u(d))throw d}}}function o(l){return l&&function(f,p,d,h){return l.call(e,f,p,d,function(m){u(m)&&(m=null),h&&h.apply(this,arguments)})}}function s(l){return l&&function(f,p,d){try{return l.call(e,f,p,d)}catch(h){if(!u(h))throw h}}}function a(l){return l&&function(f,p,d){typeof p=="function"&&(d=p,p=null);function h(m,_){_&&(_.uid<0&&(_.uid+=4294967296),_.gid<0&&(_.gid+=4294967296)),d&&d.apply(this,arguments)}return p?l.call(e,f,p,h):l.call(e,f,h)}}function c(l){return l&&function(f,p){var d=p?l.call(e,f,p):l.call(e,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function u(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var w1=w((N0e,_1)=>{var b1=B("stream").Stream;_1.exports=YX;function YX(e){return{ReadStream:t,WriteStream:r};function t(i,n){if(!(this instanceof t))return new t(i,n);b1.call(this);var o=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var s=Object.keys(n),a=0,c=s.length;a<c;a++){var u=s[a];this[u]=n[u]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}e.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(i,n){if(!(this instanceof r))return new r(i,n);b1.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var o=Object.keys(n),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=n[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var S1=w((P0e,x1)=>{"use strict";x1.exports=eJ;var QX=Object.getPrototypeOf||function(e){return e.__proto__};function eJ(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:QX(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var Ii=w((q0e,bS)=>{var ht=B("fs"),tJ=v1(),rJ=w1(),nJ=S1(),yp=B("util"),Xt,bp;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Xt=Symbol.for("graceful-fs.queue"),bp=Symbol.for("graceful-fs.previous")):(Xt="___graceful-fs.queue",bp="___graceful-fs.previous");function iJ(){}function T1(e,t){Object.defineProperty(e,Xt,{get:function(){return t}})}var vo=iJ;yp.debuglog?vo=yp.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(vo=function(){var e=yp.format.apply(yp,arguments);e="GFS4: "+e.split(/\n/).join(`
|
|
3
|
+
GFS4: `),console.error(e)});ht[Xt]||(E1=global[Xt]||[],T1(ht,E1),ht.close=(function(e){function t(r,i){return e.call(ht,r,function(n){n||k1(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(t,bp,{value:e}),t})(ht.close),ht.closeSync=(function(e){function t(r){e.apply(ht,arguments),k1()}return Object.defineProperty(t,bp,{value:e}),t})(ht.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){vo(ht[Xt]),B("assert").equal(ht[Xt].length,0)}));var E1;global[Xt]||T1(global,ht[Xt]);bS.exports=yS(nJ(ht));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ht.__patched&&(bS.exports=yS(ht),ht.__patched=!0);function yS(e){tJ(e),e.gracefulify=yS,e.createReadStream=y,e.createWriteStream=T;var t=e.readFile;e.readFile=r;function r(b,O,A){return typeof O=="function"&&(A=O,O=null),P(b,O,A);function P(D,V,$,U){return t(D,V,function(Z){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?ra([P,[D,V,$],Z,U||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=n;function n(b,O,A,P){return typeof A=="function"&&(P=A,A=null),D(b,O,A,P);function D(V,$,U,Z,J){return i(V,$,U,function(j){j&&(j.code==="EMFILE"||j.code==="ENFILE")?ra([D,[V,$,U,Z],j,J||Date.now(),Date.now()]):typeof Z=="function"&&Z.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=s);function s(b,O,A,P){return typeof A=="function"&&(P=A,A=null),D(b,O,A,P);function D(V,$,U,Z,J){return o(V,$,U,function(j){j&&(j.code==="EMFILE"||j.code==="ENFILE")?ra([D,[V,$,U,Z],j,J||Date.now(),Date.now()]):typeof Z=="function"&&Z.apply(this,arguments)})}}var a=e.copyFile;a&&(e.copyFile=c);function c(b,O,A,P){return typeof A=="function"&&(P=A,A=0),D(b,O,A,P);function D(V,$,U,Z,J){return a(V,$,U,function(j){j&&(j.code==="EMFILE"||j.code==="ENFILE")?ra([D,[V,$,U,Z],j,J||Date.now(),Date.now()]):typeof Z=="function"&&Z.apply(this,arguments)})}}var u=e.readdir;e.readdir=f;var l=/^v[0-5]\./;function f(b,O,A){typeof O=="function"&&(A=O,O=null);var P=l.test(process.version)?function($,U,Z,J){return u($,D($,U,Z,J))}:function($,U,Z,J){return u($,U,D($,U,Z,J))};return P(b,O,A);function D(V,$,U,Z){return function(J,j){J&&(J.code==="EMFILE"||J.code==="ENFILE")?ra([P,[V,$,U],J,Z||Date.now(),Date.now()]):(j&&j.sort&&j.sort(),typeof U=="function"&&U.call(this,J,j))}}}if(process.version.substr(0,4)==="v0.8"){var p=rJ(e);k=p.ReadStream,v=p.WriteStream}var d=e.ReadStream;d&&(k.prototype=Object.create(d.prototype),k.prototype.open=S);var h=e.WriteStream;h&&(v.prototype=Object.create(h.prototype),v.prototype.open=g),Object.defineProperty(e,"ReadStream",{get:function(){return k},set:function(b){k=b},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return v},set:function(b){v=b},enumerable:!0,configurable:!0});var m=k;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(b){m=b},enumerable:!0,configurable:!0});var _=v;Object.defineProperty(e,"FileWriteStream",{get:function(){return _},set:function(b){_=b},enumerable:!0,configurable:!0});function k(b,O){return this instanceof k?(d.apply(this,arguments),this):k.apply(Object.create(k.prototype),arguments)}function S(){var b=this;I(b.path,b.flags,b.mode,function(O,A){O?(b.autoClose&&b.destroy(),b.emit("error",O)):(b.fd=A,b.emit("open",A),b.read())})}function v(b,O){return this instanceof v?(h.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function g(){var b=this;I(b.path,b.flags,b.mode,function(O,A){O?(b.destroy(),b.emit("error",O)):(b.fd=A,b.emit("open",A))})}function y(b,O){return new e.ReadStream(b,O)}function T(b,O){return new e.WriteStream(b,O)}var R=e.open;e.open=I;function I(b,O,A,P){return typeof A=="function"&&(P=A,A=null),D(b,O,A,P);function D(V,$,U,Z,J){return R(V,$,U,function(j,pe){j&&(j.code==="EMFILE"||j.code==="ENFILE")?ra([D,[V,$,U,Z],j,J||Date.now(),Date.now()]):typeof Z=="function"&&Z.apply(this,arguments)})}}return e}function ra(e){vo("ENQUEUE",e[0].name,e[1]),ht[Xt].push(e),vS()}var vp;function k1(){for(var e=Date.now(),t=0;t<ht[Xt].length;++t)ht[Xt][t].length>2&&(ht[Xt][t][3]=e,ht[Xt][t][4]=e);vS()}function vS(){if(clearTimeout(vp),vp=void 0,ht[Xt].length!==0){var e=ht[Xt].shift(),t=e[0],r=e[1],i=e[2],n=e[3],o=e[4];if(n===void 0)vo("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-n>=6e4){vo("TIMEOUT",t.name,r);var s=r.pop();typeof s=="function"&&s.call(null,i)}else{var a=Date.now()-o,c=Math.max(o-n,1),u=Math.min(c*1.2,100);a>=u?(vo("RETRY",t.name,r),t.apply(null,r.concat([n]))):ht[Xt].push(e)}vp===void 0&&(vp=setTimeout(vS,0))}}});var lr=w(Vn=>{"use strict";var I1=Mt().fromCallback,ur=Ii(),oJ=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(e=>typeof ur[e]=="function");Object.assign(Vn,ur);oJ.forEach(e=>{Vn[e]=I1(ur[e])});Vn.exists=function(e,t){return typeof t=="function"?ur.exists(e,t):new Promise(r=>ur.exists(e,r))};Vn.read=function(e,t,r,i,n,o){return typeof o=="function"?ur.read(e,t,r,i,n,o):new Promise((s,a)=>{ur.read(e,t,r,i,n,(c,u,l)=>{if(c)return a(c);s({bytesRead:u,buffer:l})})})};Vn.write=function(e,t,...r){return typeof r[r.length-1]=="function"?ur.write(e,t,...r):new Promise((i,n)=>{ur.write(e,t,...r,(o,s,a)=>{if(o)return n(o);i({bytesWritten:s,buffer:a})})})};Vn.readv=function(e,t,...r){return typeof r[r.length-1]=="function"?ur.readv(e,t,...r):new Promise((i,n)=>{ur.readv(e,t,...r,(o,s,a)=>{if(o)return n(o);i({bytesRead:s,buffers:a})})})};Vn.writev=function(e,t,...r){return typeof r[r.length-1]=="function"?ur.writev(e,t,...r):new Promise((i,n)=>{ur.writev(e,t,...r,(o,s,a)=>{if(o)return n(o);i({bytesWritten:s,buffers:a})})})};typeof ur.realpath.native=="function"?Vn.realpath.native=I1(ur.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var C1=w((M0e,O1)=>{"use strict";var sJ=B("path");O1.exports.checkPath=function(t){if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(sJ.parse(t).root,""))){let i=new Error(`Path contains invalid characters: ${t}`);throw i.code="EINVAL",i}}});var D1=w((L0e,_S)=>{"use strict";var A1=lr(),{checkPath:$1}=C1(),R1=e=>{let t={mode:511};return typeof e=="number"?e:{...t,...e}.mode};_S.exports.makeDir=async(e,t)=>($1(e),A1.mkdir(e,{mode:R1(t),recursive:!0}));_S.exports.makeDirSync=(e,t)=>($1(e),A1.mkdirSync(e,{mode:R1(t),recursive:!0}))});var Xr=w((F0e,N1)=>{"use strict";var aJ=Mt().fromPromise,{makeDir:cJ,makeDirSync:wS}=D1(),xS=aJ(cJ);N1.exports={mkdirs:xS,mkdirsSync:wS,mkdirp:xS,mkdirpSync:wS,ensureDir:xS,ensureDirSync:wS}});var Oi=w((z0e,q1)=>{"use strict";var uJ=Mt().fromPromise,P1=lr();function lJ(e){return P1.access(e).then(()=>!0).catch(()=>!1)}q1.exports={pathExists:uJ(lJ),pathExistsSync:P1.existsSync}});var SS=w((U0e,j1)=>{"use strict";var na=lr(),fJ=Mt().fromPromise;async function dJ(e,t,r){let i=await na.open(e,"r+"),n=null;try{await na.futimes(i,t,r)}catch(o){n=o}finally{try{await na.close(i)}catch(o){n||(n=o)}}if(n)throw n}function pJ(e,t,r){let i=na.openSync(e,"r+"),n=null;try{na.futimesSync(i,t,r)}catch(o){n=o}finally{try{na.closeSync(i)}catch(o){n||(n=o)}}if(n)throw n}j1.exports={utimesMillis:fJ(dJ),utimesMillisSync:pJ}});var bo=w((B0e,L1)=>{"use strict";var ia=lr(),Lt=B("path"),M1=Mt().fromPromise;function hJ(e,t,r){let i=r.dereference?n=>ia.stat(n,{bigint:!0}):n=>ia.lstat(n,{bigint:!0});return Promise.all([i(e),i(t).catch(n=>{if(n.code==="ENOENT")return null;throw n})]).then(([n,o])=>({srcStat:n,destStat:o}))}function mJ(e,t,r){let i,n=r.dereference?s=>ia.statSync(s,{bigint:!0}):s=>ia.lstatSync(s,{bigint:!0}),o=n(e);try{i=n(t)}catch(s){if(s.code==="ENOENT")return{srcStat:o,destStat:null};throw s}return{srcStat:o,destStat:i}}async function gJ(e,t,r,i){let{srcStat:n,destStat:o}=await hJ(e,t,i);if(o){if(Tu(n,o)){let s=Lt.basename(e),a=Lt.basename(t);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return{srcStat:n,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!n.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(n.isDirectory()&&TS(e,t))throw new Error(_p(e,t,r));return{srcStat:n,destStat:o}}function yJ(e,t,r,i){let{srcStat:n,destStat:o}=mJ(e,t,i);if(o){if(Tu(n,o)){let s=Lt.basename(e),a=Lt.basename(t);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return{srcStat:n,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!n.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(n.isDirectory()&&TS(e,t))throw new Error(_p(e,t,r));return{srcStat:n,destStat:o}}async function ES(e,t,r,i){let n=Lt.resolve(Lt.dirname(e)),o=Lt.resolve(Lt.dirname(r));if(o===n||o===Lt.parse(o).root)return;let s;try{s=await ia.stat(o,{bigint:!0})}catch(a){if(a.code==="ENOENT")return ES(e,t,o,i);throw a}if(Tu(t,s))throw new Error(_p(e,r,i));return ES(e,t,o,i)}function kS(e,t,r,i){let n=Lt.resolve(Lt.dirname(e)),o=Lt.resolve(Lt.dirname(r));if(o===n||o===Lt.parse(o).root)return;let s;try{s=ia.statSync(o,{bigint:!0})}catch(a){if(a.code==="ENOENT")return kS(e,t,o,i);throw a}if(Tu(t,s))throw new Error(_p(e,r,i));return kS(e,t,o,i)}function Tu(e,t){return t.ino!==void 0&&t.dev!==void 0&&t.ino===e.ino&&t.dev===e.dev}function TS(e,t){let r=Lt.resolve(e).split(Lt.sep).filter(n=>n),i=Lt.resolve(t).split(Lt.sep).filter(n=>n);return r.every((n,o)=>i[o]===n)}function _p(e,t,r){return`Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}L1.exports={checkPaths:M1(gJ),checkPathsSync:yJ,checkParentPaths:M1(ES),checkParentPathsSync:kS,isSrcSubdir:TS,areIdentical:Tu}});var z1=w((W0e,F1)=>{"use strict";async function vJ(e,t){let r=[];for await(let i of e)r.push(t(i).then(()=>null,n=>n??new Error("unknown error")));await Promise.all(r.map(i=>i.then(n=>{if(n!==null)throw n})))}F1.exports={asyncIteratorConcurrentProcess:vJ}});var V1=w((H0e,H1)=>{"use strict";var tr=lr(),Iu=B("path"),{mkdirs:bJ}=Xr(),{pathExists:_J}=Oi(),{utimesMillis:wJ}=SS(),Ou=bo(),{asyncIteratorConcurrentProcess:xJ}=z1();async function SJ(e,t,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
4
4
|
|
|
5
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:i,destStat:n}=await Ou.checkPaths(e,t,"copy",r);if(await Ou.checkParentPaths(e,i,t,"copy"),!await B1(e,t,r))return;let s=Iu.dirname(t);await _J(s)||await bJ(s),await W1(n,e,t,r)}async function B1(e,t,r){return r.filter?r.filter(e,t):!0}async function W1(e,t,r,i){let o=await(i.dereference?tr.stat:tr.lstat)(t);if(o.isDirectory())return IJ(o,e,t,r,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return EJ(o,e,t,r,i);if(o.isSymbolicLink())return OJ(e,t,r,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${t}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}async function EJ(e,t,r,i,n){if(!t)return U1(e,r,i,n);if(n.overwrite)return await tr.unlink(i),U1(e,r,i,n);if(n.errorOnExist)throw new Error(`'${i}' already exists`)}async function U1(e,t,r,i){if(await tr.copyFile(t,r),i.preserveTimestamps){kJ(e.mode)&&await TJ(r,e.mode);let n=await tr.stat(t);await wJ(r,n.atime,n.mtime)}return tr.chmod(r,e.mode)}function kJ(e){return(e&128)===0}function TJ(e,t){return tr.chmod(e,t|128)}async function IJ(e,t,r,i,n){t||await tr.mkdir(i),await xJ(await tr.opendir(r),async o=>{let s=Iu.join(r,o.name),a=Iu.join(i,o.name);if(await B1(s,a,n)){let{destStat:u}=await Ou.checkPaths(s,a,"copy",n);await W1(u,s,a,n)}}),t||await tr.chmod(i,e.mode)}async function OJ(e,t,r,i){let n=await tr.readlink(t);if(i.dereference&&(n=Iu.resolve(process.cwd(),n)),!e)return tr.symlink(n,r);let o=null;try{o=await tr.readlink(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return tr.symlink(n,r);throw s}if(i.dereference&&(o=Iu.resolve(process.cwd(),o)),n!==o){if(Ou.isSrcSubdir(n,o))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${o}'.`);if(Ou.isSrcSubdir(o,n))throw new Error(`Cannot overwrite '${o}' with '${n}'.`)}return await tr.unlink(r),tr.symlink(n,r)}H1.exports=SJ});var J1=w((
|
|
5
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:i,destStat:n}=await Ou.checkPaths(e,t,"copy",r);if(await Ou.checkParentPaths(e,i,t,"copy"),!await B1(e,t,r))return;let s=Iu.dirname(t);await _J(s)||await bJ(s),await W1(n,e,t,r)}async function B1(e,t,r){return r.filter?r.filter(e,t):!0}async function W1(e,t,r,i){let o=await(i.dereference?tr.stat:tr.lstat)(t);if(o.isDirectory())return IJ(o,e,t,r,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return EJ(o,e,t,r,i);if(o.isSymbolicLink())return OJ(e,t,r,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${t}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}async function EJ(e,t,r,i,n){if(!t)return U1(e,r,i,n);if(n.overwrite)return await tr.unlink(i),U1(e,r,i,n);if(n.errorOnExist)throw new Error(`'${i}' already exists`)}async function U1(e,t,r,i){if(await tr.copyFile(t,r),i.preserveTimestamps){kJ(e.mode)&&await TJ(r,e.mode);let n=await tr.stat(t);await wJ(r,n.atime,n.mtime)}return tr.chmod(r,e.mode)}function kJ(e){return(e&128)===0}function TJ(e,t){return tr.chmod(e,t|128)}async function IJ(e,t,r,i,n){t||await tr.mkdir(i),await xJ(await tr.opendir(r),async o=>{let s=Iu.join(r,o.name),a=Iu.join(i,o.name);if(await B1(s,a,n)){let{destStat:u}=await Ou.checkPaths(s,a,"copy",n);await W1(u,s,a,n)}}),t||await tr.chmod(i,e.mode)}async function OJ(e,t,r,i){let n=await tr.readlink(t);if(i.dereference&&(n=Iu.resolve(process.cwd(),n)),!e)return tr.symlink(n,r);let o=null;try{o=await tr.readlink(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return tr.symlink(n,r);throw s}if(i.dereference&&(o=Iu.resolve(process.cwd(),o)),n!==o){if(Ou.isSrcSubdir(n,o))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${o}'.`);if(Ou.isSrcSubdir(o,n))throw new Error(`Cannot overwrite '${o}' with '${n}'.`)}return await tr.unlink(r),tr.symlink(n,r)}H1.exports=SJ});var J1=w((V0e,X1)=>{"use strict";var fr=Ii(),Cu=B("path"),CJ=Xr().mkdirsSync,AJ=SS().utimesMillisSync,Au=bo();function $J(e,t,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
6
6
|
|
|
7
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:i,destStat:n}=Au.checkPathsSync(e,t,"copy",r);if(Au.checkParentPathsSync(e,i,t,"copy"),r.filter&&!r.filter(e,t))return;let o=Cu.dirname(t);return fr.existsSync(o)||CJ(o),Z1(n,e,t,r)}function Z1(e,t,r,i){let o=(i.dereference?fr.statSync:fr.lstatSync)(t);if(o.isDirectory())return MJ(o,e,t,r,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return RJ(o,e,t,r,i);if(o.isSymbolicLink())return zJ(e,t,r,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${t}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}function RJ(e,t,r,i,n){return t?DJ(e,r,i,n):G1(e,r,i,n)}function DJ(e,t,r,i){if(i.overwrite)return fr.unlinkSync(r),G1(e,t,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}function G1(e,t,r,i){return fr.copyFileSync(t,r),i.preserveTimestamps&&NJ(e.mode,t,r),IS(r,e.mode)}function NJ(e,t,r){return PJ(e)&&qJ(r,e),jJ(t,r)}function PJ(e){return(e&128)===0}function qJ(e,t){return IS(e,t|128)}function IS(e,t){return fr.chmodSync(e,t)}function jJ(e,t){let r=fr.statSync(e);return AJ(t,r.atime,r.mtime)}function MJ(e,t,r,i,n){return t?K1(r,i,n):LJ(e.mode,r,i,n)}function LJ(e,t,r,i){return fr.mkdirSync(r),K1(t,r,i),IS(r,e)}function K1(e,t,r){let i=fr.opendirSync(e);try{let n;for(;(n=i.readSync())!==null;)FJ(n.name,e,t,r)}finally{i.closeSync()}}function FJ(e,t,r,i){let n=Cu.join(t,e),o=Cu.join(r,e);if(i.filter&&!i.filter(n,o))return;let{destStat:s}=Au.checkPathsSync(n,o,"copy",i);return Z1(s,n,o,i)}function zJ(e,t,r,i){let n=fr.readlinkSync(t);if(i.dereference&&(n=Cu.resolve(process.cwd(),n)),e){let o;try{o=fr.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return fr.symlinkSync(n,r);throw s}if(i.dereference&&(o=Cu.resolve(process.cwd(),o)),n!==o){if(Au.isSrcSubdir(n,o))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${o}'.`);if(Au.isSrcSubdir(o,n))throw new Error(`Cannot overwrite '${o}' with '${n}'.`)}return UJ(n,r)}else return fr.symlinkSync(n,r)}function UJ(e,t){return fr.unlinkSync(t),fr.symlinkSync(e,t)}X1.exports=$J});var wp=w((
|
|
8
|
-
`,finalEOL:r=!0,replacer:i=null,spaces:n}={}){let o=r?t:"",s=JSON.stringify(e,i,n);if(s===void 0)throw new TypeError(`Converting ${typeof e} value to JSON is not supported`);return s.replace(/\n/g,t)+o}function b7(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}NR.exports={stringify:v7,stripBom:b7}});var MR=w((
|
|
9
|
-
`;super(r),this.name="AggregateError",this.errors=t}};hD.exports={AggregateError:NS,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array}});var PS=w((mEe,mD)=>{"use strict";mD.exports={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,i]){let n=t.shift();return i==="f"?n.toFixed(6):i==="j"?JSON.stringify(n):i==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}});var rr=w((gEe,vD)=>{"use strict";var{format:tY,inspect:Ip}=PS(),{AggregateError:rY}=ft(),nY=globalThis.AggregateError||rY,iY=Symbol("kIsNodeError"),oY=["string","function","number","object","Function","Object","boolean","bigint","symbol"],sY=/^([A-Z][a-z0-9]*)+$/,aY="__node_internal_",Op={};function _o(e,t){if(!e)throw new Op.ERR_INTERNAL_ASSERTION(t)}function gD(e){let t="",r=e.length,i=e[0]==="-"?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function cY(e,t,r){if(typeof t=="function")return _o(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);let i=(t.match(/%[dfijoOs]/g)||[]).length;return _o(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?t:tY(t,...r)}function Jt(e,t,r){r||(r=Error);class i extends r{constructor(...o){super(cY(e,t,o))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[iY]=!0,Op[e]=i}function yD(e){let t=aY+e.name;return Object.defineProperty(e,"name",{value:t}),e}function uY(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new nY([t,e],t.message);return r.code=t.code,r}return e||t}var qS=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Op.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};Jt("ERR_ASSERTION","%s",Error);Jt("ERR_INVALID_ARG_TYPE",(e,t,r)=>{_o(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let i="The ";e.endsWith(" argument")?i+=`${e} `:i+=`"${e}" ${e.includes(".")?"property":"argument"} `,i+="must be ";let n=[],o=[],s=[];for(let c of t)_o(typeof c=="string","All expected entries have to be of type string"),oY.includes(c)?n.push(c.toLowerCase()):sY.test(c)?o.push(c):(_o(c!=="object",'The value "object" should be written as "Object"'),s.push(c));if(o.length>0){let c=n.indexOf("object");c!==-1&&(n.splice(n,c,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let c=n.pop();i+=`one of type ${n.join(", ")}, or ${c}`}}(o.length>0||s.length>0)&&(i+=" or ")}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();i+=`an instance of ${o.join(", ")}, or ${c}`}}s.length>0&&(i+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(i+="an "),i+=`${s[0]}`;break;case 2:i+=`one of ${s[0]} or ${s[1]}`;break;default:{let c=s.pop();i+=`one of ${s.join(", ")}, or ${c}`}}if(r==null)i+=`. Received ${r}`;else if(typeof r=="function"&&r.name)i+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)i+=`. Received an instance of ${r.constructor.name}`;else{let c=Ip(r,{depth:-1});i+=`. Received ${c}`}}else{let c=Ip(r,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),i+=`. Received type ${typeof r} (${c})`}return i},TypeError);Jt("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let i=Ip(t);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${i}`},TypeError);Jt("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var i;let n=r!=null&&(i=r.constructor)!==null&&i!==void 0&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${n}.`},TypeError);Jt("ERR_MISSING_ARGS",(...e)=>{_o(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(i=>`"${i}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let i=e.pop();t+=`The ${e.join(", ")}, and ${i} arguments`}break}return`${t} must be specified`},TypeError);Jt("ERR_OUT_OF_RANGE",(e,t,r)=>{_o(t,'Missing "range" argument');let i;if(Number.isInteger(r)&&Math.abs(r)>2**32)i=gD(String(r));else if(typeof r=="bigint"){i=String(r);let n=BigInt(2)**BigInt(32);(r>n||r<-n)&&(i=gD(i)),i+="n"}else i=Ip(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${i}`},RangeError);Jt("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Jt("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Jt("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Jt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Jt("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Jt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Jt("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Jt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Jt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Jt("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Jt("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);vD.exports={AbortError:qS,aggregateTwoErrors:yD(uY),hideStackFrames:yD,codes:Op}});var OD=w((qu,Pu)=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});var ED=new WeakMap,jS=new WeakMap;function ut(e){let t=ED.get(e);return console.assert(t!=null,"'this' is expected an Event object, but got",e),t}function bD(e){if(e.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener);return}e.event.cancelable&&(e.canceled=!0,typeof e.event.preventDefault=="function"&&e.event.preventDefault())}function aa(e,t){ED.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let r=Object.keys(t);for(let i=0;i<r.length;++i){let n=r[i];n in this||Object.defineProperty(this,n,kD(n))}}aa.prototype={get type(){return ut(this).event.type},get target(){return ut(this).eventTarget},get currentTarget(){return ut(this).currentTarget},composedPath(){let e=ut(this).currentTarget;return e==null?[]:[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return ut(this).eventPhase},stopPropagation(){let e=ut(this);e.stopped=!0,typeof e.event.stopPropagation=="function"&&e.event.stopPropagation()},stopImmediatePropagation(){let e=ut(this);e.stopped=!0,e.immediateStopped=!0,typeof e.event.stopImmediatePropagation=="function"&&e.event.stopImmediatePropagation()},get bubbles(){return!!ut(this).event.bubbles},get cancelable(){return!!ut(this).event.cancelable},preventDefault(){bD(ut(this))},get defaultPrevented(){return ut(this).canceled},get composed(){return!!ut(this).event.composed},get timeStamp(){return ut(this).timeStamp},get srcElement(){return ut(this).eventTarget},get cancelBubble(){return ut(this).stopped},set cancelBubble(e){if(!e)return;let t=ut(this);t.stopped=!0,typeof t.event.cancelBubble=="boolean"&&(t.event.cancelBubble=!0)},get returnValue(){return!ut(this).canceled},set returnValue(e){e||bD(ut(this))},initEvent(){}};Object.defineProperty(aa.prototype,"constructor",{value:aa,configurable:!0,writable:!0});typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(aa.prototype,window.Event.prototype),jS.set(window.Event.prototype,aa));function kD(e){return{get(){return ut(this).event[e]},set(t){ut(this).event[e]=t},configurable:!0,enumerable:!0}}function lY(e){return{value(){let t=ut(this).event;return t[e].apply(t,arguments)},configurable:!0,enumerable:!0}}function fY(e,t){let r=Object.keys(t);if(r.length===0)return e;function i(n,o){e.call(this,n,o)}i.prototype=Object.create(e.prototype,{constructor:{value:i,configurable:!0,writable:!0}});for(let n=0;n<r.length;++n){let o=r[n];if(!(o in e.prototype)){let a=typeof Object.getOwnPropertyDescriptor(t,o).value=="function";Object.defineProperty(i.prototype,o,a?lY(o):kD(o))}}return i}function TD(e){if(e==null||e===Object.prototype)return aa;let t=jS.get(e);return t==null&&(t=fY(TD(Object.getPrototypeOf(e)),e),jS.set(e,t)),t}function dY(e,t){let r=TD(Object.getPrototypeOf(t));return new r(e,t)}function pY(e){return ut(e).immediateStopped}function hY(e,t){ut(e).eventPhase=t}function mY(e,t){ut(e).currentTarget=t}function _D(e,t){ut(e).passiveListener=t}var ID=new WeakMap,wD=1,xD=2,Cp=3;function Ap(e){return e!==null&&typeof e=="object"}function Nu(e){let t=ID.get(e);if(t==null)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return t}function gY(e){return{get(){let r=Nu(this).get(e);for(;r!=null;){if(r.listenerType===Cp)return r.listener;r=r.next}return null},set(t){typeof t!="function"&&!Ap(t)&&(t=null);let r=Nu(this),i=null,n=r.get(e);for(;n!=null;)n.listenerType===Cp?i!==null?i.next=n.next:n.next!==null?r.set(e,n.next):r.delete(e):i=n,n=n.next;if(t!==null){let o={listener:t,listenerType:Cp,passive:!1,once:!1,next:null};i===null?r.set(e,o):i.next=o}},configurable:!0,enumerable:!0}}function MS(e,t){Object.defineProperty(e,`on${t}`,gY(t))}function SD(e){function t(){Jr.call(this)}t.prototype=Object.create(Jr.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let r=0;r<e.length;++r)MS(t.prototype,e[r]);return t}function Jr(){if(this instanceof Jr){ID.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return SD(arguments[0]);if(arguments.length>0){let e=new Array(arguments.length);for(let t=0;t<arguments.length;++t)e[t]=arguments[t];return SD(e)}throw new TypeError("Cannot call a class as a function")}Jr.prototype={addEventListener(e,t,r){if(t==null)return;if(typeof t!="function"&&!Ap(t))throw new TypeError("'listener' should be a function or an object.");let i=Nu(this),n=Ap(r),s=(n?!!r.capture:!!r)?wD:xD,a={listener:t,listenerType:s,passive:n&&!!r.passive,once:n&&!!r.once,next:null},c=i.get(e);if(c===void 0){i.set(e,a);return}let u=null;for(;c!=null;){if(c.listener===t&&c.listenerType===s)return;u=c,c=c.next}u.next=a},removeEventListener(e,t,r){if(t==null)return;let i=Nu(this),o=(Ap(r)?!!r.capture:!!r)?wD:xD,s=null,a=i.get(e);for(;a!=null;){if(a.listener===t&&a.listenerType===o){s!==null?s.next=a.next:a.next!==null?i.set(e,a.next):i.delete(e);return}s=a,a=a.next}},dispatchEvent(e){if(e==null||typeof e.type!="string")throw new TypeError('"event.type" should be a string.');let t=Nu(this),r=e.type,i=t.get(r);if(i==null)return!0;let n=dY(this,e),o=null;for(;i!=null;){if(i.once?o!==null?o.next=i.next:i.next!==null?t.set(r,i.next):t.delete(r):o=i,_D(n,i.passive?i.listener:null),typeof i.listener=="function")try{i.listener.call(this,n)}catch(s){typeof console<"u"&&typeof console.error=="function"&&console.error(s)}else i.listenerType!==Cp&&typeof i.listener.handleEvent=="function"&&i.listener.handleEvent(n);if(pY(n))break;i=i.next}return _D(n,null),hY(n,0),mY(n,null),!n.defaultPrevented}};Object.defineProperty(Jr.prototype,"constructor",{value:Jr,configurable:!0,writable:!0});typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf(Jr.prototype,window.EventTarget.prototype);qu.defineEventAttribute=MS;qu.EventTarget=Jr;qu.default=Jr;Pu.exports=Jr;Pu.exports.EventTarget=Pu.exports.default=Jr;Pu.exports.defineEventAttribute=MS});var ca=w((Mu,ju)=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});var LS=OD(),Ri=class extends LS.EventTarget{constructor(){throw super(),new TypeError("AbortSignal cannot be constructed directly")}get aborted(){let t=$p.get(this);if(typeof t!="boolean")throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return t}};LS.defineEventAttribute(Ri.prototype,"abort");function yY(){let e=Object.create(Ri.prototype);return LS.EventTarget.call(e),$p.set(e,!1),e}function vY(e){$p.get(e)===!1&&($p.set(e,!0),e.dispatchEvent({type:"abort"}))}var $p=new WeakMap;Object.defineProperties(Ri.prototype,{aborted:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ri.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});var Di=class{constructor(){AD.set(this,yY())}get signal(){return CD(this)}abort(){vY(CD(this))}},AD=new WeakMap;function CD(e){let t=AD.get(e);if(t==null)throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${e===null?"null":typeof e}`);return t}Object.defineProperties(Di.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Di.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});Mu.AbortController=Di;Mu.AbortSignal=Ri;Mu.default=Di;ju.exports=Di;ju.exports.AbortController=ju.exports.default=Di;ju.exports.AbortSignal=Ri});var pr=w((yEe,zS)=>{"use strict";var bY=B("buffer"),{format:_Y,inspect:wY}=PS(),{codes:{ERR_INVALID_ARG_TYPE:FS}}=rr(),{kResistStopPropagation:xY,AggregateError:SY,SymbolDispose:EY}=ft(),kY=globalThis.AbortSignal||ca().AbortSignal,TY=globalThis.AbortController||ca().AbortController,IY=Object.getPrototypeOf(async function(){}).constructor,$D=globalThis.Blob||bY.Blob,OY=typeof $D<"u"?function(t){return t instanceof $D}:function(t){return!1},RD=(e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new FS(t,"AbortSignal",e)},CY=(e,t)=>{if(typeof e!="function")throw new FS(t,"Function",e)};zS.exports={AggregateError:SY,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((i,n)=>{e=i,t=n}),resolve:e,reject:t}},promisify(e){return new Promise((t,r)=>{e((i,...n)=>i?r(i):t(...n))})},debuglog(){return function(){}},format:_Y,inspect:wY,types:{isAsyncFunction(e){return e instanceof IY},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:OY,deprecate(e,t){return e},addAbortListener:B("events").addAbortListener||function(t,r){if(t===void 0)throw new FS("signal","AbortSignal",t);RD(t,"signal"),CY(r,"listener");let i;return t.aborted?queueMicrotask(()=>r()):(t.addEventListener("abort",r,{__proto__:null,once:!0,[xY]:!0}),i=()=>{t.removeEventListener("abort",r)}),{__proto__:null,[EY](){var n;(n=i)===null||n===void 0||n()}}},AbortSignalAny:kY.any||function(t){if(t.length===1)return t[0];let r=new TY,i=()=>r.abort();return t.forEach(n=>{RD(n,"signals"),n.addEventListener("abort",i,{once:!0})}),r.signal.addEventListener("abort",()=>{t.forEach(n=>n.removeEventListener("abort",i))},{once:!0}),r.signal}};zS.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var la=w((vEe,UD)=>{"use strict";var{ArrayIsArray:BS,ArrayPrototypeIncludes:qD,ArrayPrototypeJoin:jD,ArrayPrototypeMap:AY,NumberIsInteger:WS,NumberIsNaN:$Y,NumberMAX_SAFE_INTEGER:RY,NumberMIN_SAFE_INTEGER:DY,NumberParseInt:NY,ObjectPrototypeHasOwnProperty:PY,RegExpPrototypeExec:MD,String:qY,StringPrototypeToUpperCase:jY,StringPrototypeTrim:MY}=ft(),{hideStackFrames:qr,codes:{ERR_SOCKET_BAD_PORT:LY,ERR_INVALID_ARG_TYPE:nr,ERR_INVALID_ARG_VALUE:ua,ERR_OUT_OF_RANGE:wo,ERR_UNKNOWN_SIGNAL:DD}}=rr(),{normalizeEncoding:FY}=pr(),{isAsyncFunction:zY,isArrayBufferView:UY}=pr().types,ND={};function BY(e){return e===(e|0)}function WY(e){return e===e>>>0}var HY=/^[0-7]+$/,VY="must be a 32-bit unsigned integer or an octal string";function ZY(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(MD(HY,e)===null)throw new ua(t,e,VY);e=NY(e,8)}return LD(e,t),e}var GY=qr((e,t,r=DY,i=RY)=>{if(typeof e!="number")throw new nr(t,"number",e);if(!WS(e))throw new wo(t,"an integer",e);if(e<r||e>i)throw new wo(t,`>= ${r} && <= ${i}`,e)}),KY=qr((e,t,r=-2147483648,i=2147483647)=>{if(typeof e!="number")throw new nr(t,"number",e);if(!WS(e))throw new wo(t,"an integer",e);if(e<r||e>i)throw new wo(t,`>= ${r} && <= ${i}`,e)}),LD=qr((e,t,r=!1)=>{if(typeof e!="number")throw new nr(t,"number",e);if(!WS(e))throw new wo(t,"an integer",e);let i=r?1:0,n=4294967295;if(e<i||e>n)throw new wo(t,`>= ${i} && <= ${n}`,e)});function HS(e,t){if(typeof e!="string")throw new nr(t,"string",e)}function XY(e,t,r=void 0,i){if(typeof e!="number")throw new nr(t,"number",e);if(r!=null&&e<r||i!=null&&e>i||(r!=null||i!=null)&&$Y(e))throw new wo(t,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,e)}var JY=qr((e,t,r)=>{if(!qD(r,e)){let n="must be one of: "+jD(AY(r,o=>typeof o=="string"?`'${o}'`:qY(o)),", ");throw new ua(t,e,n)}});function FD(e,t){if(typeof e!="boolean")throw new nr(t,"boolean",e)}function US(e,t,r){return e==null||!PY(e,t)?r:e[t]}var YY=qr((e,t,r=null)=>{let i=US(r,"allowArray",!1),n=US(r,"allowFunction",!1);if(!US(r,"nullable",!1)&&e===null||!i&&BS(e)||typeof e!="object"&&(!n||typeof e!="function"))throw new nr(t,"Object",e)}),QY=qr((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new nr(t,"a dictionary",e)}),Rp=qr((e,t,r=0)=>{if(!BS(e))throw new nr(t,"Array",e);if(e.length<r){let i=`must be longer than ${r}`;throw new ua(t,e,i)}});function eQ(e,t){Rp(e,t);for(let r=0;r<e.length;r++)HS(e[r],`${t}[${r}]`)}function tQ(e,t){Rp(e,t);for(let r=0;r<e.length;r++)FD(e[r],`${t}[${r}]`)}function rQ(e,t){Rp(e,t);for(let r=0;r<e.length;r++){let i=e[r],n=`${t}[${r}]`;if(i==null)throw new nr(n,"AbortSignal",i);zD(i,n)}}function nQ(e,t="signal"){if(HS(e,t),ND[e]===void 0)throw ND[jY(e)]!==void 0?new DD(e+" (signals must use all capital letters)"):new DD(e)}var iQ=qr((e,t="buffer")=>{if(!UY(e))throw new nr(t,["Buffer","TypedArray","DataView"],e)});function oQ(e,t){let r=FY(t),i=e.length;if(r==="hex"&&i%2!==0)throw new ua("encoding",t,`is invalid for data of length ${i}`)}function sQ(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&MY(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new LY(t,e,r);return e|0}var zD=qr((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new nr(t,"AbortSignal",e)}),aQ=qr((e,t)=>{if(typeof e!="function")throw new nr(t,"Function",e)}),cQ=qr((e,t)=>{if(typeof e!="function"||zY(e))throw new nr(t,"Function",e)}),uQ=qr((e,t)=>{if(e!==void 0)throw new nr(t,"undefined",e)});function lQ(e,t,r){if(!qD(r,e))throw new nr(t,`('${jD(r,"|")}')`,e)}var fQ=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function PD(e,t){if(typeof e>"u"||!MD(fQ,e))throw new ua(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function dQ(e){if(typeof e=="string")return PD(e,"hints"),e;if(BS(e)){let t=e.length,r="";if(t===0)return r;for(let i=0;i<t;i++){let n=e[i];PD(n,"hints"),r+=n,i!==t-1&&(r+=", ")}return r}throw new ua("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}UD.exports={isInt32:BY,isUint32:WY,parseFileMode:ZY,validateArray:Rp,validateStringArray:eQ,validateBooleanArray:tQ,validateAbortSignalArray:rQ,validateBoolean:FD,validateBuffer:iQ,validateDictionary:QY,validateEncoding:oQ,validateFunction:aQ,validateInt32:KY,validateInteger:GY,validateNumber:XY,validateObject:YY,validateOneOf:JY,validatePlainFunction:cQ,validatePort:sQ,validateSignalName:nQ,validateString:HS,validateUint32:LD,validateUndefined:uQ,validateUnion:lQ,validateAbortSignal:zD,validateLinkHeaderValue:dQ}});var Ni=w((bEe,BD)=>{BD.exports=global.process});var hn=w((_Ee,iN)=>{"use strict";var{SymbolAsyncIterator:WD,SymbolIterator:HD,SymbolFor:xo}=ft(),VD=xo("nodejs.stream.destroyed"),ZD=xo("nodejs.stream.errored"),VS=xo("nodejs.stream.readable"),ZS=xo("nodejs.stream.writable"),GD=xo("nodejs.stream.disturbed"),pQ=xo("nodejs.webstream.isClosedPromise"),hQ=xo("nodejs.webstream.controllerErrorFunction");function Dp(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function Np(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function mQ(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function pn(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function KD(e){return!!(e&&!pn(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function XD(e){return!!(e&&!pn(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function JD(e){return!!(e&&!pn(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function gQ(e){return KD(e)||XD(e)||JD(e)}function yQ(e,t){return e==null?!1:t===!0?typeof e[WD]=="function":t===!1?typeof e[HD]=="function":typeof e[WD]=="function"||typeof e[HD]=="function"}function Pp(e){if(!pn(e))return null;let t=e._writableState,r=e._readableState,i=t||r;return!!(e.destroyed||e[VD]||i!=null&&i.destroyed)}function YD(e){if(!Np(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}function vQ(e,t){if(!Np(e))return null;if(e.writableFinished===!0)return!0;let r=e._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}function bQ(e){if(!Dp(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}function QD(e,t){if(!Dp(e))return null;let r=e._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}function eN(e){return e&&e[VS]!=null?e[VS]:typeof e?.readable!="boolean"?null:Pp(e)?!1:Dp(e)&&e.readable&&!QD(e)}function tN(e){return e&&e[ZS]!=null?e[ZS]:typeof e?.writable!="boolean"?null:Pp(e)?!1:Np(e)&&e.writable&&!YD(e)}function _Q(e,t){return pn(e)?Pp(e)?!0:!(t?.readable!==!1&&eN(e)||t?.writable!==!1&&tN(e)):null}function wQ(e){var t,r;return pn(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function xQ(e){var t,r;return pn(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function SQ(e){if(!pn(e))return null;if(typeof e.closed=="boolean")return e.closed;let t=e._writableState,r=e._readableState;return typeof t?.closed=="boolean"||typeof r?.closed=="boolean"?t?.closed||r?.closed:typeof e._closed=="boolean"&&rN(e)?e._closed:null}function rN(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function nN(e){return typeof e._sent100=="boolean"&&rN(e)}function EQ(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function kQ(e){if(!pn(e))return null;let t=e._writableState,r=e._readableState,i=t||r;return!i&&nN(e)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}function TQ(e){var t;return!!(e&&((t=e[GD])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function IQ(e){var t,r,i,n,o,s,a,c,u,l;return!!(e&&((t=(r=(i=(n=(o=(s=e[ZD])!==null&&s!==void 0?s:e.readableErrored)!==null&&o!==void 0?o:e.writableErrored)!==null&&n!==void 0?n:(a=e._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&i!==void 0?i:(c=e._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(u=e._readableState)===null||u===void 0?void 0:u.errored)!==null&&t!==void 0?t:!((l=e._writableState)===null||l===void 0)&&l.errored))}iN.exports={isDestroyed:Pp,kIsDestroyed:VD,isDisturbed:TQ,kIsDisturbed:GD,isErrored:IQ,kIsErrored:ZD,isReadable:eN,kIsReadable:VS,kIsClosedPromise:pQ,kControllerErrorFunction:hQ,kIsWritable:ZS,isClosed:SQ,isDuplexNodeStream:mQ,isFinished:_Q,isIterable:yQ,isReadableNodeStream:Dp,isReadableStream:KD,isReadableEnded:bQ,isReadableFinished:QD,isReadableErrored:xQ,isNodeStream:pn,isWebStream:gQ,isWritable:tN,isWritableNodeStream:Np,isWritableStream:XD,isWritableEnded:YD,isWritableFinished:vQ,isWritableErrored:wQ,isServerRequest:EQ,isServerResponse:nN,willEmitClose:kQ,isTransformStream:JD}});var Gn=w((wEe,YS)=>{"use strict";var Pi=Ni(),{AbortError:pN,codes:OQ}=rr(),{ERR_INVALID_ARG_TYPE:CQ,ERR_STREAM_PREMATURE_CLOSE:oN}=OQ,{kEmptyObject:KS,once:XS}=pr(),{validateAbortSignal:AQ,validateFunction:$Q,validateObject:RQ,validateBoolean:DQ}=la(),{Promise:NQ,PromisePrototypeThen:PQ,SymbolDispose:hN}=ft(),{isClosed:qQ,isReadable:sN,isReadableNodeStream:GS,isReadableStream:jQ,isReadableFinished:aN,isReadableErrored:cN,isWritable:uN,isWritableNodeStream:lN,isWritableStream:MQ,isWritableFinished:fN,isWritableErrored:dN,isNodeStream:LQ,willEmitClose:FQ,kIsClosedPromise:zQ}=hn(),fa;function UQ(e){return e.setHeader&&typeof e.abort=="function"}var JS=()=>{};function mN(e,t,r){var i,n;if(arguments.length===2?(r=t,t=KS):t==null?t=KS:RQ(t,"options"),$Q(r,"callback"),AQ(t.signal,"options.signal"),r=XS(r),jQ(e)||MQ(e))return BQ(e,t,r);if(!LQ(e))throw new CQ("stream",["ReadableStream","WritableStream","Stream"],e);let o=(i=t.readable)!==null&&i!==void 0?i:GS(e),s=(n=t.writable)!==null&&n!==void 0?n:lN(e),a=e._writableState,c=e._readableState,u=()=>{e.writable||p()},l=FQ(e)&&GS(e)===o&&lN(e)===s,f=fN(e,!1),p=()=>{f=!0,e.destroyed&&(l=!1),!(l&&(!e.readable||o))&&(!o||d)&&r.call(e)},d=aN(e,!1),h=()=>{d=!0,e.destroyed&&(l=!1),!(l&&(!e.writable||s))&&(!s||f)&&r.call(e)},m=y=>{r.call(e,y)},_=qQ(e),k=()=>{_=!0;let y=dN(e)||cN(e);if(y&&typeof y!="boolean")return r.call(e,y);if(o&&!d&&GS(e,!0)&&!aN(e,!1))return r.call(e,new oN);if(s&&!f&&!fN(e,!1))return r.call(e,new oN);r.call(e)},S=()=>{_=!0;let y=dN(e)||cN(e);if(y&&typeof y!="boolean")return r.call(e,y);r.call(e)},v=()=>{e.req.on("finish",p)};UQ(e)?(e.on("complete",p),l||e.on("abort",k),e.req?v():e.on("request",v)):s&&!a&&(e.on("end",u),e.on("close",u)),!l&&typeof e.aborted=="boolean"&&e.on("aborted",k),e.on("end",h),e.on("finish",p),t.error!==!1&&e.on("error",m),e.on("close",k),_?Pi.nextTick(k):a!=null&&a.errorEmitted||c!=null&&c.errorEmitted?l||Pi.nextTick(S):(!o&&(!l||sN(e))&&(f||uN(e)===!1)||!s&&(!l||uN(e))&&(d||sN(e)===!1)||c&&e.req&&e.aborted)&&Pi.nextTick(S);let g=()=>{r=JS,e.removeListener("aborted",k),e.removeListener("complete",p),e.removeListener("abort",k),e.removeListener("request",v),e.req&&e.req.removeListener("finish",p),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",p),e.removeListener("end",h),e.removeListener("error",m),e.removeListener("close",k)};if(t.signal&&!_){let y=()=>{let T=r;g(),T.call(e,new pN(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)Pi.nextTick(y);else{fa=fa||pr().addAbortListener;let T=fa(t.signal,y),R=r;r=XS((...I)=>{T[hN](),R.apply(e,I)})}}return g}function BQ(e,t,r){let i=!1,n=JS;if(t.signal)if(n=()=>{i=!0,r.call(e,new pN(void 0,{cause:t.signal.reason}))},t.signal.aborted)Pi.nextTick(n);else{fa=fa||pr().addAbortListener;let s=fa(t.signal,n),a=r;r=XS((...c)=>{s[hN](),a.apply(e,c)})}let o=(...s)=>{i||Pi.nextTick(()=>r.apply(e,s))};return PQ(e[zQ].promise,o,o),JS}function WQ(e,t){var r;let i=!1;return t===null&&(t=KS),(r=t)!==null&&r!==void 0&&r.cleanup&&(DQ(t.cleanup,"cleanup"),i=t.cleanup),new NQ((n,o)=>{let s=mN(e,t,a=>{i&&s(),a?o(a):n()})})}YS.exports=mN;YS.exports.finished=WQ});var So=w((xEe,SN)=>{"use strict";var mn=Ni(),{aggregateTwoErrors:HQ,codes:{ERR_MULTIPLE_CALLBACK:VQ},AbortError:ZQ}=rr(),{Symbol:vN}=ft(),{kIsDestroyed:GQ,isDestroyed:KQ,isFinished:XQ,isServerRequest:JQ}=hn(),bN=vN("kDestroy"),QS=vN("kConstruct");function _N(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function YQ(e,t){let r=this._readableState,i=this._writableState,n=i||r;return i!=null&&i.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(_N(e,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),n.constructed?gN(this,e,t):this.once(bN,function(o){gN(this,HQ(o,e),t)}),this)}function gN(e,t,r){let i=!1;function n(o){if(i)return;i=!0;let s=e._readableState,a=e._writableState;_N(o,a,s),a&&(a.closed=!0),s&&(s.closed=!0),typeof r=="function"&&r(o),o?mn.nextTick(QQ,e,o):mn.nextTick(wN,e)}try{e._destroy(t||null,n)}catch(o){n(o)}}function QQ(e,t){e0(e,t),wN(e)}function wN(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function e0(e,t){let r=e._readableState,i=e._writableState;i!=null&&i.errorEmitted||r!=null&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function eee(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function t0(e,t,r){let i=e._readableState,n=e._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?e.destroy(t):t&&(t.stack,n&&!n.errored&&(n.errored=t),i&&!i.errored&&(i.errored=t),r?mn.nextTick(e0,e,t):e0(e,t))}function tee(e,t){if(typeof e._construct!="function")return;let r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(QS,t),!(e.listenerCount(QS)>1)&&mn.nextTick(ree,e)}function ree(e){let t=!1;function r(i){if(t){t0(e,i??new VQ);return}t=!0;let n=e._readableState,o=e._writableState,s=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),s.destroyed?e.emit(bN,i):i?t0(e,i,!0):mn.nextTick(nee,e)}try{e._construct(i=>{mn.nextTick(r,i)})}catch(i){mn.nextTick(r,i)}}function nee(e){e.emit(QS)}function yN(e){return e?.setHeader&&typeof e.abort=="function"}function xN(e){e.emit("close")}function iee(e,t){e.emit("error",t),mn.nextTick(xN,e)}function oee(e,t){!e||KQ(e)||(!t&&!XQ(e)&&(t=new ZQ),JQ(e)?(e.socket=null,e.destroy(t)):yN(e)?e.abort():yN(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?mn.nextTick(iee,e,t):mn.nextTick(xN,e),e.destroyed||(e[GQ]=!0))}SN.exports={construct:tee,destroyer:oee,destroy:YQ,undestroy:eee,errorOrDestroy:t0}});var Mp=w((SEe,kN)=>{"use strict";var{ArrayIsArray:see,ObjectSetPrototypeOf:EN}=ft(),{EventEmitter:qp}=B("events");function jp(e){qp.call(this,e)}EN(jp.prototype,qp.prototype);EN(jp,qp);jp.prototype.pipe=function(e,t){let r=this;function i(l){e.writable&&e.write(l)===!1&&r.pause&&r.pause()}r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}e.on("drain",n),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",s),r.on("close",a));let o=!1;function s(){o||(o=!0,e.end())}function a(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function c(l){u(),qp.listenerCount(this,"error")===0&&this.emit("error",l)}r0(r,"error",c),r0(e,"error",c);function u(){r.removeListener("data",i),e.removeListener("drain",n),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e};function r0(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):see(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}kN.exports={Stream:jp,prependListener:r0}});var Lu=w((EEe,Lp)=>{"use strict";var{SymbolDispose:aee}=ft(),{AbortError:TN,codes:cee}=rr(),{isNodeStream:IN,isWebStream:uee,kControllerErrorFunction:lee}=hn(),fee=Gn(),{ERR_INVALID_ARG_TYPE:ON}=cee,n0,dee=(e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new ON(t,"AbortSignal",e)};Lp.exports.addAbortSignal=function(t,r){if(dee(t,"signal"),!IN(r)&&!uee(r))throw new ON("stream",["ReadableStream","WritableStream","Stream"],r);return Lp.exports.addAbortSignalNoValidate(t,r)};Lp.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let r=IN(t)?()=>{t.destroy(new TN(void 0,{cause:e.reason}))}:()=>{t[lee](new TN(void 0,{cause:e.reason}))};if(e.aborted)r();else{n0=n0||pr().addAbortListener;let i=n0(e,r);fee(t,i[aee])}return t}});var $N=w((TEe,AN)=>{"use strict";var{StringPrototypeSlice:CN,SymbolIterator:pee,TypedArrayPrototypeSet:Fp,Uint8Array:hee}=ft(),{Buffer:i0}=B("buffer"),{inspect:mee}=pr();AN.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){let r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,i=""+r.data;for(;(r=r.next)!==null;)i+=t+r.data;return i}concat(t){if(this.length===0)return i0.alloc(0);let r=i0.allocUnsafe(t>>>0),i=this.head,n=0;for(;i;)Fp(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(t,r){let i=this.head.data;if(t<i.length){let n=i.slice(0,t);return this.head.data=i.slice(t),n}return t===i.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[pee](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",i=this.head,n=0;do{let o=i.data;if(t>o.length)r+=o,t-=o.length;else{t===o.length?(r+=o,++n,i.next?this.head=i.next:this.head=this.tail=null):(r+=CN(o,0,t),this.head=i,i.data=CN(o,t));break}++n}while((i=i.next)!==null);return this.length-=n,r}_getBuffer(t){let r=i0.allocUnsafe(t),i=t,n=this.head,o=0;do{let s=n.data;if(t>s.length)Fp(r,s,i-t),t-=s.length;else{t===s.length?(Fp(r,s,i-t),++o,n.next?this.head=n.next:this.head=this.tail=null):(Fp(r,new hee(s.buffer,s.byteOffset,t),i-t),this.head=n,n.data=s.slice(t));break}++o}while((n=n.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return mee(this,{...r,depth:0,customInspect:!1})}}});var Fu=w((IEe,PN)=>{"use strict";var{MathFloor:gee,NumberIsInteger:yee}=ft(),{validateInteger:vee}=la(),{ERR_INVALID_ARG_VALUE:bee}=rr().codes,RN=16*1024,DN=16;function _ee(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function NN(e){return e?DN:RN}function wee(e,t){vee(t,"value",0),e?DN=t:RN=t}function xee(e,t,r,i){let n=_ee(t,i,r);if(n!=null){if(!yee(n)||n<0){let o=i?`options.${r}`:"options.highWaterMark";throw new bee(o,n)}return gee(n)}return NN(e.objectMode)}PN.exports={getHighWaterMark:xee,getDefaultHighWaterMark:NN,setDefaultHighWaterMark:wee}});var MN=w((o0,jN)=>{var zp=B("buffer"),gn=zp.Buffer;function qN(e,t){for(var r in e)t[r]=e[r]}gn.from&&gn.alloc&&gn.allocUnsafe&&gn.allocUnsafeSlow?jN.exports=zp:(qN(zp,o0),o0.Buffer=Eo);function Eo(e,t,r){return gn(e,t,r)}Eo.prototype=Object.create(gn.prototype);qN(gn,Eo);Eo.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return gn(e,t,r)};Eo.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=gn(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};Eo.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return gn(e)};Eo.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return zp.SlowBuffer(e)}});var zN=w(FN=>{"use strict";var a0=MN().Buffer,LN=a0.isEncoding||function(e){switch(e=""+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 See(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}}function Eee(e){var t=See(e);if(typeof t!="string"&&(a0.isEncoding===LN||!LN(e)))throw new Error("Unknown encoding: "+e);return t||e}FN.StringDecoder=zu;function zu(e){this.encoding=Eee(e);var t;switch(this.encoding){case"utf16le":this.text=Aee,this.end=$ee,t=4;break;case"utf8":this.fillLast=Iee,t=4;break;case"base64":this.text=Ree,this.end=Dee,t=3;break;default:this.write=Nee,this.end=Pee;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=a0.allocUnsafe(t)}zu.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};zu.prototype.end=Cee;zu.prototype.text=Oee;zu.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};function s0(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function kee(e,t,r){var i=t.length-1;if(i<r)return 0;var n=s0(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=s0(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=s0(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function Tee(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function Iee(e){var t=this.lastTotal-this.lastNeed,r=Tee(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function Oee(e,t){var r=kee(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}function Cee(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function Aee(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function $ee(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function Ree(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?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-r))}function Dee(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Nee(e){return e.toString(this.encoding)}function Pee(e){return e&&e.length?this.write(e):""}});var c0=w((CEe,HN)=>{"use strict";var UN=Ni(),{PromisePrototypeThen:qee,SymbolAsyncIterator:BN,SymbolIterator:WN}=ft(),{Buffer:jee}=B("buffer"),{ERR_INVALID_ARG_TYPE:Mee,ERR_STREAM_NULL_VALUES:Lee}=rr().codes;function Fee(e,t,r){let i;if(typeof t=="string"||t instanceof jee)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let n;if(t&&t[BN])n=!0,i=t[BN]();else if(t&&t[WN])n=!1,i=t[WN]();else throw new Mee("iterable",["Iterable"],t);let o=new e({objectMode:!0,highWaterMark:1,...r}),s=!1;o._read=function(){s||(s=!0,c())},o._destroy=function(u,l){qee(a(u),()=>UN.nextTick(l,u),f=>UN.nextTick(l,f||u))};async function a(u){let l=u!=null,f=typeof i.throw=="function";if(l&&f){let{value:p,done:d}=await i.throw(u);if(await p,d)return}if(typeof i.return=="function"){let{value:p}=await i.return();await p}}async function c(){for(;;){try{let{value:u,done:l}=n?await i.next():i.next();if(l)o.push(null);else{let f=u&&typeof u.then=="function"?await u:u;if(f===null)throw s=!1,new Lee;if(o.push(f))continue;s=!1}}catch(u){o.destroy(u)}break}}return o}HN.exports=Fee});var Bu=w((AEe,uP)=>{"use strict";var Yr=Ni(),{ArrayPrototypeIndexOf:zee,NumberIsInteger:Uee,NumberIsNaN:Bee,NumberParseInt:Wee,ObjectDefineProperties:g0,ObjectKeys:Hee,ObjectSetPrototypeOf:GN,Promise:KN,SafeSet:Vee,SymbolAsyncDispose:Zee,SymbolAsyncIterator:Gee,Symbol:Kee}=ft();uP.exports=ke;ke.ReadableState=Hp;var{EventEmitter:Xee}=B("events"),{Stream:qi,prependListener:Jee}=Mp(),{Buffer:u0}=B("buffer"),{addAbortSignal:Yee}=Lu(),XN=Gn(),Pe=pr().debuglog("stream",e=>{Pe=e}),Qee=$N(),ha=So(),{getHighWaterMark:ete,getDefaultHighWaterMark:tte}=Fu(),{aggregateTwoErrors:VN,codes:{ERR_INVALID_ARG_TYPE:rte,ERR_METHOD_NOT_IMPLEMENTED:nte,ERR_OUT_OF_RANGE:ite,ERR_STREAM_PUSH_AFTER_EOF:ote,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:ste},AbortError:ate}=rr(),{validateObject:cte}=la(),ko=Kee("kPaused"),{StringDecoder:JN}=zN(),ute=c0();GN(ke.prototype,qi.prototype);GN(ke,qi);var l0=()=>{},{errorOrDestroy:da}=ha,pa=1,lte=2,YN=4,Uu=8,QN=16,Up=32,Bp=64,eP=128,fte=256,dte=512,pte=1024,h0=2048,m0=4096,hte=8192,mte=16384,gte=32768,tP=65536,yte=1<<17,vte=1<<18;function $t(e){return{enumerable:!1,get(){return(this.state&e)!==0},set(t){t?this.state|=e:this.state&=~e}}}g0(Hp.prototype,{objectMode:$t(pa),ended:$t(lte),endEmitted:$t(YN),reading:$t(Uu),constructed:$t(QN),sync:$t(Up),needReadable:$t(Bp),emittedReadable:$t(eP),readableListening:$t(fte),resumeScheduled:$t(dte),errorEmitted:$t(pte),emitClose:$t(h0),autoDestroy:$t(m0),destroyed:$t(hte),closed:$t(mte),closeEmitted:$t(gte),multiAwaitDrain:$t(tP),readingMore:$t(yte),dataEmitted:$t(vte)});function Hp(e,t,r){typeof r!="boolean"&&(r=t instanceof yn()),this.state=h0|m0|QN|Up,e&&e.objectMode&&(this.state|=pa),r&&e&&e.readableObjectMode&&(this.state|=pa),this.highWaterMark=e?ete(this,e,"readableHighWaterMark",r):tte(!1),this.buffer=new Qee,this.length=0,this.pipes=[],this.flowing=null,this[ko]=null,e&&e.emitClose===!1&&(this.state&=~h0),e&&e.autoDestroy===!1&&(this.state&=~m0),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new JN(e.encoding),this.encoding=e.encoding)}function ke(e){if(!(this instanceof ke))return new ke(e);let t=this instanceof yn();this._readableState=new Hp(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&Yee(e.signal,this)),qi.call(this,e),ha.construct(this,()=>{this._readableState.needReadable&&Wp(this,this._readableState)})}ke.prototype.destroy=ha.destroy;ke.prototype._undestroy=ha.undestroy;ke.prototype._destroy=function(e,t){t(e)};ke.prototype[Xee.captureRejectionSymbol]=function(e){this.destroy(e)};ke.prototype[Zee]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new ate,this.destroy(e)),new KN((t,r)=>XN(this,i=>i&&i!==e?r(i):t(null)))};ke.prototype.push=function(e,t){return rP(this,e,t,!1)};ke.prototype.unshift=function(e,t){return rP(this,e,t,!0)};function rP(e,t,r,i){Pe("readableAddChunk",t);let n=e._readableState,o;if((n.state&pa)===0&&(typeof t=="string"?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?t=u0.from(t,r).toString(n.encoding):(t=u0.from(t,r),r=""))):t instanceof u0?r="":qi._isUint8Array(t)?(t=qi._uint8ArrayToBuffer(t),r=""):t!=null&&(o=new rte("chunk",["string","Buffer","Uint8Array"],t))),o)da(e,o);else if(t===null)n.state&=~Uu,wte(e,n);else if((n.state&pa)!==0||t&&t.length>0)if(i)if((n.state&YN)!==0)da(e,new ste);else{if(n.destroyed||n.errored)return!1;f0(e,n,t,!0)}else if(n.ended)da(e,new ote);else{if(n.destroyed||n.errored)return!1;n.state&=~Uu,n.decoder&&!r?(t=n.decoder.write(t),n.objectMode||t.length!==0?f0(e,n,t,!1):Wp(e,n)):f0(e,n,t,!1)}else i||(n.state&=~Uu,Wp(e,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}function f0(e,t,r,i){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?((t.state&tP)!==0?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),(t.state&Bp)!==0&&Vp(e)),Wp(e,t)}ke.prototype.isPaused=function(){let e=this._readableState;return e[ko]===!0||e.flowing===!1};ke.prototype.setEncoding=function(e){let t=new JN(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,i="";for(let n of r)i+=t.write(n);return r.clear(),i!==""&&r.push(i),this._readableState.length=i.length,this};var bte=1073741824;function _te(e){if(e>bte)throw new ite("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}function ZN(e,t){return e<=0||t.length===0&&t.ended?0:(t.state&pa)!==0?1:Bee(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}ke.prototype.read=function(e){Pe("read",e),e===void 0?e=NaN:Uee(e)||(e=Wee(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=_te(e)),e!==0&&(t.state&=~eP),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return Pe("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?d0(this):Vp(this),null;if(e=ZN(e,t),e===0&&t.ended)return t.length===0&&d0(this),null;let i=(t.state&Bp)!==0;if(Pe("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,Pe("length less than watermark",i)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)i=!1,Pe("reading, ended or constructing",i);else if(i){Pe("do read"),t.state|=Uu|Up,t.length===0&&(t.state|=Bp);try{this._read(t.highWaterMark)}catch(o){da(this,o)}t.state&=~Up,t.reading||(e=ZN(r,t))}let n;return e>0?n=aP(e,t):n=null,n===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&d0(this)),n!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",n)),n};function wte(e,t){if(Pe("onEofChunk"),!t.ended){if(t.decoder){let r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Vp(e):(t.needReadable=!1,t.emittedReadable=!0,nP(e))}}function Vp(e){let t=e._readableState;Pe("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(Pe("emitReadable",t.flowing),t.emittedReadable=!0,Yr.nextTick(nP,e))}function nP(e){let t=e._readableState;Pe("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,oP(e)}function Wp(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,Yr.nextTick(xte,e,t))}function xte(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let r=t.length;if(Pe("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}ke.prototype._read=function(e){throw new nte("_read()")};ke.prototype.pipe=function(e,t){let r=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new Vee(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),Pe("pipe count=%d opts=%j",i.pipes.length,t);let o=(!t||t.end!==!1)&&e!==Yr.stdout&&e!==Yr.stderr?a:_;i.endEmitted?Yr.nextTick(o):r.once("end",o),e.on("unpipe",s);function s(k,S){Pe("onunpipe"),k===r&&S&&S.hasUnpiped===!1&&(S.hasUnpiped=!0,l())}function a(){Pe("onend"),e.end()}let c,u=!1;function l(){Pe("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),c&&e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",_),r.removeListener("data",p),u=!0,c&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&c()}function f(){u||(i.pipes.length===1&&i.pipes[0]===e?(Pe("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(Pe("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),c||(c=Ste(r,e),e.on("drain",c))}r.on("data",p);function p(k){Pe("ondata");let S=e.write(k);Pe("dest.write",S),S===!1&&f()}function d(k){if(Pe("onerror",k),_(),e.removeListener("error",d),e.listenerCount("error")===0){let S=e._writableState||e._readableState;S&&!S.errorEmitted?da(e,k):e.emit("error",k)}}Jee(e,"error",d);function h(){e.removeListener("finish",m),_()}e.once("close",h);function m(){Pe("onfinish"),e.removeListener("close",h),_()}e.once("finish",m);function _(){Pe("unpipe"),r.unpipe(e)}return e.emit("pipe",r),e.writableNeedDrain===!0?f():i.flowing||(Pe("pipe resume"),r.resume()),e};function Ste(e,t){return function(){let i=e._readableState;i.awaitDrainWriters===t?(Pe("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(Pe("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(t)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()}}ke.prototype.unpipe=function(e){let t=this._readableState,r={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let n=t.pipes;t.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let i=zee(t.pipes,e);return i===-1?this:(t.pipes.splice(i,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,r),this)};ke.prototype.on=function(e,t){let r=qi.prototype.on.call(this,e,t),i=this._readableState;return e==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):e==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,Pe("on readable",i.length,i.reading),i.length?Vp(this):i.reading||Yr.nextTick(Ete,this)),r};ke.prototype.addListener=ke.prototype.on;ke.prototype.removeListener=function(e,t){let r=qi.prototype.removeListener.call(this,e,t);return e==="readable"&&Yr.nextTick(iP,this),r};ke.prototype.off=ke.prototype.removeListener;ke.prototype.removeAllListeners=function(e){let t=qi.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&Yr.nextTick(iP,this),t};function iP(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[ko]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function Ete(e){Pe("readable nexttick read 0"),e.read(0)}ke.prototype.resume=function(){let e=this._readableState;return e.flowing||(Pe("resume"),e.flowing=!e.readableListening,kte(this,e)),e[ko]=!1,this};function kte(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Yr.nextTick(Tte,e,t))}function Tte(e,t){Pe("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),oP(e),t.flowing&&!t.reading&&e.read(0)}ke.prototype.pause=function(){return Pe("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Pe("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ko]=!0,this};function oP(e){let t=e._readableState;for(Pe("flow",t.flowing);t.flowing&&e.read()!==null;);}ke.prototype.wrap=function(e){let t=!1;e.on("data",i=>{!this.push(i)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",i=>{da(this,i)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=Hee(e);for(let i=1;i<r.length;i++){let n=r[i];this[n]===void 0&&typeof e[n]=="function"&&(this[n]=e[n].bind(e))}return this};ke.prototype[Gee]=function(){return sP(this)};ke.prototype.iterator=function(e){return e!==void 0&&cte(e,"options"),sP(this,e)};function sP(e,t){typeof e.read!="function"&&(e=ke.wrap(e,{objectMode:!0}));let r=Ite(e,t);return r.stream=e,r}async function*Ite(e,t){let r=l0;function i(s){this===e?(r(),r=l0):r=s}e.on("readable",i);let n,o=XN(e,{writable:!1},s=>{n=s?VN(n,s):null,r(),r=l0});try{for(;;){let s=e.destroyed?null:e.read();if(s!==null)yield s;else{if(n)throw n;if(n===null)return;await new KN(i)}}}catch(s){throw n=VN(n,s),n}finally{(n||t?.destroyOnReturn!==!1)&&(n===void 0||e._readableState.autoDestroy)?ha.destroyer(e,null):(e.off("readable",i),o())}}g0(ke.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});g0(Hp.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ko]!==!1},set(e){this[ko]=!!e}}});ke._fromList=aP;function aP(e,t){if(t.length===0)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function d0(e){let t=e._readableState;Pe("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Yr.nextTick(Ote,t,e))}function Ote(e,t){if(Pe("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit("end"),t.writable&&t.allowHalfOpen===!1)Yr.nextTick(Cte,t);else if(e.autoDestroy){let r=t._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&t.destroy()}}}function Cte(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}ke.from=function(e,t){return ute(ke,e,t)};var p0;function cP(){return p0===void 0&&(p0={}),p0}ke.fromWeb=function(e,t){return cP().newStreamReadableFromReadableStream(e,t)};ke.toWeb=function(e,t){return cP().newReadableStreamFromStreamReadable(e,t)};ke.wrap=function(e,t){var r,i;return new ke({objectMode:(r=(i=e.readableObjectMode)!==null&&i!==void 0?i:e.objectMode)!==null&&r!==void 0?r:!0,...t,destroy(n,o){ha.destroyer(e,n),o(n)}}).wrap(e)}});var Jp=w(($Ee,wP)=>{"use strict";var To=Ni(),{ArrayPrototypeSlice:dP,Error:Ate,FunctionPrototypeSymbolHasInstance:pP,ObjectDefineProperty:hP,ObjectDefineProperties:$te,ObjectSetPrototypeOf:mP,StringPrototypeToLowerCase:Rte,Symbol:Dte,SymbolHasInstance:Nte}=ft();wP.exports=mt;mt.WritableState=Vu;var{EventEmitter:Pte}=B("events"),Wu=Mp().Stream,{Buffer:Zp}=B("buffer"),Xp=So(),{addAbortSignal:qte}=Lu(),{getHighWaterMark:jte,getDefaultHighWaterMark:Mte}=Fu(),{ERR_INVALID_ARG_TYPE:Lte,ERR_METHOD_NOT_IMPLEMENTED:Fte,ERR_MULTIPLE_CALLBACK:gP,ERR_STREAM_CANNOT_PIPE:zte,ERR_STREAM_DESTROYED:Hu,ERR_STREAM_ALREADY_FINISHED:Ute,ERR_STREAM_NULL_VALUES:Bte,ERR_STREAM_WRITE_AFTER_END:Wte,ERR_UNKNOWN_ENCODING:yP}=rr().codes,{errorOrDestroy:ma}=Xp;mP(mt.prototype,Wu.prototype);mP(mt,Wu);function b0(){}var ga=Dte("kOnFinished");function Vu(e,t,r){typeof r!="boolean"&&(r=t instanceof yn()),this.objectMode=!!(e&&e.objectMode),r&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?jte(this,e,"writableHighWaterMark",r):Mte(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(e&&e.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Vte.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Kp(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[ga]=[]}function Kp(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}Vu.prototype.getBuffer=function(){return dP(this.buffered,this.bufferedIndex)};hP(Vu.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function mt(e){let t=this instanceof yn();if(!t&&!pP(mt,this))return new mt(e);this._writableState=new Vu(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&qte(e.signal,this)),Wu.call(this,e),Xp.construct(this,()=>{let r=this._writableState;r.writing||w0(this,r),x0(this,r)})}hP(mt,Nte,{__proto__:null,value:function(e){return pP(this,e)?!0:this!==mt?!1:e&&e._writableState instanceof Vu}});mt.prototype.pipe=function(){ma(this,new zte)};function vP(e,t,r,i){let n=e._writableState;if(typeof r=="function")i=r,r=n.defaultEncoding;else{if(!r)r=n.defaultEncoding;else if(r!=="buffer"&&!Zp.isEncoding(r))throw new yP(r);typeof i!="function"&&(i=b0)}if(t===null)throw new Bte;if(!n.objectMode)if(typeof t=="string")n.decodeStrings!==!1&&(t=Zp.from(t,r),r="buffer");else if(t instanceof Zp)r="buffer";else if(Wu._isUint8Array(t))t=Wu._uint8ArrayToBuffer(t),r="buffer";else throw new Lte("chunk",["string","Buffer","Uint8Array"],t);let o;return n.ending?o=new Wte:n.destroyed&&(o=new Hu("write")),o?(To.nextTick(i,o),ma(e,o,!0),o):(n.pendingcb++,Hte(e,n,t,r,i))}mt.prototype.write=function(e,t,r){return vP(this,e,t,r)===!0};mt.prototype.cork=function(){this._writableState.corked++};mt.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||w0(this,e))};mt.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=Rte(t)),!Zp.isEncoding(t))throw new yP(t);return this._writableState.defaultEncoding=t,this};function Hte(e,t,r,i,n){let o=t.objectMode?1:r.length;t.length+=o;let s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:i,callback:n}),t.allBuffers&&i!=="buffer"&&(t.allBuffers=!1),t.allNoop&&n!==b0&&(t.allNoop=!1)):(t.writelen=o,t.writecb=n,t.writing=!0,t.sync=!0,e._write(r,i,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}function lP(e,t,r,i,n,o,s){t.writelen=i,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new Hu("write")):r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function fP(e,t,r,i){--t.pendingcb,i(r),_0(t),ma(e,r)}function Vte(e,t){let r=e._writableState,i=r.sync,n=r.writecb;if(typeof n!="function"){ma(e,new gP);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?To.nextTick(fP,e,r,t,n):fP(e,r,t,n)):(r.buffered.length>r.bufferedIndex&&w0(e,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===n?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:n,stream:e,state:r},To.nextTick(Zte,r.afterWriteTickInfo)):bP(e,r,1,n))}function Zte({stream:e,state:t,count:r,cb:i}){return t.afterWriteTickInfo=null,bP(e,t,r,i)}function bP(e,t,r,i){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,i();t.destroyed&&_0(t),x0(e,t)}function _0(e){if(e.writing)return;for(let n=e.bufferedIndex;n<e.buffered.length;++n){var t;let{chunk:o,callback:s}=e.buffered[n],a=e.objectMode?1:o.length;e.length-=a,s((t=e.errored)!==null&&t!==void 0?t:new Hu("write"))}let r=e[ga].splice(0);for(let n=0;n<r.length;n++){var i;r[n]((i=e.errored)!==null&&i!==void 0?i:new Hu("end"))}Kp(e)}function w0(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:n}=t,o=r.length-i;if(!o)return;let s=i;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;let a=t.allNoop?b0:u=>{for(let l=s;l<r.length;++l)r[l].callback(u)},c=t.allNoop&&s===0?r:dP(r,s);c.allBuffers=t.allBuffers,lP(e,t,!0,t.length,c,"",a),Kp(t)}else{do{let{chunk:a,encoding:c,callback:u}=r[s];r[s++]=null;let l=n?1:a.length;lP(e,t,!1,l,a,c,u)}while(s<r.length&&!t.writing);s===r.length?Kp(t):s>256?(r.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}mt.prototype._write=function(e,t,r){if(this._writev)this._writev([{chunk:e,encoding:t}],r);else throw new Fte("_write()")};mt.prototype._writev=null;mt.prototype.end=function(e,t,r){let i=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null);let n;if(e!=null){let o=vP(this,e,t);o instanceof Ate&&(n=o)}return i.corked&&(i.corked=1,this.uncork()),n||(!i.errored&&!i.ending?(i.ending=!0,x0(this,i,!0),i.ended=!0):i.finished?n=new Ute("end"):i.destroyed&&(n=new Hu("end"))),typeof r=="function"&&(n||i.finished?To.nextTick(r,n):i[ga].push(r)),this};function Gp(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function Gte(e,t){let r=!1;function i(n){if(r){ma(e,n??gP());return}if(r=!0,t.pendingcb--,n){let o=t[ga].splice(0);for(let s=0;s<o.length;s++)o[s](n);ma(e,n,t.sync)}else Gp(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,To.nextTick(v0,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(n){i(n)}t.sync=!1}function Kte(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,Gte(e,t)):(t.prefinished=!0,e.emit("prefinish")))}function x0(e,t,r){Gp(t)&&(Kte(e,t),t.pendingcb===0&&(r?(t.pendingcb++,To.nextTick((i,n)=>{Gp(n)?v0(i,n):n.pendingcb--},e,t)):Gp(t)&&(t.pendingcb++,v0(e,t))))}function v0(e,t){t.pendingcb--,t.finished=!0;let r=t[ga].splice(0);for(let i=0;i<r.length;i++)r[i]();if(e.emit("finish"),t.autoDestroy){let i=e._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&e.destroy()}}$te(mt.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Xte=Xp.destroy;mt.prototype.destroy=function(e,t){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[ga].length)&&To.nextTick(_0,r),Xte.call(this,e,t),this};mt.prototype._undestroy=Xp.undestroy;mt.prototype._destroy=function(e,t){t(e)};mt.prototype[Pte.captureRejectionSymbol]=function(e){this.destroy(e)};var y0;function _P(){return y0===void 0&&(y0={}),y0}mt.fromWeb=function(e,t){return _P().newStreamWritableFromWritableStream(e,t)};mt.toWeb=function(e){return _P().newWritableStreamFromStreamWritable(e)}});var qP=w((REe,PP)=>{var S0=Ni(),Jte=B("buffer"),{isReadable:Yte,isWritable:Qte,isIterable:xP,isNodeStream:ere,isReadableNodeStream:SP,isWritableNodeStream:EP,isDuplexNodeStream:tre,isReadableStream:kP,isWritableStream:TP}=hn(),IP=Gn(),{AbortError:DP,codes:{ERR_INVALID_ARG_TYPE:rre,ERR_INVALID_RETURN_VALUE:OP}}=rr(),{destroyer:va}=So(),nre=yn(),NP=Bu(),ire=Jp(),{createDeferredPromise:CP}=pr(),AP=c0(),$P=globalThis.Blob||Jte.Blob,ore=typeof $P<"u"?function(t){return t instanceof $P}:function(t){return!1},sre=globalThis.AbortController||ca().AbortController,{FunctionPrototypeCall:RP}=ft(),ji=class extends nre{constructor(t){super(t),t?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};PP.exports=function e(t,r){if(tre(t))return t;if(SP(t))return ya({readable:t});if(EP(t))return ya({writable:t});if(ere(t))return ya({writable:!1,readable:!1});if(kP(t))return ya({readable:NP.fromWeb(t)});if(TP(t))return ya({writable:ire.fromWeb(t)});if(typeof t=="function"){let{value:n,write:o,final:s,destroy:a}=are(t);if(xP(n))return AP(ji,n,{objectMode:!0,write:o,final:s,destroy:a});let c=n?.then;if(typeof c=="function"){let u,l=RP(c,n,f=>{if(f!=null)throw new OP("nully","body",f)},f=>{va(u,f)});return u=new ji({objectMode:!0,readable:!1,write:o,final(f){s(async()=>{try{await l,S0.nextTick(f,null)}catch(p){S0.nextTick(f,p)}})},destroy:a})}throw new OP("Iterable, AsyncIterable or AsyncFunction",r,n)}if(ore(t))return e(t.arrayBuffer());if(xP(t))return AP(ji,t,{objectMode:!0,writable:!1});if(kP(t?.readable)&&TP(t?.writable))return ji.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let n=t!=null&&t.readable?SP(t?.readable)?t?.readable:e(t.readable):void 0,o=t!=null&&t.writable?EP(t?.writable)?t?.writable:e(t.writable):void 0;return ya({readable:n,writable:o})}let i=t?.then;if(typeof i=="function"){let n;return RP(i,t,o=>{o!=null&&n.push(o),n.push(null)},o=>{va(n,o)}),n=new ji({objectMode:!0,writable:!1,read(){}})}throw new rre(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)};function are(e){let{promise:t,resolve:r}=CP(),i=new sre,n=i.signal;return{value:e((async function*(){for(;;){let s=t;t=null;let{chunk:a,done:c,cb:u}=await s;if(S0.nextTick(u),c)return;if(n.aborted)throw new DP(void 0,{cause:n.reason});({promise:t,resolve:r}=CP()),yield a}})(),{signal:n}),write(s,a,c){let u=r;r=null,u({chunk:s,done:!1,cb:c})},final(s){let a=r;r=null,a({done:!0,cb:s})},destroy(s,a){i.abort(),a(s)}}}function ya(e){let t=e.readable&&typeof e.readable.read!="function"?NP.wrap(e.readable):e.readable,r=e.writable,i=!!Yte(t),n=!!Qte(r),o,s,a,c,u;function l(f){let p=c;c=null,p?p(f):f&&u.destroy(f)}return u=new ji({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:i,writable:n}),n&&(IP(r,f=>{n=!1,f&&va(t,f),l(f)}),u._write=function(f,p,d){r.write(f,p)?d():o=d},u._final=function(f){r.end(),s=f},r.on("drain",function(){if(o){let f=o;o=null,f()}}),r.on("finish",function(){if(s){let f=s;s=null,f()}})),i&&(IP(t,f=>{i=!1,f&&va(t,f),l(f)}),t.on("readable",function(){if(a){let f=a;a=null,f()}}),t.on("end",function(){u.push(null)}),u._read=function(){for(;;){let f=t.read();if(f===null){a=u._read;return}if(!u.push(f))return}}),u._destroy=function(f,p){!f&&c!==null&&(f=new DP),a=null,o=null,s=null,c===null?p(f):(c=p,va(r,f),va(t,f))},u}});var yn=w((DEe,LP)=>{"use strict";var{ObjectDefineProperties:cre,ObjectGetOwnPropertyDescriptor:Kn,ObjectKeys:ure,ObjectSetPrototypeOf:jP}=ft();LP.exports=Qr;var T0=Bu(),jr=Jp();jP(Qr.prototype,T0.prototype);jP(Qr,T0);{let e=ure(jr.prototype);for(let t=0;t<e.length;t++){let r=e[t];Qr.prototype[r]||(Qr.prototype[r]=jr.prototype[r])}}function Qr(e){if(!(this instanceof Qr))return new Qr(e);T0.call(this,e),jr.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,e.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}cre(Qr.prototype,{writable:{__proto__:null,...Kn(jr.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Kn(jr.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Kn(jr.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Kn(jr.prototype,"writableBuffer")},writableLength:{__proto__:null,...Kn(jr.prototype,"writableLength")},writableFinished:{__proto__:null,...Kn(jr.prototype,"writableFinished")},writableCorked:{__proto__:null,...Kn(jr.prototype,"writableCorked")},writableEnded:{__proto__:null,...Kn(jr.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Kn(jr.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}});var E0;function MP(){return E0===void 0&&(E0={}),E0}Qr.fromWeb=function(e,t){return MP().newStreamDuplexFromReadableWritablePair(e,t)};Qr.toWeb=function(e){return MP().newReadableWritablePairFromDuplex(e)};var k0;Qr.from=function(e){return k0||(k0=qP()),k0(e,"body")}});var C0=w((NEe,zP)=>{"use strict";var{ObjectSetPrototypeOf:FP,Symbol:lre}=ft();zP.exports=Xn;var{ERR_METHOD_NOT_IMPLEMENTED:fre}=rr().codes,O0=yn(),{getHighWaterMark:dre}=Fu();FP(Xn.prototype,O0.prototype);FP(Xn,O0);var Zu=lre("kCallback");function Xn(e){if(!(this instanceof Xn))return new Xn(e);let t=e?dre(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),O0.call(this,e),this._readableState.sync=!1,this[Zu]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",pre)}function I0(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function pre(){this._final!==I0&&I0.call(this)}Xn.prototype._final=I0;Xn.prototype._transform=function(e,t,r){throw new fre("_transform()")};Xn.prototype._write=function(e,t,r){let i=this._readableState,n=this._writableState,o=i.length;this._transform(e,t,(s,a)=>{if(s){r(s);return}a!=null&&this.push(a),n.ended||o===i.length||i.length<i.highWaterMark?r():this[Zu]=r})};Xn.prototype._read=function(){if(this[Zu]){let e=this[Zu];this[Zu]=null,e()}}});var $0=w((PEe,BP)=>{"use strict";var{ObjectSetPrototypeOf:UP}=ft();BP.exports=ba;var A0=C0();UP(ba.prototype,A0.prototype);UP(ba,A0);function ba(e){if(!(this instanceof ba))return new ba(e);A0.call(this,e)}ba.prototype._transform=function(e,t,r){r(null,e)}});var th=w((qEe,GP)=>{var Gu=Ni(),{ArrayIsArray:hre,Promise:mre,SymbolAsyncIterator:gre,SymbolDispose:yre}=ft(),eh=Gn(),{once:vre}=pr(),bre=So(),WP=yn(),{aggregateTwoErrors:_re,codes:{ERR_INVALID_ARG_TYPE:F0,ERR_INVALID_RETURN_VALUE:R0,ERR_MISSING_ARGS:wre,ERR_STREAM_DESTROYED:xre,ERR_STREAM_PREMATURE_CLOSE:Sre},AbortError:Ere}=rr(),{validateFunction:kre,validateAbortSignal:Tre}=la(),{isIterable:Io,isReadable:D0,isReadableNodeStream:Qp,isNodeStream:HP,isTransformStream:_a,isWebStream:Ire,isReadableStream:N0,isReadableFinished:Ore}=hn(),Cre=globalThis.AbortController||ca().AbortController,P0,q0,j0;function VP(e,t,r){let i=!1;e.on("close",()=>{i=!0});let n=eh(e,{readable:t,writable:r},o=>{i=!o});return{destroy:o=>{i||(i=!0,bre.destroyer(e,o||new xre("pipe")))},cleanup:n}}function Are(e){return kre(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function M0(e){if(Io(e))return e;if(Qp(e))return $re(e);throw new F0("val",["Readable","Iterable","AsyncIterable"],e)}async function*$re(e){q0||(q0=Bu()),yield*q0.prototype[gre].call(e)}async function Yp(e,t,r,{end:i}){let n,o=null,s=u=>{if(u&&(n=u),o){let l=o;o=null,l()}},a=()=>new mre((u,l)=>{n?l(n):o=()=>{n?l(n):u()}});t.on("drain",s);let c=eh(t,{readable:!1},s);try{t.writableNeedDrain&&await a();for await(let u of e)t.write(u)||await a();i&&(t.end(),await a()),r()}catch(u){r(n!==u?_re(n,u):u)}finally{c(),t.off("drain",s)}}async function L0(e,t,r,{end:i}){_a(t)&&(t=t.writable);let n=t.getWriter();try{for await(let o of e)await n.ready,n.write(o).catch(()=>{});await n.ready,i&&await n.close(),r()}catch(o){try{await n.abort(o),r(o)}catch(s){r(s)}}}function Rre(...e){return ZP(e,vre(Are(e)))}function ZP(e,t,r){if(e.length===1&&hre(e[0])&&(e=e[0]),e.length<2)throw new wre("streams");let i=new Cre,n=i.signal,o=r?.signal,s=[];Tre(o,"options.signal");function a(){h(new Ere)}j0=j0||pr().addAbortListener;let c;o&&(c=j0(o,a));let u,l,f=[],p=0;function d(v){h(v,--p===0)}function h(v,g){var y;if(v&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=v),!(!u&&!g)){for(;f.length;)f.shift()(u);(y=c)===null||y===void 0||y[yre](),i.abort(),g&&(u||s.forEach(T=>T()),Gu.nextTick(t,u,l))}}let m;for(let v=0;v<e.length;v++){let g=e[v],y=v<e.length-1,T=v>0,R=y||r?.end!==!1,I=v===e.length-1;if(HP(g)){let b=function(O){O&&O.name!=="AbortError"&&O.code!=="ERR_STREAM_PREMATURE_CLOSE"&&d(O)};var S=b;if(R){let{destroy:O,cleanup:A}=VP(g,y,T);f.push(O),D0(g)&&I&&s.push(A)}g.on("error",b),D0(g)&&I&&s.push(()=>{g.removeListener("error",b)})}if(v===0)if(typeof g=="function"){if(m=g({signal:n}),!Io(m))throw new R0("Iterable, AsyncIterable or Stream","source",m)}else Io(g)||Qp(g)||_a(g)?m=g:m=WP.from(g);else if(typeof g=="function"){if(_a(m)){var _;m=M0((_=m)===null||_===void 0?void 0:_.readable)}else m=M0(m);if(m=g(m,{signal:n}),y){if(!Io(m,!0))throw new R0("AsyncIterable",`transform[${v-1}]`,m)}else{var k;P0||(P0=$0());let b=new P0({objectMode:!0}),O=(k=m)===null||k===void 0?void 0:k.then;if(typeof O=="function")p++,O.call(m,D=>{l=D,D!=null&&b.write(D),R&&b.end(),Gu.nextTick(d)},D=>{b.destroy(D),Gu.nextTick(d,D)});else if(Io(m,!0))p++,Yp(m,b,d,{end:R});else if(N0(m)||_a(m)){let D=m.readable||m;p++,Yp(D,b,d,{end:R})}else throw new R0("AsyncIterable or Promise","destination",m);m=b;let{destroy:A,cleanup:P}=VP(m,!1,!0);f.push(A),I&&s.push(P)}}else if(HP(g)){if(Qp(m)){p+=2;let b=Dre(m,g,d,{end:R});D0(g)&&I&&s.push(b)}else if(_a(m)||N0(m)){let b=m.readable||m;p++,Yp(b,g,d,{end:R})}else if(Io(m))p++,Yp(m,g,d,{end:R});else throw new F0("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],m);m=g}else if(Ire(g)){if(Qp(m))p++,L0(M0(m),g,d,{end:R});else if(N0(m)||Io(m))p++,L0(m,g,d,{end:R});else if(_a(m))p++,L0(m.readable,g,d,{end:R});else throw new F0("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],m);m=g}else m=WP.from(g)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&Gu.nextTick(a),m}function Dre(e,t,r,{end:i}){let n=!1;if(t.on("close",()=>{n||r(new Sre)}),e.pipe(t,{end:!1}),i){let s=function(){n=!0,t.end()};var o=s;Ore(e)?Gu.nextTick(s):e.once("end",s)}else r();return eh(e,{readable:!0,writable:!1},s=>{let a=e._readableState;s&&s.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?e.once("end",r).once("error",r):r(s)}),eh(t,{readable:!1,writable:!0},r)}GP.exports={pipelineImpl:ZP,pipeline:Rre}});var U0=w((jEe,eq)=>{"use strict";var{pipeline:Nre}=th(),rh=yn(),{destroyer:Pre}=So(),{isNodeStream:nh,isReadable:KP,isWritable:XP,isWebStream:z0,isTransformStream:Oo,isWritableStream:JP,isReadableStream:YP}=hn(),{AbortError:qre,codes:{ERR_INVALID_ARG_VALUE:QP,ERR_MISSING_ARGS:jre}}=rr(),Mre=Gn();eq.exports=function(...t){if(t.length===0)throw new jre("streams");if(t.length===1)return rh.from(t[0]);let r=[...t];if(typeof t[0]=="function"&&(t[0]=rh.from(t[0])),typeof t[t.length-1]=="function"){let d=t.length-1;t[d]=rh.from(t[d])}for(let d=0;d<t.length;++d)if(!(!nh(t[d])&&!z0(t[d]))){if(d<t.length-1&&!(KP(t[d])||YP(t[d])||Oo(t[d])))throw new QP(`streams[${d}]`,r[d],"must be readable");if(d>0&&!(XP(t[d])||JP(t[d])||Oo(t[d])))throw new QP(`streams[${d}]`,r[d],"must be writable")}let i,n,o,s,a;function c(d){let h=s;s=null,h?h(d):d?a.destroy(d):!p&&!f&&a.destroy()}let u=t[0],l=Nre(t,c),f=!!(XP(u)||JP(u)||Oo(u)),p=!!(KP(l)||YP(l)||Oo(l));if(a=new rh({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(l!=null&&l.readableObjectMode),writable:f,readable:p}),f){if(nh(u))a._write=function(h,m,_){u.write(h,m)?_():i=_},a._final=function(h){u.end(),n=h},u.on("drain",function(){if(i){let h=i;i=null,h()}});else if(z0(u)){let m=(Oo(u)?u.writable:u).getWriter();a._write=async function(_,k,S){try{await m.ready,m.write(_).catch(()=>{}),S()}catch(v){S(v)}},a._final=async function(_){try{await m.ready,m.close().catch(()=>{}),n=_}catch(k){_(k)}}}let d=Oo(l)?l.readable:l;Mre(d,()=>{if(n){let h=n;n=null,h()}})}if(p){if(nh(l))l.on("readable",function(){if(o){let d=o;o=null,d()}}),l.on("end",function(){a.push(null)}),a._read=function(){for(;;){let d=l.read();if(d===null){o=a._read;return}if(!a.push(d))return}};else if(z0(l)){let h=(Oo(l)?l.readable:l).getReader();a._read=async function(){for(;;)try{let{value:m,done:_}=await h.read();if(!a.push(m))return;if(_){a.push(null);return}}catch{return}}}}return a._destroy=function(d,h){!d&&s!==null&&(d=new qre),o=null,i=null,n=null,s===null?h(d):(s=h,nh(l)&&Pre(l,d))},a}});var lq=w((MEe,H0)=>{"use strict";var Lre=globalThis.AbortController||ca().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Fre,ERR_INVALID_ARG_TYPE:Ku,ERR_MISSING_ARGS:zre,ERR_OUT_OF_RANGE:Ure},AbortError:vn}=rr(),{validateAbortSignal:Co,validateInteger:tq,validateObject:Ao}=la(),Bre=ft().Symbol("kWeak"),Wre=ft().Symbol("kResistStopPropagation"),{finished:Hre}=Gn(),Vre=U0(),{addAbortSignalNoValidate:Zre}=Lu(),{isWritable:Gre,isNodeStream:Kre}=hn(),{deprecate:Xre}=pr(),{ArrayPrototypePush:Jre,Boolean:Yre,MathFloor:rq,Number:Qre,NumberIsNaN:ene,Promise:nq,PromiseReject:iq,PromiseResolve:tne,PromisePrototypeThen:oq,Symbol:aq}=ft(),ih=aq("kEmpty"),sq=aq("kEof");function rne(e,t){if(t!=null&&Ao(t,"options"),t?.signal!=null&&Co(t.signal,"options.signal"),Kre(e)&&!Gre(e))throw new Fre("stream",e,"must be writable");let r=Vre(this,e);return t!=null&&t.signal&&Zre(t.signal,r),r}function oh(e,t){if(typeof e!="function")throw new Ku("fn",["Function","AsyncFunction"],e);t!=null&&Ao(t,"options"),t?.signal!=null&&Co(t.signal,"options.signal");let r=1;t?.concurrency!=null&&(r=rq(t.concurrency));let i=r-1;return t?.highWaterMark!=null&&(i=rq(t.highWaterMark)),tq(r,"options.concurrency",1),tq(i,"options.highWaterMark",0),i+=r,async function*(){let o=pr().AbortSignalAny([t?.signal].filter(Yre)),s=this,a=[],c={signal:o},u,l,f=!1,p=0;function d(){f=!0,h()}function h(){p-=1,m()}function m(){l&&!f&&p<r&&a.length<i&&(l(),l=null)}async function _(){try{for await(let k of s){if(f)return;if(o.aborted)throw new vn;try{if(k=e(k,c),k===ih)continue;k=tne(k)}catch(S){k=iq(S)}p+=1,oq(k,h,d),a.push(k),u&&(u(),u=null),!f&&(a.length>=i||p>=r)&&await new nq(S=>{l=S})}a.push(sq)}catch(k){let S=iq(k);oq(S,h,d),a.push(S)}finally{f=!0,u&&(u(),u=null)}}_();try{for(;;){for(;a.length>0;){let k=await a[0];if(k===sq)return;if(o.aborted)throw new vn;k!==ih&&(yield k),a.shift(),m()}await new nq(k=>{u=k})}}finally{f=!0,l&&(l(),l=null)}}.call(this)}function nne(e=void 0){return e!=null&&Ao(e,"options"),e?.signal!=null&&Co(e.signal,"options.signal"),async function*(){let r=0;for await(let n of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new vn({cause:e.signal.reason});yield[r++,n]}}.call(this)}async function cq(e,t=void 0){for await(let r of W0.call(this,e,t))return!0;return!1}async function ine(e,t=void 0){if(typeof e!="function")throw new Ku("fn",["Function","AsyncFunction"],e);return!await cq.call(this,async(...r)=>!await e(...r),t)}async function one(e,t){for await(let r of W0.call(this,e,t))return r}async function sne(e,t){if(typeof e!="function")throw new Ku("fn",["Function","AsyncFunction"],e);async function r(i,n){return await e(i,n),ih}for await(let i of oh.call(this,r,t));}function W0(e,t){if(typeof e!="function")throw new Ku("fn",["Function","AsyncFunction"],e);async function r(i,n){return await e(i,n)?i:ih}return oh.call(this,r,t)}var B0=class extends zre{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function ane(e,t,r){var i;if(typeof e!="function")throw new Ku("reducer",["Function","AsyncFunction"],e);r!=null&&Ao(r,"options"),r?.signal!=null&&Co(r.signal,"options.signal");let n=arguments.length>1;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted){let u=new vn(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await Hre(this.destroy(u)),u}let o=new Lre,s=o.signal;if(r!=null&&r.signal){let u={once:!0,[Bre]:this,[Wre]:!0};r.signal.addEventListener("abort",()=>o.abort(),u)}let a=!1;try{for await(let u of this){var c;if(a=!0,r!=null&&(c=r.signal)!==null&&c!==void 0&&c.aborted)throw new vn;n?t=await e(t,u,{signal:s}):(t=u,n=!0)}if(!a&&!n)throw new B0}finally{o.abort()}return t}async function cne(e){e!=null&&Ao(e,"options"),e?.signal!=null&&Co(e.signal,"options.signal");let t=[];for await(let i of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new vn(void 0,{cause:e.signal.reason});Jre(t,i)}return t}function une(e,t){let r=oh.call(this,e,t);return async function*(){for await(let n of r)yield*n}.call(this)}function uq(e){if(e=Qre(e),ene(e))return 0;if(e<0)throw new Ure("number",">= 0",e);return e}function lne(e,t=void 0){return t!=null&&Ao(t,"options"),t?.signal!=null&&Co(t.signal,"options.signal"),e=uq(e),async function*(){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new vn;for await(let o of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new vn;e--<=0&&(yield o)}}.call(this)}function fne(e,t=void 0){return t!=null&&Ao(t,"options"),t?.signal!=null&&Co(t.signal,"options.signal"),e=uq(e),async function*(){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new vn;for await(let o of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new vn;if(e-- >0&&(yield o),e<=0)return}}.call(this)}H0.exports.streamReturningOperators={asIndexedPairs:Xre(nne,"readable.asIndexedPairs will be removed in a future version."),drop:lne,filter:W0,flatMap:une,map:oh,take:fne,compose:rne};H0.exports.promiseReturningOperators={every:ine,forEach:sne,reduce:ane,toArray:cne,some:cq,find:one}});var V0=w((LEe,fq)=>{"use strict";var{ArrayPrototypePop:dne,Promise:pne}=ft(),{isIterable:hne,isNodeStream:mne,isWebStream:gne}=hn(),{pipelineImpl:yne}=th(),{finished:vne}=Gn();Z0();function bne(...e){return new pne((t,r)=>{let i,n,o=e[e.length-1];if(o&&typeof o=="object"&&!mne(o)&&!hne(o)&&!gne(o)){let s=dne(e);i=s.signal,n=s.end}yne(e,(s,a)=>{s?r(s):t(a)},{signal:i,end:n})})}fq.exports={finished:vne,pipeline:bne}});var Z0=w((FEe,_q)=>{"use strict";var{Buffer:_ne}=B("buffer"),{ObjectDefineProperty:Jn,ObjectKeys:hq,ReflectApply:mq}=ft(),{promisify:{custom:gq}}=pr(),{streamReturningOperators:dq,promiseReturningOperators:pq}=lq(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:yq}}=rr(),wne=U0(),{setDefaultHighWaterMark:xne,getDefaultHighWaterMark:Sne}=Fu(),{pipeline:vq}=th(),{destroyer:Ene}=So(),bq=Gn(),G0=V0(),Xu=hn(),lt=_q.exports=Mp().Stream;lt.isDestroyed=Xu.isDestroyed;lt.isDisturbed=Xu.isDisturbed;lt.isErrored=Xu.isErrored;lt.isReadable=Xu.isReadable;lt.isWritable=Xu.isWritable;lt.Readable=Bu();for(let e of hq(dq)){let r=function(...i){if(new.target)throw yq();return lt.Readable.from(mq(t,this,i))},t=dq[e];Jn(r,"name",{__proto__:null,value:t.name}),Jn(r,"length",{__proto__:null,value:t.length}),Jn(lt.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let e of hq(pq)){let r=function(...i){if(new.target)throw yq();return mq(t,this,i)},t=pq[e];Jn(r,"name",{__proto__:null,value:t.name}),Jn(r,"length",{__proto__:null,value:t.length}),Jn(lt.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}lt.Writable=Jp();lt.Duplex=yn();lt.Transform=C0();lt.PassThrough=$0();lt.pipeline=vq;var{addAbortSignal:kne}=Lu();lt.addAbortSignal=kne;lt.finished=bq;lt.destroy=Ene;lt.compose=wne;lt.setDefaultHighWaterMark=xne;lt.getDefaultHighWaterMark=Sne;Jn(lt,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return G0}});Jn(vq,gq,{__proto__:null,enumerable:!0,get(){return G0.pipeline}});Jn(bq,gq,{__proto__:null,enumerable:!0,get(){return G0.finished}});lt.Stream=lt;lt._isUint8Array=function(t){return t instanceof Uint8Array};lt._uint8ArrayToBuffer=function(t){return _ne.from(t.buffer,t.byteOffset,t.byteLength)}});var wq=w((zEe,Re)=>{"use strict";var Rt=B("stream");if(Rt&&process.env.READABLE_STREAM==="disable"){let e=Rt.promises;Re.exports._uint8ArrayToBuffer=Rt._uint8ArrayToBuffer,Re.exports._isUint8Array=Rt._isUint8Array,Re.exports.isDisturbed=Rt.isDisturbed,Re.exports.isErrored=Rt.isErrored,Re.exports.isReadable=Rt.isReadable,Re.exports.Readable=Rt.Readable,Re.exports.Writable=Rt.Writable,Re.exports.Duplex=Rt.Duplex,Re.exports.Transform=Rt.Transform,Re.exports.PassThrough=Rt.PassThrough,Re.exports.addAbortSignal=Rt.addAbortSignal,Re.exports.finished=Rt.finished,Re.exports.destroy=Rt.destroy,Re.exports.pipeline=Rt.pipeline,Re.exports.compose=Rt.compose,Object.defineProperty(Rt,"promises",{configurable:!0,enumerable:!0,get(){return e}}),Re.exports.Stream=Rt.Stream}else{let e=Z0(),t=V0(),r=e.Readable.destroy;Re.exports=e.Readable,Re.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,Re.exports._isUint8Array=e._isUint8Array,Re.exports.isDisturbed=e.isDisturbed,Re.exports.isErrored=e.isErrored,Re.exports.isReadable=e.isReadable,Re.exports.Readable=e.Readable,Re.exports.Writable=e.Writable,Re.exports.Duplex=e.Duplex,Re.exports.Transform=e.Transform,Re.exports.PassThrough=e.PassThrough,Re.exports.addAbortSignal=e.addAbortSignal,Re.exports.finished=e.finished,Re.exports.destroy=e.destroy,Re.exports.destroy=r,Re.exports.pipeline=e.pipeline,Re.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),Re.exports.Stream=e.Stream}Re.exports.default=Re.exports});var kq=w((UEe,Eq)=>{var Tne=pD(),sh=B("stream");(!sh.Writable||!sh.Writable.prototype.destroy)&&(sh=wq());var ah;function Ine(){let t,r,i;for(ah=[],r=0;r<256;r++){for(t=r,i=0;i<8;i++)t=t&1?3988292384^t>>>1:t=t>>>1;ah[r]=t>>>0}}function xq(e,t){ah||Ine(),e.charCodeAt&&(e=e.charCodeAt(0));let r=t.readUInt32BE()>>8&16777215,i=ah[(t.readUInt32BE()^e>>>0)&255];return(r^i)>>>0}function Sq(e,t){let r=e>>16&65535,i=e&65535,n=t>>16&65535,o=t&65535;return((r*o+i*n&65535)<<16>>>0)+i*o}function wa(){if(!(this instanceof wa))return new wa;this.key0=Buffer.allocUnsafe(4),this.key1=Buffer.allocUnsafe(4),this.key2=Buffer.allocUnsafe(4),this.key0.writeUInt32BE(305419896,0),this.key1.writeUInt32BE(591751049,0),this.key2.writeUInt32BE(878082192,0)}wa.prototype.update=function(e){this.key0.writeUInt32BE(xq(e,this.key0)),this.key1.writeUInt32BE((this.key0.readUInt32BE()&255&4294967295)+this.key1.readUInt32BE()>>>0);let t=new Tne(Sq(this.key1.readUInt32BE(),134775813)+1&4294967295),r=Buffer.alloc(8);t.copy(r,0),r.copy(this.key1,0,4,8),this.key2.writeUInt32BE(xq((this.key1.readUInt32BE()>>24&255)>>>0,this.key2))};wa.prototype.decryptByte=function(e){let t=(this.key2.readUInt32BE()|2)>>>0;return e=e^Sq(t,t^1)>>8&255,this.update(e),e};wa.prototype.stream=function(){let e=sh.Transform(),t=this;return e._transform=function(r,i,n){for(let o=0;o<r.length;o++)r[o]=t.decryptByte(r[o]);this.push(r),n()},e};Eq.exports=wa});var Oq=w((BEe,Iq)=>{var One=kq(),Cne=ep(),Tq=B("stream"),Ane=B("zlib"),$ne=rp(),Rne=np(),Dne=mu();Iq.exports=function(t,r,i,n,o){let s=Cne(),a=Tq.PassThrough(),c=t.stream(r,o);return c.pipe(s).on("error",function(u){a.emit("error",u)}),a.vars=s.pull(30).then(function(u){let l=Dne.parse(u,[["signature",4],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2]]);return l.lastModifiedDateTime=Rne(l.lastModifiedDate,l.lastModifiedTime),s.pull(l.fileNameLength).then(function(f){return l.fileName=f.toString("utf8"),s.pull(l.extraFieldLength)}).then(function(f){let p;return l.extra=$ne(f,l),n&&n.compressedSize&&(l=n),l.flags&1&&(p=s.pull(12).then(function(d){if(!i)throw new Error("MISSING_PASSWORD");let h=One();String(i).split("").forEach(function(_){h.update(_)});for(let _=0;_<d.length;_++)d[_]=h.decryptByte(d[_]);l.decrypt=h,l.compressedSize-=12;let m=l.flags&8?l.lastModifiedTime>>8&255:l.crc32>>24&255;if(d[11]!==m)throw new Error("BAD_PASSWORD");return l})),Promise.resolve(p).then(function(){return a.emit("vars",l),l})})}),a.vars.then(function(u){let l=!(u.flags&8)||u.compressedSize>0,f,p=u.compressionMethod?Ane.createInflateRaw():Tq.PassThrough();l?(a.size=u.uncompressedSize,f=u.compressedSize):(f=Buffer.alloc(4),f.writeUInt32LE(134695760,0));let d=s.stream(f);u.decrypt&&(d=d.pipe(u.decrypt.stream())),d.pipe(p).on("error",function(h){a.emit("error",h)}).pipe(a).on("finish",function(){c.destroy?c.destroy():c.abort?c.abort():c.close?c.close():c.push?c.push():console.log("warning - unable to close stream")})}).catch(function(u){a.emit("error",u)}),a}});var Mi=w((WEe,J0)=>{var K0=(function(){"use strict";return this===void 0})();K0?J0.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:K0,propertyIsWritable:function(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return!!(!r||r.writable||r.set)}}:(Cq={}.hasOwnProperty,Aq={}.toString,$q={}.constructor.prototype,X0=function(e){var t=[];for(var r in e)Cq.call(e,r)&&t.push(r);return t},Rq=function(e,t){return{value:e[t]}},Dq=function(e,t,r){return e[t]=r.value,e},Nq=function(e){return e},Pq=function(e){try{return Object(e).constructor.prototype}catch{return $q}},qq=function(e){try{return Aq.call(e)==="[object Array]"}catch{return!1}},J0.exports={isArray:qq,keys:X0,names:X0,defineProperty:Dq,getDescriptor:Rq,freeze:Nq,getPrototypeOf:Pq,isES5:K0,propertyIsWritable:function(){return!0}});var Cq,Aq,$q,X0,Rq,Dq,Nq,Pq,qq});var it=w((exports,module)=>{"use strict";var es5=Mi(),canEvaluate=typeof navigator>"u",errorObj={e:{}},tryCatchTarget,globalObject=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:exports!==void 0?exports:null;function tryCatcher(){try{var e=tryCatchTarget;return tryCatchTarget=null,e.apply(this,arguments)}catch(t){return errorObj.e=t,errorObj}}function tryCatch(e){return tryCatchTarget=e,tryCatcher}var inherits=function(e,t){var r={}.hasOwnProperty;function i(){this.constructor=e,this.constructor$=t;for(var n in t.prototype)r.call(t.prototype,n)&&n.charAt(n.length-1)!=="$"&&(this[n+"$"]=t.prototype[n])}return i.prototype=t.prototype,e.prototype=new i,e.prototype};function isPrimitive(e){return e==null||e===!0||e===!1||typeof e=="string"||typeof e=="number"}function isObject(e){return typeof e=="function"||typeof e=="object"&&e!==null}function maybeWrapAsError(e){return isPrimitive(e)?new Error(safeToString(e)):e}function withAppended(e,t){var r=e.length,i=new Array(r+1),n;for(n=0;n<r;++n)i[n]=e[n];return i[n]=t,i}function getDataPropertyOrDefault(e,t,r){if(es5.isES5){var i=Object.getOwnPropertyDescriptor(e,t);if(i!=null)return i.get==null&&i.set==null?i.value:r}else return{}.hasOwnProperty.call(e,t)?e[t]:void 0}function notEnumerableProp(e,t,r){if(isPrimitive(e))return e;var i={value:r,configurable:!0,enumerable:!1,writable:!0};return es5.defineProperty(e,t,i),e}function thrower(e){throw e}var inheritedDataKeys=(function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(n){for(var o=0;o<e.length;++o)if(e[o]===n)return!0;return!1};if(es5.isES5){var r=Object.getOwnPropertyNames;return function(n){for(var o=[],s=Object.create(null);n!=null&&!t(n);){var a;try{a=r(n)}catch{return o}for(var c=0;c<a.length;++c){var u=a[c];if(!s[u]){s[u]=!0;var l=Object.getOwnPropertyDescriptor(n,u);l!=null&&l.get==null&&l.set==null&&o.push(u)}}n=es5.getPrototypeOf(n)}return o}}else{var i={}.hasOwnProperty;return function(n){if(t(n))return[];var o=[];e:for(var s in n)if(i.call(n,s))o.push(s);else{for(var a=0;a<e.length;++a)if(i.call(e[a],s))continue e;o.push(s)}return o}}})(),thisAssignmentPattern=/this\s*\.\s*\S+\s*=/;function isClass(e){try{if(typeof e=="function"){var t=es5.names(e.prototype),r=es5.isES5&&t.length>1,i=t.length>0&&!(t.length===1&&t[0]==="constructor"),n=thisAssignmentPattern.test(e+"")&&es5.names(e).length>0;if(r||i||n)return!0}return!1}catch{return!1}}function toFastProperties(obj){function FakeConstructor(){}FakeConstructor.prototype=obj;var receiver=new FakeConstructor;function ic(){return typeof receiver.foo}return ic(),ic(),obj;eval(obj)}var rident=/^[a-z$_][a-z$_0-9]*$/i;function isIdentifier(e){return rident.test(e)}function filledRange(e,t,r){for(var i=new Array(e),n=0;n<e;++n)i[n]=t+n+r;return i}function safeToString(e){try{return e+""}catch{return"[no string representation]"}}function isError(e){return e instanceof Error||e!==null&&typeof e=="object"&&typeof e.message=="string"&&typeof e.name=="string"}function markAsOriginatingFromRejection(e){try{notEnumerableProp(e,"isOperational",!0)}catch{}}function originatesFromRejection(e){return e==null?!1:e instanceof Error.__BluebirdErrorTypes__.OperationalError||e.isOperational===!0}function canAttachTrace(e){return isError(e)&&es5.propertyIsWritable(e,"stack")}var ensureErrorObject=(function(){return"stack"in new Error?function(e){return canAttachTrace(e)?e:new Error(safeToString(e))}:function(e){if(canAttachTrace(e))return e;try{throw new Error(safeToString(e))}catch(t){return t}}})();function classString(e){return{}.toString.call(e)}function copyDescriptors(e,t,r){for(var i=es5.names(e),n=0;n<i.length;++n){var o=i[n];if(r(o))try{es5.defineProperty(t,o,es5.getDescriptor(e,o))}catch{}}}var asArray=function(e){return es5.isArray(e)?e:null};typeof Symbol<"u"&&Symbol.iterator&&(ArrayFrom=typeof Array.from=="function"?function(e){return Array.from(e)}:function(e){for(var t=[],r=e[Symbol.iterator](),i;!(i=r.next()).done;)t.push(i.value);return t},asArray=function(e){return es5.isArray(e)?e:e!=null&&typeof e[Symbol.iterator]=="function"?ArrayFrom(e):null});var ArrayFrom,isNode=typeof process<"u"&&classString(process).toLowerCase()==="[object process]",hasEnvVariables=typeof process<"u"&&typeof process.env<"u";function env(e){return hasEnvVariables?process.env[e]:void 0}function getNativePromise(){if(typeof Promise=="function")try{var e=new Promise(function(){});if(classString(e)==="[object Promise]")return Promise}catch{}}var reflectHandler;function contextBind(e,t){if(e===null||typeof t!="function"||t===reflectHandler)return t;e.domain!==null&&(t=e.domain.bind(t));var r=e.async;if(r!==null){var i=t;t=function(){for(var n=arguments.length+2,o=new Array(n),s=2;s<n;++s)o[s]=arguments[s-2];return o[0]=i,o[1]=this,r.runInAsyncScope.apply(r,o)}}return t}var ret={setReflectHandler:function(e){reflectHandler=e},isClass,isIdentifier,inheritedDataKeys,getDataPropertyOrDefault,thrower,isArray:es5.isArray,asArray,notEnumerableProp,isPrimitive,isObject,isError,canEvaluate,errorObj,tryCatch,inherits,withAppended,maybeWrapAsError,toFastProperties,filledRange,toString:safeToString,canAttachTrace,ensureErrorObject,originatesFromRejection,markAsOriginatingFromRejection,classString,copyDescriptors,isNode,hasEnvVariables,env,global:globalObject,getNativePromise,contextBind};ret.isRecentNode=ret.isNode&&(function(){var e;return process.versions&&process.versions.node?e=process.versions.node.split(".").map(Number):process.version&&(e=process.version.split(".").map(Number)),e[0]===0&&e[1]>10||e[0]>0})();ret.nodeSupportsAsyncResource=ret.isNode&&(function(){var e=!1;try{var t=B("async_hooks").AsyncResource;e=typeof t.prototype.runInAsyncScope=="function"}catch{e=!1}return e})();ret.isNode&&ret.toFastProperties(process);try{throw new Error}catch(e){ret.lastLineError=e}module.exports=ret});var zq=w((HEe,Fq)=>{"use strict";var Q0=it(),$o,Nne=function(){throw new Error(`No async scheduler available
|
|
7
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:i,destStat:n}=Au.checkPathsSync(e,t,"copy",r);if(Au.checkParentPathsSync(e,i,t,"copy"),r.filter&&!r.filter(e,t))return;let o=Cu.dirname(t);return fr.existsSync(o)||CJ(o),Z1(n,e,t,r)}function Z1(e,t,r,i){let o=(i.dereference?fr.statSync:fr.lstatSync)(t);if(o.isDirectory())return MJ(o,e,t,r,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return RJ(o,e,t,r,i);if(o.isSymbolicLink())return zJ(e,t,r,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${t}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}function RJ(e,t,r,i,n){return t?DJ(e,r,i,n):G1(e,r,i,n)}function DJ(e,t,r,i){if(i.overwrite)return fr.unlinkSync(r),G1(e,t,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}function G1(e,t,r,i){return fr.copyFileSync(t,r),i.preserveTimestamps&&NJ(e.mode,t,r),IS(r,e.mode)}function NJ(e,t,r){return PJ(e)&&qJ(r,e),jJ(t,r)}function PJ(e){return(e&128)===0}function qJ(e,t){return IS(e,t|128)}function IS(e,t){return fr.chmodSync(e,t)}function jJ(e,t){let r=fr.statSync(e);return AJ(t,r.atime,r.mtime)}function MJ(e,t,r,i,n){return t?K1(r,i,n):LJ(e.mode,r,i,n)}function LJ(e,t,r,i){return fr.mkdirSync(r),K1(t,r,i),IS(r,e)}function K1(e,t,r){let i=fr.opendirSync(e);try{let n;for(;(n=i.readSync())!==null;)FJ(n.name,e,t,r)}finally{i.closeSync()}}function FJ(e,t,r,i){let n=Cu.join(t,e),o=Cu.join(r,e);if(i.filter&&!i.filter(n,o))return;let{destStat:s}=Au.checkPathsSync(n,o,"copy",i);return Z1(s,n,o,i)}function zJ(e,t,r,i){let n=fr.readlinkSync(t);if(i.dereference&&(n=Cu.resolve(process.cwd(),n)),e){let o;try{o=fr.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return fr.symlinkSync(n,r);throw s}if(i.dereference&&(o=Cu.resolve(process.cwd(),o)),n!==o){if(Au.isSrcSubdir(n,o))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${o}'.`);if(Au.isSrcSubdir(o,n))throw new Error(`Cannot overwrite '${o}' with '${n}'.`)}return UJ(n,r)}else return fr.symlinkSync(n,r)}function UJ(e,t){return fr.unlinkSync(t),fr.symlinkSync(e,t)}X1.exports=$J});var wp=w((Z0e,Y1)=>{"use strict";var BJ=Mt().fromPromise;Y1.exports={copy:BJ(V1()),copySync:J1()}});var $u=w((G0e,eR)=>{"use strict";var Q1=Ii(),WJ=Mt().fromCallback;function HJ(e,t){Q1.rm(e,{recursive:!0,force:!0},t)}function VJ(e){Q1.rmSync(e,{recursive:!0,force:!0})}eR.exports={remove:WJ(HJ),removeSync:VJ}});var cR=w((K0e,aR)=>{"use strict";var ZJ=Mt().fromPromise,nR=lr(),iR=B("path"),oR=Xr(),sR=$u(),tR=ZJ(async function(t){let r;try{r=await nR.readdir(t)}catch{return oR.mkdirs(t)}return Promise.all(r.map(i=>sR.remove(iR.join(t,i))))});function rR(e){let t;try{t=nR.readdirSync(e)}catch{return oR.mkdirsSync(e)}t.forEach(r=>{r=iR.join(e,r),sR.removeSync(r)})}aR.exports={emptyDirSync:rR,emptydirSync:rR,emptyDir:tR,emptydir:tR}});var dR=w((X0e,fR)=>{"use strict";var GJ=Mt().fromPromise,uR=B("path"),Zn=lr(),lR=Xr();async function KJ(e){let t;try{t=await Zn.stat(e)}catch{}if(t&&t.isFile())return;let r=uR.dirname(e),i=null;try{i=await Zn.stat(r)}catch(n){if(n.code==="ENOENT"){await lR.mkdirs(r),await Zn.writeFile(e,"");return}else throw n}i.isDirectory()?await Zn.writeFile(e,""):await Zn.readdir(r)}function XJ(e){let t;try{t=Zn.statSync(e)}catch{}if(t&&t.isFile())return;let r=uR.dirname(e);try{Zn.statSync(r).isDirectory()||Zn.readdirSync(r)}catch(i){if(i&&i.code==="ENOENT")lR.mkdirsSync(r);else throw i}Zn.writeFileSync(e,"")}fR.exports={createFile:GJ(KJ),createFileSync:XJ}});var yR=w((J0e,gR)=>{"use strict";var JJ=Mt().fromPromise,pR=B("path"),Ci=lr(),hR=Xr(),{pathExists:YJ}=Oi(),{areIdentical:mR}=bo();async function QJ(e,t){let r;try{r=await Ci.lstat(t,{bigint:!0})}catch{}let i;try{i=await Ci.lstat(e,{bigint:!0})}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}if(r&&mR(i,r))return;let n=pR.dirname(t);await YJ(n)||await hR.mkdirs(n),await Ci.link(e,t)}function e7(e,t){let r;try{r=Ci.lstatSync(t,{bigint:!0})}catch{}try{let o=Ci.lstatSync(e,{bigint:!0});if(r&&mR(o,r))return}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let i=pR.dirname(t);return Ci.existsSync(i)||hR.mkdirsSync(i),Ci.linkSync(e,t)}gR.exports={createLink:JJ(QJ),createLinkSync:e7}});var bR=w((Y0e,vR)=>{"use strict";var Ai=B("path"),Ru=lr(),{pathExists:t7}=Oi(),r7=Mt().fromPromise;async function n7(e,t){if(Ai.isAbsolute(e)){try{await Ru.lstat(e)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:e,toDst:e}}let r=Ai.dirname(t),i=Ai.join(r,e);if(await t7(i))return{toCwd:i,toDst:e};try{await Ru.lstat(e)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:e,toDst:Ai.relative(r,e)}}function i7(e,t){if(Ai.isAbsolute(e)){if(!Ru.existsSync(e))throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}let r=Ai.dirname(t),i=Ai.join(r,e);if(Ru.existsSync(i))return{toCwd:i,toDst:e};if(!Ru.existsSync(e))throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Ai.relative(r,e)}}vR.exports={symlinkPaths:r7(n7),symlinkPathsSync:i7}});var xR=w((Q0e,wR)=>{"use strict";var _R=lr(),o7=Mt().fromPromise;async function s7(e,t){if(t)return t;let r;try{r=await _R.lstat(e)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}function a7(e,t){if(t)return t;let r;try{r=_R.lstatSync(e)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}wR.exports={symlinkType:o7(s7),symlinkTypeSync:a7}});var kR=w((eEe,ER)=>{"use strict";var c7=Mt().fromPromise,$i=B("path"),_r=lr(),{mkdirs:u7,mkdirsSync:l7}=Xr(),{symlinkPaths:f7,symlinkPathsSync:d7}=bR(),{symlinkType:p7,symlinkTypeSync:h7}=xR(),{pathExists:m7}=Oi(),{areIdentical:SR}=bo();async function g7(e,t,r){let i;try{i=await _r.lstat(t)}catch{}if(i&&i.isSymbolicLink()){let a;if($i.isAbsolute(e))a=await _r.stat(e,{bigint:!0});else{let u=$i.dirname(t),l=$i.join(u,e);try{a=await _r.stat(l,{bigint:!0})}catch{a=await _r.stat(e,{bigint:!0})}}let c;try{c=await _r.stat(t,{bigint:!0})}catch(u){if(u.code!=="ENOENT")throw u}if(c&&SR(a,c))return}let n=await f7(e,t);e=n.toDst;let o=await p7(n.toCwd,r),s=$i.dirname(t);return await m7(s)||await u7(s),_r.symlink(e,t,o)}function y7(e,t,r){let i;try{i=_r.lstatSync(t)}catch{}if(i&&i.isSymbolicLink()){let a;if($i.isAbsolute(e))a=_r.statSync(e,{bigint:!0});else{let u=$i.dirname(t),l=$i.join(u,e);try{a=_r.statSync(l,{bigint:!0})}catch{a=_r.statSync(e,{bigint:!0})}}let c;try{c=_r.statSync(t,{bigint:!0})}catch(u){if(u.code!=="ENOENT")throw u}if(c&&SR(a,c))return}let n=d7(e,t);e=n.toDst,r=h7(n.toCwd,r);let o=$i.dirname(t);return _r.existsSync(o)||l7(o),_r.symlinkSync(e,t,r)}ER.exports={createSymlink:c7(g7),createSymlinkSync:y7}});var DR=w((tEe,RR)=>{"use strict";var{createFile:TR,createFileSync:IR}=dR(),{createLink:OR,createLinkSync:CR}=yR(),{createSymlink:AR,createSymlinkSync:$R}=kR();RR.exports={createFile:TR,createFileSync:IR,ensureFile:TR,ensureFileSync:IR,createLink:OR,createLinkSync:CR,ensureLink:OR,ensureLinkSync:CR,createSymlink:AR,createSymlinkSync:$R,ensureSymlink:AR,ensureSymlinkSync:$R}});var xp=w((rEe,NR)=>{function v7(e,{EOL:t=`
|
|
8
|
+
`,finalEOL:r=!0,replacer:i=null,spaces:n}={}){let o=r?t:"",s=JSON.stringify(e,i,n);if(s===void 0)throw new TypeError(`Converting ${typeof e} value to JSON is not supported`);return s.replace(/\n/g,t)+o}function b7(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}NR.exports={stringify:v7,stripBom:b7}});var MR=w((nEe,jR)=>{var oa;try{oa=Ii()}catch{oa=B("fs")}var Sp=Mt(),{stringify:PR,stripBom:qR}=xp();async function _7(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||oa,i="throws"in t?t.throws:!0,n=await Sp.fromCallback(r.readFile)(e,t);n=qR(n);let o;try{o=JSON.parse(n,t?t.reviver:null)}catch(s){if(i)throw s.message=`${e}: ${s.message}`,s;return null}return o}var w7=Sp.fromPromise(_7);function x7(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||oa,i="throws"in t?t.throws:!0;try{let n=r.readFileSync(e,t);return n=qR(n),JSON.parse(n,t.reviver)}catch(n){if(i)throw n.message=`${e}: ${n.message}`,n;return null}}async function S7(e,t,r={}){let i=r.fs||oa,n=PR(t,r);await Sp.fromCallback(i.writeFile)(e,n,r)}var E7=Sp.fromPromise(S7);function k7(e,t,r={}){let i=r.fs||oa,n=PR(t,r);return i.writeFileSync(e,n,r)}jR.exports={readFile:w7,readFileSync:x7,writeFile:E7,writeFileSync:k7}});var FR=w((iEe,LR)=>{"use strict";var Ep=MR();LR.exports={readJson:Ep.readFile,readJsonSync:Ep.readFileSync,writeJson:Ep.writeFile,writeJsonSync:Ep.writeFileSync}});var kp=w((oEe,BR)=>{"use strict";var T7=Mt().fromPromise,OS=lr(),zR=B("path"),UR=Xr(),I7=Oi().pathExists;async function O7(e,t,r="utf-8"){let i=zR.dirname(e);return await I7(i)||await UR.mkdirs(i),OS.writeFile(e,t,r)}function C7(e,...t){let r=zR.dirname(e);OS.existsSync(r)||UR.mkdirsSync(r),OS.writeFileSync(e,...t)}BR.exports={outputFile:T7(O7),outputFileSync:C7}});var HR=w((sEe,WR)=>{"use strict";var{stringify:A7}=xp(),{outputFile:$7}=kp();async function R7(e,t,r={}){let i=A7(t,r);await $7(e,i,r)}WR.exports=R7});var ZR=w((aEe,VR)=>{"use strict";var{stringify:D7}=xp(),{outputFileSync:N7}=kp();function P7(e,t,r){let i=D7(t,r);N7(e,i,r)}VR.exports=P7});var KR=w((cEe,GR)=>{"use strict";var q7=Mt().fromPromise,dr=FR();dr.outputJson=q7(HR());dr.outputJsonSync=ZR();dr.outputJSON=dr.outputJson;dr.outputJSONSync=dr.outputJsonSync;dr.writeJSON=dr.writeJson;dr.writeJSONSync=dr.writeJsonSync;dr.readJSON=dr.readJson;dr.readJSONSync=dr.readJsonSync;GR.exports=dr});var eD=w((uEe,QR)=>{"use strict";var j7=lr(),XR=B("path"),{copy:M7}=wp(),{remove:YR}=$u(),{mkdirp:L7}=Xr(),{pathExists:F7}=Oi(),JR=bo();async function z7(e,t,r={}){let i=r.overwrite||r.clobber||!1,{srcStat:n,isChangingCase:o=!1}=await JR.checkPaths(e,t,"move",r);await JR.checkParentPaths(e,n,t,"move");let s=XR.dirname(t);return XR.parse(s).root!==s&&await L7(s),U7(e,t,i,o)}async function U7(e,t,r,i){if(!i){if(r)await YR(t);else if(await F7(t))throw new Error("dest already exists.")}try{await j7.rename(e,t)}catch(n){if(n.code!=="EXDEV")throw n;await B7(e,t,r)}}async function B7(e,t,r){return await M7(e,t,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),YR(e)}QR.exports=z7});var oD=w((lEe,iD)=>{"use strict";var rD=Ii(),AS=B("path"),W7=wp().copySync,nD=$u().removeSync,H7=Xr().mkdirpSync,tD=bo();function V7(e,t,r){r=r||{};let i=r.overwrite||r.clobber||!1,{srcStat:n,isChangingCase:o=!1}=tD.checkPathsSync(e,t,"move",r);return tD.checkParentPathsSync(e,n,t,"move"),Z7(t)||H7(AS.dirname(t)),G7(e,t,i,o)}function Z7(e){let t=AS.dirname(e);return AS.parse(t).root===t}function G7(e,t,r,i){if(i)return CS(e,t,r);if(r)return nD(t),CS(e,t,r);if(rD.existsSync(t))throw new Error("dest already exists.");return CS(e,t,r)}function CS(e,t,r){try{rD.renameSync(e,t)}catch(i){if(i.code!=="EXDEV")throw i;return K7(e,t,r)}}function K7(e,t,r){return W7(e,t,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),nD(e)}iD.exports=V7});var aD=w((fEe,sD)=>{"use strict";var X7=Mt().fromPromise;sD.exports={move:X7(eD()),moveSync:oD()}});var $S=w((dEe,cD)=>{"use strict";cD.exports={...lr(),...wp(),...cR(),...DR(),...KR(),...Xr(),...aD(),...kp(),...Oi(),...$u()}});var lD=w((pEe,uD)=>{uD.exports=eY;var J7=ip(),RS=$S(),Tp=B("path"),Y7=B("stream"),Q7=pS();function eY(e){e.path=Tp.resolve(Tp.normalize(e.path));let t=new J7(e),r=new Y7.Writable({objectMode:!0});r._write=async function(n,o,s){let a=Tp.join(e.path,n.path.replace(/\\/g,"/"));if(a.indexOf(e.path)!=0)return s();if(n.type=="Directory")return await RS.ensureDir(a),s();await RS.ensureDir(Tp.dirname(a));let c=e.getWriter?e.getWriter({path:a}):RS.createWriteStream(a);n.pipe(c).on("error",s).on("close",s)};let i=Q7(t,r);return t.once("crx-header",function(n){i.crxHeader=n}),t.pipe(r).on("finish",function(){i.emit("close")}),i.promise=function(){return new Promise(function(n,o){i.on("close",n),i.on("error",o)})},i}});var pD=w((hEe,dD)=>{var DS=4294967296,fD=[];for(sa=0;sa<256;sa++)fD[sa]=(sa>15?"":"0")+sa.toString(16);var sa,Du=dD.exports=function(e,t){e instanceof Buffer?(this.buffer=e,this.offset=t||0):Object.prototype.toString.call(e)=="[object Uint8Array]"?(this.buffer=new Buffer(e),this.offset=t||0):(this.buffer=this.buffer||new Buffer(8),this.offset=0,this.setValue.apply(this,arguments))};Du.MAX_INT=Math.pow(2,53);Du.MIN_INT=-Math.pow(2,53);Du.prototype={constructor:Du,_2scomp:function(){for(var e=this.buffer,t=this.offset,r=1,i=t+7;i>=t;i--){var n=(e[i]^255)+r;e[i]=n&255,r=n>>8}},setValue:function(e,t){var r=!1;if(arguments.length==1)if(typeof e=="number"){if(r=e<0,e=Math.abs(e),t=e%DS,e=e/DS,e>DS)throw new RangeError(e+" is outside Int64 range");e=e|0}else if(typeof e=="string")e=(e+"").replace(/^0x/,""),t=e.substr(-8),e=e.length>8?e.substr(0,e.length-8):"",e=parseInt(e,16),t=parseInt(t,16);else throw new Error(e+" must be a Number or String");for(var i=this.buffer,n=this.offset,o=7;o>=0;o--)i[n+o]=t&255,t=o==4?e:t>>>8;r&&this._2scomp()},toNumber:function(e){for(var t=this.buffer,r=this.offset,i=t[r]&128,n=0,o=1,s=7,a=1;s>=0;s--,a*=256){var c=t[r+s];i&&(c=(c^255)+o,o=c>>8,c=c&255),n+=c*a}return!e&&n>=Du.MAX_INT?i?-1/0:1/0:i?-n:n},valueOf:function(){return this.toNumber(!1)},toString:function(e){return this.valueOf().toString(e||10)},toOctetString:function(e){for(var t=new Array(8),r=this.buffer,i=this.offset,n=0;n<8;n++)t[n]=fD[r[i+n]];return t.join(e||"")},toBuffer:function(e){if(e&&this.offset===0)return this.buffer;var t=new Buffer(8);return this.buffer.copy(t,0,this.offset,this.offset+8),t},copy:function(e,t){this.buffer.copy(e,t||0,this.offset,this.offset+8)},compare:function(e){if((this.buffer[this.offset]&128)!=(e.buffer[e.offset]&128))return e.buffer[e.offset]-this.buffer[this.offset];for(var t=0;t<8;t++)if(this.buffer[this.offset+t]!==e.buffer[e.offset+t])return this.buffer[this.offset+t]-e.buffer[e.offset+t];return 0},equals:function(e){return this.compare(e)===0},inspect:function(){return"[Int64 value:"+this+" octets:"+this.toOctetString(" ")+"]"}}});var ft=w((mEe,hD)=>{"use strict";var NS=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let i=0;i<t.length;i++)r+=` ${t[i].stack}
|
|
9
|
+
`;super(r),this.name="AggregateError",this.errors=t}};hD.exports={AggregateError:NS,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array}});var PS=w((gEe,mD)=>{"use strict";mD.exports={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,i]){let n=t.shift();return i==="f"?n.toFixed(6):i==="j"?JSON.stringify(n):i==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}});var rr=w((yEe,vD)=>{"use strict";var{format:tY,inspect:Ip}=PS(),{AggregateError:rY}=ft(),nY=globalThis.AggregateError||rY,iY=Symbol("kIsNodeError"),oY=["string","function","number","object","Function","Object","boolean","bigint","symbol"],sY=/^([A-Z][a-z0-9]*)+$/,aY="__node_internal_",Op={};function _o(e,t){if(!e)throw new Op.ERR_INTERNAL_ASSERTION(t)}function gD(e){let t="",r=e.length,i=e[0]==="-"?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function cY(e,t,r){if(typeof t=="function")return _o(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);let i=(t.match(/%[dfijoOs]/g)||[]).length;return _o(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?t:tY(t,...r)}function Jt(e,t,r){r||(r=Error);class i extends r{constructor(...o){super(cY(e,t,o))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[iY]=!0,Op[e]=i}function yD(e){let t=aY+e.name;return Object.defineProperty(e,"name",{value:t}),e}function uY(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new nY([t,e],t.message);return r.code=t.code,r}return e||t}var qS=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Op.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};Jt("ERR_ASSERTION","%s",Error);Jt("ERR_INVALID_ARG_TYPE",(e,t,r)=>{_o(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let i="The ";e.endsWith(" argument")?i+=`${e} `:i+=`"${e}" ${e.includes(".")?"property":"argument"} `,i+="must be ";let n=[],o=[],s=[];for(let c of t)_o(typeof c=="string","All expected entries have to be of type string"),oY.includes(c)?n.push(c.toLowerCase()):sY.test(c)?o.push(c):(_o(c!=="object",'The value "object" should be written as "Object"'),s.push(c));if(o.length>0){let c=n.indexOf("object");c!==-1&&(n.splice(n,c,1),o.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let c=n.pop();i+=`one of type ${n.join(", ")}, or ${c}`}}(o.length>0||s.length>0)&&(i+=" or ")}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();i+=`an instance of ${o.join(", ")}, or ${c}`}}s.length>0&&(i+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(i+="an "),i+=`${s[0]}`;break;case 2:i+=`one of ${s[0]} or ${s[1]}`;break;default:{let c=s.pop();i+=`one of ${s.join(", ")}, or ${c}`}}if(r==null)i+=`. Received ${r}`;else if(typeof r=="function"&&r.name)i+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)i+=`. Received an instance of ${r.constructor.name}`;else{let c=Ip(r,{depth:-1});i+=`. Received ${c}`}}else{let c=Ip(r,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),i+=`. Received type ${typeof r} (${c})`}return i},TypeError);Jt("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let i=Ip(t);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${i}`},TypeError);Jt("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var i;let n=r!=null&&(i=r.constructor)!==null&&i!==void 0&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${n}.`},TypeError);Jt("ERR_MISSING_ARGS",(...e)=>{_o(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(i=>`"${i}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let i=e.pop();t+=`The ${e.join(", ")}, and ${i} arguments`}break}return`${t} must be specified`},TypeError);Jt("ERR_OUT_OF_RANGE",(e,t,r)=>{_o(t,'Missing "range" argument');let i;if(Number.isInteger(r)&&Math.abs(r)>2**32)i=gD(String(r));else if(typeof r=="bigint"){i=String(r);let n=BigInt(2)**BigInt(32);(r>n||r<-n)&&(i=gD(i)),i+="n"}else i=Ip(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${i}`},RangeError);Jt("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Jt("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Jt("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Jt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Jt("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Jt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Jt("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Jt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Jt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Jt("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Jt("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);vD.exports={AbortError:qS,aggregateTwoErrors:yD(uY),hideStackFrames:yD,codes:Op}});var OD=w((qu,Pu)=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});var ED=new WeakMap,jS=new WeakMap;function ut(e){let t=ED.get(e);return console.assert(t!=null,"'this' is expected an Event object, but got",e),t}function bD(e){if(e.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener);return}e.event.cancelable&&(e.canceled=!0,typeof e.event.preventDefault=="function"&&e.event.preventDefault())}function aa(e,t){ED.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let r=Object.keys(t);for(let i=0;i<r.length;++i){let n=r[i];n in this||Object.defineProperty(this,n,kD(n))}}aa.prototype={get type(){return ut(this).event.type},get target(){return ut(this).eventTarget},get currentTarget(){return ut(this).currentTarget},composedPath(){let e=ut(this).currentTarget;return e==null?[]:[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return ut(this).eventPhase},stopPropagation(){let e=ut(this);e.stopped=!0,typeof e.event.stopPropagation=="function"&&e.event.stopPropagation()},stopImmediatePropagation(){let e=ut(this);e.stopped=!0,e.immediateStopped=!0,typeof e.event.stopImmediatePropagation=="function"&&e.event.stopImmediatePropagation()},get bubbles(){return!!ut(this).event.bubbles},get cancelable(){return!!ut(this).event.cancelable},preventDefault(){bD(ut(this))},get defaultPrevented(){return ut(this).canceled},get composed(){return!!ut(this).event.composed},get timeStamp(){return ut(this).timeStamp},get srcElement(){return ut(this).eventTarget},get cancelBubble(){return ut(this).stopped},set cancelBubble(e){if(!e)return;let t=ut(this);t.stopped=!0,typeof t.event.cancelBubble=="boolean"&&(t.event.cancelBubble=!0)},get returnValue(){return!ut(this).canceled},set returnValue(e){e||bD(ut(this))},initEvent(){}};Object.defineProperty(aa.prototype,"constructor",{value:aa,configurable:!0,writable:!0});typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(aa.prototype,window.Event.prototype),jS.set(window.Event.prototype,aa));function kD(e){return{get(){return ut(this).event[e]},set(t){ut(this).event[e]=t},configurable:!0,enumerable:!0}}function lY(e){return{value(){let t=ut(this).event;return t[e].apply(t,arguments)},configurable:!0,enumerable:!0}}function fY(e,t){let r=Object.keys(t);if(r.length===0)return e;function i(n,o){e.call(this,n,o)}i.prototype=Object.create(e.prototype,{constructor:{value:i,configurable:!0,writable:!0}});for(let n=0;n<r.length;++n){let o=r[n];if(!(o in e.prototype)){let a=typeof Object.getOwnPropertyDescriptor(t,o).value=="function";Object.defineProperty(i.prototype,o,a?lY(o):kD(o))}}return i}function TD(e){if(e==null||e===Object.prototype)return aa;let t=jS.get(e);return t==null&&(t=fY(TD(Object.getPrototypeOf(e)),e),jS.set(e,t)),t}function dY(e,t){let r=TD(Object.getPrototypeOf(t));return new r(e,t)}function pY(e){return ut(e).immediateStopped}function hY(e,t){ut(e).eventPhase=t}function mY(e,t){ut(e).currentTarget=t}function _D(e,t){ut(e).passiveListener=t}var ID=new WeakMap,wD=1,xD=2,Cp=3;function Ap(e){return e!==null&&typeof e=="object"}function Nu(e){let t=ID.get(e);if(t==null)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return t}function gY(e){return{get(){let r=Nu(this).get(e);for(;r!=null;){if(r.listenerType===Cp)return r.listener;r=r.next}return null},set(t){typeof t!="function"&&!Ap(t)&&(t=null);let r=Nu(this),i=null,n=r.get(e);for(;n!=null;)n.listenerType===Cp?i!==null?i.next=n.next:n.next!==null?r.set(e,n.next):r.delete(e):i=n,n=n.next;if(t!==null){let o={listener:t,listenerType:Cp,passive:!1,once:!1,next:null};i===null?r.set(e,o):i.next=o}},configurable:!0,enumerable:!0}}function MS(e,t){Object.defineProperty(e,`on${t}`,gY(t))}function SD(e){function t(){Jr.call(this)}t.prototype=Object.create(Jr.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let r=0;r<e.length;++r)MS(t.prototype,e[r]);return t}function Jr(){if(this instanceof Jr){ID.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return SD(arguments[0]);if(arguments.length>0){let e=new Array(arguments.length);for(let t=0;t<arguments.length;++t)e[t]=arguments[t];return SD(e)}throw new TypeError("Cannot call a class as a function")}Jr.prototype={addEventListener(e,t,r){if(t==null)return;if(typeof t!="function"&&!Ap(t))throw new TypeError("'listener' should be a function or an object.");let i=Nu(this),n=Ap(r),s=(n?!!r.capture:!!r)?wD:xD,a={listener:t,listenerType:s,passive:n&&!!r.passive,once:n&&!!r.once,next:null},c=i.get(e);if(c===void 0){i.set(e,a);return}let u=null;for(;c!=null;){if(c.listener===t&&c.listenerType===s)return;u=c,c=c.next}u.next=a},removeEventListener(e,t,r){if(t==null)return;let i=Nu(this),o=(Ap(r)?!!r.capture:!!r)?wD:xD,s=null,a=i.get(e);for(;a!=null;){if(a.listener===t&&a.listenerType===o){s!==null?s.next=a.next:a.next!==null?i.set(e,a.next):i.delete(e);return}s=a,a=a.next}},dispatchEvent(e){if(e==null||typeof e.type!="string")throw new TypeError('"event.type" should be a string.');let t=Nu(this),r=e.type,i=t.get(r);if(i==null)return!0;let n=dY(this,e),o=null;for(;i!=null;){if(i.once?o!==null?o.next=i.next:i.next!==null?t.set(r,i.next):t.delete(r):o=i,_D(n,i.passive?i.listener:null),typeof i.listener=="function")try{i.listener.call(this,n)}catch(s){typeof console<"u"&&typeof console.error=="function"&&console.error(s)}else i.listenerType!==Cp&&typeof i.listener.handleEvent=="function"&&i.listener.handleEvent(n);if(pY(n))break;i=i.next}return _D(n,null),hY(n,0),mY(n,null),!n.defaultPrevented}};Object.defineProperty(Jr.prototype,"constructor",{value:Jr,configurable:!0,writable:!0});typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf(Jr.prototype,window.EventTarget.prototype);qu.defineEventAttribute=MS;qu.EventTarget=Jr;qu.default=Jr;Pu.exports=Jr;Pu.exports.EventTarget=Pu.exports.default=Jr;Pu.exports.defineEventAttribute=MS});var ca=w((Mu,ju)=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});var LS=OD(),Ri=class extends LS.EventTarget{constructor(){throw super(),new TypeError("AbortSignal cannot be constructed directly")}get aborted(){let t=$p.get(this);if(typeof t!="boolean")throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return t}};LS.defineEventAttribute(Ri.prototype,"abort");function yY(){let e=Object.create(Ri.prototype);return LS.EventTarget.call(e),$p.set(e,!1),e}function vY(e){$p.get(e)===!1&&($p.set(e,!0),e.dispatchEvent({type:"abort"}))}var $p=new WeakMap;Object.defineProperties(Ri.prototype,{aborted:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ri.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});var Di=class{constructor(){AD.set(this,yY())}get signal(){return CD(this)}abort(){vY(CD(this))}},AD=new WeakMap;function CD(e){let t=AD.get(e);if(t==null)throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${e===null?"null":typeof e}`);return t}Object.defineProperties(Di.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Di.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});Mu.AbortController=Di;Mu.AbortSignal=Ri;Mu.default=Di;ju.exports=Di;ju.exports.AbortController=ju.exports.default=Di;ju.exports.AbortSignal=Ri});var pr=w((vEe,zS)=>{"use strict";var bY=B("buffer"),{format:_Y,inspect:wY}=PS(),{codes:{ERR_INVALID_ARG_TYPE:FS}}=rr(),{kResistStopPropagation:xY,AggregateError:SY,SymbolDispose:EY}=ft(),kY=globalThis.AbortSignal||ca().AbortSignal,TY=globalThis.AbortController||ca().AbortController,IY=Object.getPrototypeOf(async function(){}).constructor,$D=globalThis.Blob||bY.Blob,OY=typeof $D<"u"?function(t){return t instanceof $D}:function(t){return!1},RD=(e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new FS(t,"AbortSignal",e)},CY=(e,t)=>{if(typeof e!="function")throw new FS(t,"Function",e)};zS.exports={AggregateError:SY,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((i,n)=>{e=i,t=n}),resolve:e,reject:t}},promisify(e){return new Promise((t,r)=>{e((i,...n)=>i?r(i):t(...n))})},debuglog(){return function(){}},format:_Y,inspect:wY,types:{isAsyncFunction(e){return e instanceof IY},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:OY,deprecate(e,t){return e},addAbortListener:B("events").addAbortListener||function(t,r){if(t===void 0)throw new FS("signal","AbortSignal",t);RD(t,"signal"),CY(r,"listener");let i;return t.aborted?queueMicrotask(()=>r()):(t.addEventListener("abort",r,{__proto__:null,once:!0,[xY]:!0}),i=()=>{t.removeEventListener("abort",r)}),{__proto__:null,[EY](){var n;(n=i)===null||n===void 0||n()}}},AbortSignalAny:kY.any||function(t){if(t.length===1)return t[0];let r=new TY,i=()=>r.abort();return t.forEach(n=>{RD(n,"signals"),n.addEventListener("abort",i,{once:!0})}),r.signal.addEventListener("abort",()=>{t.forEach(n=>n.removeEventListener("abort",i))},{once:!0}),r.signal}};zS.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var la=w((bEe,UD)=>{"use strict";var{ArrayIsArray:BS,ArrayPrototypeIncludes:qD,ArrayPrototypeJoin:jD,ArrayPrototypeMap:AY,NumberIsInteger:WS,NumberIsNaN:$Y,NumberMAX_SAFE_INTEGER:RY,NumberMIN_SAFE_INTEGER:DY,NumberParseInt:NY,ObjectPrototypeHasOwnProperty:PY,RegExpPrototypeExec:MD,String:qY,StringPrototypeToUpperCase:jY,StringPrototypeTrim:MY}=ft(),{hideStackFrames:qr,codes:{ERR_SOCKET_BAD_PORT:LY,ERR_INVALID_ARG_TYPE:nr,ERR_INVALID_ARG_VALUE:ua,ERR_OUT_OF_RANGE:wo,ERR_UNKNOWN_SIGNAL:DD}}=rr(),{normalizeEncoding:FY}=pr(),{isAsyncFunction:zY,isArrayBufferView:UY}=pr().types,ND={};function BY(e){return e===(e|0)}function WY(e){return e===e>>>0}var HY=/^[0-7]+$/,VY="must be a 32-bit unsigned integer or an octal string";function ZY(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(MD(HY,e)===null)throw new ua(t,e,VY);e=NY(e,8)}return LD(e,t),e}var GY=qr((e,t,r=DY,i=RY)=>{if(typeof e!="number")throw new nr(t,"number",e);if(!WS(e))throw new wo(t,"an integer",e);if(e<r||e>i)throw new wo(t,`>= ${r} && <= ${i}`,e)}),KY=qr((e,t,r=-2147483648,i=2147483647)=>{if(typeof e!="number")throw new nr(t,"number",e);if(!WS(e))throw new wo(t,"an integer",e);if(e<r||e>i)throw new wo(t,`>= ${r} && <= ${i}`,e)}),LD=qr((e,t,r=!1)=>{if(typeof e!="number")throw new nr(t,"number",e);if(!WS(e))throw new wo(t,"an integer",e);let i=r?1:0,n=4294967295;if(e<i||e>n)throw new wo(t,`>= ${i} && <= ${n}`,e)});function HS(e,t){if(typeof e!="string")throw new nr(t,"string",e)}function XY(e,t,r=void 0,i){if(typeof e!="number")throw new nr(t,"number",e);if(r!=null&&e<r||i!=null&&e>i||(r!=null||i!=null)&&$Y(e))throw new wo(t,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,e)}var JY=qr((e,t,r)=>{if(!qD(r,e)){let n="must be one of: "+jD(AY(r,o=>typeof o=="string"?`'${o}'`:qY(o)),", ");throw new ua(t,e,n)}});function FD(e,t){if(typeof e!="boolean")throw new nr(t,"boolean",e)}function US(e,t,r){return e==null||!PY(e,t)?r:e[t]}var YY=qr((e,t,r=null)=>{let i=US(r,"allowArray",!1),n=US(r,"allowFunction",!1);if(!US(r,"nullable",!1)&&e===null||!i&&BS(e)||typeof e!="object"&&(!n||typeof e!="function"))throw new nr(t,"Object",e)}),QY=qr((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new nr(t,"a dictionary",e)}),Rp=qr((e,t,r=0)=>{if(!BS(e))throw new nr(t,"Array",e);if(e.length<r){let i=`must be longer than ${r}`;throw new ua(t,e,i)}});function eQ(e,t){Rp(e,t);for(let r=0;r<e.length;r++)HS(e[r],`${t}[${r}]`)}function tQ(e,t){Rp(e,t);for(let r=0;r<e.length;r++)FD(e[r],`${t}[${r}]`)}function rQ(e,t){Rp(e,t);for(let r=0;r<e.length;r++){let i=e[r],n=`${t}[${r}]`;if(i==null)throw new nr(n,"AbortSignal",i);zD(i,n)}}function nQ(e,t="signal"){if(HS(e,t),ND[e]===void 0)throw ND[jY(e)]!==void 0?new DD(e+" (signals must use all capital letters)"):new DD(e)}var iQ=qr((e,t="buffer")=>{if(!UY(e))throw new nr(t,["Buffer","TypedArray","DataView"],e)});function oQ(e,t){let r=FY(t),i=e.length;if(r==="hex"&&i%2!==0)throw new ua("encoding",t,`is invalid for data of length ${i}`)}function sQ(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&MY(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new LY(t,e,r);return e|0}var zD=qr((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new nr(t,"AbortSignal",e)}),aQ=qr((e,t)=>{if(typeof e!="function")throw new nr(t,"Function",e)}),cQ=qr((e,t)=>{if(typeof e!="function"||zY(e))throw new nr(t,"Function",e)}),uQ=qr((e,t)=>{if(e!==void 0)throw new nr(t,"undefined",e)});function lQ(e,t,r){if(!qD(r,e))throw new nr(t,`('${jD(r,"|")}')`,e)}var fQ=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function PD(e,t){if(typeof e>"u"||!MD(fQ,e))throw new ua(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function dQ(e){if(typeof e=="string")return PD(e,"hints"),e;if(BS(e)){let t=e.length,r="";if(t===0)return r;for(let i=0;i<t;i++){let n=e[i];PD(n,"hints"),r+=n,i!==t-1&&(r+=", ")}return r}throw new ua("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}UD.exports={isInt32:BY,isUint32:WY,parseFileMode:ZY,validateArray:Rp,validateStringArray:eQ,validateBooleanArray:tQ,validateAbortSignalArray:rQ,validateBoolean:FD,validateBuffer:iQ,validateDictionary:QY,validateEncoding:oQ,validateFunction:aQ,validateInt32:KY,validateInteger:GY,validateNumber:XY,validateObject:YY,validateOneOf:JY,validatePlainFunction:cQ,validatePort:sQ,validateSignalName:nQ,validateString:HS,validateUint32:LD,validateUndefined:uQ,validateUnion:lQ,validateAbortSignal:zD,validateLinkHeaderValue:dQ}});var Ni=w((_Ee,BD)=>{BD.exports=global.process});var hn=w((wEe,iN)=>{"use strict";var{SymbolAsyncIterator:WD,SymbolIterator:HD,SymbolFor:xo}=ft(),VD=xo("nodejs.stream.destroyed"),ZD=xo("nodejs.stream.errored"),VS=xo("nodejs.stream.readable"),ZS=xo("nodejs.stream.writable"),GD=xo("nodejs.stream.disturbed"),pQ=xo("nodejs.webstream.isClosedPromise"),hQ=xo("nodejs.webstream.controllerErrorFunction");function Dp(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function Np(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function mQ(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function pn(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function KD(e){return!!(e&&!pn(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function XD(e){return!!(e&&!pn(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function JD(e){return!!(e&&!pn(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function gQ(e){return KD(e)||XD(e)||JD(e)}function yQ(e,t){return e==null?!1:t===!0?typeof e[WD]=="function":t===!1?typeof e[HD]=="function":typeof e[WD]=="function"||typeof e[HD]=="function"}function Pp(e){if(!pn(e))return null;let t=e._writableState,r=e._readableState,i=t||r;return!!(e.destroyed||e[VD]||i!=null&&i.destroyed)}function YD(e){if(!Np(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}function vQ(e,t){if(!Np(e))return null;if(e.writableFinished===!0)return!0;let r=e._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}function bQ(e){if(!Dp(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}function QD(e,t){if(!Dp(e))return null;let r=e._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}function eN(e){return e&&e[VS]!=null?e[VS]:typeof e?.readable!="boolean"?null:Pp(e)?!1:Dp(e)&&e.readable&&!QD(e)}function tN(e){return e&&e[ZS]!=null?e[ZS]:typeof e?.writable!="boolean"?null:Pp(e)?!1:Np(e)&&e.writable&&!YD(e)}function _Q(e,t){return pn(e)?Pp(e)?!0:!(t?.readable!==!1&&eN(e)||t?.writable!==!1&&tN(e)):null}function wQ(e){var t,r;return pn(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function xQ(e){var t,r;return pn(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function SQ(e){if(!pn(e))return null;if(typeof e.closed=="boolean")return e.closed;let t=e._writableState,r=e._readableState;return typeof t?.closed=="boolean"||typeof r?.closed=="boolean"?t?.closed||r?.closed:typeof e._closed=="boolean"&&rN(e)?e._closed:null}function rN(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function nN(e){return typeof e._sent100=="boolean"&&rN(e)}function EQ(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function kQ(e){if(!pn(e))return null;let t=e._writableState,r=e._readableState,i=t||r;return!i&&nN(e)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}function TQ(e){var t;return!!(e&&((t=e[GD])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function IQ(e){var t,r,i,n,o,s,a,c,u,l;return!!(e&&((t=(r=(i=(n=(o=(s=e[ZD])!==null&&s!==void 0?s:e.readableErrored)!==null&&o!==void 0?o:e.writableErrored)!==null&&n!==void 0?n:(a=e._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&i!==void 0?i:(c=e._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(u=e._readableState)===null||u===void 0?void 0:u.errored)!==null&&t!==void 0?t:!((l=e._writableState)===null||l===void 0)&&l.errored))}iN.exports={isDestroyed:Pp,kIsDestroyed:VD,isDisturbed:TQ,kIsDisturbed:GD,isErrored:IQ,kIsErrored:ZD,isReadable:eN,kIsReadable:VS,kIsClosedPromise:pQ,kControllerErrorFunction:hQ,kIsWritable:ZS,isClosed:SQ,isDuplexNodeStream:mQ,isFinished:_Q,isIterable:yQ,isReadableNodeStream:Dp,isReadableStream:KD,isReadableEnded:bQ,isReadableFinished:QD,isReadableErrored:xQ,isNodeStream:pn,isWebStream:gQ,isWritable:tN,isWritableNodeStream:Np,isWritableStream:XD,isWritableEnded:YD,isWritableFinished:vQ,isWritableErrored:wQ,isServerRequest:EQ,isServerResponse:nN,willEmitClose:kQ,isTransformStream:JD}});var Gn=w((xEe,YS)=>{"use strict";var Pi=Ni(),{AbortError:pN,codes:OQ}=rr(),{ERR_INVALID_ARG_TYPE:CQ,ERR_STREAM_PREMATURE_CLOSE:oN}=OQ,{kEmptyObject:KS,once:XS}=pr(),{validateAbortSignal:AQ,validateFunction:$Q,validateObject:RQ,validateBoolean:DQ}=la(),{Promise:NQ,PromisePrototypeThen:PQ,SymbolDispose:hN}=ft(),{isClosed:qQ,isReadable:sN,isReadableNodeStream:GS,isReadableStream:jQ,isReadableFinished:aN,isReadableErrored:cN,isWritable:uN,isWritableNodeStream:lN,isWritableStream:MQ,isWritableFinished:fN,isWritableErrored:dN,isNodeStream:LQ,willEmitClose:FQ,kIsClosedPromise:zQ}=hn(),fa;function UQ(e){return e.setHeader&&typeof e.abort=="function"}var JS=()=>{};function mN(e,t,r){var i,n;if(arguments.length===2?(r=t,t=KS):t==null?t=KS:RQ(t,"options"),$Q(r,"callback"),AQ(t.signal,"options.signal"),r=XS(r),jQ(e)||MQ(e))return BQ(e,t,r);if(!LQ(e))throw new CQ("stream",["ReadableStream","WritableStream","Stream"],e);let o=(i=t.readable)!==null&&i!==void 0?i:GS(e),s=(n=t.writable)!==null&&n!==void 0?n:lN(e),a=e._writableState,c=e._readableState,u=()=>{e.writable||p()},l=FQ(e)&&GS(e)===o&&lN(e)===s,f=fN(e,!1),p=()=>{f=!0,e.destroyed&&(l=!1),!(l&&(!e.readable||o))&&(!o||d)&&r.call(e)},d=aN(e,!1),h=()=>{d=!0,e.destroyed&&(l=!1),!(l&&(!e.writable||s))&&(!s||f)&&r.call(e)},m=y=>{r.call(e,y)},_=qQ(e),k=()=>{_=!0;let y=dN(e)||cN(e);if(y&&typeof y!="boolean")return r.call(e,y);if(o&&!d&&GS(e,!0)&&!aN(e,!1))return r.call(e,new oN);if(s&&!f&&!fN(e,!1))return r.call(e,new oN);r.call(e)},S=()=>{_=!0;let y=dN(e)||cN(e);if(y&&typeof y!="boolean")return r.call(e,y);r.call(e)},v=()=>{e.req.on("finish",p)};UQ(e)?(e.on("complete",p),l||e.on("abort",k),e.req?v():e.on("request",v)):s&&!a&&(e.on("end",u),e.on("close",u)),!l&&typeof e.aborted=="boolean"&&e.on("aborted",k),e.on("end",h),e.on("finish",p),t.error!==!1&&e.on("error",m),e.on("close",k),_?Pi.nextTick(k):a!=null&&a.errorEmitted||c!=null&&c.errorEmitted?l||Pi.nextTick(S):(!o&&(!l||sN(e))&&(f||uN(e)===!1)||!s&&(!l||uN(e))&&(d||sN(e)===!1)||c&&e.req&&e.aborted)&&Pi.nextTick(S);let g=()=>{r=JS,e.removeListener("aborted",k),e.removeListener("complete",p),e.removeListener("abort",k),e.removeListener("request",v),e.req&&e.req.removeListener("finish",p),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",p),e.removeListener("end",h),e.removeListener("error",m),e.removeListener("close",k)};if(t.signal&&!_){let y=()=>{let T=r;g(),T.call(e,new pN(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)Pi.nextTick(y);else{fa=fa||pr().addAbortListener;let T=fa(t.signal,y),R=r;r=XS((...I)=>{T[hN](),R.apply(e,I)})}}return g}function BQ(e,t,r){let i=!1,n=JS;if(t.signal)if(n=()=>{i=!0,r.call(e,new pN(void 0,{cause:t.signal.reason}))},t.signal.aborted)Pi.nextTick(n);else{fa=fa||pr().addAbortListener;let s=fa(t.signal,n),a=r;r=XS((...c)=>{s[hN](),a.apply(e,c)})}let o=(...s)=>{i||Pi.nextTick(()=>r.apply(e,s))};return PQ(e[zQ].promise,o,o),JS}function WQ(e,t){var r;let i=!1;return t===null&&(t=KS),(r=t)!==null&&r!==void 0&&r.cleanup&&(DQ(t.cleanup,"cleanup"),i=t.cleanup),new NQ((n,o)=>{let s=mN(e,t,a=>{i&&s(),a?o(a):n()})})}YS.exports=mN;YS.exports.finished=WQ});var So=w((SEe,SN)=>{"use strict";var mn=Ni(),{aggregateTwoErrors:HQ,codes:{ERR_MULTIPLE_CALLBACK:VQ},AbortError:ZQ}=rr(),{Symbol:vN}=ft(),{kIsDestroyed:GQ,isDestroyed:KQ,isFinished:XQ,isServerRequest:JQ}=hn(),bN=vN("kDestroy"),QS=vN("kConstruct");function _N(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function YQ(e,t){let r=this._readableState,i=this._writableState,n=i||r;return i!=null&&i.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(_N(e,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),n.constructed?gN(this,e,t):this.once(bN,function(o){gN(this,HQ(o,e),t)}),this)}function gN(e,t,r){let i=!1;function n(o){if(i)return;i=!0;let s=e._readableState,a=e._writableState;_N(o,a,s),a&&(a.closed=!0),s&&(s.closed=!0),typeof r=="function"&&r(o),o?mn.nextTick(QQ,e,o):mn.nextTick(wN,e)}try{e._destroy(t||null,n)}catch(o){n(o)}}function QQ(e,t){e0(e,t),wN(e)}function wN(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function e0(e,t){let r=e._readableState,i=e._writableState;i!=null&&i.errorEmitted||r!=null&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function eee(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function t0(e,t,r){let i=e._readableState,n=e._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?e.destroy(t):t&&(t.stack,n&&!n.errored&&(n.errored=t),i&&!i.errored&&(i.errored=t),r?mn.nextTick(e0,e,t):e0(e,t))}function tee(e,t){if(typeof e._construct!="function")return;let r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(QS,t),!(e.listenerCount(QS)>1)&&mn.nextTick(ree,e)}function ree(e){let t=!1;function r(i){if(t){t0(e,i??new VQ);return}t=!0;let n=e._readableState,o=e._writableState,s=o||n;n&&(n.constructed=!0),o&&(o.constructed=!0),s.destroyed?e.emit(bN,i):i?t0(e,i,!0):mn.nextTick(nee,e)}try{e._construct(i=>{mn.nextTick(r,i)})}catch(i){mn.nextTick(r,i)}}function nee(e){e.emit(QS)}function yN(e){return e?.setHeader&&typeof e.abort=="function"}function xN(e){e.emit("close")}function iee(e,t){e.emit("error",t),mn.nextTick(xN,e)}function oee(e,t){!e||KQ(e)||(!t&&!XQ(e)&&(t=new ZQ),JQ(e)?(e.socket=null,e.destroy(t)):yN(e)?e.abort():yN(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?mn.nextTick(iee,e,t):mn.nextTick(xN,e),e.destroyed||(e[GQ]=!0))}SN.exports={construct:tee,destroyer:oee,destroy:YQ,undestroy:eee,errorOrDestroy:t0}});var Mp=w((EEe,kN)=>{"use strict";var{ArrayIsArray:see,ObjectSetPrototypeOf:EN}=ft(),{EventEmitter:qp}=B("events");function jp(e){qp.call(this,e)}EN(jp.prototype,qp.prototype);EN(jp,qp);jp.prototype.pipe=function(e,t){let r=this;function i(l){e.writable&&e.write(l)===!1&&r.pause&&r.pause()}r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}e.on("drain",n),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",s),r.on("close",a));let o=!1;function s(){o||(o=!0,e.end())}function a(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function c(l){u(),qp.listenerCount(this,"error")===0&&this.emit("error",l)}r0(r,"error",c),r0(e,"error",c);function u(){r.removeListener("data",i),e.removeListener("drain",n),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e};function r0(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):see(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}kN.exports={Stream:jp,prependListener:r0}});var Lu=w((kEe,Lp)=>{"use strict";var{SymbolDispose:aee}=ft(),{AbortError:TN,codes:cee}=rr(),{isNodeStream:IN,isWebStream:uee,kControllerErrorFunction:lee}=hn(),fee=Gn(),{ERR_INVALID_ARG_TYPE:ON}=cee,n0,dee=(e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new ON(t,"AbortSignal",e)};Lp.exports.addAbortSignal=function(t,r){if(dee(t,"signal"),!IN(r)&&!uee(r))throw new ON("stream",["ReadableStream","WritableStream","Stream"],r);return Lp.exports.addAbortSignalNoValidate(t,r)};Lp.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let r=IN(t)?()=>{t.destroy(new TN(void 0,{cause:e.reason}))}:()=>{t[lee](new TN(void 0,{cause:e.reason}))};if(e.aborted)r();else{n0=n0||pr().addAbortListener;let i=n0(e,r);fee(t,i[aee])}return t}});var $N=w((IEe,AN)=>{"use strict";var{StringPrototypeSlice:CN,SymbolIterator:pee,TypedArrayPrototypeSet:Fp,Uint8Array:hee}=ft(),{Buffer:i0}=B("buffer"),{inspect:mee}=pr();AN.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){let r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,i=""+r.data;for(;(r=r.next)!==null;)i+=t+r.data;return i}concat(t){if(this.length===0)return i0.alloc(0);let r=i0.allocUnsafe(t>>>0),i=this.head,n=0;for(;i;)Fp(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(t,r){let i=this.head.data;if(t<i.length){let n=i.slice(0,t);return this.head.data=i.slice(t),n}return t===i.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[pee](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",i=this.head,n=0;do{let o=i.data;if(t>o.length)r+=o,t-=o.length;else{t===o.length?(r+=o,++n,i.next?this.head=i.next:this.head=this.tail=null):(r+=CN(o,0,t),this.head=i,i.data=CN(o,t));break}++n}while((i=i.next)!==null);return this.length-=n,r}_getBuffer(t){let r=i0.allocUnsafe(t),i=t,n=this.head,o=0;do{let s=n.data;if(t>s.length)Fp(r,s,i-t),t-=s.length;else{t===s.length?(Fp(r,s,i-t),++o,n.next?this.head=n.next:this.head=this.tail=null):(Fp(r,new hee(s.buffer,s.byteOffset,t),i-t),this.head=n,n.data=s.slice(t));break}++o}while((n=n.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return mee(this,{...r,depth:0,customInspect:!1})}}});var Fu=w((OEe,PN)=>{"use strict";var{MathFloor:gee,NumberIsInteger:yee}=ft(),{validateInteger:vee}=la(),{ERR_INVALID_ARG_VALUE:bee}=rr().codes,RN=16*1024,DN=16;function _ee(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function NN(e){return e?DN:RN}function wee(e,t){vee(t,"value",0),e?DN=t:RN=t}function xee(e,t,r,i){let n=_ee(t,i,r);if(n!=null){if(!yee(n)||n<0){let o=i?`options.${r}`:"options.highWaterMark";throw new bee(o,n)}return gee(n)}return NN(e.objectMode)}PN.exports={getHighWaterMark:xee,getDefaultHighWaterMark:NN,setDefaultHighWaterMark:wee}});var MN=w((o0,jN)=>{var zp=B("buffer"),gn=zp.Buffer;function qN(e,t){for(var r in e)t[r]=e[r]}gn.from&&gn.alloc&&gn.allocUnsafe&&gn.allocUnsafeSlow?jN.exports=zp:(qN(zp,o0),o0.Buffer=Eo);function Eo(e,t,r){return gn(e,t,r)}Eo.prototype=Object.create(gn.prototype);qN(gn,Eo);Eo.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return gn(e,t,r)};Eo.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=gn(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};Eo.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return gn(e)};Eo.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return zp.SlowBuffer(e)}});var zN=w(FN=>{"use strict";var a0=MN().Buffer,LN=a0.isEncoding||function(e){switch(e=""+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 See(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}}function Eee(e){var t=See(e);if(typeof t!="string"&&(a0.isEncoding===LN||!LN(e)))throw new Error("Unknown encoding: "+e);return t||e}FN.StringDecoder=zu;function zu(e){this.encoding=Eee(e);var t;switch(this.encoding){case"utf16le":this.text=Aee,this.end=$ee,t=4;break;case"utf8":this.fillLast=Iee,t=4;break;case"base64":this.text=Ree,this.end=Dee,t=3;break;default:this.write=Nee,this.end=Pee;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=a0.allocUnsafe(t)}zu.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};zu.prototype.end=Cee;zu.prototype.text=Oee;zu.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};function s0(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function kee(e,t,r){var i=t.length-1;if(i<r)return 0;var n=s0(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=s0(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=s0(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function Tee(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function Iee(e){var t=this.lastTotal-this.lastNeed,r=Tee(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function Oee(e,t){var r=kee(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}function Cee(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function Aee(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function $ee(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function Ree(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?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-r))}function Dee(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Nee(e){return e.toString(this.encoding)}function Pee(e){return e&&e.length?this.write(e):""}});var c0=w((AEe,HN)=>{"use strict";var UN=Ni(),{PromisePrototypeThen:qee,SymbolAsyncIterator:BN,SymbolIterator:WN}=ft(),{Buffer:jee}=B("buffer"),{ERR_INVALID_ARG_TYPE:Mee,ERR_STREAM_NULL_VALUES:Lee}=rr().codes;function Fee(e,t,r){let i;if(typeof t=="string"||t instanceof jee)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let n;if(t&&t[BN])n=!0,i=t[BN]();else if(t&&t[WN])n=!1,i=t[WN]();else throw new Mee("iterable",["Iterable"],t);let o=new e({objectMode:!0,highWaterMark:1,...r}),s=!1;o._read=function(){s||(s=!0,c())},o._destroy=function(u,l){qee(a(u),()=>UN.nextTick(l,u),f=>UN.nextTick(l,f||u))};async function a(u){let l=u!=null,f=typeof i.throw=="function";if(l&&f){let{value:p,done:d}=await i.throw(u);if(await p,d)return}if(typeof i.return=="function"){let{value:p}=await i.return();await p}}async function c(){for(;;){try{let{value:u,done:l}=n?await i.next():i.next();if(l)o.push(null);else{let f=u&&typeof u.then=="function"?await u:u;if(f===null)throw s=!1,new Lee;if(o.push(f))continue;s=!1}}catch(u){o.destroy(u)}break}}return o}HN.exports=Fee});var Bu=w(($Ee,uP)=>{"use strict";var Yr=Ni(),{ArrayPrototypeIndexOf:zee,NumberIsInteger:Uee,NumberIsNaN:Bee,NumberParseInt:Wee,ObjectDefineProperties:g0,ObjectKeys:Hee,ObjectSetPrototypeOf:GN,Promise:KN,SafeSet:Vee,SymbolAsyncDispose:Zee,SymbolAsyncIterator:Gee,Symbol:Kee}=ft();uP.exports=ke;ke.ReadableState=Hp;var{EventEmitter:Xee}=B("events"),{Stream:qi,prependListener:Jee}=Mp(),{Buffer:u0}=B("buffer"),{addAbortSignal:Yee}=Lu(),XN=Gn(),Pe=pr().debuglog("stream",e=>{Pe=e}),Qee=$N(),ha=So(),{getHighWaterMark:ete,getDefaultHighWaterMark:tte}=Fu(),{aggregateTwoErrors:VN,codes:{ERR_INVALID_ARG_TYPE:rte,ERR_METHOD_NOT_IMPLEMENTED:nte,ERR_OUT_OF_RANGE:ite,ERR_STREAM_PUSH_AFTER_EOF:ote,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:ste},AbortError:ate}=rr(),{validateObject:cte}=la(),ko=Kee("kPaused"),{StringDecoder:JN}=zN(),ute=c0();GN(ke.prototype,qi.prototype);GN(ke,qi);var l0=()=>{},{errorOrDestroy:da}=ha,pa=1,lte=2,YN=4,Uu=8,QN=16,Up=32,Bp=64,eP=128,fte=256,dte=512,pte=1024,h0=2048,m0=4096,hte=8192,mte=16384,gte=32768,tP=65536,yte=1<<17,vte=1<<18;function $t(e){return{enumerable:!1,get(){return(this.state&e)!==0},set(t){t?this.state|=e:this.state&=~e}}}g0(Hp.prototype,{objectMode:$t(pa),ended:$t(lte),endEmitted:$t(YN),reading:$t(Uu),constructed:$t(QN),sync:$t(Up),needReadable:$t(Bp),emittedReadable:$t(eP),readableListening:$t(fte),resumeScheduled:$t(dte),errorEmitted:$t(pte),emitClose:$t(h0),autoDestroy:$t(m0),destroyed:$t(hte),closed:$t(mte),closeEmitted:$t(gte),multiAwaitDrain:$t(tP),readingMore:$t(yte),dataEmitted:$t(vte)});function Hp(e,t,r){typeof r!="boolean"&&(r=t instanceof yn()),this.state=h0|m0|QN|Up,e&&e.objectMode&&(this.state|=pa),r&&e&&e.readableObjectMode&&(this.state|=pa),this.highWaterMark=e?ete(this,e,"readableHighWaterMark",r):tte(!1),this.buffer=new Qee,this.length=0,this.pipes=[],this.flowing=null,this[ko]=null,e&&e.emitClose===!1&&(this.state&=~h0),e&&e.autoDestroy===!1&&(this.state&=~m0),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new JN(e.encoding),this.encoding=e.encoding)}function ke(e){if(!(this instanceof ke))return new ke(e);let t=this instanceof yn();this._readableState=new Hp(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&Yee(e.signal,this)),qi.call(this,e),ha.construct(this,()=>{this._readableState.needReadable&&Wp(this,this._readableState)})}ke.prototype.destroy=ha.destroy;ke.prototype._undestroy=ha.undestroy;ke.prototype._destroy=function(e,t){t(e)};ke.prototype[Xee.captureRejectionSymbol]=function(e){this.destroy(e)};ke.prototype[Zee]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new ate,this.destroy(e)),new KN((t,r)=>XN(this,i=>i&&i!==e?r(i):t(null)))};ke.prototype.push=function(e,t){return rP(this,e,t,!1)};ke.prototype.unshift=function(e,t){return rP(this,e,t,!0)};function rP(e,t,r,i){Pe("readableAddChunk",t);let n=e._readableState,o;if((n.state&pa)===0&&(typeof t=="string"?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?t=u0.from(t,r).toString(n.encoding):(t=u0.from(t,r),r=""))):t instanceof u0?r="":qi._isUint8Array(t)?(t=qi._uint8ArrayToBuffer(t),r=""):t!=null&&(o=new rte("chunk",["string","Buffer","Uint8Array"],t))),o)da(e,o);else if(t===null)n.state&=~Uu,wte(e,n);else if((n.state&pa)!==0||t&&t.length>0)if(i)if((n.state&YN)!==0)da(e,new ste);else{if(n.destroyed||n.errored)return!1;f0(e,n,t,!0)}else if(n.ended)da(e,new ote);else{if(n.destroyed||n.errored)return!1;n.state&=~Uu,n.decoder&&!r?(t=n.decoder.write(t),n.objectMode||t.length!==0?f0(e,n,t,!1):Wp(e,n)):f0(e,n,t,!1)}else i||(n.state&=~Uu,Wp(e,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}function f0(e,t,r,i){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?((t.state&tP)!==0?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),(t.state&Bp)!==0&&Vp(e)),Wp(e,t)}ke.prototype.isPaused=function(){let e=this._readableState;return e[ko]===!0||e.flowing===!1};ke.prototype.setEncoding=function(e){let t=new JN(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,i="";for(let n of r)i+=t.write(n);return r.clear(),i!==""&&r.push(i),this._readableState.length=i.length,this};var bte=1073741824;function _te(e){if(e>bte)throw new ite("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}function ZN(e,t){return e<=0||t.length===0&&t.ended?0:(t.state&pa)!==0?1:Bee(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}ke.prototype.read=function(e){Pe("read",e),e===void 0?e=NaN:Uee(e)||(e=Wee(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=_te(e)),e!==0&&(t.state&=~eP),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return Pe("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?d0(this):Vp(this),null;if(e=ZN(e,t),e===0&&t.ended)return t.length===0&&d0(this),null;let i=(t.state&Bp)!==0;if(Pe("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,Pe("length less than watermark",i)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)i=!1,Pe("reading, ended or constructing",i);else if(i){Pe("do read"),t.state|=Uu|Up,t.length===0&&(t.state|=Bp);try{this._read(t.highWaterMark)}catch(o){da(this,o)}t.state&=~Up,t.reading||(e=ZN(r,t))}let n;return e>0?n=aP(e,t):n=null,n===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&d0(this)),n!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",n)),n};function wte(e,t){if(Pe("onEofChunk"),!t.ended){if(t.decoder){let r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Vp(e):(t.needReadable=!1,t.emittedReadable=!0,nP(e))}}function Vp(e){let t=e._readableState;Pe("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(Pe("emitReadable",t.flowing),t.emittedReadable=!0,Yr.nextTick(nP,e))}function nP(e){let t=e._readableState;Pe("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,oP(e)}function Wp(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,Yr.nextTick(xte,e,t))}function xte(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let r=t.length;if(Pe("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}ke.prototype._read=function(e){throw new nte("_read()")};ke.prototype.pipe=function(e,t){let r=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new Vee(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),Pe("pipe count=%d opts=%j",i.pipes.length,t);let o=(!t||t.end!==!1)&&e!==Yr.stdout&&e!==Yr.stderr?a:_;i.endEmitted?Yr.nextTick(o):r.once("end",o),e.on("unpipe",s);function s(k,S){Pe("onunpipe"),k===r&&S&&S.hasUnpiped===!1&&(S.hasUnpiped=!0,l())}function a(){Pe("onend"),e.end()}let c,u=!1;function l(){Pe("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),c&&e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",_),r.removeListener("data",p),u=!0,c&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&c()}function f(){u||(i.pipes.length===1&&i.pipes[0]===e?(Pe("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(Pe("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),c||(c=Ste(r,e),e.on("drain",c))}r.on("data",p);function p(k){Pe("ondata");let S=e.write(k);Pe("dest.write",S),S===!1&&f()}function d(k){if(Pe("onerror",k),_(),e.removeListener("error",d),e.listenerCount("error")===0){let S=e._writableState||e._readableState;S&&!S.errorEmitted?da(e,k):e.emit("error",k)}}Jee(e,"error",d);function h(){e.removeListener("finish",m),_()}e.once("close",h);function m(){Pe("onfinish"),e.removeListener("close",h),_()}e.once("finish",m);function _(){Pe("unpipe"),r.unpipe(e)}return e.emit("pipe",r),e.writableNeedDrain===!0?f():i.flowing||(Pe("pipe resume"),r.resume()),e};function Ste(e,t){return function(){let i=e._readableState;i.awaitDrainWriters===t?(Pe("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(Pe("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(t)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()}}ke.prototype.unpipe=function(e){let t=this._readableState,r={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let n=t.pipes;t.pipes=[],this.pause();for(let o=0;o<n.length;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}let i=zee(t.pipes,e);return i===-1?this:(t.pipes.splice(i,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,r),this)};ke.prototype.on=function(e,t){let r=qi.prototype.on.call(this,e,t),i=this._readableState;return e==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):e==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,Pe("on readable",i.length,i.reading),i.length?Vp(this):i.reading||Yr.nextTick(Ete,this)),r};ke.prototype.addListener=ke.prototype.on;ke.prototype.removeListener=function(e,t){let r=qi.prototype.removeListener.call(this,e,t);return e==="readable"&&Yr.nextTick(iP,this),r};ke.prototype.off=ke.prototype.removeListener;ke.prototype.removeAllListeners=function(e){let t=qi.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&Yr.nextTick(iP,this),t};function iP(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[ko]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function Ete(e){Pe("readable nexttick read 0"),e.read(0)}ke.prototype.resume=function(){let e=this._readableState;return e.flowing||(Pe("resume"),e.flowing=!e.readableListening,kte(this,e)),e[ko]=!1,this};function kte(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Yr.nextTick(Tte,e,t))}function Tte(e,t){Pe("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),oP(e),t.flowing&&!t.reading&&e.read(0)}ke.prototype.pause=function(){return Pe("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Pe("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ko]=!0,this};function oP(e){let t=e._readableState;for(Pe("flow",t.flowing);t.flowing&&e.read()!==null;);}ke.prototype.wrap=function(e){let t=!1;e.on("data",i=>{!this.push(i)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",i=>{da(this,i)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=Hee(e);for(let i=1;i<r.length;i++){let n=r[i];this[n]===void 0&&typeof e[n]=="function"&&(this[n]=e[n].bind(e))}return this};ke.prototype[Gee]=function(){return sP(this)};ke.prototype.iterator=function(e){return e!==void 0&&cte(e,"options"),sP(this,e)};function sP(e,t){typeof e.read!="function"&&(e=ke.wrap(e,{objectMode:!0}));let r=Ite(e,t);return r.stream=e,r}async function*Ite(e,t){let r=l0;function i(s){this===e?(r(),r=l0):r=s}e.on("readable",i);let n,o=XN(e,{writable:!1},s=>{n=s?VN(n,s):null,r(),r=l0});try{for(;;){let s=e.destroyed?null:e.read();if(s!==null)yield s;else{if(n)throw n;if(n===null)return;await new KN(i)}}}catch(s){throw n=VN(n,s),n}finally{(n||t?.destroyOnReturn!==!1)&&(n===void 0||e._readableState.autoDestroy)?ha.destroyer(e,null):(e.off("readable",i),o())}}g0(ke.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});g0(Hp.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ko]!==!1},set(e){this[ko]=!!e}}});ke._fromList=aP;function aP(e,t){if(t.length===0)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function d0(e){let t=e._readableState;Pe("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Yr.nextTick(Ote,t,e))}function Ote(e,t){if(Pe("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit("end"),t.writable&&t.allowHalfOpen===!1)Yr.nextTick(Cte,t);else if(e.autoDestroy){let r=t._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&t.destroy()}}}function Cte(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}ke.from=function(e,t){return ute(ke,e,t)};var p0;function cP(){return p0===void 0&&(p0={}),p0}ke.fromWeb=function(e,t){return cP().newStreamReadableFromReadableStream(e,t)};ke.toWeb=function(e,t){return cP().newReadableStreamFromStreamReadable(e,t)};ke.wrap=function(e,t){var r,i;return new ke({objectMode:(r=(i=e.readableObjectMode)!==null&&i!==void 0?i:e.objectMode)!==null&&r!==void 0?r:!0,...t,destroy(n,o){ha.destroyer(e,n),o(n)}}).wrap(e)}});var Jp=w((REe,wP)=>{"use strict";var To=Ni(),{ArrayPrototypeSlice:dP,Error:Ate,FunctionPrototypeSymbolHasInstance:pP,ObjectDefineProperty:hP,ObjectDefineProperties:$te,ObjectSetPrototypeOf:mP,StringPrototypeToLowerCase:Rte,Symbol:Dte,SymbolHasInstance:Nte}=ft();wP.exports=mt;mt.WritableState=Vu;var{EventEmitter:Pte}=B("events"),Wu=Mp().Stream,{Buffer:Zp}=B("buffer"),Xp=So(),{addAbortSignal:qte}=Lu(),{getHighWaterMark:jte,getDefaultHighWaterMark:Mte}=Fu(),{ERR_INVALID_ARG_TYPE:Lte,ERR_METHOD_NOT_IMPLEMENTED:Fte,ERR_MULTIPLE_CALLBACK:gP,ERR_STREAM_CANNOT_PIPE:zte,ERR_STREAM_DESTROYED:Hu,ERR_STREAM_ALREADY_FINISHED:Ute,ERR_STREAM_NULL_VALUES:Bte,ERR_STREAM_WRITE_AFTER_END:Wte,ERR_UNKNOWN_ENCODING:yP}=rr().codes,{errorOrDestroy:ma}=Xp;mP(mt.prototype,Wu.prototype);mP(mt,Wu);function b0(){}var ga=Dte("kOnFinished");function Vu(e,t,r){typeof r!="boolean"&&(r=t instanceof yn()),this.objectMode=!!(e&&e.objectMode),r&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?jte(this,e,"writableHighWaterMark",r):Mte(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(e&&e.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Vte.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Kp(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[ga]=[]}function Kp(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}Vu.prototype.getBuffer=function(){return dP(this.buffered,this.bufferedIndex)};hP(Vu.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function mt(e){let t=this instanceof yn();if(!t&&!pP(mt,this))return new mt(e);this._writableState=new Vu(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&qte(e.signal,this)),Wu.call(this,e),Xp.construct(this,()=>{let r=this._writableState;r.writing||w0(this,r),x0(this,r)})}hP(mt,Nte,{__proto__:null,value:function(e){return pP(this,e)?!0:this!==mt?!1:e&&e._writableState instanceof Vu}});mt.prototype.pipe=function(){ma(this,new zte)};function vP(e,t,r,i){let n=e._writableState;if(typeof r=="function")i=r,r=n.defaultEncoding;else{if(!r)r=n.defaultEncoding;else if(r!=="buffer"&&!Zp.isEncoding(r))throw new yP(r);typeof i!="function"&&(i=b0)}if(t===null)throw new Bte;if(!n.objectMode)if(typeof t=="string")n.decodeStrings!==!1&&(t=Zp.from(t,r),r="buffer");else if(t instanceof Zp)r="buffer";else if(Wu._isUint8Array(t))t=Wu._uint8ArrayToBuffer(t),r="buffer";else throw new Lte("chunk",["string","Buffer","Uint8Array"],t);let o;return n.ending?o=new Wte:n.destroyed&&(o=new Hu("write")),o?(To.nextTick(i,o),ma(e,o,!0),o):(n.pendingcb++,Hte(e,n,t,r,i))}mt.prototype.write=function(e,t,r){return vP(this,e,t,r)===!0};mt.prototype.cork=function(){this._writableState.corked++};mt.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||w0(this,e))};mt.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=Rte(t)),!Zp.isEncoding(t))throw new yP(t);return this._writableState.defaultEncoding=t,this};function Hte(e,t,r,i,n){let o=t.objectMode?1:r.length;t.length+=o;let s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:i,callback:n}),t.allBuffers&&i!=="buffer"&&(t.allBuffers=!1),t.allNoop&&n!==b0&&(t.allNoop=!1)):(t.writelen=o,t.writecb=n,t.writing=!0,t.sync=!0,e._write(r,i,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}function lP(e,t,r,i,n,o,s){t.writelen=i,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new Hu("write")):r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function fP(e,t,r,i){--t.pendingcb,i(r),_0(t),ma(e,r)}function Vte(e,t){let r=e._writableState,i=r.sync,n=r.writecb;if(typeof n!="function"){ma(e,new gP);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?To.nextTick(fP,e,r,t,n):fP(e,r,t,n)):(r.buffered.length>r.bufferedIndex&&w0(e,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===n?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:n,stream:e,state:r},To.nextTick(Zte,r.afterWriteTickInfo)):bP(e,r,1,n))}function Zte({stream:e,state:t,count:r,cb:i}){return t.afterWriteTickInfo=null,bP(e,t,r,i)}function bP(e,t,r,i){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,i();t.destroyed&&_0(t),x0(e,t)}function _0(e){if(e.writing)return;for(let n=e.bufferedIndex;n<e.buffered.length;++n){var t;let{chunk:o,callback:s}=e.buffered[n],a=e.objectMode?1:o.length;e.length-=a,s((t=e.errored)!==null&&t!==void 0?t:new Hu("write"))}let r=e[ga].splice(0);for(let n=0;n<r.length;n++){var i;r[n]((i=e.errored)!==null&&i!==void 0?i:new Hu("end"))}Kp(e)}function w0(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:n}=t,o=r.length-i;if(!o)return;let s=i;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;let a=t.allNoop?b0:u=>{for(let l=s;l<r.length;++l)r[l].callback(u)},c=t.allNoop&&s===0?r:dP(r,s);c.allBuffers=t.allBuffers,lP(e,t,!0,t.length,c,"",a),Kp(t)}else{do{let{chunk:a,encoding:c,callback:u}=r[s];r[s++]=null;let l=n?1:a.length;lP(e,t,!1,l,a,c,u)}while(s<r.length&&!t.writing);s===r.length?Kp(t):s>256?(r.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}mt.prototype._write=function(e,t,r){if(this._writev)this._writev([{chunk:e,encoding:t}],r);else throw new Fte("_write()")};mt.prototype._writev=null;mt.prototype.end=function(e,t,r){let i=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null);let n;if(e!=null){let o=vP(this,e,t);o instanceof Ate&&(n=o)}return i.corked&&(i.corked=1,this.uncork()),n||(!i.errored&&!i.ending?(i.ending=!0,x0(this,i,!0),i.ended=!0):i.finished?n=new Ute("end"):i.destroyed&&(n=new Hu("end"))),typeof r=="function"&&(n||i.finished?To.nextTick(r,n):i[ga].push(r)),this};function Gp(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function Gte(e,t){let r=!1;function i(n){if(r){ma(e,n??gP());return}if(r=!0,t.pendingcb--,n){let o=t[ga].splice(0);for(let s=0;s<o.length;s++)o[s](n);ma(e,n,t.sync)}else Gp(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,To.nextTick(v0,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(n){i(n)}t.sync=!1}function Kte(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,Gte(e,t)):(t.prefinished=!0,e.emit("prefinish")))}function x0(e,t,r){Gp(t)&&(Kte(e,t),t.pendingcb===0&&(r?(t.pendingcb++,To.nextTick((i,n)=>{Gp(n)?v0(i,n):n.pendingcb--},e,t)):Gp(t)&&(t.pendingcb++,v0(e,t))))}function v0(e,t){t.pendingcb--,t.finished=!0;let r=t[ga].splice(0);for(let i=0;i<r.length;i++)r[i]();if(e.emit("finish"),t.autoDestroy){let i=e._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&e.destroy()}}$te(mt.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Xte=Xp.destroy;mt.prototype.destroy=function(e,t){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[ga].length)&&To.nextTick(_0,r),Xte.call(this,e,t),this};mt.prototype._undestroy=Xp.undestroy;mt.prototype._destroy=function(e,t){t(e)};mt.prototype[Pte.captureRejectionSymbol]=function(e){this.destroy(e)};var y0;function _P(){return y0===void 0&&(y0={}),y0}mt.fromWeb=function(e,t){return _P().newStreamWritableFromWritableStream(e,t)};mt.toWeb=function(e){return _P().newWritableStreamFromStreamWritable(e)}});var qP=w((DEe,PP)=>{var S0=Ni(),Jte=B("buffer"),{isReadable:Yte,isWritable:Qte,isIterable:xP,isNodeStream:ere,isReadableNodeStream:SP,isWritableNodeStream:EP,isDuplexNodeStream:tre,isReadableStream:kP,isWritableStream:TP}=hn(),IP=Gn(),{AbortError:DP,codes:{ERR_INVALID_ARG_TYPE:rre,ERR_INVALID_RETURN_VALUE:OP}}=rr(),{destroyer:va}=So(),nre=yn(),NP=Bu(),ire=Jp(),{createDeferredPromise:CP}=pr(),AP=c0(),$P=globalThis.Blob||Jte.Blob,ore=typeof $P<"u"?function(t){return t instanceof $P}:function(t){return!1},sre=globalThis.AbortController||ca().AbortController,{FunctionPrototypeCall:RP}=ft(),ji=class extends nre{constructor(t){super(t),t?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};PP.exports=function e(t,r){if(tre(t))return t;if(SP(t))return ya({readable:t});if(EP(t))return ya({writable:t});if(ere(t))return ya({writable:!1,readable:!1});if(kP(t))return ya({readable:NP.fromWeb(t)});if(TP(t))return ya({writable:ire.fromWeb(t)});if(typeof t=="function"){let{value:n,write:o,final:s,destroy:a}=are(t);if(xP(n))return AP(ji,n,{objectMode:!0,write:o,final:s,destroy:a});let c=n?.then;if(typeof c=="function"){let u,l=RP(c,n,f=>{if(f!=null)throw new OP("nully","body",f)},f=>{va(u,f)});return u=new ji({objectMode:!0,readable:!1,write:o,final(f){s(async()=>{try{await l,S0.nextTick(f,null)}catch(p){S0.nextTick(f,p)}})},destroy:a})}throw new OP("Iterable, AsyncIterable or AsyncFunction",r,n)}if(ore(t))return e(t.arrayBuffer());if(xP(t))return AP(ji,t,{objectMode:!0,writable:!1});if(kP(t?.readable)&&TP(t?.writable))return ji.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let n=t!=null&&t.readable?SP(t?.readable)?t?.readable:e(t.readable):void 0,o=t!=null&&t.writable?EP(t?.writable)?t?.writable:e(t.writable):void 0;return ya({readable:n,writable:o})}let i=t?.then;if(typeof i=="function"){let n;return RP(i,t,o=>{o!=null&&n.push(o),n.push(null)},o=>{va(n,o)}),n=new ji({objectMode:!0,writable:!1,read(){}})}throw new rre(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)};function are(e){let{promise:t,resolve:r}=CP(),i=new sre,n=i.signal;return{value:e((async function*(){for(;;){let s=t;t=null;let{chunk:a,done:c,cb:u}=await s;if(S0.nextTick(u),c)return;if(n.aborted)throw new DP(void 0,{cause:n.reason});({promise:t,resolve:r}=CP()),yield a}})(),{signal:n}),write(s,a,c){let u=r;r=null,u({chunk:s,done:!1,cb:c})},final(s){let a=r;r=null,a({done:!0,cb:s})},destroy(s,a){i.abort(),a(s)}}}function ya(e){let t=e.readable&&typeof e.readable.read!="function"?NP.wrap(e.readable):e.readable,r=e.writable,i=!!Yte(t),n=!!Qte(r),o,s,a,c,u;function l(f){let p=c;c=null,p?p(f):f&&u.destroy(f)}return u=new ji({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:i,writable:n}),n&&(IP(r,f=>{n=!1,f&&va(t,f),l(f)}),u._write=function(f,p,d){r.write(f,p)?d():o=d},u._final=function(f){r.end(),s=f},r.on("drain",function(){if(o){let f=o;o=null,f()}}),r.on("finish",function(){if(s){let f=s;s=null,f()}})),i&&(IP(t,f=>{i=!1,f&&va(t,f),l(f)}),t.on("readable",function(){if(a){let f=a;a=null,f()}}),t.on("end",function(){u.push(null)}),u._read=function(){for(;;){let f=t.read();if(f===null){a=u._read;return}if(!u.push(f))return}}),u._destroy=function(f,p){!f&&c!==null&&(f=new DP),a=null,o=null,s=null,c===null?p(f):(c=p,va(r,f),va(t,f))},u}});var yn=w((NEe,LP)=>{"use strict";var{ObjectDefineProperties:cre,ObjectGetOwnPropertyDescriptor:Kn,ObjectKeys:ure,ObjectSetPrototypeOf:jP}=ft();LP.exports=Qr;var T0=Bu(),jr=Jp();jP(Qr.prototype,T0.prototype);jP(Qr,T0);{let e=ure(jr.prototype);for(let t=0;t<e.length;t++){let r=e[t];Qr.prototype[r]||(Qr.prototype[r]=jr.prototype[r])}}function Qr(e){if(!(this instanceof Qr))return new Qr(e);T0.call(this,e),jr.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,e.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}cre(Qr.prototype,{writable:{__proto__:null,...Kn(jr.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Kn(jr.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Kn(jr.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Kn(jr.prototype,"writableBuffer")},writableLength:{__proto__:null,...Kn(jr.prototype,"writableLength")},writableFinished:{__proto__:null,...Kn(jr.prototype,"writableFinished")},writableCorked:{__proto__:null,...Kn(jr.prototype,"writableCorked")},writableEnded:{__proto__:null,...Kn(jr.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Kn(jr.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}});var E0;function MP(){return E0===void 0&&(E0={}),E0}Qr.fromWeb=function(e,t){return MP().newStreamDuplexFromReadableWritablePair(e,t)};Qr.toWeb=function(e){return MP().newReadableWritablePairFromDuplex(e)};var k0;Qr.from=function(e){return k0||(k0=qP()),k0(e,"body")}});var C0=w((PEe,zP)=>{"use strict";var{ObjectSetPrototypeOf:FP,Symbol:lre}=ft();zP.exports=Xn;var{ERR_METHOD_NOT_IMPLEMENTED:fre}=rr().codes,O0=yn(),{getHighWaterMark:dre}=Fu();FP(Xn.prototype,O0.prototype);FP(Xn,O0);var Zu=lre("kCallback");function Xn(e){if(!(this instanceof Xn))return new Xn(e);let t=e?dre(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),O0.call(this,e),this._readableState.sync=!1,this[Zu]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",pre)}function I0(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function pre(){this._final!==I0&&I0.call(this)}Xn.prototype._final=I0;Xn.prototype._transform=function(e,t,r){throw new fre("_transform()")};Xn.prototype._write=function(e,t,r){let i=this._readableState,n=this._writableState,o=i.length;this._transform(e,t,(s,a)=>{if(s){r(s);return}a!=null&&this.push(a),n.ended||o===i.length||i.length<i.highWaterMark?r():this[Zu]=r})};Xn.prototype._read=function(){if(this[Zu]){let e=this[Zu];this[Zu]=null,e()}}});var $0=w((qEe,BP)=>{"use strict";var{ObjectSetPrototypeOf:UP}=ft();BP.exports=ba;var A0=C0();UP(ba.prototype,A0.prototype);UP(ba,A0);function ba(e){if(!(this instanceof ba))return new ba(e);A0.call(this,e)}ba.prototype._transform=function(e,t,r){r(null,e)}});var th=w((jEe,GP)=>{var Gu=Ni(),{ArrayIsArray:hre,Promise:mre,SymbolAsyncIterator:gre,SymbolDispose:yre}=ft(),eh=Gn(),{once:vre}=pr(),bre=So(),WP=yn(),{aggregateTwoErrors:_re,codes:{ERR_INVALID_ARG_TYPE:F0,ERR_INVALID_RETURN_VALUE:R0,ERR_MISSING_ARGS:wre,ERR_STREAM_DESTROYED:xre,ERR_STREAM_PREMATURE_CLOSE:Sre},AbortError:Ere}=rr(),{validateFunction:kre,validateAbortSignal:Tre}=la(),{isIterable:Io,isReadable:D0,isReadableNodeStream:Qp,isNodeStream:HP,isTransformStream:_a,isWebStream:Ire,isReadableStream:N0,isReadableFinished:Ore}=hn(),Cre=globalThis.AbortController||ca().AbortController,P0,q0,j0;function VP(e,t,r){let i=!1;e.on("close",()=>{i=!0});let n=eh(e,{readable:t,writable:r},o=>{i=!o});return{destroy:o=>{i||(i=!0,bre.destroyer(e,o||new xre("pipe")))},cleanup:n}}function Are(e){return kre(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function M0(e){if(Io(e))return e;if(Qp(e))return $re(e);throw new F0("val",["Readable","Iterable","AsyncIterable"],e)}async function*$re(e){q0||(q0=Bu()),yield*q0.prototype[gre].call(e)}async function Yp(e,t,r,{end:i}){let n,o=null,s=u=>{if(u&&(n=u),o){let l=o;o=null,l()}},a=()=>new mre((u,l)=>{n?l(n):o=()=>{n?l(n):u()}});t.on("drain",s);let c=eh(t,{readable:!1},s);try{t.writableNeedDrain&&await a();for await(let u of e)t.write(u)||await a();i&&(t.end(),await a()),r()}catch(u){r(n!==u?_re(n,u):u)}finally{c(),t.off("drain",s)}}async function L0(e,t,r,{end:i}){_a(t)&&(t=t.writable);let n=t.getWriter();try{for await(let o of e)await n.ready,n.write(o).catch(()=>{});await n.ready,i&&await n.close(),r()}catch(o){try{await n.abort(o),r(o)}catch(s){r(s)}}}function Rre(...e){return ZP(e,vre(Are(e)))}function ZP(e,t,r){if(e.length===1&&hre(e[0])&&(e=e[0]),e.length<2)throw new wre("streams");let i=new Cre,n=i.signal,o=r?.signal,s=[];Tre(o,"options.signal");function a(){h(new Ere)}j0=j0||pr().addAbortListener;let c;o&&(c=j0(o,a));let u,l,f=[],p=0;function d(v){h(v,--p===0)}function h(v,g){var y;if(v&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=v),!(!u&&!g)){for(;f.length;)f.shift()(u);(y=c)===null||y===void 0||y[yre](),i.abort(),g&&(u||s.forEach(T=>T()),Gu.nextTick(t,u,l))}}let m;for(let v=0;v<e.length;v++){let g=e[v],y=v<e.length-1,T=v>0,R=y||r?.end!==!1,I=v===e.length-1;if(HP(g)){let b=function(O){O&&O.name!=="AbortError"&&O.code!=="ERR_STREAM_PREMATURE_CLOSE"&&d(O)};var S=b;if(R){let{destroy:O,cleanup:A}=VP(g,y,T);f.push(O),D0(g)&&I&&s.push(A)}g.on("error",b),D0(g)&&I&&s.push(()=>{g.removeListener("error",b)})}if(v===0)if(typeof g=="function"){if(m=g({signal:n}),!Io(m))throw new R0("Iterable, AsyncIterable or Stream","source",m)}else Io(g)||Qp(g)||_a(g)?m=g:m=WP.from(g);else if(typeof g=="function"){if(_a(m)){var _;m=M0((_=m)===null||_===void 0?void 0:_.readable)}else m=M0(m);if(m=g(m,{signal:n}),y){if(!Io(m,!0))throw new R0("AsyncIterable",`transform[${v-1}]`,m)}else{var k;P0||(P0=$0());let b=new P0({objectMode:!0}),O=(k=m)===null||k===void 0?void 0:k.then;if(typeof O=="function")p++,O.call(m,D=>{l=D,D!=null&&b.write(D),R&&b.end(),Gu.nextTick(d)},D=>{b.destroy(D),Gu.nextTick(d,D)});else if(Io(m,!0))p++,Yp(m,b,d,{end:R});else if(N0(m)||_a(m)){let D=m.readable||m;p++,Yp(D,b,d,{end:R})}else throw new R0("AsyncIterable or Promise","destination",m);m=b;let{destroy:A,cleanup:P}=VP(m,!1,!0);f.push(A),I&&s.push(P)}}else if(HP(g)){if(Qp(m)){p+=2;let b=Dre(m,g,d,{end:R});D0(g)&&I&&s.push(b)}else if(_a(m)||N0(m)){let b=m.readable||m;p++,Yp(b,g,d,{end:R})}else if(Io(m))p++,Yp(m,g,d,{end:R});else throw new F0("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],m);m=g}else if(Ire(g)){if(Qp(m))p++,L0(M0(m),g,d,{end:R});else if(N0(m)||Io(m))p++,L0(m,g,d,{end:R});else if(_a(m))p++,L0(m.readable,g,d,{end:R});else throw new F0("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],m);m=g}else m=WP.from(g)}return(n!=null&&n.aborted||o!=null&&o.aborted)&&Gu.nextTick(a),m}function Dre(e,t,r,{end:i}){let n=!1;if(t.on("close",()=>{n||r(new Sre)}),e.pipe(t,{end:!1}),i){let s=function(){n=!0,t.end()};var o=s;Ore(e)?Gu.nextTick(s):e.once("end",s)}else r();return eh(e,{readable:!0,writable:!1},s=>{let a=e._readableState;s&&s.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?e.once("end",r).once("error",r):r(s)}),eh(t,{readable:!1,writable:!0},r)}GP.exports={pipelineImpl:ZP,pipeline:Rre}});var U0=w((MEe,eq)=>{"use strict";var{pipeline:Nre}=th(),rh=yn(),{destroyer:Pre}=So(),{isNodeStream:nh,isReadable:KP,isWritable:XP,isWebStream:z0,isTransformStream:Oo,isWritableStream:JP,isReadableStream:YP}=hn(),{AbortError:qre,codes:{ERR_INVALID_ARG_VALUE:QP,ERR_MISSING_ARGS:jre}}=rr(),Mre=Gn();eq.exports=function(...t){if(t.length===0)throw new jre("streams");if(t.length===1)return rh.from(t[0]);let r=[...t];if(typeof t[0]=="function"&&(t[0]=rh.from(t[0])),typeof t[t.length-1]=="function"){let d=t.length-1;t[d]=rh.from(t[d])}for(let d=0;d<t.length;++d)if(!(!nh(t[d])&&!z0(t[d]))){if(d<t.length-1&&!(KP(t[d])||YP(t[d])||Oo(t[d])))throw new QP(`streams[${d}]`,r[d],"must be readable");if(d>0&&!(XP(t[d])||JP(t[d])||Oo(t[d])))throw new QP(`streams[${d}]`,r[d],"must be writable")}let i,n,o,s,a;function c(d){let h=s;s=null,h?h(d):d?a.destroy(d):!p&&!f&&a.destroy()}let u=t[0],l=Nre(t,c),f=!!(XP(u)||JP(u)||Oo(u)),p=!!(KP(l)||YP(l)||Oo(l));if(a=new rh({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(l!=null&&l.readableObjectMode),writable:f,readable:p}),f){if(nh(u))a._write=function(h,m,_){u.write(h,m)?_():i=_},a._final=function(h){u.end(),n=h},u.on("drain",function(){if(i){let h=i;i=null,h()}});else if(z0(u)){let m=(Oo(u)?u.writable:u).getWriter();a._write=async function(_,k,S){try{await m.ready,m.write(_).catch(()=>{}),S()}catch(v){S(v)}},a._final=async function(_){try{await m.ready,m.close().catch(()=>{}),n=_}catch(k){_(k)}}}let d=Oo(l)?l.readable:l;Mre(d,()=>{if(n){let h=n;n=null,h()}})}if(p){if(nh(l))l.on("readable",function(){if(o){let d=o;o=null,d()}}),l.on("end",function(){a.push(null)}),a._read=function(){for(;;){let d=l.read();if(d===null){o=a._read;return}if(!a.push(d))return}};else if(z0(l)){let h=(Oo(l)?l.readable:l).getReader();a._read=async function(){for(;;)try{let{value:m,done:_}=await h.read();if(!a.push(m))return;if(_){a.push(null);return}}catch{return}}}}return a._destroy=function(d,h){!d&&s!==null&&(d=new qre),o=null,i=null,n=null,s===null?h(d):(s=h,nh(l)&&Pre(l,d))},a}});var lq=w((LEe,H0)=>{"use strict";var Lre=globalThis.AbortController||ca().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Fre,ERR_INVALID_ARG_TYPE:Ku,ERR_MISSING_ARGS:zre,ERR_OUT_OF_RANGE:Ure},AbortError:vn}=rr(),{validateAbortSignal:Co,validateInteger:tq,validateObject:Ao}=la(),Bre=ft().Symbol("kWeak"),Wre=ft().Symbol("kResistStopPropagation"),{finished:Hre}=Gn(),Vre=U0(),{addAbortSignalNoValidate:Zre}=Lu(),{isWritable:Gre,isNodeStream:Kre}=hn(),{deprecate:Xre}=pr(),{ArrayPrototypePush:Jre,Boolean:Yre,MathFloor:rq,Number:Qre,NumberIsNaN:ene,Promise:nq,PromiseReject:iq,PromiseResolve:tne,PromisePrototypeThen:oq,Symbol:aq}=ft(),ih=aq("kEmpty"),sq=aq("kEof");function rne(e,t){if(t!=null&&Ao(t,"options"),t?.signal!=null&&Co(t.signal,"options.signal"),Kre(e)&&!Gre(e))throw new Fre("stream",e,"must be writable");let r=Vre(this,e);return t!=null&&t.signal&&Zre(t.signal,r),r}function oh(e,t){if(typeof e!="function")throw new Ku("fn",["Function","AsyncFunction"],e);t!=null&&Ao(t,"options"),t?.signal!=null&&Co(t.signal,"options.signal");let r=1;t?.concurrency!=null&&(r=rq(t.concurrency));let i=r-1;return t?.highWaterMark!=null&&(i=rq(t.highWaterMark)),tq(r,"options.concurrency",1),tq(i,"options.highWaterMark",0),i+=r,async function*(){let o=pr().AbortSignalAny([t?.signal].filter(Yre)),s=this,a=[],c={signal:o},u,l,f=!1,p=0;function d(){f=!0,h()}function h(){p-=1,m()}function m(){l&&!f&&p<r&&a.length<i&&(l(),l=null)}async function _(){try{for await(let k of s){if(f)return;if(o.aborted)throw new vn;try{if(k=e(k,c),k===ih)continue;k=tne(k)}catch(S){k=iq(S)}p+=1,oq(k,h,d),a.push(k),u&&(u(),u=null),!f&&(a.length>=i||p>=r)&&await new nq(S=>{l=S})}a.push(sq)}catch(k){let S=iq(k);oq(S,h,d),a.push(S)}finally{f=!0,u&&(u(),u=null)}}_();try{for(;;){for(;a.length>0;){let k=await a[0];if(k===sq)return;if(o.aborted)throw new vn;k!==ih&&(yield k),a.shift(),m()}await new nq(k=>{u=k})}}finally{f=!0,l&&(l(),l=null)}}.call(this)}function nne(e=void 0){return e!=null&&Ao(e,"options"),e?.signal!=null&&Co(e.signal,"options.signal"),async function*(){let r=0;for await(let n of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new vn({cause:e.signal.reason});yield[r++,n]}}.call(this)}async function cq(e,t=void 0){for await(let r of W0.call(this,e,t))return!0;return!1}async function ine(e,t=void 0){if(typeof e!="function")throw new Ku("fn",["Function","AsyncFunction"],e);return!await cq.call(this,async(...r)=>!await e(...r),t)}async function one(e,t){for await(let r of W0.call(this,e,t))return r}async function sne(e,t){if(typeof e!="function")throw new Ku("fn",["Function","AsyncFunction"],e);async function r(i,n){return await e(i,n),ih}for await(let i of oh.call(this,r,t));}function W0(e,t){if(typeof e!="function")throw new Ku("fn",["Function","AsyncFunction"],e);async function r(i,n){return await e(i,n)?i:ih}return oh.call(this,r,t)}var B0=class extends zre{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function ane(e,t,r){var i;if(typeof e!="function")throw new Ku("reducer",["Function","AsyncFunction"],e);r!=null&&Ao(r,"options"),r?.signal!=null&&Co(r.signal,"options.signal");let n=arguments.length>1;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted){let u=new vn(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await Hre(this.destroy(u)),u}let o=new Lre,s=o.signal;if(r!=null&&r.signal){let u={once:!0,[Bre]:this,[Wre]:!0};r.signal.addEventListener("abort",()=>o.abort(),u)}let a=!1;try{for await(let u of this){var c;if(a=!0,r!=null&&(c=r.signal)!==null&&c!==void 0&&c.aborted)throw new vn;n?t=await e(t,u,{signal:s}):(t=u,n=!0)}if(!a&&!n)throw new B0}finally{o.abort()}return t}async function cne(e){e!=null&&Ao(e,"options"),e?.signal!=null&&Co(e.signal,"options.signal");let t=[];for await(let i of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new vn(void 0,{cause:e.signal.reason});Jre(t,i)}return t}function une(e,t){let r=oh.call(this,e,t);return async function*(){for await(let n of r)yield*n}.call(this)}function uq(e){if(e=Qre(e),ene(e))return 0;if(e<0)throw new Ure("number",">= 0",e);return e}function lne(e,t=void 0){return t!=null&&Ao(t,"options"),t?.signal!=null&&Co(t.signal,"options.signal"),e=uq(e),async function*(){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new vn;for await(let o of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new vn;e--<=0&&(yield o)}}.call(this)}function fne(e,t=void 0){return t!=null&&Ao(t,"options"),t?.signal!=null&&Co(t.signal,"options.signal"),e=uq(e),async function*(){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new vn;for await(let o of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new vn;if(e-- >0&&(yield o),e<=0)return}}.call(this)}H0.exports.streamReturningOperators={asIndexedPairs:Xre(nne,"readable.asIndexedPairs will be removed in a future version."),drop:lne,filter:W0,flatMap:une,map:oh,take:fne,compose:rne};H0.exports.promiseReturningOperators={every:ine,forEach:sne,reduce:ane,toArray:cne,some:cq,find:one}});var V0=w((FEe,fq)=>{"use strict";var{ArrayPrototypePop:dne,Promise:pne}=ft(),{isIterable:hne,isNodeStream:mne,isWebStream:gne}=hn(),{pipelineImpl:yne}=th(),{finished:vne}=Gn();Z0();function bne(...e){return new pne((t,r)=>{let i,n,o=e[e.length-1];if(o&&typeof o=="object"&&!mne(o)&&!hne(o)&&!gne(o)){let s=dne(e);i=s.signal,n=s.end}yne(e,(s,a)=>{s?r(s):t(a)},{signal:i,end:n})})}fq.exports={finished:vne,pipeline:bne}});var Z0=w((zEe,_q)=>{"use strict";var{Buffer:_ne}=B("buffer"),{ObjectDefineProperty:Jn,ObjectKeys:hq,ReflectApply:mq}=ft(),{promisify:{custom:gq}}=pr(),{streamReturningOperators:dq,promiseReturningOperators:pq}=lq(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:yq}}=rr(),wne=U0(),{setDefaultHighWaterMark:xne,getDefaultHighWaterMark:Sne}=Fu(),{pipeline:vq}=th(),{destroyer:Ene}=So(),bq=Gn(),G0=V0(),Xu=hn(),lt=_q.exports=Mp().Stream;lt.isDestroyed=Xu.isDestroyed;lt.isDisturbed=Xu.isDisturbed;lt.isErrored=Xu.isErrored;lt.isReadable=Xu.isReadable;lt.isWritable=Xu.isWritable;lt.Readable=Bu();for(let e of hq(dq)){let r=function(...i){if(new.target)throw yq();return lt.Readable.from(mq(t,this,i))},t=dq[e];Jn(r,"name",{__proto__:null,value:t.name}),Jn(r,"length",{__proto__:null,value:t.length}),Jn(lt.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let e of hq(pq)){let r=function(...i){if(new.target)throw yq();return mq(t,this,i)},t=pq[e];Jn(r,"name",{__proto__:null,value:t.name}),Jn(r,"length",{__proto__:null,value:t.length}),Jn(lt.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}lt.Writable=Jp();lt.Duplex=yn();lt.Transform=C0();lt.PassThrough=$0();lt.pipeline=vq;var{addAbortSignal:kne}=Lu();lt.addAbortSignal=kne;lt.finished=bq;lt.destroy=Ene;lt.compose=wne;lt.setDefaultHighWaterMark=xne;lt.getDefaultHighWaterMark=Sne;Jn(lt,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return G0}});Jn(vq,gq,{__proto__:null,enumerable:!0,get(){return G0.pipeline}});Jn(bq,gq,{__proto__:null,enumerable:!0,get(){return G0.finished}});lt.Stream=lt;lt._isUint8Array=function(t){return t instanceof Uint8Array};lt._uint8ArrayToBuffer=function(t){return _ne.from(t.buffer,t.byteOffset,t.byteLength)}});var wq=w((UEe,Re)=>{"use strict";var Rt=B("stream");if(Rt&&process.env.READABLE_STREAM==="disable"){let e=Rt.promises;Re.exports._uint8ArrayToBuffer=Rt._uint8ArrayToBuffer,Re.exports._isUint8Array=Rt._isUint8Array,Re.exports.isDisturbed=Rt.isDisturbed,Re.exports.isErrored=Rt.isErrored,Re.exports.isReadable=Rt.isReadable,Re.exports.Readable=Rt.Readable,Re.exports.Writable=Rt.Writable,Re.exports.Duplex=Rt.Duplex,Re.exports.Transform=Rt.Transform,Re.exports.PassThrough=Rt.PassThrough,Re.exports.addAbortSignal=Rt.addAbortSignal,Re.exports.finished=Rt.finished,Re.exports.destroy=Rt.destroy,Re.exports.pipeline=Rt.pipeline,Re.exports.compose=Rt.compose,Object.defineProperty(Rt,"promises",{configurable:!0,enumerable:!0,get(){return e}}),Re.exports.Stream=Rt.Stream}else{let e=Z0(),t=V0(),r=e.Readable.destroy;Re.exports=e.Readable,Re.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,Re.exports._isUint8Array=e._isUint8Array,Re.exports.isDisturbed=e.isDisturbed,Re.exports.isErrored=e.isErrored,Re.exports.isReadable=e.isReadable,Re.exports.Readable=e.Readable,Re.exports.Writable=e.Writable,Re.exports.Duplex=e.Duplex,Re.exports.Transform=e.Transform,Re.exports.PassThrough=e.PassThrough,Re.exports.addAbortSignal=e.addAbortSignal,Re.exports.finished=e.finished,Re.exports.destroy=e.destroy,Re.exports.destroy=r,Re.exports.pipeline=e.pipeline,Re.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),Re.exports.Stream=e.Stream}Re.exports.default=Re.exports});var kq=w((BEe,Eq)=>{var Tne=pD(),sh=B("stream");(!sh.Writable||!sh.Writable.prototype.destroy)&&(sh=wq());var ah;function Ine(){let t,r,i;for(ah=[],r=0;r<256;r++){for(t=r,i=0;i<8;i++)t=t&1?3988292384^t>>>1:t=t>>>1;ah[r]=t>>>0}}function xq(e,t){ah||Ine(),e.charCodeAt&&(e=e.charCodeAt(0));let r=t.readUInt32BE()>>8&16777215,i=ah[(t.readUInt32BE()^e>>>0)&255];return(r^i)>>>0}function Sq(e,t){let r=e>>16&65535,i=e&65535,n=t>>16&65535,o=t&65535;return((r*o+i*n&65535)<<16>>>0)+i*o}function wa(){if(!(this instanceof wa))return new wa;this.key0=Buffer.allocUnsafe(4),this.key1=Buffer.allocUnsafe(4),this.key2=Buffer.allocUnsafe(4),this.key0.writeUInt32BE(305419896,0),this.key1.writeUInt32BE(591751049,0),this.key2.writeUInt32BE(878082192,0)}wa.prototype.update=function(e){this.key0.writeUInt32BE(xq(e,this.key0)),this.key1.writeUInt32BE((this.key0.readUInt32BE()&255&4294967295)+this.key1.readUInt32BE()>>>0);let t=new Tne(Sq(this.key1.readUInt32BE(),134775813)+1&4294967295),r=Buffer.alloc(8);t.copy(r,0),r.copy(this.key1,0,4,8),this.key2.writeUInt32BE(xq((this.key1.readUInt32BE()>>24&255)>>>0,this.key2))};wa.prototype.decryptByte=function(e){let t=(this.key2.readUInt32BE()|2)>>>0;return e=e^Sq(t,t^1)>>8&255,this.update(e),e};wa.prototype.stream=function(){let e=sh.Transform(),t=this;return e._transform=function(r,i,n){for(let o=0;o<r.length;o++)r[o]=t.decryptByte(r[o]);this.push(r),n()},e};Eq.exports=wa});var Oq=w((WEe,Iq)=>{var One=kq(),Cne=ep(),Tq=B("stream"),Ane=B("zlib"),$ne=rp(),Rne=np(),Dne=mu();Iq.exports=function(t,r,i,n,o){let s=Cne(),a=Tq.PassThrough(),c=t.stream(r,o);return c.pipe(s).on("error",function(u){a.emit("error",u)}),a.vars=s.pull(30).then(function(u){let l=Dne.parse(u,[["signature",4],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2]]);return l.lastModifiedDateTime=Rne(l.lastModifiedDate,l.lastModifiedTime),s.pull(l.fileNameLength).then(function(f){return l.fileName=f.toString("utf8"),s.pull(l.extraFieldLength)}).then(function(f){let p;return l.extra=$ne(f,l),n&&n.compressedSize&&(l=n),l.flags&1&&(p=s.pull(12).then(function(d){if(!i)throw new Error("MISSING_PASSWORD");let h=One();String(i).split("").forEach(function(_){h.update(_)});for(let _=0;_<d.length;_++)d[_]=h.decryptByte(d[_]);l.decrypt=h,l.compressedSize-=12;let m=l.flags&8?l.lastModifiedTime>>8&255:l.crc32>>24&255;if(d[11]!==m)throw new Error("BAD_PASSWORD");return l})),Promise.resolve(p).then(function(){return a.emit("vars",l),l})})}),a.vars.then(function(u){let l=!(u.flags&8)||u.compressedSize>0,f,p=u.compressionMethod?Ane.createInflateRaw():Tq.PassThrough();l?(a.size=u.uncompressedSize,f=u.compressedSize):(f=Buffer.alloc(4),f.writeUInt32LE(134695760,0));let d=s.stream(f);u.decrypt&&(d=d.pipe(u.decrypt.stream())),d.pipe(p).on("error",function(h){a.emit("error",h)}).pipe(a).on("finish",function(){c.destroy?c.destroy():c.abort?c.abort():c.close?c.close():c.push?c.push():console.log("warning - unable to close stream")})}).catch(function(u){a.emit("error",u)}),a}});var Mi=w((HEe,J0)=>{var K0=(function(){"use strict";return this===void 0})();K0?J0.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:K0,propertyIsWritable:function(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return!!(!r||r.writable||r.set)}}:(Cq={}.hasOwnProperty,Aq={}.toString,$q={}.constructor.prototype,X0=function(e){var t=[];for(var r in e)Cq.call(e,r)&&t.push(r);return t},Rq=function(e,t){return{value:e[t]}},Dq=function(e,t,r){return e[t]=r.value,e},Nq=function(e){return e},Pq=function(e){try{return Object(e).constructor.prototype}catch{return $q}},qq=function(e){try{return Aq.call(e)==="[object Array]"}catch{return!1}},J0.exports={isArray:qq,keys:X0,names:X0,defineProperty:Dq,getDescriptor:Rq,freeze:Nq,getPrototypeOf:Pq,isES5:K0,propertyIsWritable:function(){return!0}});var Cq,Aq,$q,X0,Rq,Dq,Nq,Pq,qq});var it=w((exports,module)=>{"use strict";var es5=Mi(),canEvaluate=typeof navigator>"u",errorObj={e:{}},tryCatchTarget,globalObject=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:exports!==void 0?exports:null;function tryCatcher(){try{var e=tryCatchTarget;return tryCatchTarget=null,e.apply(this,arguments)}catch(t){return errorObj.e=t,errorObj}}function tryCatch(e){return tryCatchTarget=e,tryCatcher}var inherits=function(e,t){var r={}.hasOwnProperty;function i(){this.constructor=e,this.constructor$=t;for(var n in t.prototype)r.call(t.prototype,n)&&n.charAt(n.length-1)!=="$"&&(this[n+"$"]=t.prototype[n])}return i.prototype=t.prototype,e.prototype=new i,e.prototype};function isPrimitive(e){return e==null||e===!0||e===!1||typeof e=="string"||typeof e=="number"}function isObject(e){return typeof e=="function"||typeof e=="object"&&e!==null}function maybeWrapAsError(e){return isPrimitive(e)?new Error(safeToString(e)):e}function withAppended(e,t){var r=e.length,i=new Array(r+1),n;for(n=0;n<r;++n)i[n]=e[n];return i[n]=t,i}function getDataPropertyOrDefault(e,t,r){if(es5.isES5){var i=Object.getOwnPropertyDescriptor(e,t);if(i!=null)return i.get==null&&i.set==null?i.value:r}else return{}.hasOwnProperty.call(e,t)?e[t]:void 0}function notEnumerableProp(e,t,r){if(isPrimitive(e))return e;var i={value:r,configurable:!0,enumerable:!1,writable:!0};return es5.defineProperty(e,t,i),e}function thrower(e){throw e}var inheritedDataKeys=(function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(n){for(var o=0;o<e.length;++o)if(e[o]===n)return!0;return!1};if(es5.isES5){var r=Object.getOwnPropertyNames;return function(n){for(var o=[],s=Object.create(null);n!=null&&!t(n);){var a;try{a=r(n)}catch{return o}for(var c=0;c<a.length;++c){var u=a[c];if(!s[u]){s[u]=!0;var l=Object.getOwnPropertyDescriptor(n,u);l!=null&&l.get==null&&l.set==null&&o.push(u)}}n=es5.getPrototypeOf(n)}return o}}else{var i={}.hasOwnProperty;return function(n){if(t(n))return[];var o=[];e:for(var s in n)if(i.call(n,s))o.push(s);else{for(var a=0;a<e.length;++a)if(i.call(e[a],s))continue e;o.push(s)}return o}}})(),thisAssignmentPattern=/this\s*\.\s*\S+\s*=/;function isClass(e){try{if(typeof e=="function"){var t=es5.names(e.prototype),r=es5.isES5&&t.length>1,i=t.length>0&&!(t.length===1&&t[0]==="constructor"),n=thisAssignmentPattern.test(e+"")&&es5.names(e).length>0;if(r||i||n)return!0}return!1}catch{return!1}}function toFastProperties(obj){function FakeConstructor(){}FakeConstructor.prototype=obj;var receiver=new FakeConstructor;function ic(){return typeof receiver.foo}return ic(),ic(),obj;eval(obj)}var rident=/^[a-z$_][a-z$_0-9]*$/i;function isIdentifier(e){return rident.test(e)}function filledRange(e,t,r){for(var i=new Array(e),n=0;n<e;++n)i[n]=t+n+r;return i}function safeToString(e){try{return e+""}catch{return"[no string representation]"}}function isError(e){return e instanceof Error||e!==null&&typeof e=="object"&&typeof e.message=="string"&&typeof e.name=="string"}function markAsOriginatingFromRejection(e){try{notEnumerableProp(e,"isOperational",!0)}catch{}}function originatesFromRejection(e){return e==null?!1:e instanceof Error.__BluebirdErrorTypes__.OperationalError||e.isOperational===!0}function canAttachTrace(e){return isError(e)&&es5.propertyIsWritable(e,"stack")}var ensureErrorObject=(function(){return"stack"in new Error?function(e){return canAttachTrace(e)?e:new Error(safeToString(e))}:function(e){if(canAttachTrace(e))return e;try{throw new Error(safeToString(e))}catch(t){return t}}})();function classString(e){return{}.toString.call(e)}function copyDescriptors(e,t,r){for(var i=es5.names(e),n=0;n<i.length;++n){var o=i[n];if(r(o))try{es5.defineProperty(t,o,es5.getDescriptor(e,o))}catch{}}}var asArray=function(e){return es5.isArray(e)?e:null};typeof Symbol<"u"&&Symbol.iterator&&(ArrayFrom=typeof Array.from=="function"?function(e){return Array.from(e)}:function(e){for(var t=[],r=e[Symbol.iterator](),i;!(i=r.next()).done;)t.push(i.value);return t},asArray=function(e){return es5.isArray(e)?e:e!=null&&typeof e[Symbol.iterator]=="function"?ArrayFrom(e):null});var ArrayFrom,isNode=typeof process<"u"&&classString(process).toLowerCase()==="[object process]",hasEnvVariables=typeof process<"u"&&typeof process.env<"u";function env(e){return hasEnvVariables?process.env[e]:void 0}function getNativePromise(){if(typeof Promise=="function")try{var e=new Promise(function(){});if(classString(e)==="[object Promise]")return Promise}catch{}}var reflectHandler;function contextBind(e,t){if(e===null||typeof t!="function"||t===reflectHandler)return t;e.domain!==null&&(t=e.domain.bind(t));var r=e.async;if(r!==null){var i=t;t=function(){for(var n=arguments.length+2,o=new Array(n),s=2;s<n;++s)o[s]=arguments[s-2];return o[0]=i,o[1]=this,r.runInAsyncScope.apply(r,o)}}return t}var ret={setReflectHandler:function(e){reflectHandler=e},isClass,isIdentifier,inheritedDataKeys,getDataPropertyOrDefault,thrower,isArray:es5.isArray,asArray,notEnumerableProp,isPrimitive,isObject,isError,canEvaluate,errorObj,tryCatch,inherits,withAppended,maybeWrapAsError,toFastProperties,filledRange,toString:safeToString,canAttachTrace,ensureErrorObject,originatesFromRejection,markAsOriginatingFromRejection,classString,copyDescriptors,isNode,hasEnvVariables,env,global:globalObject,getNativePromise,contextBind};ret.isRecentNode=ret.isNode&&(function(){var e;return process.versions&&process.versions.node?e=process.versions.node.split(".").map(Number):process.version&&(e=process.version.split(".").map(Number)),e[0]===0&&e[1]>10||e[0]>0})();ret.nodeSupportsAsyncResource=ret.isNode&&(function(){var e=!1;try{var t=B("async_hooks").AsyncResource;e=typeof t.prototype.runInAsyncScope=="function"}catch{e=!1}return e})();ret.isNode&&ret.toFastProperties(process);try{throw new Error}catch(e){ret.lastLineError=e}module.exports=ret});var zq=w((VEe,Fq)=>{"use strict";var Q0=it(),$o,Nne=function(){throw new Error(`No async scheduler available
|
|
10
10
|
|
|
11
11
|
See http://goo.gl/MqrFmX
|
|
12
|
-
`)},Y0=Q0.getNativePromise();Q0.isNode&&typeof MutationObserver>"u"?(jq=global.setImmediate,Mq=process.nextTick,$o=Q0.isRecentNode?function(e){jq.call(global,e)}:function(e){Mq.call(process,e)}):typeof Y0=="function"&&typeof Y0.resolve=="function"?(Lq=Y0.resolve(),$o=function(e){Lq.then(e)}):typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova))&&"classList"in document.documentElement?$o=(function(){var e=document.createElement("div"),t={attributes:!0},r=!1,i=document.createElement("div"),n=new MutationObserver(function(){e.classList.toggle("foo"),r=!1});n.observe(i,t);var o=function(){r||(r=!0,i.classList.toggle("foo"))};return function(a){var c=new MutationObserver(function(){c.disconnect(),a()});c.observe(e,t),o()}})():typeof setImmediate<"u"?$o=function(e){setImmediate(e)}:typeof setTimeout<"u"?$o=function(e){setTimeout(e,0)}:$o=Nne;var jq,Mq,Lq;Fq.exports=$o});var Bq=w((
|
|
12
|
+
`)},Y0=Q0.getNativePromise();Q0.isNode&&typeof MutationObserver>"u"?(jq=global.setImmediate,Mq=process.nextTick,$o=Q0.isRecentNode?function(e){jq.call(global,e)}:function(e){Mq.call(process,e)}):typeof Y0=="function"&&typeof Y0.resolve=="function"?(Lq=Y0.resolve(),$o=function(e){Lq.then(e)}):typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova))&&"classList"in document.documentElement?$o=(function(){var e=document.createElement("div"),t={attributes:!0},r=!1,i=document.createElement("div"),n=new MutationObserver(function(){e.classList.toggle("foo"),r=!1});n.observe(i,t);var o=function(){r||(r=!0,i.classList.toggle("foo"))};return function(a){var c=new MutationObserver(function(){c.disconnect(),a()});c.observe(e,t),o()}})():typeof setImmediate<"u"?$o=function(e){setImmediate(e)}:typeof setTimeout<"u"?$o=function(e){setTimeout(e,0)}:$o=Nne;var jq,Mq,Lq;Fq.exports=$o});var Bq=w((ZEe,Uq)=>{"use strict";function Pne(e,t,r,i,n){for(var o=0;o<n;++o)r[o+i]=e[o+t],e[o+t]=void 0}function Li(e){this._capacity=e,this._length=0,this._front=0}Li.prototype._willBeOverCapacity=function(e){return this._capacity<e};Li.prototype._pushOne=function(e){var t=this.length();this._checkCapacity(t+1);var r=this._front+t&this._capacity-1;this[r]=e,this._length=t+1};Li.prototype.push=function(e,t,r){var i=this.length()+3;if(this._willBeOverCapacity(i)){this._pushOne(e),this._pushOne(t),this._pushOne(r);return}var n=this._front+i-3;this._checkCapacity(i);var o=this._capacity-1;this[n+0&o]=e,this[n+1&o]=t,this[n+2&o]=r,this._length=i};Li.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};Li.prototype.length=function(){return this._length};Li.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(this._capacity<<1)};Li.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e;var r=this._front,i=this._length,n=r+i&t-1;Pne(this,0,this,t,n)};Uq.exports=Li});var Zq=w((GEe,eE)=>{"use strict";var Vq;try{throw new Error}catch(e){Vq=e}var qne=zq(),Wq=Bq();function Mr(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new Wq(16),this._normalQueue=new Wq(16),this._haveDrainedQueues=!1;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=qne}Mr.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t};Mr.prototype.hasCustomScheduler=function(){return this._customScheduler};Mr.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};Mr.prototype.fatalError=function(e,t){t?(process.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+`
|
|
13
13
|
`),process.exit(2)):this.throwLater(e)};Mr.prototype.throwLater=function(e,t){if(arguments.length===1&&(t=e,e=function(){throw t}),typeof setTimeout<"u")setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch{throw new Error(`No async scheduler available
|
|
14
14
|
|
|
15
15
|
See http://goo.gl/MqrFmX
|
|
16
|
-
`)}};function jne(e,t,r){this._lateQueue.push(e,t,r),this._queueTick()}function Mne(e,t,r){this._normalQueue.push(e,t,r),this._queueTick()}function Lne(e){this._normalQueue._pushOne(e),this._queueTick()}Mr.prototype.invokeLater=jne;Mr.prototype.invoke=Mne;Mr.prototype.settlePromises=Lne;function Hq(e){for(;e.length()>0;)Fne(e)}function Fne(e){var t=e.shift();if(typeof t!="function")t._settlePromises();else{var r=e.shift(),i=e.shift();t.call(r,i)}}Mr.prototype._drainQueues=function(){Hq(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,Hq(this._lateQueue)};Mr.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))};Mr.prototype._reset=function(){this._isTickUsed=!1};eE.exports=Mr;eE.exports.firstLineError=Vq});var Yn=w((
|
|
16
|
+
`)}};function jne(e,t,r){this._lateQueue.push(e,t,r),this._queueTick()}function Mne(e,t,r){this._normalQueue.push(e,t,r),this._queueTick()}function Lne(e){this._normalQueue._pushOne(e),this._queueTick()}Mr.prototype.invokeLater=jne;Mr.prototype.invoke=Mne;Mr.prototype.settlePromises=Lne;function Hq(e){for(;e.length()>0;)Fne(e)}function Fne(e){var t=e.shift();if(typeof t!="function")t._settlePromises();else{var r=e.shift(),i=e.shift();t.call(r,i)}}Mr.prototype._drainQueues=function(){Hq(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,Hq(this._lateQueue)};Mr.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))};Mr.prototype._reset=function(){this._isTickUsed=!1};eE.exports=Mr;eE.exports.firstLineError=Vq});var Yn=w((KEe,Xq)=>{"use strict";var nE=Mi(),zne=nE.freeze,Gq=it(),Kq=Gq.inherits,Sa=Gq.notEnumerableProp;function Ea(e,t){function r(i){if(!(this instanceof r))return new r(i);Sa(this,"message",typeof i=="string"?i:t),Sa(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return Kq(r,Error),r}var tE,rE,Une=Ea("Warning","warning"),Bne=Ea("CancellationError","cancellation error"),Wne=Ea("TimeoutError","timeout error"),Yu=Ea("AggregateError","aggregate error");try{tE=TypeError,rE=RangeError}catch{tE=Ea("TypeError","type error"),rE=Ea("RangeError","range error")}var ch="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(xa=0;xa<ch.length;++xa)typeof Array.prototype[ch[xa]]=="function"&&(Yu.prototype[ch[xa]]=Array.prototype[ch[xa]]);var xa;nE.defineProperty(Yu.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});Yu.prototype.isOperational=!0;var uh=0;Yu.prototype.toString=function(){var e=Array(uh*4+1).join(" "),t=`
|
|
17
17
|
`+e+`AggregateError of:
|
|
18
18
|
`;uh++,e=Array(uh*4+1).join(" ");for(var r=0;r<this.length;++r){for(var i=this[r]===this?"[Circular AggregateError]":this[r]+"",n=i.split(`
|
|
19
19
|
`),o=0;o<n.length;++o)n[o]=e+n[o];i=n.join(`
|
|
20
20
|
`),t+=i+`
|
|
21
|
-
`}return uh--,t};function Ju(e){if(!(this instanceof Ju))return new Ju(e);Sa(this,"name","OperationalError"),Sa(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(Sa(this,"message",e.message),Sa(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}Kq(Ju,Error);var Ro=Error.__BluebirdErrorTypes__;Ro||(Ro=zne({CancellationError:Bne,TimeoutError:Wne,OperationalError:Ju,RejectionError:Ju,AggregateError:Yu}),nE.defineProperty(Error,"__BluebirdErrorTypes__",{value:Ro,writable:!1,enumerable:!1,configurable:!1}));Xq.exports={Error,TypeError:tE,RangeError:rE,CancellationError:Ro.CancellationError,OperationalError:Ro.OperationalError,TimeoutError:Ro.TimeoutError,AggregateError:Ro.AggregateError,Warning:Une}});var Yq=w((
|
|
21
|
+
`}return uh--,t};function Ju(e){if(!(this instanceof Ju))return new Ju(e);Sa(this,"name","OperationalError"),Sa(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(Sa(this,"message",e.message),Sa(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}Kq(Ju,Error);var Ro=Error.__BluebirdErrorTypes__;Ro||(Ro=zne({CancellationError:Bne,TimeoutError:Wne,OperationalError:Ju,RejectionError:Ju,AggregateError:Yu}),nE.defineProperty(Error,"__BluebirdErrorTypes__",{value:Ro,writable:!1,enumerable:!1,configurable:!1}));Xq.exports={Error,TypeError:tE,RangeError:rE,CancellationError:Ro.CancellationError,OperationalError:Ro.OperationalError,TimeoutError:Ro.TimeoutError,AggregateError:Ro.AggregateError,Warning:Une}});var Yq=w((XEe,Jq)=>{"use strict";Jq.exports=function(e,t){var r=it(),i=r.errorObj,n=r.isObject;function o(f,p){if(n(f)){if(f instanceof e)return f;var d=a(f);if(d===i){p&&p._pushContext();var h=e.reject(d.e);return p&&p._popContext(),h}else if(typeof d=="function"){if(u(f)){var h=new e(t);return f._then(h._fulfill,h._reject,void 0,h,null),h}return l(f,d,p)}}return f}function s(f){return f.then}function a(f){try{return s(f)}catch(p){return i.e=p,i}}var c={}.hasOwnProperty;function u(f){try{return c.call(f,"_promise0")}catch{return!1}}function l(f,p,d){var h=new e(t),m=h;d&&d._pushContext(),h._captureStackTrace(),d&&d._popContext();var _=!0,k=r.tryCatch(p).call(f,S,v);_=!1,h&&k===i&&(h._rejectCallback(k.e,!0,!0),h=null);function S(g){h&&(h._resolveCallback(g),h=null)}function v(g){h&&(h._rejectCallback(g,_,!0),h=null)}return m}return o}});var ej=w((JEe,Qq)=>{"use strict";Qq.exports=function(e,t,r,i,n){var o=it(),s=o.isArray;function a(u){switch(u){case-2:return[];case-3:return{};case-6:return new Map}}function c(u){var l=this._promise=new e(t);u instanceof e&&(l._propagateFrom(u,3),u.suppressUnhandledRejections()),l._setOnCancel(this),this._values=u,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return o.inherits(c,n),c.prototype.length=function(){return this._length},c.prototype.promise=function(){return this._promise},c.prototype._init=function u(l,f){var p=r(this._values,this._promise);if(p instanceof e){p=p._target();var d=p._bitField;if(this._values=p,(d&50397184)===0)return this._promise._setAsyncGuaranteed(),p._then(u,this._reject,void 0,this,f);if((d&33554432)!==0)p=p._value();else return(d&16777216)!==0?this._reject(p._reason()):this._cancel()}if(p=o.asArray(p),p===null){var h=i("expecting an array or an iterable object but got "+o.classString(p)).reason();this._promise._rejectCallback(h,!1);return}if(p.length===0){f===-5?this._resolveEmptyArray():this._resolve(a(f));return}this._iterate(p)},c.prototype._iterate=function(u){var l=this.getActualLength(u.length);this._length=l,this._values=this.shouldCopyValues()?new Array(l):this._values;for(var f=this._promise,p=!1,d=null,h=0;h<l;++h){var m=r(u[h],f);m instanceof e?(m=m._target(),d=m._bitField):d=null,p?d!==null&&m.suppressUnhandledRejections():d!==null?(d&50397184)===0?(m._proxy(this,h),this._values[h]=m):(d&33554432)!==0?p=this._promiseFulfilled(m._value(),h):(d&16777216)!==0?p=this._promiseRejected(m._reason(),h):p=this._promiseCancelled(h):p=this._promiseFulfilled(m,h)}p||f._setAsyncGuaranteed()},c.prototype._isResolved=function(){return this._values===null},c.prototype._resolve=function(u){this._values=null,this._promise._fulfill(u)},c.prototype._cancel=function(){this._isResolved()||!this._promise._isCancellable()||(this._values=null,this._promise._cancel())},c.prototype._reject=function(u){this._values=null,this._promise._rejectCallback(u,!1)},c.prototype._promiseFulfilled=function(u,l){this._values[l]=u;var f=++this._totalResolved;return f>=this._length?(this._resolve(this._values),!0):!1},c.prototype._promiseCancelled=function(){return this._cancel(),!0},c.prototype._promiseRejected=function(u){return this._totalResolved++,this._reject(u),!0},c.prototype._resultCancelled=function(){if(!this._isResolved()){var u=this._values;if(this._cancel(),u instanceof e)u.cancel();else for(var l=0;l<u.length;++l)u[l]instanceof e&&u[l].cancel()}},c.prototype.shouldCopyValues=function(){return!0},c.prototype.getActualLength=function(u){return u},c}});var rj=w((YEe,tj)=>{"use strict";tj.exports=function(e){var t=!1,r=[];e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){};function i(){this._trace=new i.CapturedTrace(o())}i.prototype._pushContext=function(){this._trace!==void 0&&(this._trace._promiseCreated=null,r.push(this._trace))},i.prototype._popContext=function(){if(this._trace!==void 0){var s=r.pop(),a=s._promiseCreated;return s._promiseCreated=null,a}return null};function n(){if(t)return new i}function o(){var s=r.length-1;if(s>=0)return r[s]}return i.CapturedTrace=null,i.create=n,i.deactivateLongStackTraces=function(){},i.activateLongStackTraces=function(){var s=e.prototype._pushContext,a=e.prototype._popContext,c=e._peekContext,u=e.prototype._peekContext,l=e.prototype._promiseCreated;i.deactivateLongStackTraces=function(){e.prototype._pushContext=s,e.prototype._popContext=a,e._peekContext=c,e.prototype._peekContext=u,e.prototype._promiseCreated=l,t=!1},t=!0,e.prototype._pushContext=i.prototype._pushContext,e.prototype._popContext=i.prototype._popContext,e._peekContext=e.prototype._peekContext=o,e.prototype._promiseCreated=function(){var f=this._peekContext();f&&f._promiseCreated==null&&(f._promiseCreated=this)}},i}});var ij=w((QEe,nj)=>{"use strict";nj.exports=function(e,t,r,i){var n=e._async,o=Yn().Warning,s=it(),a=Mi(),c=s.canAttachTrace,u,l,f=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,p=/\((?:timers\.js):\d+:\d+\)/,d=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,h=null,m=null,_=!1,k,S=!!(s.env("BLUEBIRD_DEBUG")!=0&&(s.env("BLUEBIRD_DEBUG")||s.env("NODE_ENV")==="development")),v=!!(s.env("BLUEBIRD_WARNINGS")!=0&&(S||s.env("BLUEBIRD_WARNINGS"))),g=!!(s.env("BLUEBIRD_LONG_STACK_TRACES")!=0&&(S||s.env("BLUEBIRD_LONG_STACK_TRACES"))),y=s.env("BLUEBIRD_W_FORGOTTEN_RETURN")!=0&&(v||!!s.env("BLUEBIRD_W_FORGOTTEN_RETURN")),T;(function(){var M=[];function L(){for(var ee=0;ee<M.length;++ee)M[ee]._notifyUnhandledRejection();K()}function K(){M.length=0}T=function(ee){M.push(ee),setTimeout(L,1)},a.defineProperty(e,"_unhandledRejectionCheck",{value:L}),a.defineProperty(e,"_unhandledRejectionClear",{value:K})})(),e.prototype.suppressUnhandledRejections=function(){var M=this._target();M._bitField=M._bitField&-1048577|524288},e.prototype._ensurePossibleRejectionHandled=function(){(this._bitField&524288)===0&&(this._setRejectionIsUnhandled(),T(this))},e.prototype._notifyUnhandledRejectionIsHandled=function(){be("rejectionHandled",u,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=this._bitField|268435456},e.prototype._returnedNonUndefined=function(){return(this._bitField&268435456)!==0},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var M=this._settledValue();this._setUnhandledRejectionIsNotified(),be("unhandledRejection",l,M,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=this._bitField|262144},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&-262145},e.prototype._isUnhandledRejectionNotified=function(){return(this._bitField&262144)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=this._bitField|1048576},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(this._bitField&1048576)>0},e.prototype._warn=function(M,L,K){return le(M,L,K||this)},e.onPossiblyUnhandledRejection=function(M){var L=e._getContext();l=s.contextBind(L,M)},e.onUnhandledRejectionHandled=function(M){var L=e._getContext();u=s.contextBind(L,M)};var R=function(){};e.longStackTraces=function(){if(n.haveItemsQueued()&&!_e.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created
|
|
22
22
|
|
|
23
23
|
See http://goo.gl/MqrFmX
|
|
24
24
|
`);if(!_e.longStackTraces&&rt()){var M=e.prototype._captureStackTrace,L=e.prototype._attachExtraTrace,K=e.prototype._dereferenceTrace;_e.longStackTraces=!0,R=function(){if(n.haveItemsQueued()&&!_e.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created
|
|
@@ -40,13 +40,13 @@ GFS4: `),console.error(e)});ht[Xt]||(E1=global[Xt]||[],T1(ht,E1),ht.close=(funct
|
|
|
40
40
|
`),me=-1,Te=-1,Ne,ge,Je=0;Je<K.length;++Je){var st=et(K[Je]);if(st){Ne=st.fileName,me=st.line;break}}for(var Je=0;Je<ee.length;++Je){var st=et(ee[Je]);if(st){ge=st.fileName,Te=st.line;break}}me<0||Te<0||!Ne||!ge||Ne!==ge||me>=Te||(Et=function(jt){if(f.test(jt))return!0;var Vt=et(jt);return!!(Vt&&Vt.fileName===Ne&&me<=Vt.line&&Vt.line<=Te)})}}function kt(M){this._parent=M,this._promisesCreated=0;var L=this._length=1+(M===void 0?0:M._length);nt(this,kt),L>32&&this.uncycle()}s.inherits(kt,Error),t.CapturedTrace=kt,kt.prototype.uncycle=function(){var M=this._length;if(!(M<2)){for(var L=[],K={},ee=0,me=this;me!==void 0;++ee)L.push(me),me=me._parent;M=this._length=ee;for(var ee=M-1;ee>=0;--ee){var Te=L[ee].stack;K[Te]===void 0&&(K[Te]=ee)}for(var ee=0;ee<M;++ee){var Ne=L[ee].stack,ge=K[Ne];if(ge!==void 0&&ge!==ee){ge>0&&(L[ge-1]._parent=void 0,L[ge-1]._length=1),L[ee]._parent=void 0,L[ee]._length=1;var Je=ee>0?L[ee-1]:this;ge<M-1?(Je._parent=L[ge+1],Je._parent.uncycle(),Je._length=Je._parent._length+1):(Je._parent=void 0,Je._length=1);for(var st=Je._length+1,jt=ee-2;jt>=0;--jt)L[jt]._length=st,st++;return}}}},kt.prototype.attachExtraTrace=function(M){if(!M.__stackCleaned__){this.uncycle();for(var L=C(M),K=L.message,ee=[L.stack],me=this;me!==void 0;)ee.push(x(me.stack.split(`
|
|
41
41
|
`))),me=me._parent;E(ee),We(ee),s.notEnumerableProp(M,"stack",Oe(K,ee)),s.notEnumerableProp(M,"__stackCleaned__",!0)}};var nt=(function(){var L=/^\s*at\s*/,K=function(Ne,ge){return typeof Ne=="string"?Ne:ge.name!==void 0&&ge.message!==void 0?ge.toString():ne(ge)};if(typeof Error.stackTraceLimit=="number"&&typeof Error.captureStackTrace=="function"){Error.stackTraceLimit+=6,h=L,m=K;var ee=Error.captureStackTrace;return Et=function(Ne){return f.test(Ne)},function(Ne,ge){Error.stackTraceLimit+=6,ee(Ne,ge),Error.stackTraceLimit-=6}}var me=new Error;if(typeof me.stack=="string"&&me.stack.split(`
|
|
42
42
|
`)[0].indexOf("stackDetection@")>=0)return h=/@/,m=K,_=!0,function(ge){ge.stack=new Error().stack};var Te;try{throw new Error}catch(Ne){Te="stack"in Ne}return!("stack"in me)&&Te&&typeof Error.stackTraceLimit=="number"?(h=L,m=K,function(ge){Error.stackTraceLimit+=6;try{throw new Error}catch(Je){ge.stack=Je.stack}Error.stackTraceLimit-=6}):(m=function(Ne,ge){return typeof Ne=="string"?Ne:(typeof ge=="object"||typeof ge=="function")&&ge.name!==void 0&&ge.message!==void 0?ge.toString():ne(ge)},null)})([]);typeof console<"u"&&typeof console.warn<"u"&&(k=function(M){console.warn(M)},s.isNode&&process.stderr.isTTY?k=function(M,L){var K=L?"\x1B[33m":"\x1B[31m";console.warn(K+M+`\x1B[0m
|
|
43
|
-
`)}:!s.isNode&&typeof new Error().stack=="string"&&(k=function(M,L){console.warn("%c"+M,L?"color: darkorange":"color: red")}));var _e={warnings:v,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return g&&e.longStackTraces(),{asyncHooks:function(){return _e.asyncHooks},longStackTraces:function(){return _e.longStackTraces},warnings:function(){return _e.warnings},cancellation:function(){return _e.cancellation},monitoring:function(){return _e.monitoring},propagateFromFunction:function(){return X},boundValueFunction:function(){return N},checkForgottenReturns:q,setBounds:Ht,warn:le,deprecated:de,CapturedTrace:kt,fireDomEvent:b,fireGlobalEvent:O}}});var iE=w((
|
|
43
|
+
`)}:!s.isNode&&typeof new Error().stack=="string"&&(k=function(M,L){console.warn("%c"+M,L?"color: darkorange":"color: red")}));var _e={warnings:v,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return g&&e.longStackTraces(),{asyncHooks:function(){return _e.asyncHooks},longStackTraces:function(){return _e.longStackTraces},warnings:function(){return _e.warnings},cancellation:function(){return _e.cancellation},monitoring:function(){return _e.monitoring},propagateFromFunction:function(){return X},boundValueFunction:function(){return N},checkForgottenReturns:q,setBounds:Ht,warn:le,deprecated:de,CapturedTrace:kt,fireDomEvent:b,fireGlobalEvent:O}}});var iE=w((eke,oj)=>{"use strict";oj.exports=function(e){var t=it(),r=Mi().keys,i=t.tryCatch,n=t.errorObj;function o(s,a,c){return function(u){var l=c._boundValue();e:for(var f=0;f<s.length;++f){var p=s[f];if(p===Error||p!=null&&p.prototype instanceof Error){if(u instanceof p)return i(a).call(l,u)}else if(typeof p=="function"){var d=i(p).call(l,u);if(d===n)return d;if(d)return i(a).call(l,u)}else if(t.isObject(u)){for(var h=r(p),m=0;m<h.length;++m){var _=h[m];if(p[_]!=u[_])continue e}return i(a).call(l,u)}}return e}}return o}});var aj=w((tke,sj)=>{"use strict";sj.exports=function(e,t,r){var i=it(),n=e.CancellationError,o=i.errorObj,s=iE()(r);function a(d,h,m){this.promise=d,this.type=h,this.handler=m,this.called=!1,this.cancelPromise=null}a.prototype.isFinallyHandler=function(){return this.type===0};function c(d){this.finallyHandler=d}c.prototype._resultCancelled=function(){u(this.finallyHandler)};function u(d,h){return d.cancelPromise!=null?(arguments.length>1?d.cancelPromise._reject(h):d.cancelPromise._cancel(),d.cancelPromise=null,!0):!1}function l(){return p.call(this,this.promise._target()._settledValue())}function f(d){if(!u(this,d))return o.e=d,o}function p(d){var h=this.promise,m=this.handler;if(!this.called){this.called=!0;var _=this.isFinallyHandler()?m.call(h._boundValue()):m.call(h._boundValue(),d);if(_===r)return _;if(_!==void 0){h._setReturnedNonUndefined();var k=t(_,h);if(k instanceof e){if(this.cancelPromise!=null)if(k._isCancelled()){var S=new n("late cancellation observer");return h._attachExtraTrace(S),o.e=S,o}else k.isPending()&&k._attachCancellationCallback(new c(this));return k._then(l,f,void 0,this,void 0)}}}return h.isRejected()?(u(this),o.e=d,o):(u(this),d)}return e.prototype._passThrough=function(d,h,m,_){return typeof d!="function"?this.then():this._then(m,_,void 0,new a(this,h,d),void 0)},e.prototype.lastly=e.prototype.finally=function(d){return this._passThrough(d,0,p,p)},e.prototype.tap=function(d){return this._passThrough(d,1,p)},e.prototype.tapCatch=function(d){var h=arguments.length;if(h===1)return this._passThrough(d,1,void 0,p);var m=new Array(h-1),_=0,k;for(k=0;k<h-1;++k){var S=arguments[k];if(i.isObject(S))m[_++]=S;else return e.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+i.classString(S)))}m.length=_;var v=arguments[k];return this._passThrough(s(m,v,this),1,void 0,p)},a}});var oE=w((rke,lj)=>{"use strict";var cj=it(),Hne=cj.maybeWrapAsError,Vne=Yn(),Zne=Vne.OperationalError,uj=Mi();function Gne(e){return e instanceof Error&&uj.getPrototypeOf(e)===Error.prototype}var Kne=/^(?:name|message|stack|cause)$/;function Xne(e){var t;if(Gne(e)){t=new Zne(e),t.name=e.name,t.message=e.message,t.stack=e.stack;for(var r=uj.keys(e),i=0;i<r.length;++i){var n=r[i];Kne.test(n)||(t[n]=e[n])}return t}return cj.markAsOriginatingFromRejection(e),e}function Jne(e,t){return function(r,i){if(e!==null){if(r){var n=Xne(Hne(r));e._attachExtraTrace(n),e._reject(n)}else if(!t)e._fulfill(i);else{for(var o=arguments.length,s=new Array(Math.max(o-1,0)),a=1;a<o;++a)s[a-1]=arguments[a];e._fulfill(s)}e=null}}}lj.exports=Jne});var dj=w((nke,fj)=>{"use strict";fj.exports=function(e,t,r,i,n){var o=it(),s=o.tryCatch;e.method=function(a){if(typeof a!="function")throw new e.TypeError("expecting a function but got "+o.classString(a));return function(){var c=new e(t);c._captureStackTrace(),c._pushContext();var u=s(a).apply(this,arguments),l=c._popContext();return n.checkForgottenReturns(u,l,"Promise.method",c),c._resolveFromSyncValue(u),c}},e.attempt=e.try=function(a){if(typeof a!="function")return i("expecting a function but got "+o.classString(a));var c=new e(t);c._captureStackTrace(),c._pushContext();var u;if(arguments.length>1){n.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],f=arguments[2];u=o.isArray(l)?s(a).apply(f,l):s(a).call(f,l)}else u=s(a)();var p=c._popContext();return n.checkForgottenReturns(u,p,"Promise.try",c),c._resolveFromSyncValue(u),c},e.prototype._resolveFromSyncValue=function(a){a===o.errorObj?this._rejectCallback(a.e,!1):this._resolveCallback(a,!0)}}});var hj=w((ike,pj)=>{"use strict";pj.exports=function(e,t,r,i){var n=!1,o=function(u,l){this._reject(l)},s=function(u,l){l.promiseRejectionQueued=!0,l.bindingPromise._then(o,o,null,this,u)},a=function(u,l){(this._bitField&50397184)===0&&this._resolveCallback(l.target)},c=function(u,l){l.promiseRejectionQueued||this._reject(u)};e.prototype.bind=function(u){n||(n=!0,e.prototype._propagateFrom=i.propagateFromFunction(),e.prototype._boundValue=i.boundValueFunction());var l=r(u),f=new e(t);f._propagateFrom(this,1);var p=this._target();if(f._setBoundTo(l),l instanceof e){var d={promiseRejectionQueued:!1,promise:f,target:p,bindingPromise:l};p._then(t,s,void 0,f,d),l._then(a,c,void 0,f,d),f._setOnCancel(l)}else f._resolveCallback(p);return f},e.prototype._setBoundTo=function(u){u!==void 0?(this._bitField=this._bitField|2097152,this._boundTo=u):this._bitField=this._bitField&-2097153},e.prototype._isBound=function(){return(this._bitField&2097152)===2097152},e.bind=function(u,l){return e.resolve(l).bind(u)}}});var gj=w((oke,mj)=>{"use strict";mj.exports=function(e,t,r,i){var n=it(),o=n.tryCatch,s=n.errorObj,a=e._async;e.prototype.break=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var c=this,u=c;c._isCancellable();){if(!c._cancelBy(u)){u._isFollowing()?u._followee().cancel():u._cancelBranched();break}var l=c._cancellationParent;if(l==null||!l._isCancellable()){c._isFollowing()?c._followee().cancel():c._cancelBranched();break}else c._isFollowing()&&c._followee().cancel(),c._setWillBeCancelled(),u=c,c=l}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return this._branchesRemainingToCancel===void 0||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(c){return c===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),a.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(c,u){if(n.isArray(c))for(var l=0;l<c.length;++l)this._doInvokeOnCancel(c[l],u);else if(c!==void 0)if(typeof c=="function"){if(!u){var f=o(c).call(this._boundValue());f===s&&(this._attachExtraTrace(f.e),a.throwLater(f.e))}}else c._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var c=this._onCancel();this._unsetOnCancel(),a.invoke(this._doInvokeOnCancel,this,c)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}});var vj=w((ske,yj)=>{"use strict";yj.exports=function(e){function t(){return this.value}function r(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(i){return i instanceof e&&i.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:i},void 0)},e.prototype.throw=e.prototype.thenThrow=function(i){return this._then(r,void 0,void 0,{reason:i},void 0)},e.prototype.catchThrow=function(i){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:i},void 0);var n=arguments[1],o=function(){throw n};return this.caught(i,o)},e.prototype.catchReturn=function(i){if(arguments.length<=1)return i instanceof e&&i.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:i},void 0);var n=arguments[1];n instanceof e&&n.suppressUnhandledRejections();var o=function(){return n};return this.caught(i,o)}}});var _j=w((ake,bj)=>{"use strict";bj.exports=function(e){function t(c){c!==void 0?(c=c._target(),this._bitField=c._bitField,this._settledValueField=c._isFateSealed()?c._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var r=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError(`cannot get fulfillment value of a non-fulfilled promise
|
|
44
44
|
|
|
45
45
|
See http://goo.gl/MqrFmX
|
|
46
46
|
`);return this._settledValue()},i=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError(`cannot get rejection reason of a non-rejected promise
|
|
47
47
|
|
|
48
48
|
See http://goo.gl/MqrFmX
|
|
49
|
-
`);return this._settledValue()},n=t.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},o=t.prototype.isRejected=function(){return(this._bitField&16777216)!==0},s=t.prototype.isPending=function(){return(this._bitField&50397184)===0},a=t.prototype.isResolved=function(){return(this._bitField&50331648)!==0};t.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},e.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},e.prototype.isPending=function(){return s.call(this._target())},e.prototype.isRejected=function(){return o.call(this._target())},e.prototype.isFulfilled=function(){return n.call(this._target())},e.prototype.isResolved=function(){return a.call(this._target())},e.prototype.value=function(){return r.call(this._target())},e.prototype.reason=function(){var c=this._target();return c._unsetRejectionIsUnhandled(),i.call(c)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}});var xj=w((
|
|
49
|
+
`);return this._settledValue()},n=t.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},o=t.prototype.isRejected=function(){return(this._bitField&16777216)!==0},s=t.prototype.isPending=function(){return(this._bitField&50397184)===0},a=t.prototype.isResolved=function(){return(this._bitField&50331648)!==0};t.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},e.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},e.prototype.isPending=function(){return s.call(this._target())},e.prototype.isRejected=function(){return o.call(this._target())},e.prototype.isFulfilled=function(){return n.call(this._target())},e.prototype.isResolved=function(){return a.call(this._target())},e.prototype.value=function(){return r.call(this._target())},e.prototype.reason=function(){var c=this._target();return c._unsetRejectionIsUnhandled(),i.call(c)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}});var xj=w((cke,wj)=>{"use strict";wj.exports=function(e,t,r,i,n){var o=it(),s=o.canEvaluate,a=o.tryCatch,c=o.errorObj,u;if(s){for(var l=function(k){return new Function("value","holder",`
|
|
50
50
|
'use strict';
|
|
51
51
|
holder.pIndex = value;
|
|
52
52
|
holder.checkFulfillment(this);
|
|
@@ -98,7 +98,7 @@ GFS4: `),console.error(e)});ht[Xt]||(E1=global[Xt]||[],T1(ht,E1),ht.close=(funct
|
|
|
98
98
|
|
|
99
99
|
return [TheName];
|
|
100
100
|
}(tryCatch, errorObj, Promise, async);
|
|
101
|
-
`;return I=I.replace(/\[TheName\]/g,R).replace(/\[TheTotal\]/g,k).replace(/\[ThePassedArguments\]/g,T).replace(/\[TheProperties\]/g,g).replace(/\[CancellationCode\]/g,y),new Function("tryCatch","errorObj","Promise","async",I)(a,c,e,n)},d=[],h=[],m=[],_=0;_<8;++_)d.push(p(_+1)),h.push(l(_+1)),m.push(f(_+1));u=function(k){this._reject(k)}}e.join=function(){var k=arguments.length-1,S;if(k>0&&typeof arguments[k]=="function"&&(S=arguments[k],k<=8&&s)){var D=new e(i);D._captureStackTrace();for(var v=d[k-1],g=new v(S),y=h,T=0;T<k;++T){var R=r(arguments[T],D);if(R instanceof e){R=R._target();var I=R._bitField;(I&50397184)===0?(R._then(y[T],u,void 0,D,g),m[T](R,g),g.asyncNeeded=!1):(I&33554432)!==0?y[T].call(D,R._value(),g):(I&16777216)!==0?D._reject(R._reason()):D._cancel()}else y[T].call(D,R,g)}if(!D._isFateSealed()){if(g.asyncNeeded){var b=e._getContext();g.fn=o.contextBind(b,g.fn)}D._setAsyncGuaranteed(),D._setOnCancel(g)}return D}for(var O=arguments.length,A=new Array(O),P=0;P<O;++P)A[P]=arguments[P];S&&A.pop();var D=new t(A).promise();return S!==void 0?D.spread(S):D}}});var Ej=w((
|
|
101
|
+
`;return I=I.replace(/\[TheName\]/g,R).replace(/\[TheTotal\]/g,k).replace(/\[ThePassedArguments\]/g,T).replace(/\[TheProperties\]/g,g).replace(/\[CancellationCode\]/g,y),new Function("tryCatch","errorObj","Promise","async",I)(a,c,e,n)},d=[],h=[],m=[],_=0;_<8;++_)d.push(p(_+1)),h.push(l(_+1)),m.push(f(_+1));u=function(k){this._reject(k)}}e.join=function(){var k=arguments.length-1,S;if(k>0&&typeof arguments[k]=="function"&&(S=arguments[k],k<=8&&s)){var D=new e(i);D._captureStackTrace();for(var v=d[k-1],g=new v(S),y=h,T=0;T<k;++T){var R=r(arguments[T],D);if(R instanceof e){R=R._target();var I=R._bitField;(I&50397184)===0?(R._then(y[T],u,void 0,D,g),m[T](R,g),g.asyncNeeded=!1):(I&33554432)!==0?y[T].call(D,R._value(),g):(I&16777216)!==0?D._reject(R._reason()):D._cancel()}else y[T].call(D,R,g)}if(!D._isFateSealed()){if(g.asyncNeeded){var b=e._getContext();g.fn=o.contextBind(b,g.fn)}D._setAsyncGuaranteed(),D._setOnCancel(g)}return D}for(var O=arguments.length,A=new Array(O),P=0;P<O;++P)A[P]=arguments[P];S&&A.pop();var D=new t(A).promise();return S!==void 0?D.spread(S):D}}});var Ej=w((uke,Sj)=>{"use strict";var sE=Object.create;sE&&(aE=sE(null),cE=sE(null),aE[" size"]=cE[" size"]=0);var aE,cE;Sj.exports=function(e){var t=it(),r=t.canEvaluate,i=t.isIdentifier,n,o,s=function(d){return new Function("ensureMethod",`
|
|
102
102
|
return function(obj) {
|
|
103
103
|
'use strict'
|
|
104
104
|
var len = this.length;
|
|
@@ -115,7 +115,7 @@ GFS4: `),console.error(e)});ht[Xt]||(E1=global[Xt]||[],T1(ht,E1),ht.close=(funct
|
|
|
115
115
|
`.replace(/methodName/g,d))(u)},a=function(d){return new Function("obj",`
|
|
116
116
|
'use strict';
|
|
117
117
|
return obj.propertyName;
|
|
118
|
-
`.replace("propertyName",d))},c=function(d,h,m){var _=m[d];if(typeof _!="function"){if(!i(d))return null;if(_=h(d),m[d]=_,m[" size"]++,m[" size"]>512){for(var k=Object.keys(m),S=0;S<256;++S)delete m[k[S]];m[" size"]=k.length-256}}return _};n=function(d){return c(d,s,aE)},o=function(d){return c(d,a,cE)};function u(d,h){var m;if(d!=null&&(m=d[h]),typeof m!="function"){var _="Object "+t.classString(d)+" has no method '"+t.toString(h)+"'";throw new e.TypeError(_)}return m}function l(d){var h=this.pop(),m=u(d,h);return m.apply(d,this)}e.prototype.call=function(d){for(var h=arguments.length,m=new Array(Math.max(h-1,0)),_=1;_<h;++_)m[_-1]=arguments[_];if(r){var k=n(d);if(k!==null)return this._then(k,void 0,void 0,m,void 0)}return m.push(d),this._then(l,void 0,void 0,m,void 0)};function f(d){return d[this]}function p(d){var h=+this;return h<0&&(h=Math.max(0,h+d.length)),d[h]}e.prototype.get=function(d){var h=typeof d=="number",m;if(h)m=p;else if(r){var _=o(d);m=_!==null?_:f}else m=f;return this._then(m,void 0,void 0,d,void 0)}}});var Tj=w((
|
|
118
|
+
`.replace("propertyName",d))},c=function(d,h,m){var _=m[d];if(typeof _!="function"){if(!i(d))return null;if(_=h(d),m[d]=_,m[" size"]++,m[" size"]>512){for(var k=Object.keys(m),S=0;S<256;++S)delete m[k[S]];m[" size"]=k.length-256}}return _};n=function(d){return c(d,s,aE)},o=function(d){return c(d,a,cE)};function u(d,h){var m;if(d!=null&&(m=d[h]),typeof m!="function"){var _="Object "+t.classString(d)+" has no method '"+t.toString(h)+"'";throw new e.TypeError(_)}return m}function l(d){var h=this.pop(),m=u(d,h);return m.apply(d,this)}e.prototype.call=function(d){for(var h=arguments.length,m=new Array(Math.max(h-1,0)),_=1;_<h;++_)m[_-1]=arguments[_];if(r){var k=n(d);if(k!==null)return this._then(k,void 0,void 0,m,void 0)}return m.push(d),this._then(l,void 0,void 0,m,void 0)};function f(d){return d[this]}function p(d){var h=+this;return h<0&&(h=Math.max(0,h+d.length)),d[h]}e.prototype.get=function(d){var h=typeof d=="number",m;if(h)m=p;else if(r){var _=o(d);m=_!==null?_:f}else m=f;return this._then(m,void 0,void 0,d,void 0)}}});var Tj=w((lke,kj)=>{"use strict";kj.exports=function(e,t,r,i,n,o){var s=Yn(),a=s.TypeError,c=it(),u=c.errorObj,l=c.tryCatch,f=[];function p(h,m,_){for(var k=0;k<m.length;++k){_._pushContext();var S=l(m[k])(h);if(_._popContext(),S===u){_._pushContext();var v=e.reject(u.e);return _._popContext(),v}var g=i(S,_);if(g instanceof e)return g}return null}function d(h,m,_,k){if(o.cancellation()){var S=new e(r),v=this._finallyPromise=new e(r);this._promise=S.lastly(function(){return v}),S._captureStackTrace(),S._setOnCancel(this)}else{var g=this._promise=new e(r);g._captureStackTrace()}this._stack=k,this._generatorFunction=h,this._receiver=m,this._generator=void 0,this._yieldHandlers=typeof _=="function"?[_].concat(f):f,this._yieldedPromise=null,this._cancellationPhase=!1}c.inherits(d,n),d.prototype._isResolved=function(){return this._promise===null},d.prototype._cleanup=function(){this._promise=this._generator=null,o.cancellation()&&this._finallyPromise!==null&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},d.prototype._promiseCancelled=function(){if(!this._isResolved()){var h=typeof this._generator.return<"u",m;if(h)this._promise._pushContext(),m=l(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var _=new e.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=_,this._promise._attachExtraTrace(_),this._promise._pushContext(),m=l(this._generator.throw).call(this._generator,_),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(m)}},d.prototype._promiseFulfilled=function(h){this._yieldedPromise=null,this._promise._pushContext();var m=l(this._generator.next).call(this._generator,h);this._promise._popContext(),this._continue(m)},d.prototype._promiseRejected=function(h){this._yieldedPromise=null,this._promise._attachExtraTrace(h),this._promise._pushContext();var m=l(this._generator.throw).call(this._generator,h);this._promise._popContext(),this._continue(m)},d.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var h=this._yieldedPromise;this._yieldedPromise=null,h.cancel()}},d.prototype.promise=function(){return this._promise},d.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},d.prototype._continue=function(h){var m=this._promise;if(h===u)return this._cleanup(),this._cancellationPhase?m.cancel():m._rejectCallback(h.e,!1);var _=h.value;if(h.done===!0)return this._cleanup(),this._cancellationPhase?m.cancel():m._resolveCallback(_);var k=i(_,this._promise);if(!(k instanceof e)&&(k=p(k,this._yieldHandlers,this._promise),k===null)){this._promiseRejected(new a(`A value %s was yielded that could not be treated as a promise
|
|
119
119
|
|
|
120
120
|
See http://goo.gl/MqrFmX
|
|
121
121
|
|
|
@@ -128,7 +128,7 @@ GFS4: `),console.error(e)});ht[Xt]||(E1=global[Xt]||[],T1(ht,E1),ht.close=(funct
|
|
|
128
128
|
`);var _=Object(m).yieldHandler,k=d,S=new Error().stack;return function(){var v=h.apply(this,arguments),g=new k(void 0,void 0,_,S),y=g.promise();return g._generator=v,g._promiseFulfilled(void 0),y}},e.coroutine.addYieldHandler=function(h){if(typeof h!="function")throw new a("expecting a function but got "+c.classString(h));f.push(h)},e.spawn=function(h){if(o.deprecated("Promise.spawn()","Promise.coroutine()"),typeof h!="function")return t(`generatorFunction must be a function
|
|
129
129
|
|
|
130
130
|
See http://goo.gl/MqrFmX
|
|
131
|
-
`);var m=new d(h,this),_=m.promise();return m._run(e.spawn),_}}});var Oj=w((
|
|
131
|
+
`);var m=new d(h,this),_=m.promise();return m._run(e.spawn),_}}});var Oj=w((fke,Ij)=>{"use strict";Ij.exports=function(e,t,r,i,n,o){var s=it(),a=s.tryCatch,c=s.errorObj,u=e._async;function l(p,d,h,m){this.constructor$(p),this._promise._captureStackTrace();var _=e._getContext();if(this._callback=s.contextBind(_,d),this._preservedValues=m===n?new Array(this.length()):null,this._limit=h,this._inFlight=0,this._queue=[],u.invoke(this._asyncInit,this,void 0),s.isArray(p))for(var k=0;k<p.length;++k){var S=p[k];S instanceof e&&S.suppressUnhandledRejections()}}s.inherits(l,t),l.prototype._asyncInit=function(){this._init$(void 0,-2)},l.prototype._init=function(){},l.prototype._promiseFulfilled=function(p,d){var h=this._values,m=this.length(),_=this._preservedValues,k=this._limit;if(d<0){if(d=d*-1-1,h[d]=p,k>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(k>=1&&this._inFlight>=k)return h[d]=p,this._queue.push(d),!1;_!==null&&(_[d]=p);var S=this._promise,v=this._callback,g=S._boundValue();S._pushContext();var y=a(v).call(g,p,d,m),T=S._popContext();if(o.checkForgottenReturns(y,T,_!==null?"Promise.filter":"Promise.map",S),y===c)return this._reject(y.e),!0;var R=i(y,this._promise);if(R instanceof e){R=R._target();var I=R._bitField;if((I&50397184)===0)return k>=1&&this._inFlight++,h[d]=R,R._proxy(this,(d+1)*-1),!1;if((I&33554432)!==0)y=R._value();else return(I&16777216)!==0?(this._reject(R._reason()),!0):(this._cancel(),!0)}h[d]=y}var b=++this._totalResolved;return b>=m?(_!==null?this._filter(h,_):this._resolve(h),!0):!1},l.prototype._drainQueue=function(){for(var p=this._queue,d=this._limit,h=this._values;p.length>0&&this._inFlight<d;){if(this._isResolved())return;var m=p.pop();this._promiseFulfilled(h[m],m)}},l.prototype._filter=function(p,d){for(var h=d.length,m=new Array(h),_=0,k=0;k<h;++k)p[k]&&(m[_++]=d[k]);m.length=_,this._resolve(m)},l.prototype.preservedValues=function(){return this._preservedValues};function f(p,d,h,m){if(typeof d!="function")return r("expecting a function but got "+s.classString(d));var _=0;if(h!==void 0)if(typeof h=="object"&&h!==null){if(typeof h.concurrency!="number")return e.reject(new TypeError("'concurrency' must be a number but it is "+s.classString(h.concurrency)));_=h.concurrency}else return e.reject(new TypeError("options argument must be an object but it is "+s.classString(h)));return _=typeof _=="number"&&isFinite(_)&&_>=1?_:0,new l(p,d,_,m).promise()}e.prototype.map=function(p,d){return f(this,p,d,null)},e.map=function(p,d,h,m){return f(p,d,h,m)}}});var Aj=w((dke,Cj)=>{"use strict";Cj.exports=function(e){var t=it(),r=e._async,i=t.tryCatch,n=t.errorObj;function o(c,u){var l=this;if(!t.isArray(c))return s.call(l,c,u);var f=i(u).apply(l._boundValue(),[null].concat(c));f===n&&r.throwLater(f.e)}function s(c,u){var l=this,f=l._boundValue(),p=c===void 0?i(u).call(f,null):i(u).call(f,null,c);p===n&&r.throwLater(p.e)}function a(c,u){var l=this;if(!c){var f=new Error(c+"");f.cause=c,c=f}var p=i(u).call(l._boundValue(),c);p===n&&r.throwLater(p.e)}e.prototype.asCallback=e.prototype.nodeify=function(c,u){if(typeof c=="function"){var l=s;u!==void 0&&Object(u).spread&&(l=o),this._then(l,a,void 0,this,c)}return this}}});var Rj=w((pke,$j)=>{"use strict";$j.exports=function(e,t){var r={},i=it(),n=oE(),o=i.withAppended,s=i.maybeWrapAsError,a=i.canEvaluate,c=Yn().TypeError,u="Async",l={__isPromisified__:!0},f=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],p=new RegExp("^(?:"+f.join("|")+")$"),d=function(D){return i.isIdentifier(D)&&D.charAt(0)!=="_"&&D!=="constructor"};function h(D){return!p.test(D)}function m(D){try{return D.__isPromisified__===!0}catch{return!1}}function _(D,V,$){var U=i.getDataPropertyOrDefault(D,V+$,l);return U?m(U):!1}function k(D,V,$){for(var U=0;U<D.length;U+=2){var Z=D[U];if($.test(Z)){for(var J=Z.replace($,""),j=0;j<D.length;j+=2)if(D[j]===J)throw new c(`Cannot promisify an API that has normal methods with '%s'-suffix
|
|
132
132
|
|
|
133
133
|
See http://goo.gl/MqrFmX
|
|
134
134
|
`.replace("%s",V))}}}function S(D,V,$,U){for(var Z=i.inheritedDataKeys(D),J=[],j=0;j<Z.length;++j){var pe=Z[j],Q=D[pe],X=U===d?!0:d(pe,Q,D);typeof Q=="function"&&!m(Q)&&!_(D,pe,V)&&U(pe,Q,D,X)&&J.push(pe,Q)}return k(J,V,$),J}var v=function(D){return D.replace(/([$])/,"\\$")},g,y=function(D){for(var V=[D],$=Math.max(0,D-1-3),U=D-1;U>=$;--U)V.push(U);for(var U=D+1;U<=3;++U)V.push(U);return V},T=function(D){return i.filledRange(D,"_arg","")},R=function(D){return i.filledRange(Math.max(D,3),"_arg","")},I=function(D){return typeof D.length=="number"?Math.max(Math.min(D.length,1024),0):0};g=function(D,V,$,U,Z,J){var j=Math.max(0,I(U)-1),pe=y(j),Q=typeof D=="string"||V===r;function X(re){var q=T(re).join(", "),de=re>0?", ":"",le;return Q?le=`ret = callback.call(this, {{args}}, nodeback); break;
|
|
@@ -172,29 +172,29 @@ GFS4: `),console.error(e)});ht[Xt]||(E1=global[Xt]||[],T1(ht,E1),ht.close=(funct
|
|
|
172
172
|
`);V=Object(V);var $=!!V.multiArgs,U=V.suffix;typeof U!="string"&&(U=u);var Z=V.filter;typeof Z!="function"&&(Z=d);var J=V.promisifier;if(typeof J!="function"&&(J=O),!i.isIdentifier(U))throw new RangeError(`suffix must be a valid identifier
|
|
173
173
|
|
|
174
174
|
See http://goo.gl/MqrFmX
|
|
175
|
-
`);for(var j=i.inheritedDataKeys(D),pe=0;pe<j.length;++pe){var Q=D[j[pe]];j[pe]!=="constructor"&&i.isClass(Q)&&(A(Q.prototype,U,Z,J,$),A(Q,U,Z,J,$))}return A(D,U,Z,J,$)}}});var Nj=w((
|
|
175
|
+
`);for(var j=i.inheritedDataKeys(D),pe=0;pe<j.length;++pe){var Q=D[j[pe]];j[pe]!=="constructor"&&i.isClass(Q)&&(A(Q.prototype,U,Z,J,$),A(Q,U,Z,J,$))}return A(D,U,Z,J,$)}}});var Nj=w((hke,Dj)=>{"use strict";Dj.exports=function(e,t,r,i){var n=it(),o=n.isObject,s=Mi(),a;typeof Map=="function"&&(a=Map);var c=(function(){var p=0,d=0;function h(m,_){this[p]=m,this[p+d]=_,p++}return function(_){d=_.size,p=0;var k=new Array(_.size*2);return _.forEach(h,k),k}})(),u=function(p){for(var d=new a,h=p.length/2|0,m=0;m<h;++m){var _=p[h+m],k=p[m];d.set(_,k)}return d};function l(p){var d=!1,h;if(a!==void 0&&p instanceof a)h=c(p),d=!0;else{var m=s.keys(p),_=m.length;h=new Array(_*2);for(var k=0;k<_;++k){var S=m[k];h[k]=p[S],h[k+_]=S}}this.constructor$(h),this._isMap=d,this._init$(void 0,d?-6:-3)}n.inherits(l,t),l.prototype._init=function(){},l.prototype._promiseFulfilled=function(p,d){this._values[d]=p;var h=++this._totalResolved;if(h>=this._length){var m;if(this._isMap)m=u(this._values);else{m={};for(var _=this.length(),k=0,S=this.length();k<S;++k)m[this._values[k+_]]=this._values[k]}return this._resolve(m),!0}return!1},l.prototype.shouldCopyValues=function(){return!1},l.prototype.getActualLength=function(p){return p>>1};function f(p){var d,h=r(p);if(o(h))h instanceof e?d=h._then(e.props,void 0,void 0,void 0,void 0):d=new l(h).promise();else return i(`cannot await properties of a non-object
|
|
176
176
|
|
|
177
177
|
See http://goo.gl/MqrFmX
|
|
178
|
-
`);return h instanceof e&&d._propagateFrom(h,2),d}e.prototype.props=function(){return f(this)},e.props=function(p){return f(p)}}});var qj=w((
|
|
178
|
+
`);return h instanceof e&&d._propagateFrom(h,2),d}e.prototype.props=function(){return f(this)},e.props=function(p){return f(p)}}});var qj=w((mke,Pj)=>{"use strict";Pj.exports=function(e,t,r,i){var n=it(),o=function(a){return a.then(function(c){return s(c,a)})};function s(a,c){var u=r(a);if(u instanceof e)return o(u);if(a=n.asArray(a),a===null)return i("expecting an array or an iterable object but got "+n.classString(a));var l=new e(t);c!==void 0&&l._propagateFrom(c,3);for(var f=l._fulfill,p=l._reject,d=0,h=a.length;d<h;++d){var m=a[d];m===void 0&&!(d in a)||e.cast(m)._then(f,p,void 0,l,null)}return l}e.race=function(a){return s(a,void 0)},e.prototype.race=function(){return s(this,void 0)}}});var Mj=w((gke,jj)=>{"use strict";jj.exports=function(e,t,r,i,n,o){var s=it(),a=s.tryCatch;function c(d,h,m,_){this.constructor$(d);var k=e._getContext();this._fn=s.contextBind(k,h),m!==void 0&&(m=e.resolve(m),m._attachCancellationCallback(this)),this._initialValue=m,this._currentCancellable=null,_===n?this._eachValues=Array(this._length):_===0?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}s.inherits(c,t),c.prototype._gotAccum=function(d){this._eachValues!==void 0&&this._eachValues!==null&&d!==n&&this._eachValues.push(d)},c.prototype._eachComplete=function(d){return this._eachValues!==null&&this._eachValues.push(d),this._eachValues},c.prototype._init=function(){},c.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},c.prototype.shouldCopyValues=function(){return!1},c.prototype._resolve=function(d){this._promise._resolveCallback(d),this._values=null},c.prototype._resultCancelled=function(d){if(d===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel())},c.prototype._iterate=function(d){this._values=d;var h,m,_=d.length;this._initialValue!==void 0?(h=this._initialValue,m=0):(h=e.resolve(d[0]),m=1),this._currentCancellable=h;for(var k=m;k<_;++k){var S=d[k];S instanceof e&&S.suppressUnhandledRejections()}if(!h.isRejected())for(;m<_;++m){var v={accum:null,value:d[m],index:m,length:_,array:this};h=h._then(f,void 0,void 0,v,void 0),(m&127)===0&&h._setNoAsyncGuarantee()}this._eachValues!==void 0&&(h=h._then(this._eachComplete,void 0,void 0,this,void 0)),h._then(u,u,void 0,h,this)},e.prototype.reduce=function(d,h){return l(this,d,h,null)},e.reduce=function(d,h,m,_){return l(d,h,m,_)};function u(d,h){this.isFulfilled()?h._resolve(d):h._reject(d)}function l(d,h,m,_){if(typeof h!="function")return r("expecting a function but got "+s.classString(h));var k=new c(d,h,m,_);return k.promise()}function f(d){this.accum=d,this.array._gotAccum(d);var h=i(this.value,this.array._promise);return h instanceof e?(this.array._currentCancellable=h,h._then(p,void 0,void 0,this,void 0)):p.call(this,h)}function p(d){var h=this.array,m=h._promise,_=a(h._fn);m._pushContext();var k;h._eachValues!==void 0?k=_.call(m._boundValue(),d,this.index,this.length):k=_.call(m._boundValue(),this.accum,d,this.index,this.length),k instanceof e&&(h._currentCancellable=k);var S=m._popContext();return o.checkForgottenReturns(k,S,h._eachValues!==void 0?"Promise.each":"Promise.reduce",m),k}}});var Fj=w((yke,Lj)=>{"use strict";Lj.exports=function(e,t,r){var i=e.PromiseInspection,n=it();function o(s){this.constructor$(s)}n.inherits(o,t),o.prototype._promiseResolved=function(s,a){this._values[s]=a;var c=++this._totalResolved;return c>=this._length?(this._resolve(this._values),!0):!1},o.prototype._promiseFulfilled=function(s,a){var c=new i;return c._bitField=33554432,c._settledValueField=s,this._promiseResolved(a,c)},o.prototype._promiseRejected=function(s,a){var c=new i;return c._bitField=16777216,c._settledValueField=s,this._promiseResolved(a,c)},e.settle=function(s){return r.deprecated(".settle()",".reflect()"),new o(s).promise()},e.allSettled=function(s){return new o(s).promise()},e.prototype.settle=function(){return e.settle(this)}}});var Uj=w((vke,zj)=>{"use strict";zj.exports=function(e,t,r){var i=it(),n=Yn().RangeError,o=Yn().AggregateError,s=i.isArray,a={};function c(l){this.constructor$(l),this._howMany=0,this._unwrap=!1,this._initialized=!1}i.inherits(c,t),c.prototype._init=function(){if(this._initialized){if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var l=s(this._values);!this._isResolved()&&l&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(l){this._howMany=l},c.prototype._promiseFulfilled=function(l){return this._addFulfilled(l),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),this.howMany()===1&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},c.prototype._promiseRejected=function(l){return this._addRejected(l),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||this._values==null?this._cancel():(this._addRejected(a),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var l=new o,f=this.length();f<this._values.length;++f)this._values[f]!==a&&l.push(this._values[f]);return l.length>0?this._reject(l):this._cancel(),!0}return!1},c.prototype._fulfilled=function(){return this._totalResolved},c.prototype._rejected=function(){return this._values.length-this.length()},c.prototype._addRejected=function(l){this._values.push(l)},c.prototype._addFulfilled=function(l){this._values[this._totalResolved++]=l},c.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},c.prototype._getRangeError=function(l){var f="Input array must contain at least "+this._howMany+" items but contains only "+l+" items";return new n(f)},c.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))};function u(l,f){if((f|0)!==f||f<0)return r(`expecting a positive integer
|
|
179
179
|
|
|
180
180
|
See http://goo.gl/MqrFmX
|
|
181
|
-
`);var p=new c(l),d=p.promise();return p.setHowMany(f),p.init(),d}e.some=function(l,f){return u(l,f)},e.prototype.some=function(l){return u(this,l)},e._SomePromiseArray=c}});var Wj=w((
|
|
181
|
+
`);var p=new c(l),d=p.promise();return p.setHowMany(f),p.init(),d}e.some=function(l,f){return u(l,f)},e.prototype.some=function(l){return u(this,l)},e._SomePromiseArray=c}});var Wj=w((bke,Bj)=>{"use strict";Bj.exports=function(e,t,r){var i=it(),n=e.TimeoutError;function o(f){this.handle=f}o.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(f){return a(+this).thenReturn(f)},a=e.delay=function(f,p){var d,h;return p!==void 0?(d=e.resolve(p)._then(s,null,null,f,void 0),r.cancellation()&&p instanceof e&&d._setOnCancel(p)):(d=new e(t),h=setTimeout(function(){d._fulfill()},+f),r.cancellation()&&d._setOnCancel(new o(h)),d._captureStackTrace()),d._setAsyncGuaranteed(),d};e.prototype.delay=function(f){return a(f,this)};var c=function(f,p,d){var h;typeof p!="string"?p instanceof Error?h=p:h=new n("operation timed out"):h=new n(p),i.markAsOriginatingFromRejection(h),f._attachExtraTrace(h),f._reject(h),d?.cancel()};function u(f){return clearTimeout(this.handle),f}function l(f){throw clearTimeout(this.handle),f}e.prototype.timeout=function(f,p){f=+f;var d,h,m=new o(setTimeout(function(){d.isPending()&&c(d,p,h)},f));return r.cancellation()?(h=this.then(),d=h._then(u,l,void 0,m,void 0),d._setOnCancel(m)):d=this._then(u,l,void 0,m,void 0),d}}});var Vj=w((_ke,Hj)=>{"use strict";Hj.exports=function(e,t,r,i,n,o){var s=it(),a=Yn().TypeError,c=it().inherits,u=s.errorObj,l=s.tryCatch,f={};function p(v){setTimeout(function(){throw v},0)}function d(v){var g=r(v);return g!==v&&typeof v._isDisposable=="function"&&typeof v._getDisposer=="function"&&v._isDisposable()&&g._setDisposable(v._getDisposer()),g}function h(v,g){var y=0,T=v.length,R=new e(n);function I(){if(y>=T)return R._fulfill();var b=d(v[y++]);if(b instanceof e&&b._isDisposable()){try{b=r(b._getDisposer().tryDispose(g),v.promise)}catch(O){return p(O)}if(b instanceof e)return b._then(I,p,null,null,null)}I()}return I(),R}function m(v,g,y){this._data=v,this._promise=g,this._context=y}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():f},m.prototype.tryDispose=function(v){var g=this.resource(),y=this._context;y!==void 0&&y._pushContext();var T=g!==f?this.doDispose(g,v):null;return y!==void 0&&y._popContext(),this._promise._unsetDisposable(),this._data=null,T},m.isDisposer=function(v){return v!=null&&typeof v.resource=="function"&&typeof v.tryDispose=="function"};function _(v,g,y){this.constructor$(v,g,y)}c(_,m),_.prototype.doDispose=function(v,g){var y=this.data();return y.call(v,v,g)};function k(v){return m.isDisposer(v)?(this.resources[this.index]._setDisposable(v),v.promise()):v}function S(v){this.length=v,this.promise=null,this[v-1]=null}S.prototype._resultCancelled=function(){for(var v=this.length,g=0;g<v;++g){var y=this[g];y instanceof e&&y.cancel()}},e.using=function(){var v=arguments.length;if(v<2)return t("you must pass at least 2 arguments to Promise.using");var g=arguments[v-1];if(typeof g!="function")return t("expecting a function but got "+s.classString(g));var y,T=!0;v===2&&Array.isArray(arguments[0])?(y=arguments[0],v=y.length,T=!1):(y=arguments,v--);for(var R=new S(v),I=0;I<v;++I){var b=y[I];if(m.isDisposer(b)){var O=b;b=b.promise(),b._setDisposable(O)}else{var A=r(b);A instanceof e&&(b=A._then(k,null,null,{resources:R,index:I},void 0))}R[I]=b}for(var P=new Array(R.length),I=0;I<P.length;++I)P[I]=e.resolve(R[I]).reflect();var D=e.all(P).then(function($){for(var U=0;U<$.length;++U){var Z=$[U];if(Z.isRejected())return u.e=Z.error(),u;if(!Z.isFulfilled()){D.cancel();return}$[U]=Z.value()}V._pushContext(),g=l(g);var J=T?g.apply(void 0,$):g($),j=V._popContext();return o.checkForgottenReturns(J,j,"Promise.using",V),J}),V=D.lastly(function(){var $=new e.PromiseInspection(D);return h(R,$)});return R.promise=V,V._setOnCancel(R),V},e.prototype._setDisposable=function(v){this._bitField=this._bitField|131072,this._disposer=v},e.prototype._isDisposable=function(){return(this._bitField&131072)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},e.prototype.disposer=function(v){if(typeof v=="function")return new _(v,this,i());throw new a}}});var Gj=w((wke,Zj)=>{"use strict";Zj.exports=function(e){var t=e._SomePromiseArray;function r(i){var n=new t(i),o=n.promise();return n.setHowMany(1),n.setUnwrap(),n.init(),o}e.any=function(i){return r(i)},e.prototype.any=function(){return r(this)}}});var Xj=w((xke,Kj)=>{"use strict";Kj.exports=function(e,t){var r=e.reduce,i=e.all;function n(){return i(this)}function o(s,a){return r(s,a,t,t)}e.prototype.each=function(s){return r(this,s,t,0)._then(n,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(s){return r(this,s,t,t)},e.each=function(s,a){return r(s,a,t,0)._then(n,void 0,void 0,s,void 0)},e.mapSeries=o}});var Yj=w((Ske,Jj)=>{"use strict";Jj.exports=function(e,t){var r=e.map;e.prototype.filter=function(i,n){return r(this,i,n,t)},e.filter=function(i,n,o){return r(i,n,o,t)}}});var Qj=w((Eke,uE)=>{"use strict";uE.exports=function(){var e=function(){return new S(`circular promise resolution chain
|
|
182
182
|
|
|
183
183
|
See http://goo.gl/MqrFmX
|
|
184
184
|
`)},t=function(){return new j.PromiseInspection(this._target())},r=function(N){return j.reject(new S(N))};function i(){}var n={},o=it();o.setReflectHandler(t);var s=function(){var N=process.domain;return N===void 0?null:N},a=function(){return null},c=function(){return{domain:s(),async:null}},u=o.isNode&&o.nodeSupportsAsyncResource?B("async_hooks").AsyncResource:null,l=function(){return{domain:s(),async:new u("Bluebird::Promise")}},f=o.isNode?c:a;o.notEnumerableProp(j,"_getContext",f);var p=function(){f=l,o.notEnumerableProp(j,"_getContext",l)},d=function(){f=c,o.notEnumerableProp(j,"_getContext",c)},h=Mi(),m=Zq(),_=new m;h.defineProperty(j,"_async",{value:_});var k=Yn(),S=j.TypeError=k.TypeError;j.RangeError=k.RangeError;var v=j.CancellationError=k.CancellationError;j.TimeoutError=k.TimeoutError,j.OperationalError=k.OperationalError,j.RejectionError=k.OperationalError,j.AggregateError=k.AggregateError;var g=function(){},y={},T={},R=Yq()(j,g),I=ej()(j,g,R,r,i),b=rj()(j),O=b.create,A=ij()(j,b,p,d),P=A.CapturedTrace,D=aj()(j,R,T),V=iE()(T),$=oE(),U=o.errorObj,Z=o.tryCatch;function J(N,H){if(N==null||N.constructor!==j)throw new S(`the promise constructor cannot be invoked directly
|
|
185
185
|
|
|
186
186
|
See http://goo.gl/MqrFmX
|
|
187
|
-
`);if(typeof H!="function")throw new S("expecting a function but got "+o.classString(H))}function j(N){N!==g&&J(this,N),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(N),this._promiseCreated(),this._fireEvent("promiseCreated",this)}j.prototype.toString=function(){return"[object Promise]"},j.prototype.caught=j.prototype.catch=function(N){var H=arguments.length;if(H>1){var G=new Array(H-1),re=0,q;for(q=0;q<H-1;++q){var de=arguments[q];if(o.isObject(de))G[re++]=de;else return r("Catch statement predicate: expecting an object but got "+o.classString(de))}if(G.length=re,N=arguments[q],typeof N!="function")throw new S("The last argument to .catch() must be a function, got "+o.toString(N));return this.then(void 0,V(G,N,this))}return this.then(void 0,N)},j.prototype.reflect=function(){return this._then(t,t,void 0,this,void 0)},j.prototype.then=function(N,H){if(A.warnings()&&arguments.length>0&&typeof N!="function"&&typeof H!="function"){var G=".then() only accepts functions but was passed: "+o.classString(N);arguments.length>1&&(G+=", "+o.classString(H)),this._warn(G)}return this._then(N,H,void 0,void 0,void 0)},j.prototype.done=function(N,H){var G=this._then(N,H,void 0,void 0,void 0);G._setIsFinal()},j.prototype.spread=function(N){return typeof N!="function"?r("expecting a function but got "+o.classString(N)):this.all()._then(N,void 0,void 0,y,void 0)},j.prototype.toJSON=function(){var N={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(N.fulfillmentValue=this.value(),N.isFulfilled=!0):this.isRejected()&&(N.rejectionReason=this.reason(),N.isRejected=!0),N},j.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new I(this).promise()},j.prototype.error=function(N){return this.caught(o.originatesFromRejection,N)},j.getNewLibraryCopy=uE.exports,j.is=function(N){return N instanceof j},j.fromNode=j.fromCallback=function(N){var H=new j(g);H._captureStackTrace();var G=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,re=Z(N)($(H,G));return re===U&&H._rejectCallback(re.e,!0),H._isFateSealed()||H._setAsyncGuaranteed(),H},j.all=function(N){return new I(N).promise()},j.cast=function(N){var H=R(N);return H instanceof j||(H=new j(g),H._captureStackTrace(),H._setFulfilled(),H._rejectionHandler0=N),H},j.resolve=j.fulfilled=j.cast,j.reject=j.rejected=function(N){var H=new j(g);return H._captureStackTrace(),H._rejectCallback(N,!0),H},j.setScheduler=function(N){if(typeof N!="function")throw new S("expecting a function but got "+o.classString(N));return _.setScheduler(N)},j.prototype._then=function(N,H,G,re,q){var de=q!==void 0,le=de?q:new j(g),Oe=this._target(),We=Oe._bitField;de||(le._propagateFrom(this,3),le._captureStackTrace(),re===void 0&&(this._bitField&2097152)!==0&&((We&50397184)!==0?re=this._boundValue():re=Oe===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,le));var E=f();if((We&50397184)!==0){var x,F,C=Oe._settlePromiseCtx;(We&33554432)!==0?(F=Oe._rejectionHandler0,x=N):(We&16777216)!==0?(F=Oe._fulfillmentHandler0,x=H,Oe._unsetRejectionIsUnhandled()):(C=Oe._settlePromiseLateCancellationObserver,F=new v("late cancellation observer"),Oe._attachExtraTrace(F),x=H),_.invoke(C,Oe,{handler:o.contextBind(E,x),promise:le,receiver:re,value:F})}else Oe._addCallbacks(N,H,le,re,E);return le},j.prototype._length=function(){return this._bitField&65535},j.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},j.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},j.prototype._setLength=function(N){this._bitField=this._bitField&-65536|N&65535},j.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},j.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},j.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},j.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},j.prototype._isFinal=function(){return(this._bitField&4194304)>0},j.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},j.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},j.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},j.prototype._setAsyncGuaranteed=function(){if(!_.hasCustomScheduler()){var N=this._bitField;this._bitField=N|(N&536870912)>>2^134217728}},j.prototype._setNoAsyncGuarantee=function(){this._bitField=(this._bitField|536870912)&-134217729},j.prototype._receiverAt=function(N){var H=N===0?this._receiver0:this[N*4-4+3];if(H!==n)return H===void 0&&this._isBound()?this._boundValue():H},j.prototype._promiseAt=function(N){return this[N*4-4+2]},j.prototype._fulfillmentHandlerAt=function(N){return this[N*4-4+0]},j.prototype._rejectionHandlerAt=function(N){return this[N*4-4+1]},j.prototype._boundValue=function(){},j.prototype._migrateCallback0=function(N){var H=N._bitField,G=N._fulfillmentHandler0,re=N._rejectionHandler0,q=N._promise0,de=N._receiverAt(0);de===void 0&&(de=n),this._addCallbacks(G,re,q,de,null)},j.prototype._migrateCallbackAt=function(N,H){var G=N._fulfillmentHandlerAt(H),re=N._rejectionHandlerAt(H),q=N._promiseAt(H),de=N._receiverAt(H);de===void 0&&(de=n),this._addCallbacks(G,re,q,de,null)},j.prototype._addCallbacks=function(N,H,G,re,q){var de=this._length();if(de>=65531&&(de=0,this._setLength(0)),de===0)this._promise0=G,this._receiver0=re,typeof N=="function"&&(this._fulfillmentHandler0=o.contextBind(q,N)),typeof H=="function"&&(this._rejectionHandler0=o.contextBind(q,H));else{var le=de*4-4;this[le+2]=G,this[le+3]=re,typeof N=="function"&&(this[le+0]=o.contextBind(q,N)),typeof H=="function"&&(this[le+1]=o.contextBind(q,H))}return this._setLength(de+1),de},j.prototype._proxy=function(N,H){this._addCallbacks(void 0,void 0,H,N,null)},j.prototype._resolveCallback=function(N,H){if((this._bitField&117506048)===0){if(N===this)return this._rejectCallback(e(),!1);var G=R(N,this);if(!(G instanceof j))return this._fulfill(N);H&&this._propagateFrom(G,2);var re=G._target();if(re===this){this._reject(e());return}var q=re._bitField;if((q&50397184)===0){var de=this._length();de>0&&re._migrateCallback0(this);for(var le=1;le<de;++le)re._migrateCallbackAt(this,le);this._setFollowing(),this._setLength(0),this._setFollowee(G)}else if((q&33554432)!==0)this._fulfill(re._value());else if((q&16777216)!==0)this._reject(re._reason());else{var Oe=new v("late cancellation observer");re._attachExtraTrace(Oe),this._reject(Oe)}}},j.prototype._rejectCallback=function(N,H,G){var re=o.ensureErrorObject(N),q=re===N;if(!q&&!G&&A.warnings()){var de="a promise was rejected with a non-error: "+o.classString(N);this._warn(de,!0)}this._attachExtraTrace(re,H?q:!1),this._reject(N)},j.prototype._resolveFromExecutor=function(N){if(N!==g){var H=this;this._captureStackTrace(),this._pushContext();var G=!0,re=this._execute(N,function(q){H._resolveCallback(q)},function(q){H._rejectCallback(q,G)});G=!1,this._popContext(),re!==void 0&&H._rejectCallback(re,!0)}},j.prototype._settlePromiseFromHandler=function(N,H,G,re){var q=re._bitField;if((q&65536)===0){re._pushContext();var de;H===y?!G||typeof G.length!="number"?(de=U,de.e=new S("cannot .spread() a non-array: "+o.classString(G))):de=Z(N).apply(this._boundValue(),G):de=Z(N).call(H,G);var le=re._popContext();q=re._bitField,(q&65536)===0&&(de===T?re._reject(G):de===U?re._rejectCallback(de.e,!1):(A.checkForgottenReturns(de,le,"",re,this),re._resolveCallback(de)))}},j.prototype._target=function(){for(var N=this;N._isFollowing();)N=N._followee();return N},j.prototype._followee=function(){return this._rejectionHandler0},j.prototype._setFollowee=function(N){this._rejectionHandler0=N},j.prototype._settlePromise=function(N,H,G,re){var q=N instanceof j,de=this._bitField,le=(de&134217728)!==0;(de&65536)!==0?(q&&N._invokeInternalOnCancel(),G instanceof D&&G.isFinallyHandler()?(G.cancelPromise=N,Z(H).call(G,re)===U&&N._reject(U.e)):H===t?N._fulfill(t.call(G)):G instanceof i?G._promiseCancelled(N):q||N instanceof I?N._cancel():G.cancel()):typeof H=="function"?q?(le&&N._setAsyncGuaranteed(),this._settlePromiseFromHandler(H,G,re,N)):H.call(G,re,N):G instanceof i?G._isResolved()||((de&33554432)!==0?G._promiseFulfilled(re,N):G._promiseRejected(re,N)):q&&(le&&N._setAsyncGuaranteed(),(de&33554432)!==0?N._fulfill(re):N._reject(re))},j.prototype._settlePromiseLateCancellationObserver=function(N){var H=N.handler,G=N.promise,re=N.receiver,q=N.value;typeof H=="function"?G instanceof j?this._settlePromiseFromHandler(H,re,q,G):H.call(re,q,G):G instanceof j&&G._reject(q)},j.prototype._settlePromiseCtx=function(N){this._settlePromise(N.promise,N.handler,N.receiver,N.value)},j.prototype._settlePromise0=function(N,H,G){var re=this._promise0,q=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(re,N,q,H)},j.prototype._clearCallbackDataAtIndex=function(N){var H=N*4-4;this[H+2]=this[H+3]=this[H+0]=this[H+1]=void 0},j.prototype._fulfill=function(N){var H=this._bitField;if(!((H&117506048)>>>16)){if(N===this){var G=e();return this._attachExtraTrace(G),this._reject(G)}this._setFulfilled(),this._rejectionHandler0=N,(H&65535)>0&&((H&134217728)!==0?this._settlePromises():_.settlePromises(this),this._dereferenceTrace())}},j.prototype._reject=function(N){var H=this._bitField;if(!((H&117506048)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=N,this._isFinal())return _.fatalError(N,o.isNode);(H&65535)>0?_.settlePromises(this):this._ensurePossibleRejectionHandled()}},j.prototype._fulfillPromises=function(N,H){for(var G=1;G<N;G++){var re=this._fulfillmentHandlerAt(G),q=this._promiseAt(G),de=this._receiverAt(G);this._clearCallbackDataAtIndex(G),this._settlePromise(q,re,de,H)}},j.prototype._rejectPromises=function(N,H){for(var G=1;G<N;G++){var re=this._rejectionHandlerAt(G),q=this._promiseAt(G),de=this._receiverAt(G);this._clearCallbackDataAtIndex(G),this._settlePromise(q,re,de,H)}},j.prototype._settlePromises=function(){var N=this._bitField,H=N&65535;if(H>0){if((N&16842752)!==0){var G=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,G,N),this._rejectPromises(H,G)}else{var re=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,re,N),this._fulfillPromises(H,re)}this._setLength(0)}this._clearCancellationData()},j.prototype._settledValue=function(){var N=this._bitField;if((N&33554432)!==0)return this._rejectionHandler0;if((N&16777216)!==0)return this._fulfillmentHandler0},typeof Symbol<"u"&&Symbol.toStringTag&&h.defineProperty(j.prototype,Symbol.toStringTag,{get:function(){return"Object"}});function pe(N){this.promise._resolveCallback(N)}function Q(N){this.promise._rejectCallback(N,!1)}j.defer=j.pending=function(){A.deprecated("Promise.defer","new Promise");var N=new j(g);return{promise:N,resolve:pe,reject:Q}},o.notEnumerableProp(j,"_makeSelfResolutionError",e),dj()(j,g,R,r,A),hj()(j,g,R,A),gj()(j,I,r,A),vj()(j),_j()(j),xj()(j,I,R,g,_),j.Promise=j,j.version="3.7.2",Ej()(j),Tj()(j,r,g,R,i,A),Oj()(j,I,r,R,g,A),Aj()(j),Rj()(j,g),Nj()(j,I,R,r),qj()(j,g,R,r),Mj()(j,I,r,R,g,A),Fj()(j,I,A),Uj()(j,I,r),Wj()(j,g,A),Vj()(j,r,R,O,g,A),Gj()(j),Xj()(j,g),Yj()(j,g),o.toFastProperties(j),o.toFastProperties(j.prototype);function X(N){var H=new j(g);H._fulfillmentHandler0=N,H._rejectionHandler0=N,H._promise0=N,H._receiver0=N}return X({a:1}),X({b:2}),X({c:3}),X(1),X(function(){}),X(void 0),X(!1),X(new j(g)),A.setBounds(m.firstLineError,o.lastLineError),j}});var rM=w((Eke,tM)=>{"use strict";var eM;typeof Promise<"u"&&(eM=Promise);function Yne(){try{Promise===lh&&(Promise=eM)}catch{}return lh}var lh=Qj()();lh.noConflict=Yne;tM.exports=lh});var oM=w((kke,iM)=>{var Qu=ep(),Qne=Oq(),eie=tp(),tie=rp(),fh=B("path"),lE=$S(),rie=np(),el=mu(),dh=rM(),nM=Buffer.alloc(4);nM.writeUInt32LE(101010256,0);function nie(e){let t=e.stream(0).pipe(Qu());return t.pull(4).then(function(r){if(r.readUInt32LE(0)===875721283){let n;return t.pull(12).then(function(o){n=el.parse(o,[["version",4],["pubKeyLength",4],["signatureLength",4]])}).then(function(){return t.pull(n.pubKeyLength+n.signatureLength)}).then(function(o){return n.publicKey=o.slice(0,n.pubKeyLength),n.signature=o.slice(n.pubKeyLength),n.size=16+n.pubKeyLength+n.signatureLength,n})}})}function iie(e,t){let r=el.parse(t,[["signature",4],["diskNumber",4],["offsetToStartOfCentralDirectory",8],["numberOfDisks",4]]);if(r.signature!=117853008)throw new Error("invalid zip64 end of central dir locator signature (0x07064b50): 0x"+r.signature.toString(16));let i=Qu();return e.stream(r.offsetToStartOfCentralDirectory).pipe(i),i.pull(56)}function oie(e){let t=el.parse(e,[["signature",4],["sizeOfCentralDirectory",8],["version",2],["versionsNeededToExtract",2],["diskNumber",4],["diskStart",4],["numberOfRecordsOnDisk",8],["numberOfRecords",8],["sizeOfCentralDirectory",8],["offsetToStartOfCentralDirectory",8]]);if(t.signature!=101075792)throw new Error("invalid zip64 end of central dir locator signature (0x06064b50): 0x0"+t.signature.toString(16));return t}iM.exports=function(t,r){let i=Qu(),n=Qu(),o=r&&r.tailSize||80,s,a,c,u;return r&&r.crx&&(a=nie(t)),t.size().then(function(l){return s=l,t.stream(Math.max(0,l-o)).on("error",function(f){i.emit("error",f)}).pipe(i),i.pull(nM)}).then(function(){return dh.props({directory:i.pull(22),crxHeader:a})}).then(function(l){let f=l.directory;if(c=l.crxHeader&&l.crxHeader.size||0,u=el.parse(f,[["signature",4],["diskNumber",2],["diskStart",2],["numberOfRecordsOnDisk",2],["numberOfRecords",2],["sizeOfCentralDirectory",4],["offsetToStartOfCentralDirectory",4],["commentLength",2]]),u.diskNumber==65535||u.numberOfRecords==65535||u.offsetToStartOfCentralDirectory==4294967295){let d=s-(o-i.match+20),h=Qu();return t.stream(d).pipe(h),h.pull(20).then(function(m){return iie(t,m)}).then(function(m){u=oie(m)})}else u.offsetToStartOfCentralDirectory+=c}).then(function(){if(u.commentLength)return i.pull(u.commentLength).then(function(l){u.comment=l.toString("utf8")})}).then(function(){return t.stream(u.offsetToStartOfCentralDirectory).pipe(n),u.extract=function(l){if(!l||!l.path)throw new Error("PATH_MISSING");return l.path=fh.resolve(fh.normalize(l.path)),u.files.then(function(f){return dh.map(f,async function(p){let d=fh.join(l.path,p.path);if(d.indexOf(l.path)!=0)return;if(p.type=="Directory"){await lE.ensureDir(d);return}await lE.ensureDir(fh.dirname(d));let h=l.getWriter?l.getWriter({path:d}):lE.createWriteStream(d);return new Promise(function(m,_){p.stream(l.password).on("error",_).pipe(h).on("close",m).on("error",_)})},{concurrency:l.concurrency>1?l.concurrency:1})})},u.files=dh.mapSeries(Array(u.numberOfRecords),function(){return n.pull(46).then(function(l){let f=el.parse(l,[["signature",4],["versionMadeBy",2],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2],["fileCommentLength",2],["diskNumber",2],["internalFileAttributes",2],["externalFileAttributes",4],["offsetToLocalFileHeader",4]]);return f.offsetToLocalFileHeader+=c,f.lastModifiedDateTime=rie(f.lastModifiedDate,f.lastModifiedTime),n.pull(f.fileNameLength).then(function(p){return f.pathBuffer=p,f.path=p.toString("utf8"),f.isUnicode=(f.flags&2048)!=0,n.pull(f.extraFieldLength)}).then(function(p){return f.extra=tie(p,f),n.pull(f.fileCommentLength)}).then(function(p){f.comment=p,f.type=f.uncompressedSize===0&&/[/\\]$/.test(f.path)?"Directory":"File";let d=r&&r.padding||1e3;return f.stream=function(h){let m=30+d+(f.extraFieldLength||0)+(f.fileNameLength||0)+f.compressedSize;return Qne(t,f.offsetToLocalFileHeader,h,f,m)},f.buffer=function(h){return eie(f.stream(h))},f})})}),dh.props(u)})}});var uM=w((Tke,cM)=>{var sM=Ii(),ka=oM(),aM=B("stream");cM.exports={buffer:function(e,t){return ka({stream:function(i,n){let o=aM.PassThrough(),s=n?i+n:void 0;return o.end(e.slice(i,s)),o},size:function(){return Promise.resolve(e.length)}},t)},file:function(e,t){return ka({stream:function(i,n){let o=n?i+n:void 0;return sM.createReadStream(e,{start:i,end:o})},size:function(){return new Promise(function(i,n){sM.stat(e,function(o,s){o?n(o):i(s.size)})})}},t)},url:function(e,t,r){if(typeof t=="string"&&(t={url:t}),!t.url)throw"URL missing";return t.headers=t.headers||{},ka({stream:function(n,o){let s=Object.create(t),a=o?n+o:"";return s.headers=Object.create(t.headers),s.headers.range="bytes="+n+"-"+a,e(s)},size:function(){return new Promise(function(n,o){let s=e(t);s.on("response",function(a){s.abort(),a.headers["content-length"]?n(a.headers["content-length"]):o(new Error("Missing content length header"))}).on("error",o)})}},r)},s3:function(e,t,r){return ka({size:function(){return new Promise(function(n,o){e.headObject(t,function(s,a){s?o(s):n(a.ContentLength)})})},stream:function(n,o){let s={};for(let c in t)s[c]=t[c];let a=o?n+o:"";return s.Range="bytes="+n+"-"+a,e.getObject(s).createReadStream()}},r)},s3_v3:function(e,t,r){let{GetObjectCommand:i,HeadObjectCommand:n}=B("@aws-sdk/client-s3");return ka({size:async()=>{let s=await e.send(new n({Bucket:t.Bucket,Key:t.Key}));return s.ContentLength?s.ContentLength:0},stream:(s,a)=>{let c=aM.PassThrough(),u=a?s+a:"";return e.send(new i({Bucket:t.Bucket,Key:t.Key,Range:`bytes=${s}-${u}`})).then(l=>{l.Body.pipe(c)}).catch(l=>{c.emit("error",l)}),c}},r)},custom:function(e,t){return ka(e,t)}}});var fE=w(tl=>{"use strict";tl.Parse=ip();tl.ParseOne=g1();tl.Extract=lD();tl.Open=uM()});var ei=w((hTe,MM)=>{"use strict";var qM=["nodebuffer","arraybuffer","fragments"],jM=typeof Blob<"u";jM&&qM.push("blob");MM.exports={BINARY_TYPES:qM,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:jM,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var al=w((mTe,_h)=>{"use strict";var{EMPTY_BUFFER:qie}=ei(),wE=Buffer[Symbol.species];function jie(e,t){if(e.length===0)return qie;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),i=0;for(let n=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return i<t?new wE(r.buffer,r.byteOffset,i):r}function LM(e,t,r,i,n){for(let o=0;o<n;o++)r[i+o]=e[o]^t[o&3]}function FM(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function Mie(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function xE(e){if(xE.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new wE(e):ArrayBuffer.isView(e)?t=new wE(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),xE.readOnly=!1),t}_h.exports={concat:jie,mask:LM,toArrayBuffer:Mie,toBuffer:xE,unmask:FM};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=B("bufferutil");_h.exports.mask=function(t,r,i,n,o){o<48?LM(t,r,i,n,o):e.mask(t,r,i,n,o)},_h.exports.unmask=function(t,r){t.length<32?FM(t,r):e.unmask(t,r)}}catch{}});var BM=w((gTe,UM)=>{"use strict";var zM=Symbol("kDone"),SE=Symbol("kRun"),EE=class{constructor(t){this[zM]=()=>{this.pending--,this[SE]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[SE]()}[SE](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[zM])}}};UM.exports=EE});var Da=w((yTe,ZM)=>{"use strict";var cl=B("zlib"),WM=al(),Lie=BM(),{kStatusCode:HM}=ei(),Fie=Buffer[Symbol.species],zie=Buffer.from([0,0,255,255]),xh=Symbol("permessage-deflate"),ti=Symbol("total-length"),$a=Symbol("callback"),zi=Symbol("buffers"),Ra=Symbol("error"),wh,kE=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!wh){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;wh=new Lie(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[$a];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,i=t.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&(typeof n.client_max_window_bits=="number"?r.clientMaxWindowBits>n.client_max_window_bits:!n.client_max_window_bits)));if(!i)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(i.server_no_context_takeover=!0),r.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(i.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?i.client_max_window_bits=r.clientMaxWindowBits:(i.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(i=>{let n=r[i];if(n.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(n=n[0],i==="client_max_window_bits"){if(n!==!0){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else if(i==="server_max_window_bits"){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else throw new Error(`Unknown parameter "${i}"`);r[i]=n})}),t}decompress(t,r,i){wh.add(n=>{this._decompress(t,r,(o,s)=>{n(),i(o,s)})})}compress(t,r,i){wh.add(n=>{this._compress(t,r,(o,s)=>{n(),i(o,s)})})}_decompress(t,r,i){let n=this._isServer?"client":"server";if(!this._inflate){let o=`${n}_max_window_bits`,s=typeof this.params[o]!="number"?cl.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=cl.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[xh]=this,this._inflate[ti]=0,this._inflate[zi]=[],this._inflate.on("error",Bie),this._inflate.on("data",VM)}this._inflate[$a]=i,this._inflate.write(t),r&&this._inflate.write(zie),this._inflate.flush(()=>{let o=this._inflate[Ra];if(o){this._inflate.close(),this._inflate=null,i(o);return}let s=WM.concat(this._inflate[zi],this._inflate[ti]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[ti]=0,this._inflate[zi]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),i(null,s)})}_compress(t,r,i){let n=this._isServer?"server":"client";if(!this._deflate){let o=`${n}_max_window_bits`,s=typeof this.params[o]!="number"?cl.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=cl.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[ti]=0,this._deflate[zi]=[],this._deflate.on("data",Uie)}this._deflate[$a]=i,this._deflate.write(t),this._deflate.flush(cl.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=WM.concat(this._deflate[zi],this._deflate[ti]);r&&(o=new Fie(o.buffer,o.byteOffset,o.length-4)),this._deflate[$a]=null,this._deflate[ti]=0,this._deflate[zi]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),i(null,o)})}};ZM.exports=kE;function Uie(e){this[zi].push(e),this[ti]+=e.length}function VM(e){if(this[ti]+=e.length,this[xh]._maxPayload<1||this[ti]<=this[xh]._maxPayload){this[zi].push(e);return}this[Ra]=new RangeError("Max payload size exceeded"),this[Ra].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Ra][HM]=1009,this.removeListener("data",VM),this.reset()}function Bie(e){if(this[xh]._inflate=null,this[Ra]){this[$a](this[Ra]);return}e[HM]=1007,this[$a](e)}});var Na=w((vTe,Sh)=>{"use strict";var{isUtf8:GM}=B("buffer"),{hasBlob:Wie}=ei(),Hie=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Vie(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function TE(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function Zie(e){return Wie&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Sh.exports={isBlob:Zie,isValidStatusCode:Vie,isValidUTF8:TE,tokenChars:Hie};if(GM)Sh.exports.isValidUTF8=function(e){return e.length<24?TE(e):GM(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=B("utf-8-validate");Sh.exports.isValidUTF8=function(t){return t.length<32?TE(t):e(t)}}catch{}});var $E=w((bTe,tL)=>{"use strict";var{Writable:Gie}=B("stream"),KM=Da(),{BINARY_TYPES:Kie,EMPTY_BUFFER:XM,kStatusCode:Xie,kWebSocket:Jie}=ei(),{concat:IE,toArrayBuffer:Yie,unmask:Qie}=al(),{isValidStatusCode:eoe,isValidUTF8:JM}=Na(),Eh=Buffer[Symbol.species],Lr=0,YM=1,QM=2,eL=3,OE=4,CE=5,kh=6,AE=class extends Gie{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||Kie[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[Jie]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Lr}_write(t,r,i){if(this._opcode===8&&this._state==Lr)return i();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){i(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(i)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let i=this._buffers[0];return this._buffers[0]=new Eh(i.buffer,i.byteOffset+t,i.length-t),new Eh(i.buffer,i.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let i=this._buffers[0],n=r.length-t;t>=i.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(i.buffer,i.byteOffset,t),n),this._buffers[0]=new Eh(i.buffer,i.byteOffset+t,i.length-t)),t-=i.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case Lr:this.getInfo(t);break;case YM:this.getPayloadLength16(t);break;case QM:this.getPayloadLength64(t);break;case eL:this.getMask();break;case OE:this.getData(t);break;case CE:case kh:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(n);return}let i=(r[0]&64)===64;if(i&&!this._extensions[KM.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(i){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._compressed=i}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(n);return}if(i){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(n);return}this._payloadLength===126?this._state=YM:this._payloadLength===127?this._state=QM:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),i=r.readUInt32BE(0);if(i>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(n);return}this._payloadLength=i*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=eL:this._state=OE}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=OE}getData(t){let r=XM;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&Qie(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let i=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(i);return}if(this._compressed){this._state=CE,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[KM.extensionName].decompress(t,this._fin,(n,o)=>{if(n)return r(n);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(s);return}this._fragments.push(o)}this.dataMessage(r),this._state===Lr&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=Lr;return}let r=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=IE(i,r):this._binaryType==="arraybuffer"?n=Yie(IE(i,r)):this._binaryType==="blob"?n=new Blob(i):n=i,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=Lr):(this._state=kh,setImmediate(()=>{this.emit("message",n,!0),this._state=Lr,this.startLoop(t)}))}else{let n=IE(i,r);if(!this._skipUTF8Validation&&!JM(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._state===CE||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=Lr):(this._state=kh,setImmediate(()=>{this.emit("message",n,!1),this._state=Lr,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,XM),this.end();else{let i=t.readUInt16BE(0);if(!eoe(i)){let o=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(o);return}let n=new Eh(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!JM(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(o);return}this._loop=!1,this.emit("conclude",i,n),this.end()}this._state=Lr;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Lr):(this._state=kh,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Lr,this.startLoop(r)}))}createError(t,r,i,n,o){this._loop=!1,this._errored=!0;let s=new t(i?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(s,this.createError),s.code=o,s[Xie]=n,s}};tL.exports=AE});var NE=w((wTe,iL)=>{"use strict";var{Duplex:_Te}=B("stream"),{randomFillSync:toe}=B("crypto"),{types:{isUint8Array:roe}}=B("util"),rL=Da(),{EMPTY_BUFFER:noe,kWebSocket:ioe,NOOP:ooe}=ei(),{isBlob:Pa,isValidStatusCode:soe}=Na(),{mask:nL,toBuffer:No}=al(),Fr=Symbol("kByteLength"),aoe=Buffer.alloc(4),Th=8*1024,Po,qa=Th,en=0,coe=1,uoe=2,RE=class e{constructor(t,r,i){this._extensions=r||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=en,this.onerror=ooe,this[ioe]=void 0}static frame(t,r){let i,n=!1,o=2,s=!1;r.mask&&(i=r.maskBuffer||aoe,r.generateMask?r.generateMask(i):(qa===Th&&(Po===void 0&&(Po=Buffer.alloc(Th)),toe(Po,0,Th),qa=0),i[0]=Po[qa++],i[1]=Po[qa++],i[2]=Po[qa++],i[3]=Po[qa++]),s=(i[0]|i[1]|i[2]|i[3])===0,o=6);let a;typeof t=="string"?(!r.mask||s)&&r[Fr]!==void 0?a=r[Fr]:(t=Buffer.from(t),a=t.length):(a=t.length,n=r.mask&&r.readOnly&&!s);let c=a;a>=65536?(o+=8,c=127):a>125&&(o+=2,c=126);let u=Buffer.allocUnsafe(n?a+o:o);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),r.mask?(u[1]|=128,u[o-4]=i[0],u[o-3]=i[1],u[o-2]=i[2],u[o-1]=i[3],s?[u,t]:n?(nL(t,i,u,o,a),[u]):(nL(t,i,t,0,a),[u,t])):[u,t]}close(t,r,i,n){let o;if(t===void 0)o=noe;else{if(typeof t!="number"||!soe(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");if(o=Buffer.allocUnsafe(2+a),o.writeUInt16BE(t,0),typeof r=="string")o.write(r,2);else if(roe(r))o.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let s={[Fr]:o.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==en?this.enqueue([this.dispatch,o,!1,s,n]):this.sendFrame(e.frame(o,s),n)}ping(t,r,i){let n,o;if(typeof t=="string"?(n=Buffer.byteLength(t),o=!1):Pa(t)?(n=t.size,o=!1):(t=No(t),n=t.length,o=No.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Fr]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};Pa(t)?this._state!==en?this.enqueue([this.getBlobData,t,!1,s,i]):this.getBlobData(t,!1,s,i):this._state!==en?this.enqueue([this.dispatch,t,!1,s,i]):this.sendFrame(e.frame(t,s),i)}pong(t,r,i){let n,o;if(typeof t=="string"?(n=Buffer.byteLength(t),o=!1):Pa(t)?(n=t.size,o=!1):(t=No(t),n=t.length,o=No.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Fr]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};Pa(t)?this._state!==en?this.enqueue([this.getBlobData,t,!1,s,i]):this.getBlobData(t,!1,s,i):this._state!==en?this.enqueue([this.dispatch,t,!1,s,i]):this.sendFrame(e.frame(t,s),i)}send(t,r,i){let n=this._extensions[rL.extensionName],o=r.binary?2:1,s=r.compress,a,c;typeof t=="string"?(a=Buffer.byteLength(t),c=!1):Pa(t)?(a=t.size,c=!1):(t=No(t),a=t.length,c=No.readOnly),this._firstFragment?(this._firstFragment=!1,s&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=n._threshold),this._compress=s):(s=!1,o=0),r.fin&&(this._firstFragment=!0);let u={[Fr]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:c,rsv1:s};Pa(t)?this._state!==en?this.enqueue([this.getBlobData,t,this._compress,u,i]):this.getBlobData(t,this._compress,u,i):this._state!==en?this.enqueue([this.dispatch,t,this._compress,u,i]):this.dispatch(t,this._compress,u,i)}getBlobData(t,r,i,n){this._bufferedBytes+=i[Fr],this._state=uoe,t.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(DE,this,a,n);return}this._bufferedBytes-=i[Fr];let s=No(o);r?this.dispatch(s,r,i,n):(this._state=en,this.sendFrame(e.frame(s,i),n),this.dequeue())}).catch(o=>{process.nextTick(loe,this,o,n)})}dispatch(t,r,i,n){if(!r){this.sendFrame(e.frame(t,i),n);return}let o=this._extensions[rL.extensionName];this._bufferedBytes+=i[Fr],this._state=coe,o.compress(t,i.fin,(s,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");DE(this,c,n);return}this._bufferedBytes-=i[Fr],this._state=en,i.readOnly=!1,this.sendFrame(e.frame(a,i),n),this.dequeue()})}dequeue(){for(;this._state===en&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Fr],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Fr],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};iL.exports=RE;function DE(e,t,r){typeof r=="function"&&r(t);for(let i=0;i<e._queue.length;i++){let n=e._queue[i],o=n[n.length-1];typeof o=="function"&&o(t)}}function loe(e,t,r){DE(e,t,r),e.onerror(t)}});var pL=w((xTe,dL)=>{"use strict";var{kForOnEventAttribute:ul,kListener:PE}=ei(),oL=Symbol("kCode"),sL=Symbol("kData"),aL=Symbol("kError"),cL=Symbol("kMessage"),uL=Symbol("kReason"),ja=Symbol("kTarget"),lL=Symbol("kType"),fL=Symbol("kWasClean"),ri=class{constructor(t){this[ja]=null,this[lL]=t}get target(){return this[ja]}get type(){return this[lL]}};Object.defineProperty(ri.prototype,"target",{enumerable:!0});Object.defineProperty(ri.prototype,"type",{enumerable:!0});var qo=class extends ri{constructor(t,r={}){super(t),this[oL]=r.code===void 0?0:r.code,this[uL]=r.reason===void 0?"":r.reason,this[fL]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[oL]}get reason(){return this[uL]}get wasClean(){return this[fL]}};Object.defineProperty(qo.prototype,"code",{enumerable:!0});Object.defineProperty(qo.prototype,"reason",{enumerable:!0});Object.defineProperty(qo.prototype,"wasClean",{enumerable:!0});var Ma=class extends ri{constructor(t,r={}){super(t),this[aL]=r.error===void 0?null:r.error,this[cL]=r.message===void 0?"":r.message}get error(){return this[aL]}get message(){return this[cL]}};Object.defineProperty(Ma.prototype,"error",{enumerable:!0});Object.defineProperty(Ma.prototype,"message",{enumerable:!0});var ll=class extends ri{constructor(t,r={}){super(t),this[sL]=r.data===void 0?null:r.data}get data(){return this[sL]}};Object.defineProperty(ll.prototype,"data",{enumerable:!0});var foe={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[ul]&&n[PE]===t&&!n[ul])return;let i;if(e==="message")i=function(o,s){let a=new ll("message",{data:s?o:o.toString()});a[ja]=this,Ih(t,this,a)};else if(e==="close")i=function(o,s){let a=new qo("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[ja]=this,Ih(t,this,a)};else if(e==="error")i=function(o){let s=new Ma("error",{error:o,message:o.message});s[ja]=this,Ih(t,this,s)};else if(e==="open")i=function(){let o=new ri("open");o[ja]=this,Ih(t,this,o)};else return;i[ul]=!!r[ul],i[PE]=t,r.once?this.once(e,i):this.on(e,i)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[PE]===t&&!r[ul]){this.removeListener(e,r);break}}};dL.exports={CloseEvent:qo,ErrorEvent:Ma,Event:ri,EventTarget:foe,MessageEvent:ll};function Ih(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var Oh=w((STe,hL)=>{"use strict";var{tokenChars:fl}=Na();function _n(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function doe(e){let t=Object.create(null),r=Object.create(null),i=!1,n=!1,o=!1,s,a,c=-1,u=-1,l=-1,f=0;for(;f<e.length;f++)if(u=e.charCodeAt(f),s===void 0)if(l===-1&&fl[u]===1)c===-1&&(c=f);else if(f!==0&&(u===32||u===9))l===-1&&c!==-1&&(l=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f);let d=e.slice(c,l);u===44?(_n(t,d,r),r=Object.create(null)):s=d,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(l===-1&&fl[u]===1)c===-1&&(c=f);else if(u===32||u===9)l===-1&&c!==-1&&(l=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f),_n(r,e.slice(c,l),!0),u===44&&(_n(t,s,r),r=Object.create(null),s=void 0),c=l=-1}else if(u===61&&c!==-1&&l===-1)a=e.slice(c,f),c=l=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(n){if(fl[u]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:i||(i=!0),n=!1}else if(o)if(fl[u]===1)c===-1&&(c=f);else if(u===34&&c!==-1)o=!1,l=f;else if(u===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===34&&e.charCodeAt(f-1)===61)o=!0;else if(l===-1&&fl[u]===1)c===-1&&(c=f);else if(c!==-1&&(u===32||u===9))l===-1&&(l=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f);let d=e.slice(c,l);i&&(d=d.replace(/\\/g,""),i=!1),_n(r,a,d),u===44&&(_n(t,s,r),r=Object.create(null),s=void 0),a=void 0,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||o||u===32||u===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=f);let p=e.slice(c,l);return s===void 0?_n(t,p,r):(a===void 0?_n(r,p,!0):i?_n(r,a,p.replace(/\\/g,"")):_n(r,a,p),_n(t,s,r)),t}function poe(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(i=>[t].concat(Object.keys(i).map(n=>{let o=i[n];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?n:`${n}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}hL.exports={format:poe,parse:doe}});var Rh=w((TTe,TL)=>{"use strict";var hoe=B("events"),moe=B("https"),goe=B("http"),yL=B("net"),yoe=B("tls"),{randomBytes:voe,createHash:boe}=B("crypto"),{Duplex:ETe,Readable:kTe}=B("stream"),{URL:qE}=B("url"),Ui=Da(),_oe=$E(),woe=NE(),{isBlob:xoe}=Na(),{BINARY_TYPES:mL,CLOSE_TIMEOUT:Soe,EMPTY_BUFFER:Ch,GUID:Eoe,kForOnEventAttribute:jE,kListener:koe,kStatusCode:Toe,kWebSocket:Ft,NOOP:vL}=ei(),{EventTarget:{addEventListener:Ioe,removeEventListener:Ooe}}=pL(),{format:Coe,parse:Aoe}=Oh(),{toBuffer:$oe}=al(),bL=Symbol("kAborted"),ME=[8,13],ni=["CONNECTING","OPEN","CLOSING","CLOSED"],Roe=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,dt=class e extends hoe{constructor(t,r,i){super(),this._binaryType=mL[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Ch,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(i=r,r=[]):r=[r]),_L(this,t,r,i)):(this._autoPong=i.autoPong,this._closeTimeout=i.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){mL.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,i){let n=new _oe({allowSynchronousEvents:i.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation}),o=new woe(t,this._extensions,i.generateMask);this._receiver=n,this._sender=o,this._socket=t,n[Ft]=this,o[Ft]=this,t[Ft]=this,n.on("conclude",Poe),n.on("drain",qoe),n.on("error",joe),n.on("message",Moe),n.on("ping",Loe),n.on("pong",Foe),o.onerror=zoe,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",SL),t.on("data",$h),t.on("end",EL),t.on("error",kL),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Ui.extensionName]&&this._extensions[Ui.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){Ar(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,i=>{i||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),xL(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){LE(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Ch,r,i)}pong(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){LE(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Ch,r,i)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(i=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){LE(this,t,i);return}let n={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[Ui.extensionName]||(n.compress=!1),this._sender.send(t||Ch,n,i)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){Ar(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(dt,"CONNECTING",{enumerable:!0,value:ni.indexOf("CONNECTING")});Object.defineProperty(dt.prototype,"CONNECTING",{enumerable:!0,value:ni.indexOf("CONNECTING")});Object.defineProperty(dt,"OPEN",{enumerable:!0,value:ni.indexOf("OPEN")});Object.defineProperty(dt.prototype,"OPEN",{enumerable:!0,value:ni.indexOf("OPEN")});Object.defineProperty(dt,"CLOSING",{enumerable:!0,value:ni.indexOf("CLOSING")});Object.defineProperty(dt.prototype,"CLOSING",{enumerable:!0,value:ni.indexOf("CLOSING")});Object.defineProperty(dt,"CLOSED",{enumerable:!0,value:ni.indexOf("CLOSED")});Object.defineProperty(dt.prototype,"CLOSED",{enumerable:!0,value:ni.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(dt.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(dt.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[jE])return t[koe];return null},set(t){for(let r of this.listeners(e))if(r[jE]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[jE]:!0})}})});dt.prototype.addEventListener=Ioe;dt.prototype.removeEventListener=Ooe;TL.exports=dt;function _L(e,t,r,i){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Soe,protocolVersion:ME[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...i,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=n.autoPong,e._closeTimeout=n.closeTimeout,!ME.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${ME.join(", ")})`);let o;if(t instanceof qE)o=t;else try{o=new qE(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),e._url=o.href;let s=o.protocol==="wss:",a=o.protocol==="ws+unix:",c;if(o.protocol!=="ws:"&&!s&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!o.pathname?c="The URL's pathname is empty":o.hash&&(c="The URL contains a fragment identifier"),c){let m=new SyntaxError(c);if(e._redirects===0)throw m;Ah(e,m);return}let u=s?443:80,l=voe(16).toString("base64"),f=s?moe.request:goe.request,p=new Set,d;if(n.createConnection=n.createConnection||(s?Noe:Doe),n.defaultPort=n.defaultPort||u,n.port=o.port||u,n.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},n.path=o.pathname+o.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(d=new Ui({...n.perMessageDeflate,isServer:!1,maxPayload:n.maxPayload}),n.headers["Sec-WebSocket-Extensions"]=Coe({[Ui.extensionName]:d.offer()})),r.length){for(let m of r){if(typeof m!="string"||!Roe.test(m)||p.has(m))throw new SyntaxError("An invalid or duplicated subprotocol was specified");p.add(m)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(o.username||o.password)&&(n.auth=`${o.username}:${o.password}`),a){let m=n.path.split(":");n.socketPath=m[0],n.path=m[1]}let h;if(n.followRedirects){if(e._redirects===0){e._originalIpc=a,e._originalSecure=s,e._originalHostOrSocketPath=a?n.socketPath:o.host;let m=i&&i.headers;if(i={...i,headers:{}},m)for(let[_,k]of Object.entries(m))i.headers[_.toLowerCase()]=k}else if(e.listenerCount("redirect")===0){let m=a?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:o.host===e._originalHostOrSocketPath;(!m||e._originalSecure&&!s)&&(delete n.headers.authorization,delete n.headers.cookie,m||delete n.headers.host,n.auth=void 0)}n.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),h=e._req=f(n),e._redirects&&e.emit("redirect",e.url,h)}else h=e._req=f(n);n.timeout&&h.on("timeout",()=>{Ar(e,h,"Opening handshake has timed out")}),h.on("error",m=>{h===null||h[bL]||(h=e._req=null,Ah(e,m))}),h.on("response",m=>{let _=m.headers.location,k=m.statusCode;if(_&&n.followRedirects&&k>=300&&k<400){if(++e._redirects>n.maxRedirects){Ar(e,h,"Maximum redirects exceeded");return}h.abort();let S;try{S=new qE(_,t)}catch{let g=new SyntaxError(`Invalid URL: ${_}`);Ah(e,g);return}_L(e,S,r,i)}else e.emit("unexpected-response",h,m)||Ar(e,h,`Unexpected server response: ${m.statusCode}`)}),h.on("upgrade",(m,_,k)=>{if(e.emit("upgrade",m),e.readyState!==dt.CONNECTING)return;h=e._req=null;let S=m.headers.upgrade;if(S===void 0||S.toLowerCase()!=="websocket"){Ar(e,_,"Invalid Upgrade header");return}let v=boe("sha1").update(l+Eoe).digest("base64");if(m.headers["sec-websocket-accept"]!==v){Ar(e,_,"Invalid Sec-WebSocket-Accept header");return}let g=m.headers["sec-websocket-protocol"],y;if(g!==void 0?p.size?p.has(g)||(y="Server sent an invalid subprotocol"):y="Server sent a subprotocol but none was requested":p.size&&(y="Server sent no subprotocol"),y){Ar(e,_,y);return}g&&(e._protocol=g);let T=m.headers["sec-websocket-extensions"];if(T!==void 0){if(!d){Ar(e,_,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let R;try{R=Aoe(T)}catch{Ar(e,_,"Invalid Sec-WebSocket-Extensions header");return}let I=Object.keys(R);if(I.length!==1||I[0]!==Ui.extensionName){Ar(e,_,"Server indicated an extension that was not requested");return}try{d.accept(R[Ui.extensionName])}catch{Ar(e,_,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Ui.extensionName]=d}e.setSocket(_,k,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(h,e):h.end()}function Ah(e,t){e._readyState=dt.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function Doe(e){return e.path=e.socketPath,yL.connect(e)}function Noe(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=yL.isIP(e.host)?"":e.host),yoe.connect(e)}function Ar(e,t,r){e._readyState=dt.CLOSING;let i=new Error(r);Error.captureStackTrace(i,Ar),t.setHeader?(t[bL]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Ah,e,i)):(t.destroy(i),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function LE(e,t,r){if(t){let i=xoe(t)?t.size:$oe(t).length;e._socket?e._sender._bufferedBytes+=i:e._bufferedAmount+=i}if(r){let i=new Error(`WebSocket is not open: readyState ${e.readyState} (${ni[e.readyState]})`);process.nextTick(r,i)}}function Poe(e,t){let r=this[Ft];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Ft]!==void 0&&(r._socket.removeListener("data",$h),process.nextTick(wL,r._socket),e===1005?r.close():r.close(e,t))}function qoe(){let e=this[Ft];e.isPaused||e._socket.resume()}function joe(e){let t=this[Ft];t._socket[Ft]!==void 0&&(t._socket.removeListener("data",$h),process.nextTick(wL,t._socket),t.close(e[Toe])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function gL(){this[Ft].emitClose()}function Moe(e,t){this[Ft].emit("message",e,t)}function Loe(e){let t=this[Ft];t._autoPong&&t.pong(e,!this._isServer,vL),t.emit("ping",e)}function Foe(e){this[Ft].emit("pong",e)}function wL(e){e.resume()}function zoe(e){let t=this[Ft];t.readyState!==dt.CLOSED&&(t.readyState===dt.OPEN&&(t._readyState=dt.CLOSING,xL(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function xL(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function SL(){let e=this[Ft];if(this.removeListener("close",SL),this.removeListener("data",$h),this.removeListener("end",EL),e._readyState=dt.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[Ft]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",gL),e._receiver.on("finish",gL))}function $h(e){this[Ft]._receiver.write(e)||this.pause()}function EL(){let e=this[Ft];e._readyState=dt.CLOSING,e._receiver.end(),this.end()}function kL(){let e=this[Ft];this.removeListener("error",kL),this.on("error",vL),e&&(e._readyState=dt.CLOSING,this.destroy())}});var AL=w((OTe,CL)=>{"use strict";var ITe=Rh(),{Duplex:Uoe}=B("stream");function IL(e){e.emit("close")}function Boe(){!this.destroyed&&this._writableState.finished&&this.destroy()}function OL(e){this.removeListener("error",OL),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function Woe(e,t){let r=!0,i=new Uoe({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(o,s){let a=!s&&i._readableState.objectMode?o.toString():o;i.push(a)||e.pause()}),e.once("error",function(o){i.destroyed||(r=!1,i.destroy(o))}),e.once("close",function(){i.destroyed||i.push(null)}),i._destroy=function(n,o){if(e.readyState===e.CLOSED){o(n),process.nextTick(IL,i);return}let s=!1;e.once("error",function(c){s=!0,o(c)}),e.once("close",function(){s||o(n),process.nextTick(IL,i)}),r&&e.terminate()},i._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){i._final(n)});return}e._socket!==null&&(e._socket._writableState.finished?(n(),i._readableState.endEmitted&&i.destroy()):(e._socket.once("finish",function(){n()}),e.close()))},i._read=function(){e.isPaused&&e.resume()},i._write=function(n,o,s){if(e.readyState===e.CONNECTING){e.once("open",function(){i._write(n,o,s)});return}e.send(n,s)},i.on("end",Boe),i.on("error",OL),i}CL.exports=Woe});var FE=w((CTe,$L)=>{"use strict";var{tokenChars:Hoe}=Na();function Voe(e){let t=new Set,r=-1,i=-1,n=0;for(n;n<e.length;n++){let s=e.charCodeAt(n);if(i===-1&&Hoe[s]===1)r===-1&&(r=n);else if(n!==0&&(s===32||s===9))i===-1&&r!==-1&&(i=n);else if(s===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);i===-1&&(i=n);let a=e.slice(r,i);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);t.add(a),r=i=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||i!==-1)throw new SyntaxError("Unexpected end of input");let o=e.slice(r,n);if(t.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}$L.exports={parse:Voe}});var ML=w(($Te,jL)=>{"use strict";var Zoe=B("events"),Dh=B("http"),{Duplex:ATe}=B("stream"),{createHash:Goe}=B("crypto"),RL=Oh(),jo=Da(),Koe=FE(),Xoe=Rh(),{CLOSE_TIMEOUT:Joe,GUID:Yoe,kWebSocket:Qoe}=ei(),ese=/^[+/0-9A-Za-z]{22}==$/,DL=0,NL=1,qL=2,zE=class extends Zoe{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Joe,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Xoe,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Dh.createServer((i,n)=>{let o=Dh.STATUS_CODES[426];n.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),n.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=tse(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,o,s)=>{this.handleUpgrade(n,o,s,i)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=DL}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===qL){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(dl,this);return}if(t&&this.once("close",t),this._state!==NL)if(this._state=NL,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(dl,this):process.nextTick(dl,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{dl(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,i,n){r.on("error",PL);let o=t.headers["sec-websocket-key"],s=t.headers.upgrade,a=+t.headers["sec-websocket-version"];if(t.method!=="GET"){Mo(this,t,r,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){Mo(this,t,r,400,"Invalid Upgrade header");return}if(o===void 0||!ese.test(o)){Mo(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Mo(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){pl(r,400);return}let c=t.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=Koe.parse(c)}catch{Mo(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let l=t.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&l!==void 0){let p=new jo({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let d=RL.parse(l);d[jo.extensionName]&&(p.accept(d[jo.extensionName]),f[jo.extensionName]=p)}catch{Mo(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let p={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(p,(d,h,m,_)=>{if(!d)return pl(r,h||401,m,_);this.completeUpgrade(f,o,u,t,r,i,n)});return}if(!this.options.verifyClient(p))return pl(r,401)}this.completeUpgrade(f,o,u,t,r,i,n)}completeUpgrade(t,r,i,n,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[Qoe])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>DL)return pl(o,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Goe("sha1").update(r+Yoe).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(i.size){let f=this.options.handleProtocols?this.options.handleProtocols(i,n):i.values().next().value;f&&(u.push(`Sec-WebSocket-Protocol: ${f}`),l._protocol=f)}if(t[jo.extensionName]){let f=t[jo.extensionName].params,p=RL.format({[jo.extensionName]:[f]});u.push(`Sec-WebSocket-Extensions: ${p}`),l._extensions=t}this.emit("headers",u,n),o.write(u.concat(`\r
|
|
187
|
+
`);if(typeof H!="function")throw new S("expecting a function but got "+o.classString(H))}function j(N){N!==g&&J(this,N),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(N),this._promiseCreated(),this._fireEvent("promiseCreated",this)}j.prototype.toString=function(){return"[object Promise]"},j.prototype.caught=j.prototype.catch=function(N){var H=arguments.length;if(H>1){var G=new Array(H-1),re=0,q;for(q=0;q<H-1;++q){var de=arguments[q];if(o.isObject(de))G[re++]=de;else return r("Catch statement predicate: expecting an object but got "+o.classString(de))}if(G.length=re,N=arguments[q],typeof N!="function")throw new S("The last argument to .catch() must be a function, got "+o.toString(N));return this.then(void 0,V(G,N,this))}return this.then(void 0,N)},j.prototype.reflect=function(){return this._then(t,t,void 0,this,void 0)},j.prototype.then=function(N,H){if(A.warnings()&&arguments.length>0&&typeof N!="function"&&typeof H!="function"){var G=".then() only accepts functions but was passed: "+o.classString(N);arguments.length>1&&(G+=", "+o.classString(H)),this._warn(G)}return this._then(N,H,void 0,void 0,void 0)},j.prototype.done=function(N,H){var G=this._then(N,H,void 0,void 0,void 0);G._setIsFinal()},j.prototype.spread=function(N){return typeof N!="function"?r("expecting a function but got "+o.classString(N)):this.all()._then(N,void 0,void 0,y,void 0)},j.prototype.toJSON=function(){var N={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(N.fulfillmentValue=this.value(),N.isFulfilled=!0):this.isRejected()&&(N.rejectionReason=this.reason(),N.isRejected=!0),N},j.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new I(this).promise()},j.prototype.error=function(N){return this.caught(o.originatesFromRejection,N)},j.getNewLibraryCopy=uE.exports,j.is=function(N){return N instanceof j},j.fromNode=j.fromCallback=function(N){var H=new j(g);H._captureStackTrace();var G=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,re=Z(N)($(H,G));return re===U&&H._rejectCallback(re.e,!0),H._isFateSealed()||H._setAsyncGuaranteed(),H},j.all=function(N){return new I(N).promise()},j.cast=function(N){var H=R(N);return H instanceof j||(H=new j(g),H._captureStackTrace(),H._setFulfilled(),H._rejectionHandler0=N),H},j.resolve=j.fulfilled=j.cast,j.reject=j.rejected=function(N){var H=new j(g);return H._captureStackTrace(),H._rejectCallback(N,!0),H},j.setScheduler=function(N){if(typeof N!="function")throw new S("expecting a function but got "+o.classString(N));return _.setScheduler(N)},j.prototype._then=function(N,H,G,re,q){var de=q!==void 0,le=de?q:new j(g),Oe=this._target(),We=Oe._bitField;de||(le._propagateFrom(this,3),le._captureStackTrace(),re===void 0&&(this._bitField&2097152)!==0&&((We&50397184)!==0?re=this._boundValue():re=Oe===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,le));var E=f();if((We&50397184)!==0){var x,F,C=Oe._settlePromiseCtx;(We&33554432)!==0?(F=Oe._rejectionHandler0,x=N):(We&16777216)!==0?(F=Oe._fulfillmentHandler0,x=H,Oe._unsetRejectionIsUnhandled()):(C=Oe._settlePromiseLateCancellationObserver,F=new v("late cancellation observer"),Oe._attachExtraTrace(F),x=H),_.invoke(C,Oe,{handler:o.contextBind(E,x),promise:le,receiver:re,value:F})}else Oe._addCallbacks(N,H,le,re,E);return le},j.prototype._length=function(){return this._bitField&65535},j.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},j.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},j.prototype._setLength=function(N){this._bitField=this._bitField&-65536|N&65535},j.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},j.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},j.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},j.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},j.prototype._isFinal=function(){return(this._bitField&4194304)>0},j.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},j.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},j.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},j.prototype._setAsyncGuaranteed=function(){if(!_.hasCustomScheduler()){var N=this._bitField;this._bitField=N|(N&536870912)>>2^134217728}},j.prototype._setNoAsyncGuarantee=function(){this._bitField=(this._bitField|536870912)&-134217729},j.prototype._receiverAt=function(N){var H=N===0?this._receiver0:this[N*4-4+3];if(H!==n)return H===void 0&&this._isBound()?this._boundValue():H},j.prototype._promiseAt=function(N){return this[N*4-4+2]},j.prototype._fulfillmentHandlerAt=function(N){return this[N*4-4+0]},j.prototype._rejectionHandlerAt=function(N){return this[N*4-4+1]},j.prototype._boundValue=function(){},j.prototype._migrateCallback0=function(N){var H=N._bitField,G=N._fulfillmentHandler0,re=N._rejectionHandler0,q=N._promise0,de=N._receiverAt(0);de===void 0&&(de=n),this._addCallbacks(G,re,q,de,null)},j.prototype._migrateCallbackAt=function(N,H){var G=N._fulfillmentHandlerAt(H),re=N._rejectionHandlerAt(H),q=N._promiseAt(H),de=N._receiverAt(H);de===void 0&&(de=n),this._addCallbacks(G,re,q,de,null)},j.prototype._addCallbacks=function(N,H,G,re,q){var de=this._length();if(de>=65531&&(de=0,this._setLength(0)),de===0)this._promise0=G,this._receiver0=re,typeof N=="function"&&(this._fulfillmentHandler0=o.contextBind(q,N)),typeof H=="function"&&(this._rejectionHandler0=o.contextBind(q,H));else{var le=de*4-4;this[le+2]=G,this[le+3]=re,typeof N=="function"&&(this[le+0]=o.contextBind(q,N)),typeof H=="function"&&(this[le+1]=o.contextBind(q,H))}return this._setLength(de+1),de},j.prototype._proxy=function(N,H){this._addCallbacks(void 0,void 0,H,N,null)},j.prototype._resolveCallback=function(N,H){if((this._bitField&117506048)===0){if(N===this)return this._rejectCallback(e(),!1);var G=R(N,this);if(!(G instanceof j))return this._fulfill(N);H&&this._propagateFrom(G,2);var re=G._target();if(re===this){this._reject(e());return}var q=re._bitField;if((q&50397184)===0){var de=this._length();de>0&&re._migrateCallback0(this);for(var le=1;le<de;++le)re._migrateCallbackAt(this,le);this._setFollowing(),this._setLength(0),this._setFollowee(G)}else if((q&33554432)!==0)this._fulfill(re._value());else if((q&16777216)!==0)this._reject(re._reason());else{var Oe=new v("late cancellation observer");re._attachExtraTrace(Oe),this._reject(Oe)}}},j.prototype._rejectCallback=function(N,H,G){var re=o.ensureErrorObject(N),q=re===N;if(!q&&!G&&A.warnings()){var de="a promise was rejected with a non-error: "+o.classString(N);this._warn(de,!0)}this._attachExtraTrace(re,H?q:!1),this._reject(N)},j.prototype._resolveFromExecutor=function(N){if(N!==g){var H=this;this._captureStackTrace(),this._pushContext();var G=!0,re=this._execute(N,function(q){H._resolveCallback(q)},function(q){H._rejectCallback(q,G)});G=!1,this._popContext(),re!==void 0&&H._rejectCallback(re,!0)}},j.prototype._settlePromiseFromHandler=function(N,H,G,re){var q=re._bitField;if((q&65536)===0){re._pushContext();var de;H===y?!G||typeof G.length!="number"?(de=U,de.e=new S("cannot .spread() a non-array: "+o.classString(G))):de=Z(N).apply(this._boundValue(),G):de=Z(N).call(H,G);var le=re._popContext();q=re._bitField,(q&65536)===0&&(de===T?re._reject(G):de===U?re._rejectCallback(de.e,!1):(A.checkForgottenReturns(de,le,"",re,this),re._resolveCallback(de)))}},j.prototype._target=function(){for(var N=this;N._isFollowing();)N=N._followee();return N},j.prototype._followee=function(){return this._rejectionHandler0},j.prototype._setFollowee=function(N){this._rejectionHandler0=N},j.prototype._settlePromise=function(N,H,G,re){var q=N instanceof j,de=this._bitField,le=(de&134217728)!==0;(de&65536)!==0?(q&&N._invokeInternalOnCancel(),G instanceof D&&G.isFinallyHandler()?(G.cancelPromise=N,Z(H).call(G,re)===U&&N._reject(U.e)):H===t?N._fulfill(t.call(G)):G instanceof i?G._promiseCancelled(N):q||N instanceof I?N._cancel():G.cancel()):typeof H=="function"?q?(le&&N._setAsyncGuaranteed(),this._settlePromiseFromHandler(H,G,re,N)):H.call(G,re,N):G instanceof i?G._isResolved()||((de&33554432)!==0?G._promiseFulfilled(re,N):G._promiseRejected(re,N)):q&&(le&&N._setAsyncGuaranteed(),(de&33554432)!==0?N._fulfill(re):N._reject(re))},j.prototype._settlePromiseLateCancellationObserver=function(N){var H=N.handler,G=N.promise,re=N.receiver,q=N.value;typeof H=="function"?G instanceof j?this._settlePromiseFromHandler(H,re,q,G):H.call(re,q,G):G instanceof j&&G._reject(q)},j.prototype._settlePromiseCtx=function(N){this._settlePromise(N.promise,N.handler,N.receiver,N.value)},j.prototype._settlePromise0=function(N,H,G){var re=this._promise0,q=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(re,N,q,H)},j.prototype._clearCallbackDataAtIndex=function(N){var H=N*4-4;this[H+2]=this[H+3]=this[H+0]=this[H+1]=void 0},j.prototype._fulfill=function(N){var H=this._bitField;if(!((H&117506048)>>>16)){if(N===this){var G=e();return this._attachExtraTrace(G),this._reject(G)}this._setFulfilled(),this._rejectionHandler0=N,(H&65535)>0&&((H&134217728)!==0?this._settlePromises():_.settlePromises(this),this._dereferenceTrace())}},j.prototype._reject=function(N){var H=this._bitField;if(!((H&117506048)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=N,this._isFinal())return _.fatalError(N,o.isNode);(H&65535)>0?_.settlePromises(this):this._ensurePossibleRejectionHandled()}},j.prototype._fulfillPromises=function(N,H){for(var G=1;G<N;G++){var re=this._fulfillmentHandlerAt(G),q=this._promiseAt(G),de=this._receiverAt(G);this._clearCallbackDataAtIndex(G),this._settlePromise(q,re,de,H)}},j.prototype._rejectPromises=function(N,H){for(var G=1;G<N;G++){var re=this._rejectionHandlerAt(G),q=this._promiseAt(G),de=this._receiverAt(G);this._clearCallbackDataAtIndex(G),this._settlePromise(q,re,de,H)}},j.prototype._settlePromises=function(){var N=this._bitField,H=N&65535;if(H>0){if((N&16842752)!==0){var G=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,G,N),this._rejectPromises(H,G)}else{var re=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,re,N),this._fulfillPromises(H,re)}this._setLength(0)}this._clearCancellationData()},j.prototype._settledValue=function(){var N=this._bitField;if((N&33554432)!==0)return this._rejectionHandler0;if((N&16777216)!==0)return this._fulfillmentHandler0},typeof Symbol<"u"&&Symbol.toStringTag&&h.defineProperty(j.prototype,Symbol.toStringTag,{get:function(){return"Object"}});function pe(N){this.promise._resolveCallback(N)}function Q(N){this.promise._rejectCallback(N,!1)}j.defer=j.pending=function(){A.deprecated("Promise.defer","new Promise");var N=new j(g);return{promise:N,resolve:pe,reject:Q}},o.notEnumerableProp(j,"_makeSelfResolutionError",e),dj()(j,g,R,r,A),hj()(j,g,R,A),gj()(j,I,r,A),vj()(j),_j()(j),xj()(j,I,R,g,_),j.Promise=j,j.version="3.7.2",Ej()(j),Tj()(j,r,g,R,i,A),Oj()(j,I,r,R,g,A),Aj()(j),Rj()(j,g),Nj()(j,I,R,r),qj()(j,g,R,r),Mj()(j,I,r,R,g,A),Fj()(j,I,A),Uj()(j,I,r),Wj()(j,g,A),Vj()(j,r,R,O,g,A),Gj()(j),Xj()(j,g),Yj()(j,g),o.toFastProperties(j),o.toFastProperties(j.prototype);function X(N){var H=new j(g);H._fulfillmentHandler0=N,H._rejectionHandler0=N,H._promise0=N,H._receiver0=N}return X({a:1}),X({b:2}),X({c:3}),X(1),X(function(){}),X(void 0),X(!1),X(new j(g)),A.setBounds(m.firstLineError,o.lastLineError),j}});var rM=w((kke,tM)=>{"use strict";var eM;typeof Promise<"u"&&(eM=Promise);function Yne(){try{Promise===lh&&(Promise=eM)}catch{}return lh}var lh=Qj()();lh.noConflict=Yne;tM.exports=lh});var oM=w((Tke,iM)=>{var Qu=ep(),Qne=Oq(),eie=tp(),tie=rp(),fh=B("path"),lE=$S(),rie=np(),el=mu(),dh=rM(),nM=Buffer.alloc(4);nM.writeUInt32LE(101010256,0);function nie(e){let t=e.stream(0).pipe(Qu());return t.pull(4).then(function(r){if(r.readUInt32LE(0)===875721283){let n;return t.pull(12).then(function(o){n=el.parse(o,[["version",4],["pubKeyLength",4],["signatureLength",4]])}).then(function(){return t.pull(n.pubKeyLength+n.signatureLength)}).then(function(o){return n.publicKey=o.slice(0,n.pubKeyLength),n.signature=o.slice(n.pubKeyLength),n.size=16+n.pubKeyLength+n.signatureLength,n})}})}function iie(e,t){let r=el.parse(t,[["signature",4],["diskNumber",4],["offsetToStartOfCentralDirectory",8],["numberOfDisks",4]]);if(r.signature!=117853008)throw new Error("invalid zip64 end of central dir locator signature (0x07064b50): 0x"+r.signature.toString(16));let i=Qu();return e.stream(r.offsetToStartOfCentralDirectory).pipe(i),i.pull(56)}function oie(e){let t=el.parse(e,[["signature",4],["sizeOfCentralDirectory",8],["version",2],["versionsNeededToExtract",2],["diskNumber",4],["diskStart",4],["numberOfRecordsOnDisk",8],["numberOfRecords",8],["sizeOfCentralDirectory",8],["offsetToStartOfCentralDirectory",8]]);if(t.signature!=101075792)throw new Error("invalid zip64 end of central dir locator signature (0x06064b50): 0x0"+t.signature.toString(16));return t}iM.exports=function(t,r){let i=Qu(),n=Qu(),o=r&&r.tailSize||80,s,a,c,u;return r&&r.crx&&(a=nie(t)),t.size().then(function(l){return s=l,t.stream(Math.max(0,l-o)).on("error",function(f){i.emit("error",f)}).pipe(i),i.pull(nM)}).then(function(){return dh.props({directory:i.pull(22),crxHeader:a})}).then(function(l){let f=l.directory;if(c=l.crxHeader&&l.crxHeader.size||0,u=el.parse(f,[["signature",4],["diskNumber",2],["diskStart",2],["numberOfRecordsOnDisk",2],["numberOfRecords",2],["sizeOfCentralDirectory",4],["offsetToStartOfCentralDirectory",4],["commentLength",2]]),u.diskNumber==65535||u.numberOfRecords==65535||u.offsetToStartOfCentralDirectory==4294967295){let d=s-(o-i.match+20),h=Qu();return t.stream(d).pipe(h),h.pull(20).then(function(m){return iie(t,m)}).then(function(m){u=oie(m)})}else u.offsetToStartOfCentralDirectory+=c}).then(function(){if(u.commentLength)return i.pull(u.commentLength).then(function(l){u.comment=l.toString("utf8")})}).then(function(){return t.stream(u.offsetToStartOfCentralDirectory).pipe(n),u.extract=function(l){if(!l||!l.path)throw new Error("PATH_MISSING");return l.path=fh.resolve(fh.normalize(l.path)),u.files.then(function(f){return dh.map(f,async function(p){let d=fh.join(l.path,p.path);if(d.indexOf(l.path)!=0)return;if(p.type=="Directory"){await lE.ensureDir(d);return}await lE.ensureDir(fh.dirname(d));let h=l.getWriter?l.getWriter({path:d}):lE.createWriteStream(d);return new Promise(function(m,_){p.stream(l.password).on("error",_).pipe(h).on("close",m).on("error",_)})},{concurrency:l.concurrency>1?l.concurrency:1})})},u.files=dh.mapSeries(Array(u.numberOfRecords),function(){return n.pull(46).then(function(l){let f=el.parse(l,[["signature",4],["versionMadeBy",2],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2],["fileCommentLength",2],["diskNumber",2],["internalFileAttributes",2],["externalFileAttributes",4],["offsetToLocalFileHeader",4]]);return f.offsetToLocalFileHeader+=c,f.lastModifiedDateTime=rie(f.lastModifiedDate,f.lastModifiedTime),n.pull(f.fileNameLength).then(function(p){return f.pathBuffer=p,f.path=p.toString("utf8"),f.isUnicode=(f.flags&2048)!=0,n.pull(f.extraFieldLength)}).then(function(p){return f.extra=tie(p,f),n.pull(f.fileCommentLength)}).then(function(p){f.comment=p,f.type=f.uncompressedSize===0&&/[/\\]$/.test(f.path)?"Directory":"File";let d=r&&r.padding||1e3;return f.stream=function(h){let m=30+d+(f.extraFieldLength||0)+(f.fileNameLength||0)+f.compressedSize;return Qne(t,f.offsetToLocalFileHeader,h,f,m)},f.buffer=function(h){return eie(f.stream(h))},f})})}),dh.props(u)})}});var uM=w((Ike,cM)=>{var sM=Ii(),ka=oM(),aM=B("stream");cM.exports={buffer:function(e,t){return ka({stream:function(i,n){let o=aM.PassThrough(),s=n?i+n:void 0;return o.end(e.slice(i,s)),o},size:function(){return Promise.resolve(e.length)}},t)},file:function(e,t){return ka({stream:function(i,n){let o=n?i+n:void 0;return sM.createReadStream(e,{start:i,end:o})},size:function(){return new Promise(function(i,n){sM.stat(e,function(o,s){o?n(o):i(s.size)})})}},t)},url:function(e,t,r){if(typeof t=="string"&&(t={url:t}),!t.url)throw"URL missing";return t.headers=t.headers||{},ka({stream:function(n,o){let s=Object.create(t),a=o?n+o:"";return s.headers=Object.create(t.headers),s.headers.range="bytes="+n+"-"+a,e(s)},size:function(){return new Promise(function(n,o){let s=e(t);s.on("response",function(a){s.abort(),a.headers["content-length"]?n(a.headers["content-length"]):o(new Error("Missing content length header"))}).on("error",o)})}},r)},s3:function(e,t,r){return ka({size:function(){return new Promise(function(n,o){e.headObject(t,function(s,a){s?o(s):n(a.ContentLength)})})},stream:function(n,o){let s={};for(let c in t)s[c]=t[c];let a=o?n+o:"";return s.Range="bytes="+n+"-"+a,e.getObject(s).createReadStream()}},r)},s3_v3:function(e,t,r){let{GetObjectCommand:i,HeadObjectCommand:n}=B("@aws-sdk/client-s3");return ka({size:async()=>{let s=await e.send(new n({Bucket:t.Bucket,Key:t.Key}));return s.ContentLength?s.ContentLength:0},stream:(s,a)=>{let c=aM.PassThrough(),u=a?s+a:"";return e.send(new i({Bucket:t.Bucket,Key:t.Key,Range:`bytes=${s}-${u}`})).then(l=>{l.Body.pipe(c)}).catch(l=>{c.emit("error",l)}),c}},r)},custom:function(e,t){return ka(e,t)}}});var fE=w(tl=>{"use strict";tl.Parse=ip();tl.ParseOne=g1();tl.Extract=lD();tl.Open=uM()});var ei=w((mTe,MM)=>{"use strict";var qM=["nodebuffer","arraybuffer","fragments"],jM=typeof Blob<"u";jM&&qM.push("blob");MM.exports={BINARY_TYPES:qM,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:jM,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var al=w((gTe,_h)=>{"use strict";var{EMPTY_BUFFER:qie}=ei(),wE=Buffer[Symbol.species];function jie(e,t){if(e.length===0)return qie;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),i=0;for(let n=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return i<t?new wE(r.buffer,r.byteOffset,i):r}function LM(e,t,r,i,n){for(let o=0;o<n;o++)r[i+o]=e[o]^t[o&3]}function FM(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function Mie(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function xE(e){if(xE.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new wE(e):ArrayBuffer.isView(e)?t=new wE(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),xE.readOnly=!1),t}_h.exports={concat:jie,mask:LM,toArrayBuffer:Mie,toBuffer:xE,unmask:FM};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=B("bufferutil");_h.exports.mask=function(t,r,i,n,o){o<48?LM(t,r,i,n,o):e.mask(t,r,i,n,o)},_h.exports.unmask=function(t,r){t.length<32?FM(t,r):e.unmask(t,r)}}catch{}});var BM=w((yTe,UM)=>{"use strict";var zM=Symbol("kDone"),SE=Symbol("kRun"),EE=class{constructor(t){this[zM]=()=>{this.pending--,this[SE]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[SE]()}[SE](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[zM])}}};UM.exports=EE});var Da=w((vTe,ZM)=>{"use strict";var cl=B("zlib"),WM=al(),Lie=BM(),{kStatusCode:HM}=ei(),Fie=Buffer[Symbol.species],zie=Buffer.from([0,0,255,255]),xh=Symbol("permessage-deflate"),ti=Symbol("total-length"),$a=Symbol("callback"),zi=Symbol("buffers"),Ra=Symbol("error"),wh,kE=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!wh){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;wh=new Lie(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[$a];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,i=t.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&(typeof n.client_max_window_bits=="number"?r.clientMaxWindowBits>n.client_max_window_bits:!n.client_max_window_bits)));if(!i)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(i.server_no_context_takeover=!0),r.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(i.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?i.client_max_window_bits=r.clientMaxWindowBits:(i.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(i=>{let n=r[i];if(n.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(n=n[0],i==="client_max_window_bits"){if(n!==!0){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else if(i==="server_max_window_bits"){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else throw new Error(`Unknown parameter "${i}"`);r[i]=n})}),t}decompress(t,r,i){wh.add(n=>{this._decompress(t,r,(o,s)=>{n(),i(o,s)})})}compress(t,r,i){wh.add(n=>{this._compress(t,r,(o,s)=>{n(),i(o,s)})})}_decompress(t,r,i){let n=this._isServer?"client":"server";if(!this._inflate){let o=`${n}_max_window_bits`,s=typeof this.params[o]!="number"?cl.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=cl.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[xh]=this,this._inflate[ti]=0,this._inflate[zi]=[],this._inflate.on("error",Bie),this._inflate.on("data",VM)}this._inflate[$a]=i,this._inflate.write(t),r&&this._inflate.write(zie),this._inflate.flush(()=>{let o=this._inflate[Ra];if(o){this._inflate.close(),this._inflate=null,i(o);return}let s=WM.concat(this._inflate[zi],this._inflate[ti]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[ti]=0,this._inflate[zi]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),i(null,s)})}_compress(t,r,i){let n=this._isServer?"server":"client";if(!this._deflate){let o=`${n}_max_window_bits`,s=typeof this.params[o]!="number"?cl.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=cl.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[ti]=0,this._deflate[zi]=[],this._deflate.on("data",Uie)}this._deflate[$a]=i,this._deflate.write(t),this._deflate.flush(cl.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=WM.concat(this._deflate[zi],this._deflate[ti]);r&&(o=new Fie(o.buffer,o.byteOffset,o.length-4)),this._deflate[$a]=null,this._deflate[ti]=0,this._deflate[zi]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),i(null,o)})}};ZM.exports=kE;function Uie(e){this[zi].push(e),this[ti]+=e.length}function VM(e){if(this[ti]+=e.length,this[xh]._maxPayload<1||this[ti]<=this[xh]._maxPayload){this[zi].push(e);return}this[Ra]=new RangeError("Max payload size exceeded"),this[Ra].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Ra][HM]=1009,this.removeListener("data",VM),this.reset()}function Bie(e){if(this[xh]._inflate=null,this[Ra]){this[$a](this[Ra]);return}e[HM]=1007,this[$a](e)}});var Na=w((bTe,Sh)=>{"use strict";var{isUtf8:GM}=B("buffer"),{hasBlob:Wie}=ei(),Hie=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Vie(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function TE(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function Zie(e){return Wie&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Sh.exports={isBlob:Zie,isValidStatusCode:Vie,isValidUTF8:TE,tokenChars:Hie};if(GM)Sh.exports.isValidUTF8=function(e){return e.length<24?TE(e):GM(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=B("utf-8-validate");Sh.exports.isValidUTF8=function(t){return t.length<32?TE(t):e(t)}}catch{}});var $E=w((_Te,tL)=>{"use strict";var{Writable:Gie}=B("stream"),KM=Da(),{BINARY_TYPES:Kie,EMPTY_BUFFER:XM,kStatusCode:Xie,kWebSocket:Jie}=ei(),{concat:IE,toArrayBuffer:Yie,unmask:Qie}=al(),{isValidStatusCode:eoe,isValidUTF8:JM}=Na(),Eh=Buffer[Symbol.species],Lr=0,YM=1,QM=2,eL=3,OE=4,CE=5,kh=6,AE=class extends Gie{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||Kie[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[Jie]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Lr}_write(t,r,i){if(this._opcode===8&&this._state==Lr)return i();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){i(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(i)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let i=this._buffers[0];return this._buffers[0]=new Eh(i.buffer,i.byteOffset+t,i.length-t),new Eh(i.buffer,i.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let i=this._buffers[0],n=r.length-t;t>=i.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(i.buffer,i.byteOffset,t),n),this._buffers[0]=new Eh(i.buffer,i.byteOffset+t,i.length-t)),t-=i.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case Lr:this.getInfo(t);break;case YM:this.getPayloadLength16(t);break;case QM:this.getPayloadLength64(t);break;case eL:this.getMask();break;case OE:this.getData(t);break;case CE:case kh:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(n);return}let i=(r[0]&64)===64;if(i&&!this._extensions[KM.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(i){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._compressed=i}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(n);return}if(i){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(n);return}this._payloadLength===126?this._state=YM:this._payloadLength===127?this._state=QM:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),i=r.readUInt32BE(0);if(i>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(n);return}this._payloadLength=i*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=eL:this._state=OE}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=OE}getData(t){let r=XM;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&Qie(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let i=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(i);return}if(this._compressed){this._state=CE,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[KM.extensionName].decompress(t,this._fin,(n,o)=>{if(n)return r(n);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(s);return}this._fragments.push(o)}this.dataMessage(r),this._state===Lr&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=Lr;return}let r=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=IE(i,r):this._binaryType==="arraybuffer"?n=Yie(IE(i,r)):this._binaryType==="blob"?n=new Blob(i):n=i,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=Lr):(this._state=kh,setImmediate(()=>{this.emit("message",n,!0),this._state=Lr,this.startLoop(t)}))}else{let n=IE(i,r);if(!this._skipUTF8Validation&&!JM(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._state===CE||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=Lr):(this._state=kh,setImmediate(()=>{this.emit("message",n,!1),this._state=Lr,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,XM),this.end();else{let i=t.readUInt16BE(0);if(!eoe(i)){let o=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(o);return}let n=new Eh(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!JM(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(o);return}this._loop=!1,this.emit("conclude",i,n),this.end()}this._state=Lr;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Lr):(this._state=kh,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Lr,this.startLoop(r)}))}createError(t,r,i,n,o){this._loop=!1,this._errored=!0;let s=new t(i?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(s,this.createError),s.code=o,s[Xie]=n,s}};tL.exports=AE});var NE=w((xTe,iL)=>{"use strict";var{Duplex:wTe}=B("stream"),{randomFillSync:toe}=B("crypto"),{types:{isUint8Array:roe}}=B("util"),rL=Da(),{EMPTY_BUFFER:noe,kWebSocket:ioe,NOOP:ooe}=ei(),{isBlob:Pa,isValidStatusCode:soe}=Na(),{mask:nL,toBuffer:No}=al(),Fr=Symbol("kByteLength"),aoe=Buffer.alloc(4),Th=8*1024,Po,qa=Th,en=0,coe=1,uoe=2,RE=class e{constructor(t,r,i){this._extensions=r||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=en,this.onerror=ooe,this[ioe]=void 0}static frame(t,r){let i,n=!1,o=2,s=!1;r.mask&&(i=r.maskBuffer||aoe,r.generateMask?r.generateMask(i):(qa===Th&&(Po===void 0&&(Po=Buffer.alloc(Th)),toe(Po,0,Th),qa=0),i[0]=Po[qa++],i[1]=Po[qa++],i[2]=Po[qa++],i[3]=Po[qa++]),s=(i[0]|i[1]|i[2]|i[3])===0,o=6);let a;typeof t=="string"?(!r.mask||s)&&r[Fr]!==void 0?a=r[Fr]:(t=Buffer.from(t),a=t.length):(a=t.length,n=r.mask&&r.readOnly&&!s);let c=a;a>=65536?(o+=8,c=127):a>125&&(o+=2,c=126);let u=Buffer.allocUnsafe(n?a+o:o);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),r.mask?(u[1]|=128,u[o-4]=i[0],u[o-3]=i[1],u[o-2]=i[2],u[o-1]=i[3],s?[u,t]:n?(nL(t,i,u,o,a),[u]):(nL(t,i,t,0,a),[u,t])):[u,t]}close(t,r,i,n){let o;if(t===void 0)o=noe;else{if(typeof t!="number"||!soe(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");if(o=Buffer.allocUnsafe(2+a),o.writeUInt16BE(t,0),typeof r=="string")o.write(r,2);else if(roe(r))o.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let s={[Fr]:o.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==en?this.enqueue([this.dispatch,o,!1,s,n]):this.sendFrame(e.frame(o,s),n)}ping(t,r,i){let n,o;if(typeof t=="string"?(n=Buffer.byteLength(t),o=!1):Pa(t)?(n=t.size,o=!1):(t=No(t),n=t.length,o=No.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Fr]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};Pa(t)?this._state!==en?this.enqueue([this.getBlobData,t,!1,s,i]):this.getBlobData(t,!1,s,i):this._state!==en?this.enqueue([this.dispatch,t,!1,s,i]):this.sendFrame(e.frame(t,s),i)}pong(t,r,i){let n,o;if(typeof t=="string"?(n=Buffer.byteLength(t),o=!1):Pa(t)?(n=t.size,o=!1):(t=No(t),n=t.length,o=No.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Fr]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};Pa(t)?this._state!==en?this.enqueue([this.getBlobData,t,!1,s,i]):this.getBlobData(t,!1,s,i):this._state!==en?this.enqueue([this.dispatch,t,!1,s,i]):this.sendFrame(e.frame(t,s),i)}send(t,r,i){let n=this._extensions[rL.extensionName],o=r.binary?2:1,s=r.compress,a,c;typeof t=="string"?(a=Buffer.byteLength(t),c=!1):Pa(t)?(a=t.size,c=!1):(t=No(t),a=t.length,c=No.readOnly),this._firstFragment?(this._firstFragment=!1,s&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=n._threshold),this._compress=s):(s=!1,o=0),r.fin&&(this._firstFragment=!0);let u={[Fr]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:c,rsv1:s};Pa(t)?this._state!==en?this.enqueue([this.getBlobData,t,this._compress,u,i]):this.getBlobData(t,this._compress,u,i):this._state!==en?this.enqueue([this.dispatch,t,this._compress,u,i]):this.dispatch(t,this._compress,u,i)}getBlobData(t,r,i,n){this._bufferedBytes+=i[Fr],this._state=uoe,t.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(DE,this,a,n);return}this._bufferedBytes-=i[Fr];let s=No(o);r?this.dispatch(s,r,i,n):(this._state=en,this.sendFrame(e.frame(s,i),n),this.dequeue())}).catch(o=>{process.nextTick(loe,this,o,n)})}dispatch(t,r,i,n){if(!r){this.sendFrame(e.frame(t,i),n);return}let o=this._extensions[rL.extensionName];this._bufferedBytes+=i[Fr],this._state=coe,o.compress(t,i.fin,(s,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");DE(this,c,n);return}this._bufferedBytes-=i[Fr],this._state=en,i.readOnly=!1,this.sendFrame(e.frame(a,i),n),this.dequeue()})}dequeue(){for(;this._state===en&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Fr],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Fr],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};iL.exports=RE;function DE(e,t,r){typeof r=="function"&&r(t);for(let i=0;i<e._queue.length;i++){let n=e._queue[i],o=n[n.length-1];typeof o=="function"&&o(t)}}function loe(e,t,r){DE(e,t,r),e.onerror(t)}});var pL=w((STe,dL)=>{"use strict";var{kForOnEventAttribute:ul,kListener:PE}=ei(),oL=Symbol("kCode"),sL=Symbol("kData"),aL=Symbol("kError"),cL=Symbol("kMessage"),uL=Symbol("kReason"),ja=Symbol("kTarget"),lL=Symbol("kType"),fL=Symbol("kWasClean"),ri=class{constructor(t){this[ja]=null,this[lL]=t}get target(){return this[ja]}get type(){return this[lL]}};Object.defineProperty(ri.prototype,"target",{enumerable:!0});Object.defineProperty(ri.prototype,"type",{enumerable:!0});var qo=class extends ri{constructor(t,r={}){super(t),this[oL]=r.code===void 0?0:r.code,this[uL]=r.reason===void 0?"":r.reason,this[fL]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[oL]}get reason(){return this[uL]}get wasClean(){return this[fL]}};Object.defineProperty(qo.prototype,"code",{enumerable:!0});Object.defineProperty(qo.prototype,"reason",{enumerable:!0});Object.defineProperty(qo.prototype,"wasClean",{enumerable:!0});var Ma=class extends ri{constructor(t,r={}){super(t),this[aL]=r.error===void 0?null:r.error,this[cL]=r.message===void 0?"":r.message}get error(){return this[aL]}get message(){return this[cL]}};Object.defineProperty(Ma.prototype,"error",{enumerable:!0});Object.defineProperty(Ma.prototype,"message",{enumerable:!0});var ll=class extends ri{constructor(t,r={}){super(t),this[sL]=r.data===void 0?null:r.data}get data(){return this[sL]}};Object.defineProperty(ll.prototype,"data",{enumerable:!0});var foe={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[ul]&&n[PE]===t&&!n[ul])return;let i;if(e==="message")i=function(o,s){let a=new ll("message",{data:s?o:o.toString()});a[ja]=this,Ih(t,this,a)};else if(e==="close")i=function(o,s){let a=new qo("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[ja]=this,Ih(t,this,a)};else if(e==="error")i=function(o){let s=new Ma("error",{error:o,message:o.message});s[ja]=this,Ih(t,this,s)};else if(e==="open")i=function(){let o=new ri("open");o[ja]=this,Ih(t,this,o)};else return;i[ul]=!!r[ul],i[PE]=t,r.once?this.once(e,i):this.on(e,i)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[PE]===t&&!r[ul]){this.removeListener(e,r);break}}};dL.exports={CloseEvent:qo,ErrorEvent:Ma,Event:ri,EventTarget:foe,MessageEvent:ll};function Ih(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var Oh=w((ETe,hL)=>{"use strict";var{tokenChars:fl}=Na();function _n(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function doe(e){let t=Object.create(null),r=Object.create(null),i=!1,n=!1,o=!1,s,a,c=-1,u=-1,l=-1,f=0;for(;f<e.length;f++)if(u=e.charCodeAt(f),s===void 0)if(l===-1&&fl[u]===1)c===-1&&(c=f);else if(f!==0&&(u===32||u===9))l===-1&&c!==-1&&(l=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f);let d=e.slice(c,l);u===44?(_n(t,d,r),r=Object.create(null)):s=d,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(l===-1&&fl[u]===1)c===-1&&(c=f);else if(u===32||u===9)l===-1&&c!==-1&&(l=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f),_n(r,e.slice(c,l),!0),u===44&&(_n(t,s,r),r=Object.create(null),s=void 0),c=l=-1}else if(u===61&&c!==-1&&l===-1)a=e.slice(c,f),c=l=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(n){if(fl[u]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:i||(i=!0),n=!1}else if(o)if(fl[u]===1)c===-1&&(c=f);else if(u===34&&c!==-1)o=!1,l=f;else if(u===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===34&&e.charCodeAt(f-1)===61)o=!0;else if(l===-1&&fl[u]===1)c===-1&&(c=f);else if(c!==-1&&(u===32||u===9))l===-1&&(l=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f);let d=e.slice(c,l);i&&(d=d.replace(/\\/g,""),i=!1),_n(r,a,d),u===44&&(_n(t,s,r),r=Object.create(null),s=void 0),a=void 0,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||o||u===32||u===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=f);let p=e.slice(c,l);return s===void 0?_n(t,p,r):(a===void 0?_n(r,p,!0):i?_n(r,a,p.replace(/\\/g,"")):_n(r,a,p),_n(t,s,r)),t}function poe(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(i=>[t].concat(Object.keys(i).map(n=>{let o=i[n];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?n:`${n}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}hL.exports={format:poe,parse:doe}});var Rh=w((ITe,TL)=>{"use strict";var hoe=B("events"),moe=B("https"),goe=B("http"),yL=B("net"),yoe=B("tls"),{randomBytes:voe,createHash:boe}=B("crypto"),{Duplex:kTe,Readable:TTe}=B("stream"),{URL:qE}=B("url"),Ui=Da(),_oe=$E(),woe=NE(),{isBlob:xoe}=Na(),{BINARY_TYPES:mL,CLOSE_TIMEOUT:Soe,EMPTY_BUFFER:Ch,GUID:Eoe,kForOnEventAttribute:jE,kListener:koe,kStatusCode:Toe,kWebSocket:Ft,NOOP:vL}=ei(),{EventTarget:{addEventListener:Ioe,removeEventListener:Ooe}}=pL(),{format:Coe,parse:Aoe}=Oh(),{toBuffer:$oe}=al(),bL=Symbol("kAborted"),ME=[8,13],ni=["CONNECTING","OPEN","CLOSING","CLOSED"],Roe=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,dt=class e extends hoe{constructor(t,r,i){super(),this._binaryType=mL[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Ch,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(i=r,r=[]):r=[r]),_L(this,t,r,i)):(this._autoPong=i.autoPong,this._closeTimeout=i.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){mL.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,i){let n=new _oe({allowSynchronousEvents:i.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation}),o=new woe(t,this._extensions,i.generateMask);this._receiver=n,this._sender=o,this._socket=t,n[Ft]=this,o[Ft]=this,t[Ft]=this,n.on("conclude",Poe),n.on("drain",qoe),n.on("error",joe),n.on("message",Moe),n.on("ping",Loe),n.on("pong",Foe),o.onerror=zoe,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",SL),t.on("data",$h),t.on("end",EL),t.on("error",kL),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Ui.extensionName]&&this._extensions[Ui.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){Ar(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,i=>{i||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),xL(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){LE(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Ch,r,i)}pong(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){LE(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Ch,r,i)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(i=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){LE(this,t,i);return}let n={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[Ui.extensionName]||(n.compress=!1),this._sender.send(t||Ch,n,i)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){Ar(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(dt,"CONNECTING",{enumerable:!0,value:ni.indexOf("CONNECTING")});Object.defineProperty(dt.prototype,"CONNECTING",{enumerable:!0,value:ni.indexOf("CONNECTING")});Object.defineProperty(dt,"OPEN",{enumerable:!0,value:ni.indexOf("OPEN")});Object.defineProperty(dt.prototype,"OPEN",{enumerable:!0,value:ni.indexOf("OPEN")});Object.defineProperty(dt,"CLOSING",{enumerable:!0,value:ni.indexOf("CLOSING")});Object.defineProperty(dt.prototype,"CLOSING",{enumerable:!0,value:ni.indexOf("CLOSING")});Object.defineProperty(dt,"CLOSED",{enumerable:!0,value:ni.indexOf("CLOSED")});Object.defineProperty(dt.prototype,"CLOSED",{enumerable:!0,value:ni.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(dt.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(dt.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[jE])return t[koe];return null},set(t){for(let r of this.listeners(e))if(r[jE]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[jE]:!0})}})});dt.prototype.addEventListener=Ioe;dt.prototype.removeEventListener=Ooe;TL.exports=dt;function _L(e,t,r,i){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Soe,protocolVersion:ME[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...i,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=n.autoPong,e._closeTimeout=n.closeTimeout,!ME.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${ME.join(", ")})`);let o;if(t instanceof qE)o=t;else try{o=new qE(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),e._url=o.href;let s=o.protocol==="wss:",a=o.protocol==="ws+unix:",c;if(o.protocol!=="ws:"&&!s&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!o.pathname?c="The URL's pathname is empty":o.hash&&(c="The URL contains a fragment identifier"),c){let m=new SyntaxError(c);if(e._redirects===0)throw m;Ah(e,m);return}let u=s?443:80,l=voe(16).toString("base64"),f=s?moe.request:goe.request,p=new Set,d;if(n.createConnection=n.createConnection||(s?Noe:Doe),n.defaultPort=n.defaultPort||u,n.port=o.port||u,n.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},n.path=o.pathname+o.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(d=new Ui({...n.perMessageDeflate,isServer:!1,maxPayload:n.maxPayload}),n.headers["Sec-WebSocket-Extensions"]=Coe({[Ui.extensionName]:d.offer()})),r.length){for(let m of r){if(typeof m!="string"||!Roe.test(m)||p.has(m))throw new SyntaxError("An invalid or duplicated subprotocol was specified");p.add(m)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(o.username||o.password)&&(n.auth=`${o.username}:${o.password}`),a){let m=n.path.split(":");n.socketPath=m[0],n.path=m[1]}let h;if(n.followRedirects){if(e._redirects===0){e._originalIpc=a,e._originalSecure=s,e._originalHostOrSocketPath=a?n.socketPath:o.host;let m=i&&i.headers;if(i={...i,headers:{}},m)for(let[_,k]of Object.entries(m))i.headers[_.toLowerCase()]=k}else if(e.listenerCount("redirect")===0){let m=a?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:o.host===e._originalHostOrSocketPath;(!m||e._originalSecure&&!s)&&(delete n.headers.authorization,delete n.headers.cookie,m||delete n.headers.host,n.auth=void 0)}n.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),h=e._req=f(n),e._redirects&&e.emit("redirect",e.url,h)}else h=e._req=f(n);n.timeout&&h.on("timeout",()=>{Ar(e,h,"Opening handshake has timed out")}),h.on("error",m=>{h===null||h[bL]||(h=e._req=null,Ah(e,m))}),h.on("response",m=>{let _=m.headers.location,k=m.statusCode;if(_&&n.followRedirects&&k>=300&&k<400){if(++e._redirects>n.maxRedirects){Ar(e,h,"Maximum redirects exceeded");return}h.abort();let S;try{S=new qE(_,t)}catch{let g=new SyntaxError(`Invalid URL: ${_}`);Ah(e,g);return}_L(e,S,r,i)}else e.emit("unexpected-response",h,m)||Ar(e,h,`Unexpected server response: ${m.statusCode}`)}),h.on("upgrade",(m,_,k)=>{if(e.emit("upgrade",m),e.readyState!==dt.CONNECTING)return;h=e._req=null;let S=m.headers.upgrade;if(S===void 0||S.toLowerCase()!=="websocket"){Ar(e,_,"Invalid Upgrade header");return}let v=boe("sha1").update(l+Eoe).digest("base64");if(m.headers["sec-websocket-accept"]!==v){Ar(e,_,"Invalid Sec-WebSocket-Accept header");return}let g=m.headers["sec-websocket-protocol"],y;if(g!==void 0?p.size?p.has(g)||(y="Server sent an invalid subprotocol"):y="Server sent a subprotocol but none was requested":p.size&&(y="Server sent no subprotocol"),y){Ar(e,_,y);return}g&&(e._protocol=g);let T=m.headers["sec-websocket-extensions"];if(T!==void 0){if(!d){Ar(e,_,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let R;try{R=Aoe(T)}catch{Ar(e,_,"Invalid Sec-WebSocket-Extensions header");return}let I=Object.keys(R);if(I.length!==1||I[0]!==Ui.extensionName){Ar(e,_,"Server indicated an extension that was not requested");return}try{d.accept(R[Ui.extensionName])}catch{Ar(e,_,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Ui.extensionName]=d}e.setSocket(_,k,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(h,e):h.end()}function Ah(e,t){e._readyState=dt.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function Doe(e){return e.path=e.socketPath,yL.connect(e)}function Noe(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=yL.isIP(e.host)?"":e.host),yoe.connect(e)}function Ar(e,t,r){e._readyState=dt.CLOSING;let i=new Error(r);Error.captureStackTrace(i,Ar),t.setHeader?(t[bL]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Ah,e,i)):(t.destroy(i),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function LE(e,t,r){if(t){let i=xoe(t)?t.size:$oe(t).length;e._socket?e._sender._bufferedBytes+=i:e._bufferedAmount+=i}if(r){let i=new Error(`WebSocket is not open: readyState ${e.readyState} (${ni[e.readyState]})`);process.nextTick(r,i)}}function Poe(e,t){let r=this[Ft];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Ft]!==void 0&&(r._socket.removeListener("data",$h),process.nextTick(wL,r._socket),e===1005?r.close():r.close(e,t))}function qoe(){let e=this[Ft];e.isPaused||e._socket.resume()}function joe(e){let t=this[Ft];t._socket[Ft]!==void 0&&(t._socket.removeListener("data",$h),process.nextTick(wL,t._socket),t.close(e[Toe])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function gL(){this[Ft].emitClose()}function Moe(e,t){this[Ft].emit("message",e,t)}function Loe(e){let t=this[Ft];t._autoPong&&t.pong(e,!this._isServer,vL),t.emit("ping",e)}function Foe(e){this[Ft].emit("pong",e)}function wL(e){e.resume()}function zoe(e){let t=this[Ft];t.readyState!==dt.CLOSED&&(t.readyState===dt.OPEN&&(t._readyState=dt.CLOSING,xL(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function xL(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function SL(){let e=this[Ft];if(this.removeListener("close",SL),this.removeListener("data",$h),this.removeListener("end",EL),e._readyState=dt.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[Ft]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",gL),e._receiver.on("finish",gL))}function $h(e){this[Ft]._receiver.write(e)||this.pause()}function EL(){let e=this[Ft];e._readyState=dt.CLOSING,e._receiver.end(),this.end()}function kL(){let e=this[Ft];this.removeListener("error",kL),this.on("error",vL),e&&(e._readyState=dt.CLOSING,this.destroy())}});var AL=w((CTe,CL)=>{"use strict";var OTe=Rh(),{Duplex:Uoe}=B("stream");function IL(e){e.emit("close")}function Boe(){!this.destroyed&&this._writableState.finished&&this.destroy()}function OL(e){this.removeListener("error",OL),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function Woe(e,t){let r=!0,i=new Uoe({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(o,s){let a=!s&&i._readableState.objectMode?o.toString():o;i.push(a)||e.pause()}),e.once("error",function(o){i.destroyed||(r=!1,i.destroy(o))}),e.once("close",function(){i.destroyed||i.push(null)}),i._destroy=function(n,o){if(e.readyState===e.CLOSED){o(n),process.nextTick(IL,i);return}let s=!1;e.once("error",function(c){s=!0,o(c)}),e.once("close",function(){s||o(n),process.nextTick(IL,i)}),r&&e.terminate()},i._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){i._final(n)});return}e._socket!==null&&(e._socket._writableState.finished?(n(),i._readableState.endEmitted&&i.destroy()):(e._socket.once("finish",function(){n()}),e.close()))},i._read=function(){e.isPaused&&e.resume()},i._write=function(n,o,s){if(e.readyState===e.CONNECTING){e.once("open",function(){i._write(n,o,s)});return}e.send(n,s)},i.on("end",Boe),i.on("error",OL),i}CL.exports=Woe});var FE=w((ATe,$L)=>{"use strict";var{tokenChars:Hoe}=Na();function Voe(e){let t=new Set,r=-1,i=-1,n=0;for(n;n<e.length;n++){let s=e.charCodeAt(n);if(i===-1&&Hoe[s]===1)r===-1&&(r=n);else if(n!==0&&(s===32||s===9))i===-1&&r!==-1&&(i=n);else if(s===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);i===-1&&(i=n);let a=e.slice(r,i);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);t.add(a),r=i=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||i!==-1)throw new SyntaxError("Unexpected end of input");let o=e.slice(r,n);if(t.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}$L.exports={parse:Voe}});var ML=w((RTe,jL)=>{"use strict";var Zoe=B("events"),Dh=B("http"),{Duplex:$Te}=B("stream"),{createHash:Goe}=B("crypto"),RL=Oh(),jo=Da(),Koe=FE(),Xoe=Rh(),{CLOSE_TIMEOUT:Joe,GUID:Yoe,kWebSocket:Qoe}=ei(),ese=/^[+/0-9A-Za-z]{22}==$/,DL=0,NL=1,qL=2,zE=class extends Zoe{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Joe,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Xoe,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Dh.createServer((i,n)=>{let o=Dh.STATUS_CODES[426];n.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),n.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=tse(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,o,s)=>{this.handleUpgrade(n,o,s,i)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=DL}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===qL){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(dl,this);return}if(t&&this.once("close",t),this._state!==NL)if(this._state=NL,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(dl,this):process.nextTick(dl,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{dl(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,i,n){r.on("error",PL);let o=t.headers["sec-websocket-key"],s=t.headers.upgrade,a=+t.headers["sec-websocket-version"];if(t.method!=="GET"){Mo(this,t,r,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){Mo(this,t,r,400,"Invalid Upgrade header");return}if(o===void 0||!ese.test(o)){Mo(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Mo(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){pl(r,400);return}let c=t.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=Koe.parse(c)}catch{Mo(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let l=t.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&l!==void 0){let p=new jo({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let d=RL.parse(l);d[jo.extensionName]&&(p.accept(d[jo.extensionName]),f[jo.extensionName]=p)}catch{Mo(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let p={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(p,(d,h,m,_)=>{if(!d)return pl(r,h||401,m,_);this.completeUpgrade(f,o,u,t,r,i,n)});return}if(!this.options.verifyClient(p))return pl(r,401)}this.completeUpgrade(f,o,u,t,r,i,n)}completeUpgrade(t,r,i,n,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[Qoe])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>DL)return pl(o,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Goe("sha1").update(r+Yoe).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(i.size){let f=this.options.handleProtocols?this.options.handleProtocols(i,n):i.values().next().value;f&&(u.push(`Sec-WebSocket-Protocol: ${f}`),l._protocol=f)}if(t[jo.extensionName]){let f=t[jo.extensionName].params,p=RL.format({[jo.extensionName]:[f]});u.push(`Sec-WebSocket-Extensions: ${p}`),l._extensions=t}this.emit("headers",u,n),o.write(u.concat(`\r
|
|
188
188
|
`).join(`\r
|
|
189
189
|
`)),o.removeListener("error",PL),l.setSocket(o,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(dl,this)})),a(l,n)}};jL.exports=zE;function tse(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let i of Object.keys(t))e.removeListener(i,t[i])}}function dl(e){e._state=qL,e.emit("close")}function PL(){this.destroy()}function pl(e,t,r,i){r=r||Dh.STATUS_CODES[t],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...i},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${Dh.STATUS_CODES[t]}\r
|
|
190
190
|
`+Object.keys(i).map(n=>`${n}: ${i[n]}`).join(`\r
|
|
191
191
|
`)+`\r
|
|
192
192
|
\r
|
|
193
|
-
`+r)}function Mo(e,t,r,i,n,o){if(e.listenerCount("wsClientError")){let s=new Error(n);Error.captureStackTrace(s,Mo),e.emit("wsClientError",s,r,t)}else pl(r,i,n,o)}});var VE=w((
|
|
193
|
+
`+r)}function Mo(e,t,r,i,n,o){if(e.listenerCount("wsClientError")){let s=new Error(n);Error.captureStackTrace(s,Mo),e.emit("wsClientError",s,r,t)}else pl(r,i,n,o)}});var VE=w((fIe,HL)=>{var Ba=1e3,Wa=Ba*60,Ha=Wa*60,zo=Ha*24,qse=zo*7,jse=zo*365.25;HL.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Mse(e);if(r==="number"&&isFinite(e))return t.long?Fse(e):Lse(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Mse(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),i=(t[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*jse;case"weeks":case"week":case"w":return r*qse;case"days":case"day":case"d":return r*zo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ha;case"minutes":case"minute":case"mins":case"min":case"m":return r*Wa;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ba;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Lse(e){var t=Math.abs(e);return t>=zo?Math.round(e/zo)+"d":t>=Ha?Math.round(e/Ha)+"h":t>=Wa?Math.round(e/Wa)+"m":t>=Ba?Math.round(e/Ba)+"s":e+"ms"}function Fse(e){var t=Math.abs(e);return t>=zo?Wh(e,t,zo,"day"):t>=Ha?Wh(e,t,Ha,"hour"):t>=Wa?Wh(e,t,Wa,"minute"):t>=Ba?Wh(e,t,Ba,"second"):e+" ms"}function Wh(e,t,r,i){var n=t>=r*1.5;return Math.round(e/r)+" "+i+(n?"s":"")}});var ZE=w((dIe,VL)=>{function zse(e){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=n,r.enabled=a,r.humanize=VE(),r.destroy=u,Object.keys(e).forEach(l=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let f=0;for(let p=0;p<l.length;p++)f=(f<<5)-f+l.charCodeAt(p),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=t;function r(l){let f,p=null,d,h;function m(..._){if(!m.enabled)return;let k=m,S=Number(new Date),v=S-(f||S);k.diff=v,k.prev=f,k.curr=S,f=S,_[0]=r.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let g=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(T,R)=>{if(T==="%%")return"%";g++;let I=r.formatters[R];if(typeof I=="function"){let b=_[g];T=I.call(k,b),_.splice(g,1),g--}return T}),r.formatArgs.call(k,_),(k.log||r.log).apply(k,_)}return m.namespace=l,m.useColors=r.useColors(),m.color=r.selectColor(l),m.extend=i,m.destroy=r.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(d!==r.namespaces&&(d=r.namespaces,h=r.enabled(l)),h),set:_=>{p=_}}),typeof r.init=="function"&&r.init(m),m}function i(l,f){let p=r(this.namespace+(typeof f>"u"?":":f)+l);return p.log=this.log,p}function n(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of f)p[0]==="-"?r.skips.push(p.slice(1)):r.names.push(p)}function o(l,f){let p=0,d=0,h=-1,m=0;for(;p<l.length;)if(d<f.length&&(f[d]===l[p]||f[d]==="*"))f[d]==="*"?(h=d,m=p,d++):(p++,d++);else if(h!==-1)d=h+1,m++,p=m;else return!1;for(;d<f.length&&f[d]==="*";)d++;return d===f.length}function s(){let l=[...r.names,...r.skips.map(f=>"-"+f)].join(",");return r.enable(""),l}function a(l){for(let f of r.skips)if(o(l,f))return!1;for(let f of r.names)if(o(l,f))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}VL.exports=zse});var ZL=w((wr,Hh)=>{wr.formatArgs=Bse;wr.save=Wse;wr.load=Hse;wr.useColors=Use;wr.storage=Vse();wr.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();wr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Use(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Bse(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Hh.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(i=r))}),e.splice(i,0,t)}wr.log=console.debug||console.log||(()=>{});function Wse(e){try{e?wr.storage.setItem("debug",e):wr.storage.removeItem("debug")}catch{}}function Hse(){let e;try{e=wr.storage.getItem("debug")||wr.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Vse(){try{return localStorage}catch{}}Hh.exports=ZE()(wr);var{formatters:Zse}=Hh.exports;Zse.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var KL=w((pIe,GL)=>{"use strict";GL.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",i=t.indexOf(r+e),n=t.indexOf("--");return i!==-1&&(n===-1||i<n)}});var YL=w((hIe,JL)=>{"use strict";var Gse=B("os"),XL=B("tty"),zr=KL(),{env:zt}=process,Wi;zr("no-color")||zr("no-colors")||zr("color=false")||zr("color=never")?Wi=0:(zr("color")||zr("colors")||zr("color=true")||zr("color=always"))&&(Wi=1);"FORCE_COLOR"in zt&&(zt.FORCE_COLOR==="true"?Wi=1:zt.FORCE_COLOR==="false"?Wi=0:Wi=zt.FORCE_COLOR.length===0?1:Math.min(parseInt(zt.FORCE_COLOR,10),3));function GE(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function KE(e,t){if(Wi===0)return 0;if(zr("color=16m")||zr("color=full")||zr("color=truecolor"))return 3;if(zr("color=256"))return 2;if(e&&!t&&Wi===void 0)return 0;let r=Wi||0;if(zt.TERM==="dumb")return r;if(process.platform==="win32"){let i=Gse.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in zt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in zt)||zt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in zt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(zt.TEAMCITY_VERSION)?1:0;if(zt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in zt){let i=parseInt((zt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(zt.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(zt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(zt.TERM)||"COLORTERM"in zt?1:r}function Kse(e){let t=KE(e,e&&e.isTTY);return GE(t)}JL.exports={supportsColor:Kse,stdout:GE(KE(!0,XL.isatty(1))),stderr:GE(KE(!0,XL.isatty(2)))}});var eF=w((Ut,Zh)=>{var Xse=B("tty"),Vh=B("util");Ut.init=nae;Ut.log=eae;Ut.formatArgs=Yse;Ut.save=tae;Ut.load=rae;Ut.useColors=Jse;Ut.destroy=Vh.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Ut.colors=[6,2,3,4,5,1];try{let e=YL();e&&(e.stderr||e).level>=2&&(Ut.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Ut.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(n,o)=>o.toUpperCase()),i=process.env[t];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i==="null"?i=null:i=Number(i),e[r]=i,e},{});function Jse(){return"colors"in Ut.inspectOpts?!!Ut.inspectOpts.colors:Xse.isatty(process.stderr.fd)}function Yse(e){let{namespace:t,useColors:r}=this;if(r){let i=this.color,n="\x1B[3"+(i<8?i:"8;5;"+i),o=` ${n};1m${t} \x1B[0m`;e[0]=o+e[0].split(`
|
|
194
194
|
`).join(`
|
|
195
195
|
`+o),e.push(n+"m+"+Zh.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Qse()+t+" "+e[0]}function Qse(){return Ut.inspectOpts.hideDate?"":new Date().toISOString()+" "}function eae(...e){return process.stderr.write(Vh.formatWithOptions(Ut.inspectOpts,...e)+`
|
|
196
196
|
`)}function tae(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function rae(){return process.env.DEBUG}function nae(e){e.inspectOpts={};let t=Object.keys(Ut.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=Ut.inspectOpts[t[r]]}Zh.exports=ZE()(Ut);var{formatters:QL}=Zh.exports;QL.o=function(e){return this.inspectOpts.colors=this.useColors,Vh.inspect(e,this.inspectOpts).split(`
|
|
197
|
-
`).map(t=>t.trim()).join(" ")};QL.O=function(e){return this.inspectOpts.colors=this.useColors,Vh.inspect(e,this.inspectOpts)}});var Va=w((
|
|
197
|
+
`).map(t=>t.trim()).join(" ")};QL.O=function(e){return this.inspectOpts.colors=this.useColors,Vh.inspect(e,this.inspectOpts)}});var Va=w((mIe,XE)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?XE.exports=ZL():XE.exports=eF()});var rF=w((gIe,tF)=>{"use strict";tF.exports=(e,t)=>new Promise((r,i)=>{if(typeof e.resume!="function"||(e.unpipe&&e.unpipe(),e.resume(),e._readableState&&e._readableState.ended)||!e.readable||e.destroyed)return r();function n(){e.removeListener("end",o),e.removeListener("close",o),e.removeListener("error",s)}function o(){n(),r()}function s(a){n(),t?i(a):r()}e.on("end",o),e.on("close",o),e.on("error",s)})});var Gh=w(JE=>{(function(){JE.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
|
|
198
198
|
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(JE)});var xn=w((nF,Hi)=>{(function(){var e,t,r,i,n,o,s,a=[].slice,c={}.hasOwnProperty;e=function(){var u,l,f,p,d,h;if(h=arguments[0],d=2<=arguments.length?a.call(arguments,1):[],n(Object.assign))Object.assign.apply(null,arguments);else for(u=0,f=d.length;u<f;u++)if(p=d[u],p!=null)for(l in p)c.call(p,l)&&(h[l]=p[l]);return h},n=function(u){return!!u&&Object.prototype.toString.call(u)==="[object Function]"},o=function(u){var l;return!!u&&((l=typeof u)=="function"||l==="object")},r=function(u){return n(Array.isArray)?Array.isArray(u):Object.prototype.toString.call(u)==="[object Array]"},i=function(u){var l;if(r(u))return!u.length;for(l in u)if(c.call(u,l))return!1;return!0},s=function(u){var l,f;return o(u)&&(f=Object.getPrototypeOf(u))&&(l=f.constructor)&&typeof l=="function"&&l instanceof l&&Function.prototype.toString.call(l)===Function.prototype.toString.call(Object)},t=function(u){return n(u.valueOf)?u.valueOf():u},Hi.exports.assign=e,Hi.exports.isFunction=n,Hi.exports.isObject=o,Hi.exports.isArray=r,Hi.exports.isEmpty=i,Hi.exports.isPlainObject=s,Hi.exports.getValue=t}).call(nF)});var YE=w((iF,oF)=>{(function(){var e;oF.exports=e=(function(){function t(){}return t.prototype.hasFeature=function(r,i){return!0},t.prototype.createDocumentType=function(r,i,n){throw new Error("This DOM method is not implemented.")},t.prototype.createDocument=function(r,i,n){throw new Error("This DOM method is not implemented.")},t.prototype.createHTMLDocument=function(r){throw new Error("This DOM method is not implemented.")},t.prototype.getFeature=function(r,i){throw new Error("This DOM method is not implemented.")},t})()}).call(iF)});var cF=w((sF,aF)=>{(function(){var e;aF.exports=e=(function(){function t(){}return t.prototype.handleError=function(r){throw new Error(r)},t})()}).call(sF)});var fF=w((uF,lF)=>{(function(){var e;lF.exports=e=(function(){function t(r){this.arr=r||[]}return Object.defineProperty(t.prototype,"length",{get:function(){return this.arr.length}}),t.prototype.item=function(r){return this.arr[r]||null},t.prototype.contains=function(r){return this.arr.indexOf(r)!==-1},t})()}).call(uF)});var hF=w((dF,pF)=>{(function(){var e,t,r;t=cF(),r=fF(),pF.exports=e=(function(){function i(){var n;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new t,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=n=Object.create(this.defaultParams)}return Object.defineProperty(i.prototype,"parameterNames",{get:function(){return new r(Object.keys(this.defaultParams))}}),i.prototype.getParameter=function(n){return this.params.hasOwnProperty(n)?this.params[n]:null},i.prototype.canSetParameter=function(n,o){return!0},i.prototype.setParameter=function(n,o){return o!=null?this.params[n]=o:delete this.params[n]},i})()}).call(dF)});var It=w((mF,gF)=>{(function(){gF.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(mF)});var QE=w((yF,vF)=>{(function(){var e,t,r;e=It(),r=$r(),vF.exports=t=(function(){function i(n,o,s){if(this.parent=n,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),o==null)throw new Error("Missing attribute name. "+this.debugInfo(o));this.name=this.stringify.name(o),this.value=this.stringify.attValue(s),this.type=e.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(i.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(i.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(i.prototype,"textContent",{get:function(){return this.value},set:function(n){return this.value=n||""}}),Object.defineProperty(i.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(i.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(i.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(i.prototype,"specified",{get:function(){return!0}}),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(n){return this.options.writer.attribute(this,this.options.writer.filterOptions(n))},i.prototype.debugInfo=function(n){return n=n||this.name,n==null?"parent: <"+this.parent.name+">":"attribute: {"+n+"}, parent: <"+this.parent.name+">"},i.prototype.isEqualNode=function(n){return!(n.namespaceURI!==this.namespaceURI||n.prefix!==this.prefix||n.localName!==this.localName||n.value!==this.value)},i})()}).call(yF)});var Kh=w((bF,_F)=>{(function(){var e;_F.exports=e=(function(){function t(r){this.nodes=r}return Object.defineProperty(t.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),t.prototype.clone=function(){return this.nodes=null},t.prototype.getNamedItem=function(r){return this.nodes[r]},t.prototype.setNamedItem=function(r){var i;return i=this.nodes[r.nodeName],this.nodes[r.nodeName]=r,i||null},t.prototype.removeNamedItem=function(r){var i;return i=this.nodes[r],delete this.nodes[r],i||null},t.prototype.item=function(r){return this.nodes[Object.keys(this.nodes)[r]]||null},t.prototype.getNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")},t.prototype.setNamedItemNS=function(r){throw new Error("This DOM method is not implemented.")},t.prototype.removeNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")},t})()}).call(bF)});var Xh=w((wF,xF)=>{(function(){var e,t,r,i,n,o,s,a,c,u=function(f,p){for(var d in p)l.call(p,d)&&(f[d]=p[d]);function h(){this.constructor=f}return h.prototype=p.prototype,f.prototype=new h,f.__super__=p.prototype,f},l={}.hasOwnProperty;c=xn(),a=c.isObject,s=c.isFunction,o=c.getValue,n=$r(),e=It(),t=QE(),i=Kh(),xF.exports=r=(function(f){u(p,f);function p(d,h,m){var _,k,S,v;if(p.__super__.constructor.call(this,d),h==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(h),this.type=e.Element,this.attribs={},this.schemaTypeInfo=null,m!=null&&this.attribute(m),d.type===e.Document&&(this.isRoot=!0,this.documentObject=d,d.rootObject=this,d.children)){for(v=d.children,k=0,S=v.length;k<S;k++)if(_=v[k],_.type===e.DocType){_.name=this.name;break}}}return Object.defineProperty(p.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(p.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(p.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(p.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(p.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(p.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(p.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(p.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new i(this.attribs)),this.attributeMap}}),p.prototype.clone=function(){var d,h,m,_;m=Object.create(this),m.isRoot&&(m.documentObject=null),m.attribs={},_=this.attribs;for(h in _)l.call(_,h)&&(d=_[h],m.attribs[h]=d.clone());return m.children=[],this.children.forEach(function(k){var S;return S=k.clone(),S.parent=m,m.children.push(S)}),m},p.prototype.attribute=function(d,h){var m,_;if(d!=null&&(d=o(d)),a(d))for(m in d)l.call(d,m)&&(_=d[m],this.attribute(m,_));else s(h)&&(h=h.apply()),this.options.keepNullAttributes&&h==null?this.attribs[d]=new t(this,d,""):h!=null&&(this.attribs[d]=new t(this,d,h));return this},p.prototype.removeAttribute=function(d){var h,m,_;if(d==null)throw new Error("Missing attribute name. "+this.debugInfo());if(d=o(d),Array.isArray(d))for(m=0,_=d.length;m<_;m++)h=d[m],delete this.attribs[h];else delete this.attribs[d];return this},p.prototype.toString=function(d){return this.options.writer.element(this,this.options.writer.filterOptions(d))},p.prototype.att=function(d,h){return this.attribute(d,h)},p.prototype.a=function(d,h){return this.attribute(d,h)},p.prototype.getAttribute=function(d){return this.attribs.hasOwnProperty(d)?this.attribs[d].value:null},p.prototype.setAttribute=function(d,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getAttributeNode=function(d){return this.attribs.hasOwnProperty(d)?this.attribs[d]:null},p.prototype.setAttributeNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.removeAttributeNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByTagName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getAttributeNS=function(d,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.setAttributeNS=function(d,h,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.removeAttributeNS=function(d,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getAttributeNodeNS=function(d,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.setAttributeNodeNS=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByTagNameNS=function(d,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.hasAttribute=function(d){return this.attribs.hasOwnProperty(d)},p.prototype.hasAttributeNS=function(d,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.setIdAttribute=function(d,h){return this.attribs.hasOwnProperty(d)?this.attribs[d].isId:h},p.prototype.setIdAttributeNS=function(d,h,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.setIdAttributeNode=function(d,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByTagName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByTagNameNS=function(d,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByClassName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.isEqualNode=function(d){var h,m,_;if(!p.__super__.isEqualNode.apply(this,arguments).isEqualNode(d)||d.namespaceURI!==this.namespaceURI||d.prefix!==this.prefix||d.localName!==this.localName||d.attribs.length!==this.attribs.length)return!1;for(h=m=0,_=this.attribs.length-1;0<=_?m<=_:m>=_;h=0<=_?++m:--m)if(!this.attribs[h].isEqualNode(d.attribs[h]))return!1;return!0},p})(n)}).call(wF)});var _l=w((SF,EF)=>{(function(){var e,t,r=function(n,o){for(var s in o)i.call(o,s)&&(n[s]=o[s]);function a(){this.constructor=n}return a.prototype=o.prototype,n.prototype=new a,n.__super__=o.prototype,n},i={}.hasOwnProperty;t=$r(),EF.exports=e=(function(n){r(o,n);function o(s){o.__super__.constructor.call(this,s),this.value=""}return Object.defineProperty(o.prototype,"data",{get:function(){return this.value},set:function(s){return this.value=s||""}}),Object.defineProperty(o.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(o.prototype,"textContent",{get:function(){return this.value},set:function(s){return this.value=s||""}}),o.prototype.clone=function(){return Object.create(this)},o.prototype.substringData=function(s,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.appendData=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.insertData=function(s,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.deleteData=function(s,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.replaceData=function(s,a,c){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.isEqualNode=function(s){return!(!o.__super__.isEqualNode.apply(this,arguments).isEqualNode(s)||s.data!==this.data)},o})(t)}).call(SF)});var Jh=w((kF,TF)=>{(function(){var e,t,r,i=function(o,s){for(var a in s)n.call(s,a)&&(o[a]=s[a]);function c(){this.constructor=o}return c.prototype=s.prototype,o.prototype=new c,o.__super__=s.prototype,o},n={}.hasOwnProperty;e=It(),r=_l(),TF.exports=t=(function(o){i(s,o);function s(a,c){if(s.__super__.constructor.call(this,a),c==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=e.CData,this.value=this.stringify.cdata(c)}return s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.cdata(this,this.options.writer.filterOptions(a))},s})(r)}).call(kF)});var Yh=w((IF,OF)=>{(function(){var e,t,r,i=function(o,s){for(var a in s)n.call(s,a)&&(o[a]=s[a]);function c(){this.constructor=o}return c.prototype=s.prototype,o.prototype=new c,o.__super__=s.prototype,o},n={}.hasOwnProperty;e=It(),t=_l(),OF.exports=r=(function(o){i(s,o);function s(a,c){if(s.__super__.constructor.call(this,a),c==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=e.Comment,this.value=this.stringify.comment(c)}return s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.comment(this,this.options.writer.filterOptions(a))},s})(t)}).call(IF)});var Qh=w((CF,AF)=>{(function(){var e,t,r,i,n=function(s,a){for(var c in a)o.call(a,c)&&(s[c]=a[c]);function u(){this.constructor=s}return u.prototype=a.prototype,s.prototype=new u,s.__super__=a.prototype,s},o={}.hasOwnProperty;i=xn().isObject,r=$r(),e=It(),AF.exports=t=(function(s){n(a,s);function a(c,u,l,f){var p;a.__super__.constructor.call(this,c),i(u)&&(p=u,u=p.version,l=p.encoding,f=p.standalone),u||(u="1.0"),this.type=e.Declaration,this.version=this.stringify.xmlVersion(u),l!=null&&(this.encoding=this.stringify.xmlEncoding(l)),f!=null&&(this.standalone=this.stringify.xmlStandalone(f))}return a.prototype.toString=function(c){return this.options.writer.declaration(this,this.options.writer.filterOptions(c))},a})(r)}).call(CF)});var em=w(($F,RF)=>{(function(){var e,t,r,i=function(o,s){for(var a in s)n.call(s,a)&&(o[a]=s[a]);function c(){this.constructor=o}return c.prototype=s.prototype,o.prototype=new c,o.__super__=s.prototype,o},n={}.hasOwnProperty;r=$r(),e=It(),RF.exports=t=(function(o){i(s,o);function s(a,c,u,l,f,p){if(s.__super__.constructor.call(this,a),c==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(u==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(c));if(!l)throw new Error("Missing DTD attribute type. "+this.debugInfo(c));if(!f)throw new Error("Missing DTD attribute default. "+this.debugInfo(c));if(f.indexOf("#")!==0&&(f="#"+f),!f.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(c));if(p&&!f.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(c));this.elementName=this.stringify.name(c),this.type=e.AttributeDeclaration,this.attributeName=this.stringify.name(u),this.attributeType=this.stringify.dtdAttType(l),p&&(this.defaultValue=this.stringify.dtdAttDefault(p)),this.defaultValueType=f}return s.prototype.toString=function(a){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(a))},s})(r)}).call($F)});var tm=w((DF,NF)=>{(function(){var e,t,r,i,n=function(s,a){for(var c in a)o.call(a,c)&&(s[c]=a[c]);function u(){this.constructor=s}return u.prototype=a.prototype,s.prototype=new u,s.__super__=a.prototype,s},o={}.hasOwnProperty;i=xn().isObject,r=$r(),e=It(),NF.exports=t=(function(s){n(a,s);function a(c,u,l,f){if(a.__super__.constructor.call(this,c),l==null)throw new Error("Missing DTD entity name. "+this.debugInfo(l));if(f==null)throw new Error("Missing DTD entity value. "+this.debugInfo(l));if(this.pe=!!u,this.name=this.stringify.name(l),this.type=e.EntityDeclaration,!i(f))this.value=this.stringify.dtdEntityValue(f),this.internal=!0;else{if(!f.pubID&&!f.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(l));if(f.pubID&&!f.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(l));if(this.internal=!1,f.pubID!=null&&(this.pubID=this.stringify.dtdPubID(f.pubID)),f.sysID!=null&&(this.sysID=this.stringify.dtdSysID(f.sysID)),f.nData!=null&&(this.nData=this.stringify.dtdNData(f.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(l))}}return Object.defineProperty(a.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(a.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(a.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(a.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(a.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(a.prototype,"xmlVersion",{get:function(){return null}}),a.prototype.toString=function(c){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(c))},a})(r)}).call(DF)});var rm=w((PF,qF)=>{(function(){var e,t,r,i=function(o,s){for(var a in s)n.call(s,a)&&(o[a]=s[a]);function c(){this.constructor=o}return c.prototype=s.prototype,o.prototype=new c,o.__super__=s.prototype,o},n={}.hasOwnProperty;r=$r(),e=It(),qF.exports=t=(function(o){i(s,o);function s(a,c,u){if(s.__super__.constructor.call(this,a),c==null)throw new Error("Missing DTD element name. "+this.debugInfo());u||(u="(#PCDATA)"),Array.isArray(u)&&(u="("+u.join(",")+")"),this.name=this.stringify.name(c),this.type=e.ElementDeclaration,this.value=this.stringify.dtdElementValue(u)}return s.prototype.toString=function(a){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(a))},s})(r)}).call(PF)});var nm=w((jF,MF)=>{(function(){var e,t,r,i=function(o,s){for(var a in s)n.call(s,a)&&(o[a]=s[a]);function c(){this.constructor=o}return c.prototype=s.prototype,o.prototype=new c,o.__super__=s.prototype,o},n={}.hasOwnProperty;r=$r(),e=It(),MF.exports=t=(function(o){i(s,o);function s(a,c,u){if(s.__super__.constructor.call(this,a),c==null)throw new Error("Missing DTD notation name. "+this.debugInfo(c));if(!u.pubID&&!u.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(c));this.name=this.stringify.name(c),this.type=e.NotationDeclaration,u.pubID!=null&&(this.pubID=this.stringify.dtdPubID(u.pubID)),u.sysID!=null&&(this.sysID=this.stringify.dtdSysID(u.sysID))}return Object.defineProperty(s.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(s.prototype,"systemId",{get:function(){return this.sysID}}),s.prototype.toString=function(a){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(a))},s})(r)}).call(jF)});var im=w((LF,FF)=>{(function(){var e,t,r,i,n,o,s,a,c,u=function(f,p){for(var d in p)l.call(p,d)&&(f[d]=p[d]);function h(){this.constructor=f}return h.prototype=p.prototype,f.prototype=new h,f.__super__=p.prototype,f},l={}.hasOwnProperty;c=xn().isObject,a=$r(),e=It(),t=em(),i=tm(),r=rm(),n=nm(),s=Kh(),FF.exports=o=(function(f){u(p,f);function p(d,h,m){var _,k,S,v,g,y;if(p.__super__.constructor.call(this,d),this.type=e.DocType,d.children){for(v=d.children,k=0,S=v.length;k<S;k++)if(_=v[k],_.type===e.Element){this.name=_.name;break}}this.documentObject=d,c(h)&&(g=h,h=g.pubID,m=g.sysID),m==null&&(y=[h,m],m=y[0],h=y[1]),h!=null&&(this.pubID=this.stringify.dtdPubID(h)),m!=null&&(this.sysID=this.stringify.dtdSysID(m))}return Object.defineProperty(p.prototype,"entities",{get:function(){var d,h,m,_,k;for(_={},k=this.children,h=0,m=k.length;h<m;h++)d=k[h],d.type===e.EntityDeclaration&&!d.pe&&(_[d.name]=d);return new s(_)}}),Object.defineProperty(p.prototype,"notations",{get:function(){var d,h,m,_,k;for(_={},k=this.children,h=0,m=k.length;h<m;h++)d=k[h],d.type===e.NotationDeclaration&&(_[d.name]=d);return new s(_)}}),Object.defineProperty(p.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(p.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(p.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),p.prototype.element=function(d,h){var m;return m=new r(this,d,h),this.children.push(m),this},p.prototype.attList=function(d,h,m,_,k){var S;return S=new t(this,d,h,m,_,k),this.children.push(S),this},p.prototype.entity=function(d,h){var m;return m=new i(this,!1,d,h),this.children.push(m),this},p.prototype.pEntity=function(d,h){var m;return m=new i(this,!0,d,h),this.children.push(m),this},p.prototype.notation=function(d,h){var m;return m=new n(this,d,h),this.children.push(m),this},p.prototype.toString=function(d){return this.options.writer.docType(this,this.options.writer.filterOptions(d))},p.prototype.ele=function(d,h){return this.element(d,h)},p.prototype.att=function(d,h,m,_,k){return this.attList(d,h,m,_,k)},p.prototype.ent=function(d,h){return this.entity(d,h)},p.prototype.pent=function(d,h){return this.pEntity(d,h)},p.prototype.not=function(d,h){return this.notation(d,h)},p.prototype.up=function(){return this.root()||this.documentObject},p.prototype.isEqualNode=function(d){return!(!p.__super__.isEqualNode.apply(this,arguments).isEqualNode(d)||d.name!==this.name||d.publicId!==this.publicId||d.systemId!==this.systemId)},p})(a)}).call(LF)});var om=w((zF,UF)=>{(function(){var e,t,r,i=function(o,s){for(var a in s)n.call(s,a)&&(o[a]=s[a]);function c(){this.constructor=o}return c.prototype=s.prototype,o.prototype=new c,o.__super__=s.prototype,o},n={}.hasOwnProperty;e=It(),t=$r(),UF.exports=r=(function(o){i(s,o);function s(a,c){if(s.__super__.constructor.call(this,a),c==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=e.Raw,this.value=this.stringify.raw(c)}return s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.raw(this,this.options.writer.filterOptions(a))},s})(t)}).call(zF)});var sm=w((BF,WF)=>{(function(){var e,t,r,i=function(o,s){for(var a in s)n.call(s,a)&&(o[a]=s[a]);function c(){this.constructor=o}return c.prototype=s.prototype,o.prototype=new c,o.__super__=s.prototype,o},n={}.hasOwnProperty;e=It(),t=_l(),WF.exports=r=(function(o){i(s,o);function s(a,c){if(s.__super__.constructor.call(this,a),c==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=e.Text,this.value=this.stringify.text(c)}return Object.defineProperty(s.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(s.prototype,"wholeText",{get:function(){var a,c,u;for(u="",c=this.previousSibling;c;)u=c.data+u,c=c.previousSibling;for(u+=this.data,a=this.nextSibling;a;)u=u+a.data,a=a.nextSibling;return u}}),s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.text(this,this.options.writer.filterOptions(a))},s.prototype.splitText=function(a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.replaceWholeText=function(a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s})(t)}).call(BF)});var am=w((HF,VF)=>{(function(){var e,t,r,i=function(o,s){for(var a in s)n.call(s,a)&&(o[a]=s[a]);function c(){this.constructor=o}return c.prototype=s.prototype,o.prototype=new c,o.__super__=s.prototype,o},n={}.hasOwnProperty;e=It(),t=_l(),VF.exports=r=(function(o){i(s,o);function s(a,c,u){if(s.__super__.constructor.call(this,a),c==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=e.ProcessingInstruction,this.target=this.stringify.insTarget(c),this.name=this.target,u&&(this.value=this.stringify.insValue(u))}return s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(a))},s.prototype.isEqualNode=function(a){return!(!s.__super__.isEqualNode.apply(this,arguments).isEqualNode(a)||a.target!==this.target)},s})(t)}).call(HF)});var ek=w((ZF,GF)=>{(function(){var e,t,r,i=function(o,s){for(var a in s)n.call(s,a)&&(o[a]=s[a]);function c(){this.constructor=o}return c.prototype=s.prototype,o.prototype=new c,o.__super__=s.prototype,o},n={}.hasOwnProperty;r=$r(),e=It(),GF.exports=t=(function(o){i(s,o);function s(a){s.__super__.constructor.call(this,a),this.type=e.Dummy}return s.prototype.clone=function(){return Object.create(this)},s.prototype.toString=function(a){return""},s})(r)}).call(ZF)});var JF=w((KF,XF)=>{(function(){var e;XF.exports=e=(function(){function t(r){this.nodes=r}return Object.defineProperty(t.prototype,"length",{get:function(){return this.nodes.length||0}}),t.prototype.clone=function(){return this.nodes=null},t.prototype.item=function(r){return this.nodes[r]||null},t})()}).call(KF)});var ez=w((YF,QF)=>{(function(){QF.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(YF)});var $r=w((tz,rz)=>{(function(){var e,t,r,i,n,o,s,a,c,u,l,f,p,d,h,m,_,k,S,v={}.hasOwnProperty;S=xn(),k=S.isObject,_=S.isFunction,m=S.isEmpty,h=S.getValue,a=null,r=null,i=null,n=null,o=null,p=null,d=null,f=null,s=null,t=null,l=null,c=null,e=null,rz.exports=u=(function(){function g(y){this.parent=y,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,a||(a=Xh(),r=Jh(),i=Yh(),n=Qh(),o=im(),p=om(),d=sm(),f=am(),s=ek(),t=It(),l=JF(),c=Kh(),e=ez())}return Object.defineProperty(g.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(g.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(g.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(g.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(g.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new l(this.children)),this.childNodeList}}),Object.defineProperty(g.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(g.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(g.prototype,"previousSibling",{get:function(){var y;return y=this.parent.children.indexOf(this),this.parent.children[y-1]||null}}),Object.defineProperty(g.prototype,"nextSibling",{get:function(){var y;return y=this.parent.children.indexOf(this),this.parent.children[y+1]||null}}),Object.defineProperty(g.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(g.prototype,"textContent",{get:function(){var y,T,R,I,b;if(this.nodeType===t.Element||this.nodeType===t.DocumentFragment){for(b="",I=this.children,T=0,R=I.length;T<R;T++)y=I[T],y.textContent&&(b+=y.textContent);return b}else return null},set:function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),g.prototype.setParent=function(y){var T,R,I,b,O;for(this.parent=y,y&&(this.options=y.options,this.stringify=y.stringify),b=this.children,O=[],R=0,I=b.length;R<I;R++)T=b[R],O.push(T.setParent(this));return O},g.prototype.element=function(y,T,R){var I,b,O,A,P,D,V,$,U,Z,J;if(D=null,T===null&&R==null&&(U=[{},null],T=U[0],R=U[1]),T==null&&(T={}),T=h(T),k(T)||(Z=[T,R],R=Z[0],T=Z[1]),y!=null&&(y=h(y)),Array.isArray(y))for(O=0,V=y.length;O<V;O++)b=y[O],D=this.element(b);else if(_(y))D=this.element(y.apply());else if(k(y)){for(P in y)if(v.call(y,P))if(J=y[P],_(J)&&(J=J.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&P.indexOf(this.stringify.convertAttKey)===0)D=this.attribute(P.substr(this.stringify.convertAttKey.length),J);else if(!this.options.separateArrayItems&&Array.isArray(J)&&m(J))D=this.dummy();else if(k(J)&&m(J))D=this.element(P);else if(!this.options.keepNullNodes&&J==null)D=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(J))for(A=0,$=J.length;A<$;A++)b=J[A],I={},I[P]=b,D=this.element(I);else k(J)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&P.indexOf(this.stringify.convertTextKey)===0?D=this.element(J):(D=this.element(P),D.element(J)):D=this.element(P,J)}else!this.options.keepNullNodes&&R===null?D=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&y.indexOf(this.stringify.convertTextKey)===0?D=this.text(R):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&y.indexOf(this.stringify.convertCDataKey)===0?D=this.cdata(R):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&y.indexOf(this.stringify.convertCommentKey)===0?D=this.comment(R):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&y.indexOf(this.stringify.convertRawKey)===0?D=this.raw(R):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&y.indexOf(this.stringify.convertPIKey)===0?D=this.instruction(y.substr(this.stringify.convertPIKey.length),R):D=this.node(y,T,R);if(D==null)throw new Error("Could not create any elements with: "+y+". "+this.debugInfo());return D},g.prototype.insertBefore=function(y,T,R){var I,b,O,A,P;if(y?.type)return O=y,A=T,O.setParent(this),A?(b=children.indexOf(A),P=children.splice(b),children.push(O),Array.prototype.push.apply(children,P)):children.push(O),O;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(y));return b=this.parent.children.indexOf(this),P=this.parent.children.splice(b),I=this.parent.element(y,T,R),Array.prototype.push.apply(this.parent.children,P),I},g.prototype.insertAfter=function(y,T,R){var I,b,O;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(y));return b=this.parent.children.indexOf(this),O=this.parent.children.splice(b+1),I=this.parent.element(y,T,R),Array.prototype.push.apply(this.parent.children,O),I},g.prototype.remove=function(){var y,T;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return y=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[y,y-y+1].concat(T=[])),this.parent},g.prototype.node=function(y,T,R){var I,b;return y!=null&&(y=h(y)),T||(T={}),T=h(T),k(T)||(b=[T,R],R=b[0],T=b[1]),I=new a(this,y,T),R!=null&&I.text(R),this.children.push(I),I},g.prototype.text=function(y){var T;return k(y)&&this.element(y),T=new d(this,y),this.children.push(T),this},g.prototype.cdata=function(y){var T;return T=new r(this,y),this.children.push(T),this},g.prototype.comment=function(y){var T;return T=new i(this,y),this.children.push(T),this},g.prototype.commentBefore=function(y){var T,R,I;return R=this.parent.children.indexOf(this),I=this.parent.children.splice(R),T=this.parent.comment(y),Array.prototype.push.apply(this.parent.children,I),this},g.prototype.commentAfter=function(y){var T,R,I;return R=this.parent.children.indexOf(this),I=this.parent.children.splice(R+1),T=this.parent.comment(y),Array.prototype.push.apply(this.parent.children,I),this},g.prototype.raw=function(y){var T;return T=new p(this,y),this.children.push(T),this},g.prototype.dummy=function(){var y;return y=new s(this),y},g.prototype.instruction=function(y,T){var R,I,b,O,A;if(y!=null&&(y=h(y)),T!=null&&(T=h(T)),Array.isArray(y))for(O=0,A=y.length;O<A;O++)R=y[O],this.instruction(R);else if(k(y))for(R in y)v.call(y,R)&&(I=y[R],this.instruction(R,I));else _(T)&&(T=T.apply()),b=new f(this,y,T),this.children.push(b);return this},g.prototype.instructionBefore=function(y,T){var R,I,b;return I=this.parent.children.indexOf(this),b=this.parent.children.splice(I),R=this.parent.instruction(y,T),Array.prototype.push.apply(this.parent.children,b),this},g.prototype.instructionAfter=function(y,T){var R,I,b;return I=this.parent.children.indexOf(this),b=this.parent.children.splice(I+1),R=this.parent.instruction(y,T),Array.prototype.push.apply(this.parent.children,b),this},g.prototype.declaration=function(y,T,R){var I,b;return I=this.document(),b=new n(I,y,T,R),I.children.length===0?I.children.unshift(b):I.children[0].type===t.Declaration?I.children[0]=b:I.children.unshift(b),I.root()||I},g.prototype.dtd=function(y,T){var R,I,b,O,A,P,D,V,$,U;for(I=this.document(),b=new o(I,y,T),$=I.children,O=A=0,D=$.length;A<D;O=++A)if(R=$[O],R.type===t.DocType)return I.children[O]=b,b;for(U=I.children,O=P=0,V=U.length;P<V;O=++P)if(R=U[O],R.isRoot)return I.children.splice(O,0,b),b;return I.children.push(b),b},g.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},g.prototype.root=function(){var y;for(y=this;y;){if(y.type===t.Document)return y.rootObject;if(y.isRoot)return y;y=y.parent}},g.prototype.document=function(){var y;for(y=this;y;){if(y.type===t.Document)return y;y=y.parent}},g.prototype.end=function(y){return this.document().end(y)},g.prototype.prev=function(){var y;if(y=this.parent.children.indexOf(this),y<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[y-1]},g.prototype.next=function(){var y;if(y=this.parent.children.indexOf(this),y===-1||y===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[y+1]},g.prototype.importDocument=function(y){var T;return T=y.root().clone(),T.parent=this,T.isRoot=!1,this.children.push(T),this},g.prototype.debugInfo=function(y){var T,R;return y=y||this.name,y==null&&!((T=this.parent)!=null&&T.name)?"":y==null?"parent: <"+this.parent.name+">":(R=this.parent)!=null&&R.name?"node: <"+y+">, parent: <"+this.parent.name+">":"node: <"+y+">"},g.prototype.ele=function(y,T,R){return this.element(y,T,R)},g.prototype.nod=function(y,T,R){return this.node(y,T,R)},g.prototype.txt=function(y){return this.text(y)},g.prototype.dat=function(y){return this.cdata(y)},g.prototype.com=function(y){return this.comment(y)},g.prototype.ins=function(y,T){return this.instruction(y,T)},g.prototype.doc=function(){return this.document()},g.prototype.dec=function(y,T,R){return this.declaration(y,T,R)},g.prototype.e=function(y,T,R){return this.element(y,T,R)},g.prototype.n=function(y,T,R){return this.node(y,T,R)},g.prototype.t=function(y){return this.text(y)},g.prototype.d=function(y){return this.cdata(y)},g.prototype.c=function(y){return this.comment(y)},g.prototype.r=function(y){return this.raw(y)},g.prototype.i=function(y,T){return this.instruction(y,T)},g.prototype.u=function(){return this.up()},g.prototype.importXMLBuilder=function(y){return this.importDocument(y)},g.prototype.replaceChild=function(y,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeChild=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.appendChild=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.hasChildNodes=function(){return this.children.length!==0},g.prototype.cloneNode=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isSupported=function(y,T){return!0},g.prototype.hasAttributes=function(){return this.attribs.length!==0},g.prototype.compareDocumentPosition=function(y){var T,R;return T=this,T===y?0:this.document()!==y.document()?(R=e.Disconnected|e.ImplementationSpecific,Math.random()<.5?R|=e.Preceding:R|=e.Following,R):T.isAncestor(y)?e.Contains|e.Preceding:T.isDescendant(y)?e.Contains|e.Following:T.isPreceding(y)?e.Preceding:e.Following},g.prototype.isSameNode=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.lookupPrefix=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isDefaultNamespace=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.lookupNamespaceURI=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isEqualNode=function(y){var T,R,I;if(y.nodeType!==this.nodeType||y.children.length!==this.children.length)return!1;for(T=R=0,I=this.children.length-1;0<=I?R<=I:R>=I;T=0<=I?++R:--R)if(!this.children[T].isEqualNode(y.children[T]))return!1;return!0},g.prototype.getFeature=function(y,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setUserData=function(y,T,R){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getUserData=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.contains=function(y){return y?y===this||this.isDescendant(y):!1},g.prototype.isDescendant=function(y){var T,R,I,b,O;for(O=this.children,I=0,b=O.length;I<b;I++)if(T=O[I],y===T||(R=T.isDescendant(y),R))return!0;return!1},g.prototype.isAncestor=function(y){return y.isDescendant(this)},g.prototype.isPreceding=function(y){var T,R;return T=this.treePosition(y),R=this.treePosition(this),T===-1||R===-1?!1:T<R},g.prototype.isFollowing=function(y){var T,R;return T=this.treePosition(y),R=this.treePosition(this),T===-1||R===-1?!1:T>R},g.prototype.treePosition=function(y){var T,R;return R=0,T=!1,this.foreachTreeNode(this.document(),function(I){if(R++,!T&&I===y)return T=!0}),T?R:-1},g.prototype.foreachTreeNode=function(y,T){var R,I,b,O,A;for(y||(y=this.document()),O=y.children,I=0,b=O.length;I<b;I++){if(R=O[I],A=T(R))return A;if(A=this.foreachTreeNode(R,T),A)return A}},g})()}).call(tz)});var tk=w((nz,iz)=>{(function(){var e,t=function(i,n){return function(){return i.apply(n,arguments)}},r={}.hasOwnProperty;iz.exports=e=(function(){function i(n){this.assertLegalName=t(this.assertLegalName,this),this.assertLegalChar=t(this.assertLegalChar,this);var o,s,a;n||(n={}),this.options=n,this.options.version||(this.options.version="1.0"),s=n.stringify||{};for(o in s)r.call(s,o)&&(a=s[o],this[o]=a)}return i.prototype.name=function(n){return this.options.noValidation?n:this.assertLegalName(""+n||"")},i.prototype.text=function(n){return this.options.noValidation?n:this.assertLegalChar(this.textEscape(""+n||""))},i.prototype.cdata=function(n){return this.options.noValidation?n:(n=""+n||"",n=n.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(n))},i.prototype.comment=function(n){if(this.options.noValidation)return n;if(n=""+n||"",n.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+n);return this.assertLegalChar(n)},i.prototype.raw=function(n){return this.options.noValidation?n:""+n||""},i.prototype.attValue=function(n){return this.options.noValidation?n:this.assertLegalChar(this.attEscape(n=""+n||""))},i.prototype.insTarget=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},i.prototype.insValue=function(n){if(this.options.noValidation)return n;if(n=""+n||"",n.match(/\?>/))throw new Error("Invalid processing instruction value: "+n);return this.assertLegalChar(n)},i.prototype.xmlVersion=function(n){if(this.options.noValidation)return n;if(n=""+n||"",!n.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+n);return n},i.prototype.xmlEncoding=function(n){if(this.options.noValidation)return n;if(n=""+n||"",!n.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+n);return this.assertLegalChar(n)},i.prototype.xmlStandalone=function(n){return this.options.noValidation?n:n?"yes":"no"},i.prototype.dtdPubID=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},i.prototype.dtdSysID=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},i.prototype.dtdElementValue=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},i.prototype.dtdAttType=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},i.prototype.dtdAttDefault=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},i.prototype.dtdEntityValue=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},i.prototype.dtdNData=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},i.prototype.convertAttKey="@",i.prototype.convertPIKey="?",i.prototype.convertTextKey="#text",i.prototype.convertCDataKey="#cdata",i.prototype.convertCommentKey="#comment",i.prototype.convertRawKey="#raw",i.prototype.assertLegalChar=function(n){var o,s;if(this.options.noValidation)return n;if(o="",this.options.version==="1.0"){if(o=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,s=n.match(o))throw new Error("Invalid character in string: "+n+" at index "+s.index)}else if(this.options.version==="1.1"&&(o=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,s=n.match(o)))throw new Error("Invalid character in string: "+n+" at index "+s.index);return n},i.prototype.assertLegalName=function(n){var o;if(this.options.noValidation)return n;if(this.assertLegalChar(n),o=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!n.match(o))throw new Error("Invalid character in name");return n},i.prototype.textEscape=function(n){var o;return this.options.noValidation?n:(o=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(o,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},i.prototype.attEscape=function(n){var o;return this.options.noValidation?n:(o=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(o,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},i})()}).call(nz)});var wl=w((oz,sz)=>{(function(){sz.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(oz)});var rk=w((az,cz)=>{(function(){var e,t,r,i,n,o,s,a,c,u,l,f,p,d,h,m,_,k={}.hasOwnProperty;_=xn().assign,e=It(),c=Qh(),u=im(),r=Jh(),i=Yh(),f=Xh(),d=om(),h=sm(),p=am(),l=ek(),n=em(),o=rm(),s=tm(),a=nm(),t=wl(),cz.exports=m=(function(){function S(v){var g,y,T;v||(v={}),this.options=v,y=v.writer||{};for(g in y)k.call(y,g)&&(T=y[g],this["_"+g]=this[g],this[g]=T)}return S.prototype.filterOptions=function(v){var g,y,T,R,I,b,O,A;return v||(v={}),v=_({},this.options,v),g={writer:this},g.pretty=v.pretty||!1,g.allowEmpty=v.allowEmpty||!1,g.indent=(y=v.indent)!=null?y:" ",g.newline=(T=v.newline)!=null?T:`
|
|
199
199
|
`,g.offset=(R=v.offset)!=null?R:0,g.dontPrettyTextNodes=(I=(b=v.dontPrettyTextNodes)!=null?b:v.dontprettytextnodes)!=null?I:0,g.spaceBeforeSlash=(O=(A=v.spaceBeforeSlash)!=null?A:v.spacebeforeslash)!=null?O:"",g.spaceBeforeSlash===!0&&(g.spaceBeforeSlash=" "),g.suppressPrettyCount=0,g.user={},g.state=t.None,g},S.prototype.indent=function(v,g,y){var T;return!g.pretty||g.suppressPrettyCount?"":g.pretty&&(T=(y||0)+g.offset+1,T>0)?new Array(T).join(g.indent):""},S.prototype.endline=function(v,g,y){return!g.pretty||g.suppressPrettyCount?"":g.newline},S.prototype.attribute=function(v,g,y){var T;return this.openAttribute(v,g,y),T=" "+v.name+'="'+v.value+'"',this.closeAttribute(v,g,y),T},S.prototype.cdata=function(v,g,y){var T;return this.openNode(v,g,y),g.state=t.OpenTag,T=this.indent(v,g,y)+"<![CDATA[",g.state=t.InsideTag,T+=v.value,g.state=t.CloseTag,T+="]]>"+this.endline(v,g,y),g.state=t.None,this.closeNode(v,g,y),T},S.prototype.comment=function(v,g,y){var T;return this.openNode(v,g,y),g.state=t.OpenTag,T=this.indent(v,g,y)+"<!-- ",g.state=t.InsideTag,T+=v.value,g.state=t.CloseTag,T+=" -->"+this.endline(v,g,y),g.state=t.None,this.closeNode(v,g,y),T},S.prototype.declaration=function(v,g,y){var T;return this.openNode(v,g,y),g.state=t.OpenTag,T=this.indent(v,g,y)+"<?xml",g.state=t.InsideTag,T+=' version="'+v.version+'"',v.encoding!=null&&(T+=' encoding="'+v.encoding+'"'),v.standalone!=null&&(T+=' standalone="'+v.standalone+'"'),g.state=t.CloseTag,T+=g.spaceBeforeSlash+"?>",T+=this.endline(v,g,y),g.state=t.None,this.closeNode(v,g,y),T},S.prototype.docType=function(v,g,y){var T,R,I,b,O;if(y||(y=0),this.openNode(v,g,y),g.state=t.OpenTag,b=this.indent(v,g,y),b+="<!DOCTYPE "+v.root().name,v.pubID&&v.sysID?b+=' PUBLIC "'+v.pubID+'" "'+v.sysID+'"':v.sysID&&(b+=' SYSTEM "'+v.sysID+'"'),v.children.length>0){for(b+=" [",b+=this.endline(v,g,y),g.state=t.InsideTag,O=v.children,R=0,I=O.length;R<I;R++)T=O[R],b+=this.writeChildNode(T,g,y+1);g.state=t.CloseTag,b+="]"}return g.state=t.CloseTag,b+=g.spaceBeforeSlash+">",b+=this.endline(v,g,y),g.state=t.None,this.closeNode(v,g,y),b},S.prototype.element=function(v,g,y){var T,R,I,b,O,A,P,D,V,$,U,Z,J,j;y||(y=0),$=!1,U="",this.openNode(v,g,y),g.state=t.OpenTag,U+=this.indent(v,g,y)+"<"+v.name,Z=v.attribs;for(V in Z)k.call(Z,V)&&(T=Z[V],U+=this.attribute(T,g,y));if(I=v.children.length,b=I===0?null:v.children[0],I===0||v.children.every(function(pe){return(pe.type===e.Text||pe.type===e.Raw)&&pe.value===""}))g.allowEmpty?(U+=">",g.state=t.CloseTag,U+="</"+v.name+">"+this.endline(v,g,y)):(g.state=t.CloseTag,U+=g.spaceBeforeSlash+"/>"+this.endline(v,g,y));else if(g.pretty&&I===1&&(b.type===e.Text||b.type===e.Raw)&&b.value!=null)U+=">",g.state=t.InsideTag,g.suppressPrettyCount++,$=!0,U+=this.writeChildNode(b,g,y+1),g.suppressPrettyCount--,$=!1,g.state=t.CloseTag,U+="</"+v.name+">"+this.endline(v,g,y);else{if(g.dontPrettyTextNodes){for(J=v.children,O=0,P=J.length;O<P;O++)if(R=J[O],(R.type===e.Text||R.type===e.Raw)&&R.value!=null){g.suppressPrettyCount++,$=!0;break}}for(U+=">"+this.endline(v,g,y),g.state=t.InsideTag,j=v.children,A=0,D=j.length;A<D;A++)R=j[A],U+=this.writeChildNode(R,g,y+1);g.state=t.CloseTag,U+=this.indent(v,g,y)+"</"+v.name+">",$&&g.suppressPrettyCount--,U+=this.endline(v,g,y),g.state=t.None}return this.closeNode(v,g,y),U},S.prototype.writeChildNode=function(v,g,y){switch(v.type){case e.CData:return this.cdata(v,g,y);case e.Comment:return this.comment(v,g,y);case e.Element:return this.element(v,g,y);case e.Raw:return this.raw(v,g,y);case e.Text:return this.text(v,g,y);case e.ProcessingInstruction:return this.processingInstruction(v,g,y);case e.Dummy:return"";case e.Declaration:return this.declaration(v,g,y);case e.DocType:return this.docType(v,g,y);case e.AttributeDeclaration:return this.dtdAttList(v,g,y);case e.ElementDeclaration:return this.dtdElement(v,g,y);case e.EntityDeclaration:return this.dtdEntity(v,g,y);case e.NotationDeclaration:return this.dtdNotation(v,g,y);default:throw new Error("Unknown XML node type: "+v.constructor.name)}},S.prototype.processingInstruction=function(v,g,y){var T;return this.openNode(v,g,y),g.state=t.OpenTag,T=this.indent(v,g,y)+"<?",g.state=t.InsideTag,T+=v.target,v.value&&(T+=" "+v.value),g.state=t.CloseTag,T+=g.spaceBeforeSlash+"?>",T+=this.endline(v,g,y),g.state=t.None,this.closeNode(v,g,y),T},S.prototype.raw=function(v,g,y){var T;return this.openNode(v,g,y),g.state=t.OpenTag,T=this.indent(v,g,y),g.state=t.InsideTag,T+=v.value,g.state=t.CloseTag,T+=this.endline(v,g,y),g.state=t.None,this.closeNode(v,g,y),T},S.prototype.text=function(v,g,y){var T;return this.openNode(v,g,y),g.state=t.OpenTag,T=this.indent(v,g,y),g.state=t.InsideTag,T+=v.value,g.state=t.CloseTag,T+=this.endline(v,g,y),g.state=t.None,this.closeNode(v,g,y),T},S.prototype.dtdAttList=function(v,g,y){var T;return this.openNode(v,g,y),g.state=t.OpenTag,T=this.indent(v,g,y)+"<!ATTLIST",g.state=t.InsideTag,T+=" "+v.elementName+" "+v.attributeName+" "+v.attributeType,v.defaultValueType!=="#DEFAULT"&&(T+=" "+v.defaultValueType),v.defaultValue&&(T+=' "'+v.defaultValue+'"'),g.state=t.CloseTag,T+=g.spaceBeforeSlash+">"+this.endline(v,g,y),g.state=t.None,this.closeNode(v,g,y),T},S.prototype.dtdElement=function(v,g,y){var T;return this.openNode(v,g,y),g.state=t.OpenTag,T=this.indent(v,g,y)+"<!ELEMENT",g.state=t.InsideTag,T+=" "+v.name+" "+v.value,g.state=t.CloseTag,T+=g.spaceBeforeSlash+">"+this.endline(v,g,y),g.state=t.None,this.closeNode(v,g,y),T},S.prototype.dtdEntity=function(v,g,y){var T;return this.openNode(v,g,y),g.state=t.OpenTag,T=this.indent(v,g,y)+"<!ENTITY",g.state=t.InsideTag,v.pe&&(T+=" %"),T+=" "+v.name,v.value?T+=' "'+v.value+'"':(v.pubID&&v.sysID?T+=' PUBLIC "'+v.pubID+'" "'+v.sysID+'"':v.sysID&&(T+=' SYSTEM "'+v.sysID+'"'),v.nData&&(T+=" NDATA "+v.nData)),g.state=t.CloseTag,T+=g.spaceBeforeSlash+">"+this.endline(v,g,y),g.state=t.None,this.closeNode(v,g,y),T},S.prototype.dtdNotation=function(v,g,y){var T;return this.openNode(v,g,y),g.state=t.OpenTag,T=this.indent(v,g,y)+"<!NOTATION",g.state=t.InsideTag,T+=" "+v.name,v.pubID&&v.sysID?T+=' PUBLIC "'+v.pubID+'" "'+v.sysID+'"':v.pubID?T+=' PUBLIC "'+v.pubID+'"':v.sysID&&(T+=' SYSTEM "'+v.sysID+'"'),g.state=t.CloseTag,T+=g.spaceBeforeSlash+">"+this.endline(v,g,y),g.state=t.None,this.closeNode(v,g,y),T},S.prototype.openNode=function(v,g,y){},S.prototype.closeNode=function(v,g,y){},S.prototype.openAttribute=function(v,g,y){},S.prototype.closeAttribute=function(v,g,y){},S})()}).call(az)});var cm=w((uz,lz)=>{(function(){var e,t,r=function(n,o){for(var s in o)i.call(o,s)&&(n[s]=o[s]);function a(){this.constructor=n}return a.prototype=o.prototype,n.prototype=new a,n.__super__=o.prototype,n},i={}.hasOwnProperty;t=rk(),lz.exports=e=(function(n){r(o,n);function o(s){o.__super__.constructor.call(this,s)}return o.prototype.document=function(s,a){var c,u,l,f,p;for(a=this.filterOptions(a),f="",p=s.children,u=0,l=p.length;u<l;u++)c=p[u],f+=this.writeChildNode(c,a,0);return a.pretty&&f.slice(-a.newline.length)===a.newline&&(f=f.slice(0,-a.newline.length)),f},o})(t)}).call(uz)});var nk=w((fz,dz)=>{(function(){var e,t,r,i,n,o,s,a,c=function(l,f){for(var p in f)u.call(f,p)&&(l[p]=f[p]);function d(){this.constructor=l}return d.prototype=f.prototype,l.prototype=new d,l.__super__=f.prototype,l},u={}.hasOwnProperty;a=xn().isPlainObject,r=YE(),t=hF(),n=$r(),e=It(),s=tk(),o=cm(),dz.exports=i=(function(l){c(f,l);function f(p){f.__super__.constructor.call(this,null),this.name="#document",this.type=e.Document,this.documentURI=null,this.domConfig=new t,p||(p={}),p.writer||(p.writer=new o),this.options=p,this.stringify=new s(p)}return Object.defineProperty(f.prototype,"implementation",{value:new r}),Object.defineProperty(f.prototype,"doctype",{get:function(){var p,d,h,m;for(m=this.children,d=0,h=m.length;d<h;d++)if(p=m[d],p.type===e.DocType)return p;return null}}),Object.defineProperty(f.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(f.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(f.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(f.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===e.Declaration?this.children[0].encoding:null}}),Object.defineProperty(f.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===e.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(f.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===e.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(f.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(f.prototype,"origin",{get:function(){return null}}),Object.defineProperty(f.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(f.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(f.prototype,"contentType",{get:function(){return null}}),f.prototype.end=function(p){var d;return d={},p?a(p)&&(d=p,p=this.options.writer):p=this.options.writer,p.document(this,p.filterOptions(d))},f.prototype.toString=function(p){return this.options.writer.document(this,this.options.writer.filterOptions(p))},f.prototype.createElement=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createTextNode=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createComment=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createCDATASection=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createProcessingInstruction=function(p,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createAttribute=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createEntityReference=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByTagName=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.importNode=function(p,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createElementNS=function(p,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createAttributeNS=function(p,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByTagNameNS=function(p,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementById=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.adoptNode=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.renameNode=function(p,d,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByClassName=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createEvent=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createNodeIterator=function(p,d,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createTreeWalker=function(p,d,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},f})(n)}).call(fz)});var mz=w((pz,hz)=>{(function(){var e,t,r,i,n,o,s,a,c,u,l,f,p,d,h,m,_,k,S,v,g,y,T,R,I={}.hasOwnProperty;R=xn(),y=R.isObject,g=R.isFunction,T=R.isPlainObject,v=R.getValue,e=It(),f=nk(),d=Xh(),i=Jh(),n=Yh(),m=om(),S=sm(),h=am(),u=Qh(),l=im(),o=em(),a=tm(),s=rm(),c=nm(),r=QE(),k=tk(),_=cm(),t=wl(),hz.exports=p=(function(){function b(O,A,P){var D;this.name="?xml",this.type=e.Document,O||(O={}),D={},O.writer?T(O.writer)&&(D=O.writer,O.writer=new _):O.writer=new _,this.options=O,this.writer=O.writer,this.writerOptions=this.writer.filterOptions(D),this.stringify=new k(O),this.onDataCallback=A||function(){},this.onEndCallback=P||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return b.prototype.createChildNode=function(O){var A,P,D,V,$,U,Z,J;switch(O.type){case e.CData:this.cdata(O.value);break;case e.Comment:this.comment(O.value);break;case e.Element:D={},Z=O.attribs;for(P in Z)I.call(Z,P)&&(A=Z[P],D[P]=A.value);this.node(O.name,D);break;case e.Dummy:this.dummy();break;case e.Raw:this.raw(O.value);break;case e.Text:this.text(O.value);break;case e.ProcessingInstruction:this.instruction(O.target,O.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+O.constructor.name)}for(J=O.children,$=0,U=J.length;$<U;$++)V=J[$],this.createChildNode(V),V.type===e.Element&&this.up();return this},b.prototype.dummy=function(){return this},b.prototype.node=function(O,A,P){var D;if(O==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(O));return this.openCurrent(),O=v(O),A==null&&(A={}),A=v(A),y(A)||(D=[A,P],P=D[0],A=D[1]),this.currentNode=new d(this,O,A),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,P!=null&&this.text(P),this},b.prototype.element=function(O,A,P){var D,V,$,U,Z,J;if(this.currentNode&&this.currentNode.type===e.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(O)||y(O)||g(O))for(U=this.options.noValidation,this.options.noValidation=!0,J=new f(this.options).element("TEMP_ROOT"),J.element(O),this.options.noValidation=U,Z=J.children,V=0,$=Z.length;V<$;V++)D=Z[V],this.createChildNode(D),D.type===e.Element&&this.up();else this.node(O,A,P);return this},b.prototype.attribute=function(O,A){var P,D;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(O));if(O!=null&&(O=v(O)),y(O))for(P in O)I.call(O,P)&&(D=O[P],this.attribute(P,D));else g(A)&&(A=A.apply()),this.options.keepNullAttributes&&A==null?this.currentNode.attribs[O]=new r(this,O,""):A!=null&&(this.currentNode.attribs[O]=new r(this,O,A));return this},b.prototype.text=function(O){var A;return this.openCurrent(),A=new S(this,O),this.onData(this.writer.text(A,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.cdata=function(O){var A;return this.openCurrent(),A=new i(this,O),this.onData(this.writer.cdata(A,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.comment=function(O){var A;return this.openCurrent(),A=new n(this,O),this.onData(this.writer.comment(A,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.raw=function(O){var A;return this.openCurrent(),A=new m(this,O),this.onData(this.writer.raw(A,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.instruction=function(O,A){var P,D,V,$,U;if(this.openCurrent(),O!=null&&(O=v(O)),A!=null&&(A=v(A)),Array.isArray(O))for(P=0,$=O.length;P<$;P++)D=O[P],this.instruction(D);else if(y(O))for(D in O)I.call(O,D)&&(V=O[D],this.instruction(D,V));else g(A)&&(A=A.apply()),U=new h(this,O,A),this.onData(this.writer.processingInstruction(U,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},b.prototype.declaration=function(O,A,P){var D;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return D=new u(this,O,A,P),this.onData(this.writer.declaration(D,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.doctype=function(O,A,P){if(this.openCurrent(),O==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new l(this,A,P),this.currentNode.rootNodeName=O,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},b.prototype.dtdElement=function(O,A){var P;return this.openCurrent(),P=new s(this,O,A),this.onData(this.writer.dtdElement(P,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.attList=function(O,A,P,D,V){var $;return this.openCurrent(),$=new o(this,O,A,P,D,V),this.onData(this.writer.dtdAttList($,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.entity=function(O,A){var P;return this.openCurrent(),P=new a(this,!1,O,A),this.onData(this.writer.dtdEntity(P,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.pEntity=function(O,A){var P;return this.openCurrent(),P=new a(this,!0,O,A),this.onData(this.writer.dtdEntity(P,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.notation=function(O,A){var P;return this.openCurrent(),P=new c(this,O,A),this.onData(this.writer.dtdNotation(P,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},b.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},b.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},b.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},b.prototype.openNode=function(O){var A,P,D,V;if(!O.isOpen){if(!this.root&&this.currentLevel===0&&O.type===e.Element&&(this.root=O),P="",O.type===e.Element){this.writerOptions.state=t.OpenTag,P=this.writer.indent(O,this.writerOptions,this.currentLevel)+"<"+O.name,V=O.attribs;for(D in V)I.call(V,D)&&(A=V[D],P+=this.writer.attribute(A,this.writerOptions,this.currentLevel));P+=(O.children?">":"/>")+this.writer.endline(O,this.writerOptions,this.currentLevel),this.writerOptions.state=t.InsideTag}else this.writerOptions.state=t.OpenTag,P=this.writer.indent(O,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+O.rootNodeName,O.pubID&&O.sysID?P+=' PUBLIC "'+O.pubID+'" "'+O.sysID+'"':O.sysID&&(P+=' SYSTEM "'+O.sysID+'"'),O.children?(P+=" [",this.writerOptions.state=t.InsideTag):(this.writerOptions.state=t.CloseTag,P+=">"),P+=this.writer.endline(O,this.writerOptions,this.currentLevel);return this.onData(P,this.currentLevel),O.isOpen=!0}},b.prototype.closeNode=function(O){var A;if(!O.isClosed)return A="",this.writerOptions.state=t.CloseTag,O.type===e.Element?A=this.writer.indent(O,this.writerOptions,this.currentLevel)+"</"+O.name+">"+this.writer.endline(O,this.writerOptions,this.currentLevel):A=this.writer.indent(O,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(O,this.writerOptions,this.currentLevel),this.writerOptions.state=t.None,this.onData(A,this.currentLevel),O.isClosed=!0},b.prototype.onData=function(O,A){return this.documentStarted=!0,this.onDataCallback(O,A+1)},b.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},b.prototype.debugInfo=function(O){return O==null?"":"node: <"+O+">"},b.prototype.ele=function(){return this.element.apply(this,arguments)},b.prototype.nod=function(O,A,P){return this.node(O,A,P)},b.prototype.txt=function(O){return this.text(O)},b.prototype.dat=function(O){return this.cdata(O)},b.prototype.com=function(O){return this.comment(O)},b.prototype.ins=function(O,A){return this.instruction(O,A)},b.prototype.dec=function(O,A,P){return this.declaration(O,A,P)},b.prototype.dtd=function(O,A,P){return this.doctype(O,A,P)},b.prototype.e=function(O,A,P){return this.element(O,A,P)},b.prototype.n=function(O,A,P){return this.node(O,A,P)},b.prototype.t=function(O){return this.text(O)},b.prototype.d=function(O){return this.cdata(O)},b.prototype.c=function(O){return this.comment(O)},b.prototype.r=function(O){return this.raw(O)},b.prototype.i=function(O,A){return this.instruction(O,A)},b.prototype.att=function(){return this.currentNode&&this.currentNode.type===e.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},b.prototype.a=function(){return this.currentNode&&this.currentNode.type===e.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},b.prototype.ent=function(O,A){return this.entity(O,A)},b.prototype.pent=function(O,A){return this.pEntity(O,A)},b.prototype.not=function(O,A){return this.notation(O,A)},b})()}).call(pz)});var vz=w((gz,yz)=>{(function(){var e,t,r,i,n=function(s,a){for(var c in a)o.call(a,c)&&(s[c]=a[c]);function u(){this.constructor=s}return u.prototype=a.prototype,s.prototype=new u,s.__super__=a.prototype,s},o={}.hasOwnProperty;e=It(),i=rk(),t=wl(),yz.exports=r=(function(s){n(a,s);function a(c,u){this.stream=c,a.__super__.constructor.call(this,u)}return a.prototype.endline=function(c,u,l){return c.isLastRootNode&&u.state===t.CloseTag?"":a.__super__.endline.call(this,c,u,l)},a.prototype.document=function(c,u){var l,f,p,d,h,m,_,k,S;for(_=c.children,f=p=0,h=_.length;p<h;f=++p)l=_[f],l.isLastRootNode=f===c.children.length-1;for(u=this.filterOptions(u),k=c.children,S=[],d=0,m=k.length;d<m;d++)l=k[d],S.push(this.writeChildNode(l,u,0));return S},a.prototype.attribute=function(c,u,l){return this.stream.write(a.__super__.attribute.call(this,c,u,l))},a.prototype.cdata=function(c,u,l){return this.stream.write(a.__super__.cdata.call(this,c,u,l))},a.prototype.comment=function(c,u,l){return this.stream.write(a.__super__.comment.call(this,c,u,l))},a.prototype.declaration=function(c,u,l){return this.stream.write(a.__super__.declaration.call(this,c,u,l))},a.prototype.docType=function(c,u,l){var f,p,d,h;if(l||(l=0),this.openNode(c,u,l),u.state=t.OpenTag,this.stream.write(this.indent(c,u,l)),this.stream.write("<!DOCTYPE "+c.root().name),c.pubID&&c.sysID?this.stream.write(' PUBLIC "'+c.pubID+'" "'+c.sysID+'"'):c.sysID&&this.stream.write(' SYSTEM "'+c.sysID+'"'),c.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(c,u,l)),u.state=t.InsideTag,h=c.children,p=0,d=h.length;p<d;p++)f=h[p],this.writeChildNode(f,u,l+1);u.state=t.CloseTag,this.stream.write("]")}return u.state=t.CloseTag,this.stream.write(u.spaceBeforeSlash+">"),this.stream.write(this.endline(c,u,l)),u.state=t.None,this.closeNode(c,u,l)},a.prototype.element=function(c,u,l){var f,p,d,h,m,_,k,S,v,g;l||(l=0),this.openNode(c,u,l),u.state=t.OpenTag,this.stream.write(this.indent(c,u,l)+"<"+c.name),v=c.attribs;for(k in v)o.call(v,k)&&(f=v[k],this.attribute(f,u,l));if(d=c.children.length,h=d===0?null:c.children[0],d===0||c.children.every(function(y){return(y.type===e.Text||y.type===e.Raw)&&y.value===""}))u.allowEmpty?(this.stream.write(">"),u.state=t.CloseTag,this.stream.write("</"+c.name+">")):(u.state=t.CloseTag,this.stream.write(u.spaceBeforeSlash+"/>"));else if(u.pretty&&d===1&&(h.type===e.Text||h.type===e.Raw)&&h.value!=null)this.stream.write(">"),u.state=t.InsideTag,u.suppressPrettyCount++,S=!0,this.writeChildNode(h,u,l+1),u.suppressPrettyCount--,S=!1,u.state=t.CloseTag,this.stream.write("</"+c.name+">");else{for(this.stream.write(">"+this.endline(c,u,l)),u.state=t.InsideTag,g=c.children,m=0,_=g.length;m<_;m++)p=g[m],this.writeChildNode(p,u,l+1);u.state=t.CloseTag,this.stream.write(this.indent(c,u,l)+"</"+c.name+">")}return this.stream.write(this.endline(c,u,l)),u.state=t.None,this.closeNode(c,u,l)},a.prototype.processingInstruction=function(c,u,l){return this.stream.write(a.__super__.processingInstruction.call(this,c,u,l))},a.prototype.raw=function(c,u,l){return this.stream.write(a.__super__.raw.call(this,c,u,l))},a.prototype.text=function(c,u,l){return this.stream.write(a.__super__.text.call(this,c,u,l))},a.prototype.dtdAttList=function(c,u,l){return this.stream.write(a.__super__.dtdAttList.call(this,c,u,l))},a.prototype.dtdElement=function(c,u,l){return this.stream.write(a.__super__.dtdElement.call(this,c,u,l))},a.prototype.dtdEntity=function(c,u,l){return this.stream.write(a.__super__.dtdEntity.call(this,c,u,l))},a.prototype.dtdNotation=function(c,u,l){return this.stream.write(a.__super__.dtdNotation.call(this,c,u,l))},a})(i)}).call(gz)});var _z=w((bz,Vi)=>{(function(){var e,t,r,i,n,o,s,a,c,u;u=xn(),a=u.assign,c=u.isFunction,r=YE(),i=nk(),n=mz(),s=cm(),o=vz(),e=It(),t=wl(),Vi.exports.create=function(l,f,p,d){var h,m;if(l==null)throw new Error("Root element needs a name.");return d=a({},f,p,d),h=new i(d),m=h.element(l),d.headless||(h.declaration(d),(d.pubID!=null||d.sysID!=null)&&h.dtd(d)),m},Vi.exports.begin=function(l,f,p){var d;return c(l)&&(d=[l,f],f=d[0],p=d[1],l={}),f?new n(l,f,p):new i(l)},Vi.exports.stringWriter=function(l){return new s(l)},Vi.exports.streamWriter=function(l,f){return new o(l,f)},Vi.exports.implementation=new r,Vi.exports.nodeType=e,Vi.exports.writerState=t}).call(bz)});var wz=w(ik=>{(function(){"use strict";var e,t,r,i,n,o={}.hasOwnProperty;e=_z(),t=Gh().defaults,i=function(s){return typeof s=="string"&&(s.indexOf("&")>=0||s.indexOf(">")>=0||s.indexOf("<")>=0)},n=function(s){return"<![CDATA["+r(s)+"]]>"},r=function(s){return s.replace("]]>","]]]]><![CDATA[>")},ik.Builder=(function(){function s(a){var c,u,l;this.options={},u=t["0.2"];for(c in u)o.call(u,c)&&(l=u[c],this.options[c]=l);for(c in a)o.call(a,c)&&(l=a[c],this.options[c]=l)}return s.prototype.buildObject=function(a){var c,u,l,f,p;return c=this.options.attrkey,u=this.options.charkey,Object.keys(a).length===1&&this.options.rootName===t["0.2"].rootName?(p=Object.keys(a)[0],a=a[p]):p=this.options.rootName,l=(function(d){return function(h,m){var _,k,S,v,g,y;if(typeof m!="object")d.options.cdata&&i(m)?h.raw(n(m)):h.txt(m);else if(Array.isArray(m)){for(v in m)if(o.call(m,v)){k=m[v];for(g in k)S=k[g],h=l(h.ele(g),S).up()}}else for(g in m)if(o.call(m,g))if(k=m[g],g===c){if(typeof k=="object")for(_ in k)y=k[_],h=h.att(_,y)}else if(g===u)d.options.cdata&&i(k)?h=h.raw(n(k)):h=h.txt(k);else if(Array.isArray(k))for(v in k)o.call(k,v)&&(S=k[v],typeof S=="string"?d.options.cdata&&i(S)?h=h.ele(g).raw(n(S)).up():h=h.ele(g,S).up():h=l(h.ele(g),S).up());else typeof k=="object"?h=l(h.ele(g),k).up():typeof k=="string"&&d.options.cdata&&i(k)?h=h.ele(g).raw(n(k)).up():(k==null&&(k=""),h=h.ele(g,k.toString()).up());return h}})(this),f=e.create(p,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),l(f,a).end(this.options.renderOpts)},s})()}).call(ik)});var xz=w(um=>{(function(e){e.parser=function(E,x){return new r(E,x)},e.SAXParser=r,e.SAXStream=l,e.createStream=c,e.MAX_BUFFER_LENGTH=64*1024;var t=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(E,x){if(!(this instanceof r))return new r(E,x);var F=this;n(F),F.q=F.c="",F.bufferCheckPosition=e.MAX_BUFFER_LENGTH,F.encoding=null,F.opt=x||{},F.opt.lowercase=F.opt.lowercase||F.opt.lowercasetags,F.looseCase=F.opt.lowercase?"toLowerCase":"toUpperCase",F.opt.maxEntityCount=F.opt.maxEntityCount||512,F.opt.maxEntityDepth=F.opt.maxEntityDepth||4,F.entityCount=F.entityDepth=0,F.tags=[],F.closed=F.closedRoot=F.sawRoot=!1,F.tag=F.error=null,F.strict=!!E,F.noscript=!!(E||F.opt.noscript),F.state=b.BEGIN,F.strictEntities=F.opt.strictEntities,F.ENTITIES=F.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),F.attribList=[],F.opt.xmlns&&(F.ns=Object.create(m)),F.opt.unquotedAttributeValues===void 0&&(F.opt.unquotedAttributeValues=!E),F.trackPosition=F.opt.position!==!1,F.trackPosition&&(F.position=F.line=F.column=0),A(F,"onready")}Object.create||(Object.create=function(E){function x(){}x.prototype=E;var F=new x;return F}),Object.keys||(Object.keys=function(E){var x=[];for(var F in E)E.hasOwnProperty(F)&&x.push(F);return x});function i(E){for(var x=Math.max(e.MAX_BUFFER_LENGTH,10),F=0,C=0,ue=t.length;C<ue;C++){var be=E[t[C]].length;if(be>x)switch(t[C]){case"textNode":Z(E);break;case"cdata":U(E,"oncdata",E.cdata),E.cdata="";break;case"script":U(E,"onscript",E.script),E.script="";break;default:j(E,"Max buffer length exceeded: "+t[C])}F=Math.max(F,be)}var ne=e.MAX_BUFFER_LENGTH-F;E.bufferCheckPosition=ne+E.position}function n(E){for(var x=0,F=t.length;x<F;x++)E[t[x]]=""}function o(E){Z(E),E.cdata!==""&&(U(E,"oncdata",E.cdata),E.cdata=""),E.script!==""&&(U(E,"onscript",E.script),E.script="")}r.prototype={end:function(){pe(this)},write:We,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){o(this)}};var s;try{s=B("stream").Stream}catch{s=function(){}}s||(s=function(){});var a=e.EVENTS.filter(function(E){return E!=="error"&&E!=="end"});function c(E,x){return new l(E,x)}function u(E,x){if(E.length>=2){if(E[0]===255&&E[1]===254)return"utf-16le";if(E[0]===254&&E[1]===255)return"utf-16be"}return E.length>=3&&E[0]===239&&E[1]===187&&E[2]===191?"utf8":E.length>=4?E[0]===60&&E[1]===0&&E[2]===63&&E[3]===0?"utf-16le":E[0]===0&&E[1]===60&&E[2]===0&&E[3]===63?"utf-16be":"utf8":x?"utf8":null}function l(E,x){if(!(this instanceof l))return new l(E,x);s.apply(this),this._parser=new r(E,x),this.writable=!0,this.readable=!0;var F=this;this._parser.onend=function(){F.emit("end")},this._parser.onerror=function(C){F.emit("error",C),F._parser.error=null},this._decoder=null,this._decoderBuffer=null,a.forEach(function(C){Object.defineProperty(F,"on"+C,{get:function(){return F._parser["on"+C]},set:function(ue){if(!ue)return F.removeAllListeners(C),F._parser["on"+C]=ue,ue;F.on(C,ue)},enumerable:!0,configurable:!1})})}l.prototype=Object.create(s.prototype,{constructor:{value:l}}),l.prototype._decodeBuffer=function(E,x){if(this._decoderBuffer&&(E=Buffer.concat([this._decoderBuffer,E]),this._decoderBuffer=null),!this._decoder){var F=u(E,x);if(!F)return this._decoderBuffer=E,"";this._parser.encoding=F,this._decoder=new TextDecoder(F)}return this._decoder.decode(E,{stream:!x})},l.prototype.write=function(E){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(E))E=this._decodeBuffer(E,!1);else if(this._decoderBuffer){var x=this._decodeBuffer(Buffer.alloc(0),!0);x&&(this._parser.write(x),this.emit("data",x))}return this._parser.write(E.toString()),this.emit("data",E),!0},l.prototype.end=function(E){if(E&&E.length&&this.write(E),this._decoderBuffer){var x=this._decodeBuffer(Buffer.alloc(0),!0);x&&(this._parser.write(x),this.emit("data",x))}else if(this._decoder){var F=this._decoder.decode();F&&(this._parser.write(F),this.emit("data",F))}return this._parser.end(),!0},l.prototype.on=function(E,x){var F=this;return!F._parser["on"+E]&&a.indexOf(E)!==-1&&(F._parser["on"+E]=function(){var C=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);C.splice(0,0,E),F.emit.apply(F,C)}),s.prototype.on.call(F,E,x)};var f=/^\[CDATA\[$/i,p=/^DOCTYPE$/i,d="http://www.w3.org/XML/1998/namespace",h="http://www.w3.org/2000/xmlns/",m={xml:d,xmlns:h},_=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,k=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,S=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function g(E){return E===" "||E===`
|
|
200
200
|
`||E==="\r"||E===" "}function y(E){return E==='"'||E==="'"}function T(E){return E===">"||g(E)}function R(E,x){return E.test(x)}function I(E,x){return!R(E,x)}var b=0;e.STATE={BEGIN:b++,BEGIN_WHITESPACE:b++,TEXT:b++,TEXT_ENTITY:b++,OPEN_WAKA:b++,SGML_DECL:b++,SGML_DECL_QUOTED:b++,DOCTYPE:b++,DOCTYPE_QUOTED:b++,DOCTYPE_DTD:b++,DOCTYPE_DTD_QUOTED:b++,COMMENT_STARTING:b++,COMMENT:b++,COMMENT_ENDING:b++,COMMENT_ENDED:b++,CDATA:b++,CDATA_ENDING:b++,CDATA_ENDING_2:b++,PROC_INST:b++,PROC_INST_BODY:b++,PROC_INST_ENDING:b++,OPEN_TAG:b++,OPEN_TAG_SLASH:b++,ATTRIB:b++,ATTRIB_NAME:b++,ATTRIB_NAME_SAW_WHITE:b++,ATTRIB_VALUE:b++,ATTRIB_VALUE_QUOTED:b++,ATTRIB_VALUE_CLOSED:b++,ATTRIB_VALUE_UNQUOTED:b++,ATTRIB_VALUE_ENTITY_Q:b++,ATTRIB_VALUE_ENTITY_U:b++,CLOSE_TAG:b++,CLOSE_TAG_SAW_WHITE:b++,SCRIPT:b++,SCRIPT_ENDING:b++},e.XML_ENTITIES=Object.assign(Object.create(null),{amp:"&",gt:">",lt:"<",quot:'"',apos:"'"}),e.ENTITIES=Object.assign(Object.create(null),{amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830}),Object.keys(e.ENTITIES).forEach(function(E){var x=e.ENTITIES[E],F=typeof x=="number"?String.fromCharCode(x):x;e.ENTITIES[E]=F});for(var O in e.STATE)e.STATE[e.STATE[O]]=O;b=e.STATE;function A(E,x,F){E[x]&&E[x](F)}function P(E){var x=E&&E.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);return x?x[2]:null}function D(E){return E?E.toLowerCase().replace(/[^a-z0-9]/g,""):null}function V(E,x){let F=D(E),C=D(x);return!F||!C?!0:C==="utf16"?F==="utf16le"||F==="utf16be":F===C}function $(E,x){if(!(!E.strict||!E.encoding||!x||x.name!=="xml")){var F=P(x.body);F&&!V(E.encoding,F)&&Q(E,"XML declaration encoding "+F+" does not match detected stream encoding "+E.encoding.toUpperCase())}}function U(E,x,F){E.textNode&&Z(E),A(E,x,F)}function Z(E){E.textNode=J(E.opt,E.textNode),E.textNode&&A(E,"ontext",E.textNode),E.textNode=""}function J(E,x){return E.trim&&(x=x.trim()),E.normalize&&(x=x.replace(/\s+/g," ")),x}function j(E,x){return Z(E),E.trackPosition&&(x+=`
|
|
@@ -205,13 +205,13 @@ Actual: `+E.attribValue);else if(C==="xmlns"&&E.attribValue!==h)Q(E,"xmlns: pref
|
|
|
205
205
|
Actual: `+E.attribValue);else{var ue=E.tag,be=E.tags[E.tags.length-1]||E;ue.ns===be.ns&&(ue.ns=Object.create(be.ns)),ue.ns[C]=E.attribValue}E.attribList.push([E.attribName,E.attribValue])}else E.tag.attributes[E.attribName]=E.attribValue,U(E,"onattribute",{name:E.attribName,value:E.attribValue});E.attribName=E.attribValue=""}function G(E,x){if(E.opt.xmlns){var F=E.tag,C=N(E.tagName);F.prefix=C.prefix,F.local=C.local,F.uri=F.ns[C.prefix]||"",F.prefix&&!F.uri&&(Q(E,"Unbound namespace prefix: "+JSON.stringify(E.tagName)),F.uri=C.prefix);var ue=E.tags[E.tags.length-1]||E;F.ns&&ue.ns!==F.ns&&Object.keys(F.ns).forEach(function(_e){U(E,"onopennamespace",{prefix:_e,uri:F.ns[_e]})});for(var be=0,ne=E.attribList.length;be<ne;be++){var Ce=E.attribList[be],rt=Ce[0],Et=Ce[1],Ge=N(rt,!0),et=Ge.prefix,Ht=Ge.local,kt=et===""?"":F.ns[et]||"",nt={name:rt,value:Et,prefix:et,local:Ht,uri:kt};et&&et!=="xmlns"&&!kt&&(Q(E,"Unbound namespace prefix: "+JSON.stringify(et)),nt.uri=et),E.tag.attributes[rt]=nt,U(E,"onattribute",nt)}E.attribList.length=0}E.tag.isSelfClosing=!!x,E.sawRoot=!0,E.tags.push(E.tag),U(E,"onopentag",E.tag),x||(!E.noscript&&E.tagName.toLowerCase()==="script"?E.state=b.SCRIPT:E.state=b.TEXT,E.tag=null,E.tagName=""),E.attribName=E.attribValue="",E.attribList.length=0}function re(E){if(!E.tagName){Q(E,"Weird empty close tag."),E.textNode+="</>",E.state=b.TEXT;return}if(E.script){if(E.tagName!=="script"){E.script+="</"+E.tagName+">",E.tagName="",E.state=b.SCRIPT;return}U(E,"onscript",E.script),E.script=""}var x=E.tags.length,F=E.tagName;E.strict||(F=F[E.looseCase]());for(var C=F;x--;){var ue=E.tags[x];if(ue.name!==C)Q(E,"Unexpected close tag");else break}if(x<0){Q(E,"Unmatched closing tag: "+E.tagName),E.textNode+="</"+E.tagName+">",E.state=b.TEXT;return}E.tagName=F;for(var be=E.tags.length;be-- >x;){var ne=E.tag=E.tags.pop();E.tagName=E.tag.name,U(E,"onclosetag",E.tagName);var Ce={};for(var rt in ne.ns)Ce[rt]=ne.ns[rt];var Et=E.tags[E.tags.length-1]||E;E.opt.xmlns&&ne.ns!==Et.ns&&Object.keys(ne.ns).forEach(function(Ge){var et=ne.ns[Ge];U(E,"onclosenamespace",{prefix:Ge,uri:et})})}x===0&&(E.closedRoot=!0),E.tagName=E.attribValue=E.attribName="",E.attribList.length=0,E.state=b.TEXT}function q(E){var x=E.entity,F=x.toLowerCase(),C,ue="";return E.ENTITIES[x]?E.ENTITIES[x]:E.ENTITIES[F]?E.ENTITIES[F]:(x=F,x.charAt(0)==="#"&&(x.charAt(1)==="x"?(x=x.slice(2),C=parseInt(x,16),ue=C.toString(16)):(x=x.slice(1),C=parseInt(x,10),ue=C.toString(10))),x=x.replace(/^0+/,""),isNaN(C)||ue.toLowerCase()!==x||C<0||C>1114111||!de(C)?(Q(E,"Invalid character entity"),"&"+E.entity+";"):String.fromCodePoint(C))}function de(E){return E===9||E===10||E===13||E>=32&&E<=55295||E>=57344&&E<=65533||E>=65536&&E<=1114111}function le(E,x){x==="<"?(E.state=b.OPEN_WAKA,E.startTagPosition=E.position):g(x)||(Q(E,"Non-whitespace before first tag."),E.textNode=x,E.state=b.TEXT)}function Oe(E,x){var F="";return x<E.length&&(F=E.charAt(x)),F}function We(E){var x=this;if(this.error)throw this.error;if(x.closed)return j(x,"Cannot write after close. Assign an onready handler.");if(E===null)return pe(x);typeof E=="object"&&(E=E.toString());for(var F=0,C="";C=Oe(E,F++),x.c=C,!!C;)switch(x.trackPosition&&(x.position++,C===`
|
|
206
206
|
`?(x.line++,x.column=0):x.column++),x.state){case b.BEGIN:if(x.state=b.BEGIN_WHITESPACE,C==="\uFEFF")continue;le(x,C);continue;case b.BEGIN_WHITESPACE:le(x,C);continue;case b.TEXT:if(x.sawRoot&&!x.closedRoot){for(var be=F-1;C&&C!=="<"&&C!=="&";)C=Oe(E,F++),C&&x.trackPosition&&(x.position++,C===`
|
|
207
207
|
`?(x.line++,x.column=0):x.column++);x.textNode+=E.substring(be,F-1)}C==="<"&&!(x.sawRoot&&x.closedRoot&&!x.strict)?(x.state=b.OPEN_WAKA,x.startTagPosition=x.position):(!g(C)&&(!x.sawRoot||x.closedRoot)&&Q(x,"Text data outside of root node."),C==="&"?x.state=b.TEXT_ENTITY:x.textNode+=C);continue;case b.SCRIPT:C==="<"?x.state=b.SCRIPT_ENDING:x.script+=C;continue;case b.SCRIPT_ENDING:C==="/"?x.state=b.CLOSE_TAG:(x.script+="<"+C,x.state=b.SCRIPT);continue;case b.OPEN_WAKA:if(C==="!")x.state=b.SGML_DECL,x.sgmlDecl="";else if(!g(C))if(R(_,C))x.state=b.OPEN_TAG,x.tagName=C;else if(C==="/")x.state=b.CLOSE_TAG,x.tagName="";else if(C==="?")x.state=b.PROC_INST,x.procInstName=x.procInstBody="";else{if(Q(x,"Unencoded <"),x.startTagPosition+1<x.position){var ue=x.position-x.startTagPosition;C=new Array(ue).join(" ")+C}x.textNode+="<"+C,x.state=b.TEXT}continue;case b.SGML_DECL:if(x.sgmlDecl+C==="--"){x.state=b.COMMENT,x.comment="",x.sgmlDecl="";continue}x.doctype&&x.doctype!==!0&&x.sgmlDecl?(x.state=b.DOCTYPE_DTD,x.doctype+="<!"+x.sgmlDecl+C,x.sgmlDecl=""):f.test(x.sgmlDecl+C)?(U(x,"onopencdata"),x.state=b.CDATA,x.sgmlDecl="",x.cdata=""):p.test(x.sgmlDecl+C)?(x.state=b.DOCTYPE,(x.doctype||x.sawRoot)&&Q(x,"Inappropriately located doctype declaration"),x.doctype="",x.sgmlDecl=""):C===">"?(U(x,"onsgmldeclaration",x.sgmlDecl),x.sgmlDecl="",x.state=b.TEXT):(y(C)&&(x.state=b.SGML_DECL_QUOTED),x.sgmlDecl+=C);continue;case b.SGML_DECL_QUOTED:C===x.q&&(x.state=b.SGML_DECL,x.q=""),x.sgmlDecl+=C;continue;case b.DOCTYPE:C===">"?(x.state=b.TEXT,U(x,"ondoctype",x.doctype),x.doctype=!0):(x.doctype+=C,C==="["?x.state=b.DOCTYPE_DTD:y(C)&&(x.state=b.DOCTYPE_QUOTED,x.q=C));continue;case b.DOCTYPE_QUOTED:x.doctype+=C,C===x.q&&(x.q="",x.state=b.DOCTYPE);continue;case b.DOCTYPE_DTD:C==="]"?(x.doctype+=C,x.state=b.DOCTYPE):C==="<"?(x.state=b.OPEN_WAKA,x.startTagPosition=x.position):y(C)?(x.doctype+=C,x.state=b.DOCTYPE_DTD_QUOTED,x.q=C):x.doctype+=C;continue;case b.DOCTYPE_DTD_QUOTED:x.doctype+=C,C===x.q&&(x.state=b.DOCTYPE_DTD,x.q="");continue;case b.COMMENT:C==="-"?x.state=b.COMMENT_ENDING:x.comment+=C;continue;case b.COMMENT_ENDING:C==="-"?(x.state=b.COMMENT_ENDED,x.comment=J(x.opt,x.comment),x.comment&&U(x,"oncomment",x.comment),x.comment=""):(x.comment+="-"+C,x.state=b.COMMENT);continue;case b.COMMENT_ENDED:C!==">"?(Q(x,"Malformed comment"),x.comment+="--"+C,x.state=b.COMMENT):x.doctype&&x.doctype!==!0?x.state=b.DOCTYPE_DTD:x.state=b.TEXT;continue;case b.CDATA:for(var be=F-1;C&&C!=="]";)C=Oe(E,F++),C&&x.trackPosition&&(x.position++,C===`
|
|
208
|
-
`?(x.line++,x.column=0):x.column++);x.cdata+=E.substring(be,F-1),C==="]"&&(x.state=b.CDATA_ENDING);continue;case b.CDATA_ENDING:C==="]"?x.state=b.CDATA_ENDING_2:(x.cdata+="]"+C,x.state=b.CDATA);continue;case b.CDATA_ENDING_2:C===">"?(x.cdata&&U(x,"oncdata",x.cdata),U(x,"onclosecdata"),x.cdata="",x.state=b.TEXT):C==="]"?x.cdata+="]":(x.cdata+="]]"+C,x.state=b.CDATA);continue;case b.PROC_INST:C==="?"?x.state=b.PROC_INST_ENDING:g(C)?x.state=b.PROC_INST_BODY:x.procInstName+=C;continue;case b.PROC_INST_BODY:if(!x.procInstBody&&g(C))continue;C==="?"?x.state=b.PROC_INST_ENDING:x.procInstBody+=C;continue;case b.PROC_INST_ENDING:if(C===">"){let Et={name:x.procInstName,body:x.procInstBody};$(x,Et),U(x,"onprocessinginstruction",Et),x.procInstName=x.procInstBody="",x.state=b.TEXT}else x.procInstBody+="?"+C,x.state=b.PROC_INST_BODY;continue;case b.OPEN_TAG:R(k,C)?x.tagName+=C:(X(x),C===">"?G(x):C==="/"?x.state=b.OPEN_TAG_SLASH:(g(C)||Q(x,"Invalid character in tag name"),x.state=b.ATTRIB));continue;case b.OPEN_TAG_SLASH:C===">"?(G(x,!0),re(x)):(Q(x,"Forward-slash in opening tag not followed by >"),x.state=b.ATTRIB);continue;case b.ATTRIB:if(g(C))continue;C===">"?G(x):C==="/"?x.state=b.OPEN_TAG_SLASH:R(_,C)?(x.attribName=C,x.attribValue="",x.state=b.ATTRIB_NAME):Q(x,"Invalid attribute name");continue;case b.ATTRIB_NAME:C==="="?x.state=b.ATTRIB_VALUE:C===">"?(Q(x,"Attribute without value"),x.attribValue=x.attribName,H(x),G(x)):g(C)?x.state=b.ATTRIB_NAME_SAW_WHITE:R(k,C)?x.attribName+=C:Q(x,"Invalid attribute name");continue;case b.ATTRIB_NAME_SAW_WHITE:if(C==="=")x.state=b.ATTRIB_VALUE;else{if(g(C))continue;Q(x,"Attribute without value"),x.tag.attributes[x.attribName]="",x.attribValue="",U(x,"onattribute",{name:x.attribName,value:""}),x.attribName="",C===">"?G(x):R(_,C)?(x.attribName=C,x.state=b.ATTRIB_NAME):(Q(x,"Invalid attribute name"),x.state=b.ATTRIB)}continue;case b.ATTRIB_VALUE:if(g(C))continue;y(C)?(x.q=C,x.state=b.ATTRIB_VALUE_QUOTED):(x.opt.unquotedAttributeValues||j(x,"Unquoted attribute value"),x.state=b.ATTRIB_VALUE_UNQUOTED,x.attribValue=C);continue;case b.ATTRIB_VALUE_QUOTED:if(C!==x.q){C==="&"?x.state=b.ATTRIB_VALUE_ENTITY_Q:x.attribValue+=C;continue}H(x),x.q="",x.state=b.ATTRIB_VALUE_CLOSED;continue;case b.ATTRIB_VALUE_CLOSED:g(C)?x.state=b.ATTRIB:C===">"?G(x):C==="/"?x.state=b.OPEN_TAG_SLASH:R(_,C)?(Q(x,"No whitespace between attributes"),x.attribName=C,x.attribValue="",x.state=b.ATTRIB_NAME):Q(x,"Invalid attribute name");continue;case b.ATTRIB_VALUE_UNQUOTED:if(!T(C)){C==="&"?x.state=b.ATTRIB_VALUE_ENTITY_U:x.attribValue+=C;continue}H(x),C===">"?G(x):x.state=b.ATTRIB;continue;case b.CLOSE_TAG:if(x.tagName)C===">"?re(x):R(k,C)?x.tagName+=C:x.script?(x.script+="</"+x.tagName+C,x.tagName="",x.state=b.SCRIPT):(g(C)||Q(x,"Invalid tagname in closing tag"),x.state=b.CLOSE_TAG_SAW_WHITE);else{if(g(C))continue;I(_,C)?x.script?(x.script+="</"+C,x.state=b.SCRIPT):Q(x,"Invalid tagname in closing tag."):x.tagName=C}continue;case b.CLOSE_TAG_SAW_WHITE:if(g(C))continue;C===">"?re(x):Q(x,"Invalid characters in closing tag");continue;case b.TEXT_ENTITY:case b.ATTRIB_VALUE_ENTITY_Q:case b.ATTRIB_VALUE_ENTITY_U:var ne,Ce;switch(x.state){case b.TEXT_ENTITY:ne=b.TEXT,Ce="textNode";break;case b.ATTRIB_VALUE_ENTITY_Q:ne=b.ATTRIB_VALUE_QUOTED,Ce="attribValue";break;case b.ATTRIB_VALUE_ENTITY_U:ne=b.ATTRIB_VALUE_UNQUOTED,Ce="attribValue";break}if(C===";"){var rt=q(x);x.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(rt)?((x.entityCount+=1)>x.opt.maxEntityCount&&j(x,"Parsed entity count exceeds max entity count"),(x.entityDepth+=1)>x.opt.maxEntityDepth&&j(x,"Parsed entity depth exceeds max entity depth"),x.entity="",x.state=ne,x.write(rt),x.entityDepth-=1):(x[Ce]+=rt,x.entity="",x.state=ne)}else R(x.entity.length?v:S,C)?x.entity+=C:(Q(x,"Invalid character in entity name"),x[Ce]+="&"+x.entity+C,x.entity="",x.state=ne);continue;default:throw new Error(x,"Unknown state: "+x.state)}return x.position>=x.bufferCheckPosition&&i(x),x}String.fromCodePoint||(function(){var E=String.fromCharCode,x=Math.floor,F=function(){var C=16384,ue=[],be,ne,Ce=-1,rt=arguments.length;if(!rt)return"";for(var Et="";++Ce<rt;){var Ge=Number(arguments[Ce]);if(!isFinite(Ge)||Ge<0||Ge>1114111||x(Ge)!==Ge)throw RangeError("Invalid code point: "+Ge);Ge<=65535?ue.push(Ge):(Ge-=65536,be=(Ge>>10)+55296,ne=Ge%1024+56320,ue.push(be,ne)),(Ce+1===rt||ue.length>C)&&(Et+=E.apply(null,ue),ue.length=0)}return Et};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:F,configurable:!0,writable:!0}):String.fromCodePoint=F})()})(typeof um>"u"?um.sax={}:um)});var Sz=w(ok=>{(function(){"use strict";ok.stripBOM=function(e){return e[0]==="\uFEFF"?e.substring(1):e}}).call(ok)});var sk=w(Uo=>{(function(){"use strict";var e;e=new RegExp(/(?!xmlns)^.*:/),Uo.normalize=function(t){return t.toLowerCase()},Uo.firstCharLowerCase=function(t){return t.charAt(0).toLowerCase()+t.slice(1)},Uo.stripPrefix=function(t){return t.replace(e,"")},Uo.parseNumbers=function(t){return isNaN(t)||(t=t%1===0?parseInt(t,10):parseFloat(t)),t},Uo.parseBooleans=function(t){return/^(?:true|false)$/i.test(t)&&(t=t.toLowerCase()==="true"),t}}).call(Uo)});var Ez=w(ii=>{(function(){"use strict";var e,t,r,i,n,o,s,a,c,u=function(p,d){return function(){return p.apply(d,arguments)}},l=function(p,d){for(var h in d)f.call(d,h)&&(p[h]=d[h]);function m(){this.constructor=p}return m.prototype=d.prototype,p.prototype=new m,p.__super__=d.prototype,p},f={}.hasOwnProperty;a=xz(),i=B("events"),e=Sz(),s=sk(),c=B("timers").setImmediate,t=Gh().defaults,n=function(p){return typeof p=="object"&&p!=null&&Object.keys(p).length===0},o=function(p,d,h){var m,_,k;for(m=0,_=p.length;m<_;m++)k=p[m],d=k(d,h);return d},r=function(p,d,h){var m;return m=Object.create(null),m.value=h,m.writable=!0,m.enumerable=!0,m.configurable=!0,Object.defineProperty(p,d,m)},ii.Parser=(function(p){l(d,p);function d(h){this.parseStringPromise=u(this.parseStringPromise,this),this.parseString=u(this.parseString,this),this.reset=u(this.reset,this),this.assignOrPush=u(this.assignOrPush,this),this.processAsync=u(this.processAsync,this);var m,_,k;if(!(this instanceof ii.Parser))return new ii.Parser(h);this.options={},_=t["0.2"];for(m in _)f.call(_,m)&&(k=_[m],this.options[m]=k);for(m in h)f.call(h,m)&&(k=h[m],this.options[m]=k);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(s.normalize)),this.reset()}return d.prototype.processAsync=function(){var h,m;try{return this.remaining.length<=this.options.chunkSize?(h=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(h),this.saxParser.close()):(h=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(h),c(this.processAsync))}catch(_){if(m=_,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(m)}},d.prototype.assignOrPush=function(h,m,_){return m in h?(h[m]instanceof Array||r(h,m,[h[m]]),h[m].push(_)):this.options.explicitArray?r(h,m,[_]):r(h,m,_)},d.prototype.reset=function(){var h,m,_,k;return this.removeAllListeners(),this.saxParser=a.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(function(S){return function(v){if(S.saxParser.resume(),!S.saxParser.errThrown)return S.saxParser.errThrown=!0,S.emit("error",v)}})(this),this.saxParser.onend=(function(S){return function(){if(!S.saxParser.ended)return S.saxParser.ended=!0,S.emit("end",S.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,k=[],h=this.options.attrkey,m=this.options.charkey,this.saxParser.onopentag=(function(S){return function(v){var g,y,T,R,I;if(T={},T[m]="",!S.options.ignoreAttrs){I=v.attributes;for(g in I)f.call(I,g)&&(!(h in T)&&!S.options.mergeAttrs&&(T[h]={}),y=S.options.attrValueProcessors?o(S.options.attrValueProcessors,v.attributes[g],g):v.attributes[g],R=S.options.attrNameProcessors?o(S.options.attrNameProcessors,g):g,S.options.mergeAttrs?S.assignOrPush(T,R,y):r(T[h],R,y))}return T["#name"]=S.options.tagNameProcessors?o(S.options.tagNameProcessors,v.name):v.name,S.options.xmlns&&(T[S.options.xmlnskey]={uri:v.uri,local:v.local}),k.push(T)}})(this),this.saxParser.onclosetag=(function(S){return function(){var v,g,y,T,R,I,b,O,A,P;if(I=k.pop(),R=I["#name"],(!S.options.explicitChildren||!S.options.preserveChildrenOrder)&&delete I["#name"],I.cdata===!0&&(v=I.cdata,delete I.cdata),A=k[k.length-1],I[m].match(/^\s*$/)&&!v?(g=I[m],delete I[m]):(S.options.trim&&(I[m]=I[m].trim()),S.options.normalize&&(I[m]=I[m].replace(/\s{2,}/g," ").trim()),I[m]=S.options.valueProcessors?o(S.options.valueProcessors,I[m],R):I[m],Object.keys(I).length===1&&m in I&&!S.EXPLICIT_CHARKEY&&(I=I[m])),n(I)&&(typeof S.options.emptyTag=="function"?I=S.options.emptyTag():I=S.options.emptyTag!==""?S.options.emptyTag:g),S.options.validator!=null&&(P="/"+(function(){var D,V,$;for($=[],D=0,V=k.length;D<V;D++)T=k[D],$.push(T["#name"]);return $})().concat(R).join("/"),(function(){var D;try{return I=S.options.validator(P,A&&A[R],I)}catch(V){return D=V,S.emit("error",D)}})()),S.options.explicitChildren&&!S.options.mergeAttrs&&typeof I=="object"){if(!S.options.preserveChildrenOrder)T={},S.options.attrkey in I&&(T[S.options.attrkey]=I[S.options.attrkey],delete I[S.options.attrkey]),!S.options.charsAsChildren&&S.options.charkey in I&&(T[S.options.charkey]=I[S.options.charkey],delete I[S.options.charkey]),Object.getOwnPropertyNames(I).length>0&&(T[S.options.childkey]=I),I=T;else if(A){A[S.options.childkey]=A[S.options.childkey]||[],b={};for(y in I)f.call(I,y)&&r(b,y,I[y]);A[S.options.childkey].push(b),delete I["#name"],Object.keys(I).length===1&&m in I&&!S.EXPLICIT_CHARKEY&&(I=I[m])}}return k.length>0?S.assignOrPush(A,R,I):(S.options.explicitRoot&&(O=I,I={},r(I,R,O)),S.resultObject=I,S.saxParser.ended=!0,S.emit("end",S.resultObject))}})(this),_=(function(S){return function(v){var g,y;if(y=k[k.length-1],y)return y[m]+=v,S.options.explicitChildren&&S.options.preserveChildrenOrder&&S.options.charsAsChildren&&(S.options.includeWhiteChars||v.replace(/\\n/g,"").trim()!=="")&&(y[S.options.childkey]=y[S.options.childkey]||[],g={"#name":"__text__"},g[m]=v,S.options.normalize&&(g[m]=g[m].replace(/\s{2,}/g," ").trim()),y[S.options.childkey].push(g)),y}})(this),this.saxParser.ontext=_,this.saxParser.oncdata=(function(S){return function(v){var g;if(g=_(v),g)return g.cdata=!0}})(this)},d.prototype.parseString=function(h,m){var _;m!=null&&typeof m=="function"&&(this.on("end",function(k){return this.reset(),m(null,k)}),this.on("error",function(k){return this.reset(),m(k)}));try{return h=h.toString(),h.trim()===""?(this.emit("end",null),!0):(h=e.stripBOM(h),this.options.async?(this.remaining=h,c(this.processAsync),this.saxParser):this.saxParser.write(h).close())}catch(k){if(_=k,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw _}else return this.emit("error",_),this.saxParser.errThrown=!0}},d.prototype.parseStringPromise=function(h){return new Promise((function(m){return function(_,k){return m.parseString(h,function(S,v){return S?k(S):_(v)})}})(this))},d})(i),ii.parseString=function(p,d,h){var m,_,k;return h!=null?(typeof h=="function"&&(m=h),typeof d=="object"&&(_=d)):(typeof d=="function"&&(m=d),_={}),k=new ii.Parser(_),k.parseString(p,m)},ii.parseStringPromise=function(p,d){var h,m;return typeof d=="object"&&(h=d),m=new ii.Parser(h),m.parseStringPromise(p)}}).call(ii)});var kz=w(oi=>{(function(){"use strict";var e,t,r,i,n=function(s,a){for(var c in a)o.call(a,c)&&(s[c]=a[c]);function u(){this.constructor=s}return u.prototype=a.prototype,s.prototype=new u,s.__super__=a.prototype,s},o={}.hasOwnProperty;t=Gh(),e=wz(),r=Ez(),i=sk(),oi.defaults=t.defaults,oi.processors=i,oi.ValidationError=(function(s){n(a,s);function a(c){this.message=c}return a})(Error),oi.Builder=e.Builder,oi.Parser=r.Parser,oi.parseString=r.parseString,oi.parseStringPromise=r.parseStringPromise}).call(oi)});var $z=w(ak=>{"use strict";var iae=B("net"),Iz=B("util"),Oz=B("events"),hr=Iz.debuglog("http");function Rr(e){if(!(this instanceof Rr))return new Rr(e);Oz.call(this);var t=this;t.defaultPort=80,t.protocol="http:",t.options=Object.assign({},e),t.options.path=null,t.requests={},t.sockets={},t.freeSockets={},t.keepAliveMsecs=t.options.keepAliveMsecs||1e3,t.keepAlive=t.options.keepAlive||!1,t.maxSockets=t.options.maxSockets||Rr.defaultMaxSockets,t.maxFreeSockets=t.options.maxFreeSockets||256,t.freeSocketKeepAliveTimeout=t.options.freeSocketKeepAliveTimeout||0,t.timeout=t.options.timeout||0,this.socketActiveTTL=this.options.socketActiveTTL||null,t.on("free",function(r,i){var n=t.getName(i);if(hr("agent.on(free)",n),r.writable&&t.requests[n]&&t.requests[n].length)hr("continue handle next request"),t.requests[n].shift().onSocket(r),t.requests[n].length===0&&delete t.requests[n];else{var o=r._httpMessage;if(o&&o.shouldKeepAlive&&r.writable&&t.keepAlive){var s=t.freeSockets[n],a=s?s.length:0,c=a;if(t.sockets[n]&&(c+=t.sockets[n].length),c>t.maxSockets||a>=t.maxFreeSockets)r.destroy();else{s=s||[],t.freeSockets[n]=s,r.setKeepAlive(!0,t.keepAliveMsecs),r.unref(),r._httpMessage=null,t.removeSocket(r,i),s.push(r),r.listeners("error").length===0&&r.once("error",Cz);let u=r.freeSocketKeepAliveTimeout||t.freeSocketKeepAliveTimeout;r.setTimeout(u),hr(`push to free socket queue and wait for ${u}ms`)}}else r.destroy()}})}Iz.inherits(Rr,Oz);ak.Agent=Rr;function Cz(e){var t=this;hr("SOCKET ERROR on FREE socket:",e.message,e.stack),t.destroy(),t.emit("agentRemove")}Rr.defaultMaxSockets=1/0;Rr.prototype.createConnection=iae.createConnection;Rr.prototype.getName=function(t){var r=t.host||"localhost";return r+=":",t.port&&(r+=t.port),r+=":",t.localAddress&&(r+=t.localAddress),(t.family===4||t.family===6)&&(r+=":"+t.family),r};function Tz(e){return function(t,r){if(t){process.nextTick(function(){e.emit("error",t)});return}e.onSocket(r)}}Rr.prototype.addRequest=function(t,r,i,n){typeof r=="string"&&(r={host:r,port:i,localAddress:n}),r=Object.assign({},r),r=Object.assign(r,this.options),r.servername||(r.servername=Az(r,t));var o=this.getName(r);this.sockets[o]||(this.sockets[o]=[]);var s=this.freeSockets[o]?this.freeSockets[o].length:0,a=s+this.sockets[o].length;if(s){var c=this.freeSockets[o].shift();if(hr("have free socket"),c.removeListener("error",Cz),c.setTimeout(this.timeout),this.socketActiveTTL&&Date.now()-c.createdTime>this.socketActiveTTL)return hr(`socket ${c.createdTime} expired`),c.destroy(),this.createSocket(t,r,Tz(t));this.freeSockets[o].length||delete this.freeSockets[o],c.ref(),t.onSocket(c),this.sockets[o].push(c)}else a<this.maxSockets?(hr("call onSocket",a,s),this.createSocket(t,r,Tz(t))):(hr("wait for socket"),this.requests[o]||(this.requests[o]=[]),this.requests[o].push(t))};Rr.prototype.createSocket=function(t,r,i){var n=this;r=Object.assign({},r),r=Object.assign(r,n.options),r.servername||(r.servername=Az(r,t));var o=n.getName(r);r._agentKey=o,hr("createConnection",o,r),r.encoding=null;var s=!1;let a=n.createConnection(r,c);a&&c(null,Object.assign(a,{createdTime:Date.now()}));function c(u,l){if(s)return;if(s=!0,u)return i(u);n.sockets[o]||(n.sockets[o]=[]),n.sockets[o].push(l),hr("sockets",o,n.sockets[o].length);function f(){n.emit("free",l,r)}l.on("free",f);function p(m){hr("CLIENT socket onClose"),n.removeSocket(l,r),n.emit("close")}l.on("close",p);function d(){hr("CLIENT socket onTimeout"),l.destroy(),n.removeSocket(l,r),n.emit("timeout")}l.on("timeout",d),l.setTimeout(n.timeout);function h(){hr("CLIENT socket onRemove"),n.removeSocket(l,r),l.removeListener("close",p),l.removeListener("free",f),l.removeListener("agentRemove",h),l.setTimeout(0,d)}l.on("agentRemove",h),i(null,l)}};function Az(e,t){let r=e.host,i=t.getHeader("host");if(i)if(i.startsWith("[")){let n=i.indexOf("]");n===-1?r=i:r=i.substr(1,n-1)}else r=i.split(":",1)[0];return r}Rr.prototype.removeSocket=function(t,r){var i=this.getName(r);hr("removeSocket",i,"writable:",t.writable);var n=[this.sockets];t.writable||n.push(this.freeSockets);for(var o=0;o<n.length;o++){var s=n[o];if(s[i]){var a=s[i].indexOf(t);a!==-1&&(s[i].splice(a,1),s[i].length===0&&delete s[i])}}var c=this.freeSockets[i]?this.freeSockets[i].length:0,u=c+(this.sockets[i]?this.sockets[i].length:0);if(this.requests[i]&&this.requests[i].length&&u<this.maxSockets){hr("removeSocket, have a request, make a socket");var l=this.requests[i][0];this.createSocket(l,r,function(f,p){if(f){process.nextTick(function(){l.emit("error",f)});return}p.emit("free")})}};Rr.prototype.destroy=function(){for(var t=[this.freeSockets,this.sockets],r=0;r<t.length;r++)for(var i=t[r],n=Object.keys(i),o=0;o<n.length;o++)for(var s=i[n[o]],a=0;a<s.length;a++)s[a].destroy()};ak.globalAgent=new Rr});var Za=w((EIe,Rz)=>{"use strict";var oae=B("util"),sae=VE();Rz.exports=function(e){if(typeof e=="number")return e;var t=sae(e);if(t===void 0){var r=new Error(oae.format("humanize-ms(%j) result undefined",e));console.warn(r.stack)}return t}});var lk=w((kIe,Nz)=>{"use strict";var aae=$z().Agent,Dz=Za(),uk=class extends aae{constructor(t){t=t||{},t.keepAlive=t.keepAlive!==!1,t.freeSocketKeepAliveTimeout===void 0&&(t.freeSocketKeepAliveTimeout=15e3),t.keepAliveTimeout&&(t.freeSocketKeepAliveTimeout=t.keepAliveTimeout),t.freeSocketKeepAliveTimeout=Dz(t.freeSocketKeepAliveTimeout),t.timeout===void 0&&(t.timeout=t.freeSocketKeepAliveTimeout*2,t.timeout<3e4&&(t.timeout=3e4)),t.timeout=Dz(t.timeout),super(t),this.createSocketCount=0,this.createSocketCountLastCheck=0,this.createSocketErrorCount=0,this.createSocketErrorCountLastCheck=0,this.closeSocketCount=0,this.closeSocketCountLastCheck=0,this.errorSocketCount=0,this.errorSocketCountLastCheck=0,this.requestCount=0,this.requestCountLastCheck=0,this.timeoutSocketCount=0,this.timeoutSocketCountLastCheck=0,this.on("free",r=>{this.requestCount++,r.lastFreeTime=Date.now()}),this.on("timeout",()=>{this.timeoutSocketCount++}),this.on("close",()=>{this.closeSocketCount++}),this.on("error",()=>{this.errorSocketCount++})}createSocket(t,r,i){super.createSocket(t,r,(n,o)=>{if(n)return this.createSocketErrorCount++,i(n);this.keepAlive&&o.setNoDelay(!0),this.createSocketCount++,i(null,o)})}get statusChanged(){let t=this.createSocketCount!==this.createSocketCountLastCheck||this.createSocketErrorCount!==this.createSocketErrorCountLastCheck||this.closeSocketCount!==this.closeSocketCountLastCheck||this.errorSocketCount!==this.errorSocketCountLastCheck||this.timeoutSocketCount!==this.timeoutSocketCountLastCheck||this.requestCount!==this.requestCountLastCheck;return t&&(this.createSocketCountLastCheck=this.createSocketCount,this.createSocketErrorCountLastCheck=this.createSocketErrorCount,this.closeSocketCountLastCheck=this.closeSocketCount,this.errorSocketCountLastCheck=this.errorSocketCount,this.timeoutSocketCountLastCheck=this.timeoutSocketCount,this.requestCountLastCheck=this.requestCount),t}getCurrentStatus(){return{createSocketCount:this.createSocketCount,createSocketErrorCount:this.createSocketErrorCount,closeSocketCount:this.closeSocketCount,errorSocketCount:this.errorSocketCount,timeoutSocketCount:this.timeoutSocketCount,requestCount:this.requestCount,freeSockets:ck(this.freeSockets),sockets:ck(this.sockets),requests:ck(this.requests)}}};Nz.exports=uk;function ck(e){let t={};for(let r in e)t[r]=e[r].length;return t}});var jz=w((TIe,qz)=>{"use strict";var cae=B("https"),uae=lk(),Pz=cae.Agent,lm=class extends uae{constructor(t){super(t),this.defaultPort=443,this.protocol="https:",this.maxCachedSessions=this.options.maxCachedSessions,this.maxCachedSessions===void 0&&(this.maxCachedSessions=100),this._sessionCache={map:{},list:[]}}};["createConnection","getName","_getSession","_cacheSession","_evictSession"].forEach(function(e){typeof Pz.prototype[e]=="function"&&(lm.prototype[e]=Pz.prototype[e])});qz.exports=lm});var fm=w((IIe,fk)=>{"use strict";fk.exports=lk();fk.exports.HttpsAgent=jz()});var Ga=w((OIe,Mz)=>{"use strict";Mz.exports=fae;var lae=Object.prototype.hasOwnProperty;function fae(e,t,r){if(!e)throw new TypeError("argument dest is required");if(!t)throw new TypeError("argument src is required");return r===void 0&&(r=!0),Object.getOwnPropertyNames(t).forEach(function(n){if(!(!r&&lae.call(e,n))){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o)}}),e}});var Lz=w((dm,xl)=>{(function(){"use strict";var e={function:!0,object:!0},t=e[typeof window]&&window||this,r=t,i=e[typeof dm]&&dm,n=e[typeof xl]&&xl&&!xl.nodeType&&xl,o=i&&n&&typeof global=="object"&&global;o&&(o.global===o||o.window===o||o.self===o)&&(t=o);var s=Math.pow(2,53)-1,a=/\bOpera/,c=this,u=Object.prototype,l=u.hasOwnProperty,f=u.toString;function p(I){return I=String(I),I.charAt(0).toUpperCase()+I.slice(1)}function d(I,b,O){var A={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return b&&O&&/^Win/i.test(I)&&!/^Windows Phone /i.test(I)&&(A=A[/[\d.]+$/.exec(I)])&&(I="Windows "+A),I=String(I),b&&O&&(I=I.replace(RegExp(b,"i"),O)),I=m(I.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0]),I}function h(I,b){var O=-1,A=I?I.length:0;if(typeof A=="number"&&A>-1&&A<=s)for(;++O<A;)b(I[O],O,I);else _(I,b)}function m(I){return I=y(I),/^(?:webOS|i(?:OS|P))/.test(I)?I:p(I)}function _(I,b){for(var O in I)l.call(I,O)&&b(I[O],O,I)}function k(I){return I==null?p(I):f.call(I).slice(8,-1)}function S(I,b){var O=I!=null?typeof I[b]:"number";return!/^(?:boolean|number|string|undefined)$/.test(O)&&(O=="object"?!!I[b]:!0)}function v(I){return String(I).replace(/([ -])(?!$)/g,"$1?")}function g(I,b){var O=null;return h(I,function(A,P){O=b(O,A,P,I)}),O}function y(I){return String(I).replace(/^ +| +$/g,"")}function T(I){var b=t,O=I&&typeof I=="object"&&k(I)!="String";O&&(b=I,I=null);var A=b.navigator||{},P=A.userAgent||"";I||(I=P);var D=O||c==r,V=O?!!A.likeChrome:/\bChrome\b/.test(I)&&!/internal|\n/i.test(f.toString()),$="Object",U=O?$:"ScriptBridgingProxyObject",Z=O?$:"Environment",J=O&&b.java?"JavaPackage":k(b.java),j=O?$:"RuntimeObject",pe=/\bJava/.test(J)&&b.java,Q=pe&&k(b.environment)==Z,X=pe?"a":"\u03B1",N=pe?"b":"\u03B2",H=b.document||{},G=b.operamini||b.opera,re=a.test(re=O&&G?G["[[Class]]"]:k(G))?re:G=null,q,de=I,le=[],Oe=null,We=I==P,E=We&&G&&typeof G.version=="function"&&G.version(),x,F=Ce([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),C=Et(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),ue=et([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),be=rt({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),ne=Ge(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function Ce(_e){return g(_e,function(M,L){return M||RegExp("\\b"+(L.pattern||v(L))+"\\b","i").exec(I)&&(L.label||L)})}function rt(_e){return g(_e,function(M,L,K){return M||(L[ue]||L[/^[a-z]+(?: +[a-z]+\b)*/i.exec(ue)]||RegExp("\\b"+v(K)+"(?:\\b|\\w*\\d)","i").exec(I))&&K})}function Et(_e){return g(_e,function(M,L){return M||RegExp("\\b"+(L.pattern||v(L))+"\\b","i").exec(I)&&(L.label||L)})}function Ge(_e){return g(_e,function(M,L){var K=L.pattern||v(L);return!M&&(M=RegExp("\\b"+K+"(?:/[\\d.]+|[ \\w.]*)","i").exec(I))&&(M=d(M,K,L.label||L)),M})}function et(_e){return g(_e,function(M,L){var K=L.pattern||v(L);return!M&&(M=RegExp("\\b"+K+" *\\d+[.\\w_]*","i").exec(I)||RegExp("\\b"+K+" *\\w+-[\\w]*","i").exec(I)||RegExp("\\b"+K+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(I))&&((M=String(L.label&&!RegExp(K,"i").test(L.label)?L.label:M).split("/"))[1]&&!/[\d.]+/.test(M[0])&&(M[0]+=" "+M[1]),L=L.label||L,M=m(M[0].replace(RegExp(K,"i"),L).replace(RegExp("; *(?:"+L+"[_-])?","i")," ").replace(RegExp("("+L+")[-_.]?(\\w)","i"),"$1 $2"))),M})}function Ht(_e){return g(_e,function(M,L){return M||(RegExp(L+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(I)||0)[1]||null})}function kt(){return this.description||""}if(F&&(F=[F]),/\bAndroid\b/.test(ne)&&!ue&&(q=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(I))&&(ue=y(q[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),be&&!ue?ue=et([be]):be&&ue&&(ue=ue.replace(RegExp("^("+v(be)+")[-_.\\s]","i"),be+" ").replace(RegExp("^("+v(be)+")[-_.]?(\\w)","i"),be+" $2")),(q=/\bGoogle TV\b/.exec(ue))&&(ue=q[0]),/\bSimulator\b/i.test(I)&&(ue=(ue?ue+" ":"")+"Simulator"),C=="Opera Mini"&&/\bOPiOS\b/.test(I)&&le.push("running in Turbo/Uncompressed mode"),C=="IE"&&/\blike iPhone OS\b/.test(I)?(q=T(I.replace(/like iPhone OS/,"")),be=q.manufacturer,ue=q.product):/^iP/.test(ue)?(C||(C="Safari"),ne="iOS"+((q=/ OS ([\d_]+)/i.exec(I))?" "+q[1].replace(/_/g,"."):"")):C=="Konqueror"&&/^Linux\b/i.test(ne)?ne="Kubuntu":be&&be!="Google"&&(/Chrome/.test(C)&&!/\bMobile Safari\b/i.test(I)||/\bVita\b/.test(ue))||/\bAndroid\b/.test(ne)&&/^Chrome/.test(C)&&/\bVersion\//i.test(I)?(C="Android Browser",ne=/\bAndroid\b/.test(ne)?ne:"Android"):C=="Silk"?(/\bMobi/i.test(I)||(ne="Android",le.unshift("desktop mode")),/Accelerated *= *true/i.test(I)&&le.unshift("accelerated")):C=="UC Browser"&&/\bUCWEB\b/.test(I)?le.push("speed mode"):C=="PaleMoon"&&(q=/\bFirefox\/([\d.]+)\b/.exec(I))?le.push("identifying as Firefox "+q[1]):C=="Firefox"&&(q=/\b(Mobile|Tablet|TV)\b/i.exec(I))?(ne||(ne="Firefox OS"),ue||(ue=q[1])):!C||(q=!/\bMinefield\b/i.test(I)&&/\b(?:Firefox|Safari)\b/.exec(C))?(C&&!ue&&/[\/,]|^[^(]+?\)/.test(I.slice(I.indexOf(q+"/")+8))&&(C=null),(q=ue||be||ne)&&(ue||be||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(ne))&&(C=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(ne)?ne:q)+" Browser")):C=="Electron"&&(q=(/\bChrome\/([\d.]+)\b/.exec(I)||0)[1])&&le.push("Chromium "+q),E||(E=Ht(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",v(C),"(?:Firefox|Minefield|NetFront)"])),(q=F=="iCab"&&parseFloat(E)>3&&"WebKit"||/\bOpera\b/.test(C)&&(/\bOPR\b/.test(I)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(I)&&!/^(?:Trident|EdgeHTML)$/.test(F)&&"WebKit"||!F&&/\bMSIE\b/i.test(I)&&(ne=="Mac OS"?"Tasman":"Trident")||F=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(C)&&"NetFront")&&(F=[q]),C=="IE"&&(q=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(I)||0)[1])?(C+=" Mobile",ne="Windows Phone "+(/\+$/.test(q)?q:q+".x"),le.unshift("desktop mode")):/\bWPDesktop\b/i.test(I)?(C="IE Mobile",ne="Windows Phone 8.x",le.unshift("desktop mode"),E||(E=(/\brv:([\d.]+)/.exec(I)||0)[1])):C!="IE"&&F=="Trident"&&(q=/\brv:([\d.]+)/.exec(I))&&(C&&le.push("identifying as "+C+(E?" "+E:"")),C="IE",E=q[1]),We){if(S(b,"global"))if(pe&&(q=pe.lang.System,de=q.getProperty("os.arch"),ne=ne||q.getProperty("os.name")+" "+q.getProperty("os.version")),Q){try{E=b.require("ringo/engine").version.join("."),C="RingoJS"}catch{(q=b.system)&&q.global.system==b.system&&(C="Narwhal",ne||(ne=q[0].os||null))}C||(C="Rhino")}else typeof b.process=="object"&&!b.process.browser&&(q=b.process)&&(typeof q.versions=="object"&&(typeof q.versions.electron=="string"?(le.push("Node "+q.versions.node),C="Electron",E=q.versions.electron):typeof q.versions.nw=="string"&&(le.push("Chromium "+E,"Node "+q.versions.node),C="NW.js",E=q.versions.nw)),C||(C="Node.js",de=q.arch,ne=q.platform,E=/[\d.]+/.exec(q.version),E=E?E[0]:null));else k(q=b.runtime)==U?(C="Adobe AIR",ne=q.flash.system.Capabilities.os):k(q=b.phantom)==j?(C="PhantomJS",E=(q=q.version||null)&&q.major+"."+q.minor+"."+q.patch):typeof H.documentMode=="number"&&(q=/\bTrident\/(\d+)/i.exec(I))?(E=[E,H.documentMode],(q=+q[1]+4)!=E[1]&&(le.push("IE "+E[1]+" mode"),F&&(F[1]=""),E[1]=q),E=C=="IE"?String(E[1].toFixed(1)):E[0]):typeof H.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(C)&&(le.push("masking as "+C+" "+E),C="IE",E="11.0",F=["Trident"],ne="Windows");ne=ne&&m(ne)}if(E&&(q=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(E)||/(?:alpha|beta)(?: ?\d)?/i.exec(I+";"+(We&&A.appMinorVersion))||/\bMinefield\b/i.test(I)&&"a")&&(Oe=/b/i.test(q)?"beta":"alpha",E=E.replace(RegExp(q+"\\+?$"),"")+(Oe=="beta"?N:X)+(/\d+\+?/.exec(q)||"")),C=="Fennec"||C=="Firefox"&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(ne))C="Firefox Mobile";else if(C=="Maxthon"&&E)E=E.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(ue))ue=="Xbox 360"&&(ne=null),ue=="Xbox 360"&&/\bIEMobile\b/.test(I)&&le.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(C)||C&&!ue&&!/Browser|Mobi/.test(C))&&(ne=="Windows CE"||/Mobi/i.test(I)))C+=" Mobile";else if(C=="IE"&&We)try{b.external===null&&le.unshift("platform preview")}catch{le.unshift("embedded")}else(/\bBlackBerry\b/.test(ue)||/\bBB10\b/.test(I))&&(q=(RegExp(ue.replace(/ +/g," *")+"/([.\\d]+)","i").exec(I)||0)[1]||E)?(q=[q,/BB10/.test(I)],ne=(q[1]?(ue=null,be="BlackBerry"):"Device Software")+" "+q[0],E=null):this!=_&&ue!="Wii"&&(We&&G||/Opera/.test(C)&&/\b(?:MSIE|Firefox)\b/i.test(I)||C=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(ne)||C=="IE"&&(ne&&!/^Win/.test(ne)&&E>5.5||/\bWindows XP\b/.test(ne)&&E>8||E==8&&!/\bTrident\b/.test(I)))&&!a.test(q=T.call(_,I.replace(a,"")+";"))&&q.name&&(q="ing as "+q.name+((q=q.version)?" "+q:""),a.test(C)?(/\bIE\b/.test(q)&&ne=="Mac OS"&&(ne=null),q="identify"+q):(q="mask"+q,re?C=m(re.replace(/([a-z])([A-Z])/g,"$1 $2")):C="Opera",/\bIE\b/.test(q)&&(ne=null),We||(E=null)),F=["Presto"],le.push(q));(q=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(I)||0)[1])&&(q=[parseFloat(q.replace(/\.(\d)$/,".0$1")),q],C=="Safari"&&q[1].slice(-1)=="+"?(C="WebKit Nightly",Oe="alpha",E=q[1].slice(0,-1)):(E==q[1]||E==(q[2]=(/\bSafari\/([\d.]+\+?)/i.exec(I)||0)[1]))&&(E=null),q[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(I)||0)[1],q[0]==537.36&&q[2]==537.36&&parseFloat(q[1])>=28&&F=="WebKit"&&(F=["Blink"]),!We||!V&&!q[1]?(F&&(F[1]="like Safari"),q=(q=q[0],q<400?1:q<500?2:q<526?3:q<533?4:q<534?"4+":q<535?5:q<537?6:q<538?7:q<601?8:q<602?9:q<604?10:q<606?11:q<608?12:"12")):(F&&(F[1]="like Chrome"),q=q[1]||(q=q[0],q<530?1:q<532?2:q<532.05?3:q<533?4:q<534.03?5:q<534.07?6:q<534.1?7:q<534.13?8:q<534.16?9:q<534.24?10:q<534.3?11:q<535.01?12:q<535.02?"13+":q<535.07?15:q<535.11?16:q<535.19?17:q<536.05?18:q<536.1?19:q<537.01?20:q<537.11?"21+":q<537.13?23:q<537.18?24:q<537.24?25:q<537.36?26:F!="Blink"?"27":"28")),F&&(F[1]+=" "+(q+=typeof q=="number"?".x":/[.+]/.test(q)?"":"+")),C=="Safari"&&(!E||parseInt(E)>45)?E=q:C=="Chrome"&&/\bHeadlessChrome/i.test(I)&&le.unshift("headless")),C=="Opera"&&(q=/\bzbov|zvav$/.exec(ne))?(C+=" ",le.unshift("desktop mode"),q=="zvav"?(C+="Mini",E=null):C+="Mobile",ne=ne.replace(RegExp(" *"+q+"$"),"")):C=="Safari"&&/\bChrome\b/.exec(F&&F[1])?(le.unshift("desktop mode"),C="Chrome Mobile",E=null,/\bOS X\b/.test(ne)?(be="Apple",ne="iOS 4.3+"):ne=null):/\bSRWare Iron\b/.test(C)&&!E&&(E=Ht("Chrome")),E&&E.indexOf(q=/[\d.]+$/.exec(ne))==0&&I.indexOf("/"+q+"-")>-1&&(ne=y(ne.replace(q,""))),ne&&ne.indexOf(C)!=-1&&!RegExp(C+" OS").test(ne)&&(ne=ne.replace(RegExp(" *"+v(C)+" *"),"")),F&&!/\b(?:Avant|Nook)\b/.test(C)&&(/Browser|Lunascape|Maxthon/.test(C)||C!="Safari"&&/^iOS/.test(ne)&&/\bSafari\b/.test(F[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(C)&&F[1])&&(q=F[F.length-1])&&le.push(q),le.length&&(le=["("+le.join("; ")+")"]),be&&ue&&ue.indexOf(be)<0&&le.push("on "+be),ue&&le.push((/^on /.test(le[le.length-1])?"":"on ")+ue),ne&&(q=/ ([\d.+]+)$/.exec(ne),x=q&&ne.charAt(ne.length-q[0].length-1)=="/",ne={architecture:32,family:q&&!x?ne.replace(q[0],""):ne,version:q?q[1]:null,toString:function(){var _e=this.version;return this.family+(_e&&!x?" "+_e:"")+(this.architecture==64?" 64-bit":"")}}),(q=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(de))&&!/\bi686\b/i.test(de)?(ne&&(ne.architecture=64,ne.family=ne.family.replace(RegExp(" *"+q),"")),C&&(/\bWOW64\b/i.test(I)||We&&/\w(?:86|32)$/.test(A.cpuClass||A.platform)&&!/\bWin64; x64\b/i.test(I))&&le.unshift("32-bit")):ne&&/^OS X/.test(ne.family)&&C=="Chrome"&&parseFloat(E)>=39&&(ne.architecture=64),I||(I=null);var nt={};return nt.description=I,nt.layout=F&&F[0],nt.manufacturer=be,nt.name=C,nt.prerelease=Oe,nt.product=ue,nt.ua=I,nt.version=C&&E,nt.os=ne||{architecture:null,family:null,version:null,toString:function(){return"null"}},nt.parse=T,nt.toString=kt,nt.version&&le.unshift(E),nt.name&&le.unshift(C),ne&&C&&!(ne==String(ne).split(" ")[0]&&(ne==C.split(" ")[0]||ue))&&le.push(ue?"("+ne+")":"on "+ne),le.length&&(nt.description=le.join(" ")),nt}var R=T();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(t.platform=R,define(function(){return R})):i&&n?_(R,function(I,b){i[b]=I}):t.platform=R}).call(dm)});var Ur=w((CIe,Fz)=>{"use strict";var dae=Array.prototype.slice;Fz.exports=Sn;function Sn(e,t){if(!(this instanceof Sn))return new Sn(e,t);this.src=e,this._withAccess=t}Sn.prototype.withAccess=function(e){return this._withAccess=e!==!1,this};Sn.prototype.pick=function(e){return Array.isArray(e)||(e=dae.call(arguments)),e.length&&(this.keys=e),this};Sn.prototype.to=function(e){if(e=e||{},!this.src)return e;var t=this.keys||Object.keys(this.src);if(!this._withAccess){for(var r=0;r<t.length;r++)i=t[r],e[i]===void 0&&(e[i]=this.src[i]);return e}for(var r=0;r<t.length;r++){var i=t[r];if(pae(e,i)){var n=this.src.__lookupGetter__(i),o=this.src.__lookupSetter__(i);n&&e.__defineGetter__(i,n),o&&e.__defineSetter__(i,o),!n&&!o&&(e[i]=this.src[i])}}return e};Sn.prototype.toCover=function(e){for(var t=this.keys||Object.keys(this.src),r=0;r<t.length;r++){var i=t[r];delete e[i];var n=this.src.__lookupGetter__(i),o=this.src.__lookupSetter__(i);n&&e.__defineGetter__(i,n),o&&e.__defineSetter__(i,o),!n&&!o&&(e[i]=this.src[i])}};Sn.prototype.override=Sn.prototype.toCover;Sn.prototype.and=function(e){var t={};return this.to(t),this.src=e,this.to(t),this.src=t,this};function pae(e,t){return e[t]===void 0&&e.__lookupGetter__(t)===void 0&&e.__lookupSetter__(t)===void 0}});var zz=w(dk=>{"use strict";var hae=B("assert");dk.noop=function(){};dk.getParamNames=function(t,r){var i=typeof t;if(hae(i==="function",'The "func" must be a function. Received type "'+i+'"'),r=r!==!1,r&&t.__cache_names)return t.__cache_names;var n=t.toString(),o=n.slice(n.indexOf("(")+1,n.indexOf(")")).match(/([^\s,]+)/g)||[];return t.__cache_names=o,o}});var Bz=w(Uz=>{"use strict";Uz.setImmediate=typeof setImmediate=="function"?setImmediate:function(e){process.nextTick(e.bind.apply(e,arguments))}});var Wz=w(Ka=>{"use strict";Ka.try=function(e){var t={error:void 0,value:void 0};try{t.value=e()}catch(r){t.error=r instanceof Error?r:new Error(r)}return t};Ka.UNSTABLE_METHOD={try:Ka.try};Ka.dig=function(e){if(e){if(arguments.length<=1)return e;for(var t=e[arguments[1]],r=2;r<arguments.length&&t;r++)t=t[arguments[r]];return t}};Ka.argumentsToArray=function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}});var Zz=w(tn=>{"use strict";var Hz=B("crypto");tn.hash=function(t,r,i){var n=Hz.createHash(t),o=Buffer.isBuffer(r);return!o&&typeof r=="object"&&(r=JSON.stringify(Vz(r))),n.update(r,o?"binary":"utf8"),n.digest(i||"hex")};tn.md5=function(t,r){return tn.hash("md5",t,r)};tn.sha1=function(t,r){return tn.hash("sha1",t,r)};tn.sha256=function(t,r){return tn.hash("sha256",t,r)};tn.hmac=function(t,r,i,n){n=n||"base64";var o=Hz.createHmac(t,r);return o.update(i,Buffer.isBuffer(i)?"binary":"utf8"),o.digest(n)};tn.base64encode=function(t,r){Buffer.isBuffer(t)||(t=typeof Buffer.from=="function"?Buffer.from(t):new Buffer(t));var i=t.toString("base64");return r&&(i=i.replace(/\+/g,"-").replace(/\//g,"_")),i};tn.base64decode=function(t,r,i){r&&(t=t.replace(/\-/g,"+").replace(/_/g,"/"));var n=typeof Buffer.from=="function"?Buffer.from(t,"base64"):new Buffer(t,"base64");return i==="buffer"?n:n.toString(i||"utf8")};function Vz(e){if(!e||Array.isArray(e)||typeof e!="object")return e;var t=Object.keys(e);t.sort();for(var r=[],i=0;i<t.length;i++){var n=t[i];r.push([n,Vz(e[n])])}return r}});var Xz=w(En=>{"use strict";En.MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1;En.MIN_SAFE_INTEGER=-En.MAX_SAFE_INTEGER;var Kz=En.MAX_SAFE_INTEGER_STR=String(En.MAX_SAFE_INTEGER),Gz=Kz.length;En.isSafeNumberString=function(t){return t[0]==="-"&&(t=t.substring(1)),t.length<Gz||t.length===Gz&&t<=Kz};En.toSafeNumber=function(t){return typeof t=="number"?t:En.isSafeNumberString(t)?Number(t):t};En.random=function(t,r){if(t===void 0&&r===void 0)return 0;r===void 0&&(r=t,t=0);var i;return t>r&&(i=t,t=r,r=i),Math.floor(t+Math.random()*(r-t))}});var Yz=w(Bo=>{"use strict";Bo.randomString=function(t,r){var i=[];for(t=t||16,r=r||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";t--;)i.push(r[Math.floor(Math.random()*r.length)]);return i.join("")};Bo.split=function(t,r){t=t||"",r=r||",";for(var i=t.split(r),n=[],o=0;o<i.length;o++){var s=i[o].trim();s.length>0&&n.push(s)}return n};Bo.splitAlwaysOptimized=function(){var t="",r=",";arguments.length===1?t=arguments[0]||"":arguments.length===2&&(t=arguments[0]||"",r=arguments[1]||",");for(var i=t.split(r),n=[],o=0;o<i.length;o++){var s=i[o].trim();s.length>0&&n.push(s)}return n};Bo.replace=function(t,r,i){var n=i;return typeof n!="function"&&(n=function(){return i}),t.replace(r,n)};var Jz=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];Bo.replaceInvalidHttpHeaderChar=function(t,r){r=r||" ";var i=!1;if(!t||typeof t!="string")return{val:t,invalid:i};for(var n=typeof r,o,s=0;s<t.length;++s)Jz[t.charCodeAt(s)]||(o=o||t.split(""),n==="function"?o[s]=r(o[s]):o[s]=r);return o&&(t=o.join(""),i=!0),{val:t,invalid:i}};Bo.includesInvalidHttpHeaderChar=function(t){if(!t||typeof t!="string")return!1;for(var r=0;r<t.length;++r)if(!Jz[t.charCodeAt(r)])return!0;return!1}});var Qz=w(pk=>{"use strict";pk.randomSlice=function(t,r){if(!r||r>=t.length)return t.slice();for(var i=Math.floor(Math.random()*t.length),n=[],o=0,s=i;o<r;o++)n.push(t[s++]),s===t.length&&(s=0);return n};pk.spliceOne=function(t,r){if(r<0&&(r=t.length+r,r<0)||r>=t.length)return t;for(var i=r,n=i+1,o=t.length;n<o;i+=1,n+=1)t[i]=t[n];return t.pop(),t}});var nU=w((jIe,rU)=>{var Sl=B("path"),eU=B("fs"),tU=parseInt("0777",8);rU.exports=Xa.mkdirp=Xa.mkdirP=Xa;function Xa(e,t,r,i){typeof t=="function"?(r=t,t={}):(!t||typeof t!="object")&&(t={mode:t});var n=t.mode,o=t.fs||eU;n===void 0&&(n=tU),i||(i=null);var s=r||function(){};e=Sl.resolve(e),o.mkdir(e,n,function(a){if(!a)return i=i||e,s(null,i);switch(a.code){case"ENOENT":if(Sl.dirname(e)===e)return s(a);Xa(Sl.dirname(e),t,function(c,u){c?s(c,u):Xa(e,t,s,u)});break;default:o.stat(e,function(c,u){c||!u.isDirectory()?s(a,i):s(null,i)});break}})}Xa.sync=function e(t,r,i){(!r||typeof r!="object")&&(r={mode:r});var n=r.mode,o=r.fs||eU;n===void 0&&(n=tU),i||(i=null),t=Sl.resolve(t);try{o.mkdirSync(t,n),i=i||t}catch(a){switch(a.code){case"ENOENT":i=e(Sl.dirname(t),r,i),e(t,r,i);break;default:var s;try{s=o.statSync(t)}catch{throw a}if(!s.isDirectory())throw a;break}}return i}});var sU=w((MIe,oU)=>{"use strict";var iU="@@any-promise/REGISTRATION",kn=null;oU.exports=function(e,t){return function(i,n){i=i||null,n=n||{};var o=n.global!==!1;if(kn===null&&o&&(kn=e[iU]||null),kn!==null&&i!==null&&kn.implementation!==i)throw new Error('any-promise already defined as "'+kn.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return kn===null&&(i!==null&&typeof n.Promise<"u"?kn={Promise:n.Promise,implementation:i}:kn=t(i),o&&(e[iU]=kn)),kn}}});var uU=w((LIe,cU)=>{"use strict";cU.exports=sU()(global,aU);function aU(e){var t=null;if(mae(e))t={Promise:global.Promise,implementation:"global.Promise"};else if(e){var r=B(e);t={Promise:r.Promise||r,implementation:e}}else t=gae();if(t===null)throw new Error('Cannot find any-promise implementation nor global.Promise. You must install polyfill or call require("any-promise/register") with your preferred implementation, e.g. require("any-promise/register/bluebird") on application load prior to any require("any-promise").');return t}function mae(e){if(e)return e==="global.Promise";if(typeof global.Promise<"u"){var t=/v(\d+)\.(\d+)\.(\d+)/.exec(process.version);return!(t&&+t[1]==0&&+t[2]<12)}return!1}function gae(){for(var e=["es6-promise","promise","native-promise-only","bluebird","rsvp","when","q","pinkie","lie","vow"],t=0,r=e.length;t<r;t++)try{return aU(e[t])}catch{}return null}});var El=w((zIe,lU)=>{lU.exports=uU()().Promise});var mU=w((UIe,hU)=>{var yae=El(),fU=B("assert");hU.exports=dU;function dU(e,t){return fU(typeof e=="function"),pU(e,t)}dU.withCallback=function(e,t){return fU(typeof e=="function"),t=t||{},t.withCallback=!0,pU(e,t)};function vae(e,t,r){return r===void 0&&(r=!0),function(i,n){if(i)return t(i);var o=arguments.length;if(o<=2||!r)return e(n);if(Array.isArray(r)){for(var a={},s=1;s<o;s++)a[r[s-1]]=arguments[s];return e(a)}for(var a=new Array(o-1),s=1;s<o;++s)a[s-1]=arguments[s];e(a)}}function pU(e,t){t=t||{};var r=e.name;r=(r||"").replace(/\s|bound(?!$)/g,"");var i=function(){var n=this,o=arguments.length;if(t.withCallback){var s=typeof arguments[o-1];if(s==="function")return e.apply(n,arguments)}for(var a=new Array(o+1),c=0;c<o;++c)a[c]=arguments[c];var u=c;return new yae(function(l,f){a[u]=vae(l,f,t.multiArgs),e.apply(n,a)})};return Object.defineProperty(i,"name",{value:r}),i}});var vU=w((BIe,yU)=>{var hk=mU();yU.exports=mk;mk.withCallback=bae;mk.thenify=hk;function mk(e,t,r){return gU(e,t,r,hk)}function bae(e,t,r){return gU(e,t,r,hk.withCallback)}function gU(e,t,r,i){return t||(t={},r=Object.keys(e)),Array.isArray(t)&&(r=t,t={}),r||(r=Object.keys(e)),typeof e=="function"&&(t=i(e)),r.forEach(function(n){typeof e[n]=="function"&&(t[n]=i(e[n]))}),Object.keys(e).forEach(function(n){_ae(e,n)||t[n]||(t[n]=e[n])}),t}function _ae(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return!r||!r.get?!1:r.get.name==="deprecated"}});var bU=w(gk=>{var wae=El(),Zi;try{Zi=Ii()}catch{Zi=B("fs")}var pm=["appendFile","chmod","chown","close","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","link","lstat","mkdir","open","read","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","write","writeFile"];typeof Zi.access=="function"&&pm.push("access");typeof Zi.copyFile=="function"&&pm.push("copyFile");typeof Zi.mkdtemp=="function"&&pm.push("mkdtemp");vU().withCallback(Zi,gk,pm);gk.exists=function(e,t){return typeof t=="function"?Zi.stat(e,function(r){t(null,!r)}):new wae(function(r){Zi.stat(e,function(i){r(!i)})})}});var xU=w(Ya=>{"use strict";var _U=B("path"),yk;function wU(){return yk||(yk=nU()),yk}var vk;function Ja(){return vk||(vk=bU()),vk}Ya.strictJSONParse=function(e){var t=JSON.parse(e);if(!t||typeof t!="object")throw new Error("JSON string is not object");return t};Ya.readJSONSync=function(e){if(!Ja().existsSync(e))throw new Error(e+" is not found");return JSON.parse(Ja().readFileSync(e))};Ya.writeJSONSync=function(e,t,r){r=r||{},"space"in r||(r.space=2),wU().sync(_U.dirname(e)),typeof t=="object"&&(t=JSON.stringify(t,r.replacer,r.space)+`
|
|
208
|
+
`?(x.line++,x.column=0):x.column++);x.cdata+=E.substring(be,F-1),C==="]"&&(x.state=b.CDATA_ENDING);continue;case b.CDATA_ENDING:C==="]"?x.state=b.CDATA_ENDING_2:(x.cdata+="]"+C,x.state=b.CDATA);continue;case b.CDATA_ENDING_2:C===">"?(x.cdata&&U(x,"oncdata",x.cdata),U(x,"onclosecdata"),x.cdata="",x.state=b.TEXT):C==="]"?x.cdata+="]":(x.cdata+="]]"+C,x.state=b.CDATA);continue;case b.PROC_INST:C==="?"?x.state=b.PROC_INST_ENDING:g(C)?x.state=b.PROC_INST_BODY:x.procInstName+=C;continue;case b.PROC_INST_BODY:if(!x.procInstBody&&g(C))continue;C==="?"?x.state=b.PROC_INST_ENDING:x.procInstBody+=C;continue;case b.PROC_INST_ENDING:if(C===">"){let Et={name:x.procInstName,body:x.procInstBody};$(x,Et),U(x,"onprocessinginstruction",Et),x.procInstName=x.procInstBody="",x.state=b.TEXT}else x.procInstBody+="?"+C,x.state=b.PROC_INST_BODY;continue;case b.OPEN_TAG:R(k,C)?x.tagName+=C:(X(x),C===">"?G(x):C==="/"?x.state=b.OPEN_TAG_SLASH:(g(C)||Q(x,"Invalid character in tag name"),x.state=b.ATTRIB));continue;case b.OPEN_TAG_SLASH:C===">"?(G(x,!0),re(x)):(Q(x,"Forward-slash in opening tag not followed by >"),x.state=b.ATTRIB);continue;case b.ATTRIB:if(g(C))continue;C===">"?G(x):C==="/"?x.state=b.OPEN_TAG_SLASH:R(_,C)?(x.attribName=C,x.attribValue="",x.state=b.ATTRIB_NAME):Q(x,"Invalid attribute name");continue;case b.ATTRIB_NAME:C==="="?x.state=b.ATTRIB_VALUE:C===">"?(Q(x,"Attribute without value"),x.attribValue=x.attribName,H(x),G(x)):g(C)?x.state=b.ATTRIB_NAME_SAW_WHITE:R(k,C)?x.attribName+=C:Q(x,"Invalid attribute name");continue;case b.ATTRIB_NAME_SAW_WHITE:if(C==="=")x.state=b.ATTRIB_VALUE;else{if(g(C))continue;Q(x,"Attribute without value"),x.tag.attributes[x.attribName]="",x.attribValue="",U(x,"onattribute",{name:x.attribName,value:""}),x.attribName="",C===">"?G(x):R(_,C)?(x.attribName=C,x.state=b.ATTRIB_NAME):(Q(x,"Invalid attribute name"),x.state=b.ATTRIB)}continue;case b.ATTRIB_VALUE:if(g(C))continue;y(C)?(x.q=C,x.state=b.ATTRIB_VALUE_QUOTED):(x.opt.unquotedAttributeValues||j(x,"Unquoted attribute value"),x.state=b.ATTRIB_VALUE_UNQUOTED,x.attribValue=C);continue;case b.ATTRIB_VALUE_QUOTED:if(C!==x.q){C==="&"?x.state=b.ATTRIB_VALUE_ENTITY_Q:x.attribValue+=C;continue}H(x),x.q="",x.state=b.ATTRIB_VALUE_CLOSED;continue;case b.ATTRIB_VALUE_CLOSED:g(C)?x.state=b.ATTRIB:C===">"?G(x):C==="/"?x.state=b.OPEN_TAG_SLASH:R(_,C)?(Q(x,"No whitespace between attributes"),x.attribName=C,x.attribValue="",x.state=b.ATTRIB_NAME):Q(x,"Invalid attribute name");continue;case b.ATTRIB_VALUE_UNQUOTED:if(!T(C)){C==="&"?x.state=b.ATTRIB_VALUE_ENTITY_U:x.attribValue+=C;continue}H(x),C===">"?G(x):x.state=b.ATTRIB;continue;case b.CLOSE_TAG:if(x.tagName)C===">"?re(x):R(k,C)?x.tagName+=C:x.script?(x.script+="</"+x.tagName+C,x.tagName="",x.state=b.SCRIPT):(g(C)||Q(x,"Invalid tagname in closing tag"),x.state=b.CLOSE_TAG_SAW_WHITE);else{if(g(C))continue;I(_,C)?x.script?(x.script+="</"+C,x.state=b.SCRIPT):Q(x,"Invalid tagname in closing tag."):x.tagName=C}continue;case b.CLOSE_TAG_SAW_WHITE:if(g(C))continue;C===">"?re(x):Q(x,"Invalid characters in closing tag");continue;case b.TEXT_ENTITY:case b.ATTRIB_VALUE_ENTITY_Q:case b.ATTRIB_VALUE_ENTITY_U:var ne,Ce;switch(x.state){case b.TEXT_ENTITY:ne=b.TEXT,Ce="textNode";break;case b.ATTRIB_VALUE_ENTITY_Q:ne=b.ATTRIB_VALUE_QUOTED,Ce="attribValue";break;case b.ATTRIB_VALUE_ENTITY_U:ne=b.ATTRIB_VALUE_UNQUOTED,Ce="attribValue";break}if(C===";"){var rt=q(x);x.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(rt)?((x.entityCount+=1)>x.opt.maxEntityCount&&j(x,"Parsed entity count exceeds max entity count"),(x.entityDepth+=1)>x.opt.maxEntityDepth&&j(x,"Parsed entity depth exceeds max entity depth"),x.entity="",x.state=ne,x.write(rt),x.entityDepth-=1):(x[Ce]+=rt,x.entity="",x.state=ne)}else R(x.entity.length?v:S,C)?x.entity+=C:(Q(x,"Invalid character in entity name"),x[Ce]+="&"+x.entity+C,x.entity="",x.state=ne);continue;default:throw new Error(x,"Unknown state: "+x.state)}return x.position>=x.bufferCheckPosition&&i(x),x}String.fromCodePoint||(function(){var E=String.fromCharCode,x=Math.floor,F=function(){var C=16384,ue=[],be,ne,Ce=-1,rt=arguments.length;if(!rt)return"";for(var Et="";++Ce<rt;){var Ge=Number(arguments[Ce]);if(!isFinite(Ge)||Ge<0||Ge>1114111||x(Ge)!==Ge)throw RangeError("Invalid code point: "+Ge);Ge<=65535?ue.push(Ge):(Ge-=65536,be=(Ge>>10)+55296,ne=Ge%1024+56320,ue.push(be,ne)),(Ce+1===rt||ue.length>C)&&(Et+=E.apply(null,ue),ue.length=0)}return Et};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:F,configurable:!0,writable:!0}):String.fromCodePoint=F})()})(typeof um>"u"?um.sax={}:um)});var Sz=w(ok=>{(function(){"use strict";ok.stripBOM=function(e){return e[0]==="\uFEFF"?e.substring(1):e}}).call(ok)});var sk=w(Uo=>{(function(){"use strict";var e;e=new RegExp(/(?!xmlns)^.*:/),Uo.normalize=function(t){return t.toLowerCase()},Uo.firstCharLowerCase=function(t){return t.charAt(0).toLowerCase()+t.slice(1)},Uo.stripPrefix=function(t){return t.replace(e,"")},Uo.parseNumbers=function(t){return isNaN(t)||(t=t%1===0?parseInt(t,10):parseFloat(t)),t},Uo.parseBooleans=function(t){return/^(?:true|false)$/i.test(t)&&(t=t.toLowerCase()==="true"),t}}).call(Uo)});var Ez=w(ii=>{(function(){"use strict";var e,t,r,i,n,o,s,a,c,u=function(p,d){return function(){return p.apply(d,arguments)}},l=function(p,d){for(var h in d)f.call(d,h)&&(p[h]=d[h]);function m(){this.constructor=p}return m.prototype=d.prototype,p.prototype=new m,p.__super__=d.prototype,p},f={}.hasOwnProperty;a=xz(),i=B("events"),e=Sz(),s=sk(),c=B("timers").setImmediate,t=Gh().defaults,n=function(p){return typeof p=="object"&&p!=null&&Object.keys(p).length===0},o=function(p,d,h){var m,_,k;for(m=0,_=p.length;m<_;m++)k=p[m],d=k(d,h);return d},r=function(p,d,h){var m;return m=Object.create(null),m.value=h,m.writable=!0,m.enumerable=!0,m.configurable=!0,Object.defineProperty(p,d,m)},ii.Parser=(function(p){l(d,p);function d(h){this.parseStringPromise=u(this.parseStringPromise,this),this.parseString=u(this.parseString,this),this.reset=u(this.reset,this),this.assignOrPush=u(this.assignOrPush,this),this.processAsync=u(this.processAsync,this);var m,_,k;if(!(this instanceof ii.Parser))return new ii.Parser(h);this.options={},_=t["0.2"];for(m in _)f.call(_,m)&&(k=_[m],this.options[m]=k);for(m in h)f.call(h,m)&&(k=h[m],this.options[m]=k);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(s.normalize)),this.reset()}return d.prototype.processAsync=function(){var h,m;try{return this.remaining.length<=this.options.chunkSize?(h=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(h),this.saxParser.close()):(h=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(h),c(this.processAsync))}catch(_){if(m=_,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(m)}},d.prototype.assignOrPush=function(h,m,_){return m in h?(h[m]instanceof Array||r(h,m,[h[m]]),h[m].push(_)):this.options.explicitArray?r(h,m,[_]):r(h,m,_)},d.prototype.reset=function(){var h,m,_,k;return this.removeAllListeners(),this.saxParser=a.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(function(S){return function(v){if(S.saxParser.resume(),!S.saxParser.errThrown)return S.saxParser.errThrown=!0,S.emit("error",v)}})(this),this.saxParser.onend=(function(S){return function(){if(!S.saxParser.ended)return S.saxParser.ended=!0,S.emit("end",S.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,k=[],h=this.options.attrkey,m=this.options.charkey,this.saxParser.onopentag=(function(S){return function(v){var g,y,T,R,I;if(T={},T[m]="",!S.options.ignoreAttrs){I=v.attributes;for(g in I)f.call(I,g)&&(!(h in T)&&!S.options.mergeAttrs&&(T[h]={}),y=S.options.attrValueProcessors?o(S.options.attrValueProcessors,v.attributes[g],g):v.attributes[g],R=S.options.attrNameProcessors?o(S.options.attrNameProcessors,g):g,S.options.mergeAttrs?S.assignOrPush(T,R,y):r(T[h],R,y))}return T["#name"]=S.options.tagNameProcessors?o(S.options.tagNameProcessors,v.name):v.name,S.options.xmlns&&(T[S.options.xmlnskey]={uri:v.uri,local:v.local}),k.push(T)}})(this),this.saxParser.onclosetag=(function(S){return function(){var v,g,y,T,R,I,b,O,A,P;if(I=k.pop(),R=I["#name"],(!S.options.explicitChildren||!S.options.preserveChildrenOrder)&&delete I["#name"],I.cdata===!0&&(v=I.cdata,delete I.cdata),A=k[k.length-1],I[m].match(/^\s*$/)&&!v?(g=I[m],delete I[m]):(S.options.trim&&(I[m]=I[m].trim()),S.options.normalize&&(I[m]=I[m].replace(/\s{2,}/g," ").trim()),I[m]=S.options.valueProcessors?o(S.options.valueProcessors,I[m],R):I[m],Object.keys(I).length===1&&m in I&&!S.EXPLICIT_CHARKEY&&(I=I[m])),n(I)&&(typeof S.options.emptyTag=="function"?I=S.options.emptyTag():I=S.options.emptyTag!==""?S.options.emptyTag:g),S.options.validator!=null&&(P="/"+(function(){var D,V,$;for($=[],D=0,V=k.length;D<V;D++)T=k[D],$.push(T["#name"]);return $})().concat(R).join("/"),(function(){var D;try{return I=S.options.validator(P,A&&A[R],I)}catch(V){return D=V,S.emit("error",D)}})()),S.options.explicitChildren&&!S.options.mergeAttrs&&typeof I=="object"){if(!S.options.preserveChildrenOrder)T={},S.options.attrkey in I&&(T[S.options.attrkey]=I[S.options.attrkey],delete I[S.options.attrkey]),!S.options.charsAsChildren&&S.options.charkey in I&&(T[S.options.charkey]=I[S.options.charkey],delete I[S.options.charkey]),Object.getOwnPropertyNames(I).length>0&&(T[S.options.childkey]=I),I=T;else if(A){A[S.options.childkey]=A[S.options.childkey]||[],b={};for(y in I)f.call(I,y)&&r(b,y,I[y]);A[S.options.childkey].push(b),delete I["#name"],Object.keys(I).length===1&&m in I&&!S.EXPLICIT_CHARKEY&&(I=I[m])}}return k.length>0?S.assignOrPush(A,R,I):(S.options.explicitRoot&&(O=I,I={},r(I,R,O)),S.resultObject=I,S.saxParser.ended=!0,S.emit("end",S.resultObject))}})(this),_=(function(S){return function(v){var g,y;if(y=k[k.length-1],y)return y[m]+=v,S.options.explicitChildren&&S.options.preserveChildrenOrder&&S.options.charsAsChildren&&(S.options.includeWhiteChars||v.replace(/\\n/g,"").trim()!=="")&&(y[S.options.childkey]=y[S.options.childkey]||[],g={"#name":"__text__"},g[m]=v,S.options.normalize&&(g[m]=g[m].replace(/\s{2,}/g," ").trim()),y[S.options.childkey].push(g)),y}})(this),this.saxParser.ontext=_,this.saxParser.oncdata=(function(S){return function(v){var g;if(g=_(v),g)return g.cdata=!0}})(this)},d.prototype.parseString=function(h,m){var _;m!=null&&typeof m=="function"&&(this.on("end",function(k){return this.reset(),m(null,k)}),this.on("error",function(k){return this.reset(),m(k)}));try{return h=h.toString(),h.trim()===""?(this.emit("end",null),!0):(h=e.stripBOM(h),this.options.async?(this.remaining=h,c(this.processAsync),this.saxParser):this.saxParser.write(h).close())}catch(k){if(_=k,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw _}else return this.emit("error",_),this.saxParser.errThrown=!0}},d.prototype.parseStringPromise=function(h){return new Promise((function(m){return function(_,k){return m.parseString(h,function(S,v){return S?k(S):_(v)})}})(this))},d})(i),ii.parseString=function(p,d,h){var m,_,k;return h!=null?(typeof h=="function"&&(m=h),typeof d=="object"&&(_=d)):(typeof d=="function"&&(m=d),_={}),k=new ii.Parser(_),k.parseString(p,m)},ii.parseStringPromise=function(p,d){var h,m;return typeof d=="object"&&(h=d),m=new ii.Parser(h),m.parseStringPromise(p)}}).call(ii)});var kz=w(oi=>{(function(){"use strict";var e,t,r,i,n=function(s,a){for(var c in a)o.call(a,c)&&(s[c]=a[c]);function u(){this.constructor=s}return u.prototype=a.prototype,s.prototype=new u,s.__super__=a.prototype,s},o={}.hasOwnProperty;t=Gh(),e=wz(),r=Ez(),i=sk(),oi.defaults=t.defaults,oi.processors=i,oi.ValidationError=(function(s){n(a,s);function a(c){this.message=c}return a})(Error),oi.Builder=e.Builder,oi.Parser=r.Parser,oi.parseString=r.parseString,oi.parseStringPromise=r.parseStringPromise}).call(oi)});var $z=w(ak=>{"use strict";var iae=B("net"),Iz=B("util"),Oz=B("events"),hr=Iz.debuglog("http");function Rr(e){if(!(this instanceof Rr))return new Rr(e);Oz.call(this);var t=this;t.defaultPort=80,t.protocol="http:",t.options=Object.assign({},e),t.options.path=null,t.requests={},t.sockets={},t.freeSockets={},t.keepAliveMsecs=t.options.keepAliveMsecs||1e3,t.keepAlive=t.options.keepAlive||!1,t.maxSockets=t.options.maxSockets||Rr.defaultMaxSockets,t.maxFreeSockets=t.options.maxFreeSockets||256,t.freeSocketKeepAliveTimeout=t.options.freeSocketKeepAliveTimeout||0,t.timeout=t.options.timeout||0,this.socketActiveTTL=this.options.socketActiveTTL||null,t.on("free",function(r,i){var n=t.getName(i);if(hr("agent.on(free)",n),r.writable&&t.requests[n]&&t.requests[n].length)hr("continue handle next request"),t.requests[n].shift().onSocket(r),t.requests[n].length===0&&delete t.requests[n];else{var o=r._httpMessage;if(o&&o.shouldKeepAlive&&r.writable&&t.keepAlive){var s=t.freeSockets[n],a=s?s.length:0,c=a;if(t.sockets[n]&&(c+=t.sockets[n].length),c>t.maxSockets||a>=t.maxFreeSockets)r.destroy();else{s=s||[],t.freeSockets[n]=s,r.setKeepAlive(!0,t.keepAliveMsecs),r.unref(),r._httpMessage=null,t.removeSocket(r,i),s.push(r),r.listeners("error").length===0&&r.once("error",Cz);let u=r.freeSocketKeepAliveTimeout||t.freeSocketKeepAliveTimeout;r.setTimeout(u),hr(`push to free socket queue and wait for ${u}ms`)}}else r.destroy()}})}Iz.inherits(Rr,Oz);ak.Agent=Rr;function Cz(e){var t=this;hr("SOCKET ERROR on FREE socket:",e.message,e.stack),t.destroy(),t.emit("agentRemove")}Rr.defaultMaxSockets=1/0;Rr.prototype.createConnection=iae.createConnection;Rr.prototype.getName=function(t){var r=t.host||"localhost";return r+=":",t.port&&(r+=t.port),r+=":",t.localAddress&&(r+=t.localAddress),(t.family===4||t.family===6)&&(r+=":"+t.family),r};function Tz(e){return function(t,r){if(t){process.nextTick(function(){e.emit("error",t)});return}e.onSocket(r)}}Rr.prototype.addRequest=function(t,r,i,n){typeof r=="string"&&(r={host:r,port:i,localAddress:n}),r=Object.assign({},r),r=Object.assign(r,this.options),r.servername||(r.servername=Az(r,t));var o=this.getName(r);this.sockets[o]||(this.sockets[o]=[]);var s=this.freeSockets[o]?this.freeSockets[o].length:0,a=s+this.sockets[o].length;if(s){var c=this.freeSockets[o].shift();if(hr("have free socket"),c.removeListener("error",Cz),c.setTimeout(this.timeout),this.socketActiveTTL&&Date.now()-c.createdTime>this.socketActiveTTL)return hr(`socket ${c.createdTime} expired`),c.destroy(),this.createSocket(t,r,Tz(t));this.freeSockets[o].length||delete this.freeSockets[o],c.ref(),t.onSocket(c),this.sockets[o].push(c)}else a<this.maxSockets?(hr("call onSocket",a,s),this.createSocket(t,r,Tz(t))):(hr("wait for socket"),this.requests[o]||(this.requests[o]=[]),this.requests[o].push(t))};Rr.prototype.createSocket=function(t,r,i){var n=this;r=Object.assign({},r),r=Object.assign(r,n.options),r.servername||(r.servername=Az(r,t));var o=n.getName(r);r._agentKey=o,hr("createConnection",o,r),r.encoding=null;var s=!1;let a=n.createConnection(r,c);a&&c(null,Object.assign(a,{createdTime:Date.now()}));function c(u,l){if(s)return;if(s=!0,u)return i(u);n.sockets[o]||(n.sockets[o]=[]),n.sockets[o].push(l),hr("sockets",o,n.sockets[o].length);function f(){n.emit("free",l,r)}l.on("free",f);function p(m){hr("CLIENT socket onClose"),n.removeSocket(l,r),n.emit("close")}l.on("close",p);function d(){hr("CLIENT socket onTimeout"),l.destroy(),n.removeSocket(l,r),n.emit("timeout")}l.on("timeout",d),l.setTimeout(n.timeout);function h(){hr("CLIENT socket onRemove"),n.removeSocket(l,r),l.removeListener("close",p),l.removeListener("free",f),l.removeListener("agentRemove",h),l.setTimeout(0,d)}l.on("agentRemove",h),i(null,l)}};function Az(e,t){let r=e.host,i=t.getHeader("host");if(i)if(i.startsWith("[")){let n=i.indexOf("]");n===-1?r=i:r=i.substr(1,n-1)}else r=i.split(":",1)[0];return r}Rr.prototype.removeSocket=function(t,r){var i=this.getName(r);hr("removeSocket",i,"writable:",t.writable);var n=[this.sockets];t.writable||n.push(this.freeSockets);for(var o=0;o<n.length;o++){var s=n[o];if(s[i]){var a=s[i].indexOf(t);a!==-1&&(s[i].splice(a,1),s[i].length===0&&delete s[i])}}var c=this.freeSockets[i]?this.freeSockets[i].length:0,u=c+(this.sockets[i]?this.sockets[i].length:0);if(this.requests[i]&&this.requests[i].length&&u<this.maxSockets){hr("removeSocket, have a request, make a socket");var l=this.requests[i][0];this.createSocket(l,r,function(f,p){if(f){process.nextTick(function(){l.emit("error",f)});return}p.emit("free")})}};Rr.prototype.destroy=function(){for(var t=[this.freeSockets,this.sockets],r=0;r<t.length;r++)for(var i=t[r],n=Object.keys(i),o=0;o<n.length;o++)for(var s=i[n[o]],a=0;a<s.length;a++)s[a].destroy()};ak.globalAgent=new Rr});var Za=w((kIe,Rz)=>{"use strict";var oae=B("util"),sae=VE();Rz.exports=function(e){if(typeof e=="number")return e;var t=sae(e);if(t===void 0){var r=new Error(oae.format("humanize-ms(%j) result undefined",e));console.warn(r.stack)}return t}});var lk=w((TIe,Nz)=>{"use strict";var aae=$z().Agent,Dz=Za(),uk=class extends aae{constructor(t){t=t||{},t.keepAlive=t.keepAlive!==!1,t.freeSocketKeepAliveTimeout===void 0&&(t.freeSocketKeepAliveTimeout=15e3),t.keepAliveTimeout&&(t.freeSocketKeepAliveTimeout=t.keepAliveTimeout),t.freeSocketKeepAliveTimeout=Dz(t.freeSocketKeepAliveTimeout),t.timeout===void 0&&(t.timeout=t.freeSocketKeepAliveTimeout*2,t.timeout<3e4&&(t.timeout=3e4)),t.timeout=Dz(t.timeout),super(t),this.createSocketCount=0,this.createSocketCountLastCheck=0,this.createSocketErrorCount=0,this.createSocketErrorCountLastCheck=0,this.closeSocketCount=0,this.closeSocketCountLastCheck=0,this.errorSocketCount=0,this.errorSocketCountLastCheck=0,this.requestCount=0,this.requestCountLastCheck=0,this.timeoutSocketCount=0,this.timeoutSocketCountLastCheck=0,this.on("free",r=>{this.requestCount++,r.lastFreeTime=Date.now()}),this.on("timeout",()=>{this.timeoutSocketCount++}),this.on("close",()=>{this.closeSocketCount++}),this.on("error",()=>{this.errorSocketCount++})}createSocket(t,r,i){super.createSocket(t,r,(n,o)=>{if(n)return this.createSocketErrorCount++,i(n);this.keepAlive&&o.setNoDelay(!0),this.createSocketCount++,i(null,o)})}get statusChanged(){let t=this.createSocketCount!==this.createSocketCountLastCheck||this.createSocketErrorCount!==this.createSocketErrorCountLastCheck||this.closeSocketCount!==this.closeSocketCountLastCheck||this.errorSocketCount!==this.errorSocketCountLastCheck||this.timeoutSocketCount!==this.timeoutSocketCountLastCheck||this.requestCount!==this.requestCountLastCheck;return t&&(this.createSocketCountLastCheck=this.createSocketCount,this.createSocketErrorCountLastCheck=this.createSocketErrorCount,this.closeSocketCountLastCheck=this.closeSocketCount,this.errorSocketCountLastCheck=this.errorSocketCount,this.timeoutSocketCountLastCheck=this.timeoutSocketCount,this.requestCountLastCheck=this.requestCount),t}getCurrentStatus(){return{createSocketCount:this.createSocketCount,createSocketErrorCount:this.createSocketErrorCount,closeSocketCount:this.closeSocketCount,errorSocketCount:this.errorSocketCount,timeoutSocketCount:this.timeoutSocketCount,requestCount:this.requestCount,freeSockets:ck(this.freeSockets),sockets:ck(this.sockets),requests:ck(this.requests)}}};Nz.exports=uk;function ck(e){let t={};for(let r in e)t[r]=e[r].length;return t}});var jz=w((IIe,qz)=>{"use strict";var cae=B("https"),uae=lk(),Pz=cae.Agent,lm=class extends uae{constructor(t){super(t),this.defaultPort=443,this.protocol="https:",this.maxCachedSessions=this.options.maxCachedSessions,this.maxCachedSessions===void 0&&(this.maxCachedSessions=100),this._sessionCache={map:{},list:[]}}};["createConnection","getName","_getSession","_cacheSession","_evictSession"].forEach(function(e){typeof Pz.prototype[e]=="function"&&(lm.prototype[e]=Pz.prototype[e])});qz.exports=lm});var fm=w((OIe,fk)=>{"use strict";fk.exports=lk();fk.exports.HttpsAgent=jz()});var Ga=w((CIe,Mz)=>{"use strict";Mz.exports=fae;var lae=Object.prototype.hasOwnProperty;function fae(e,t,r){if(!e)throw new TypeError("argument dest is required");if(!t)throw new TypeError("argument src is required");return r===void 0&&(r=!0),Object.getOwnPropertyNames(t).forEach(function(n){if(!(!r&&lae.call(e,n))){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o)}}),e}});var Lz=w((dm,xl)=>{(function(){"use strict";var e={function:!0,object:!0},t=e[typeof window]&&window||this,r=t,i=e[typeof dm]&&dm,n=e[typeof xl]&&xl&&!xl.nodeType&&xl,o=i&&n&&typeof global=="object"&&global;o&&(o.global===o||o.window===o||o.self===o)&&(t=o);var s=Math.pow(2,53)-1,a=/\bOpera/,c=this,u=Object.prototype,l=u.hasOwnProperty,f=u.toString;function p(I){return I=String(I),I.charAt(0).toUpperCase()+I.slice(1)}function d(I,b,O){var A={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return b&&O&&/^Win/i.test(I)&&!/^Windows Phone /i.test(I)&&(A=A[/[\d.]+$/.exec(I)])&&(I="Windows "+A),I=String(I),b&&O&&(I=I.replace(RegExp(b,"i"),O)),I=m(I.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0]),I}function h(I,b){var O=-1,A=I?I.length:0;if(typeof A=="number"&&A>-1&&A<=s)for(;++O<A;)b(I[O],O,I);else _(I,b)}function m(I){return I=y(I),/^(?:webOS|i(?:OS|P))/.test(I)?I:p(I)}function _(I,b){for(var O in I)l.call(I,O)&&b(I[O],O,I)}function k(I){return I==null?p(I):f.call(I).slice(8,-1)}function S(I,b){var O=I!=null?typeof I[b]:"number";return!/^(?:boolean|number|string|undefined)$/.test(O)&&(O=="object"?!!I[b]:!0)}function v(I){return String(I).replace(/([ -])(?!$)/g,"$1?")}function g(I,b){var O=null;return h(I,function(A,P){O=b(O,A,P,I)}),O}function y(I){return String(I).replace(/^ +| +$/g,"")}function T(I){var b=t,O=I&&typeof I=="object"&&k(I)!="String";O&&(b=I,I=null);var A=b.navigator||{},P=A.userAgent||"";I||(I=P);var D=O||c==r,V=O?!!A.likeChrome:/\bChrome\b/.test(I)&&!/internal|\n/i.test(f.toString()),$="Object",U=O?$:"ScriptBridgingProxyObject",Z=O?$:"Environment",J=O&&b.java?"JavaPackage":k(b.java),j=O?$:"RuntimeObject",pe=/\bJava/.test(J)&&b.java,Q=pe&&k(b.environment)==Z,X=pe?"a":"\u03B1",N=pe?"b":"\u03B2",H=b.document||{},G=b.operamini||b.opera,re=a.test(re=O&&G?G["[[Class]]"]:k(G))?re:G=null,q,de=I,le=[],Oe=null,We=I==P,E=We&&G&&typeof G.version=="function"&&G.version(),x,F=Ce([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),C=Et(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),ue=et([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),be=rt({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),ne=Ge(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function Ce(_e){return g(_e,function(M,L){return M||RegExp("\\b"+(L.pattern||v(L))+"\\b","i").exec(I)&&(L.label||L)})}function rt(_e){return g(_e,function(M,L,K){return M||(L[ue]||L[/^[a-z]+(?: +[a-z]+\b)*/i.exec(ue)]||RegExp("\\b"+v(K)+"(?:\\b|\\w*\\d)","i").exec(I))&&K})}function Et(_e){return g(_e,function(M,L){return M||RegExp("\\b"+(L.pattern||v(L))+"\\b","i").exec(I)&&(L.label||L)})}function Ge(_e){return g(_e,function(M,L){var K=L.pattern||v(L);return!M&&(M=RegExp("\\b"+K+"(?:/[\\d.]+|[ \\w.]*)","i").exec(I))&&(M=d(M,K,L.label||L)),M})}function et(_e){return g(_e,function(M,L){var K=L.pattern||v(L);return!M&&(M=RegExp("\\b"+K+" *\\d+[.\\w_]*","i").exec(I)||RegExp("\\b"+K+" *\\w+-[\\w]*","i").exec(I)||RegExp("\\b"+K+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(I))&&((M=String(L.label&&!RegExp(K,"i").test(L.label)?L.label:M).split("/"))[1]&&!/[\d.]+/.test(M[0])&&(M[0]+=" "+M[1]),L=L.label||L,M=m(M[0].replace(RegExp(K,"i"),L).replace(RegExp("; *(?:"+L+"[_-])?","i")," ").replace(RegExp("("+L+")[-_.]?(\\w)","i"),"$1 $2"))),M})}function Ht(_e){return g(_e,function(M,L){return M||(RegExp(L+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(I)||0)[1]||null})}function kt(){return this.description||""}if(F&&(F=[F]),/\bAndroid\b/.test(ne)&&!ue&&(q=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(I))&&(ue=y(q[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),be&&!ue?ue=et([be]):be&&ue&&(ue=ue.replace(RegExp("^("+v(be)+")[-_.\\s]","i"),be+" ").replace(RegExp("^("+v(be)+")[-_.]?(\\w)","i"),be+" $2")),(q=/\bGoogle TV\b/.exec(ue))&&(ue=q[0]),/\bSimulator\b/i.test(I)&&(ue=(ue?ue+" ":"")+"Simulator"),C=="Opera Mini"&&/\bOPiOS\b/.test(I)&&le.push("running in Turbo/Uncompressed mode"),C=="IE"&&/\blike iPhone OS\b/.test(I)?(q=T(I.replace(/like iPhone OS/,"")),be=q.manufacturer,ue=q.product):/^iP/.test(ue)?(C||(C="Safari"),ne="iOS"+((q=/ OS ([\d_]+)/i.exec(I))?" "+q[1].replace(/_/g,"."):"")):C=="Konqueror"&&/^Linux\b/i.test(ne)?ne="Kubuntu":be&&be!="Google"&&(/Chrome/.test(C)&&!/\bMobile Safari\b/i.test(I)||/\bVita\b/.test(ue))||/\bAndroid\b/.test(ne)&&/^Chrome/.test(C)&&/\bVersion\//i.test(I)?(C="Android Browser",ne=/\bAndroid\b/.test(ne)?ne:"Android"):C=="Silk"?(/\bMobi/i.test(I)||(ne="Android",le.unshift("desktop mode")),/Accelerated *= *true/i.test(I)&&le.unshift("accelerated")):C=="UC Browser"&&/\bUCWEB\b/.test(I)?le.push("speed mode"):C=="PaleMoon"&&(q=/\bFirefox\/([\d.]+)\b/.exec(I))?le.push("identifying as Firefox "+q[1]):C=="Firefox"&&(q=/\b(Mobile|Tablet|TV)\b/i.exec(I))?(ne||(ne="Firefox OS"),ue||(ue=q[1])):!C||(q=!/\bMinefield\b/i.test(I)&&/\b(?:Firefox|Safari)\b/.exec(C))?(C&&!ue&&/[\/,]|^[^(]+?\)/.test(I.slice(I.indexOf(q+"/")+8))&&(C=null),(q=ue||be||ne)&&(ue||be||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(ne))&&(C=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(ne)?ne:q)+" Browser")):C=="Electron"&&(q=(/\bChrome\/([\d.]+)\b/.exec(I)||0)[1])&&le.push("Chromium "+q),E||(E=Ht(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",v(C),"(?:Firefox|Minefield|NetFront)"])),(q=F=="iCab"&&parseFloat(E)>3&&"WebKit"||/\bOpera\b/.test(C)&&(/\bOPR\b/.test(I)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(I)&&!/^(?:Trident|EdgeHTML)$/.test(F)&&"WebKit"||!F&&/\bMSIE\b/i.test(I)&&(ne=="Mac OS"?"Tasman":"Trident")||F=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(C)&&"NetFront")&&(F=[q]),C=="IE"&&(q=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(I)||0)[1])?(C+=" Mobile",ne="Windows Phone "+(/\+$/.test(q)?q:q+".x"),le.unshift("desktop mode")):/\bWPDesktop\b/i.test(I)?(C="IE Mobile",ne="Windows Phone 8.x",le.unshift("desktop mode"),E||(E=(/\brv:([\d.]+)/.exec(I)||0)[1])):C!="IE"&&F=="Trident"&&(q=/\brv:([\d.]+)/.exec(I))&&(C&&le.push("identifying as "+C+(E?" "+E:"")),C="IE",E=q[1]),We){if(S(b,"global"))if(pe&&(q=pe.lang.System,de=q.getProperty("os.arch"),ne=ne||q.getProperty("os.name")+" "+q.getProperty("os.version")),Q){try{E=b.require("ringo/engine").version.join("."),C="RingoJS"}catch{(q=b.system)&&q.global.system==b.system&&(C="Narwhal",ne||(ne=q[0].os||null))}C||(C="Rhino")}else typeof b.process=="object"&&!b.process.browser&&(q=b.process)&&(typeof q.versions=="object"&&(typeof q.versions.electron=="string"?(le.push("Node "+q.versions.node),C="Electron",E=q.versions.electron):typeof q.versions.nw=="string"&&(le.push("Chromium "+E,"Node "+q.versions.node),C="NW.js",E=q.versions.nw)),C||(C="Node.js",de=q.arch,ne=q.platform,E=/[\d.]+/.exec(q.version),E=E?E[0]:null));else k(q=b.runtime)==U?(C="Adobe AIR",ne=q.flash.system.Capabilities.os):k(q=b.phantom)==j?(C="PhantomJS",E=(q=q.version||null)&&q.major+"."+q.minor+"."+q.patch):typeof H.documentMode=="number"&&(q=/\bTrident\/(\d+)/i.exec(I))?(E=[E,H.documentMode],(q=+q[1]+4)!=E[1]&&(le.push("IE "+E[1]+" mode"),F&&(F[1]=""),E[1]=q),E=C=="IE"?String(E[1].toFixed(1)):E[0]):typeof H.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(C)&&(le.push("masking as "+C+" "+E),C="IE",E="11.0",F=["Trident"],ne="Windows");ne=ne&&m(ne)}if(E&&(q=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(E)||/(?:alpha|beta)(?: ?\d)?/i.exec(I+";"+(We&&A.appMinorVersion))||/\bMinefield\b/i.test(I)&&"a")&&(Oe=/b/i.test(q)?"beta":"alpha",E=E.replace(RegExp(q+"\\+?$"),"")+(Oe=="beta"?N:X)+(/\d+\+?/.exec(q)||"")),C=="Fennec"||C=="Firefox"&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(ne))C="Firefox Mobile";else if(C=="Maxthon"&&E)E=E.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(ue))ue=="Xbox 360"&&(ne=null),ue=="Xbox 360"&&/\bIEMobile\b/.test(I)&&le.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(C)||C&&!ue&&!/Browser|Mobi/.test(C))&&(ne=="Windows CE"||/Mobi/i.test(I)))C+=" Mobile";else if(C=="IE"&&We)try{b.external===null&&le.unshift("platform preview")}catch{le.unshift("embedded")}else(/\bBlackBerry\b/.test(ue)||/\bBB10\b/.test(I))&&(q=(RegExp(ue.replace(/ +/g," *")+"/([.\\d]+)","i").exec(I)||0)[1]||E)?(q=[q,/BB10/.test(I)],ne=(q[1]?(ue=null,be="BlackBerry"):"Device Software")+" "+q[0],E=null):this!=_&&ue!="Wii"&&(We&&G||/Opera/.test(C)&&/\b(?:MSIE|Firefox)\b/i.test(I)||C=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(ne)||C=="IE"&&(ne&&!/^Win/.test(ne)&&E>5.5||/\bWindows XP\b/.test(ne)&&E>8||E==8&&!/\bTrident\b/.test(I)))&&!a.test(q=T.call(_,I.replace(a,"")+";"))&&q.name&&(q="ing as "+q.name+((q=q.version)?" "+q:""),a.test(C)?(/\bIE\b/.test(q)&&ne=="Mac OS"&&(ne=null),q="identify"+q):(q="mask"+q,re?C=m(re.replace(/([a-z])([A-Z])/g,"$1 $2")):C="Opera",/\bIE\b/.test(q)&&(ne=null),We||(E=null)),F=["Presto"],le.push(q));(q=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(I)||0)[1])&&(q=[parseFloat(q.replace(/\.(\d)$/,".0$1")),q],C=="Safari"&&q[1].slice(-1)=="+"?(C="WebKit Nightly",Oe="alpha",E=q[1].slice(0,-1)):(E==q[1]||E==(q[2]=(/\bSafari\/([\d.]+\+?)/i.exec(I)||0)[1]))&&(E=null),q[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(I)||0)[1],q[0]==537.36&&q[2]==537.36&&parseFloat(q[1])>=28&&F=="WebKit"&&(F=["Blink"]),!We||!V&&!q[1]?(F&&(F[1]="like Safari"),q=(q=q[0],q<400?1:q<500?2:q<526?3:q<533?4:q<534?"4+":q<535?5:q<537?6:q<538?7:q<601?8:q<602?9:q<604?10:q<606?11:q<608?12:"12")):(F&&(F[1]="like Chrome"),q=q[1]||(q=q[0],q<530?1:q<532?2:q<532.05?3:q<533?4:q<534.03?5:q<534.07?6:q<534.1?7:q<534.13?8:q<534.16?9:q<534.24?10:q<534.3?11:q<535.01?12:q<535.02?"13+":q<535.07?15:q<535.11?16:q<535.19?17:q<536.05?18:q<536.1?19:q<537.01?20:q<537.11?"21+":q<537.13?23:q<537.18?24:q<537.24?25:q<537.36?26:F!="Blink"?"27":"28")),F&&(F[1]+=" "+(q+=typeof q=="number"?".x":/[.+]/.test(q)?"":"+")),C=="Safari"&&(!E||parseInt(E)>45)?E=q:C=="Chrome"&&/\bHeadlessChrome/i.test(I)&&le.unshift("headless")),C=="Opera"&&(q=/\bzbov|zvav$/.exec(ne))?(C+=" ",le.unshift("desktop mode"),q=="zvav"?(C+="Mini",E=null):C+="Mobile",ne=ne.replace(RegExp(" *"+q+"$"),"")):C=="Safari"&&/\bChrome\b/.exec(F&&F[1])?(le.unshift("desktop mode"),C="Chrome Mobile",E=null,/\bOS X\b/.test(ne)?(be="Apple",ne="iOS 4.3+"):ne=null):/\bSRWare Iron\b/.test(C)&&!E&&(E=Ht("Chrome")),E&&E.indexOf(q=/[\d.]+$/.exec(ne))==0&&I.indexOf("/"+q+"-")>-1&&(ne=y(ne.replace(q,""))),ne&&ne.indexOf(C)!=-1&&!RegExp(C+" OS").test(ne)&&(ne=ne.replace(RegExp(" *"+v(C)+" *"),"")),F&&!/\b(?:Avant|Nook)\b/.test(C)&&(/Browser|Lunascape|Maxthon/.test(C)||C!="Safari"&&/^iOS/.test(ne)&&/\bSafari\b/.test(F[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(C)&&F[1])&&(q=F[F.length-1])&&le.push(q),le.length&&(le=["("+le.join("; ")+")"]),be&&ue&&ue.indexOf(be)<0&&le.push("on "+be),ue&&le.push((/^on /.test(le[le.length-1])?"":"on ")+ue),ne&&(q=/ ([\d.+]+)$/.exec(ne),x=q&&ne.charAt(ne.length-q[0].length-1)=="/",ne={architecture:32,family:q&&!x?ne.replace(q[0],""):ne,version:q?q[1]:null,toString:function(){var _e=this.version;return this.family+(_e&&!x?" "+_e:"")+(this.architecture==64?" 64-bit":"")}}),(q=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(de))&&!/\bi686\b/i.test(de)?(ne&&(ne.architecture=64,ne.family=ne.family.replace(RegExp(" *"+q),"")),C&&(/\bWOW64\b/i.test(I)||We&&/\w(?:86|32)$/.test(A.cpuClass||A.platform)&&!/\bWin64; x64\b/i.test(I))&&le.unshift("32-bit")):ne&&/^OS X/.test(ne.family)&&C=="Chrome"&&parseFloat(E)>=39&&(ne.architecture=64),I||(I=null);var nt={};return nt.description=I,nt.layout=F&&F[0],nt.manufacturer=be,nt.name=C,nt.prerelease=Oe,nt.product=ue,nt.ua=I,nt.version=C&&E,nt.os=ne||{architecture:null,family:null,version:null,toString:function(){return"null"}},nt.parse=T,nt.toString=kt,nt.version&&le.unshift(E),nt.name&&le.unshift(C),ne&&C&&!(ne==String(ne).split(" ")[0]&&(ne==C.split(" ")[0]||ue))&&le.push(ue?"("+ne+")":"on "+ne),le.length&&(nt.description=le.join(" ")),nt}var R=T();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(t.platform=R,define(function(){return R})):i&&n?_(R,function(I,b){i[b]=I}):t.platform=R}).call(dm)});var Ur=w((AIe,Fz)=>{"use strict";var dae=Array.prototype.slice;Fz.exports=Sn;function Sn(e,t){if(!(this instanceof Sn))return new Sn(e,t);this.src=e,this._withAccess=t}Sn.prototype.withAccess=function(e){return this._withAccess=e!==!1,this};Sn.prototype.pick=function(e){return Array.isArray(e)||(e=dae.call(arguments)),e.length&&(this.keys=e),this};Sn.prototype.to=function(e){if(e=e||{},!this.src)return e;var t=this.keys||Object.keys(this.src);if(!this._withAccess){for(var r=0;r<t.length;r++)i=t[r],e[i]===void 0&&(e[i]=this.src[i]);return e}for(var r=0;r<t.length;r++){var i=t[r];if(pae(e,i)){var n=this.src.__lookupGetter__(i),o=this.src.__lookupSetter__(i);n&&e.__defineGetter__(i,n),o&&e.__defineSetter__(i,o),!n&&!o&&(e[i]=this.src[i])}}return e};Sn.prototype.toCover=function(e){for(var t=this.keys||Object.keys(this.src),r=0;r<t.length;r++){var i=t[r];delete e[i];var n=this.src.__lookupGetter__(i),o=this.src.__lookupSetter__(i);n&&e.__defineGetter__(i,n),o&&e.__defineSetter__(i,o),!n&&!o&&(e[i]=this.src[i])}};Sn.prototype.override=Sn.prototype.toCover;Sn.prototype.and=function(e){var t={};return this.to(t),this.src=e,this.to(t),this.src=t,this};function pae(e,t){return e[t]===void 0&&e.__lookupGetter__(t)===void 0&&e.__lookupSetter__(t)===void 0}});var zz=w(dk=>{"use strict";var hae=B("assert");dk.noop=function(){};dk.getParamNames=function(t,r){var i=typeof t;if(hae(i==="function",'The "func" must be a function. Received type "'+i+'"'),r=r!==!1,r&&t.__cache_names)return t.__cache_names;var n=t.toString(),o=n.slice(n.indexOf("(")+1,n.indexOf(")")).match(/([^\s,]+)/g)||[];return t.__cache_names=o,o}});var Bz=w(Uz=>{"use strict";Uz.setImmediate=typeof setImmediate=="function"?setImmediate:function(e){process.nextTick(e.bind.apply(e,arguments))}});var Wz=w(Ka=>{"use strict";Ka.try=function(e){var t={error:void 0,value:void 0};try{t.value=e()}catch(r){t.error=r instanceof Error?r:new Error(r)}return t};Ka.UNSTABLE_METHOD={try:Ka.try};Ka.dig=function(e){if(e){if(arguments.length<=1)return e;for(var t=e[arguments[1]],r=2;r<arguments.length&&t;r++)t=t[arguments[r]];return t}};Ka.argumentsToArray=function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}});var Zz=w(tn=>{"use strict";var Hz=B("crypto");tn.hash=function(t,r,i){var n=Hz.createHash(t),o=Buffer.isBuffer(r);return!o&&typeof r=="object"&&(r=JSON.stringify(Vz(r))),n.update(r,o?"binary":"utf8"),n.digest(i||"hex")};tn.md5=function(t,r){return tn.hash("md5",t,r)};tn.sha1=function(t,r){return tn.hash("sha1",t,r)};tn.sha256=function(t,r){return tn.hash("sha256",t,r)};tn.hmac=function(t,r,i,n){n=n||"base64";var o=Hz.createHmac(t,r);return o.update(i,Buffer.isBuffer(i)?"binary":"utf8"),o.digest(n)};tn.base64encode=function(t,r){Buffer.isBuffer(t)||(t=typeof Buffer.from=="function"?Buffer.from(t):new Buffer(t));var i=t.toString("base64");return r&&(i=i.replace(/\+/g,"-").replace(/\//g,"_")),i};tn.base64decode=function(t,r,i){r&&(t=t.replace(/\-/g,"+").replace(/_/g,"/"));var n=typeof Buffer.from=="function"?Buffer.from(t,"base64"):new Buffer(t,"base64");return i==="buffer"?n:n.toString(i||"utf8")};function Vz(e){if(!e||Array.isArray(e)||typeof e!="object")return e;var t=Object.keys(e);t.sort();for(var r=[],i=0;i<t.length;i++){var n=t[i];r.push([n,Vz(e[n])])}return r}});var Xz=w(En=>{"use strict";En.MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1;En.MIN_SAFE_INTEGER=-En.MAX_SAFE_INTEGER;var Kz=En.MAX_SAFE_INTEGER_STR=String(En.MAX_SAFE_INTEGER),Gz=Kz.length;En.isSafeNumberString=function(t){return t[0]==="-"&&(t=t.substring(1)),t.length<Gz||t.length===Gz&&t<=Kz};En.toSafeNumber=function(t){return typeof t=="number"?t:En.isSafeNumberString(t)?Number(t):t};En.random=function(t,r){if(t===void 0&&r===void 0)return 0;r===void 0&&(r=t,t=0);var i;return t>r&&(i=t,t=r,r=i),Math.floor(t+Math.random()*(r-t))}});var Yz=w(Bo=>{"use strict";Bo.randomString=function(t,r){var i=[];for(t=t||16,r=r||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";t--;)i.push(r[Math.floor(Math.random()*r.length)]);return i.join("")};Bo.split=function(t,r){t=t||"",r=r||",";for(var i=t.split(r),n=[],o=0;o<i.length;o++){var s=i[o].trim();s.length>0&&n.push(s)}return n};Bo.splitAlwaysOptimized=function(){var t="",r=",";arguments.length===1?t=arguments[0]||"":arguments.length===2&&(t=arguments[0]||"",r=arguments[1]||",");for(var i=t.split(r),n=[],o=0;o<i.length;o++){var s=i[o].trim();s.length>0&&n.push(s)}return n};Bo.replace=function(t,r,i){var n=i;return typeof n!="function"&&(n=function(){return i}),t.replace(r,n)};var Jz=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];Bo.replaceInvalidHttpHeaderChar=function(t,r){r=r||" ";var i=!1;if(!t||typeof t!="string")return{val:t,invalid:i};for(var n=typeof r,o,s=0;s<t.length;++s)Jz[t.charCodeAt(s)]||(o=o||t.split(""),n==="function"?o[s]=r(o[s]):o[s]=r);return o&&(t=o.join(""),i=!0),{val:t,invalid:i}};Bo.includesInvalidHttpHeaderChar=function(t){if(!t||typeof t!="string")return!1;for(var r=0;r<t.length;++r)if(!Jz[t.charCodeAt(r)])return!0;return!1}});var Qz=w(pk=>{"use strict";pk.randomSlice=function(t,r){if(!r||r>=t.length)return t.slice();for(var i=Math.floor(Math.random()*t.length),n=[],o=0,s=i;o<r;o++)n.push(t[s++]),s===t.length&&(s=0);return n};pk.spliceOne=function(t,r){if(r<0&&(r=t.length+r,r<0)||r>=t.length)return t;for(var i=r,n=i+1,o=t.length;n<o;i+=1,n+=1)t[i]=t[n];return t.pop(),t}});var nU=w((MIe,rU)=>{var Sl=B("path"),eU=B("fs"),tU=parseInt("0777",8);rU.exports=Xa.mkdirp=Xa.mkdirP=Xa;function Xa(e,t,r,i){typeof t=="function"?(r=t,t={}):(!t||typeof t!="object")&&(t={mode:t});var n=t.mode,o=t.fs||eU;n===void 0&&(n=tU),i||(i=null);var s=r||function(){};e=Sl.resolve(e),o.mkdir(e,n,function(a){if(!a)return i=i||e,s(null,i);switch(a.code){case"ENOENT":if(Sl.dirname(e)===e)return s(a);Xa(Sl.dirname(e),t,function(c,u){c?s(c,u):Xa(e,t,s,u)});break;default:o.stat(e,function(c,u){c||!u.isDirectory()?s(a,i):s(null,i)});break}})}Xa.sync=function e(t,r,i){(!r||typeof r!="object")&&(r={mode:r});var n=r.mode,o=r.fs||eU;n===void 0&&(n=tU),i||(i=null),t=Sl.resolve(t);try{o.mkdirSync(t,n),i=i||t}catch(a){switch(a.code){case"ENOENT":i=e(Sl.dirname(t),r,i),e(t,r,i);break;default:var s;try{s=o.statSync(t)}catch{throw a}if(!s.isDirectory())throw a;break}}return i}});var sU=w((LIe,oU)=>{"use strict";var iU="@@any-promise/REGISTRATION",kn=null;oU.exports=function(e,t){return function(i,n){i=i||null,n=n||{};var o=n.global!==!1;if(kn===null&&o&&(kn=e[iU]||null),kn!==null&&i!==null&&kn.implementation!==i)throw new Error('any-promise already defined as "'+kn.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return kn===null&&(i!==null&&typeof n.Promise<"u"?kn={Promise:n.Promise,implementation:i}:kn=t(i),o&&(e[iU]=kn)),kn}}});var uU=w((FIe,cU)=>{"use strict";cU.exports=sU()(global,aU);function aU(e){var t=null;if(mae(e))t={Promise:global.Promise,implementation:"global.Promise"};else if(e){var r=B(e);t={Promise:r.Promise||r,implementation:e}}else t=gae();if(t===null)throw new Error('Cannot find any-promise implementation nor global.Promise. You must install polyfill or call require("any-promise/register") with your preferred implementation, e.g. require("any-promise/register/bluebird") on application load prior to any require("any-promise").');return t}function mae(e){if(e)return e==="global.Promise";if(typeof global.Promise<"u"){var t=/v(\d+)\.(\d+)\.(\d+)/.exec(process.version);return!(t&&+t[1]==0&&+t[2]<12)}return!1}function gae(){for(var e=["es6-promise","promise","native-promise-only","bluebird","rsvp","when","q","pinkie","lie","vow"],t=0,r=e.length;t<r;t++)try{return aU(e[t])}catch{}return null}});var El=w((UIe,lU)=>{lU.exports=uU()().Promise});var mU=w((BIe,hU)=>{var yae=El(),fU=B("assert");hU.exports=dU;function dU(e,t){return fU(typeof e=="function"),pU(e,t)}dU.withCallback=function(e,t){return fU(typeof e=="function"),t=t||{},t.withCallback=!0,pU(e,t)};function vae(e,t,r){return r===void 0&&(r=!0),function(i,n){if(i)return t(i);var o=arguments.length;if(o<=2||!r)return e(n);if(Array.isArray(r)){for(var a={},s=1;s<o;s++)a[r[s-1]]=arguments[s];return e(a)}for(var a=new Array(o-1),s=1;s<o;++s)a[s-1]=arguments[s];e(a)}}function pU(e,t){t=t||{};var r=e.name;r=(r||"").replace(/\s|bound(?!$)/g,"");var i=function(){var n=this,o=arguments.length;if(t.withCallback){var s=typeof arguments[o-1];if(s==="function")return e.apply(n,arguments)}for(var a=new Array(o+1),c=0;c<o;++c)a[c]=arguments[c];var u=c;return new yae(function(l,f){a[u]=vae(l,f,t.multiArgs),e.apply(n,a)})};return Object.defineProperty(i,"name",{value:r}),i}});var vU=w((WIe,yU)=>{var hk=mU();yU.exports=mk;mk.withCallback=bae;mk.thenify=hk;function mk(e,t,r){return gU(e,t,r,hk)}function bae(e,t,r){return gU(e,t,r,hk.withCallback)}function gU(e,t,r,i){return t||(t={},r=Object.keys(e)),Array.isArray(t)&&(r=t,t={}),r||(r=Object.keys(e)),typeof e=="function"&&(t=i(e)),r.forEach(function(n){typeof e[n]=="function"&&(t[n]=i(e[n]))}),Object.keys(e).forEach(function(n){_ae(e,n)||t[n]||(t[n]=e[n])}),t}function _ae(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return!r||!r.get?!1:r.get.name==="deprecated"}});var bU=w(gk=>{var wae=El(),Zi;try{Zi=Ii()}catch{Zi=B("fs")}var pm=["appendFile","chmod","chown","close","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","link","lstat","mkdir","open","read","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","write","writeFile"];typeof Zi.access=="function"&&pm.push("access");typeof Zi.copyFile=="function"&&pm.push("copyFile");typeof Zi.mkdtemp=="function"&&pm.push("mkdtemp");vU().withCallback(Zi,gk,pm);gk.exists=function(e,t){return typeof t=="function"?Zi.stat(e,function(r){t(null,!r)}):new wae(function(r){Zi.stat(e,function(i){r(!i)})})}});var xU=w(Ya=>{"use strict";var _U=B("path"),yk;function wU(){return yk||(yk=nU()),yk}var vk;function Ja(){return vk||(vk=bU()),vk}Ya.strictJSONParse=function(e){var t=JSON.parse(e);if(!t||typeof t!="object")throw new Error("JSON string is not object");return t};Ya.readJSONSync=function(e){if(!Ja().existsSync(e))throw new Error(e+" is not found");return JSON.parse(Ja().readFileSync(e))};Ya.writeJSONSync=function(e,t,r){r=r||{},"space"in r||(r.space=2),wU().sync(_U.dirname(e)),typeof t=="object"&&(t=JSON.stringify(t,r.replacer,r.space)+`
|
|
209
209
|
`),Ja().writeFileSync(e,t)};Ya.readJSON=function(e){return Ja().exists(e).then(function(t){if(!t)throw new Error(e+" is not found");return Ja().readFile(e)}).then(function(t){return JSON.parse(t)})};Ya.writeJSON=function(e,t,r){return r=r||{},"space"in r||(r.space=2),typeof t=="object"&&(t=JSON.stringify(t,r.replacer,r.space)+`
|
|
210
|
-
`),xae(_U.dirname(e)).then(function(){return Ja().writeFile(e,t)})};function xae(e){return new Promise(function(t,r){wU()(e,function(i){if(i)return r(i);t()})})}});var SU=w(Gi=>{"use strict";var Sae=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],hm=" ",Wo=parseInt(-new Date().getTimezoneOffset()/60,10);Wo>=0?hm+="+":hm+="-";Wo=Math.abs(Wo);Wo<10&&(Wo="0"+Wo);hm+=Wo+"00";Gi.accessLogDate=function(e){e=e||new Date;var t=e.getDate();t<10&&(t="0"+t);var r=e.getHours();r<10&&(r="0"+r);var i=e.getMinutes();i<10&&(i="0"+i);var n=e.getSeconds();return n<10&&(n="0"+n),t+"/"+Sae[e.getMonth()]+"/"+e.getFullYear()+":"+r+":"+i+":"+n+hm};Gi.logDate=Gi.YYYYMMDDHHmmssSSS=function(e,t){typeof e=="string"?(t=e,e=new Date):e=e||new Date;var r=e.getDate();r<10&&(r="0"+r);var i=e.getMonth()+1;i<10&&(i="0"+i);var n=e.getHours();n<10&&(n="0"+n);var o=e.getMinutes();o<10&&(o="0"+o);var s=e.getSeconds();s<10&&(s="0"+s);var a=e.getMilliseconds();return a<10?a="00"+a:a<100&&(a="0"+a),e.getFullYear()+"-"+i+"-"+r+" "+n+":"+o+":"+s+(t||".")+a};Gi.YYYYMMDDHHmmss=function(e,t){e=e||new Date,e instanceof Date||(e=new Date(e));var r="-",i=":";t&&(t.dateSep&&(r=t.dateSep),t.timeSep&&(i=t.timeSep));var n=e.getDate();n<10&&(n="0"+n);var o=e.getMonth()+1;o<10&&(o="0"+o);var s=e.getHours();s<10&&(s="0"+s);var a=e.getMinutes();a<10&&(a="0"+a);var c=e.getSeconds();return c<10&&(c="0"+c),e.getFullYear()+r+o+r+n+" "+s+i+a+i+c};Gi.YYYYMMDD=function(t,r){typeof t=="string"?(r=t,t=new Date):(t=t||new Date,typeof r!="string"&&(r="-"));var i=t.getDate();i<10&&(i="0"+i);var n=t.getMonth()+1;return n<10&&(n="0"+n),t.getFullYear()+r+n+r+i};Gi.datestruct=function(e){return e=e||new Date,{YYYYMMDD:e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate(),H:e.getHours()}};Gi.timestamp=function(t){if(t){var r=t;return typeof r=="string"&&(r=Number(r)),String(t).length===10&&(r*=1e3),new Date(r)}return Math.round(Date.now()/1e3)}});var kU=w(Qa=>{"use strict";Qa.assign=function(e,t){Array.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++){var i=t[r];if(i)for(var n=Object.keys(i),o=0;o<n.length;o++){var s=n[o];e[s]=i[s]}}return e};Qa.has=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)};Qa.getOwnEnumerables=function(t,r){return!t||typeof t!="object"||Array.isArray(t)?[]:Object.keys(t).filter(function(i){if(r){var n=t[i];if(n==null||Number.isNaN(n))return!1}return Qa.has(t,i)})};Qa.map=function(t){var r=new EU;if(!t)return r;for(var i in t)r[i]=t[i];return r};function EU(){}EU.prototype=Object.create(null)});var IU=w((GIe,TU)=>{"use strict";var Eae=/["'&<>]/;TU.exports=kae;function kae(e){var t=""+e,r=Eae.exec(t);if(!r)return t;var i,n="",o=0,s=0;for(o=r.index;o<t.length;o++){switch(t.charCodeAt(o)){case 34:i=""";break;case 38:i="&";break;case 39:i="'";break;case 60:i="<";break;case 62:i=">";break;default:continue}s!==o&&(n+=t.substring(s,o)),s=o+1,n+=i}return s!==o?n+t.substring(s,o):n}});var CU=w((KIe,OU)=>{"use strict";OU.exports=function(t){return typeof t<"u"&&t!==null&&(typeof t=="object"||typeof t=="function")}});var RU=w((XIe,$U)=>{"use strict";var AU=CU();$U.exports=function(t){AU(t)||(t={});for(var r=arguments.length,i=1;i<r;i++){var n=arguments[i];AU(n)&&Tae(t,n)}return t};function Tae(e,t){for(var r in t)Iae(t,r)&&(e[r]=t[r])}function Iae(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var PU=w((JIe,NU)=>{"use strict";var Oae=RU(),bk={},DU,Ho={default:{""":'"',""":'"',"'":"'","'":"'","&":"&","&":"&",">":">",">":">","<":"<","<":"<"},extras:{"¢":"\xA2","¢":"\xA2","©":"\xA9","©":"\xA9","€":"\u20AC","€":"\u20AC","£":"\xA3","£":"\xA3","®":"\xAE","®":"\xAE","¥":"\xA5","¥":"\xA5"}};Object.defineProperty(Ho,"all",{get:function(){return DU||(DU=Oae({},Ho.default,Ho.extras))}});function mm(e,t){if(!Aae(e))return"";var r=Ho[t||"default"],i=Cae(t,r);return e.replace(i,function(n){return r[n]})}function Cae(e,t){if(bk[e])return bk[e];var r=Object.keys(t).join("|"),i=new RegExp("(?=("+r+"))\\1","g");return bk[e]=i,i}function Aae(e){return e&&typeof e=="string"}mm.chars=Ho.default;mm.extras=Ho.extras;Object.defineProperty(mm,"all",{get:function(){return Ho.all}});NU.exports=mm});var qU=w(kl=>{"use strict";kl.escape=IU();kl.unescape=PU();kl.encodeURIComponent=function(t){try{return encodeURIComponent(t)}catch{return t}};kl.decodeURIComponent=function(t){try{return decodeURIComponent(t)}catch{return t}}});var Ki=w((QIe,jU)=>{"use strict";var $ae=Ur();$ae(zz()).and(Bz()).and(Wz()).and(Zz()).and(Xz()).and(Yz()).and(Qz()).and(xU()).and(SU()).and(kU()).and(qU()).to(jU.exports)});var Vo=w((eOe,MU)=>{"use strict";MU.exports=TypeError});var FU=w((tOe,LU)=>{LU.exports=B("util").inspect});var Al=w((rOe,s2)=>{var Ck=typeof Map=="function"&&Map.prototype,_k=Object.getOwnPropertyDescriptor&&Ck?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ym=Ck&&_k&&typeof _k.get=="function"?_k.get:null,zU=Ck&&Map.prototype.forEach,Ak=typeof Set=="function"&&Set.prototype,wk=Object.getOwnPropertyDescriptor&&Ak?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,vm=Ak&&wk&&typeof wk.get=="function"?wk.get:null,UU=Ak&&Set.prototype.forEach,Rae=typeof WeakMap=="function"&&WeakMap.prototype,Il=Rae?WeakMap.prototype.has:null,Dae=typeof WeakSet=="function"&&WeakSet.prototype,Ol=Dae?WeakSet.prototype.has:null,Nae=typeof WeakRef=="function"&&WeakRef.prototype,BU=Nae?WeakRef.prototype.deref:null,Pae=Boolean.prototype.valueOf,qae=Object.prototype.toString,jae=Function.prototype.toString,Mae=String.prototype.match,$k=String.prototype.slice,Xi=String.prototype.replace,Lae=String.prototype.toUpperCase,WU=String.prototype.toLowerCase,QU=RegExp.prototype.test,HU=Array.prototype.concat,Tn=Array.prototype.join,Fae=Array.prototype.slice,VU=Math.floor,Ek=typeof BigInt=="function"?BigInt.prototype.valueOf:null,xk=Object.getOwnPropertySymbols,kk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ec=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Cl=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ec||!0)?Symbol.toStringTag:null,e2=Object.prototype.propertyIsEnumerable,ZU=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function GU(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||QU.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var i=e<0?-VU(-e):VU(e);if(i!==e){var n=String(i),o=$k.call(t,n.length+1);return Xi.call(n,r,"$&_")+"."+Xi.call(Xi.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Xi.call(t,r,"$&_")}var Tk=FU(),KU=Tk.custom,XU=n2(KU)?KU:null,t2={__proto__:null,double:'"',single:"'"},zae={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};s2.exports=function e(t,r,i,n){var o=r||{};if(si(o,"quoteStyle")&&!si(t2,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(si(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=si(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(si(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(si(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return o2(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return a?GU(t,c):c}if(typeof t=="bigint"){var u=String(t)+"n";return a?GU(t,u):u}var l=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=l&&l>0&&typeof t=="object")return Ik(t)?"[Array]":"[Object]";var f=oce(o,i);if(typeof n>"u")n=[];else if(i2(n,t)>=0)return"[Circular]";function p(D,V,$){if(V&&(n=Fae.call(n),n.push(V)),$){var U={depth:o.depth};return si(o,"quoteStyle")&&(U.quoteStyle=o.quoteStyle),e(D,U,i+1,n)}return e(D,o,i+1,n)}if(typeof t=="function"&&!JU(t)){var d=Xae(t),h=gm(t,p);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(h.length>0?" { "+Tn.call(h,", ")+" }":"")}if(n2(t)){var m=ec?Xi.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):kk.call(t);return typeof t=="object"&&!ec?Tl(m):m}if(rce(t)){for(var _="<"+WU.call(String(t.nodeName)),k=t.attributes||[],S=0;S<k.length;S++)_+=" "+k[S].name+"="+r2(Uae(k[S].value),"double",o);return _+=">",t.childNodes&&t.childNodes.length&&(_+="..."),_+="</"+WU.call(String(t.nodeName))+">",_}if(Ik(t)){if(t.length===0)return"[]";var v=gm(t,p);return f&&!ice(v)?"["+Ok(v,f)+"]":"[ "+Tn.call(v,", ")+" ]"}if(Wae(t)){var g=gm(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!e2.call(t,"cause")?"{ ["+String(t)+"] "+Tn.call(HU.call("[cause]: "+p(t.cause),g),", ")+" }":g.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Tn.call(g,", ")+" }"}if(typeof t=="object"&&s){if(XU&&typeof t[XU]=="function"&&Tk)return Tk(t,{depth:l-i});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(Jae(t)){var y=[];return zU&&zU.call(t,function(D,V){y.push(p(V,t,!0)+" => "+p(D,t))}),YU("Map",ym.call(t),y,f)}if(ece(t)){var T=[];return UU&&UU.call(t,function(D){T.push(p(D,t))}),YU("Set",vm.call(t),T,f)}if(Yae(t))return Sk("WeakMap");if(tce(t))return Sk("WeakSet");if(Qae(t))return Sk("WeakRef");if(Vae(t))return Tl(p(Number(t)));if(Gae(t))return Tl(p(Ek.call(t)));if(Zae(t))return Tl(Pae.call(t));if(Hae(t))return Tl(p(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!Bae(t)&&!JU(t)){var R=gm(t,p),I=ZU?ZU(t)===Object.prototype:t instanceof Object||t.constructor===Object,b=t instanceof Object?"":"null prototype",O=!I&&Cl&&Object(t)===t&&Cl in t?$k.call(Ji(t),8,-1):b?"Object":"",A=I||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",P=A+(O||b?"["+Tn.call(HU.call([],O||[],b||[]),": ")+"] ":"");return R.length===0?P+"{}":f?P+"{"+Ok(R,f)+"}":P+"{ "+Tn.call(R,", ")+" }"}return String(t)};function r2(e,t,r){var i=r.quoteStyle||t,n=t2[i];return n+e+n}function Uae(e){return Xi.call(String(e),/"/g,""")}function Zo(e){return!Cl||!(typeof e=="object"&&(Cl in e||typeof e[Cl]<"u"))}function Ik(e){return Ji(e)==="[object Array]"&&Zo(e)}function Bae(e){return Ji(e)==="[object Date]"&&Zo(e)}function JU(e){return Ji(e)==="[object RegExp]"&&Zo(e)}function Wae(e){return Ji(e)==="[object Error]"&&Zo(e)}function Hae(e){return Ji(e)==="[object String]"&&Zo(e)}function Vae(e){return Ji(e)==="[object Number]"&&Zo(e)}function Zae(e){return Ji(e)==="[object Boolean]"&&Zo(e)}function n2(e){if(ec)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!kk)return!1;try{return kk.call(e),!0}catch{}return!1}function Gae(e){if(!e||typeof e!="object"||!Ek)return!1;try{return Ek.call(e),!0}catch{}return!1}var Kae=Object.prototype.hasOwnProperty||function(e){return e in this};function si(e,t){return Kae.call(e,t)}function Ji(e){return qae.call(e)}function Xae(e){if(e.name)return e.name;var t=Mae.call(jae.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function i2(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}function Jae(e){if(!ym||!e||typeof e!="object")return!1;try{ym.call(e);try{vm.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function Yae(e){if(!Il||!e||typeof e!="object")return!1;try{Il.call(e,Il);try{Ol.call(e,Ol)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function Qae(e){if(!BU||!e||typeof e!="object")return!1;try{return BU.call(e),!0}catch{}return!1}function ece(e){if(!vm||!e||typeof e!="object")return!1;try{vm.call(e);try{ym.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function tce(e){if(!Ol||!e||typeof e!="object")return!1;try{Ol.call(e,Ol);try{Il.call(e,Il)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function rce(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function o2(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return o2($k.call(e,0,t.maxStringLength),t)+i}var n=zae[t.quoteStyle||"single"];n.lastIndex=0;var o=Xi.call(Xi.call(e,n,"\\$1"),/[\x00-\x1f]/g,nce);return r2(o,"single",t)}function nce(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+Lae.call(t.toString(16))}function Tl(e){return"Object("+e+")"}function Sk(e){return e+" { ? }"}function YU(e,t,r,i){var n=i?Ok(r,i):Tn.call(r,", ");return e+" ("+t+") {"+n+"}"}function ice(e){for(var t=0;t<e.length;t++)if(i2(e[t],`
|
|
210
|
+
`),xae(_U.dirname(e)).then(function(){return Ja().writeFile(e,t)})};function xae(e){return new Promise(function(t,r){wU()(e,function(i){if(i)return r(i);t()})})}});var SU=w(Gi=>{"use strict";var Sae=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],hm=" ",Wo=parseInt(-new Date().getTimezoneOffset()/60,10);Wo>=0?hm+="+":hm+="-";Wo=Math.abs(Wo);Wo<10&&(Wo="0"+Wo);hm+=Wo+"00";Gi.accessLogDate=function(e){e=e||new Date;var t=e.getDate();t<10&&(t="0"+t);var r=e.getHours();r<10&&(r="0"+r);var i=e.getMinutes();i<10&&(i="0"+i);var n=e.getSeconds();return n<10&&(n="0"+n),t+"/"+Sae[e.getMonth()]+"/"+e.getFullYear()+":"+r+":"+i+":"+n+hm};Gi.logDate=Gi.YYYYMMDDHHmmssSSS=function(e,t){typeof e=="string"?(t=e,e=new Date):e=e||new Date;var r=e.getDate();r<10&&(r="0"+r);var i=e.getMonth()+1;i<10&&(i="0"+i);var n=e.getHours();n<10&&(n="0"+n);var o=e.getMinutes();o<10&&(o="0"+o);var s=e.getSeconds();s<10&&(s="0"+s);var a=e.getMilliseconds();return a<10?a="00"+a:a<100&&(a="0"+a),e.getFullYear()+"-"+i+"-"+r+" "+n+":"+o+":"+s+(t||".")+a};Gi.YYYYMMDDHHmmss=function(e,t){e=e||new Date,e instanceof Date||(e=new Date(e));var r="-",i=":";t&&(t.dateSep&&(r=t.dateSep),t.timeSep&&(i=t.timeSep));var n=e.getDate();n<10&&(n="0"+n);var o=e.getMonth()+1;o<10&&(o="0"+o);var s=e.getHours();s<10&&(s="0"+s);var a=e.getMinutes();a<10&&(a="0"+a);var c=e.getSeconds();return c<10&&(c="0"+c),e.getFullYear()+r+o+r+n+" "+s+i+a+i+c};Gi.YYYYMMDD=function(t,r){typeof t=="string"?(r=t,t=new Date):(t=t||new Date,typeof r!="string"&&(r="-"));var i=t.getDate();i<10&&(i="0"+i);var n=t.getMonth()+1;return n<10&&(n="0"+n),t.getFullYear()+r+n+r+i};Gi.datestruct=function(e){return e=e||new Date,{YYYYMMDD:e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate(),H:e.getHours()}};Gi.timestamp=function(t){if(t){var r=t;return typeof r=="string"&&(r=Number(r)),String(t).length===10&&(r*=1e3),new Date(r)}return Math.round(Date.now()/1e3)}});var kU=w(Qa=>{"use strict";Qa.assign=function(e,t){Array.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++){var i=t[r];if(i)for(var n=Object.keys(i),o=0;o<n.length;o++){var s=n[o];e[s]=i[s]}}return e};Qa.has=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)};Qa.getOwnEnumerables=function(t,r){return!t||typeof t!="object"||Array.isArray(t)?[]:Object.keys(t).filter(function(i){if(r){var n=t[i];if(n==null||Number.isNaN(n))return!1}return Qa.has(t,i)})};Qa.map=function(t){var r=new EU;if(!t)return r;for(var i in t)r[i]=t[i];return r};function EU(){}EU.prototype=Object.create(null)});var IU=w((KIe,TU)=>{"use strict";var Eae=/["'&<>]/;TU.exports=kae;function kae(e){var t=""+e,r=Eae.exec(t);if(!r)return t;var i,n="",o=0,s=0;for(o=r.index;o<t.length;o++){switch(t.charCodeAt(o)){case 34:i=""";break;case 38:i="&";break;case 39:i="'";break;case 60:i="<";break;case 62:i=">";break;default:continue}s!==o&&(n+=t.substring(s,o)),s=o+1,n+=i}return s!==o?n+t.substring(s,o):n}});var CU=w((XIe,OU)=>{"use strict";OU.exports=function(t){return typeof t<"u"&&t!==null&&(typeof t=="object"||typeof t=="function")}});var RU=w((JIe,$U)=>{"use strict";var AU=CU();$U.exports=function(t){AU(t)||(t={});for(var r=arguments.length,i=1;i<r;i++){var n=arguments[i];AU(n)&&Tae(t,n)}return t};function Tae(e,t){for(var r in t)Iae(t,r)&&(e[r]=t[r])}function Iae(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var PU=w((YIe,NU)=>{"use strict";var Oae=RU(),bk={},DU,Ho={default:{""":'"',""":'"',"'":"'","'":"'","&":"&","&":"&",">":">",">":">","<":"<","<":"<"},extras:{"¢":"\xA2","¢":"\xA2","©":"\xA9","©":"\xA9","€":"\u20AC","€":"\u20AC","£":"\xA3","£":"\xA3","®":"\xAE","®":"\xAE","¥":"\xA5","¥":"\xA5"}};Object.defineProperty(Ho,"all",{get:function(){return DU||(DU=Oae({},Ho.default,Ho.extras))}});function mm(e,t){if(!Aae(e))return"";var r=Ho[t||"default"],i=Cae(t,r);return e.replace(i,function(n){return r[n]})}function Cae(e,t){if(bk[e])return bk[e];var r=Object.keys(t).join("|"),i=new RegExp("(?=("+r+"))\\1","g");return bk[e]=i,i}function Aae(e){return e&&typeof e=="string"}mm.chars=Ho.default;mm.extras=Ho.extras;Object.defineProperty(mm,"all",{get:function(){return Ho.all}});NU.exports=mm});var qU=w(kl=>{"use strict";kl.escape=IU();kl.unescape=PU();kl.encodeURIComponent=function(t){try{return encodeURIComponent(t)}catch{return t}};kl.decodeURIComponent=function(t){try{return decodeURIComponent(t)}catch{return t}}});var Ki=w((eOe,jU)=>{"use strict";var $ae=Ur();$ae(zz()).and(Bz()).and(Wz()).and(Zz()).and(Xz()).and(Yz()).and(Qz()).and(xU()).and(SU()).and(kU()).and(qU()).to(jU.exports)});var Vo=w((tOe,MU)=>{"use strict";MU.exports=TypeError});var FU=w((rOe,LU)=>{LU.exports=B("util").inspect});var Al=w((nOe,s2)=>{var Ck=typeof Map=="function"&&Map.prototype,_k=Object.getOwnPropertyDescriptor&&Ck?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ym=Ck&&_k&&typeof _k.get=="function"?_k.get:null,zU=Ck&&Map.prototype.forEach,Ak=typeof Set=="function"&&Set.prototype,wk=Object.getOwnPropertyDescriptor&&Ak?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,vm=Ak&&wk&&typeof wk.get=="function"?wk.get:null,UU=Ak&&Set.prototype.forEach,Rae=typeof WeakMap=="function"&&WeakMap.prototype,Il=Rae?WeakMap.prototype.has:null,Dae=typeof WeakSet=="function"&&WeakSet.prototype,Ol=Dae?WeakSet.prototype.has:null,Nae=typeof WeakRef=="function"&&WeakRef.prototype,BU=Nae?WeakRef.prototype.deref:null,Pae=Boolean.prototype.valueOf,qae=Object.prototype.toString,jae=Function.prototype.toString,Mae=String.prototype.match,$k=String.prototype.slice,Xi=String.prototype.replace,Lae=String.prototype.toUpperCase,WU=String.prototype.toLowerCase,QU=RegExp.prototype.test,HU=Array.prototype.concat,Tn=Array.prototype.join,Fae=Array.prototype.slice,VU=Math.floor,Ek=typeof BigInt=="function"?BigInt.prototype.valueOf:null,xk=Object.getOwnPropertySymbols,kk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ec=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Cl=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ec||!0)?Symbol.toStringTag:null,e2=Object.prototype.propertyIsEnumerable,ZU=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function GU(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||QU.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var i=e<0?-VU(-e):VU(e);if(i!==e){var n=String(i),o=$k.call(t,n.length+1);return Xi.call(n,r,"$&_")+"."+Xi.call(Xi.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Xi.call(t,r,"$&_")}var Tk=FU(),KU=Tk.custom,XU=n2(KU)?KU:null,t2={__proto__:null,double:'"',single:"'"},zae={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};s2.exports=function e(t,r,i,n){var o=r||{};if(si(o,"quoteStyle")&&!si(t2,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(si(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=si(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(si(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(si(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return o2(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return a?GU(t,c):c}if(typeof t=="bigint"){var u=String(t)+"n";return a?GU(t,u):u}var l=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=l&&l>0&&typeof t=="object")return Ik(t)?"[Array]":"[Object]";var f=oce(o,i);if(typeof n>"u")n=[];else if(i2(n,t)>=0)return"[Circular]";function p(D,V,$){if(V&&(n=Fae.call(n),n.push(V)),$){var U={depth:o.depth};return si(o,"quoteStyle")&&(U.quoteStyle=o.quoteStyle),e(D,U,i+1,n)}return e(D,o,i+1,n)}if(typeof t=="function"&&!JU(t)){var d=Xae(t),h=gm(t,p);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(h.length>0?" { "+Tn.call(h,", ")+" }":"")}if(n2(t)){var m=ec?Xi.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):kk.call(t);return typeof t=="object"&&!ec?Tl(m):m}if(rce(t)){for(var _="<"+WU.call(String(t.nodeName)),k=t.attributes||[],S=0;S<k.length;S++)_+=" "+k[S].name+"="+r2(Uae(k[S].value),"double",o);return _+=">",t.childNodes&&t.childNodes.length&&(_+="..."),_+="</"+WU.call(String(t.nodeName))+">",_}if(Ik(t)){if(t.length===0)return"[]";var v=gm(t,p);return f&&!ice(v)?"["+Ok(v,f)+"]":"[ "+Tn.call(v,", ")+" ]"}if(Wae(t)){var g=gm(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!e2.call(t,"cause")?"{ ["+String(t)+"] "+Tn.call(HU.call("[cause]: "+p(t.cause),g),", ")+" }":g.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Tn.call(g,", ")+" }"}if(typeof t=="object"&&s){if(XU&&typeof t[XU]=="function"&&Tk)return Tk(t,{depth:l-i});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(Jae(t)){var y=[];return zU&&zU.call(t,function(D,V){y.push(p(V,t,!0)+" => "+p(D,t))}),YU("Map",ym.call(t),y,f)}if(ece(t)){var T=[];return UU&&UU.call(t,function(D){T.push(p(D,t))}),YU("Set",vm.call(t),T,f)}if(Yae(t))return Sk("WeakMap");if(tce(t))return Sk("WeakSet");if(Qae(t))return Sk("WeakRef");if(Vae(t))return Tl(p(Number(t)));if(Gae(t))return Tl(p(Ek.call(t)));if(Zae(t))return Tl(Pae.call(t));if(Hae(t))return Tl(p(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!Bae(t)&&!JU(t)){var R=gm(t,p),I=ZU?ZU(t)===Object.prototype:t instanceof Object||t.constructor===Object,b=t instanceof Object?"":"null prototype",O=!I&&Cl&&Object(t)===t&&Cl in t?$k.call(Ji(t),8,-1):b?"Object":"",A=I||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",P=A+(O||b?"["+Tn.call(HU.call([],O||[],b||[]),": ")+"] ":"");return R.length===0?P+"{}":f?P+"{"+Ok(R,f)+"}":P+"{ "+Tn.call(R,", ")+" }"}return String(t)};function r2(e,t,r){var i=r.quoteStyle||t,n=t2[i];return n+e+n}function Uae(e){return Xi.call(String(e),/"/g,""")}function Zo(e){return!Cl||!(typeof e=="object"&&(Cl in e||typeof e[Cl]<"u"))}function Ik(e){return Ji(e)==="[object Array]"&&Zo(e)}function Bae(e){return Ji(e)==="[object Date]"&&Zo(e)}function JU(e){return Ji(e)==="[object RegExp]"&&Zo(e)}function Wae(e){return Ji(e)==="[object Error]"&&Zo(e)}function Hae(e){return Ji(e)==="[object String]"&&Zo(e)}function Vae(e){return Ji(e)==="[object Number]"&&Zo(e)}function Zae(e){return Ji(e)==="[object Boolean]"&&Zo(e)}function n2(e){if(ec)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!kk)return!1;try{return kk.call(e),!0}catch{}return!1}function Gae(e){if(!e||typeof e!="object"||!Ek)return!1;try{return Ek.call(e),!0}catch{}return!1}var Kae=Object.prototype.hasOwnProperty||function(e){return e in this};function si(e,t){return Kae.call(e,t)}function Ji(e){return qae.call(e)}function Xae(e){if(e.name)return e.name;var t=Mae.call(jae.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function i2(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}function Jae(e){if(!ym||!e||typeof e!="object")return!1;try{ym.call(e);try{vm.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function Yae(e){if(!Il||!e||typeof e!="object")return!1;try{Il.call(e,Il);try{Ol.call(e,Ol)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function Qae(e){if(!BU||!e||typeof e!="object")return!1;try{return BU.call(e),!0}catch{}return!1}function ece(e){if(!vm||!e||typeof e!="object")return!1;try{vm.call(e);try{ym.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function tce(e){if(!Ol||!e||typeof e!="object")return!1;try{Ol.call(e,Ol);try{Il.call(e,Il)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function rce(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function o2(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return o2($k.call(e,0,t.maxStringLength),t)+i}var n=zae[t.quoteStyle||"single"];n.lastIndex=0;var o=Xi.call(Xi.call(e,n,"\\$1"),/[\x00-\x1f]/g,nce);return r2(o,"single",t)}function nce(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+Lae.call(t.toString(16))}function Tl(e){return"Object("+e+")"}function Sk(e){return e+" { ? }"}function YU(e,t,r,i){var n=i?Ok(r,i):Tn.call(r,", ");return e+" ("+t+") {"+n+"}"}function ice(e){for(var t=0;t<e.length;t++)if(i2(e[t],`
|
|
211
211
|
`)>=0)return!1;return!0}function oce(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=Tn.call(Array(e.indent+1)," ");else return null;return{base:r,prev:Tn.call(Array(t+1),r)}}function Ok(e,t){if(e.length===0)return"";var r=`
|
|
212
212
|
`+t.prev+t.base;return r+Tn.call(e,","+r)+`
|
|
213
|
-
`+t.prev}function gm(e,t){var r=Ik(e),i=[];if(r){i.length=e.length;for(var n=0;n<e.length;n++)i[n]=si(e,n)?t(e[n],e):""}var o=typeof xk=="function"?xk(e):[],s;if(ec){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var c in e)si(e,c)&&(r&&String(Number(c))===c&&c<e.length||ec&&s["$"+c]instanceof Symbol||(QU.call(/[^\w$]/,c)?i.push(t(c,e)+": "+t(e[c],e)):i.push(c+": "+t(e[c],e))));if(typeof xk=="function")for(var u=0;u<o.length;u++)e2.call(e,o[u])&&i.push("["+t(o[u])+"]: "+t(e[o[u]],e));return i}});var c2=w((nOe,a2)=>{"use strict";var sce=Al(),ace=Vo(),bm=function(e,t,r){for(var i=e,n;(n=i.next)!=null;i=n)if(n.key===t)return i.next=n.next,r||(n.next=e.next,e.next=n),n},cce=function(e,t){if(e){var r=bm(e,t);return r&&r.value}},uce=function(e,t,r){var i=bm(e,t);i?i.value=r:e.next={key:t,next:e.next,value:r}},lce=function(e,t){return e?!!bm(e,t):!1},fce=function(e,t){if(e)return bm(e,t,!0)};a2.exports=function(){var t,r={assert:function(i){if(!r.has(i))throw new ace("Side channel does not contain "+sce(i))},delete:function(i){var n=fce(t,i);return n&&t&&!t.next&&(t=void 0),!!n},get:function(i){return cce(t,i)},has:function(i){return lce(t,i)},set:function(i,n){t||(t={next:void 0}),uce(t,i,n)}};return r}});var Rk=w((iOe,u2)=>{"use strict";u2.exports=Object});var f2=w((oOe,l2)=>{"use strict";l2.exports=Error});var p2=w((sOe,d2)=>{"use strict";d2.exports=EvalError});var m2=w((aOe,h2)=>{"use strict";h2.exports=RangeError});var y2=w((cOe,g2)=>{"use strict";g2.exports=ReferenceError});var b2=w((uOe,v2)=>{"use strict";v2.exports=SyntaxError});var w2=w((lOe,_2)=>{"use strict";_2.exports=URIError});var S2=w((fOe,x2)=>{"use strict";x2.exports=Math.abs});var k2=w((dOe,E2)=>{"use strict";E2.exports=Math.floor});var I2=w((pOe,T2)=>{"use strict";T2.exports=Math.max});var C2=w((hOe,O2)=>{"use strict";O2.exports=Math.min});var $2=w((mOe,A2)=>{"use strict";A2.exports=Math.pow});var D2=w((gOe,R2)=>{"use strict";R2.exports=Math.round});var P2=w((yOe,N2)=>{"use strict";N2.exports=Number.isNaN||function(t){return t!==t}});var j2=w((vOe,q2)=>{"use strict";var dce=P2();q2.exports=function(t){return dce(t)||t===0?t:t<0?-1:1}});var L2=w((bOe,M2)=>{"use strict";M2.exports=Object.getOwnPropertyDescriptor});var Dk=w((_Oe,F2)=>{"use strict";var _m=L2();if(_m)try{_m([],"length")}catch{_m=null}F2.exports=_m});var Nk=w((wOe,z2)=>{"use strict";var wm=Object.defineProperty||!1;if(wm)try{wm({},"a",{value:1})}catch{wm=!1}z2.exports=wm});var B2=w((xOe,U2)=>{"use strict";U2.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;t[r]=n;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==n||a.enumerable!==!0)return!1}return!0}});var V2=w((SOe,H2)=>{"use strict";var W2=typeof Symbol<"u"&&Symbol,pce=B2();H2.exports=function(){return typeof W2!="function"||typeof Symbol!="function"||typeof W2("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:pce()}});var Pk=w((EOe,Z2)=>{"use strict";Z2.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var qk=w((kOe,G2)=>{"use strict";var hce=Rk();G2.exports=hce.getPrototypeOf||null});var J2=w((TOe,X2)=>{"use strict";var mce="Function.prototype.bind called on incompatible ",gce=Object.prototype.toString,yce=Math.max,vce="[object Function]",K2=function(t,r){for(var i=[],n=0;n<t.length;n+=1)i[n]=t[n];for(var o=0;o<r.length;o+=1)i[o+t.length]=r[o];return i},bce=function(t,r){for(var i=[],n=r||0,o=0;n<t.length;n+=1,o+=1)i[o]=t[n];return i},_ce=function(e,t){for(var r="",i=0;i<e.length;i+=1)r+=e[i],i+1<e.length&&(r+=t);return r};X2.exports=function(t){var r=this;if(typeof r!="function"||gce.apply(r)!==vce)throw new TypeError(mce+r);for(var i=bce(arguments,1),n,o=function(){if(this instanceof n){var l=r.apply(this,K2(i,arguments));return Object(l)===l?l:this}return r.apply(t,K2(i,arguments))},s=yce(0,r.length-i.length),a=[],c=0;c<s;c++)a[c]="$"+c;if(n=Function("binder","return function ("+_ce(a,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var u=function(){};u.prototype=r.prototype,n.prototype=new u,u.prototype=null}return n}});var $l=w((IOe,Y2)=>{"use strict";var wce=J2();Y2.exports=Function.prototype.bind||wce});var xm=w((OOe,Q2)=>{"use strict";Q2.exports=Function.prototype.call});var jk=w((COe,e4)=>{"use strict";e4.exports=Function.prototype.apply});var r4=w((AOe,t4)=>{"use strict";t4.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var i4=w(($Oe,n4)=>{"use strict";var xce=$l(),Sce=jk(),Ece=xm(),kce=r4();n4.exports=kce||xce.call(Ece,Sce)});var Mk=w((ROe,o4)=>{"use strict";var Tce=$l(),Ice=Vo(),Oce=xm(),Cce=i4();o4.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new Ice("a function is required");return Cce(Tce,Oce,t)}});var f4=w((DOe,l4)=>{"use strict";var Ace=Mk(),s4=Dk(),c4;try{c4=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Lk=!!c4&&s4&&s4(Object.prototype,"__proto__"),u4=Object,a4=u4.getPrototypeOf;l4.exports=Lk&&typeof Lk.get=="function"?Ace([Lk.get]):typeof a4=="function"?function(t){return a4(t==null?t:u4(t))}:!1});var g4=w((NOe,m4)=>{"use strict";var d4=Pk(),p4=qk(),h4=f4();m4.exports=d4?function(t){return d4(t)}:p4?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return p4(t)}:h4?function(t){return h4(t)}:null});var v4=w((POe,y4)=>{"use strict";var $ce=Function.prototype.call,Rce=Object.prototype.hasOwnProperty,Dce=$l();y4.exports=Dce.call($ce,Rce)});var km=w((qOe,E4)=>{"use strict";var De,Nce=Rk(),Pce=f2(),qce=p2(),jce=m2(),Mce=y2(),oc=b2(),nc=Vo(),Lce=w2(),Fce=S2(),zce=k2(),Uce=I2(),Bce=C2(),Wce=$2(),Hce=D2(),Vce=j2(),x4=Function,Fk=function(e){try{return x4('"use strict"; return ('+e+").constructor;")()}catch{}},Rl=Dk(),Zce=Nk(),zk=function(){throw new nc},Gce=Rl?(function(){try{return arguments.callee,zk}catch{try{return Rl(arguments,"callee").get}catch{return zk}}})():zk,tc=V2()(),Bt=g4(),Kce=qk(),Xce=Pk(),S4=jk(),Dl=xm(),rc={},Jce=typeof Uint8Array>"u"||!Bt?De:Bt(Uint8Array),Go={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?De:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?De:ArrayBuffer,"%ArrayIteratorPrototype%":tc&&Bt?Bt([][Symbol.iterator]()):De,"%AsyncFromSyncIteratorPrototype%":De,"%AsyncFunction%":rc,"%AsyncGenerator%":rc,"%AsyncGeneratorFunction%":rc,"%AsyncIteratorPrototype%":rc,"%Atomics%":typeof Atomics>"u"?De:Atomics,"%BigInt%":typeof BigInt>"u"?De:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?De:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?De:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?De:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Pce,"%eval%":eval,"%EvalError%":qce,"%Float16Array%":typeof Float16Array>"u"?De:Float16Array,"%Float32Array%":typeof Float32Array>"u"?De:Float32Array,"%Float64Array%":typeof Float64Array>"u"?De:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?De:FinalizationRegistry,"%Function%":x4,"%GeneratorFunction%":rc,"%Int8Array%":typeof Int8Array>"u"?De:Int8Array,"%Int16Array%":typeof Int16Array>"u"?De:Int16Array,"%Int32Array%":typeof Int32Array>"u"?De:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":tc&&Bt?Bt(Bt([][Symbol.iterator]())):De,"%JSON%":typeof JSON=="object"?JSON:De,"%Map%":typeof Map>"u"?De:Map,"%MapIteratorPrototype%":typeof Map>"u"||!tc||!Bt?De:Bt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Nce,"%Object.getOwnPropertyDescriptor%":Rl,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?De:Promise,"%Proxy%":typeof Proxy>"u"?De:Proxy,"%RangeError%":jce,"%ReferenceError%":Mce,"%Reflect%":typeof Reflect>"u"?De:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?De:Set,"%SetIteratorPrototype%":typeof Set>"u"||!tc||!Bt?De:Bt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?De:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":tc&&Bt?Bt(""[Symbol.iterator]()):De,"%Symbol%":tc?Symbol:De,"%SyntaxError%":oc,"%ThrowTypeError%":Gce,"%TypedArray%":Jce,"%TypeError%":nc,"%Uint8Array%":typeof Uint8Array>"u"?De:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?De:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?De:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?De:Uint32Array,"%URIError%":Lce,"%WeakMap%":typeof WeakMap>"u"?De:WeakMap,"%WeakRef%":typeof WeakRef>"u"?De:WeakRef,"%WeakSet%":typeof WeakSet>"u"?De:WeakSet,"%Function.prototype.call%":Dl,"%Function.prototype.apply%":S4,"%Object.defineProperty%":Zce,"%Object.getPrototypeOf%":Kce,"%Math.abs%":Fce,"%Math.floor%":zce,"%Math.max%":Uce,"%Math.min%":Bce,"%Math.pow%":Wce,"%Math.round%":Hce,"%Math.sign%":Vce,"%Reflect.getPrototypeOf%":Xce};if(Bt)try{null.error}catch(e){b4=Bt(Bt(e)),Go["%Error.prototype%"]=b4}var b4,Yce=function e(t){var r;if(t==="%AsyncFunction%")r=Fk("async function () {}");else if(t==="%GeneratorFunction%")r=Fk("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Fk("async function* () {}");else if(t==="%AsyncGenerator%"){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=e("%AsyncGenerator%");n&&Bt&&(r=Bt(n.prototype))}return Go[t]=r,r},_4={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Nl=$l(),Sm=v4(),Qce=Nl.call(Dl,Array.prototype.concat),eue=Nl.call(S4,Array.prototype.splice),w4=Nl.call(Dl,String.prototype.replace),Em=Nl.call(Dl,String.prototype.slice),tue=Nl.call(Dl,RegExp.prototype.exec),rue=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,nue=/\\(\\)?/g,iue=function(t){var r=Em(t,0,1),i=Em(t,-1);if(r==="%"&&i!=="%")throw new oc("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new oc("invalid intrinsic syntax, expected opening `%`");var n=[];return w4(t,rue,function(o,s,a,c){n[n.length]=a?w4(c,nue,"$1"):s||o}),n},oue=function(t,r){var i=t,n;if(Sm(_4,i)&&(n=_4[i],i="%"+n[0]+"%"),Sm(Go,i)){var o=Go[i];if(o===rc&&(o=Yce(i)),typeof o>"u"&&!r)throw new nc("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new oc("intrinsic "+t+" does not exist!")};E4.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new nc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new nc('"allowMissing" argument must be a boolean');if(tue(/^%?[^%]*%?$/,t)===null)throw new oc("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=iue(t),n=i.length>0?i[0]:"",o=oue("%"+n+"%",r),s=o.name,a=o.value,c=!1,u=o.alias;u&&(n=u[0],eue(i,Qce([0,1],u)));for(var l=1,f=!0;l<i.length;l+=1){var p=i[l],d=Em(p,0,1),h=Em(p,-1);if((d==='"'||d==="'"||d==="`"||h==='"'||h==="'"||h==="`")&&d!==h)throw new oc("property names with quotes must have matching quotes");if((p==="constructor"||!f)&&(c=!0),n+="."+p,s="%"+n+"%",Sm(Go,s))a=Go[s];else if(a!=null){if(!(p in a)){if(!r)throw new nc("base intrinsic for "+t+" exists, but the property is not available.");return}if(Rl&&l+1>=i.length){var m=Rl(a,p);f=!!m,f&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[p]}else f=Sm(a,p),a=a[p];f&&!c&&(Go[s]=a)}}return a}});var Uk=w((jOe,I4)=>{"use strict";var k4=km(),T4=Mk(),sue=T4([k4("%String.prototype.indexOf%")]);I4.exports=function(t,r){var i=k4(t,!!r);return typeof i=="function"&&sue(t,".prototype.")>-1?T4([i]):i}});var Bk=w((MOe,C4)=>{"use strict";var aue=km(),Pl=Uk(),cue=Al(),uue=Vo(),O4=aue("%Map%",!0),lue=Pl("Map.prototype.get",!0),fue=Pl("Map.prototype.set",!0),due=Pl("Map.prototype.has",!0),pue=Pl("Map.prototype.delete",!0),hue=Pl("Map.prototype.size",!0);C4.exports=!!O4&&function(){var t,r={assert:function(i){if(!r.has(i))throw new uue("Side channel does not contain "+cue(i))},delete:function(i){if(t){var n=pue(t,i);return hue(t)===0&&(t=void 0),n}return!1},get:function(i){if(t)return lue(t,i)},has:function(i){return t?due(t,i):!1},set:function(i,n){t||(t=new O4),fue(t,i,n)}};return r}});var $4=w((LOe,A4)=>{"use strict";var mue=km(),Im=Uk(),gue=Al(),Tm=Bk(),yue=Vo(),sc=mue("%WeakMap%",!0),vue=Im("WeakMap.prototype.get",!0),bue=Im("WeakMap.prototype.set",!0),_ue=Im("WeakMap.prototype.has",!0),wue=Im("WeakMap.prototype.delete",!0);A4.exports=sc?function(){var t,r,i={assert:function(n){if(!i.has(n))throw new yue("Side channel does not contain "+gue(n))},delete:function(n){if(sc&&n&&(typeof n=="object"||typeof n=="function")){if(t)return wue(t,n)}else if(Tm&&r)return r.delete(n);return!1},get:function(n){return sc&&n&&(typeof n=="object"||typeof n=="function")&&t?vue(t,n):r&&r.get(n)},has:function(n){return sc&&n&&(typeof n=="object"||typeof n=="function")&&t?_ue(t,n):!!r&&r.has(n)},set:function(n,o){sc&&n&&(typeof n=="object"||typeof n=="function")?(t||(t=new sc),bue(t,n,o)):Tm&&(r||(r=Tm()),r.set(n,o))}};return i}:Tm});var Wk=w((FOe,R4)=>{"use strict";var xue=Vo(),Sue=Al(),Eue=c2(),kue=Bk(),Tue=$4(),Iue=Tue||kue||Eue;R4.exports=function(){var t,r={assert:function(i){if(!r.has(i)){var n=i&&Object(i)===i?"the given object key":Sue(i);throw new xue("Side channel does not contain "+n)}},delete:function(i){return!!t&&t.delete(i)},get:function(i){return t&&t.get(i)},has:function(i){return!!t&&t.has(i)},set:function(i,n){t||(t=Iue()),t.set(i,n)}};return r}});var Om=w((zOe,D4)=>{"use strict";var Oue=String.prototype.replace,Cue=/%20/g,Hk={RFC1738:"RFC1738",RFC3986:"RFC3986"};D4.exports={default:Hk.RFC3986,formatters:{RFC1738:function(e){return Oue.call(e,Cue,"+")},RFC3986:function(e){return String(e)}},RFC1738:Hk.RFC1738,RFC3986:Hk.RFC3986}});var Kk=w((UOe,q4)=>{"use strict";var Aue=Om(),P4=Wk(),N4=Nk(),Vk=Object.prototype.hasOwnProperty,Ko=Array.isArray,Am=P4(),Xo=function(t,r){return Am.set(t,r),t},Jo=function(t){return Am.has(t)},ql=function(t){return Am.get(t)},Zk=function(t,r){Am.set(t,r)},In=(function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e})(),$ue=function(t){for(;t.length>1;){var r=t.pop(),i=r.obj[r.prop];if(Ko(i)){for(var n=[],o=0;o<i.length;++o)typeof i[o]<"u"&&(n[n.length]=i[o]);r.obj[r.prop]=n}}},ac=function(t,r){for(var i=r&&r.plainObjects?{__proto__:null}:{},n=0;n<t.length;++n)typeof t[n]<"u"&&(i[n]=t[n]);return i},Gk=function(t,r,i){r==="__proto__"&&N4?N4(t,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[r]=i},Rue=function e(t,r,i){if(!r)return t;if(typeof r!="object"&&typeof r!="function"){if(Ko(t)){var n=t.length;if(i&&typeof i.arrayLimit=="number"&&n>=i.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(i.arrayLimit===1?"":"s")+" allowed in an array.");return Xo(ac(t.concat(r),i),n)}t[n]=r}else if(t&&typeof t=="object")if(Jo(t)){var o=ql(t)+1;t[o]=r,Zk(t,o)}else{if(i&&i.strictMerge)return[t,r];(i&&(i.plainObjects||i.allowPrototypes)||!Vk.call(Object.prototype,r))&&(t[r]=!0)}else return[t,r];return t}if(!t||typeof t!="object"){if(Jo(r)){for(var s=Object.keys(r),a=i&&i.plainObjects?{__proto__:null,0:t}:{0:t},c=0;c<s.length;c++){var u=parseInt(s[c],10);a[u+1]=r[s[c]]}return Xo(a,ql(r)+1)}var l=[t].concat(r);if(i&&typeof i.arrayLimit=="number"&&l.length>i.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(i.arrayLimit===1?"":"s")+" allowed in an array.");return Xo(ac(l,i),l.length-1)}return l}var f=t;if(Ko(t)&&!Ko(r)&&(f=ac(t,i)),Ko(t)&&Ko(r)){if(r.forEach(function(p,d){if(Vk.call(t,d)){var h=t[d];h&&typeof h=="object"&&p&&typeof p=="object"?t[d]=e(h,p,i):t[t.length]=p}else t[d]=p}),i&&typeof i.arrayLimit=="number"&&t.length>i.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(i.arrayLimit===1?"":"s")+" allowed in an array.");return Xo(ac(t,i),t.length-1)}return t}return Object.keys(r).reduce(function(p,d){var h=r[d];if(Vk.call(p,d)?Gk(p,d,e(p[d],h,i)):Gk(p,d,h),Jo(r)&&!Jo(p)&&Xo(p,ql(r)),Jo(p)){var m=parseInt(d,10);String(m)===d&&m>=0&&m>ql(p)&&Zk(p,m)}return p},f)},Due=function(t,r){return Object.keys(r).reduce(function(i,n){return Gk(i,n,r[n]),i},t)},Nue=function(e,t,r){var i=e.replace(/\+/g," ");if(r==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},Cm=1024,Pue=function(t,r,i,n,o){if(t.length===0)return t;var s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),i==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});for(var a="",c=0;c<s.length;c+=Cm){var u=s.length>=Cm?s.slice(c,c+Cm):s;if(c+Cm<s.length){var l=u.charCodeAt(u.length-1);l>=55296&&l<=56319&&(u=u.slice(0,-1),c-=1)}for(var f=[],p=0;p<u.length;++p){var d=u.charCodeAt(p);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||o===Aue.RFC1738&&(d===40||d===41)){f[f.length]=u.charAt(p);continue}if(d<128){f[f.length]=In[d];continue}if(d<2048){f[f.length]=In[192|d>>6]+In[128|d&63];continue}if(d<55296||d>=57344){f[f.length]=In[224|d>>12]+In[128|d>>6&63]+In[128|d&63];continue}p+=1,d=65536+((d&1023)<<10|u.charCodeAt(p)&1023),f[f.length]=In[240|d>>18]+In[128|d>>12&63]+In[128|d>>6&63]+In[128|d&63]}a+=f.join("")}return a},que=function(t){for(var r=[{obj:{o:t},prop:"o"}],i=P4(),n=0;n<r.length;++n)for(var o=r[n],s=o.obj[o.prop],a=Object.keys(s),c=0;c<a.length;++c){var u=a[c],l=s[u];typeof l=="object"&&l!==null&&!i.has(l)&&(r[r.length]={obj:s,prop:u},i.set(l,!0))}return $ue(r),t},jue=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},Mue=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},Lue=function(t,r,i,n,o){if(Jo(t)){if(o)throw new RangeError("Array limit exceeded. Only "+i+" element"+(i===1?"":"s")+" allowed in an array.");var s=ql(t)+1;return t[s]=r,Zk(t,s),t}var a=[].concat(t,r);if(a.length>i){if(o)throw new RangeError("Array limit exceeded. Only "+i+" element"+(i===1?"":"s")+" allowed in an array.");return Xo(ac(a,{plainObjects:n}),a.length-1)}return a},Fue=function(t,r){if(Ko(t)){for(var i=[],n=0;n<t.length;n+=1)i[i.length]=r(t[n]);return i}return r(t)};q4.exports={arrayToObject:ac,assign:Due,combine:Lue,compact:que,decode:Nue,encode:Pue,isBuffer:Mue,isOverflow:Jo,isRegExp:jue,markOverflow:Xo,maybeMap:Fue,merge:Rue}});var U4=w((BOe,z4)=>{"use strict";var M4=Wk(),$m=Kk(),jl=Om(),zue=Object.prototype.hasOwnProperty,L4={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},On=Array.isArray,Uue=Array.prototype.push,F4=function(e,t){Uue.apply(e,On(t)?t:[t])},Bue=Date.prototype.toISOString,j4=jl.default,Pt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:$m.encode,encodeValuesOnly:!1,filter:void 0,format:j4,formatter:jl.formatters[j4],indices:!1,serializeDate:function(t){return Bue.call(t)},skipNulls:!1,strictNullHandling:!1},Wue=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Xk={},Hue=function e(t,r,i,n,o,s,a,c,u,l,f,p,d,h,m,_,k,S){for(var v=t,g=S,y=0,T=!1;(g=g.get(Xk))!==void 0&&!T;){var R=g.get(t);if(y+=1,typeof R<"u"){if(R===y)throw new RangeError("Cyclic object value");T=!0}typeof g.get(Xk)>"u"&&(y=0)}if(typeof l=="function"?v=l(r,v):v instanceof Date?v=d(v):i==="comma"&&On(v)&&(v=$m.maybeMap(v,function(pe){return pe instanceof Date?d(pe):pe})),v===null){if(s)return m(u&&!_?u(r,Pt.encoder,k,"key",h):r);v=""}if(Wue(v)||$m.isBuffer(v)){if(u){var I=_?r:u(r,Pt.encoder,k,"key",h);return[m(I)+"="+m(u(v,Pt.encoder,k,"value",h))]}return[m(r)+"="+m(String(v))]}var b=[];if(typeof v>"u")return b;var O;if(i==="comma"&&On(v))_&&u&&(v=$m.maybeMap(v,function(pe){return pe==null?pe:u(pe)})),O=[{value:v.length>0?v.join(",")||null:void 0}];else if(On(l))O=l;else{var A=Object.keys(v);O=f?A.sort(f):A}var P=c?String(r).replace(/\./g,"%2E"):String(r),D=n&&On(v)&&v.length===1?P+"[]":P;if(o&&On(v)&&v.length===0)return D+"[]";for(var V=0;V<O.length;++V){var $=O[V],U=typeof $=="object"&&$&&typeof $.value<"u"?$.value:v[$];if(!(a&&U===null)){var Z=p&&c?String($).replace(/\./g,"%2E"):String($),J=On(v)?typeof i=="function"?i(D,Z):D:D+(p?"."+Z:"["+Z+"]");S.set(t,y);var j=M4();j.set(Xk,S),F4(b,e(U,J,i,n,o,s,a,c,i==="comma"&&_&&On(v)?null:u,l,f,p,d,h,m,_,k,j))}}return b},Vue=function(t){if(!t)return Pt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=t.charset||Pt.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=jl.default;if(typeof t.format<"u"){if(!zue.call(jl.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var n=jl.formatters[i],o=Pt.filter;(typeof t.filter=="function"||On(t.filter))&&(o=t.filter);var s;if(t.arrayFormat in L4?s=t.arrayFormat:"indices"in t?s=t.indices?"indices":"repeat":s=Pt.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var a=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:Pt.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Pt.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Pt.allowEmptyArrays,arrayFormat:s,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Pt.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Pt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Pt.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Pt.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Pt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Pt.encodeValuesOnly,filter:o,format:i,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Pt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Pt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Pt.strictNullHandling}};z4.exports=function(e,t){var r=e,i=Vue(t),n,o;typeof i.filter=="function"?(o=i.filter,r=o("",r)):On(i.filter)&&(o=i.filter,n=o);var s=[];if(typeof r!="object"||r===null)return"";var a=L4[i.arrayFormat],c=a==="comma"&&i.commaRoundTrip;n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var u=M4(),l=0;l<n.length;++l){var f=n[l];if(!(typeof f>"u"||f===null)){var p=r[f];i.skipNulls&&p===null||F4(s,Hue(p,f,a,c,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,u))}}var d=s.join(i.delimiter),h=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B"+i.delimiter:h+="utf8=%E2%9C%93"+i.delimiter),d.length>0?h+d:""}});var H4=w((WOe,W4)=>{"use strict";var Cn=Kk(),Rm=Object.prototype.hasOwnProperty,Jk=Array.isArray,gt={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Cn.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},Zue=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},B4=function(e,t,r,i){if(e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1){if(i&&t.throwOnLimitExceeded)for(var n=0,o=e.indexOf(",");o>-1;){if(n+=1,n>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");o=e.indexOf(",",o+1)}return e.split(",")}if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return e},Gue="utf8=%26%2310003%3B",Kue="utf8=%E2%9C%93",Xue=function(t,r){var i={__proto__:null},n=r.ignoreQueryPrefix?t.replace(/^\?/,""):t;n=n.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var o=r.parameterLimit===1/0?void 0:r.parameterLimit,s=n.split(r.delimiter,r.throwOnLimitExceeded&&typeof o<"u"?o+1:o);if(r.throwOnLimitExceeded&&typeof o<"u"&&s.length>o)throw new RangeError("Parameter limit exceeded. Only "+o+" parameter"+(o===1?"":"s")+" allowed.");var a=-1,c,u=r.charset;if(r.charsetSentinel)for(c=0;c<s.length;++c)s[c].indexOf("utf8=")===0&&(s[c]===Kue?u="utf-8":s[c]===Gue&&(u="iso-8859-1"),a=c,c=s.length);for(c=0;c<s.length;++c)if(c!==a){var l=s[c],f=l.indexOf("]="),p=f===-1?l.indexOf("="):f+1,d,h;if(p===-1?(d=r.decoder(l,gt.decoder,u,"key"),h=r.strictNullHandling?null:""):(d=r.decoder(l.slice(0,p),gt.decoder,u,"key"),d!==null&&(h=Cn.maybeMap(B4(l.slice(p+1),r,Jk(i[d])?i[d].length:0,l.indexOf("[]=")===-1),function(_){return r.decoder(_,gt.decoder,u,"value")}))),h&&r.interpretNumericEntities&&u==="iso-8859-1"&&(h=Zue(String(h))),l.indexOf("[]=")>-1&&(h=Jk(h)?[h]:h),r.comma&&Jk(h)&&h.length>r.arrayLimit&&(h=Cn.combine([],h,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded)),d!==null){var m=Rm.call(i,d);m&&(r.duplicates==="combine"||l.indexOf("[]=")>-1)?i[d]=Cn.combine(i[d],h,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded):(!m||r.duplicates==="last")&&(i[d]=h)}}return i},Jue=function(e,t,r,i){var n=0;if(e.length>0&&e[e.length-1]==="[]"){var o=e.slice(0,-1).join("");n=Array.isArray(t)&&t[o]?t[o].length:0}for(var s=i?t:B4(t,r,n),a=e.length-1;a>=0;--a){var c,u=e[a];if(u==="[]"&&r.parseArrays)Cn.isOverflow(s)?c=s:c=r.allowEmptyArrays&&(s===""||r.strictNullHandling&&s===null)?[]:Cn.combine([],s,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded);else{c=r.plainObjects?{__proto__:null}:{};var l=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,f=r.decodeDotInKeys?l.replace(/%2E/g,"."):l,p=parseInt(f,10),d=!isNaN(p)&&u!==f&&String(p)===f&&p>=0&&r.parseArrays;if(!r.parseArrays&&f==="")c={0:s};else if(d&&p<r.arrayLimit)c=[],c[p]=s;else{if(d&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");d?(c[p]=s,Cn.markOverflow(c,p)):f!=="__proto__"&&(c[f]=s)}}s=c}return s},Yue=function(t,r){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(r.depth<=0)return!r.plainObjects&&Rm.call(Object.prototype,i)&&!r.allowPrototypes?void 0:[i];var n=[],o=i.indexOf("["),s=o>=0?i.slice(0,o):i;if(s){if(!r.plainObjects&&Rm.call(Object.prototype,s)&&!r.allowPrototypes)return;n[n.length]=s}for(var a=i.length,c=o,u=0;c>=0&&u<r.depth;){for(var l=1,f=c+1,p=-1;f<a&&p<0;){var d=i.charCodeAt(f);d===91?l+=1:d===93&&(l-=1,l===0&&(p=f)),f+=1}if(p<0)return n[n.length]="["+i.slice(c)+"]",n;var h=i.slice(c,p+1),m=h.slice(1,-1);if(!r.plainObjects&&Rm.call(Object.prototype,m)&&!r.allowPrototypes)return;n[n.length]=h,u+=1,c=i.indexOf("[",p+1)}if(c>=0){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");n[n.length]="["+i.slice(c)+"]"}return n},Que=function(t,r,i,n){if(t){var o=Yue(t,i);if(o)return Jue(o,r,i,n)}},ele=function(t){if(!t)return gt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof t.charset>"u"?gt.charset:t.charset,i=typeof t.duplicates>"u"?gt.duplicates:t.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var n=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:gt.allowDots:!!t.allowDots;return{allowDots:n,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:gt.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:gt.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:gt.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:gt.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:gt.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:gt.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:gt.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:gt.decoder,delimiter:typeof t.delimiter=="string"||Cn.isRegExp(t.delimiter)?t.delimiter:gt.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:gt.depth,duplicates:i,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:gt.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:gt.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:gt.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:gt.strictDepth,strictMerge:typeof t.strictMerge=="boolean"?!!t.strictMerge:gt.strictMerge,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:gt.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}};W4.exports=function(e,t){var r=ele(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?{__proto__:null}:{};for(var i=typeof e=="string"?Xue(e,r):e,n=r.plainObjects?{__proto__:null}:{},o=Object.keys(i),s=0;s<o.length;++s){var a=o[s],c=Que(a,i[a],r,typeof e=="string");n=Cn.merge(n,c,r)}return r.allowSparse===!0?n:Cn.compact(n)}});var Yk=w((HOe,V4)=>{"use strict";var tle=U4(),rle=H4(),nle=Om();V4.exports={formats:nle,parse:rle,stringify:tle}});var G4=w((VOe,Z4)=>{"use strict";var ile=B("os"),ole={15:"El Capitan",14:"Yosemite",13:"Mavericks",12:"Mountain Lion",11:"Lion",10:"Snow Leopard",9:"Leopard",8:"Tiger",7:"Panther",6:"Jaguar",5:"Puma"};Z4.exports=function(e){return e=(e||ile.release()).split(".")[0],{name:ole[e],version:"10."+(Number(e)-4)}}});var f6=w((xe,l6)=>{xe=l6.exports=je;var Xe;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?Xe=function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:Xe=function(){};xe.SEMVER_SPEC_VERSION="2.0.0";var Ml=256,Dm=Number.MAX_SAFE_INTEGER||9007199254740991,Qk=16,sle=Ml-6,Ll=xe.re=[],ot=xe.safeRe=[],se=xe.src=[],qe=0,iT="[a-zA-Z0-9-]",eT=[["\\s",1],["\\d",Ml],[iT,sle]];function Lm(e){for(var t=0;t<eT.length;t++){var r=eT[t][0],i=eT[t][1];e=e.split(r+"*").join(r+"{0,"+i+"}").split(r+"+").join(r+"{1,"+i+"}")}return e}var cc=qe++;se[cc]="0|[1-9]\\d*";var uc=qe++;se[uc]="\\d+";var oT=qe++;se[oT]="\\d*[a-zA-Z-]"+iT+"*";var X4=qe++;se[X4]="("+se[cc]+")\\.("+se[cc]+")\\.("+se[cc]+")";var J4=qe++;se[J4]="("+se[uc]+")\\.("+se[uc]+")\\.("+se[uc]+")";var tT=qe++;se[tT]="(?:"+se[cc]+"|"+se[oT]+")";var rT=qe++;se[rT]="(?:"+se[uc]+"|"+se[oT]+")";var sT=qe++;se[sT]="(?:-("+se[tT]+"(?:\\."+se[tT]+")*))";var aT=qe++;se[aT]="(?:-?("+se[rT]+"(?:\\."+se[rT]+")*))";var nT=qe++;se[nT]=iT+"+";var zl=qe++;se[zl]="(?:\\+("+se[nT]+"(?:\\."+se[nT]+")*))";var cT=qe++,Y4="v?"+se[X4]+se[sT]+"?"+se[zl]+"?";se[cT]="^"+Y4+"$";var uT="[v=\\s]*"+se[J4]+se[aT]+"?"+se[zl]+"?",lT=qe++;se[lT]="^"+uT+"$";var hc=qe++;se[hc]="((?:<|>)?=?)";var Nm=qe++;se[Nm]=se[uc]+"|x|X|\\*";var Pm=qe++;se[Pm]=se[cc]+"|x|X|\\*";var Yo=qe++;se[Yo]="[v=\\s]*("+se[Pm]+")(?:\\.("+se[Pm]+")(?:\\.("+se[Pm]+")(?:"+se[sT]+")?"+se[zl]+"?)?)?";var fc=qe++;se[fc]="[v=\\s]*("+se[Nm]+")(?:\\.("+se[Nm]+")(?:\\.("+se[Nm]+")(?:"+se[aT]+")?"+se[zl]+"?)?)?";var Q4=qe++;se[Q4]="^"+se[hc]+"\\s*"+se[Yo]+"$";var e6=qe++;se[e6]="^"+se[hc]+"\\s*"+se[fc]+"$";var t6=qe++;se[t6]="(?:^|[^\\d])(\\d{1,"+Qk+"})(?:\\.(\\d{1,"+Qk+"}))?(?:\\.(\\d{1,"+Qk+"}))?(?:$|[^\\d])";var Fm=qe++;se[Fm]="(?:~>?)";var dc=qe++;se[dc]="(\\s*)"+se[Fm]+"\\s+";Ll[dc]=new RegExp(se[dc],"g");ot[dc]=new RegExp(Lm(se[dc]),"g");var ale="$1~",r6=qe++;se[r6]="^"+se[Fm]+se[Yo]+"$";var n6=qe++;se[n6]="^"+se[Fm]+se[fc]+"$";var zm=qe++;se[zm]="(?:\\^)";var pc=qe++;se[pc]="(\\s*)"+se[zm]+"\\s+";Ll[pc]=new RegExp(se[pc],"g");ot[pc]=new RegExp(Lm(se[pc]),"g");var cle="$1^",i6=qe++;se[i6]="^"+se[zm]+se[Yo]+"$";var o6=qe++;se[o6]="^"+se[zm]+se[fc]+"$";var fT=qe++;se[fT]="^"+se[hc]+"\\s*("+uT+")$|^$";var dT=qe++;se[dT]="^"+se[hc]+"\\s*("+Y4+")$|^$";var Qo=qe++;se[Qo]="(\\s*)"+se[hc]+"\\s*("+uT+"|"+se[Yo]+")";Ll[Qo]=new RegExp(se[Qo],"g");ot[Qo]=new RegExp(Lm(se[Qo]),"g");var ule="$1$2$3",s6=qe++;se[s6]="^\\s*("+se[Yo]+")\\s+-\\s+("+se[Yo]+")\\s*$";var a6=qe++;se[a6]="^\\s*("+se[fc]+")\\s+-\\s+("+se[fc]+")\\s*$";var c6=qe++;se[c6]="(<|>)?=?\\s*\\*";for(An=0;An<qe;An++)Xe(An,se[An]),Ll[An]||(Ll[An]=new RegExp(se[An]),ot[An]=new RegExp(Lm(se[An])));var An;xe.parse=es;function es(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof je)return e;if(typeof e!="string"||e.length>Ml)return null;var r=t.loose?ot[lT]:ot[cT];if(!r.test(e))return null;try{return new je(e,t)}catch{return null}}xe.valid=lle;function lle(e,t){var r=es(e,t);return r?r.version:null}xe.clean=fle;function fle(e,t){var r=es(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}xe.SemVer=je;function je(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof je){if(e.loose===t.loose)return e;e=e.version}else if(typeof e!="string")throw new TypeError("Invalid Version: "+e);if(e.length>Ml)throw new TypeError("version is longer than "+Ml+" characters");if(!(this instanceof je))return new je(e,t);Xe("SemVer",e,t),this.options=t,this.loose=!!t.loose;var r=e.trim().match(t.loose?ot[lT]:ot[cT]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Dm||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Dm||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Dm||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(i){if(/^[0-9]+$/.test(i)){var n=+i;if(n>=0&&n<Dm)return n}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}je.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version};je.prototype.toString=function(){return this.version};je.prototype.compare=function(e){return Xe("SemVer.compare",this.version,this.options,e),e instanceof je||(e=new je(e,this.options)),this.compareMain(e)||this.comparePre(e)};je.prototype.compareMain=function(e){return e instanceof je||(e=new je(e,this.options)),lc(this.major,e.major)||lc(this.minor,e.minor)||lc(this.patch,e.patch)};je.prototype.comparePre=function(e){if(e instanceof je||(e=new je(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],i=e.prerelease[t];if(Xe("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return lc(r,i)}while(++t)};je.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this};xe.inc=dle;function dle(e,t,r,i){typeof r=="string"&&(i=r,r=void 0);try{return new je(e,r).inc(t,i).version}catch{return null}}xe.diff=ple;function ple(e,t){if(pT(e,t))return null;var r=es(e),i=es(t),n="";if(r.prerelease.length||i.prerelease.length){n="pre";var o="prerelease"}for(var s in r)if((s==="major"||s==="minor"||s==="patch")&&r[s]!==i[s])return n+s;return o}xe.compareIdentifiers=lc;var K4=/^[0-9]+$/;function lc(e,t){var r=K4.test(e),i=K4.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1}xe.rcompareIdentifiers=hle;function hle(e,t){return lc(t,e)}xe.major=mle;function mle(e,t){return new je(e,t).major}xe.minor=gle;function gle(e,t){return new je(e,t).minor}xe.patch=yle;function yle(e,t){return new je(e,t).patch}xe.compare=ai;function ai(e,t,r){return new je(e,r).compare(new je(t,r))}xe.compareLoose=vle;function vle(e,t){return ai(e,t,!0)}xe.rcompare=ble;function ble(e,t,r){return ai(t,e,r)}xe.sort=_le;function _le(e,t){return e.sort(function(r,i){return xe.compare(r,i,t)})}xe.rsort=wle;function wle(e,t){return e.sort(function(r,i){return xe.rcompare(r,i,t)})}xe.gt=Fl;function Fl(e,t,r){return ai(e,t,r)>0}xe.lt=qm;function qm(e,t,r){return ai(e,t,r)<0}xe.eq=pT;function pT(e,t,r){return ai(e,t,r)===0}xe.neq=u6;function u6(e,t,r){return ai(e,t,r)!==0}xe.gte=hT;function hT(e,t,r){return ai(e,t,r)>=0}xe.lte=mT;function mT(e,t,r){return ai(e,t,r)<=0}xe.cmp=jm;function jm(e,t,r,i){switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return pT(e,r,i);case"!=":return u6(e,r,i);case">":return Fl(e,r,i);case">=":return hT(e,r,i);case"<":return qm(e,r,i);case"<=":return mT(e,r,i);default:throw new TypeError("Invalid operator: "+t)}}xe.Comparator=Br;function Br(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof Br){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof Br))return new Br(e,t);e=e.trim().split(/\s+/).join(" "),Xe("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ul?this.value="":this.value=this.operator+this.semver.version,Xe("comp",this)}var Ul={};Br.prototype.parse=function(e){var t=this.options.loose?ot[fT]:ot[dT],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new je(r[2],this.options.loose):this.semver=Ul};Br.prototype.toString=function(){return this.value};Br.prototype.test=function(e){return Xe("Comparator.test",e,this.options.loose),this.semver===Ul?!0:(typeof e=="string"&&(e=new je(e,this.options)),jm(e,this.operator,this.semver,this.options))};Br.prototype.intersects=function(e,t){if(!(e instanceof Br))throw new TypeError("a Comparator is required");(!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1});var r;if(this.operator==="")return r=new yt(e.value,t),Mm(this.value,r,t);if(e.operator==="")return r=new yt(this.value,t),Mm(e.semver,r,t);var i=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),n=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),o=this.semver.version===e.semver.version,s=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),a=jm(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),c=jm(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return i||n||o&&s||a||c};xe.Range=yt;function yt(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof yt)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new yt(e.raw,t);if(e instanceof Br)return new yt(e.value,t);if(!(this instanceof yt))return new yt(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}yt.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range};yt.prototype.toString=function(){return this.range};yt.prototype.parseRange=function(e){var t=this.options.loose,r=t?ot[a6]:ot[s6];e=e.replace(r,$le),Xe("hyphen replace",e),e=e.replace(ot[Qo],ule),Xe("comparator trim",e,ot[Qo]),e=e.replace(ot[dc],ale),e=e.replace(ot[pc],cle);var i=t?ot[fT]:ot[dT],n=e.split(" ").map(function(o){return Sle(o,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(n=n.filter(function(o){return!!o.match(i)})),n=n.map(function(o){return new Br(o,this.options)},this),n};yt.prototype.intersects=function(e,t){if(!(e instanceof yt))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(i){return e.set.some(function(n){return n.every(function(o){return i.intersects(o,t)})})})})};xe.toComparators=xle;function xle(e,t){return new yt(e,t).set.map(function(r){return r.map(function(i){return i.value}).join(" ").trim().split(" ")})}function Sle(e,t){return Xe("comp",e,t),e=Tle(e,t),Xe("caret",e),e=Ele(e,t),Xe("tildes",e),e=Ole(e,t),Xe("xrange",e),e=Ale(e,t),Xe("stars",e),e}function mr(e){return!e||e.toLowerCase()==="x"||e==="*"}function Ele(e,t){return e.trim().split(/\s+/).map(function(r){return kle(r,t)}).join(" ")}function kle(e,t){var r=t.loose?ot[n6]:ot[r6];return e.replace(r,function(i,n,o,s,a){Xe("tilde",e,i,n,o,s,a);var c;return mr(n)?c="":mr(o)?c=">="+n+".0.0 <"+(+n+1)+".0.0":mr(s)?c=">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":a?(Xe("replaceTilde pr",a),c=">="+n+"."+o+"."+s+"-"+a+" <"+n+"."+(+o+1)+".0"):c=">="+n+"."+o+"."+s+" <"+n+"."+(+o+1)+".0",Xe("tilde return",c),c})}function Tle(e,t){return e.trim().split(/\s+/).map(function(r){return Ile(r,t)}).join(" ")}function Ile(e,t){Xe("caret",e,t);var r=t.loose?ot[o6]:ot[i6];return e.replace(r,function(i,n,o,s,a){Xe("caret",e,i,n,o,s,a);var c;return mr(n)?c="":mr(o)?c=">="+n+".0.0 <"+(+n+1)+".0.0":mr(s)?n==="0"?c=">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":c=">="+n+"."+o+".0 <"+(+n+1)+".0.0":a?(Xe("replaceCaret pr",a),n==="0"?o==="0"?c=">="+n+"."+o+"."+s+"-"+a+" <"+n+"."+o+"."+(+s+1):c=">="+n+"."+o+"."+s+"-"+a+" <"+n+"."+(+o+1)+".0":c=">="+n+"."+o+"."+s+"-"+a+" <"+(+n+1)+".0.0"):(Xe("no pr"),n==="0"?o==="0"?c=">="+n+"."+o+"."+s+" <"+n+"."+o+"."+(+s+1):c=">="+n+"."+o+"."+s+" <"+n+"."+(+o+1)+".0":c=">="+n+"."+o+"."+s+" <"+(+n+1)+".0.0"),Xe("caret return",c),c})}function Ole(e,t){return Xe("replaceXRanges",e,t),e.split(/\s+/).map(function(r){return Cle(r,t)}).join(" ")}function Cle(e,t){e=e.trim();var r=t.loose?ot[e6]:ot[Q4];return e.replace(r,function(i,n,o,s,a,c){Xe("xRange",e,i,n,o,s,a,c);var u=mr(o),l=u||mr(s),f=l||mr(a),p=f;return n==="="&&p&&(n=""),u?n===">"||n==="<"?i="<0.0.0":i="*":n&&p?(l&&(s=0),a=0,n===">"?(n=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):n==="<="&&(n="<",l?o=+o+1:s=+s+1),i=n+o+"."+s+"."+a):l?i=">="+o+".0.0 <"+(+o+1)+".0.0":f&&(i=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0"),Xe("xRange return",i),i})}function Ale(e,t){return Xe("replaceStars",e,t),e.trim().replace(ot[c6],"")}function $le(e,t,r,i,n,o,s,a,c,u,l,f,p){return mr(r)?t="":mr(i)?t=">="+r+".0.0":mr(n)?t=">="+r+"."+i+".0":t=">="+t,mr(c)?a="":mr(u)?a="<"+(+c+1)+".0.0":mr(l)?a="<"+c+"."+(+u+1)+".0":f?a="<="+c+"."+u+"."+l+"-"+f:a="<="+a,(t+" "+a).trim()}yt.prototype.test=function(e){if(!e)return!1;typeof e=="string"&&(e=new je(e,this.options));for(var t=0;t<this.set.length;t++)if(Rle(this.set[t],e,this.options))return!0;return!1};function Rle(e,t,r){for(var i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(i=0;i<e.length;i++)if(Xe(e[i].semver),e[i].semver!==Ul&&e[i].semver.prerelease.length>0){var n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}xe.satisfies=Mm;function Mm(e,t,r){try{t=new yt(t,r)}catch{return!1}return t.test(e)}xe.maxSatisfying=Dle;function Dle(e,t,r){var i=null,n=null;try{var o=new yt(t,r)}catch{return null}return e.forEach(function(s){o.test(s)&&(!i||n.compare(s)===-1)&&(i=s,n=new je(i,r))}),i}xe.minSatisfying=Nle;function Nle(e,t,r){var i=null,n=null;try{var o=new yt(t,r)}catch{return null}return e.forEach(function(s){o.test(s)&&(!i||n.compare(s)===1)&&(i=s,n=new je(i,r))}),i}xe.minVersion=Ple;function Ple(e,t){e=new yt(e,t);var r=new je("0.0.0");if(e.test(r)||(r=new je("0.0.0-0"),e.test(r)))return r;r=null;for(var i=0;i<e.set.length;++i){var n=e.set[i];n.forEach(function(o){var s=new je(o.semver.version);switch(o.operator){case">":s.prerelease.length===0?s.patch++:s.prerelease.push(0),s.raw=s.format();case"":case">=":(!r||Fl(r,s))&&(r=s);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+o.operator)}})}return r&&e.test(r)?r:null}xe.validRange=qle;function qle(e,t){try{return new yt(e,t).range||"*"}catch{return null}}xe.ltr=jle;function jle(e,t,r){return gT(e,t,"<",r)}xe.gtr=Mle;function Mle(e,t,r){return gT(e,t,">",r)}xe.outside=gT;function gT(e,t,r,i){e=new je(e,i),t=new yt(t,i);var n,o,s,a,c;switch(r){case">":n=Fl,o=mT,s=qm,a=">",c=">=";break;case"<":n=qm,o=hT,s=Fl,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Mm(e,t,i))return!1;for(var u=0;u<t.set.length;++u){var l=t.set[u],f=null,p=null;if(l.forEach(function(d){d.semver===Ul&&(d=new Br(">=0.0.0")),f=f||d,p=p||d,n(d.semver,f.semver,i)?f=d:s(d.semver,p.semver,i)&&(p=d)}),f.operator===a||f.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}xe.prerelease=Lle;function Lle(e,t){var r=es(e,t);return r&&r.prerelease.length?r.prerelease:null}xe.intersects=Fle;function Fle(e,t,r){return e=new yt(e,r),t=new yt(t,r),e.intersects(t)}xe.coerce=zle;function zle(e){if(e instanceof je)return e;if(typeof e!="string")return null;var t=e.match(ot[t6]);return t==null?null:es(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}});var p6=w((ZOe,d6)=>{"use strict";var Ule=B("os"),Ble=f6(),Wle={"10.0":"10","6.3":"8.1","6.2":"8","6.1":"7","6.0":"Vista","5.1":"XP","5.0":"2000","4.9":"ME","4.1":"98","4.0":"95"};d6.exports=function(e){var t=/\d+\.\d+/,r=t.exec(e||Ule.release());if(!e&&process.platform==="win32"&&Ble.satisfies(process.version,">=0.12.0 <3.1.0"))try{r=t.exec(String(B("child_process").execSync("ver.exe",{timeout:2e3})))}catch{}if(e&&!r)throw new Error("`release` argument doesn't match `n.n`");return Wle[(r||[])[0]]}});var g6=w((GOe,m6)=>{"use strict";var h6=B("os"),Hle=G4(),Vle=p6();m6.exports=function(e,t){if(!e&&t)throw new Error("You can't specify a `release` without specfying `platform`");e=e||h6.platform(),t=t||h6.release();var r;return e==="darwin"?(r=Hle(t).name,"OS X"+(r?" "+r:"")):e==="linux"?(r=t.replace(/^(\d+\.\d+).*/,"$1"),"Linux"+(r?" "+r:"")):e==="win32"?(r=Vle(t),"Windows"+(r?" "+r:"")):e}});var b6=w((KOe,v6)=>{"use strict";var Zle=g6(),y6="Node.js/"+process.version.slice(1)+" ("+Zle()+"; "+process.arch+")";v6.exports=function(t,r){return arguments.length!==2?y6:t+"/"+r+" "+y6}});var x6=w((XOe,w6)=>{var _6=B("crypto"),Gle=/(\w+)=["']?([^'"]{1,10000})["']?/,Kle=0,Xle="00000000";function yT(e){return _6.createHash("md5").update(e).digest("hex")}function Jle(e,t,r,i){let n=r.split(","),o={};for(let h=0;h<n.length;h++){let m=Gle.exec(n[h]);m&&(o[m[1]]=m[2].replace(/["']/g,""))}if(!o.realm||!o.nonce)return"";let s=o.qop||"";i=i.split(":");let a=String(++Kle);a=Xle.substring(a.length)+a;let c=_6.randomBytes(8).toString("hex"),u=yT(i[0]+":"+o.realm+":"+i[1]),l=yT(e.toUpperCase()+":"+t),f=u+":"+o.nonce;s&&(s=s.split(",")[0],f+=":"+a+":"+c+":"+s),f+=":"+l;let p=yT(f),d='Digest username="'+i[0]+'", realm="'+o.realm+'", nonce="'+o.nonce+'", uri="'+t+'", response="'+p+'"';return o.opaque&&(d+=', opaque="'+o.opaque+'"'),s&&(d+=", qop="+s+", nc="+a+', cnonce="'+c+'"'),d}w6.exports=Jle});var S6=w((JOe,Yle)=>{Yle.exports={"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","306":"(Unused)","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Unordered Collection","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}});var T6=w((YOe,k6)=>{"use strict";var E6=S6();k6.exports=$n;$n.STATUS_CODES=E6;$n.codes=Qle($n,E6);$n.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0};$n.empty={204:!0,205:!0,304:!0};$n.retry={502:!0,503:!0,504:!0};function Qle(e,t){var r=[];return Object.keys(t).forEach(function(n){var o=t[n],s=Number(n);e[s]=o,e[o]=s,e[o.toLowerCase()]=s,r.push(s)}),r}function $n(e){if(typeof e=="number"){if(!$n[e])throw new Error("invalid status code: "+e);return e}if(typeof e!="string")throw new TypeError("code must be a number or string");var t=parseInt(e,10);if(!isNaN(t)){if(!$n[t])throw new Error("invalid status code: "+t);return t}if(t=$n[e.toLowerCase()],!t)throw new Error('invalid status message: "'+e+'"');return t}});var A6=w(vT=>{"use strict";var I6=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,efe=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,O6=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,tfe=/\\([\u000b\u0020-\u00ff])/g,rfe=/([\\"])/g,C6=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;vT.format=nfe;vT.parse=ife;function nfe(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!C6.test(r))throw new TypeError("invalid type");var i=r;if(t&&typeof t=="object")for(var n,o=Object.keys(t).sort(),s=0;s<o.length;s++){if(n=o[s],!O6.test(n))throw new TypeError("invalid parameter name");i+="; "+n+"="+sfe(t[n])}return i}function ife(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?ofe(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),i=r!==-1?t.slice(0,r).trim():t.trim();if(!C6.test(i))throw new TypeError("invalid media type");var n=new afe(i.toLowerCase());if(r!==-1){var o,s,a;for(I6.lastIndex=r;s=I6.exec(t);){if(s.index!==r)throw new TypeError("invalid parameter format");r+=s[0].length,o=s[1].toLowerCase(),a=s[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(tfe,"$1"))),n.parameters[o]=a}if(r!==t.length)throw new TypeError("invalid parameter format")}return n}function ofe(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function sfe(e){var t=String(e);if(O6.test(t))return t;if(t.length>0&&!efe.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(rfe,"\\$1")+'"'}function afe(e){this.parameters=Object.create(null),this.type=e}});var R6=w((eCe,$6)=>{"use strict";$6.exports=cfe;function cfe(e,t){if(!Array.isArray(e))throw new TypeError("arg must be an array of [ee, events...] arrays");for(var r=[],i=0;i<e.length;i++){var n=e[i];if(!Array.isArray(n)||n.length<2)throw new TypeError("each array member must be [ee, events...]");for(var o=n[0],s=1;s<n.length;s++){var a=n[s],c=ufe(a,u);o.on(a,c),r.push({ee:o,event:a,fn:c})}}function u(){l(),t.apply(null,arguments)}function l(){for(var p,d=0;d<r.length;d++)p=r[d],p.ee.removeListener(p.event,p.fn)}function f(p){t=p}return f.cancel=l,f}function ufe(e,t){return function(i){for(var n=new Array(arguments.length),o=this,s=e==="error"?i:null,a=0;a<n.length;a++)n[a]=arguments[a];t(s,o,e,n)}}});var P6=w((tCe,N6)=>{N6.exports=D6;function D6(e,t){if(e&&t)return D6(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(i){r[i]=e[i]}),r;function r(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];var o=e.apply(this,i),s=i[i.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(a){o[a]=s[a]}),o}}});var _T=w((rCe,bT)=>{var q6=P6();bT.exports=q6(Um);bT.exports.strict=q6(j6);Um.proto=Um(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Um(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return j6(this)},configurable:!0})});function Um(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function j6(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}});var F6=w((nCe,L6)=>{var lfe=_T(),ffe=function(){},dfe=global.Bare?queueMicrotask:process.nextTick.bind(process),pfe=function(e){return e.setHeader&&typeof e.abort=="function"},hfe=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},M6=function(e,t,r){if(typeof t=="function")return M6(e,null,t);t||(t={}),r=lfe(r||ffe);var i=e._writableState,n=e._readableState,o=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,a=!1,c=function(){e.writable||u()},u=function(){s=!1,o||r.call(e)},l=function(){o=!1,s||r.call(e)},f=function(_){r.call(e,_?new Error("exited with error code: "+_):null)},p=function(_){r.call(e,_)},d=function(){dfe(h)},h=function(){if(!a){if(o&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"));if(s&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"))}},m=function(){e.req.on("finish",u)};return pfe(e)?(e.on("complete",u),e.on("abort",d),e.req?m():e.on("request",m)):s&&!i&&(e.on("end",c),e.on("close",c)),hfe(e)&&e.on("exit",f),e.on("end",l),e.on("finish",u),t.error!==!1&&e.on("error",p),e.on("close",d),function(){a=!0,e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",m),e.req&&e.req.removeListener("finish",u),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",u),e.removeListener("exit",f),e.removeListener("end",l),e.removeListener("error",p),e.removeListener("close",d)}};L6.exports=M6});var wT=w((iCe,U6)=>{var mfe=_T(),gfe=F6(),Bm;try{Bm=B("fs")}catch{}var Bl=function(){},yfe=typeof process>"u"?!1:/^v?\.0/.test(process.version),Wm=function(e){return typeof e=="function"},vfe=function(e){return!yfe||!Bm?!1:(e instanceof(Bm.ReadStream||Bl)||e instanceof(Bm.WriteStream||Bl))&&Wm(e.close)},bfe=function(e){return e.setHeader&&Wm(e.abort)},_fe=function(e,t,r,i){i=mfe(i);var n=!1;e.on("close",function(){n=!0}),gfe(e,{readable:t,writable:r},function(s){if(s)return i(s);n=!0,i()});var o=!1;return function(s){if(!n&&!o){if(o=!0,vfe(e))return e.close(Bl);if(bfe(e))return e.abort();if(Wm(e.destroy))return e.destroy();i(s||new Error("stream was destroyed"))}}},z6=function(e){e()},wfe=function(e,t){return e.pipe(t)},xfe=function(){var e=Array.prototype.slice.call(arguments),t=Wm(e[e.length-1]||Bl)&&e.pop()||Bl;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,i=e.map(function(n,o){var s=o<e.length-1,a=o>0;return _fe(n,s,a,function(c){r||(r=c),c&&i.forEach(z6),!s&&(i.forEach(z6),t(r))})});return e.reduce(wfe)};U6.exports=xfe});var H6=w((B6,W6)=>{var Sfe=B("stream");B6=W6.exports=xT;xT.through=xT;function xT(e,t,r){e=e||function(l){this.queue(l)},t=t||function(){this.queue(null)};var i=!1,n=!1,o=[],s=!1,a=new Sfe;a.readable=a.writable=!0,a.paused=!1,a.autoDestroy=!(r&&r.autoDestroy===!1),a.write=function(l){return e.call(this,l),!a.paused};function c(){for(;o.length&&!a.paused;){var l=o.shift();if(l===null)return a.emit("end");a.emit("data",l)}}a.queue=a.push=function(l){return s||(l===null&&(s=!0),o.push(l),c()),a},a.on("end",function(){a.readable=!1,!a.writable&&a.autoDestroy&&process.nextTick(function(){a.destroy()})});function u(){a.writable=!1,t.call(a),!a.readable&&a.autoDestroy&&a.destroy()}return a.end=function(l){if(!i)return i=!0,arguments.length&&a.write(l),u(),a},a.destroy=function(){if(!n)return n=!0,i=!0,o.length=0,a.writable=a.readable=!1,a.emit("close"),a},a.pause=function(){if(!a.paused)return a.paused=!0,a},a.resume=function(){return a.paused&&(a.paused=!1,a.emit("resume")),c(),a.paused||a.emit("drain"),a},a}});var Z6=w((oCe,V6)=>{V6.exports=H6()});var K6=w((sCe,G6)=>{"use strict";function Hm(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e<arguments.length;e++)this.define(arguments[e]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}Hm.prototype.define=function(e,t){for(let r in e){let i=e[r].map(function(n){return n.toLowerCase()});r=r.toLowerCase();for(let n=0;n<i.length;n++){let o=i[n];if(o[0]!=="*"){if(!t&&o in this._types)throw new Error('Attempt to change mapping for "'+o+'" extension from "'+this._types[o]+'" to "'+r+'". Pass `force=true` to allow this, otherwise remove "'+o+'" from the list of extensions for "'+r+'".');this._types[o]=r}}if(t||!this._extensions[r]){let n=i[0];this._extensions[r]=n[0]!=="*"?n:n.substr(1)}}};Hm.prototype.getType=function(e){e=String(e);let t=e.replace(/^.*[/\\]/,"").toLowerCase(),r=t.replace(/^.*\./,"").toLowerCase(),i=t.length<e.length;return(r.length<t.length-1||!i)&&this._types[r]||null};Hm.prototype.getExtension=function(e){return e=/^\s*([^;\s]*)/.test(e)&&RegExp.$1,e&&this._extensions[e.toLowerCase()]||null};G6.exports=Hm});var J6=w((aCe,X6)=>{X6.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}});var Q6=w((cCe,Y6)=>{Y6.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}});var Wl=w((uCe,eB)=>{"use strict";var Efe=K6();eB.exports=new Efe(J6(),Q6())});var nB=w((lCe,rB)=>{"use strict";var kfe=B("events").EventEmitter,Tfe=B("fs").ReadStream,tB=B("stream"),ts=B("zlib");rB.exports=Ife;function Ife(e,t){return Dfe(e)?Ofe(e):Nfe(e)?Afe(e):$fe(e)&&e.destroy(),Rfe(e)&&t&&(e.removeAllListeners("error"),e.addListener("error",Pfe)),e}function Ofe(e){e.destroy(),typeof e.close=="function"&&e.on("open",jfe)}function Cfe(e){if(e._hadError===!0){var t=e._binding===null?"_binding":"_handle";e[t]={close:function(){this[t]=null}}}e.close()}function Afe(e){typeof e.destroy=="function"?e._binding?(e.destroy(),e._processing?(e._needDrain=!0,e.once("drain",qfe)):e._binding.clear()):e._destroy&&e._destroy!==tB.Transform.prototype._destroy?e.destroy():e._destroy&&typeof e.close=="function"?(e.destroyed=!0,e.close()):e.destroy():typeof e.close=="function"&&Cfe(e)}function $fe(e){return e instanceof tB&&typeof e.destroy=="function"}function Rfe(e){return e instanceof kfe}function Dfe(e){return e instanceof Tfe}function Nfe(e){return e instanceof ts.Gzip||e instanceof ts.Gunzip||e instanceof ts.Deflate||e instanceof ts.DeflateRaw||e instanceof ts.Inflate||e instanceof ts.InflateRaw||e instanceof ts.Unzip}function Pfe(){}function qfe(){this._binding.clear()}function jfe(){typeof this.fd=="number"&&this.close()}});var sB=w((fCe,oB)=>{"use strict";var iB=function(e,t){for(e=e.toString(16).toUpperCase();e.length<t;)e="0"+e;return e};oB.exports=function(e){var t=Math.ceil(e.length/16),r=e.length%16||16,i=e.length.toString(16).length;i<6&&(i=6);var n,o="",s=0,a,c,u;for(n=0;n<t;n++){o+="\x1B[36m"+iB(s,i)+"\x1B[0m ",a=n===t-1?r:16,c=16-a;var l;for(l=0;l<a;l++)o+=" "+iB(e[s],2),s++;for(l=0;l<c;l++)o+=" ";for(s-=a,o+=" ",l=0;l<a;l++)u=e[s],o+=u>31&&u<127||u>159?String.fromCharCode(u):".",s++;o+=`
|
|
214
|
-
`}return o}});var uB=w((
|
|
213
|
+
`+t.prev}function gm(e,t){var r=Ik(e),i=[];if(r){i.length=e.length;for(var n=0;n<e.length;n++)i[n]=si(e,n)?t(e[n],e):""}var o=typeof xk=="function"?xk(e):[],s;if(ec){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var c in e)si(e,c)&&(r&&String(Number(c))===c&&c<e.length||ec&&s["$"+c]instanceof Symbol||(QU.call(/[^\w$]/,c)?i.push(t(c,e)+": "+t(e[c],e)):i.push(c+": "+t(e[c],e))));if(typeof xk=="function")for(var u=0;u<o.length;u++)e2.call(e,o[u])&&i.push("["+t(o[u])+"]: "+t(e[o[u]],e));return i}});var c2=w((iOe,a2)=>{"use strict";var sce=Al(),ace=Vo(),bm=function(e,t,r){for(var i=e,n;(n=i.next)!=null;i=n)if(n.key===t)return i.next=n.next,r||(n.next=e.next,e.next=n),n},cce=function(e,t){if(e){var r=bm(e,t);return r&&r.value}},uce=function(e,t,r){var i=bm(e,t);i?i.value=r:e.next={key:t,next:e.next,value:r}},lce=function(e,t){return e?!!bm(e,t):!1},fce=function(e,t){if(e)return bm(e,t,!0)};a2.exports=function(){var t,r={assert:function(i){if(!r.has(i))throw new ace("Side channel does not contain "+sce(i))},delete:function(i){var n=fce(t,i);return n&&t&&!t.next&&(t=void 0),!!n},get:function(i){return cce(t,i)},has:function(i){return lce(t,i)},set:function(i,n){t||(t={next:void 0}),uce(t,i,n)}};return r}});var Rk=w((oOe,u2)=>{"use strict";u2.exports=Object});var f2=w((sOe,l2)=>{"use strict";l2.exports=Error});var p2=w((aOe,d2)=>{"use strict";d2.exports=EvalError});var m2=w((cOe,h2)=>{"use strict";h2.exports=RangeError});var y2=w((uOe,g2)=>{"use strict";g2.exports=ReferenceError});var b2=w((lOe,v2)=>{"use strict";v2.exports=SyntaxError});var w2=w((fOe,_2)=>{"use strict";_2.exports=URIError});var S2=w((dOe,x2)=>{"use strict";x2.exports=Math.abs});var k2=w((pOe,E2)=>{"use strict";E2.exports=Math.floor});var I2=w((hOe,T2)=>{"use strict";T2.exports=Math.max});var C2=w((mOe,O2)=>{"use strict";O2.exports=Math.min});var $2=w((gOe,A2)=>{"use strict";A2.exports=Math.pow});var D2=w((yOe,R2)=>{"use strict";R2.exports=Math.round});var P2=w((vOe,N2)=>{"use strict";N2.exports=Number.isNaN||function(t){return t!==t}});var j2=w((bOe,q2)=>{"use strict";var dce=P2();q2.exports=function(t){return dce(t)||t===0?t:t<0?-1:1}});var L2=w((_Oe,M2)=>{"use strict";M2.exports=Object.getOwnPropertyDescriptor});var Dk=w((wOe,F2)=>{"use strict";var _m=L2();if(_m)try{_m([],"length")}catch{_m=null}F2.exports=_m});var Nk=w((xOe,z2)=>{"use strict";var wm=Object.defineProperty||!1;if(wm)try{wm({},"a",{value:1})}catch{wm=!1}z2.exports=wm});var B2=w((SOe,U2)=>{"use strict";U2.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;t[r]=n;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==n||a.enumerable!==!0)return!1}return!0}});var V2=w((EOe,H2)=>{"use strict";var W2=typeof Symbol<"u"&&Symbol,pce=B2();H2.exports=function(){return typeof W2!="function"||typeof Symbol!="function"||typeof W2("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:pce()}});var Pk=w((kOe,Z2)=>{"use strict";Z2.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var qk=w((TOe,G2)=>{"use strict";var hce=Rk();G2.exports=hce.getPrototypeOf||null});var J2=w((IOe,X2)=>{"use strict";var mce="Function.prototype.bind called on incompatible ",gce=Object.prototype.toString,yce=Math.max,vce="[object Function]",K2=function(t,r){for(var i=[],n=0;n<t.length;n+=1)i[n]=t[n];for(var o=0;o<r.length;o+=1)i[o+t.length]=r[o];return i},bce=function(t,r){for(var i=[],n=r||0,o=0;n<t.length;n+=1,o+=1)i[o]=t[n];return i},_ce=function(e,t){for(var r="",i=0;i<e.length;i+=1)r+=e[i],i+1<e.length&&(r+=t);return r};X2.exports=function(t){var r=this;if(typeof r!="function"||gce.apply(r)!==vce)throw new TypeError(mce+r);for(var i=bce(arguments,1),n,o=function(){if(this instanceof n){var l=r.apply(this,K2(i,arguments));return Object(l)===l?l:this}return r.apply(t,K2(i,arguments))},s=yce(0,r.length-i.length),a=[],c=0;c<s;c++)a[c]="$"+c;if(n=Function("binder","return function ("+_ce(a,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var u=function(){};u.prototype=r.prototype,n.prototype=new u,u.prototype=null}return n}});var $l=w((OOe,Y2)=>{"use strict";var wce=J2();Y2.exports=Function.prototype.bind||wce});var xm=w((COe,Q2)=>{"use strict";Q2.exports=Function.prototype.call});var jk=w((AOe,e4)=>{"use strict";e4.exports=Function.prototype.apply});var r4=w(($Oe,t4)=>{"use strict";t4.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var i4=w((ROe,n4)=>{"use strict";var xce=$l(),Sce=jk(),Ece=xm(),kce=r4();n4.exports=kce||xce.call(Ece,Sce)});var Mk=w((DOe,o4)=>{"use strict";var Tce=$l(),Ice=Vo(),Oce=xm(),Cce=i4();o4.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new Ice("a function is required");return Cce(Tce,Oce,t)}});var f4=w((NOe,l4)=>{"use strict";var Ace=Mk(),s4=Dk(),c4;try{c4=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Lk=!!c4&&s4&&s4(Object.prototype,"__proto__"),u4=Object,a4=u4.getPrototypeOf;l4.exports=Lk&&typeof Lk.get=="function"?Ace([Lk.get]):typeof a4=="function"?function(t){return a4(t==null?t:u4(t))}:!1});var g4=w((POe,m4)=>{"use strict";var d4=Pk(),p4=qk(),h4=f4();m4.exports=d4?function(t){return d4(t)}:p4?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return p4(t)}:h4?function(t){return h4(t)}:null});var v4=w((qOe,y4)=>{"use strict";var $ce=Function.prototype.call,Rce=Object.prototype.hasOwnProperty,Dce=$l();y4.exports=Dce.call($ce,Rce)});var km=w((jOe,E4)=>{"use strict";var De,Nce=Rk(),Pce=f2(),qce=p2(),jce=m2(),Mce=y2(),oc=b2(),nc=Vo(),Lce=w2(),Fce=S2(),zce=k2(),Uce=I2(),Bce=C2(),Wce=$2(),Hce=D2(),Vce=j2(),x4=Function,Fk=function(e){try{return x4('"use strict"; return ('+e+").constructor;")()}catch{}},Rl=Dk(),Zce=Nk(),zk=function(){throw new nc},Gce=Rl?(function(){try{return arguments.callee,zk}catch{try{return Rl(arguments,"callee").get}catch{return zk}}})():zk,tc=V2()(),Bt=g4(),Kce=qk(),Xce=Pk(),S4=jk(),Dl=xm(),rc={},Jce=typeof Uint8Array>"u"||!Bt?De:Bt(Uint8Array),Go={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?De:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?De:ArrayBuffer,"%ArrayIteratorPrototype%":tc&&Bt?Bt([][Symbol.iterator]()):De,"%AsyncFromSyncIteratorPrototype%":De,"%AsyncFunction%":rc,"%AsyncGenerator%":rc,"%AsyncGeneratorFunction%":rc,"%AsyncIteratorPrototype%":rc,"%Atomics%":typeof Atomics>"u"?De:Atomics,"%BigInt%":typeof BigInt>"u"?De:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?De:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?De:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?De:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Pce,"%eval%":eval,"%EvalError%":qce,"%Float16Array%":typeof Float16Array>"u"?De:Float16Array,"%Float32Array%":typeof Float32Array>"u"?De:Float32Array,"%Float64Array%":typeof Float64Array>"u"?De:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?De:FinalizationRegistry,"%Function%":x4,"%GeneratorFunction%":rc,"%Int8Array%":typeof Int8Array>"u"?De:Int8Array,"%Int16Array%":typeof Int16Array>"u"?De:Int16Array,"%Int32Array%":typeof Int32Array>"u"?De:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":tc&&Bt?Bt(Bt([][Symbol.iterator]())):De,"%JSON%":typeof JSON=="object"?JSON:De,"%Map%":typeof Map>"u"?De:Map,"%MapIteratorPrototype%":typeof Map>"u"||!tc||!Bt?De:Bt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Nce,"%Object.getOwnPropertyDescriptor%":Rl,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?De:Promise,"%Proxy%":typeof Proxy>"u"?De:Proxy,"%RangeError%":jce,"%ReferenceError%":Mce,"%Reflect%":typeof Reflect>"u"?De:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?De:Set,"%SetIteratorPrototype%":typeof Set>"u"||!tc||!Bt?De:Bt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?De:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":tc&&Bt?Bt(""[Symbol.iterator]()):De,"%Symbol%":tc?Symbol:De,"%SyntaxError%":oc,"%ThrowTypeError%":Gce,"%TypedArray%":Jce,"%TypeError%":nc,"%Uint8Array%":typeof Uint8Array>"u"?De:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?De:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?De:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?De:Uint32Array,"%URIError%":Lce,"%WeakMap%":typeof WeakMap>"u"?De:WeakMap,"%WeakRef%":typeof WeakRef>"u"?De:WeakRef,"%WeakSet%":typeof WeakSet>"u"?De:WeakSet,"%Function.prototype.call%":Dl,"%Function.prototype.apply%":S4,"%Object.defineProperty%":Zce,"%Object.getPrototypeOf%":Kce,"%Math.abs%":Fce,"%Math.floor%":zce,"%Math.max%":Uce,"%Math.min%":Bce,"%Math.pow%":Wce,"%Math.round%":Hce,"%Math.sign%":Vce,"%Reflect.getPrototypeOf%":Xce};if(Bt)try{null.error}catch(e){b4=Bt(Bt(e)),Go["%Error.prototype%"]=b4}var b4,Yce=function e(t){var r;if(t==="%AsyncFunction%")r=Fk("async function () {}");else if(t==="%GeneratorFunction%")r=Fk("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Fk("async function* () {}");else if(t==="%AsyncGenerator%"){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=e("%AsyncGenerator%");n&&Bt&&(r=Bt(n.prototype))}return Go[t]=r,r},_4={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Nl=$l(),Sm=v4(),Qce=Nl.call(Dl,Array.prototype.concat),eue=Nl.call(S4,Array.prototype.splice),w4=Nl.call(Dl,String.prototype.replace),Em=Nl.call(Dl,String.prototype.slice),tue=Nl.call(Dl,RegExp.prototype.exec),rue=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,nue=/\\(\\)?/g,iue=function(t){var r=Em(t,0,1),i=Em(t,-1);if(r==="%"&&i!=="%")throw new oc("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new oc("invalid intrinsic syntax, expected opening `%`");var n=[];return w4(t,rue,function(o,s,a,c){n[n.length]=a?w4(c,nue,"$1"):s||o}),n},oue=function(t,r){var i=t,n;if(Sm(_4,i)&&(n=_4[i],i="%"+n[0]+"%"),Sm(Go,i)){var o=Go[i];if(o===rc&&(o=Yce(i)),typeof o>"u"&&!r)throw new nc("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new oc("intrinsic "+t+" does not exist!")};E4.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new nc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new nc('"allowMissing" argument must be a boolean');if(tue(/^%?[^%]*%?$/,t)===null)throw new oc("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=iue(t),n=i.length>0?i[0]:"",o=oue("%"+n+"%",r),s=o.name,a=o.value,c=!1,u=o.alias;u&&(n=u[0],eue(i,Qce([0,1],u)));for(var l=1,f=!0;l<i.length;l+=1){var p=i[l],d=Em(p,0,1),h=Em(p,-1);if((d==='"'||d==="'"||d==="`"||h==='"'||h==="'"||h==="`")&&d!==h)throw new oc("property names with quotes must have matching quotes");if((p==="constructor"||!f)&&(c=!0),n+="."+p,s="%"+n+"%",Sm(Go,s))a=Go[s];else if(a!=null){if(!(p in a)){if(!r)throw new nc("base intrinsic for "+t+" exists, but the property is not available.");return}if(Rl&&l+1>=i.length){var m=Rl(a,p);f=!!m,f&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[p]}else f=Sm(a,p),a=a[p];f&&!c&&(Go[s]=a)}}return a}});var Uk=w((MOe,I4)=>{"use strict";var k4=km(),T4=Mk(),sue=T4([k4("%String.prototype.indexOf%")]);I4.exports=function(t,r){var i=k4(t,!!r);return typeof i=="function"&&sue(t,".prototype.")>-1?T4([i]):i}});var Bk=w((LOe,C4)=>{"use strict";var aue=km(),Pl=Uk(),cue=Al(),uue=Vo(),O4=aue("%Map%",!0),lue=Pl("Map.prototype.get",!0),fue=Pl("Map.prototype.set",!0),due=Pl("Map.prototype.has",!0),pue=Pl("Map.prototype.delete",!0),hue=Pl("Map.prototype.size",!0);C4.exports=!!O4&&function(){var t,r={assert:function(i){if(!r.has(i))throw new uue("Side channel does not contain "+cue(i))},delete:function(i){if(t){var n=pue(t,i);return hue(t)===0&&(t=void 0),n}return!1},get:function(i){if(t)return lue(t,i)},has:function(i){return t?due(t,i):!1},set:function(i,n){t||(t=new O4),fue(t,i,n)}};return r}});var $4=w((FOe,A4)=>{"use strict";var mue=km(),Im=Uk(),gue=Al(),Tm=Bk(),yue=Vo(),sc=mue("%WeakMap%",!0),vue=Im("WeakMap.prototype.get",!0),bue=Im("WeakMap.prototype.set",!0),_ue=Im("WeakMap.prototype.has",!0),wue=Im("WeakMap.prototype.delete",!0);A4.exports=sc?function(){var t,r,i={assert:function(n){if(!i.has(n))throw new yue("Side channel does not contain "+gue(n))},delete:function(n){if(sc&&n&&(typeof n=="object"||typeof n=="function")){if(t)return wue(t,n)}else if(Tm&&r)return r.delete(n);return!1},get:function(n){return sc&&n&&(typeof n=="object"||typeof n=="function")&&t?vue(t,n):r&&r.get(n)},has:function(n){return sc&&n&&(typeof n=="object"||typeof n=="function")&&t?_ue(t,n):!!r&&r.has(n)},set:function(n,o){sc&&n&&(typeof n=="object"||typeof n=="function")?(t||(t=new sc),bue(t,n,o)):Tm&&(r||(r=Tm()),r.set(n,o))}};return i}:Tm});var Wk=w((zOe,R4)=>{"use strict";var xue=Vo(),Sue=Al(),Eue=c2(),kue=Bk(),Tue=$4(),Iue=Tue||kue||Eue;R4.exports=function(){var t,r={assert:function(i){if(!r.has(i)){var n=i&&Object(i)===i?"the given object key":Sue(i);throw new xue("Side channel does not contain "+n)}},delete:function(i){return!!t&&t.delete(i)},get:function(i){return t&&t.get(i)},has:function(i){return!!t&&t.has(i)},set:function(i,n){t||(t=Iue()),t.set(i,n)}};return r}});var Om=w((UOe,D4)=>{"use strict";var Oue=String.prototype.replace,Cue=/%20/g,Hk={RFC1738:"RFC1738",RFC3986:"RFC3986"};D4.exports={default:Hk.RFC3986,formatters:{RFC1738:function(e){return Oue.call(e,Cue,"+")},RFC3986:function(e){return String(e)}},RFC1738:Hk.RFC1738,RFC3986:Hk.RFC3986}});var Kk=w((BOe,q4)=>{"use strict";var Aue=Om(),P4=Wk(),N4=Nk(),Vk=Object.prototype.hasOwnProperty,Ko=Array.isArray,Am=P4(),Xo=function(t,r){return Am.set(t,r),t},Jo=function(t){return Am.has(t)},ql=function(t){return Am.get(t)},Zk=function(t,r){Am.set(t,r)},In=(function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e})(),$ue=function(t){for(;t.length>1;){var r=t.pop(),i=r.obj[r.prop];if(Ko(i)){for(var n=[],o=0;o<i.length;++o)typeof i[o]<"u"&&(n[n.length]=i[o]);r.obj[r.prop]=n}}},ac=function(t,r){for(var i=r&&r.plainObjects?{__proto__:null}:{},n=0;n<t.length;++n)typeof t[n]<"u"&&(i[n]=t[n]);return i},Gk=function(t,r,i){r==="__proto__"&&N4?N4(t,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[r]=i},Rue=function e(t,r,i){if(!r)return t;if(typeof r!="object"&&typeof r!="function"){if(Ko(t)){var n=t.length;if(i&&typeof i.arrayLimit=="number"&&n>=i.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(i.arrayLimit===1?"":"s")+" allowed in an array.");return Xo(ac(t.concat(r),i),n)}t[n]=r}else if(t&&typeof t=="object")if(Jo(t)){var o=ql(t)+1;t[o]=r,Zk(t,o)}else{if(i&&i.strictMerge)return[t,r];(i&&(i.plainObjects||i.allowPrototypes)||!Vk.call(Object.prototype,r))&&(t[r]=!0)}else return[t,r];return t}if(!t||typeof t!="object"){if(Jo(r)){for(var s=Object.keys(r),a=i&&i.plainObjects?{__proto__:null,0:t}:{0:t},c=0;c<s.length;c++){var u=parseInt(s[c],10);a[u+1]=r[s[c]]}return Xo(a,ql(r)+1)}var l=[t].concat(r);if(i&&typeof i.arrayLimit=="number"&&l.length>i.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(i.arrayLimit===1?"":"s")+" allowed in an array.");return Xo(ac(l,i),l.length-1)}return l}var f=t;if(Ko(t)&&!Ko(r)&&(f=ac(t,i)),Ko(t)&&Ko(r)){if(r.forEach(function(p,d){if(Vk.call(t,d)){var h=t[d];h&&typeof h=="object"&&p&&typeof p=="object"?t[d]=e(h,p,i):t[t.length]=p}else t[d]=p}),i&&typeof i.arrayLimit=="number"&&t.length>i.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(i.arrayLimit===1?"":"s")+" allowed in an array.");return Xo(ac(t,i),t.length-1)}return t}return Object.keys(r).reduce(function(p,d){var h=r[d];if(Vk.call(p,d)?Gk(p,d,e(p[d],h,i)):Gk(p,d,h),Jo(r)&&!Jo(p)&&Xo(p,ql(r)),Jo(p)){var m=parseInt(d,10);String(m)===d&&m>=0&&m>ql(p)&&Zk(p,m)}return p},f)},Due=function(t,r){return Object.keys(r).reduce(function(i,n){return Gk(i,n,r[n]),i},t)},Nue=function(e,t,r){var i=e.replace(/\+/g," ");if(r==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},Cm=1024,Pue=function(t,r,i,n,o){if(t.length===0)return t;var s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),i==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});for(var a="",c=0;c<s.length;c+=Cm){var u=s.length>=Cm?s.slice(c,c+Cm):s;if(c+Cm<s.length){var l=u.charCodeAt(u.length-1);l>=55296&&l<=56319&&(u=u.slice(0,-1),c-=1)}for(var f=[],p=0;p<u.length;++p){var d=u.charCodeAt(p);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||o===Aue.RFC1738&&(d===40||d===41)){f[f.length]=u.charAt(p);continue}if(d<128){f[f.length]=In[d];continue}if(d<2048){f[f.length]=In[192|d>>6]+In[128|d&63];continue}if(d<55296||d>=57344){f[f.length]=In[224|d>>12]+In[128|d>>6&63]+In[128|d&63];continue}p+=1,d=65536+((d&1023)<<10|u.charCodeAt(p)&1023),f[f.length]=In[240|d>>18]+In[128|d>>12&63]+In[128|d>>6&63]+In[128|d&63]}a+=f.join("")}return a},que=function(t){for(var r=[{obj:{o:t},prop:"o"}],i=P4(),n=0;n<r.length;++n)for(var o=r[n],s=o.obj[o.prop],a=Object.keys(s),c=0;c<a.length;++c){var u=a[c],l=s[u];typeof l=="object"&&l!==null&&!i.has(l)&&(r[r.length]={obj:s,prop:u},i.set(l,!0))}return $ue(r),t},jue=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},Mue=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},Lue=function(t,r,i,n,o){if(Jo(t)){if(o)throw new RangeError("Array limit exceeded. Only "+i+" element"+(i===1?"":"s")+" allowed in an array.");var s=ql(t)+1;return t[s]=r,Zk(t,s),t}var a=[].concat(t,r);if(a.length>i){if(o)throw new RangeError("Array limit exceeded. Only "+i+" element"+(i===1?"":"s")+" allowed in an array.");return Xo(ac(a,{plainObjects:n}),a.length-1)}return a},Fue=function(t,r){if(Ko(t)){for(var i=[],n=0;n<t.length;n+=1)i[i.length]=r(t[n]);return i}return r(t)};q4.exports={arrayToObject:ac,assign:Due,combine:Lue,compact:que,decode:Nue,encode:Pue,isBuffer:Mue,isOverflow:Jo,isRegExp:jue,markOverflow:Xo,maybeMap:Fue,merge:Rue}});var U4=w((WOe,z4)=>{"use strict";var M4=Wk(),$m=Kk(),jl=Om(),zue=Object.prototype.hasOwnProperty,L4={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},On=Array.isArray,Uue=Array.prototype.push,F4=function(e,t){Uue.apply(e,On(t)?t:[t])},Bue=Date.prototype.toISOString,j4=jl.default,Pt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:$m.encode,encodeValuesOnly:!1,filter:void 0,format:j4,formatter:jl.formatters[j4],indices:!1,serializeDate:function(t){return Bue.call(t)},skipNulls:!1,strictNullHandling:!1},Wue=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Xk={},Hue=function e(t,r,i,n,o,s,a,c,u,l,f,p,d,h,m,_,k,S){for(var v=t,g=S,y=0,T=!1;(g=g.get(Xk))!==void 0&&!T;){var R=g.get(t);if(y+=1,typeof R<"u"){if(R===y)throw new RangeError("Cyclic object value");T=!0}typeof g.get(Xk)>"u"&&(y=0)}if(typeof l=="function"?v=l(r,v):v instanceof Date?v=d(v):i==="comma"&&On(v)&&(v=$m.maybeMap(v,function(pe){return pe instanceof Date?d(pe):pe})),v===null){if(s)return m(u&&!_?u(r,Pt.encoder,k,"key",h):r);v=""}if(Wue(v)||$m.isBuffer(v)){if(u){var I=_?r:u(r,Pt.encoder,k,"key",h);return[m(I)+"="+m(u(v,Pt.encoder,k,"value",h))]}return[m(r)+"="+m(String(v))]}var b=[];if(typeof v>"u")return b;var O;if(i==="comma"&&On(v))_&&u&&(v=$m.maybeMap(v,function(pe){return pe==null?pe:u(pe)})),O=[{value:v.length>0?v.join(",")||null:void 0}];else if(On(l))O=l;else{var A=Object.keys(v);O=f?A.sort(f):A}var P=c?String(r).replace(/\./g,"%2E"):String(r),D=n&&On(v)&&v.length===1?P+"[]":P;if(o&&On(v)&&v.length===0)return D+"[]";for(var V=0;V<O.length;++V){var $=O[V],U=typeof $=="object"&&$&&typeof $.value<"u"?$.value:v[$];if(!(a&&U===null)){var Z=p&&c?String($).replace(/\./g,"%2E"):String($),J=On(v)?typeof i=="function"?i(D,Z):D:D+(p?"."+Z:"["+Z+"]");S.set(t,y);var j=M4();j.set(Xk,S),F4(b,e(U,J,i,n,o,s,a,c,i==="comma"&&_&&On(v)?null:u,l,f,p,d,h,m,_,k,j))}}return b},Vue=function(t){if(!t)return Pt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=t.charset||Pt.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=jl.default;if(typeof t.format<"u"){if(!zue.call(jl.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var n=jl.formatters[i],o=Pt.filter;(typeof t.filter=="function"||On(t.filter))&&(o=t.filter);var s;if(t.arrayFormat in L4?s=t.arrayFormat:"indices"in t?s=t.indices?"indices":"repeat":s=Pt.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var a=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:Pt.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Pt.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Pt.allowEmptyArrays,arrayFormat:s,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Pt.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Pt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Pt.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Pt.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Pt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Pt.encodeValuesOnly,filter:o,format:i,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Pt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Pt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Pt.strictNullHandling}};z4.exports=function(e,t){var r=e,i=Vue(t),n,o;typeof i.filter=="function"?(o=i.filter,r=o("",r)):On(i.filter)&&(o=i.filter,n=o);var s=[];if(typeof r!="object"||r===null)return"";var a=L4[i.arrayFormat],c=a==="comma"&&i.commaRoundTrip;n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var u=M4(),l=0;l<n.length;++l){var f=n[l];if(!(typeof f>"u"||f===null)){var p=r[f];i.skipNulls&&p===null||F4(s,Hue(p,f,a,c,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,u))}}var d=s.join(i.delimiter),h=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B"+i.delimiter:h+="utf8=%E2%9C%93"+i.delimiter),d.length>0?h+d:""}});var H4=w((HOe,W4)=>{"use strict";var Cn=Kk(),Rm=Object.prototype.hasOwnProperty,Jk=Array.isArray,gt={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Cn.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},Zue=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},B4=function(e,t,r,i){if(e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1){if(i&&t.throwOnLimitExceeded)for(var n=0,o=e.indexOf(",");o>-1;){if(n+=1,n>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");o=e.indexOf(",",o+1)}return e.split(",")}if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return e},Gue="utf8=%26%2310003%3B",Kue="utf8=%E2%9C%93",Xue=function(t,r){var i={__proto__:null},n=r.ignoreQueryPrefix?t.replace(/^\?/,""):t;n=n.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var o=r.parameterLimit===1/0?void 0:r.parameterLimit,s=n.split(r.delimiter,r.throwOnLimitExceeded&&typeof o<"u"?o+1:o);if(r.throwOnLimitExceeded&&typeof o<"u"&&s.length>o)throw new RangeError("Parameter limit exceeded. Only "+o+" parameter"+(o===1?"":"s")+" allowed.");var a=-1,c,u=r.charset;if(r.charsetSentinel)for(c=0;c<s.length;++c)s[c].indexOf("utf8=")===0&&(s[c]===Kue?u="utf-8":s[c]===Gue&&(u="iso-8859-1"),a=c,c=s.length);for(c=0;c<s.length;++c)if(c!==a){var l=s[c],f=l.indexOf("]="),p=f===-1?l.indexOf("="):f+1,d,h;if(p===-1?(d=r.decoder(l,gt.decoder,u,"key"),h=r.strictNullHandling?null:""):(d=r.decoder(l.slice(0,p),gt.decoder,u,"key"),d!==null&&(h=Cn.maybeMap(B4(l.slice(p+1),r,Jk(i[d])?i[d].length:0,l.indexOf("[]=")===-1),function(_){return r.decoder(_,gt.decoder,u,"value")}))),h&&r.interpretNumericEntities&&u==="iso-8859-1"&&(h=Zue(String(h))),l.indexOf("[]=")>-1&&(h=Jk(h)?[h]:h),r.comma&&Jk(h)&&h.length>r.arrayLimit&&(h=Cn.combine([],h,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded)),d!==null){var m=Rm.call(i,d);m&&(r.duplicates==="combine"||l.indexOf("[]=")>-1)?i[d]=Cn.combine(i[d],h,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded):(!m||r.duplicates==="last")&&(i[d]=h)}}return i},Jue=function(e,t,r,i){var n=0;if(e.length>0&&e[e.length-1]==="[]"){var o=e.slice(0,-1).join("");n=Array.isArray(t)&&t[o]?t[o].length:0}for(var s=i?t:B4(t,r,n),a=e.length-1;a>=0;--a){var c,u=e[a];if(u==="[]"&&r.parseArrays)Cn.isOverflow(s)?c=s:c=r.allowEmptyArrays&&(s===""||r.strictNullHandling&&s===null)?[]:Cn.combine([],s,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded);else{c=r.plainObjects?{__proto__:null}:{};var l=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,f=r.decodeDotInKeys?l.replace(/%2E/g,"."):l,p=parseInt(f,10),d=!isNaN(p)&&u!==f&&String(p)===f&&p>=0&&r.parseArrays;if(!r.parseArrays&&f==="")c={0:s};else if(d&&p<r.arrayLimit)c=[],c[p]=s;else{if(d&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");d?(c[p]=s,Cn.markOverflow(c,p)):f!=="__proto__"&&(c[f]=s)}}s=c}return s},Yue=function(t,r){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(r.depth<=0)return!r.plainObjects&&Rm.call(Object.prototype,i)&&!r.allowPrototypes?void 0:[i];var n=[],o=i.indexOf("["),s=o>=0?i.slice(0,o):i;if(s){if(!r.plainObjects&&Rm.call(Object.prototype,s)&&!r.allowPrototypes)return;n[n.length]=s}for(var a=i.length,c=o,u=0;c>=0&&u<r.depth;){for(var l=1,f=c+1,p=-1;f<a&&p<0;){var d=i.charCodeAt(f);d===91?l+=1:d===93&&(l-=1,l===0&&(p=f)),f+=1}if(p<0)return n[n.length]="["+i.slice(c)+"]",n;var h=i.slice(c,p+1),m=h.slice(1,-1);if(!r.plainObjects&&Rm.call(Object.prototype,m)&&!r.allowPrototypes)return;n[n.length]=h,u+=1,c=i.indexOf("[",p+1)}if(c>=0){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");n[n.length]="["+i.slice(c)+"]"}return n},Que=function(t,r,i,n){if(t){var o=Yue(t,i);if(o)return Jue(o,r,i,n)}},ele=function(t){if(!t)return gt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof t.charset>"u"?gt.charset:t.charset,i=typeof t.duplicates>"u"?gt.duplicates:t.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var n=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:gt.allowDots:!!t.allowDots;return{allowDots:n,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:gt.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:gt.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:gt.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:gt.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:gt.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:gt.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:gt.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:gt.decoder,delimiter:typeof t.delimiter=="string"||Cn.isRegExp(t.delimiter)?t.delimiter:gt.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:gt.depth,duplicates:i,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:gt.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:gt.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:gt.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:gt.strictDepth,strictMerge:typeof t.strictMerge=="boolean"?!!t.strictMerge:gt.strictMerge,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:gt.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}};W4.exports=function(e,t){var r=ele(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?{__proto__:null}:{};for(var i=typeof e=="string"?Xue(e,r):e,n=r.plainObjects?{__proto__:null}:{},o=Object.keys(i),s=0;s<o.length;++s){var a=o[s],c=Que(a,i[a],r,typeof e=="string");n=Cn.merge(n,c,r)}return r.allowSparse===!0?n:Cn.compact(n)}});var Yk=w((VOe,V4)=>{"use strict";var tle=U4(),rle=H4(),nle=Om();V4.exports={formats:nle,parse:rle,stringify:tle}});var G4=w((ZOe,Z4)=>{"use strict";var ile=B("os"),ole={15:"El Capitan",14:"Yosemite",13:"Mavericks",12:"Mountain Lion",11:"Lion",10:"Snow Leopard",9:"Leopard",8:"Tiger",7:"Panther",6:"Jaguar",5:"Puma"};Z4.exports=function(e){return e=(e||ile.release()).split(".")[0],{name:ole[e],version:"10."+(Number(e)-4)}}});var f6=w((xe,l6)=>{xe=l6.exports=je;var Xe;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?Xe=function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:Xe=function(){};xe.SEMVER_SPEC_VERSION="2.0.0";var Ml=256,Dm=Number.MAX_SAFE_INTEGER||9007199254740991,Qk=16,sle=Ml-6,Ll=xe.re=[],ot=xe.safeRe=[],se=xe.src=[],qe=0,iT="[a-zA-Z0-9-]",eT=[["\\s",1],["\\d",Ml],[iT,sle]];function Lm(e){for(var t=0;t<eT.length;t++){var r=eT[t][0],i=eT[t][1];e=e.split(r+"*").join(r+"{0,"+i+"}").split(r+"+").join(r+"{1,"+i+"}")}return e}var cc=qe++;se[cc]="0|[1-9]\\d*";var uc=qe++;se[uc]="\\d+";var oT=qe++;se[oT]="\\d*[a-zA-Z-]"+iT+"*";var X4=qe++;se[X4]="("+se[cc]+")\\.("+se[cc]+")\\.("+se[cc]+")";var J4=qe++;se[J4]="("+se[uc]+")\\.("+se[uc]+")\\.("+se[uc]+")";var tT=qe++;se[tT]="(?:"+se[cc]+"|"+se[oT]+")";var rT=qe++;se[rT]="(?:"+se[uc]+"|"+se[oT]+")";var sT=qe++;se[sT]="(?:-("+se[tT]+"(?:\\."+se[tT]+")*))";var aT=qe++;se[aT]="(?:-?("+se[rT]+"(?:\\."+se[rT]+")*))";var nT=qe++;se[nT]=iT+"+";var zl=qe++;se[zl]="(?:\\+("+se[nT]+"(?:\\."+se[nT]+")*))";var cT=qe++,Y4="v?"+se[X4]+se[sT]+"?"+se[zl]+"?";se[cT]="^"+Y4+"$";var uT="[v=\\s]*"+se[J4]+se[aT]+"?"+se[zl]+"?",lT=qe++;se[lT]="^"+uT+"$";var hc=qe++;se[hc]="((?:<|>)?=?)";var Nm=qe++;se[Nm]=se[uc]+"|x|X|\\*";var Pm=qe++;se[Pm]=se[cc]+"|x|X|\\*";var Yo=qe++;se[Yo]="[v=\\s]*("+se[Pm]+")(?:\\.("+se[Pm]+")(?:\\.("+se[Pm]+")(?:"+se[sT]+")?"+se[zl]+"?)?)?";var fc=qe++;se[fc]="[v=\\s]*("+se[Nm]+")(?:\\.("+se[Nm]+")(?:\\.("+se[Nm]+")(?:"+se[aT]+")?"+se[zl]+"?)?)?";var Q4=qe++;se[Q4]="^"+se[hc]+"\\s*"+se[Yo]+"$";var e6=qe++;se[e6]="^"+se[hc]+"\\s*"+se[fc]+"$";var t6=qe++;se[t6]="(?:^|[^\\d])(\\d{1,"+Qk+"})(?:\\.(\\d{1,"+Qk+"}))?(?:\\.(\\d{1,"+Qk+"}))?(?:$|[^\\d])";var Fm=qe++;se[Fm]="(?:~>?)";var dc=qe++;se[dc]="(\\s*)"+se[Fm]+"\\s+";Ll[dc]=new RegExp(se[dc],"g");ot[dc]=new RegExp(Lm(se[dc]),"g");var ale="$1~",r6=qe++;se[r6]="^"+se[Fm]+se[Yo]+"$";var n6=qe++;se[n6]="^"+se[Fm]+se[fc]+"$";var zm=qe++;se[zm]="(?:\\^)";var pc=qe++;se[pc]="(\\s*)"+se[zm]+"\\s+";Ll[pc]=new RegExp(se[pc],"g");ot[pc]=new RegExp(Lm(se[pc]),"g");var cle="$1^",i6=qe++;se[i6]="^"+se[zm]+se[Yo]+"$";var o6=qe++;se[o6]="^"+se[zm]+se[fc]+"$";var fT=qe++;se[fT]="^"+se[hc]+"\\s*("+uT+")$|^$";var dT=qe++;se[dT]="^"+se[hc]+"\\s*("+Y4+")$|^$";var Qo=qe++;se[Qo]="(\\s*)"+se[hc]+"\\s*("+uT+"|"+se[Yo]+")";Ll[Qo]=new RegExp(se[Qo],"g");ot[Qo]=new RegExp(Lm(se[Qo]),"g");var ule="$1$2$3",s6=qe++;se[s6]="^\\s*("+se[Yo]+")\\s+-\\s+("+se[Yo]+")\\s*$";var a6=qe++;se[a6]="^\\s*("+se[fc]+")\\s+-\\s+("+se[fc]+")\\s*$";var c6=qe++;se[c6]="(<|>)?=?\\s*\\*";for(An=0;An<qe;An++)Xe(An,se[An]),Ll[An]||(Ll[An]=new RegExp(se[An]),ot[An]=new RegExp(Lm(se[An])));var An;xe.parse=es;function es(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof je)return e;if(typeof e!="string"||e.length>Ml)return null;var r=t.loose?ot[lT]:ot[cT];if(!r.test(e))return null;try{return new je(e,t)}catch{return null}}xe.valid=lle;function lle(e,t){var r=es(e,t);return r?r.version:null}xe.clean=fle;function fle(e,t){var r=es(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}xe.SemVer=je;function je(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof je){if(e.loose===t.loose)return e;e=e.version}else if(typeof e!="string")throw new TypeError("Invalid Version: "+e);if(e.length>Ml)throw new TypeError("version is longer than "+Ml+" characters");if(!(this instanceof je))return new je(e,t);Xe("SemVer",e,t),this.options=t,this.loose=!!t.loose;var r=e.trim().match(t.loose?ot[lT]:ot[cT]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Dm||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Dm||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Dm||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(i){if(/^[0-9]+$/.test(i)){var n=+i;if(n>=0&&n<Dm)return n}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}je.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version};je.prototype.toString=function(){return this.version};je.prototype.compare=function(e){return Xe("SemVer.compare",this.version,this.options,e),e instanceof je||(e=new je(e,this.options)),this.compareMain(e)||this.comparePre(e)};je.prototype.compareMain=function(e){return e instanceof je||(e=new je(e,this.options)),lc(this.major,e.major)||lc(this.minor,e.minor)||lc(this.patch,e.patch)};je.prototype.comparePre=function(e){if(e instanceof je||(e=new je(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],i=e.prerelease[t];if(Xe("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return lc(r,i)}while(++t)};je.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this};xe.inc=dle;function dle(e,t,r,i){typeof r=="string"&&(i=r,r=void 0);try{return new je(e,r).inc(t,i).version}catch{return null}}xe.diff=ple;function ple(e,t){if(pT(e,t))return null;var r=es(e),i=es(t),n="";if(r.prerelease.length||i.prerelease.length){n="pre";var o="prerelease"}for(var s in r)if((s==="major"||s==="minor"||s==="patch")&&r[s]!==i[s])return n+s;return o}xe.compareIdentifiers=lc;var K4=/^[0-9]+$/;function lc(e,t){var r=K4.test(e),i=K4.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1}xe.rcompareIdentifiers=hle;function hle(e,t){return lc(t,e)}xe.major=mle;function mle(e,t){return new je(e,t).major}xe.minor=gle;function gle(e,t){return new je(e,t).minor}xe.patch=yle;function yle(e,t){return new je(e,t).patch}xe.compare=ai;function ai(e,t,r){return new je(e,r).compare(new je(t,r))}xe.compareLoose=vle;function vle(e,t){return ai(e,t,!0)}xe.rcompare=ble;function ble(e,t,r){return ai(t,e,r)}xe.sort=_le;function _le(e,t){return e.sort(function(r,i){return xe.compare(r,i,t)})}xe.rsort=wle;function wle(e,t){return e.sort(function(r,i){return xe.rcompare(r,i,t)})}xe.gt=Fl;function Fl(e,t,r){return ai(e,t,r)>0}xe.lt=qm;function qm(e,t,r){return ai(e,t,r)<0}xe.eq=pT;function pT(e,t,r){return ai(e,t,r)===0}xe.neq=u6;function u6(e,t,r){return ai(e,t,r)!==0}xe.gte=hT;function hT(e,t,r){return ai(e,t,r)>=0}xe.lte=mT;function mT(e,t,r){return ai(e,t,r)<=0}xe.cmp=jm;function jm(e,t,r,i){switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return pT(e,r,i);case"!=":return u6(e,r,i);case">":return Fl(e,r,i);case">=":return hT(e,r,i);case"<":return qm(e,r,i);case"<=":return mT(e,r,i);default:throw new TypeError("Invalid operator: "+t)}}xe.Comparator=Br;function Br(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof Br){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof Br))return new Br(e,t);e=e.trim().split(/\s+/).join(" "),Xe("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ul?this.value="":this.value=this.operator+this.semver.version,Xe("comp",this)}var Ul={};Br.prototype.parse=function(e){var t=this.options.loose?ot[fT]:ot[dT],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new je(r[2],this.options.loose):this.semver=Ul};Br.prototype.toString=function(){return this.value};Br.prototype.test=function(e){return Xe("Comparator.test",e,this.options.loose),this.semver===Ul?!0:(typeof e=="string"&&(e=new je(e,this.options)),jm(e,this.operator,this.semver,this.options))};Br.prototype.intersects=function(e,t){if(!(e instanceof Br))throw new TypeError("a Comparator is required");(!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1});var r;if(this.operator==="")return r=new yt(e.value,t),Mm(this.value,r,t);if(e.operator==="")return r=new yt(this.value,t),Mm(e.semver,r,t);var i=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),n=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),o=this.semver.version===e.semver.version,s=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),a=jm(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),c=jm(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return i||n||o&&s||a||c};xe.Range=yt;function yt(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof yt)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new yt(e.raw,t);if(e instanceof Br)return new yt(e.value,t);if(!(this instanceof yt))return new yt(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}yt.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range};yt.prototype.toString=function(){return this.range};yt.prototype.parseRange=function(e){var t=this.options.loose,r=t?ot[a6]:ot[s6];e=e.replace(r,$le),Xe("hyphen replace",e),e=e.replace(ot[Qo],ule),Xe("comparator trim",e,ot[Qo]),e=e.replace(ot[dc],ale),e=e.replace(ot[pc],cle);var i=t?ot[fT]:ot[dT],n=e.split(" ").map(function(o){return Sle(o,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(n=n.filter(function(o){return!!o.match(i)})),n=n.map(function(o){return new Br(o,this.options)},this),n};yt.prototype.intersects=function(e,t){if(!(e instanceof yt))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(i){return e.set.some(function(n){return n.every(function(o){return i.intersects(o,t)})})})})};xe.toComparators=xle;function xle(e,t){return new yt(e,t).set.map(function(r){return r.map(function(i){return i.value}).join(" ").trim().split(" ")})}function Sle(e,t){return Xe("comp",e,t),e=Tle(e,t),Xe("caret",e),e=Ele(e,t),Xe("tildes",e),e=Ole(e,t),Xe("xrange",e),e=Ale(e,t),Xe("stars",e),e}function mr(e){return!e||e.toLowerCase()==="x"||e==="*"}function Ele(e,t){return e.trim().split(/\s+/).map(function(r){return kle(r,t)}).join(" ")}function kle(e,t){var r=t.loose?ot[n6]:ot[r6];return e.replace(r,function(i,n,o,s,a){Xe("tilde",e,i,n,o,s,a);var c;return mr(n)?c="":mr(o)?c=">="+n+".0.0 <"+(+n+1)+".0.0":mr(s)?c=">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":a?(Xe("replaceTilde pr",a),c=">="+n+"."+o+"."+s+"-"+a+" <"+n+"."+(+o+1)+".0"):c=">="+n+"."+o+"."+s+" <"+n+"."+(+o+1)+".0",Xe("tilde return",c),c})}function Tle(e,t){return e.trim().split(/\s+/).map(function(r){return Ile(r,t)}).join(" ")}function Ile(e,t){Xe("caret",e,t);var r=t.loose?ot[o6]:ot[i6];return e.replace(r,function(i,n,o,s,a){Xe("caret",e,i,n,o,s,a);var c;return mr(n)?c="":mr(o)?c=">="+n+".0.0 <"+(+n+1)+".0.0":mr(s)?n==="0"?c=">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":c=">="+n+"."+o+".0 <"+(+n+1)+".0.0":a?(Xe("replaceCaret pr",a),n==="0"?o==="0"?c=">="+n+"."+o+"."+s+"-"+a+" <"+n+"."+o+"."+(+s+1):c=">="+n+"."+o+"."+s+"-"+a+" <"+n+"."+(+o+1)+".0":c=">="+n+"."+o+"."+s+"-"+a+" <"+(+n+1)+".0.0"):(Xe("no pr"),n==="0"?o==="0"?c=">="+n+"."+o+"."+s+" <"+n+"."+o+"."+(+s+1):c=">="+n+"."+o+"."+s+" <"+n+"."+(+o+1)+".0":c=">="+n+"."+o+"."+s+" <"+(+n+1)+".0.0"),Xe("caret return",c),c})}function Ole(e,t){return Xe("replaceXRanges",e,t),e.split(/\s+/).map(function(r){return Cle(r,t)}).join(" ")}function Cle(e,t){e=e.trim();var r=t.loose?ot[e6]:ot[Q4];return e.replace(r,function(i,n,o,s,a,c){Xe("xRange",e,i,n,o,s,a,c);var u=mr(o),l=u||mr(s),f=l||mr(a),p=f;return n==="="&&p&&(n=""),u?n===">"||n==="<"?i="<0.0.0":i="*":n&&p?(l&&(s=0),a=0,n===">"?(n=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):n==="<="&&(n="<",l?o=+o+1:s=+s+1),i=n+o+"."+s+"."+a):l?i=">="+o+".0.0 <"+(+o+1)+".0.0":f&&(i=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0"),Xe("xRange return",i),i})}function Ale(e,t){return Xe("replaceStars",e,t),e.trim().replace(ot[c6],"")}function $le(e,t,r,i,n,o,s,a,c,u,l,f,p){return mr(r)?t="":mr(i)?t=">="+r+".0.0":mr(n)?t=">="+r+"."+i+".0":t=">="+t,mr(c)?a="":mr(u)?a="<"+(+c+1)+".0.0":mr(l)?a="<"+c+"."+(+u+1)+".0":f?a="<="+c+"."+u+"."+l+"-"+f:a="<="+a,(t+" "+a).trim()}yt.prototype.test=function(e){if(!e)return!1;typeof e=="string"&&(e=new je(e,this.options));for(var t=0;t<this.set.length;t++)if(Rle(this.set[t],e,this.options))return!0;return!1};function Rle(e,t,r){for(var i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(i=0;i<e.length;i++)if(Xe(e[i].semver),e[i].semver!==Ul&&e[i].semver.prerelease.length>0){var n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}xe.satisfies=Mm;function Mm(e,t,r){try{t=new yt(t,r)}catch{return!1}return t.test(e)}xe.maxSatisfying=Dle;function Dle(e,t,r){var i=null,n=null;try{var o=new yt(t,r)}catch{return null}return e.forEach(function(s){o.test(s)&&(!i||n.compare(s)===-1)&&(i=s,n=new je(i,r))}),i}xe.minSatisfying=Nle;function Nle(e,t,r){var i=null,n=null;try{var o=new yt(t,r)}catch{return null}return e.forEach(function(s){o.test(s)&&(!i||n.compare(s)===1)&&(i=s,n=new je(i,r))}),i}xe.minVersion=Ple;function Ple(e,t){e=new yt(e,t);var r=new je("0.0.0");if(e.test(r)||(r=new je("0.0.0-0"),e.test(r)))return r;r=null;for(var i=0;i<e.set.length;++i){var n=e.set[i];n.forEach(function(o){var s=new je(o.semver.version);switch(o.operator){case">":s.prerelease.length===0?s.patch++:s.prerelease.push(0),s.raw=s.format();case"":case">=":(!r||Fl(r,s))&&(r=s);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+o.operator)}})}return r&&e.test(r)?r:null}xe.validRange=qle;function qle(e,t){try{return new yt(e,t).range||"*"}catch{return null}}xe.ltr=jle;function jle(e,t,r){return gT(e,t,"<",r)}xe.gtr=Mle;function Mle(e,t,r){return gT(e,t,">",r)}xe.outside=gT;function gT(e,t,r,i){e=new je(e,i),t=new yt(t,i);var n,o,s,a,c;switch(r){case">":n=Fl,o=mT,s=qm,a=">",c=">=";break;case"<":n=qm,o=hT,s=Fl,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Mm(e,t,i))return!1;for(var u=0;u<t.set.length;++u){var l=t.set[u],f=null,p=null;if(l.forEach(function(d){d.semver===Ul&&(d=new Br(">=0.0.0")),f=f||d,p=p||d,n(d.semver,f.semver,i)?f=d:s(d.semver,p.semver,i)&&(p=d)}),f.operator===a||f.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}xe.prerelease=Lle;function Lle(e,t){var r=es(e,t);return r&&r.prerelease.length?r.prerelease:null}xe.intersects=Fle;function Fle(e,t,r){return e=new yt(e,r),t=new yt(t,r),e.intersects(t)}xe.coerce=zle;function zle(e){if(e instanceof je)return e;if(typeof e!="string")return null;var t=e.match(ot[t6]);return t==null?null:es(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}});var p6=w((GOe,d6)=>{"use strict";var Ule=B("os"),Ble=f6(),Wle={"10.0":"10","6.3":"8.1","6.2":"8","6.1":"7","6.0":"Vista","5.1":"XP","5.0":"2000","4.9":"ME","4.1":"98","4.0":"95"};d6.exports=function(e){var t=/\d+\.\d+/,r=t.exec(e||Ule.release());if(!e&&process.platform==="win32"&&Ble.satisfies(process.version,">=0.12.0 <3.1.0"))try{r=t.exec(String(B("child_process").execSync("ver.exe",{timeout:2e3})))}catch{}if(e&&!r)throw new Error("`release` argument doesn't match `n.n`");return Wle[(r||[])[0]]}});var g6=w((KOe,m6)=>{"use strict";var h6=B("os"),Hle=G4(),Vle=p6();m6.exports=function(e,t){if(!e&&t)throw new Error("You can't specify a `release` without specfying `platform`");e=e||h6.platform(),t=t||h6.release();var r;return e==="darwin"?(r=Hle(t).name,"OS X"+(r?" "+r:"")):e==="linux"?(r=t.replace(/^(\d+\.\d+).*/,"$1"),"Linux"+(r?" "+r:"")):e==="win32"?(r=Vle(t),"Windows"+(r?" "+r:"")):e}});var b6=w((XOe,v6)=>{"use strict";var Zle=g6(),y6="Node.js/"+process.version.slice(1)+" ("+Zle()+"; "+process.arch+")";v6.exports=function(t,r){return arguments.length!==2?y6:t+"/"+r+" "+y6}});var x6=w((JOe,w6)=>{var _6=B("crypto"),Gle=/(\w+)=["']?([^'"]{1,10000})["']?/,Kle=0,Xle="00000000";function yT(e){return _6.createHash("md5").update(e).digest("hex")}function Jle(e,t,r,i){let n=r.split(","),o={};for(let h=0;h<n.length;h++){let m=Gle.exec(n[h]);m&&(o[m[1]]=m[2].replace(/["']/g,""))}if(!o.realm||!o.nonce)return"";let s=o.qop||"";i=i.split(":");let a=String(++Kle);a=Xle.substring(a.length)+a;let c=_6.randomBytes(8).toString("hex"),u=yT(i[0]+":"+o.realm+":"+i[1]),l=yT(e.toUpperCase()+":"+t),f=u+":"+o.nonce;s&&(s=s.split(",")[0],f+=":"+a+":"+c+":"+s),f+=":"+l;let p=yT(f),d='Digest username="'+i[0]+'", realm="'+o.realm+'", nonce="'+o.nonce+'", uri="'+t+'", response="'+p+'"';return o.opaque&&(d+=', opaque="'+o.opaque+'"'),s&&(d+=", qop="+s+", nc="+a+', cnonce="'+c+'"'),d}w6.exports=Jle});var S6=w((YOe,Yle)=>{Yle.exports={"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","306":"(Unused)","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Unordered Collection","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}});var T6=w((QOe,k6)=>{"use strict";var E6=S6();k6.exports=$n;$n.STATUS_CODES=E6;$n.codes=Qle($n,E6);$n.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0};$n.empty={204:!0,205:!0,304:!0};$n.retry={502:!0,503:!0,504:!0};function Qle(e,t){var r=[];return Object.keys(t).forEach(function(n){var o=t[n],s=Number(n);e[s]=o,e[o]=s,e[o.toLowerCase()]=s,r.push(s)}),r}function $n(e){if(typeof e=="number"){if(!$n[e])throw new Error("invalid status code: "+e);return e}if(typeof e!="string")throw new TypeError("code must be a number or string");var t=parseInt(e,10);if(!isNaN(t)){if(!$n[t])throw new Error("invalid status code: "+t);return t}if(t=$n[e.toLowerCase()],!t)throw new Error('invalid status message: "'+e+'"');return t}});var A6=w(vT=>{"use strict";var I6=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,efe=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,O6=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,tfe=/\\([\u000b\u0020-\u00ff])/g,rfe=/([\\"])/g,C6=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;vT.format=nfe;vT.parse=ife;function nfe(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!C6.test(r))throw new TypeError("invalid type");var i=r;if(t&&typeof t=="object")for(var n,o=Object.keys(t).sort(),s=0;s<o.length;s++){if(n=o[s],!O6.test(n))throw new TypeError("invalid parameter name");i+="; "+n+"="+sfe(t[n])}return i}function ife(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?ofe(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),i=r!==-1?t.slice(0,r).trim():t.trim();if(!C6.test(i))throw new TypeError("invalid media type");var n=new afe(i.toLowerCase());if(r!==-1){var o,s,a;for(I6.lastIndex=r;s=I6.exec(t);){if(s.index!==r)throw new TypeError("invalid parameter format");r+=s[0].length,o=s[1].toLowerCase(),a=s[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(tfe,"$1"))),n.parameters[o]=a}if(r!==t.length)throw new TypeError("invalid parameter format")}return n}function ofe(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function sfe(e){var t=String(e);if(O6.test(t))return t;if(t.length>0&&!efe.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(rfe,"\\$1")+'"'}function afe(e){this.parameters=Object.create(null),this.type=e}});var R6=w((tCe,$6)=>{"use strict";$6.exports=cfe;function cfe(e,t){if(!Array.isArray(e))throw new TypeError("arg must be an array of [ee, events...] arrays");for(var r=[],i=0;i<e.length;i++){var n=e[i];if(!Array.isArray(n)||n.length<2)throw new TypeError("each array member must be [ee, events...]");for(var o=n[0],s=1;s<n.length;s++){var a=n[s],c=ufe(a,u);o.on(a,c),r.push({ee:o,event:a,fn:c})}}function u(){l(),t.apply(null,arguments)}function l(){for(var p,d=0;d<r.length;d++)p=r[d],p.ee.removeListener(p.event,p.fn)}function f(p){t=p}return f.cancel=l,f}function ufe(e,t){return function(i){for(var n=new Array(arguments.length),o=this,s=e==="error"?i:null,a=0;a<n.length;a++)n[a]=arguments[a];t(s,o,e,n)}}});var P6=w((rCe,N6)=>{N6.exports=D6;function D6(e,t){if(e&&t)return D6(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(i){r[i]=e[i]}),r;function r(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];var o=e.apply(this,i),s=i[i.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(a){o[a]=s[a]}),o}}});var _T=w((nCe,bT)=>{var q6=P6();bT.exports=q6(Um);bT.exports.strict=q6(j6);Um.proto=Um(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Um(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return j6(this)},configurable:!0})});function Um(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function j6(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}});var F6=w((iCe,L6)=>{var lfe=_T(),ffe=function(){},dfe=global.Bare?queueMicrotask:process.nextTick.bind(process),pfe=function(e){return e.setHeader&&typeof e.abort=="function"},hfe=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},M6=function(e,t,r){if(typeof t=="function")return M6(e,null,t);t||(t={}),r=lfe(r||ffe);var i=e._writableState,n=e._readableState,o=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,a=!1,c=function(){e.writable||u()},u=function(){s=!1,o||r.call(e)},l=function(){o=!1,s||r.call(e)},f=function(_){r.call(e,_?new Error("exited with error code: "+_):null)},p=function(_){r.call(e,_)},d=function(){dfe(h)},h=function(){if(!a){if(o&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"));if(s&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"))}},m=function(){e.req.on("finish",u)};return pfe(e)?(e.on("complete",u),e.on("abort",d),e.req?m():e.on("request",m)):s&&!i&&(e.on("end",c),e.on("close",c)),hfe(e)&&e.on("exit",f),e.on("end",l),e.on("finish",u),t.error!==!1&&e.on("error",p),e.on("close",d),function(){a=!0,e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",m),e.req&&e.req.removeListener("finish",u),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",u),e.removeListener("exit",f),e.removeListener("end",l),e.removeListener("error",p),e.removeListener("close",d)}};L6.exports=M6});var wT=w((oCe,U6)=>{var mfe=_T(),gfe=F6(),Bm;try{Bm=B("fs")}catch{}var Bl=function(){},yfe=typeof process>"u"?!1:/^v?\.0/.test(process.version),Wm=function(e){return typeof e=="function"},vfe=function(e){return!yfe||!Bm?!1:(e instanceof(Bm.ReadStream||Bl)||e instanceof(Bm.WriteStream||Bl))&&Wm(e.close)},bfe=function(e){return e.setHeader&&Wm(e.abort)},_fe=function(e,t,r,i){i=mfe(i);var n=!1;e.on("close",function(){n=!0}),gfe(e,{readable:t,writable:r},function(s){if(s)return i(s);n=!0,i()});var o=!1;return function(s){if(!n&&!o){if(o=!0,vfe(e))return e.close(Bl);if(bfe(e))return e.abort();if(Wm(e.destroy))return e.destroy();i(s||new Error("stream was destroyed"))}}},z6=function(e){e()},wfe=function(e,t){return e.pipe(t)},xfe=function(){var e=Array.prototype.slice.call(arguments),t=Wm(e[e.length-1]||Bl)&&e.pop()||Bl;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,i=e.map(function(n,o){var s=o<e.length-1,a=o>0;return _fe(n,s,a,function(c){r||(r=c),c&&i.forEach(z6),!s&&(i.forEach(z6),t(r))})});return e.reduce(wfe)};U6.exports=xfe});var H6=w((B6,W6)=>{var Sfe=B("stream");B6=W6.exports=xT;xT.through=xT;function xT(e,t,r){e=e||function(l){this.queue(l)},t=t||function(){this.queue(null)};var i=!1,n=!1,o=[],s=!1,a=new Sfe;a.readable=a.writable=!0,a.paused=!1,a.autoDestroy=!(r&&r.autoDestroy===!1),a.write=function(l){return e.call(this,l),!a.paused};function c(){for(;o.length&&!a.paused;){var l=o.shift();if(l===null)return a.emit("end");a.emit("data",l)}}a.queue=a.push=function(l){return s||(l===null&&(s=!0),o.push(l),c()),a},a.on("end",function(){a.readable=!1,!a.writable&&a.autoDestroy&&process.nextTick(function(){a.destroy()})});function u(){a.writable=!1,t.call(a),!a.readable&&a.autoDestroy&&a.destroy()}return a.end=function(l){if(!i)return i=!0,arguments.length&&a.write(l),u(),a},a.destroy=function(){if(!n)return n=!0,i=!0,o.length=0,a.writable=a.readable=!1,a.emit("close"),a},a.pause=function(){if(!a.paused)return a.paused=!0,a},a.resume=function(){return a.paused&&(a.paused=!1,a.emit("resume")),c(),a.paused||a.emit("drain"),a},a}});var Z6=w((sCe,V6)=>{V6.exports=H6()});var K6=w((aCe,G6)=>{"use strict";function Hm(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e<arguments.length;e++)this.define(arguments[e]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}Hm.prototype.define=function(e,t){for(let r in e){let i=e[r].map(function(n){return n.toLowerCase()});r=r.toLowerCase();for(let n=0;n<i.length;n++){let o=i[n];if(o[0]!=="*"){if(!t&&o in this._types)throw new Error('Attempt to change mapping for "'+o+'" extension from "'+this._types[o]+'" to "'+r+'". Pass `force=true` to allow this, otherwise remove "'+o+'" from the list of extensions for "'+r+'".');this._types[o]=r}}if(t||!this._extensions[r]){let n=i[0];this._extensions[r]=n[0]!=="*"?n:n.substr(1)}}};Hm.prototype.getType=function(e){e=String(e);let t=e.replace(/^.*[/\\]/,"").toLowerCase(),r=t.replace(/^.*\./,"").toLowerCase(),i=t.length<e.length;return(r.length<t.length-1||!i)&&this._types[r]||null};Hm.prototype.getExtension=function(e){return e=/^\s*([^;\s]*)/.test(e)&&RegExp.$1,e&&this._extensions[e.toLowerCase()]||null};G6.exports=Hm});var J6=w((cCe,X6)=>{X6.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}});var Q6=w((uCe,Y6)=>{Y6.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}});var Wl=w((lCe,eB)=>{"use strict";var Efe=K6();eB.exports=new Efe(J6(),Q6())});var nB=w((fCe,rB)=>{"use strict";var kfe=B("events").EventEmitter,Tfe=B("fs").ReadStream,tB=B("stream"),ts=B("zlib");rB.exports=Ife;function Ife(e,t){return Dfe(e)?Ofe(e):Nfe(e)?Afe(e):$fe(e)&&e.destroy(),Rfe(e)&&t&&(e.removeAllListeners("error"),e.addListener("error",Pfe)),e}function Ofe(e){e.destroy(),typeof e.close=="function"&&e.on("open",jfe)}function Cfe(e){if(e._hadError===!0){var t=e._binding===null?"_binding":"_handle";e[t]={close:function(){this[t]=null}}}e.close()}function Afe(e){typeof e.destroy=="function"?e._binding?(e.destroy(),e._processing?(e._needDrain=!0,e.once("drain",qfe)):e._binding.clear()):e._destroy&&e._destroy!==tB.Transform.prototype._destroy?e.destroy():e._destroy&&typeof e.close=="function"?(e.destroyed=!0,e.close()):e.destroy():typeof e.close=="function"&&Cfe(e)}function $fe(e){return e instanceof tB&&typeof e.destroy=="function"}function Rfe(e){return e instanceof kfe}function Dfe(e){return e instanceof Tfe}function Nfe(e){return e instanceof ts.Gzip||e instanceof ts.Gunzip||e instanceof ts.Deflate||e instanceof ts.DeflateRaw||e instanceof ts.Inflate||e instanceof ts.InflateRaw||e instanceof ts.Unzip}function Pfe(){}function qfe(){this._binding.clear()}function jfe(){typeof this.fd=="number"&&this.close()}});var sB=w((dCe,oB)=>{"use strict";var iB=function(e,t){for(e=e.toString(16).toUpperCase();e.length<t;)e="0"+e;return e};oB.exports=function(e){var t=Math.ceil(e.length/16),r=e.length%16||16,i=e.length.toString(16).length;i<6&&(i=6);var n,o="",s=0,a,c,u;for(n=0;n<t;n++){o+="\x1B[36m"+iB(s,i)+"\x1B[0m ",a=n===t-1?r:16,c=16-a;var l;for(l=0;l<a;l++)o+=" "+iB(e[s],2),s++;for(l=0;l<c;l++)o+=" ";for(s-=a,o+=" ",l=0;l<a;l++)u=e[s],o+=u>31&&u<127||u>159?String.fromCharCode(u):".",s++;o+=`
|
|
214
|
+
`}return o}});var uB=w((pCe,cB)=>{"use strict";var St=B("util").debuglog("formstream"),Mfe=B("stream"),Lfe=B("crypto"),Ffe=Z6(),zfe=B("util"),Vm=Wl(),aB=B("path"),Ufe=B("fs"),Bfe=nB(),Yi=sB(),ST="--",ET=`\r
|
|
215
215
|
`,rs=Buffer.from(ET);function Ot(e){if(!(this instanceof Ot))return new Ot(e);Ot.super_.call(this),this._boundary=this._generateBoundary(),this._streams=[],this._buffers=[],this._endData=Buffer.from(ST+this._boundary+ST+ET),this._contentLength=0,this._isAllStreamSizeKnown=!0,this._knownStreamSize=0,this._minChunkSize=e&&e.minChunkSize||0,this.isFormStream=!0,St(`start boundary
|
|
216
216
|
%s`,this._boundary)}zfe.inherits(Ot,Mfe);cB.exports=Ot;Ot.prototype._generateBoundary=function(){return"--------------------------"+Lfe.randomBytes(12).toString("hex")};Ot.prototype.setTotalStreamSize=function(e){if(this._isAllStreamSizeKnown)return this;e=e||0;for(var t=0;t<this._streams.length;t++)e+=this._streams[t][0].length,e+=rs.length;return this._knownStreamSize=e,this._isAllStreamSizeKnown=!0,St("set total size: %s",e),this};Ot.prototype.headers=function(e){var t={"Content-Type":"multipart/form-data; boundary="+this._boundary};if(this._contentLength+=this._knownStreamSize,this._contentLength+=this._endData.length,this._isAllStreamSizeKnown&&(t["Content-Length"]=String(this._contentLength)),e)for(var r in e)t[r]=e[r];return St("headers: %j",t),t};Ot.prototype.file=function(e,t,r,i){typeof r=="number"&&!i&&(i=r,r=aB.basename(t)),r||(r=aB.basename(t));var n=Vm.getType(r),o=Ufe.createReadStream(t);return this.stream(e,o,r,n,i)};Ot.prototype.field=function(e,t,r){return Buffer.isBuffer(t)||(typeof t=="number"&&(t=String(t)),t=Buffer.from(t)),this.buffer(e,t,null,r)};Ot.prototype.stream=function(e,t,r,i,n){typeof i=="number"&&!n?(n=i,i=Vm.getType(r)):i||(i=Vm.getType(r)),t.once("error",this.emit.bind(this,"error")),this.once("destroy",function(){Bfe(t)});var o=this._leading({name:e,filename:r},i),s=Ffe().pause();return t.pipe(s),this._streams.push([o,s]),typeof n=="number"?(this._knownStreamSize+=o.length,this._knownStreamSize+=n,this._knownStreamSize+=rs.length):this._isAllStreamSizeKnown=!1,process.nextTick(this.resume.bind(this)),this};Ot.prototype.buffer=function(e,t,r,i){r&&!i&&(i=Vm.getType(r));var n={name:e};r&&(n.filename=r);var o=this._leading(n,i),s=o.length+t.length+rs.length;return this._buffers.push(Buffer.concat([o,t,rs],s)),this._contentLength+=s,process.nextTick(this.resume.bind(this)),St.enabled&&(t.length>512?St(`new buffer field, content size: %d
|
|
217
217
|
%s%s`,t.length,o.toString(),Yi(t.slice(0,512))):St(`new buffer field, content size: %d
|
|
@@ -224,16 +224,16 @@ Actual: `+E.attribValue);else{var ue=E.tag,be=E.tags[E.tags.length-1]||E;ue.ns==
|
|
|
224
224
|
%s`,l.length,n,i,Yi(l)))}}),c.on("end",function(){s.push(rs),o+=rs.length;let u=Buffer.concat(s,o);return r.emit("data",u),n++,u.length>512?St(`stream end, size %d, chunk index %d, stream size %d
|
|
225
225
|
%s...... only show 512 bytes ......`,u.length,n,i,Yi(u.slice(0,512))):St(`stream end, size %d, chunk index %d, stream size %d
|
|
226
226
|
%s`,u.length,n,i,Yi(u)),process.nextTick(r.drain.bind(r))}),c.resume()};Ot.prototype._emitEnd=function(){this.emit("data",this._endData),this.emit("end"),St.enabled&&St(`end boundary
|
|
227
|
-
%s`,this._endData.toString())};Ot.prototype.drain=function(){this._emitBuffers();var e=this._streams.shift();return e?this._minChunkSize&&this._minChunkSize>0?this._emitStreamWithChunkSize(e,this._minChunkSize):this._emitStream(e):this._emitEnd(),this};Ot.prototype.resume=function(){return this.paused=!1,this._draining||(this._draining=!0,this.drain()),this};Ot.prototype.close=Ot.prototype.destroy=function(){this.emit("destroy")}});var dB=w((
|
|
227
|
+
%s`,this._endData.toString())};Ot.prototype.drain=function(){this._emitBuffers();var e=this._streams.shift();return e?this._minChunkSize&&this._minChunkSize>0?this._emitStreamWithChunkSize(e,this._minChunkSize):this._emitStream(e):this._emitEnd(),this};Ot.prototype.resume=function(){return this.paused=!1,this._draining||(this._draining=!0,this.drain()),this};Ot.prototype.close=Ot.prototype.destroy=function(){this.emit("destroy")}});var dB=w((hCe,fB)=>{"use strict";function lB(e){return e.replace(/^\.*/,".").toLowerCase()}function Wfe(e){e=e.trim().toLowerCase();var t=e.split(":",2),r=lB(t[0]),i=t[1],n=e.indexOf(":")>-1;return{hostname:r,port:i,hasPort:n}}function Hfe(e,t){var r=e.port||(e.protocol==="https:"?"443":"80"),i=lB(e.hostname),n=t.split(",");return n.map(Wfe).some(function(o){var s=i.indexOf(o.hostname),a=s>-1&&s===i.length-o.hostname.length;return o.hasPort?r===o.port&&a:a})}function Vfe(e){var t=process.env.NO_PROXY||process.env.no_proxy||"";return t==="*"||t!==""&&Hfe(e,t)?null:e.protocol==="http:"?process.env.HTTP_PROXY||process.env.http_proxy||null:e.protocol==="https:"&&(process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy)||null}fB.exports=Vfe});var hB=w((mCe,TT)=>{"use strict";var pB=B("util").debuglog("urllib:detect_proxy_agent"),Zfe=dB(),kT={};function Gfe(e,t){if(!t.enableProxy&&!process.env.URLLIB_ENABLE_PROXY)return null;var r=t.proxy||process.env.URLLIB_PROXY;if(!r&&(r=Zfe(e),!r))return null;var i=kT[r];return i||(pB("create new proxy %s",r),i=kT[r]=new(B("proxy-agent"))(r)),pB("get proxy: %s",r),i}TT.exports=Gfe;TT.exports.proxyAgents=kT});var mB=w((gCe,Kfe)=>{Kfe.exports={name:"urllib",version:"2.44.1",publishConfig:{tag:"latest-2"},description:"Help in opening URLs (mostly HTTP) in a complex world \u2014 basic and digest authentication, redirections, cookies and more.",keywords:["urllib","http","urlopen","curl","wget","request","https"],author:"fengmk2 <fengmk2@gmail.com> (https://fengmk2.com)",homepage:"https://github.com/node-modules/urllib",main:"lib/index.js",types:"lib/index.d.ts",files:["lib"],repository:{type:"git",url:"git://github.com/node-modules/urllib.git"},scripts:{tsd:"node test/tsd.js","test-local":"mocha -t 30000 test/*.test.js",test:"npm run lint && npm run test-local","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- -t 30000 test/*.test.js",ci:"npm run lint && npm run tsd && npm run test-cov",lint:"jshint .",contributor:"git-contributor"},dependencies:{"any-promise":"^1.3.0","content-type":"^1.0.2","default-user-agent":"^1.0.0","digest-header":"^1.0.0","ee-first":"~1.1.1",formstream:"^1.1.0","humanize-ms":"^1.2.0","iconv-lite":"^0.6.3",pump:"^3.0.0",qs:"^6.4.0",statuses:"^1.3.1",utility:"^1.16.1"},peerDependencies:{"proxy-agent":"^5.0.0"},peerDependenciesMeta:{"proxy-agent":{optional:!0}},devDependencies:{"@types/mocha":"^5.2.5","@types/node":"^10.12.18",agentkeepalive:"^4.0.0",benchmark:"^2.1.4",bluebird:"*",busboy:"^0.2.14",co:"*",coffee:"1","git-contributor":"2","http-proxy":"^1.16.2",istanbul:"*",jshint:"*",mkdirp:"^0.5.1",mocha:"3",muk:"^0.5.3",pedding:"^1.1.0","proxy-agent":"^5.0.0",semver:"5",spy:"^1.0.0",tar:"^4.4.8",through2:"^2.0.3",tsd:"^0.18.0",typescript:"^4.4.4"},engines:{node:">= 0.10.0"},license:"MIT"}});var yB=w((yCe,gB)=>{"use strict";function IT(e){let t=String(e||"utf8").trim().toLowerCase().replace(/_/g,"-");return t==="utf-8"?"utf8":t}function Xfe(e){let t=IT(e);if(Buffer.isEncoding(t))return!0;try{return new TextDecoder(e),!0}catch{return!1}}function Jfe(e,t){let r=Buffer.isBuffer(e)?e:Buffer.from(e),i=IT(t);if(Buffer.isEncoding(i))return r.toString(i);try{return new TextDecoder(t).decode(r)}catch{return r.toString()}}function Yfe(e,t){let r=typeof e=="string"?e:String(e),i=IT(t);return Buffer.isEncoding(i)?Buffer.from(r,i):Buffer.from(r)}gB.exports={decode:Jfe,encode:Yfe,encodingExists:Xfe,encodings:{}}});var RT=w(Ct=>{"use strict";var Fe=B("util").debuglog("urllib"),Qfe=B("path"),ede=B("dns"),vB=B("net"),kB=B("http"),TB=B("https"),ns=B("url"),Hl=ns.URL,tde=B("util"),bB=Yk(),_B=B("querystring"),rde=B("zlib"),nde=b6(),ide=x6(),mc=Za(),ode=T6(),sde=A6(),ade=R6(),OT=wT(),Gm=Ki(),cde=uB(),ude=hB(),CT,AT,lde=mB(),fde=Ct.USER_AGENT=nde("node-urllib",lde.version),dde=parseInt(process.versions.node.split(".")[0]);Ct.agent=new kB.Agent;Ct.agent.maxSockets=1e3;Ct.httpsAgent=new TB.Agent;Ct.httpsAgent.maxSockets=1e3;var pde=`
|
|
228
228
|
--------------------
|
|
229
229
|
`;Ct.TIMEOUT=mc("5s");Ct.TIMEOUTS=[mc("5s"),mc("5s")];var $T=0,hde=Math.pow(2,31)-10,wB=/^v0\.10\.\d+$/.test(process.version),mde=/^v0\.12\.\d+$/.test(process.version),gde=["json","text"],xB=/^https?:\/\//i,IB=["authorization","cookie","proxy-authorization"];function yde(e){if(e.href)return e.href;var t=e.host||e.hostname;if(!t)return null;var r=e.protocol||"http:";return r.charAt(r.length-1)!==":"&&(r+=":"),e.port&&String(t).indexOf(":")===-1&&(t+=":"+e.port),r+"//"+t+(e.path||e.pathname||"/")}function vde(e,t){try{var r=yde(e);if(!r)return!0;if(Hl)return new Hl(r).origin!==new Hl(t,r).origin;var i=ns.parse(r),n=ns.parse(ns.resolve(r,t)),o=i.port||(i.protocol==="https:"?"443":"80"),s=n.port||(n.protocol==="https:"?"443":"80");return i.protocol!==n.protocol||i.hostname!==n.hostname||o!==s}catch{return!0}}function bde(e,t){var r=t||IB,i={};if(e)for(var n=Gm.getOwnEnumerables(e,!0),o=0;o<n.length;o++){var s=n[o];r.indexOf(s.toLowerCase())===-1&&(i[s]=e[s])}return i}var _de=/^timeout=(\d+)/i,SB="_URLLIB_SOCKET_REQUEST_COUNT",Zm="_URLLIB_SOCKET_RESPONSE_COUNT";Ct.request=function(t,r,i){return arguments.length===2&&typeof r=="function"&&(i=r,r=null),typeof i=="function"?Ct.requestWithCallback(t,r,i):(CT||(CT=El()),new CT(function(n,o){Ct.requestWithCallback(t,r,wde(n,o))}))};Ct.curl=Ct.request;function wde(e,t){return function(r,i,n){if(r)return t(r);e({data:i,status:n.statusCode,headers:n.headers,res:n})}}Ct.requestThunk=function(t,r){return function(i){Ct.requestWithCallback(t,r,function(n,o,s){if(n)return i(n);i(null,{data:o,status:s.statusCode,headers:s.headers,res:s})})}};function OB(e,t,r){var i;if(!e||typeof e!="string"&&typeof e!="object"){var n=tde.format("expect request url to be a string or a http request options, but got %j",e);throw new Error(n)}arguments.length===2&&typeof t=="function"&&(r=t,t=null),t=t||{},$T>=hde&&($T=0);var o=++$T;t.requestUrls=t.requestUrls||[],t.timeout=t.timeout||Ct.TIMEOUTS,t.maxRedirects=t.maxRedirects||10,t.streaming=t.streaming||t.customResponse;var s=Date.now(),a;typeof e=="string"?(xB.test(e)||(e="http://"+e),Hl?a=ns.parse(new Hl(e).href):a=ns.parse(e)):a=e;var c={requestId:o,url:a.href,args:t,ctx:t.ctx};t.emitter&&t.emitter.emit("request",c);var u=(t.type||t.method||a.method||"GET").toUpperCase(),l=a.port||80,f=kB,p=EB(t.agent,Ct.agent),d=t.fixJSONCtlChars;a.protocol==="https:"&&(f=TB,p=EB(t.httpsAgent,Ct.httpsAgent),a.port||(l=443));var h=ude(a,t);h&&(p=h);var m=t.lookup;if(t.checkAddress){var _=m||ede.lookup;m=function(Y,ve,Ae){_(Y,ve,function($e,Ue,pt){!$e&&!t.checkAddress(Ue,pt,Y)&&($e=new Error("illegal address"),$e.name="IllegalAddressError",$e.hostname=Y,$e.ip=Ue,$e.family=pt),Ae($e,Ue,pt)})}}var k=0,S={host:a.hostname||a.host||"localhost",path:a.path||"/",method:u,port:l,agent:p,headers:{},lookup:m},v={};if(t.headers)for(var g=Gm.getOwnEnumerables(t.headers,!0),y=0;y<g.length;y++){var T=g[y],R=T.toLowerCase();R!==T&&(v[R]=T),S.headers[R]=t.headers[T]}t.socketPath&&(S.socketPath=t.socketPath);for(var I=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],y=0;y<I.length;y++){var T=I[y];t.hasOwnProperty(T)&&(S[T]=t[T])}dde<12&&S.rejectUnauthorized===!1&&!S.hasOwnProperty("secureOptions")&&(S.secureOptions=B("constants").SSL_OP_NO_TLSv1_2);var b=t.auth||a.auth;b&&(S.auth=b);var O=null,A=!1;if(t.files){(!S.method||S.method==="GET"||S.method==="HEAD")&&(S.method="POST");var P=t.files,D=[];if(Array.isArray(P))for(var y=0;y<P.length;y++){var V="file"+(y===0?"":y);D.push([V,P[y]])}else if(Buffer.isBuffer(P)||typeof P.pipe=="function"||typeof P=="string")D.push(["file",P]);else if(typeof P=="object")for(var V in P)D.push([V,P[V]]);var $=new cde;if(t.data)for(var U in t.data)$.field(U,t.data[U]);for(var y=0;y<D.length;y++){var Z=D[y];if(Buffer.isBuffer(Z[1]))$.buffer(Z[0],Z[1],"bufferfile"+y);else if(typeof Z[1].pipe=="function"){var J=Z[1].path||"streamfile"+y;J=Qfe.basename(J),$.stream(Z[0],Z[1],J)}else $.file(Z[0],Z[1])}for(var j=$.headers(),pe=Gm.getOwnEnumerables(j,!0),y=0;y<pe.length;y++){var T=pe[y];S.headers[T.toLowerCase()]=j[T]}Fe("set multipart headers: %j, method: %s",j,S.method),t.stream=$}else if(O=t.content||t.data,A=u==="GET"||u==="HEAD"||t.dataAsQueryString,!t.content&&O&&!(typeof O=="string"||Buffer.isBuffer(O)))if(A)O=t.nestedQuerystring?bB.stringify(O):_B.stringify(O);else{var Q=S.headers["content-type"];Q||(t.contentType==="json"?Q="application/json":Q="application/x-www-form-urlencoded",S.headers["content-type"]=Q),CB(Q).type==="application/json"?O=JSON.stringify(O):O=t.nestedQuerystring?bB.stringify(O):_B.stringify(O)}if(O&&(A&&(S.path+=(a.query?"&":"?")+O,O=null),O)){var X=O.length;Buffer.isBuffer(O)||(X=Buffer.byteLength(O)),k=X,S.headers["content-length"]=X.toString()}t.dataType==="json"&&(S.headers.accept||(S.headers.accept="application/json")),typeof t.beforeRequest=="function"&&t.beforeRequest(S);var N=null,H=null,G=null,re=!1,q=!1,de=0,le=0,Oe=0,We=-1,E=null,x=!1,F="",C="",ue=null;t.timing&&(ue={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0});function be(){N&&(clearTimeout(N),N=null,Fe("Request#%d connect timer canceled",o))}function ne(){H&&(clearTimeout(H),H=null,Fe("Request#%d response timer canceled",o))}function Ce(Y,ve,Ae){if(be(),ne(),!r){console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),o,process.pid,S.method,e),Y&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
|
|
230
230
|
stack: %s`,Date(),o,process.pid,Y.name,Y.message,Y.stack);return}var at=r;r=null;var $e={};if(Ae&&(We=Ae.statusCode,E=Ae.statusMessage,$e=Ae.headers),!et(Ae,at)){var Ue=Et(ve,Ae);if(Fe("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j, socketHandledRequests: %s, socketHandledResponses: %s",Ue.requestUseTime,Oe,We,S.method,S.host,S.path,q,ue,de,le),Y){var pt="";p&&typeof p.getCurrentStatus=="function"&&(pt=", agent status: "+JSON.stringify(p.getCurrentStatus())),Y.message+=", "+S.method+" "+e+" "+We+" (connected: "+re+", keepalive socket: "+q+pt+", socketHandledRequests: "+de+", socketHandledResponses: "+le+`)
|
|
231
231
|
headers: `+JSON.stringify($e),Y.data=ve,Y.path=S.path,Y.status=We,Y.headers=$e,Y.res=Ue,Ode(Y,i)}var qn=p&&(p.options&&p.options.freeSocketTimeout||p.freeSocketKeepAliveTimeout);if(p&&p.keepAlive&&qn>0&&We>=200&&$e.connection==="keep-alive"&&$e["keep-alive"]){var jn=_de.exec($e["keep-alive"]);if(jn){var on=parseInt(jn[1]);if(on>0){var $c=on*1e3-500;if($c<qn){var hs=Ae.socket||i&&i.socket;p.options&&p.options.freeSocketTimeout?hs.freeSocketTimeout=$c:hs.freeSocketKeepAliveTimeout=$c}}}}at(Y,ve,t.streaming?Ae:Ue),Ge(Y,Ue)}}function rt(Y,ve){var Ae=Et(Y,ve);Ge(null,Ae)}function Et(Y,ve){var Ae=Date.now()-s;ue&&(ue.contentDownload=Ae);var at=ve&&ve.headers||{},$e=ve&&ve.statusCode||We,Ue=ve&&ve.statusMessage||E;return{status:$e,statusCode:$e,statusMessage:Ue,headers:at,size:Oe,aborted:x,rt:Ae,keepAliveSocket:q,data:Y,requestUrls:t.requestUrls,timing:ue,remoteAddress:F,remotePort:C,socketHandledRequests:de,socketHandledResponses:le}}function Ge(Y,ve){t.emitter&&(c.url=a.href,c.socket=i&&i.connection,c.options=S,c.size=k,t.emitter.emit("response",{requestId:o,error:Y,ctx:t.ctx,req:c,res:ve}))}function et(Y,ve){var Ae={};if(Y&&Y.headers&&(Ae=Y.headers),We===401&&Ae["www-authenticate"]&&!S.headers.authorization&&t.digestAuth){var at=Ae["www-authenticate"];if(at.indexOf("Digest ")>=0)return Fe("Request#%d %s: got digest auth header WWW-Authenticate: %s",o,e,at),S.headers.authorization=ide(S.method,S.path,at,t.digestAuth),Fe("Request#%d %s: auth with digest header: %s",o,e,S.headers.authorization),Y.headers["set-cookie"]&&(S.headers.cookie=Y.headers["set-cookie"].join(";")),t.headers=S.headers,Ct.requestWithCallback(e,t,ve),!0}return!1}function Ht(Y){var ve=null;if(t.followRedirect&&ode.redirect[Y.statusCode]){t._followRedirectCount=(t._followRedirectCount||0)+1;var Ae=Y.headers.location;if(!Ae)ve=new Error("Got statusCode "+Y.statusCode+" but cannot resolve next location from headers"),ve.name="FollowRedirectError";else if(t._followRedirectCount>t.maxRedirects)ve=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+e),ve.name="MaxRedirectError";else{var at=t.formatRedirectUrl?t.formatRedirectUrl(e,Ae):ns.resolve(e,Ae);if(Fe("Request#%d %s: `redirected` from %s to %s",o,S.path,e,at),ne(),S.headers.host&&xB.test(Ae)&&(S.headers.host=null,t.headers=S.headers),vde(a,at)){var $e=Object.assign({},t),Ue=IB;h&&(Ue=Ue.filter(function(qn){return qn!=="proxy-authorization"})),$e.headers=bde(t.headers||S.headers,Ue),$e.auth=null,$e.digestAuth=null,t=$e}var pt=r;return r=null,Ct.requestWithCallback(at,t,pt),{redirect:!0,error:null}}}return{redirect:!1,error:ve}}if(t.headers&&(t.headers["User-Agent"]===null||t.headers["user-agent"]===null))S.headers["user-agent"]&&delete S.headers["user-agent"];else{var kt=S.headers["user-agent"];kt||(S.headers["user-agent"]=fde)}if(t.gzip){var nt=t.headers&&(t.headers["Accept-Encoding"]===null||t.headers["accept-encoding"]===null);if(!nt){var _e=S.headers["accept-encoding"];_e||(S.headers["accept-encoding"]="gzip, deflate")}}function M(Y,ve,Ae){if(x){Fe("Request#%d %s: Remote socket was terminated before `response.end()` was called",o,e);var at=me||new Error("Remote socket was terminated before `response.end()` was called");return Ae(at)}var $e=Y.headers["content-encoding"];if(ve.length===0||!$e)return Ae(null,ve,$e);switch($e=$e.toLowerCase(),$e){case"gzip":case"deflate":Fe("unzip %d length body",ve.length),rde.unzip(ve,function(Ue,pt){Ue&&Ue.name==="Error"&&(Ue.name="UnzipError"),Ae(Ue,pt)});break;default:Ae(null,ve,$e)}}var L=t.writeStream,K=!1;Fe("Request#%d %s %s with headers %j, options.path: %s",o,u,e,S.headers,S.path),t.requestUrls.push(a.href);var ee=!1,me;function Te(Y){if(ee=!0,le=Y.socket[Zm]=(Y.socket[Zm]||0)+1,ue&&(ue.waiting=Date.now()-s),Fe("Request#%d %s `req response` event emit: status %d, headers: %j",o,e,Y.statusCode,Y.headers),t.streaming){var ve=Ht(Y);if(ve.redirect){Y.resume(),rt(null,Y);return}return ve.error?(Y.resume(),Ce(ve.error,null,Y)):Ce(null,null,Y)}if(Y.on("error",function(Ue){me=Ue,Fe("Request#%d %s: `res error` event emit, total size %d, socket handled %s requests and %s responses",o,e,Oe,de,le)}),Y.on("aborted",function(){x=!0,Fe("Request#%d %s: `res aborted` event emit, total size %d",o,e,Oe)}),L){var ve=Ht(Y);if(ve.redirect){Y.resume(),rt(null,Y);return}if(ve.error){Y.resume(),L.end(),Ce(ve.error,null,Y);return}if(t.consumeWriteStream===!1){Y.on("end",Ce.bind(null,null,null,Y)),OT(Y,L,function(pt){K||(K=!0,Fe("Request#%d %s: writeStream close, error: %s",o,e,pt))});return}if(wB||mde){ade([[L,"close"],[Y,"aborted"]],function(pt,qn,jn){Fe("Request#%d %s: writeStream or res %s event emitted",o,e,jn),Ce(G||null,null,Y)}),Y.pipe(L);return}Fe("Request#%d %s: pump res to writeStream",o,e),OT(Y,L,function(pt){Fe("Request#%d %s: writeStream close event emitted, error: %s, isWriteStreamClose: %s",o,e,pt,K),!K&&(K=!0,Ce(G||pt,null,Y))});return}var Ae=[];Y.on("data",function(Ue){Fe("Request#%d %s: `res data` event emit, size %d",o,e,Ue.length),Oe+=Ue.length,Ae.push(Ue)});var at=!1;function $e(Ue){if(Fe("Request#%d %s: `res %s` event emit, total size %d, socket handled %s requests and %s responses",o,e,Ue,Oe,de,le),!at){at=!0;var pt=Buffer.concat(Ae,Oe);if(Fe("Request#%d %s: _dumped: %s",o,e,Y._dumped),G)return Ce(G,pt,Y);var qn=Ht(Y);if(qn.error)return Ce(qn.error,pt,Y);if(qn.redirect){rt(null,Y);return}M(Y,pt,function(jn,on,$c){if(jn)return Ce(jn,pt,Y);if(!$c&&gde.indexOf(t.dataType)>=0){try{on=Ide(on,Y)}catch(bZ){return Fe("decodeBodyByCharset error: %s",bZ),Ce(null,on,Y)}if(t.dataType==="json")if(Oe===0)on=null;else{var hs=Tde(on,d);hs.error?jn=hs.error:on=hs.data}}Ce(jn,on,Y)})}}Y.on("close",function(){$e("close")}),Y.on("end",function(){$e("end")})}var Ne,ge;Array.isArray(t.timeout)?(Ne=mc(t.timeout[0]),ge=mc(t.timeout[1])):Ne=ge=mc(t.timeout),Fe("ConnectTimeout: %d, ResponseTimeout: %d",Ne,ge);function Je(){Fe("Connect timer ticking, timeout: %d",Ne),N=setTimeout(function(){N=null,We===-1&&(We=-2);var Y="Connect timeout for "+Ne+"ms",ve="ConnectionTimeoutError";i.socket||(ve="SocketAssignTimeoutError",Y+=", working sockets is full"),G=new Error(Y),G.name=ve,G.requestId=o,Fe("ConnectTimeout: Request#%d %s %s: %s, connected: %s",o,e,G.name,Y,re),Pn()},Ne)}function st(){Fe("Response timer ticking, timeout: %d",ge),H=setTimeout(function(){H=null;var Y="Response timeout for "+ge+"ms",ve="ResponseTimeoutError";G=new Error(Y),G.name=ve,G.requestId=o,Fe("ResponseTimeout: Request#%d %s %s: %s, connected: %s",o,e,G.name,Y,re),Pn()},ge)}if(t.checkAddress){var jt=a.hostname,Vt=null;if(vB.isIPv4(jt)?Vt=4:vB.isIPv6(jt)&&(Vt=6),Vt&&!t.checkAddress(jt,Vt,jt)){var nn=new Error("illegal address");return nn.name="IllegalAddressError",nn.hostname=jt,nn.ip=jt,nn.family=Vt,Ce(nn)}}try{var ro=S;if(t.keepHeaderCase){var Ry=Object.keys(v);if(Ry.length){for(var ff={},g=Gm.getOwnEnumerables(S.headers,!0),y=0;y<g.length;y++){var T=g[y];ff[v[T]||T]=S.headers[T]}ro=Object.assign({},S),ro.headers=ff}}i=f.request(ro,Te),t.trace&&(i._callSite={},Error.captureStackTrace(i._callSite,OB))}catch(Y){return Ce(Y)}typeof window>"u"&&Je();var Zt=!1;function Pn(){Zt||(Zt=!0,Fe("Request#%d %s abort, connected: %s",o,e,re),i.socket||(G.noSocket=!0,Ce(G)),i.abort())}ue&&i.on("finish",function(){ue.requestSent=Date.now()-s}),i.once("socket",function(Y){ue&&(ue.queuing=Date.now()-s),wB&&Y.socket&&(Y=Y.socket);var ve=Cde(Y);if(ve&&ve<ge){var Ae=ge+500;Fe("Request#%d socket.timeout(%s) < responseTimeout(%s), reset socket timeout to %s",o,ve,ge,Ae),Y.setTimeout(Ae)}de=Y[SB]=(Y[SB]||0)+1,Y[Zm]&&(le=Y[Zm]);var at=Y.readyState;if(at==="opening"){Y.once("lookup",function($e,Ue,pt){Fe("Request#%d %s lookup: %s, %s, %s",o,e,$e,Ue,pt),ue&&(ue.dnslookup=Date.now()-s),Ue&&(F=Ue)}),Y.once("connect",function(){ue&&(ue.connected=Date.now()-s),be(),st(),Fe("Request#%d %s new socket connected",o,e),re=!0,F||(F=Y.remoteAddress),C=Y.remotePort});return}Fe("Request#%d %s reuse socket connected, readyState: %s",o,e,at),re=!0,q=!0,F||(F=Y.remoteAddress),C=Y.remotePort,be(),st()}),L&&L.once("error",function(Y){Y.message+=' (writeStream "error")',G=Y,Fe("Request#%d %s `writeStream error` event emit, %s: %s",o,e,Y.name,Y.message),Pn()});var no=!1;function di(Y){Y&&(no&&ee||(no=!0,Y.name==="Error"&&(Y.name=re?"ResponseError":"RequestError"),Fe("Request#%d %s `req error` event emit, %s: %s",o,e,Y.name,Y.message),Ce(G||Y)))}return t.stream?(Fe("Request#%d pump args.stream to req",o),OT(t.stream,i,di)):i.end(O,function(){no=!0}),i.on("error",di),i.requestId=o,i}Ct.requestWithCallback=OB;var xde={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Sde=/[\u0000-\u001F\u005C]/g;function Ede(e){return xde[e]||"\\u"+(e.charCodeAt(0)+65536).toString(16).substr(1)}function kde(e){return e.replace(Sde,Ede)}function Tde(e,t){var r={error:null,data:null};t&&(typeof t=="function"?e=t(e):e=kde(e));try{r.data=JSON.parse(e)}catch(i){i.name==="SyntaxError"&&(i.name="JSONResponseFormatError"),e.length>1024?i.message+=" (data json format: "+JSON.stringify(e.slice(0,512))+" ...skip... "+JSON.stringify(e.slice(e.length-512))+")":i.message+=" (data json format: "+JSON.stringify(e)+")",r.error=i}return r}function Ide(e,t){var r=t.headers["content-type"];if(!r)return e.toString();var r=CB(r),i=r.parameters.charset||"utf-8";return Buffer.isEncoding(i)?e.toString(i):(AT||(AT=yB()),AT.decode(e,i))}function EB(e,t){return e===void 0?t:e}function CB(e){try{return sde.parse(e)}catch{return{parameters:{}}}}function Ode(e,t){if(t){var r=t._callSite&&t._callSite.stack;if(!(!r||typeof r!="string")&&!e._longStack){var i=r.indexOf(`
|
|
232
|
-
`);i!==-1&&(e._longStack=!0,e.stack+=pde+r.substr(i+1))}}}function Cde(e){return e.timeout||e._idleTimeout}});var DT=w((vCe,RB)=>{"use strict";var AB=B("events").EventEmitter,Ade=B("util"),$B=Ki(),Km=RT();RB.exports=Vl;function Vl(e){AB.call(this),e=e||{},e.agent!==void 0?(this.agent=e.agent,this.hasCustomAgent=!0):(this.agent=Km.agent,this.hasCustomAgent=!1),e.httpsAgent!==void 0?(this.httpsAgent=e.httpsAgent,this.hasCustomHttpsAgent=!0):(this.httpsAgent=Km.httpsAgent,this.hasCustomHttpsAgent=!1),this.defaultArgs=e.defaultArgs}Ade.inherits(Vl,AB);Vl.prototype.request=Vl.prototype.curl=function(e,t,r){return typeof t=="function"&&(r=t,t=null),t=t||{},this.defaultArgs&&(t=$B.assign({},[this.defaultArgs,t])),t.emitter=this,t.agent=Xm(t.agent,this.agent),t.httpsAgent=Xm(t.httpsAgent,this.httpsAgent),Km.request(e,t,r)};Vl.prototype.requestThunk=function(e,t){return t=t||{},this.defaultArgs&&(t=$B.assign({},[this.defaultArgs,t])),t.emitter=this,t.agent=Xm(t.agent,this.agent),t.httpsAgent=Xm(t.httpsAgent,this.httpsAgent),Km.requestThunk(e,t)};function Xm(e,t){return e===void 0?t:e}});var PB=w((bCe,NB)=>{"use strict";var $de=B("util"),Jm=B("util").debuglog("urllib"),Rde=Za(),PT=DT(),NT;NB.exports=Zl;function Zl(e){PT.call(this,e)}$de.inherits(Zl,PT);Zl.prototype.request=Zl.prototype.curl=function(t,r){var i=this;return r=r||{},r.retry=r.retry||0,r.retryDelay&&(r.retryDelay=Rde(r.retryDelay)),r.isRetry=r.isRetry||function(n){return n.status>=500},PT.prototype.request.call(i,t,r).then(function(n){return r.retry>0&&typeof r.isRetry=="function"&&r.isRetry(n)?(r.retry--,Jm("retry request %s, remain %s",t,r.retry),r.retryDelay?(Jm("retry after %sms",r.retryDelay),DB(r.retryDelay).then(function(){return i.request(t,r)})):i.request(t,r)):n}).catch(function(n){if(r.retry>0)return r.retry--,Jm("retry request %s, remain %s, err %s",t,r.retry,n),r.retryDelay?(Jm("retry after %sms",r.retryDelay),DB(r.retryDelay).then(function(){return i.request(t,r)})):i.request(t,r);throw n})};Zl.prototype.requestThunk=function(t,r){var i=this;return function(n){i.request(t,r).then(function(o){var s=n;n=null,s(null,o)}).catch(function(o){n&&n(o)})}};function DB(e){return NT||(NT=El()),new NT(function(t){setTimeout(t,e)})}});var qT=w(xr=>{"use strict";var ci=RT();xr.USER_AGENT=ci.USER_AGENT;xr.TIMEOUT=ci.TIMEOUT;xr.TIMEOUTS=ci.TIMEOUTS;xr.agent=ci.agent;xr.httpsAgent=ci.httpsAgent;xr.curl=ci.curl;xr.request=ci.request;xr.requestWithCallback=ci.requestWithCallback;xr.requestThunk=ci.requestThunk;xr.HttpClient=DT();xr.HttpClient2=PB();xr.create=function(e){return new xr.HttpClient(e)}});var qB=w((wCe,Dde)=>{Dde.exports={name:"ali-oss",version:"6.23.0",description:"aliyun oss(object storage service) node client",main:"./lib/client.js",files:["lib","shims","dist"],browser:{"./lib/client.js":"./dist/aliyun-oss-sdk.js",mime:"mime/lite",urllib:"./shims/xhr.js",utility:"./shims/utility.js",crypto:"./shims/crypto/crypto.js",debug:"./shims/debug",fs:!1,child_process:!1,"is-type-of":"./shims/is-type-of.js"},scripts:{"build-change-log":"standard-version",test:"npm run tsc && mocha -t 120000 -r should -r dotenv/config test/node/*.test.js test/node/**/*.test.js","test-cov":"npm run tsc && nyc --reporter=lcov node_modules/.bin/_mocha -t 120000 -r should test/node/*.test.js test/node/**/*.test.js",jshint:"jshint .","build-test":"mkdir -p ./test/browser/build && MINIFY=1 node browser-build.js > test/browser/build/aliyun-oss-sdk.min.js && node -r dotenv/config task/browser-test-build.js > test/browser/build/tests.js","browser-test":"npm run build-test && karma start","build-dist":"npm run tsc && node browser-build.js > dist/aliyun-oss-sdk.js && MINIFY=1 node browser-build.js > dist/aliyun-oss-sdk.min.js","publish-to-npm":"node publish-npm-check.js && npm publish","publish-to-cdn":"node publish.js","snyk-protect":"snyk-protect","lint-staged":"lint-staged","detect-secrets":"node task/detect-secrets",tsc:"npm run tsc:clean && npm run tsc:build","tsc:build":"tsc -b tsconfig.json tsconfig-cjs.json","tsc:watch":"tsc -b tsconfig.json tsconfig-cjs.json --watch","tsc:clean":"tsc -b tsconfig.json tsconfig-cjs.json --clean ",prepare:"husky install"},"git-pre-hooks":{"pre-release":"npm run build-dist","post-release":["npm run publish-to-npm","npm run publish-to-cdn"]},homepage:"https://github.com/ali-sdk/ali-oss",bugs:{url:"https://github.com/ali-sdk/ali-oss/issues"},publishConfig:{registry:"https://registry.npmjs.org/",access:"public"},repository:{type:"git",url:"https://github.com/ali-sdk/ali-oss.git"},keywords:["oss","client","file","aliyun"],author:"dead_horse",license:"MIT",engines:{node:">=8"},devDependencies:{"@alicloud/openapi-client":"^0.4.10","@alicloud/resourcemanager20200331":"^2.3.0","@alicloud/tea-util":"^1.4.9","@babel/core":"^7.11.6","@babel/plugin-transform-regenerator":"^7.10.4","@babel/plugin-transform-runtime":"^7.11.5","@babel/preset-env":"^7.11.5","@babel/runtime":"^7.11.2","@commitlint/cli":"^17.6.7","@commitlint/config-conventional":"^16.2.4","@octokit/core":"^5.0.0","@semantic-release/exec":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^10.0.5","@snyk/protect":"^1.1196.0","@types/node":"^14.0.12","@typescript-eslint/eslint-plugin":"^5.0.0","@typescript-eslint/parser":"^5.0.0",aliasify:"^2.0.0",axios:"^0.27.2",babelify:"^10.0.0","beautify-benchmark":"^0.2.4",benchmark:"^2.1.1",bluebird:"^3.1.5",browserify:"^17.0.0","core-js":"^3.6.5","crypto-js":"^4.2.0",dotenv:"^8.2.0",eslint:"^8.44.0","eslint-config-airbnb":"^19.0.4","eslint-config-ali":"^13.0.0","eslint-config-prettier":"^8.8.0","eslint-plugin-import":"^2.21.1","eslint-plugin-jsx-a11y":"^6.0.3","eslint-plugin-prettier":"^4.2.1",filereader:"^0.10.3","form-data":"^4.0.0","git-pre-hooks":"^1.2.0",husky:"^7.0.4",immediate:"^3.3.0",karma:"^6.3.4","karma-browserify":"^8.1.0","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.0.1","karma-ie-launcher":"^1.0.0","karma-mocha":"^2.0.1","karma-safari-launcher":"^1.0.0","lint-staged":"^12.4.1",mm:"^2.0.0",mocha:"^9.1.2",nise:"5.1.4",nyc:"^15.1.0",prettier:"^3.0.0","promise-polyfill":"^6.0.2",puppeteer:"19.0.0","semantic-release":"^21.1.1",should:"^11.0.0",sinon:"^15.2.0","standard-version":"^9.3.1","stream-equal":"^1.1.0",timemachine:"^0.3.0",typescript:"^3.9.5","uglify-js":"^3.14.2",watchify:"^4.0.0"},dependencies:{address:"^1.2.2",agentkeepalive:"^3.4.1",bowser:"^1.6.0","copy-to":"^2.0.1",dateformat:"^2.0.0",debug:"^4.3.4",destroy:"^1.0.4","end-or-error":"^1.0.1","get-ready":"^1.0.0","humanize-ms":"^1.2.0","is-type-of":"^1.4.0","js-base64":"^2.5.2",jstoxml:"^2.0.0",lodash:"^4.17.21","merge-descriptors":"^1.0.1",mime:"^2.4.5",platform:"^1.3.1",pump:"^3.0.0",qs:"^6.4.0","sdk-base":"^2.0.1","stream-http":"2.8.2","stream-wormhole":"^1.0.4",urllib:"^2.44.0",utility:"^1.18.0",xml2js:"^0.6.2"},snyk:!0,"lint-staged":{"**/!(dist)/*":["npm run detect-secrets --"],"**/*.{js,ts}":["eslint --cache --fix --ext .js,.ts","prettier --write","git add"]}}});var MB=w((jB,Ym)=>{(function(e,t,r){typeof Ym<"u"&&Ym.exports?Ym.exports=r():typeof define=="function"&&define.amd?define(t,r):e[t]=r()})(jB,"bowser",function(){var e=!0;function t(c){function u(j){var pe=c.match(j);return pe&&pe.length>1&&pe[1]||""}function l(j){var pe=c.match(j);return pe&&pe.length>1&&pe[2]||""}var f=u(/(ipod|iphone|ipad)/i).toLowerCase(),p=/like android/i.test(c),d=!p&&/android/i.test(c),h=/nexus\s*[0-6]\s*/i.test(c),m=!h&&/nexus\s*[0-9]+/i.test(c),_=/CrOS/.test(c),k=/silk/i.test(c),S=/sailfish/i.test(c),v=/tizen/i.test(c),g=/(web|hpw)(o|0)s/i.test(c),y=/windows phone/i.test(c),T=/SamsungBrowser/i.test(c),R=!y&&/windows/i.test(c),I=!f&&!k&&/macintosh/i.test(c),b=!d&&!S&&!v&&!g&&/linux/i.test(c),O=l(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),A=u(/version\/(\d+(\.\d+)?)/i),P=/tablet/i.test(c)&&!/tablet pc/i.test(c),D=!P&&/[^-]mobi/i.test(c),V=/xbox/i.test(c),$;/opera/i.test(c)?$={name:"Opera",opera:e,version:A||u(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(c)?$={name:"Opera",opera:e,version:u(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||A}:/SamsungBrowser/i.test(c)?$={name:"Samsung Internet for Android",samsungBrowser:e,version:A||u(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/Whale/i.test(c)?$={name:"NAVER Whale browser",whale:e,version:u(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)}:/MZBrowser/i.test(c)?$={name:"MZ Browser",mzbrowser:e,version:u(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/coast/i.test(c)?$={name:"Opera Coast",coast:e,version:A||u(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/focus/i.test(c)?$={name:"Focus",focus:e,version:u(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)}:/yabrowser/i.test(c)?$={name:"Yandex Browser",yandexbrowser:e,version:A||u(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(c)?$={name:"UC Browser",ucbrowser:e,version:u(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(c)?$={name:"Maxthon",maxthon:e,version:u(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(c)?$={name:"Epiphany",epiphany:e,version:u(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(c)?$={name:"Puffin",puffin:e,version:u(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(c)?$={name:"Sleipnir",sleipnir:e,version:u(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(c)?$={name:"K-Meleon",kMeleon:e,version:u(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:y?($={name:"Windows Phone",osname:"Windows Phone",windowsphone:e},O?($.msedge=e,$.version=O):($.msie=e,$.version=u(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(c)?$={name:"Internet Explorer",msie:e,version:u(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:_?$={name:"Chrome",osname:"Chrome OS",chromeos:e,chromeBook:e,chrome:e,version:u(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(c)?$={name:"Microsoft Edge",msedge:e,version:O}:/vivaldi/i.test(c)?$={name:"Vivaldi",vivaldi:e,version:u(/vivaldi\/(\d+(\.\d+)?)/i)||A}:S?$={name:"Sailfish",osname:"Sailfish OS",sailfish:e,version:u(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(c)?$={name:"SeaMonkey",seamonkey:e,version:u(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(c)?($={name:"Firefox",firefox:e,version:u(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(c)&&($.firefoxos=e,$.osname="Firefox OS")):k?$={name:"Amazon Silk",silk:e,version:u(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(c)?$={name:"PhantomJS",phantom:e,version:u(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(c)?$={name:"SlimerJS",slimer:e,version:u(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(c)||/rim\stablet/i.test(c)?$={name:"BlackBerry",osname:"BlackBerry OS",blackberry:e,version:A||u(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:g?($={name:"WebOS",osname:"WebOS",webos:e,version:A||u(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(c)&&($.touchpad=e)):/bada/i.test(c)?$={name:"Bada",osname:"Bada",bada:e,version:u(/dolfin\/(\d+(\.\d+)?)/i)}:v?$={name:"Tizen",osname:"Tizen",tizen:e,version:u(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||A}:/qupzilla/i.test(c)?$={name:"QupZilla",qupzilla:e,version:u(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||A}:/chromium/i.test(c)?$={name:"Chromium",chromium:e,version:u(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||A}:/chrome|crios|crmo/i.test(c)?$={name:"Chrome",chrome:e,version:u(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:d?$={name:"Android",version:A}:/safari|applewebkit/i.test(c)?($={name:"Safari",safari:e},A&&($.version=A)):f?($={name:f=="iphone"?"iPhone":f=="ipad"?"iPad":"iPod"},A&&($.version=A)):/googlebot/i.test(c)?$={name:"Googlebot",googlebot:e,version:u(/googlebot\/(\d+(\.\d+))/i)||A}:$={name:u(/^(.*)\/(.*) /),version:l(/^(.*)\/(.*) /)},!$.msedge&&/(apple)?webkit/i.test(c)?(/(apple)?webkit\/537\.36/i.test(c)?($.name=$.name||"Blink",$.blink=e):($.name=$.name||"Webkit",$.webkit=e),!$.version&&A&&($.version=A)):!$.opera&&/gecko\//i.test(c)&&($.name=$.name||"Gecko",$.gecko=e,$.version=$.version||u(/gecko\/(\d+(\.\d+)?)/i)),!$.windowsphone&&(d||$.silk)?($.android=e,$.osname="Android"):!$.windowsphone&&f?($[f]=e,$.ios=e,$.osname="iOS"):I?($.mac=e,$.osname="macOS"):V?($.xbox=e,$.osname="Xbox"):R?($.windows=e,$.osname="Windows"):b&&($.linux=e,$.osname="Linux");function U(j){switch(j){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}var Z="";$.windows?Z=U(u(/Windows ((NT|XP)( \d\d?.\d)?)/i)):$.windowsphone?Z=u(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):$.mac?(Z=u(/Mac OS X (\d+([_\.\s]\d+)*)/i),Z=Z.replace(/[_\s]/g,".")):f?(Z=u(/os (\d+([_\s]\d+)*) like mac os x/i),Z=Z.replace(/[_\s]/g,".")):d?Z=u(/android[ \/-](\d+(\.\d+)*)/i):$.webos?Z=u(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):$.blackberry?Z=u(/rim\stablet\sos\s(\d+(\.\d+)*)/i):$.bada?Z=u(/bada\/(\d+(\.\d+)*)/i):$.tizen&&(Z=u(/tizen[\/\s](\d+(\.\d+)*)/i)),Z&&($.osversion=Z);var J=!$.windows&&Z.split(".")[0];return P||m||f=="ipad"||d&&(J==3||J>=4&&!D)||$.silk?$.tablet=e:(D||f=="iphone"||f=="ipod"||d||h||$.blackberry||$.webos||$.bada)&&($.mobile=e),$.msedge||$.msie&&$.version>=10||$.yandexbrowser&&$.version>=15||$.vivaldi&&$.version>=1||$.chrome&&$.version>=20||$.samsungBrowser&&$.version>=4||$.whale&&o([$.version,"1.0"])===1||$.mzbrowser&&o([$.version,"6.0"])===1||$.focus&&o([$.version,"1.0"])===1||$.firefox&&$.version>=20||$.safari&&$.version>=6||$.opera&&$.version>=10||$.ios&&$.osversion&&$.osversion.split(".")[0]>=6||$.blackberry&&$.version>=10.1||$.chromium&&$.version>=20?$.a=e:$.msie&&$.version<10||$.chrome&&$.version<20||$.firefox&&$.version<20||$.safari&&$.version<6||$.opera&&$.version<10||$.ios&&$.osversion&&$.osversion.split(".")[0]<6||$.chromium&&$.version<20?$.c=e:$.x=e,$}var r=t(typeof navigator<"u"&&navigator.userAgent||"");r.test=function(c){for(var u=0;u<c.length;++u){var l=c[u];if(typeof l=="string"&&l in r)return!0}return!1};function i(c){return c.split(".").length}function n(c,u){var l=[],f;if(Array.prototype.map)return Array.prototype.map.call(c,u);for(f=0;f<c.length;f++)l.push(u(c[f]));return l}function o(c){for(var u=Math.max(i(c[0]),i(c[1])),l=n(c,function(f){var p=u-i(f);return f=f+new Array(p+1).join(".0"),n(f.split("."),function(d){return new Array(20-d.length).join("0")+d}).reverse()});--u>=0;){if(l[0][u]>l[1][u])return 1;if(l[0][u]===l[1][u]){if(u===0)return 0}else return-1}}function s(c,u,l){var f=r;typeof u=="string"&&(l=u,u=void 0),u===void 0&&(u=!1),l&&(f=t(l));var p=""+f.version;for(var d in c)if(c.hasOwnProperty(d)&&f[d]){if(typeof c[d]!="string")throw new Error("Browser version in the minVersion map should be a string: "+d+": "+String(c));return o([p,c[d]])<0}return u}function a(c,u,l){return!s(c,u,l)}return r.isUnsupportedBrowser=s,r.compareVersions=o,r.check=a,r._detect=t,r.detect=t,r})});var zB=w((xCe,Gl)=>{var Nde=B("stream");function jT(e){return e instanceof Nde.Stream}function LB(e){return jT(e)&&typeof e._read=="function"&&typeof e._readableState=="object"}function FB(e){return jT(e)&&typeof e._write=="function"&&typeof e._writableState=="object"}function Pde(e){return LB(e)&&FB(e)}Gl.exports=jT;Gl.exports.isReadable=LB;Gl.exports.isWritable=FB;Gl.exports.isDuplex=Pde});var UB=w((Kl,Qm)=>{(function(e){var t=Function.prototype.toString;function r(n){return t.call(n).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}function i(n){return typeof n=="function"&&(/^class(?:\s|{)/.test(t.call(n))||/^.*classCallCheck\(/.test(r(n)))}typeof Kl<"u"?(typeof Qm<"u"&&Qm.exports&&(Kl=Qm.exports=i),Kl.isClass=i):typeof define=="function"&&define.amd?define([],function(){return i}):e.isClass=i})(Kl)});var is=w(ze=>{"use strict";var eg=mo(),rg=zB(),qde=UB();Object.keys(eg).map(function(e){ze[jde(e)]=eg[e]});ze.stream=rg;ze.readableStream=rg.isReadable;ze.writableStream=rg.isWritable;ze.duplexStream=rg.isDuplex;ze.class=qde;ze.finite=Number.isFinite;ze.NaN=Number.isNaN;ze.generator=function(e){return e&&typeof e.next=="function"&&typeof e.throw=="function"};ze.generatorFunction=function(e){return e&&e.constructor&&e.constructor.name==="GeneratorFunction"};ze.asyncFunction=function(e){return e&&e.constructor&&e.constructor.name==="AsyncFunction"};ze.promise=function(e){return e&&typeof e.then=="function"};var tg=Math.pow(2,31);ze.int=function(e){return eg.isNumber(e)&&e%1===0};ze.int32=function(e){return ze.int(e)&&e<tg&&e>=-tg};ze.long=function(e){return ze.int(e)&&(e>=tg||e<-tg)};ze.Long=function(e){return ze.object(e)&&ze.number(e.high)&&ze.number(e.low)};ze.double=function(e){return eg.isNumber(e)&&!isNaN(e)&&e%1!==0};ze.bigInt=function(e){return typeof e=="bigint"};ze.bigint=ze.bigInt;ze.date=function(t){return t instanceof Date};ze.regExp=function(t){return t instanceof RegExp};ze.regexp=ze.regExp;ze.error=function(t){return t instanceof Error};ze.array=Array.isArray;function jde(e){var t=e.slice(2);return t=t[0].toLowerCase()+t.slice(1),t}});var Sr=w(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});ng.isObject=void 0;ng.isObject=e=>Object.prototype.toString.call(e)==="[object Object]"});var BB=w(ig=>{"use strict";Object.defineProperty(ig,"__esModule",{value:!0});ig.lowercaseKeyHeader=void 0;var Mde=Sr();function Lde(e){let t={};return Mde.isObject(e)&&Object.keys(e).forEach(r=>{t[r.toLowerCase()]=e[r]}),t}ig.lowercaseKeyHeader=Lde});var HB=w((TCe,WB)=>{var Fde=typeof global=="object"&&global&&global.Object===Object&&global;WB.exports=Fde});var ZB=w((ICe,VB)=>{var zde=HB(),Ude=typeof self=="object"&&self&&self.Object===Object&&self,Bde=zde||Ude||Function("return this")();VB.exports=Bde});var og=w((OCe,GB)=>{var Wde=ZB(),Hde=Wde.Symbol;GB.exports=Hde});var XB=w((CCe,KB)=>{function Vde(e,t){for(var r=-1,i=e==null?0:e.length,n=Array(i);++r<i;)n[r]=t(e[r],r,e);return n}KB.exports=Vde});var sg=w((ACe,JB)=>{var Zde=Array.isArray;JB.exports=Zde});var t3=w(($Ce,e3)=>{var YB=og(),QB=Object.prototype,Gde=QB.hasOwnProperty,Kde=QB.toString,Xl=YB?YB.toStringTag:void 0;function Xde(e){var t=Gde.call(e,Xl),r=e[Xl];try{e[Xl]=void 0;var i=!0}catch{}var n=Kde.call(e);return i&&(t?e[Xl]=r:delete e[Xl]),n}e3.exports=Xde});var n3=w((RCe,r3)=>{var Jde=Object.prototype,Yde=Jde.toString;function Qde(e){return Yde.call(e)}r3.exports=Qde});var MT=w((DCe,s3)=>{var i3=og(),epe=t3(),tpe=n3(),rpe="[object Null]",npe="[object Undefined]",o3=i3?i3.toStringTag:void 0;function ipe(e){return e==null?e===void 0?npe:rpe:o3&&o3 in Object(e)?epe(e):tpe(e)}s3.exports=ipe});var LT=w((NCe,a3)=>{function ope(e){return e!=null&&typeof e=="object"}a3.exports=ope});var u3=w((PCe,c3)=>{var spe=MT(),ape=LT(),cpe="[object Symbol]";function upe(e){return typeof e=="symbol"||ape(e)&&spe(e)==cpe}c3.exports=upe});var m3=w((qCe,h3)=>{var l3=og(),lpe=XB(),fpe=sg(),dpe=u3(),ppe=1/0,f3=l3?l3.prototype:void 0,d3=f3?f3.toString:void 0;function p3(e){if(typeof e=="string")return e;if(fpe(e))return lpe(e,p3)+"";if(dpe(e))return d3?d3.call(e):"";var t=e+"";return t=="0"&&1/e==-ppe?"-0":t}h3.exports=p3});var y3=w((jCe,g3)=>{var hpe=m3();function mpe(e){return e==null?"":hpe(e)}g3.exports=mpe});var v3=w(gc=>{"use strict";var gpe=gc&&gc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gc,"__esModule",{value:!0});gc.encodeString=void 0;var ype=gpe(y3());function vpe(e){let t=ype.default(e);return encodeURIComponent(t).replace(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`)}gc.encodeString=vpe});var ss=w(Er=>{var os=B("crypto"),ag=is(),bpe=Yk(),{lowercaseKeyHeader:_3}=BB(),{encodeString:b3}=v3();Er.getProduct=function(t){return t===void 0?"oss":"oss-cloudbox"};Er.getSignRegion=function(t,r){return r===void 0?t:r};Er.buildCanonicalizedResource=function(t,r){let i=`${t}`,n="?";if(ag.string(r)&&r.trim()!=="")i+=n+r;else if(ag.array(r))r.sort(),i+=n+r.join("&");else if(r){let o=s=>{i+=n+s,(r[s]||r[s]===0)&&(i+=`=${r[s]}`),n="&"};Object.keys(r).sort().forEach(o)}return i};Er.buildCanonicalString=function(t,r,i,n){i=i||{};let o=_3(i.headers),s="x-oss-",a=[],c={},u=[t.toUpperCase(),o["content-md5"]||"",o["content-type"],n||o["x-oss-date"]];return Object.keys(o).forEach(l=>{let f=l.toLowerCase();f.indexOf(s)===0&&(c[f]=String(o[l]).trim())}),Object.keys(c).sort().forEach(l=>{a.push(`${l}:${c[l]}`)}),u=u.concat(a),u.push(this.buildCanonicalizedResource(r,i.parameters)),u.join(`
|
|
232
|
+
`);i!==-1&&(e._longStack=!0,e.stack+=pde+r.substr(i+1))}}}function Cde(e){return e.timeout||e._idleTimeout}});var DT=w((bCe,RB)=>{"use strict";var AB=B("events").EventEmitter,Ade=B("util"),$B=Ki(),Km=RT();RB.exports=Vl;function Vl(e){AB.call(this),e=e||{},e.agent!==void 0?(this.agent=e.agent,this.hasCustomAgent=!0):(this.agent=Km.agent,this.hasCustomAgent=!1),e.httpsAgent!==void 0?(this.httpsAgent=e.httpsAgent,this.hasCustomHttpsAgent=!0):(this.httpsAgent=Km.httpsAgent,this.hasCustomHttpsAgent=!1),this.defaultArgs=e.defaultArgs}Ade.inherits(Vl,AB);Vl.prototype.request=Vl.prototype.curl=function(e,t,r){return typeof t=="function"&&(r=t,t=null),t=t||{},this.defaultArgs&&(t=$B.assign({},[this.defaultArgs,t])),t.emitter=this,t.agent=Xm(t.agent,this.agent),t.httpsAgent=Xm(t.httpsAgent,this.httpsAgent),Km.request(e,t,r)};Vl.prototype.requestThunk=function(e,t){return t=t||{},this.defaultArgs&&(t=$B.assign({},[this.defaultArgs,t])),t.emitter=this,t.agent=Xm(t.agent,this.agent),t.httpsAgent=Xm(t.httpsAgent,this.httpsAgent),Km.requestThunk(e,t)};function Xm(e,t){return e===void 0?t:e}});var PB=w((_Ce,NB)=>{"use strict";var $de=B("util"),Jm=B("util").debuglog("urllib"),Rde=Za(),PT=DT(),NT;NB.exports=Zl;function Zl(e){PT.call(this,e)}$de.inherits(Zl,PT);Zl.prototype.request=Zl.prototype.curl=function(t,r){var i=this;return r=r||{},r.retry=r.retry||0,r.retryDelay&&(r.retryDelay=Rde(r.retryDelay)),r.isRetry=r.isRetry||function(n){return n.status>=500},PT.prototype.request.call(i,t,r).then(function(n){return r.retry>0&&typeof r.isRetry=="function"&&r.isRetry(n)?(r.retry--,Jm("retry request %s, remain %s",t,r.retry),r.retryDelay?(Jm("retry after %sms",r.retryDelay),DB(r.retryDelay).then(function(){return i.request(t,r)})):i.request(t,r)):n}).catch(function(n){if(r.retry>0)return r.retry--,Jm("retry request %s, remain %s, err %s",t,r.retry,n),r.retryDelay?(Jm("retry after %sms",r.retryDelay),DB(r.retryDelay).then(function(){return i.request(t,r)})):i.request(t,r);throw n})};Zl.prototype.requestThunk=function(t,r){var i=this;return function(n){i.request(t,r).then(function(o){var s=n;n=null,s(null,o)}).catch(function(o){n&&n(o)})}};function DB(e){return NT||(NT=El()),new NT(function(t){setTimeout(t,e)})}});var qT=w(xr=>{"use strict";var ci=RT();xr.USER_AGENT=ci.USER_AGENT;xr.TIMEOUT=ci.TIMEOUT;xr.TIMEOUTS=ci.TIMEOUTS;xr.agent=ci.agent;xr.httpsAgent=ci.httpsAgent;xr.curl=ci.curl;xr.request=ci.request;xr.requestWithCallback=ci.requestWithCallback;xr.requestThunk=ci.requestThunk;xr.HttpClient=DT();xr.HttpClient2=PB();xr.create=function(e){return new xr.HttpClient(e)}});var qB=w((xCe,Dde)=>{Dde.exports={name:"ali-oss",version:"6.23.0",description:"aliyun oss(object storage service) node client",main:"./lib/client.js",files:["lib","shims","dist"],browser:{"./lib/client.js":"./dist/aliyun-oss-sdk.js",mime:"mime/lite",urllib:"./shims/xhr.js",utility:"./shims/utility.js",crypto:"./shims/crypto/crypto.js",debug:"./shims/debug",fs:!1,child_process:!1,"is-type-of":"./shims/is-type-of.js"},scripts:{"build-change-log":"standard-version",test:"npm run tsc && mocha -t 120000 -r should -r dotenv/config test/node/*.test.js test/node/**/*.test.js","test-cov":"npm run tsc && nyc --reporter=lcov node_modules/.bin/_mocha -t 120000 -r should test/node/*.test.js test/node/**/*.test.js",jshint:"jshint .","build-test":"mkdir -p ./test/browser/build && MINIFY=1 node browser-build.js > test/browser/build/aliyun-oss-sdk.min.js && node -r dotenv/config task/browser-test-build.js > test/browser/build/tests.js","browser-test":"npm run build-test && karma start","build-dist":"npm run tsc && node browser-build.js > dist/aliyun-oss-sdk.js && MINIFY=1 node browser-build.js > dist/aliyun-oss-sdk.min.js","publish-to-npm":"node publish-npm-check.js && npm publish","publish-to-cdn":"node publish.js","snyk-protect":"snyk-protect","lint-staged":"lint-staged","detect-secrets":"node task/detect-secrets",tsc:"npm run tsc:clean && npm run tsc:build","tsc:build":"tsc -b tsconfig.json tsconfig-cjs.json","tsc:watch":"tsc -b tsconfig.json tsconfig-cjs.json --watch","tsc:clean":"tsc -b tsconfig.json tsconfig-cjs.json --clean ",prepare:"husky install"},"git-pre-hooks":{"pre-release":"npm run build-dist","post-release":["npm run publish-to-npm","npm run publish-to-cdn"]},homepage:"https://github.com/ali-sdk/ali-oss",bugs:{url:"https://github.com/ali-sdk/ali-oss/issues"},publishConfig:{registry:"https://registry.npmjs.org/",access:"public"},repository:{type:"git",url:"https://github.com/ali-sdk/ali-oss.git"},keywords:["oss","client","file","aliyun"],author:"dead_horse",license:"MIT",engines:{node:">=8"},devDependencies:{"@alicloud/openapi-client":"^0.4.10","@alicloud/resourcemanager20200331":"^2.3.0","@alicloud/tea-util":"^1.4.9","@babel/core":"^7.11.6","@babel/plugin-transform-regenerator":"^7.10.4","@babel/plugin-transform-runtime":"^7.11.5","@babel/preset-env":"^7.11.5","@babel/runtime":"^7.11.2","@commitlint/cli":"^17.6.7","@commitlint/config-conventional":"^16.2.4","@octokit/core":"^5.0.0","@semantic-release/exec":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^10.0.5","@snyk/protect":"^1.1196.0","@types/node":"^14.0.12","@typescript-eslint/eslint-plugin":"^5.0.0","@typescript-eslint/parser":"^5.0.0",aliasify:"^2.0.0",axios:"^0.27.2",babelify:"^10.0.0","beautify-benchmark":"^0.2.4",benchmark:"^2.1.1",bluebird:"^3.1.5",browserify:"^17.0.0","core-js":"^3.6.5","crypto-js":"^4.2.0",dotenv:"^8.2.0",eslint:"^8.44.0","eslint-config-airbnb":"^19.0.4","eslint-config-ali":"^13.0.0","eslint-config-prettier":"^8.8.0","eslint-plugin-import":"^2.21.1","eslint-plugin-jsx-a11y":"^6.0.3","eslint-plugin-prettier":"^4.2.1",filereader:"^0.10.3","form-data":"^4.0.0","git-pre-hooks":"^1.2.0",husky:"^7.0.4",immediate:"^3.3.0",karma:"^6.3.4","karma-browserify":"^8.1.0","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.0.1","karma-ie-launcher":"^1.0.0","karma-mocha":"^2.0.1","karma-safari-launcher":"^1.0.0","lint-staged":"^12.4.1",mm:"^2.0.0",mocha:"^9.1.2",nise:"5.1.4",nyc:"^15.1.0",prettier:"^3.0.0","promise-polyfill":"^6.0.2",puppeteer:"19.0.0","semantic-release":"^21.1.1",should:"^11.0.0",sinon:"^15.2.0","standard-version":"^9.3.1","stream-equal":"^1.1.0",timemachine:"^0.3.0",typescript:"^3.9.5","uglify-js":"^3.14.2",watchify:"^4.0.0"},dependencies:{address:"^1.2.2",agentkeepalive:"^3.4.1",bowser:"^1.6.0","copy-to":"^2.0.1",dateformat:"^2.0.0",debug:"^4.3.4",destroy:"^1.0.4","end-or-error":"^1.0.1","get-ready":"^1.0.0","humanize-ms":"^1.2.0","is-type-of":"^1.4.0","js-base64":"^2.5.2",jstoxml:"^2.0.0",lodash:"^4.17.21","merge-descriptors":"^1.0.1",mime:"^2.4.5",platform:"^1.3.1",pump:"^3.0.0",qs:"^6.4.0","sdk-base":"^2.0.1","stream-http":"2.8.2","stream-wormhole":"^1.0.4",urllib:"^2.44.0",utility:"^1.18.0",xml2js:"^0.6.2"},snyk:!0,"lint-staged":{"**/!(dist)/*":["npm run detect-secrets --"],"**/*.{js,ts}":["eslint --cache --fix --ext .js,.ts","prettier --write","git add"]}}});var MB=w((jB,Ym)=>{(function(e,t,r){typeof Ym<"u"&&Ym.exports?Ym.exports=r():typeof define=="function"&&define.amd?define(t,r):e[t]=r()})(jB,"bowser",function(){var e=!0;function t(c){function u(j){var pe=c.match(j);return pe&&pe.length>1&&pe[1]||""}function l(j){var pe=c.match(j);return pe&&pe.length>1&&pe[2]||""}var f=u(/(ipod|iphone|ipad)/i).toLowerCase(),p=/like android/i.test(c),d=!p&&/android/i.test(c),h=/nexus\s*[0-6]\s*/i.test(c),m=!h&&/nexus\s*[0-9]+/i.test(c),_=/CrOS/.test(c),k=/silk/i.test(c),S=/sailfish/i.test(c),v=/tizen/i.test(c),g=/(web|hpw)(o|0)s/i.test(c),y=/windows phone/i.test(c),T=/SamsungBrowser/i.test(c),R=!y&&/windows/i.test(c),I=!f&&!k&&/macintosh/i.test(c),b=!d&&!S&&!v&&!g&&/linux/i.test(c),O=l(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),A=u(/version\/(\d+(\.\d+)?)/i),P=/tablet/i.test(c)&&!/tablet pc/i.test(c),D=!P&&/[^-]mobi/i.test(c),V=/xbox/i.test(c),$;/opera/i.test(c)?$={name:"Opera",opera:e,version:A||u(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(c)?$={name:"Opera",opera:e,version:u(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||A}:/SamsungBrowser/i.test(c)?$={name:"Samsung Internet for Android",samsungBrowser:e,version:A||u(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/Whale/i.test(c)?$={name:"NAVER Whale browser",whale:e,version:u(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)}:/MZBrowser/i.test(c)?$={name:"MZ Browser",mzbrowser:e,version:u(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/coast/i.test(c)?$={name:"Opera Coast",coast:e,version:A||u(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/focus/i.test(c)?$={name:"Focus",focus:e,version:u(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)}:/yabrowser/i.test(c)?$={name:"Yandex Browser",yandexbrowser:e,version:A||u(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(c)?$={name:"UC Browser",ucbrowser:e,version:u(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(c)?$={name:"Maxthon",maxthon:e,version:u(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(c)?$={name:"Epiphany",epiphany:e,version:u(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(c)?$={name:"Puffin",puffin:e,version:u(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(c)?$={name:"Sleipnir",sleipnir:e,version:u(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(c)?$={name:"K-Meleon",kMeleon:e,version:u(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:y?($={name:"Windows Phone",osname:"Windows Phone",windowsphone:e},O?($.msedge=e,$.version=O):($.msie=e,$.version=u(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(c)?$={name:"Internet Explorer",msie:e,version:u(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:_?$={name:"Chrome",osname:"Chrome OS",chromeos:e,chromeBook:e,chrome:e,version:u(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(c)?$={name:"Microsoft Edge",msedge:e,version:O}:/vivaldi/i.test(c)?$={name:"Vivaldi",vivaldi:e,version:u(/vivaldi\/(\d+(\.\d+)?)/i)||A}:S?$={name:"Sailfish",osname:"Sailfish OS",sailfish:e,version:u(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(c)?$={name:"SeaMonkey",seamonkey:e,version:u(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(c)?($={name:"Firefox",firefox:e,version:u(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(c)&&($.firefoxos=e,$.osname="Firefox OS")):k?$={name:"Amazon Silk",silk:e,version:u(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(c)?$={name:"PhantomJS",phantom:e,version:u(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(c)?$={name:"SlimerJS",slimer:e,version:u(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(c)||/rim\stablet/i.test(c)?$={name:"BlackBerry",osname:"BlackBerry OS",blackberry:e,version:A||u(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:g?($={name:"WebOS",osname:"WebOS",webos:e,version:A||u(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(c)&&($.touchpad=e)):/bada/i.test(c)?$={name:"Bada",osname:"Bada",bada:e,version:u(/dolfin\/(\d+(\.\d+)?)/i)}:v?$={name:"Tizen",osname:"Tizen",tizen:e,version:u(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||A}:/qupzilla/i.test(c)?$={name:"QupZilla",qupzilla:e,version:u(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||A}:/chromium/i.test(c)?$={name:"Chromium",chromium:e,version:u(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||A}:/chrome|crios|crmo/i.test(c)?$={name:"Chrome",chrome:e,version:u(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:d?$={name:"Android",version:A}:/safari|applewebkit/i.test(c)?($={name:"Safari",safari:e},A&&($.version=A)):f?($={name:f=="iphone"?"iPhone":f=="ipad"?"iPad":"iPod"},A&&($.version=A)):/googlebot/i.test(c)?$={name:"Googlebot",googlebot:e,version:u(/googlebot\/(\d+(\.\d+))/i)||A}:$={name:u(/^(.*)\/(.*) /),version:l(/^(.*)\/(.*) /)},!$.msedge&&/(apple)?webkit/i.test(c)?(/(apple)?webkit\/537\.36/i.test(c)?($.name=$.name||"Blink",$.blink=e):($.name=$.name||"Webkit",$.webkit=e),!$.version&&A&&($.version=A)):!$.opera&&/gecko\//i.test(c)&&($.name=$.name||"Gecko",$.gecko=e,$.version=$.version||u(/gecko\/(\d+(\.\d+)?)/i)),!$.windowsphone&&(d||$.silk)?($.android=e,$.osname="Android"):!$.windowsphone&&f?($[f]=e,$.ios=e,$.osname="iOS"):I?($.mac=e,$.osname="macOS"):V?($.xbox=e,$.osname="Xbox"):R?($.windows=e,$.osname="Windows"):b&&($.linux=e,$.osname="Linux");function U(j){switch(j){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}var Z="";$.windows?Z=U(u(/Windows ((NT|XP)( \d\d?.\d)?)/i)):$.windowsphone?Z=u(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):$.mac?(Z=u(/Mac OS X (\d+([_\.\s]\d+)*)/i),Z=Z.replace(/[_\s]/g,".")):f?(Z=u(/os (\d+([_\s]\d+)*) like mac os x/i),Z=Z.replace(/[_\s]/g,".")):d?Z=u(/android[ \/-](\d+(\.\d+)*)/i):$.webos?Z=u(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):$.blackberry?Z=u(/rim\stablet\sos\s(\d+(\.\d+)*)/i):$.bada?Z=u(/bada\/(\d+(\.\d+)*)/i):$.tizen&&(Z=u(/tizen[\/\s](\d+(\.\d+)*)/i)),Z&&($.osversion=Z);var J=!$.windows&&Z.split(".")[0];return P||m||f=="ipad"||d&&(J==3||J>=4&&!D)||$.silk?$.tablet=e:(D||f=="iphone"||f=="ipod"||d||h||$.blackberry||$.webos||$.bada)&&($.mobile=e),$.msedge||$.msie&&$.version>=10||$.yandexbrowser&&$.version>=15||$.vivaldi&&$.version>=1||$.chrome&&$.version>=20||$.samsungBrowser&&$.version>=4||$.whale&&o([$.version,"1.0"])===1||$.mzbrowser&&o([$.version,"6.0"])===1||$.focus&&o([$.version,"1.0"])===1||$.firefox&&$.version>=20||$.safari&&$.version>=6||$.opera&&$.version>=10||$.ios&&$.osversion&&$.osversion.split(".")[0]>=6||$.blackberry&&$.version>=10.1||$.chromium&&$.version>=20?$.a=e:$.msie&&$.version<10||$.chrome&&$.version<20||$.firefox&&$.version<20||$.safari&&$.version<6||$.opera&&$.version<10||$.ios&&$.osversion&&$.osversion.split(".")[0]<6||$.chromium&&$.version<20?$.c=e:$.x=e,$}var r=t(typeof navigator<"u"&&navigator.userAgent||"");r.test=function(c){for(var u=0;u<c.length;++u){var l=c[u];if(typeof l=="string"&&l in r)return!0}return!1};function i(c){return c.split(".").length}function n(c,u){var l=[],f;if(Array.prototype.map)return Array.prototype.map.call(c,u);for(f=0;f<c.length;f++)l.push(u(c[f]));return l}function o(c){for(var u=Math.max(i(c[0]),i(c[1])),l=n(c,function(f){var p=u-i(f);return f=f+new Array(p+1).join(".0"),n(f.split("."),function(d){return new Array(20-d.length).join("0")+d}).reverse()});--u>=0;){if(l[0][u]>l[1][u])return 1;if(l[0][u]===l[1][u]){if(u===0)return 0}else return-1}}function s(c,u,l){var f=r;typeof u=="string"&&(l=u,u=void 0),u===void 0&&(u=!1),l&&(f=t(l));var p=""+f.version;for(var d in c)if(c.hasOwnProperty(d)&&f[d]){if(typeof c[d]!="string")throw new Error("Browser version in the minVersion map should be a string: "+d+": "+String(c));return o([p,c[d]])<0}return u}function a(c,u,l){return!s(c,u,l)}return r.isUnsupportedBrowser=s,r.compareVersions=o,r.check=a,r._detect=t,r.detect=t,r})});var zB=w((SCe,Gl)=>{var Nde=B("stream");function jT(e){return e instanceof Nde.Stream}function LB(e){return jT(e)&&typeof e._read=="function"&&typeof e._readableState=="object"}function FB(e){return jT(e)&&typeof e._write=="function"&&typeof e._writableState=="object"}function Pde(e){return LB(e)&&FB(e)}Gl.exports=jT;Gl.exports.isReadable=LB;Gl.exports.isWritable=FB;Gl.exports.isDuplex=Pde});var UB=w((Kl,Qm)=>{(function(e){var t=Function.prototype.toString;function r(n){return t.call(n).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}function i(n){return typeof n=="function"&&(/^class(?:\s|{)/.test(t.call(n))||/^.*classCallCheck\(/.test(r(n)))}typeof Kl<"u"?(typeof Qm<"u"&&Qm.exports&&(Kl=Qm.exports=i),Kl.isClass=i):typeof define=="function"&&define.amd?define([],function(){return i}):e.isClass=i})(Kl)});var is=w(ze=>{"use strict";var eg=mo(),rg=zB(),qde=UB();Object.keys(eg).map(function(e){ze[jde(e)]=eg[e]});ze.stream=rg;ze.readableStream=rg.isReadable;ze.writableStream=rg.isWritable;ze.duplexStream=rg.isDuplex;ze.class=qde;ze.finite=Number.isFinite;ze.NaN=Number.isNaN;ze.generator=function(e){return e&&typeof e.next=="function"&&typeof e.throw=="function"};ze.generatorFunction=function(e){return e&&e.constructor&&e.constructor.name==="GeneratorFunction"};ze.asyncFunction=function(e){return e&&e.constructor&&e.constructor.name==="AsyncFunction"};ze.promise=function(e){return e&&typeof e.then=="function"};var tg=Math.pow(2,31);ze.int=function(e){return eg.isNumber(e)&&e%1===0};ze.int32=function(e){return ze.int(e)&&e<tg&&e>=-tg};ze.long=function(e){return ze.int(e)&&(e>=tg||e<-tg)};ze.Long=function(e){return ze.object(e)&&ze.number(e.high)&&ze.number(e.low)};ze.double=function(e){return eg.isNumber(e)&&!isNaN(e)&&e%1!==0};ze.bigInt=function(e){return typeof e=="bigint"};ze.bigint=ze.bigInt;ze.date=function(t){return t instanceof Date};ze.regExp=function(t){return t instanceof RegExp};ze.regexp=ze.regExp;ze.error=function(t){return t instanceof Error};ze.array=Array.isArray;function jde(e){var t=e.slice(2);return t=t[0].toLowerCase()+t.slice(1),t}});var Sr=w(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});ng.isObject=void 0;ng.isObject=e=>Object.prototype.toString.call(e)==="[object Object]"});var BB=w(ig=>{"use strict";Object.defineProperty(ig,"__esModule",{value:!0});ig.lowercaseKeyHeader=void 0;var Mde=Sr();function Lde(e){let t={};return Mde.isObject(e)&&Object.keys(e).forEach(r=>{t[r.toLowerCase()]=e[r]}),t}ig.lowercaseKeyHeader=Lde});var HB=w((ICe,WB)=>{var Fde=typeof global=="object"&&global&&global.Object===Object&&global;WB.exports=Fde});var ZB=w((OCe,VB)=>{var zde=HB(),Ude=typeof self=="object"&&self&&self.Object===Object&&self,Bde=zde||Ude||Function("return this")();VB.exports=Bde});var og=w((CCe,GB)=>{var Wde=ZB(),Hde=Wde.Symbol;GB.exports=Hde});var XB=w((ACe,KB)=>{function Vde(e,t){for(var r=-1,i=e==null?0:e.length,n=Array(i);++r<i;)n[r]=t(e[r],r,e);return n}KB.exports=Vde});var sg=w(($Ce,JB)=>{var Zde=Array.isArray;JB.exports=Zde});var t3=w((RCe,e3)=>{var YB=og(),QB=Object.prototype,Gde=QB.hasOwnProperty,Kde=QB.toString,Xl=YB?YB.toStringTag:void 0;function Xde(e){var t=Gde.call(e,Xl),r=e[Xl];try{e[Xl]=void 0;var i=!0}catch{}var n=Kde.call(e);return i&&(t?e[Xl]=r:delete e[Xl]),n}e3.exports=Xde});var n3=w((DCe,r3)=>{var Jde=Object.prototype,Yde=Jde.toString;function Qde(e){return Yde.call(e)}r3.exports=Qde});var MT=w((NCe,s3)=>{var i3=og(),epe=t3(),tpe=n3(),rpe="[object Null]",npe="[object Undefined]",o3=i3?i3.toStringTag:void 0;function ipe(e){return e==null?e===void 0?npe:rpe:o3&&o3 in Object(e)?epe(e):tpe(e)}s3.exports=ipe});var LT=w((PCe,a3)=>{function ope(e){return e!=null&&typeof e=="object"}a3.exports=ope});var u3=w((qCe,c3)=>{var spe=MT(),ape=LT(),cpe="[object Symbol]";function upe(e){return typeof e=="symbol"||ape(e)&&spe(e)==cpe}c3.exports=upe});var m3=w((jCe,h3)=>{var l3=og(),lpe=XB(),fpe=sg(),dpe=u3(),ppe=1/0,f3=l3?l3.prototype:void 0,d3=f3?f3.toString:void 0;function p3(e){if(typeof e=="string")return e;if(fpe(e))return lpe(e,p3)+"";if(dpe(e))return d3?d3.call(e):"";var t=e+"";return t=="0"&&1/e==-ppe?"-0":t}h3.exports=p3});var y3=w((MCe,g3)=>{var hpe=m3();function mpe(e){return e==null?"":hpe(e)}g3.exports=mpe});var v3=w(gc=>{"use strict";var gpe=gc&&gc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gc,"__esModule",{value:!0});gc.encodeString=void 0;var ype=gpe(y3());function vpe(e){let t=ype.default(e);return encodeURIComponent(t).replace(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`)}gc.encodeString=vpe});var ss=w(Er=>{var os=B("crypto"),ag=is(),bpe=Yk(),{lowercaseKeyHeader:_3}=BB(),{encodeString:b3}=v3();Er.getProduct=function(t){return t===void 0?"oss":"oss-cloudbox"};Er.getSignRegion=function(t,r){return r===void 0?t:r};Er.buildCanonicalizedResource=function(t,r){let i=`${t}`,n="?";if(ag.string(r)&&r.trim()!=="")i+=n+r;else if(ag.array(r))r.sort(),i+=n+r.join("&");else if(r){let o=s=>{i+=n+s,(r[s]||r[s]===0)&&(i+=`=${r[s]}`),n="&"};Object.keys(r).sort().forEach(o)}return i};Er.buildCanonicalString=function(t,r,i,n){i=i||{};let o=_3(i.headers),s="x-oss-",a=[],c={},u=[t.toUpperCase(),o["content-md5"]||"",o["content-type"],n||o["x-oss-date"]];return Object.keys(o).forEach(l=>{let f=l.toLowerCase();f.indexOf(s)===0&&(c[f]=String(o[l]).trim())}),Object.keys(c).sort().forEach(l=>{a.push(`${l}:${c[l]}`)}),u=u.concat(a),u.push(this.buildCanonicalizedResource(r,i.parameters)),u.join(`
|
|
233
233
|
`)};Er.computeSignature=function(t,r,i="utf-8"){return os.createHmac("sha1",t).update(Buffer.from(r,i)).digest("base64")};Er.authorization=function(t,r,i,n){return`OSS ${t}:${this.computeSignature(r,i,n)}`};Er.fixAdditionalHeaders=e=>{if(!e)return[];let t="x-oss-";return[...new Set(e.map(r=>r.toLowerCase()))].filter(r=>r!=="content-type"&&r!=="content-md5"&&!r.startsWith(t)).sort()};Er.getCanonicalRequest=function(t,r,i,n,o){let s=_3(r.headers),a=r.queries||{},c="x-oss-";if(n&&!i)throw Error("Please ensure that bucketName is passed into getCanonicalRequest.");let u=[t.toUpperCase(),b3(`/${i?`${i}/`:""}${n||""}`).replace(/%2F/g,"/")];u.push(bpe.stringify(a,{encoder:b3,sort:(p,d)=>p.localeCompare(d),strictNullHandling:!0})),o&&o.forEach(p=>{if(!Object.prototype.hasOwnProperty.call(s,p))throw Error(`Can't find additional header ${p} in request headers.`)});let l=new Set(o);Object.keys(s).forEach(p=>{(p==="content-type"||p==="content-md5"||p.startsWith(c))&&l.add(p)});let f=`${[...l].sort().map(p=>`${p}:${ag.string(s[p])?s[p].trim():s[p]}
|
|
234
234
|
`).join("")}`;return u.push(f),o&&o.length>0?u.push(o.join(";")):u.push(""),u.push(s["x-oss-content-sha256"]||"UNSIGNED-PAYLOAD"),u.join(`
|
|
235
235
|
`)};Er.getCredential=function(t,r,i,n="oss"){let o=`${t}/${r}/${n}/aliyun_v4_request`;return i?`${i}/${o}`:o};Er.getStringToSign=function(t,r,i,n="oss"){return["OSS4-HMAC-SHA256",r,this.getCredential(r.split("T")[0],t,void 0,n),os.createHash("sha256").update(i).digest("hex")].join(`
|
|
236
|
-
`)};Er.getSignatureV4=function(t,r,i,n,o="oss"){let s=os.createHmac("sha256",`aliyun_v4${t}`).update(r).digest(),a=os.createHmac("sha256",s).update(i).digest(),c=os.createHmac("sha256",a).update(o).digest(),u=os.createHmac("sha256",c).update("aliyun_v4_request").digest();return os.createHmac("sha256",u).update(n).digest("hex")};Er.authorizationV4=function(t,r,i,n,o,s,a,c,u="utf-8",l){let f=this.getProduct(l),p=this.fixAdditionalHeaders(c),d={};Object.entries(o.headers).forEach(g=>{d[g[0]]=ag.string(g[1])?Buffer.from(g[1],u).toString():g[1]});let h=d["x-oss-date"]||o.queries&&o.queries["x-oss-date"],m=this.getCanonicalRequest(n,{headers:d,queries:o.queries},s,a,p),_=this.getStringToSign(i,h,m,f),k=h.split("T")[0],S=this.getSignatureV4(r,k,i,_,f),v=p.length>0?`AdditionalHeaders=${p.join(";")},`:"";return`OSS4-HMAC-SHA256 Credential=${this.getCredential(k,i,t,f)},${v}Signature=${S}`};Er._signatureForURL=function(t,r={},i,n,o){let s={},{subResource:a={}}=r;if(r.process){let u="x-oss-process";a[u]=r.process}if(r.trafficLimit){let u="x-oss-traffic-limit";a[u]=r.trafficLimit}if(r.response&&Object.keys(r.response).forEach(u=>{let l=`response-${u.toLowerCase()}`;a[l]=r.response[u]}),Object.keys(r).forEach(u=>{let l=u.toLowerCase(),f=r[u];l.indexOf("x-oss-")===0?s[l]=f:(l.indexOf("content-md5")===0||l.indexOf("content-type")===0)&&(s[u]=f)}),Object.prototype.hasOwnProperty.call(r,"security-token")&&(a["security-token"]=r["security-token"]),Object.prototype.hasOwnProperty.call(r,"callback")){let u={callbackUrl:encodeURI(r.callback.url),callbackBody:r.callback.body};if(r.callback.host&&(u.callbackHost=r.callback.host),r.callback.contentType&&(u.callbackBodyType=r.callback.contentType),r.callback.callbackSNI&&(u.callbackSNI=r.callback.callbackSNI),a.callback=Buffer.from(JSON.stringify(u)).toString("base64"),r.callback.customValue){let l={};Object.keys(r.callback.customValue).forEach(f=>{l[`x:${f}`]=r.callback.customValue[f]}),a["callback-var"]=Buffer.from(JSON.stringify(l)).toString("base64")}}let c=this.buildCanonicalString(r.method,i,{headers:s,parameters:a},n.toString());return{Signature:this.computeSignature(t,c,o),subResource:a}}});var Me=w(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});cg.checkBucketName=void 0;cg.checkBucketName=(e,t=!1)=>{if(!(t?/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/:/^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/).test(e))throw new Error("The bucket must be conform to the specifications")}});var fg=w(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});lg.checkConfigValid=void 0;var ug={endpoint:_pe,region:/^[a-zA-Z0-9\-_]+$/};function _pe(e){return typeof e=="string"?/^[a-zA-Z0-9._:/-]+$/.test(e):e.host?/^[a-zA-Z0-9._:/-]+$/.test(e.host):!1}lg.checkConfigValid=(e,t)=>{if(ug[t]){let r=!0;if(ug[t]instanceof Function?r=ug[t](e):r=ug[t].test(e),!r)throw new Error(`The ${t} must be conform to the specifications`)}}});var FT=w(yc=>{"use strict";var wpe=yc&&yc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yc,"__esModule",{value:!0});yc.setRegion=void 0;var xpe=wpe(B("url")),Spe=fg();function Epe(e,t=!1,r=!1){Spe.checkConfigValid(e,"region");let i=r?"https://":"http://",n=t?"-internal.aliyuncs.com":".aliyuncs.com",o="vpc100-oss-cn-";return e.substr(0,o.length)===o&&(n=".aliyuncs.com"),xpe.default.parse(i+e+n)}yc.setRegion=Epe});var S3=w((BCe,x3)=>{var kpe=Za(),w3=B("url"),{checkBucketName:Tpe}=Me(),{setRegion:Ipe}=FT(),{checkConfigValid:Ope}=fg();function Cpe(e,t){Ope(e,"endpoint");let r=w3.parse(e);if(r.protocol||(r=w3.parse(`http${t?"s":""}://${e}`)),r.protocol!=="http:"&&r.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return r}x3.exports=function(e){if(!e||!e.accessKeyId||!e.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");e.stsToken&&!e.refreshSTSToken&&!e.refreshSTSTokenInterval&&console.warn("It's recommended to set 'refreshSTSToken' and 'refreshSTSTokenInterval' to refresh stsToken\u3001accessKeyId\u3001accessKeySecret automatically when sts token has expired"),e.bucket&&Tpe(e.bucket);let t=Object.assign({region:"oss-cn-hangzhou",internal:!1,secure:!1,timeout:6e4,bucket:null,endpoint:null,cname:!1,isRequestPay:!1,sldEnable:!1,headerEncoding:"utf-8",refreshSTSToken:null,refreshSTSTokenInterval:6e4*5,retryMax:0,authorizationV4:!1},e);if(t.accessKeyId=t.accessKeyId.trim(),t.accessKeySecret=t.accessKeySecret.trim(),t.timeout&&(t.timeout=kpe(t.timeout)),t.endpoint)t.endpoint=Cpe(t.endpoint,t.secure);else if(t.region)t.endpoint=Ipe(t.region,t.internal,t.secure);else throw new Error("require options.endpoint or options.region");return t.inited=!0,t}});var k3=w((WCe,E3)=>{var Ape=MT(),$pe=sg(),Rpe=LT(),Dpe="[object String]";function Npe(e){return typeof e=="string"||!$pe(e)&&Rpe(e)&&Ape(e)==Dpe}E3.exports=Npe});var I3=w((HCe,T3)=>{function Ppe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}T3.exports=Ppe});var dg=w((zT,O3)=>{(function(e){"use strict";var t=(function(){var s=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,a=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,c=/[^-+\dA-Z]/g;return function(u,l,f,p){if(arguments.length===1&&o(u)==="string"&&!/\d/.test(u)&&(l=u,u=void 0),u=u||new Date,u instanceof Date||(u=new Date(u)),isNaN(u))throw TypeError("Invalid date");l=String(t.masks[l]||l||t.masks.default);var d=l.slice(0,4);(d==="UTC:"||d==="GMT:")&&(l=l.slice(4),f=!0,d==="GMT:"&&(p=!0));var h=f?"getUTC":"get",m=u[h+"Date"](),_=u[h+"Day"](),k=u[h+"Month"](),S=u[h+"FullYear"](),v=u[h+"Hours"](),g=u[h+"Minutes"](),y=u[h+"Seconds"](),T=u[h+"Milliseconds"](),R=f?0:u.getTimezoneOffset(),I=i(u),b=n(u),O={d:m,dd:r(m),ddd:t.i18n.dayNames[_],dddd:t.i18n.dayNames[_+7],m:k+1,mm:r(k+1),mmm:t.i18n.monthNames[k],mmmm:t.i18n.monthNames[k+12],yy:String(S).slice(2),yyyy:S,h:v%12||12,hh:r(v%12||12),H:v,HH:r(v),M:g,MM:r(g),s:y,ss:r(y),l:r(T,3),L:r(Math.round(T/10)),t:v<12?"a":"p",tt:v<12?"am":"pm",T:v<12?"A":"P",TT:v<12?"AM":"PM",Z:p?"GMT":f?"UTC":(String(u).match(a)||[""]).pop().replace(c,""),o:(R>0?"-":"+")+r(Math.floor(Math.abs(R)/60)*100+Math.abs(R)%60,4),S:["th","st","nd","rd"][m%10>3?0:(m%100-m%10!=10)*m%10],W:I,N:b};return l.replace(s,function(A){return A in O?O[A]:A.slice(1,A.length-1)})}})();t.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},t.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};function r(s,a){for(s=String(s),a=a||2;s.length<a;)s="0"+s;return s}function i(s){var a=new Date(s.getFullYear(),s.getMonth(),s.getDate());a.setDate(a.getDate()-(a.getDay()+6)%7+3);var c=new Date(a.getFullYear(),0,4);c.setDate(c.getDate()-(c.getDay()+6)%7+3);var u=a.getTimezoneOffset()-c.getTimezoneOffset();a.setHours(a.getHours()-u);var l=(a-c)/(864e5*7);return 1+Math.floor(l)}function n(s){var a=s.getDay();return a===0&&(a=7),a}function o(s){return s===null?"null":s===void 0?"undefined":typeof s!="object"?typeof s:Array.isArray(s)?"array":{}.toString.call(s).slice(8,-1).toLowerCase()}typeof define=="function"&&define.amd?define(function(){return t}):typeof zT=="object"?O3.exports=t:e.dateFormat=t})(zT)});var UT=w(pg=>{"use strict";Object.defineProperty(pg,"__esModule",{value:!0});pg.encoder=void 0;function qpe(e,t="utf-8"){return t==="utf-8"?e:Buffer.from(e).toString("latin1")}pg.encoder=qpe});var as=w(hg=>{"use strict";Object.defineProperty(hg,"__esModule",{value:!0});hg.isIP=void 0;hg.isIP=e=>{let t=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,r=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;return t.test(e)||r.test(e)}});var BT=w(vc=>{"use strict";var mg=vc&&vc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vc,"__esModule",{value:!0});vc.getReqUrl=void 0;var jpe=mg(Ur()),Mpe=mg(B("url")),C3=mg(Ga()),A3=mg(is()),Lpe=as(),Fpe=fg();function zpe(e){let t={},r=this.options.cname;Fpe.checkConfigValid(this.options.endpoint,"endpoint"),jpe.default(this.options.endpoint,!1).to(t),e.bucket&&!r&&!Lpe.isIP(t.hostname)&&!this.options.sldEnable&&(t.host=`${e.bucket}.${t.host}`);let i="/";e.bucket&&this.options.sldEnable&&(i+=`${e.bucket}/`),e.object&&(i+=this._escape(e.object).replace(/\+/g,"%2B")),t.pathname=i;let n={};if(e.query&&C3.default(n,e.query),e.subres){let o={};A3.default.string(e.subres)?o[e.subres]="":A3.default.array(e.subres)?e.subres.forEach(s=>{o[s]=""}):o=e.subres,C3.default(n,o)}return t.query=n,Mpe.default.format(t)}vc.getReqUrl=zpe});var $3=w(gg=>{"use strict";Object.defineProperty(gg,"__esModule",{value:!0});gg.isDingTalk=void 0;function Upe(){return!!(process.browser&&window.navigator.userAgent.toLowerCase().includes("aliapp(dingtalk"))}gg.isDingTalk=Upe});var N3=w(yg=>{"use strict";Object.defineProperty(yg,"__esModule",{value:!0});yg.createRequest=void 0;var Bpe=B("crypto"),Wpe=Va()("ali-oss"),Hpe=k3(),Vpe=sg(),R3=I3(),Zpe=Wl(),Gpe=dg(),Kpe=Ur(),Xpe=B("path"),{encoder:Jpe}=UT(),{isIP:Ype}=as(),{setRegion:Qpe}=FT(),{getReqUrl:ehe}=BT(),{isDingTalk:the}=$3();function D3(e,t){return e[t]||e[t.toLowerCase()]}function rhe(e,t){delete e[t],delete e[t.toLowerCase()]}function nhe(e){let t=new Date;this.options.amendTimeSkewed&&(t=+new Date+this.options.amendTimeSkewed);let r={"x-oss-date":Gpe(t,this.options.authorizationV4?"UTC:yyyymmdd'T'HHMMss'Z'":"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'")};this.options.authorizationV4&&(r["x-oss-content-sha256"]="UNSIGNED-PAYLOAD"),typeof window<"u"&&(r["x-oss-user-agent"]=this.userAgent),this.userAgent.includes("nodejs")&&(r["User-Agent"]=this.userAgent),this.options.isRequestPay&&Object.assign(r,{"x-oss-request-payer":"requester"}),this.options.stsToken&&(r["x-oss-security-token"]=this.options.stsToken),Kpe(e.headers).to(r),D3(r,"Content-Type")||(e.mime&&e.mime.indexOf("/")>0?r["Content-Type"]=e.mime:the()?r["Content-Type"]="application/octet-stream":r["Content-Type"]=Zpe.getType(e.mime||Xpe.extname(e.object||""))),D3(r,"Content-Type")||rhe(r,"Content-Type"),e.content&&(e.disabledMD5||(!e.headers||!e.headers["Content-MD5"]?r["Content-MD5"]=Bpe.createHash("md5").update(Buffer.from(e.content,"utf8")).digest("base64"):r["Content-MD5"]=e.headers["Content-MD5"]),r["Content-Length"]||(r["Content-Length"]=e.content.length));let{hasOwnProperty:i}=Object.prototype;for(let c in r)r[c]&&i.call(r,c)&&(r[c]=Jpe(String(r[c]),this.options.headerEncoding));let n={};if(Hpe(e.subres)?n[e.subres]=null:Vpe(e.subres)?e.subres.forEach(c=>{n[c]=null}):R3(e.subres)&&Object.entries(e.subres).forEach(c=>{n[c[0]]=c[1]===""?null:c[1]}),R3(e.query)&&Object.entries(e.query).forEach(c=>{n[c[0]]=c[1]}),r.authorization=this.options.authorizationV4?this.authorizationV4(e.method,{headers:r,queries:n},e.bucket,e.object,e.additionalHeaders):this.authorization(e.method,this._getResource(e),e.subres,r,this.options.headerEncoding),Ype(this.options.endpoint.hostname)){let{region:c,internal:u,secure:l}=this.options,f=Qpe(c,u,l);r.host=`${e.bucket}.${f.host}`}let o=ehe.bind(this)(e);Wpe("request %s %s, with headers %j, !!stream: %s",e.method,o,r,!!e.stream);let s=e.timeout||this.options.timeout,a={method:e.method,content:e.content,stream:e.stream,headers:r,timeout:s,writeStream:e.writeStream,customResponse:e.customResponse,ctx:e.ctx||this.ctx};return this.agent&&(a.agent=this.agent),this.httpsAgent&&(a.httpsAgent=this.httpsAgent),a.enableProxy=!!this.options.enableProxy,a.proxy=this.options.proxy?this.options.proxy:null,{url:o,params:a}}yg.createRequest=nhe});var bc=w(vg=>{"use strict";Object.defineProperty(vg,"__esModule",{value:!0});vg.formatObjKey=void 0;function WT(e,t,r){if(e===null||typeof e!="object")return e;let i;if(Array.isArray(e)){i=[];for(let n=0;n<e.length;n++)i.push(WT(e[n],t,r))}else i={},Object.keys(e).forEach(n=>{i[ihe(n,t,r)]=WT(e[n],t,r)});return i}vg.formatObjKey=WT;function ihe(e,t,r){return r&&r.exclude&&r.exclude.includes(e)||(t==="firstUpperCase"?e=e.replace(/^./,i=>i.toUpperCase()):t==="firstLowerCase"&&(e=e.replace(/^./,i=>i.toLowerCase()))),e}});var bg=w(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.checkCredentials=_c.setSTSToken=void 0;var ohe=bc();async function she(){this.options||(this.options={});let e=new Date;if(this.stsTokenFreshTime){if(+e-this.stsTokenFreshTime>=this.options.refreshSTSTokenInterval){this.stsTokenFreshTime=e;let t=await this.options.refreshSTSToken();t=ohe.formatObjKey(t,"firstLowerCase"),t.securityToken&&(t.stsToken=t.securityToken),P3(t),Object.assign(this.options,t)}}else this.stsTokenFreshTime=e;return null}_c.setSTSToken=she;function P3(e){let t=["accessKeySecret","accessKeyId","stsToken"],r=Object.keys(e);t.forEach(i=>{if(!r.find(n=>n===i))throw Error(`refreshSTSToken must return contains ${i}`)})}_c.checkCredentials=P3});var wg=w(_g=>{"use strict";Object.defineProperty(_g,"__esModule",{value:!0});_g.retry=void 0;function ahe(e,t,r={}){let i=0,{retryDelay:n=500,errorHandler:o=()=>!0}=r,s=(...a)=>new Promise((c,u)=>{e(...a).then(l=>{i=0,c(l)}).catch(l=>{i<t&&o(l)?(i++,setTimeout(()=>{c(s(...a))},n)):(i=0,u(l))})});return s}_g.retry=ahe});var Sg=w(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});xg.isFunction=void 0;xg.isFunction=e=>typeof e=="function"});var kg=w(Eg=>{"use strict";Object.defineProperty(Eg,"__esModule",{value:!0});Eg.getStandardRegion=void 0;function che(e){return e.replace(/^oss-/g,"")}Eg.getStandardRegion=che});var j3=w(q3=>{var uhe=q3;uhe.getSymlink=async function(t,r={}){r.subres=Object.assign({symlink:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),t=this._objectName(t);let i=this._objectRequestParams("GET",t,r);i.successStatuses=[200];let n=await this.request(i),o=n.res.headers["x-oss-symlink-target"];return{targetName:decodeURIComponent(o),res:n.res}}});var L3=w(M3=>{var lhe=M3;lhe.putSymlink=async function(t,r,i){i=i||{},i.headers=i.headers||{},r=this._escape(this._objectName(r)),this._convertMetaToHeaders(i.meta,i.headers),i.headers["x-oss-symlink-target"]=r,i.subres=Object.assign({symlink:""},i.subres),i.versionId&&(i.subres.versionId=i.versionId),i.storageClass&&(i.headers["x-oss-storage-class"]=i.storageClass),t=this._objectName(t);let n=this._objectRequestParams("PUT",t,i);return n.successStatuses=[200],{res:(await this.request(n)).res}}});var z3=w(F3=>{var fhe=F3;fhe.getObjectMeta=async function(t,r){r=r||{},t=this._objectName(t),r.subres=Object.assign({objectMeta:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId);let i=this._objectRequestParams("HEAD",t,r);i.successStatuses=[200];let n=await this.request(i);return{status:n.status,res:n.res}}});var W3=w(B3=>{var{checkBucketName:dhe}=Me(),U3=B3,phe=["content-type","content-encoding","content-language","content-disposition","cache-control","expires"];U3.copy=async function(t,r,i,n){typeof i=="object"&&(n=i),n=n||{},n.headers=n.headers||{},Object.keys(n.headers).forEach(c=>{n.headers[`x-oss-copy-source-${c.toLowerCase()}`]=n.headers[c]}),(n.meta||Object.keys(n.headers).find(c=>phe.includes(c.toLowerCase())))&&(n.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(n.meta,n.headers),r=this._getSourceName(r,i),n.versionId&&(r=`${r}?versionId=${n.versionId}`),n.headers["x-oss-copy-source"]=r;let o=this._objectRequestParams("PUT",t,n);o.xmlResponse=!0,o.successStatuses=[200,304];let s=await this.request(o),{data:a}=s;return a&&(a={etag:a.ETag,lastModified:a.LastModified}),{data:a,res:s.res}};U3._getSourceName=function(t,r){return typeof r=="string"?t=this._objectName(t):t[0]!=="/"?r=this.options.bucket:(r=t.replace(/\/(.+?)(\/.*)/,"$1"),t=t.replace(/(\/.+?\/)(.*)/,"$2")),dhe(r),t=encodeURIComponent(t),t=`/${r}/${t}`,t}});var Ig=w(Tg=>{"use strict";Object.defineProperty(Tg,"__esModule",{value:!0});Tg.policy2Str=void 0;function hhe(e){let t;if(e)if(typeof e=="string")try{t=JSON.stringify(JSON.parse(e))}catch(r){throw new Error(`Policy string is not a valid JSON: ${r.message}`)}else t=JSON.stringify(e);return t}Tg.policy2Str=hhe});var Z3=w(V3=>{var{policy2Str:mhe}=Ig(),ghe=ss(),{isObject:H3}=Sr(),yhe=V3;yhe.calculatePostSignature=function(t){if(!H3(t)&&typeof t!="string")throw new Error("policy must be JSON string or Object");if(!H3(t))try{JSON.stringify(JSON.parse(t))}catch{throw new Error("policy must be JSON string or Object")}t=Buffer.from(mhe(t),"utf8").toString("base64");let r=ghe.computeSignature(this.options.accessKeySecret,t);return{OSSAccessKeyId:this.options.accessKeyId,Signature:r,policy:t}}});var K3=w(G3=>{var vhe=G3,{isObject:bhe}=Sr();vhe.getObjectTagging=async function(t,r={}){r.subres=Object.assign({tagging:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),t=this._objectName(t);let i=this._objectRequestParams("GET",t,r);i.successStatuses=[200];let n=await this.request(i),o=await this.parseXML(n.data),{Tag:s}=o.TagSet;s=s&&bhe(s)?[s]:s||[];let a={};return s.forEach(c=>{a[c.Key]=c.Value}),{status:n.status,res:n.res,tag:a}}});var gr=w(Og=>{"use strict";Object.defineProperty(Og,"__esModule",{value:!0});Og.obj2xml=void 0;var _he=bc();function cs(e){return Object.prototype.toString.call(e).replace(/(.*? |])/g,"").toLowerCase()}function HT(e,t){let r="";return t&&t.headers&&(r=`<?xml version="1.0" encoding="UTF-8"?>
|
|
236
|
+
`)};Er.getSignatureV4=function(t,r,i,n,o="oss"){let s=os.createHmac("sha256",`aliyun_v4${t}`).update(r).digest(),a=os.createHmac("sha256",s).update(i).digest(),c=os.createHmac("sha256",a).update(o).digest(),u=os.createHmac("sha256",c).update("aliyun_v4_request").digest();return os.createHmac("sha256",u).update(n).digest("hex")};Er.authorizationV4=function(t,r,i,n,o,s,a,c,u="utf-8",l){let f=this.getProduct(l),p=this.fixAdditionalHeaders(c),d={};Object.entries(o.headers).forEach(g=>{d[g[0]]=ag.string(g[1])?Buffer.from(g[1],u).toString():g[1]});let h=d["x-oss-date"]||o.queries&&o.queries["x-oss-date"],m=this.getCanonicalRequest(n,{headers:d,queries:o.queries},s,a,p),_=this.getStringToSign(i,h,m,f),k=h.split("T")[0],S=this.getSignatureV4(r,k,i,_,f),v=p.length>0?`AdditionalHeaders=${p.join(";")},`:"";return`OSS4-HMAC-SHA256 Credential=${this.getCredential(k,i,t,f)},${v}Signature=${S}`};Er._signatureForURL=function(t,r={},i,n,o){let s={},{subResource:a={}}=r;if(r.process){let u="x-oss-process";a[u]=r.process}if(r.trafficLimit){let u="x-oss-traffic-limit";a[u]=r.trafficLimit}if(r.response&&Object.keys(r.response).forEach(u=>{let l=`response-${u.toLowerCase()}`;a[l]=r.response[u]}),Object.keys(r).forEach(u=>{let l=u.toLowerCase(),f=r[u];l.indexOf("x-oss-")===0?s[l]=f:(l.indexOf("content-md5")===0||l.indexOf("content-type")===0)&&(s[u]=f)}),Object.prototype.hasOwnProperty.call(r,"security-token")&&(a["security-token"]=r["security-token"]),Object.prototype.hasOwnProperty.call(r,"callback")){let u={callbackUrl:encodeURI(r.callback.url),callbackBody:r.callback.body};if(r.callback.host&&(u.callbackHost=r.callback.host),r.callback.contentType&&(u.callbackBodyType=r.callback.contentType),r.callback.callbackSNI&&(u.callbackSNI=r.callback.callbackSNI),a.callback=Buffer.from(JSON.stringify(u)).toString("base64"),r.callback.customValue){let l={};Object.keys(r.callback.customValue).forEach(f=>{l[`x:${f}`]=r.callback.customValue[f]}),a["callback-var"]=Buffer.from(JSON.stringify(l)).toString("base64")}}let c=this.buildCanonicalString(r.method,i,{headers:s,parameters:a},n.toString());return{Signature:this.computeSignature(t,c,o),subResource:a}}});var Me=w(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});cg.checkBucketName=void 0;cg.checkBucketName=(e,t=!1)=>{if(!(t?/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/:/^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/).test(e))throw new Error("The bucket must be conform to the specifications")}});var fg=w(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});lg.checkConfigValid=void 0;var ug={endpoint:_pe,region:/^[a-zA-Z0-9\-_]+$/};function _pe(e){return typeof e=="string"?/^[a-zA-Z0-9._:/-]+$/.test(e):e.host?/^[a-zA-Z0-9._:/-]+$/.test(e.host):!1}lg.checkConfigValid=(e,t)=>{if(ug[t]){let r=!0;if(ug[t]instanceof Function?r=ug[t](e):r=ug[t].test(e),!r)throw new Error(`The ${t} must be conform to the specifications`)}}});var FT=w(yc=>{"use strict";var wpe=yc&&yc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yc,"__esModule",{value:!0});yc.setRegion=void 0;var xpe=wpe(B("url")),Spe=fg();function Epe(e,t=!1,r=!1){Spe.checkConfigValid(e,"region");let i=r?"https://":"http://",n=t?"-internal.aliyuncs.com":".aliyuncs.com",o="vpc100-oss-cn-";return e.substr(0,o.length)===o&&(n=".aliyuncs.com"),xpe.default.parse(i+e+n)}yc.setRegion=Epe});var S3=w((WCe,x3)=>{var kpe=Za(),w3=B("url"),{checkBucketName:Tpe}=Me(),{setRegion:Ipe}=FT(),{checkConfigValid:Ope}=fg();function Cpe(e,t){Ope(e,"endpoint");let r=w3.parse(e);if(r.protocol||(r=w3.parse(`http${t?"s":""}://${e}`)),r.protocol!=="http:"&&r.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return r}x3.exports=function(e){if(!e||!e.accessKeyId||!e.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");e.stsToken&&!e.refreshSTSToken&&!e.refreshSTSTokenInterval&&console.warn("It's recommended to set 'refreshSTSToken' and 'refreshSTSTokenInterval' to refresh stsToken\u3001accessKeyId\u3001accessKeySecret automatically when sts token has expired"),e.bucket&&Tpe(e.bucket);let t=Object.assign({region:"oss-cn-hangzhou",internal:!1,secure:!1,timeout:6e4,bucket:null,endpoint:null,cname:!1,isRequestPay:!1,sldEnable:!1,headerEncoding:"utf-8",refreshSTSToken:null,refreshSTSTokenInterval:6e4*5,retryMax:0,authorizationV4:!1},e);if(t.accessKeyId=t.accessKeyId.trim(),t.accessKeySecret=t.accessKeySecret.trim(),t.timeout&&(t.timeout=kpe(t.timeout)),t.endpoint)t.endpoint=Cpe(t.endpoint,t.secure);else if(t.region)t.endpoint=Ipe(t.region,t.internal,t.secure);else throw new Error("require options.endpoint or options.region");return t.inited=!0,t}});var k3=w((HCe,E3)=>{var Ape=MT(),$pe=sg(),Rpe=LT(),Dpe="[object String]";function Npe(e){return typeof e=="string"||!$pe(e)&&Rpe(e)&&Ape(e)==Dpe}E3.exports=Npe});var I3=w((VCe,T3)=>{function Ppe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}T3.exports=Ppe});var dg=w((zT,O3)=>{(function(e){"use strict";var t=(function(){var s=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,a=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,c=/[^-+\dA-Z]/g;return function(u,l,f,p){if(arguments.length===1&&o(u)==="string"&&!/\d/.test(u)&&(l=u,u=void 0),u=u||new Date,u instanceof Date||(u=new Date(u)),isNaN(u))throw TypeError("Invalid date");l=String(t.masks[l]||l||t.masks.default);var d=l.slice(0,4);(d==="UTC:"||d==="GMT:")&&(l=l.slice(4),f=!0,d==="GMT:"&&(p=!0));var h=f?"getUTC":"get",m=u[h+"Date"](),_=u[h+"Day"](),k=u[h+"Month"](),S=u[h+"FullYear"](),v=u[h+"Hours"](),g=u[h+"Minutes"](),y=u[h+"Seconds"](),T=u[h+"Milliseconds"](),R=f?0:u.getTimezoneOffset(),I=i(u),b=n(u),O={d:m,dd:r(m),ddd:t.i18n.dayNames[_],dddd:t.i18n.dayNames[_+7],m:k+1,mm:r(k+1),mmm:t.i18n.monthNames[k],mmmm:t.i18n.monthNames[k+12],yy:String(S).slice(2),yyyy:S,h:v%12||12,hh:r(v%12||12),H:v,HH:r(v),M:g,MM:r(g),s:y,ss:r(y),l:r(T,3),L:r(Math.round(T/10)),t:v<12?"a":"p",tt:v<12?"am":"pm",T:v<12?"A":"P",TT:v<12?"AM":"PM",Z:p?"GMT":f?"UTC":(String(u).match(a)||[""]).pop().replace(c,""),o:(R>0?"-":"+")+r(Math.floor(Math.abs(R)/60)*100+Math.abs(R)%60,4),S:["th","st","nd","rd"][m%10>3?0:(m%100-m%10!=10)*m%10],W:I,N:b};return l.replace(s,function(A){return A in O?O[A]:A.slice(1,A.length-1)})}})();t.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},t.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};function r(s,a){for(s=String(s),a=a||2;s.length<a;)s="0"+s;return s}function i(s){var a=new Date(s.getFullYear(),s.getMonth(),s.getDate());a.setDate(a.getDate()-(a.getDay()+6)%7+3);var c=new Date(a.getFullYear(),0,4);c.setDate(c.getDate()-(c.getDay()+6)%7+3);var u=a.getTimezoneOffset()-c.getTimezoneOffset();a.setHours(a.getHours()-u);var l=(a-c)/(864e5*7);return 1+Math.floor(l)}function n(s){var a=s.getDay();return a===0&&(a=7),a}function o(s){return s===null?"null":s===void 0?"undefined":typeof s!="object"?typeof s:Array.isArray(s)?"array":{}.toString.call(s).slice(8,-1).toLowerCase()}typeof define=="function"&&define.amd?define(function(){return t}):typeof zT=="object"?O3.exports=t:e.dateFormat=t})(zT)});var UT=w(pg=>{"use strict";Object.defineProperty(pg,"__esModule",{value:!0});pg.encoder=void 0;function qpe(e,t="utf-8"){return t==="utf-8"?e:Buffer.from(e).toString("latin1")}pg.encoder=qpe});var as=w(hg=>{"use strict";Object.defineProperty(hg,"__esModule",{value:!0});hg.isIP=void 0;hg.isIP=e=>{let t=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,r=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;return t.test(e)||r.test(e)}});var BT=w(vc=>{"use strict";var mg=vc&&vc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vc,"__esModule",{value:!0});vc.getReqUrl=void 0;var jpe=mg(Ur()),Mpe=mg(B("url")),C3=mg(Ga()),A3=mg(is()),Lpe=as(),Fpe=fg();function zpe(e){let t={},r=this.options.cname;Fpe.checkConfigValid(this.options.endpoint,"endpoint"),jpe.default(this.options.endpoint,!1).to(t),e.bucket&&!r&&!Lpe.isIP(t.hostname)&&!this.options.sldEnable&&(t.host=`${e.bucket}.${t.host}`);let i="/";e.bucket&&this.options.sldEnable&&(i+=`${e.bucket}/`),e.object&&(i+=this._escape(e.object).replace(/\+/g,"%2B")),t.pathname=i;let n={};if(e.query&&C3.default(n,e.query),e.subres){let o={};A3.default.string(e.subres)?o[e.subres]="":A3.default.array(e.subres)?e.subres.forEach(s=>{o[s]=""}):o=e.subres,C3.default(n,o)}return t.query=n,Mpe.default.format(t)}vc.getReqUrl=zpe});var $3=w(gg=>{"use strict";Object.defineProperty(gg,"__esModule",{value:!0});gg.isDingTalk=void 0;function Upe(){return!!(process.browser&&window.navigator.userAgent.toLowerCase().includes("aliapp(dingtalk"))}gg.isDingTalk=Upe});var N3=w(yg=>{"use strict";Object.defineProperty(yg,"__esModule",{value:!0});yg.createRequest=void 0;var Bpe=B("crypto"),Wpe=Va()("ali-oss"),Hpe=k3(),Vpe=sg(),R3=I3(),Zpe=Wl(),Gpe=dg(),Kpe=Ur(),Xpe=B("path"),{encoder:Jpe}=UT(),{isIP:Ype}=as(),{setRegion:Qpe}=FT(),{getReqUrl:ehe}=BT(),{isDingTalk:the}=$3();function D3(e,t){return e[t]||e[t.toLowerCase()]}function rhe(e,t){delete e[t],delete e[t.toLowerCase()]}function nhe(e){let t=new Date;this.options.amendTimeSkewed&&(t=+new Date+this.options.amendTimeSkewed);let r={"x-oss-date":Gpe(t,this.options.authorizationV4?"UTC:yyyymmdd'T'HHMMss'Z'":"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'")};this.options.authorizationV4&&(r["x-oss-content-sha256"]="UNSIGNED-PAYLOAD"),typeof window<"u"&&(r["x-oss-user-agent"]=this.userAgent),this.userAgent.includes("nodejs")&&(r["User-Agent"]=this.userAgent),this.options.isRequestPay&&Object.assign(r,{"x-oss-request-payer":"requester"}),this.options.stsToken&&(r["x-oss-security-token"]=this.options.stsToken),Kpe(e.headers).to(r),D3(r,"Content-Type")||(e.mime&&e.mime.indexOf("/")>0?r["Content-Type"]=e.mime:the()?r["Content-Type"]="application/octet-stream":r["Content-Type"]=Zpe.getType(e.mime||Xpe.extname(e.object||""))),D3(r,"Content-Type")||rhe(r,"Content-Type"),e.content&&(e.disabledMD5||(!e.headers||!e.headers["Content-MD5"]?r["Content-MD5"]=Bpe.createHash("md5").update(Buffer.from(e.content,"utf8")).digest("base64"):r["Content-MD5"]=e.headers["Content-MD5"]),r["Content-Length"]||(r["Content-Length"]=e.content.length));let{hasOwnProperty:i}=Object.prototype;for(let c in r)r[c]&&i.call(r,c)&&(r[c]=Jpe(String(r[c]),this.options.headerEncoding));let n={};if(Hpe(e.subres)?n[e.subres]=null:Vpe(e.subres)?e.subres.forEach(c=>{n[c]=null}):R3(e.subres)&&Object.entries(e.subres).forEach(c=>{n[c[0]]=c[1]===""?null:c[1]}),R3(e.query)&&Object.entries(e.query).forEach(c=>{n[c[0]]=c[1]}),r.authorization=this.options.authorizationV4?this.authorizationV4(e.method,{headers:r,queries:n},e.bucket,e.object,e.additionalHeaders):this.authorization(e.method,this._getResource(e),e.subres,r,this.options.headerEncoding),Ype(this.options.endpoint.hostname)){let{region:c,internal:u,secure:l}=this.options,f=Qpe(c,u,l);r.host=`${e.bucket}.${f.host}`}let o=ehe.bind(this)(e);Wpe("request %s %s, with headers %j, !!stream: %s",e.method,o,r,!!e.stream);let s=e.timeout||this.options.timeout,a={method:e.method,content:e.content,stream:e.stream,headers:r,timeout:s,writeStream:e.writeStream,customResponse:e.customResponse,ctx:e.ctx||this.ctx};return this.agent&&(a.agent=this.agent),this.httpsAgent&&(a.httpsAgent=this.httpsAgent),a.enableProxy=!!this.options.enableProxy,a.proxy=this.options.proxy?this.options.proxy:null,{url:o,params:a}}yg.createRequest=nhe});var bc=w(vg=>{"use strict";Object.defineProperty(vg,"__esModule",{value:!0});vg.formatObjKey=void 0;function WT(e,t,r){if(e===null||typeof e!="object")return e;let i;if(Array.isArray(e)){i=[];for(let n=0;n<e.length;n++)i.push(WT(e[n],t,r))}else i={},Object.keys(e).forEach(n=>{i[ihe(n,t,r)]=WT(e[n],t,r)});return i}vg.formatObjKey=WT;function ihe(e,t,r){return r&&r.exclude&&r.exclude.includes(e)||(t==="firstUpperCase"?e=e.replace(/^./,i=>i.toUpperCase()):t==="firstLowerCase"&&(e=e.replace(/^./,i=>i.toLowerCase()))),e}});var bg=w(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.checkCredentials=_c.setSTSToken=void 0;var ohe=bc();async function she(){this.options||(this.options={});let e=new Date;if(this.stsTokenFreshTime){if(+e-this.stsTokenFreshTime>=this.options.refreshSTSTokenInterval){this.stsTokenFreshTime=e;let t=await this.options.refreshSTSToken();t=ohe.formatObjKey(t,"firstLowerCase"),t.securityToken&&(t.stsToken=t.securityToken),P3(t),Object.assign(this.options,t)}}else this.stsTokenFreshTime=e;return null}_c.setSTSToken=she;function P3(e){let t=["accessKeySecret","accessKeyId","stsToken"],r=Object.keys(e);t.forEach(i=>{if(!r.find(n=>n===i))throw Error(`refreshSTSToken must return contains ${i}`)})}_c.checkCredentials=P3});var wg=w(_g=>{"use strict";Object.defineProperty(_g,"__esModule",{value:!0});_g.retry=void 0;function ahe(e,t,r={}){let i=0,{retryDelay:n=500,errorHandler:o=()=>!0}=r,s=(...a)=>new Promise((c,u)=>{e(...a).then(l=>{i=0,c(l)}).catch(l=>{i<t&&o(l)?(i++,setTimeout(()=>{c(s(...a))},n)):(i=0,u(l))})});return s}_g.retry=ahe});var Sg=w(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});xg.isFunction=void 0;xg.isFunction=e=>typeof e=="function"});var kg=w(Eg=>{"use strict";Object.defineProperty(Eg,"__esModule",{value:!0});Eg.getStandardRegion=void 0;function che(e){return e.replace(/^oss-/g,"")}Eg.getStandardRegion=che});var j3=w(q3=>{var uhe=q3;uhe.getSymlink=async function(t,r={}){r.subres=Object.assign({symlink:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),t=this._objectName(t);let i=this._objectRequestParams("GET",t,r);i.successStatuses=[200];let n=await this.request(i),o=n.res.headers["x-oss-symlink-target"];return{targetName:decodeURIComponent(o),res:n.res}}});var L3=w(M3=>{var lhe=M3;lhe.putSymlink=async function(t,r,i){i=i||{},i.headers=i.headers||{},r=this._escape(this._objectName(r)),this._convertMetaToHeaders(i.meta,i.headers),i.headers["x-oss-symlink-target"]=r,i.subres=Object.assign({symlink:""},i.subres),i.versionId&&(i.subres.versionId=i.versionId),i.storageClass&&(i.headers["x-oss-storage-class"]=i.storageClass),t=this._objectName(t);let n=this._objectRequestParams("PUT",t,i);return n.successStatuses=[200],{res:(await this.request(n)).res}}});var z3=w(F3=>{var fhe=F3;fhe.getObjectMeta=async function(t,r){r=r||{},t=this._objectName(t),r.subres=Object.assign({objectMeta:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId);let i=this._objectRequestParams("HEAD",t,r);i.successStatuses=[200];let n=await this.request(i);return{status:n.status,res:n.res}}});var W3=w(B3=>{var{checkBucketName:dhe}=Me(),U3=B3,phe=["content-type","content-encoding","content-language","content-disposition","cache-control","expires"];U3.copy=async function(t,r,i,n){typeof i=="object"&&(n=i),n=n||{},n.headers=n.headers||{},Object.keys(n.headers).forEach(c=>{n.headers[`x-oss-copy-source-${c.toLowerCase()}`]=n.headers[c]}),(n.meta||Object.keys(n.headers).find(c=>phe.includes(c.toLowerCase())))&&(n.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(n.meta,n.headers),r=this._getSourceName(r,i),n.versionId&&(r=`${r}?versionId=${n.versionId}`),n.headers["x-oss-copy-source"]=r;let o=this._objectRequestParams("PUT",t,n);o.xmlResponse=!0,o.successStatuses=[200,304];let s=await this.request(o),{data:a}=s;return a&&(a={etag:a.ETag,lastModified:a.LastModified}),{data:a,res:s.res}};U3._getSourceName=function(t,r){return typeof r=="string"?t=this._objectName(t):t[0]!=="/"?r=this.options.bucket:(r=t.replace(/\/(.+?)(\/.*)/,"$1"),t=t.replace(/(\/.+?\/)(.*)/,"$2")),dhe(r),t=encodeURIComponent(t),t=`/${r}/${t}`,t}});var Ig=w(Tg=>{"use strict";Object.defineProperty(Tg,"__esModule",{value:!0});Tg.policy2Str=void 0;function hhe(e){let t;if(e)if(typeof e=="string")try{t=JSON.stringify(JSON.parse(e))}catch(r){throw new Error(`Policy string is not a valid JSON: ${r.message}`)}else t=JSON.stringify(e);return t}Tg.policy2Str=hhe});var Z3=w(V3=>{var{policy2Str:mhe}=Ig(),ghe=ss(),{isObject:H3}=Sr(),yhe=V3;yhe.calculatePostSignature=function(t){if(!H3(t)&&typeof t!="string")throw new Error("policy must be JSON string or Object");if(!H3(t))try{JSON.stringify(JSON.parse(t))}catch{throw new Error("policy must be JSON string or Object")}t=Buffer.from(mhe(t),"utf8").toString("base64");let r=ghe.computeSignature(this.options.accessKeySecret,t);return{OSSAccessKeyId:this.options.accessKeyId,Signature:r,policy:t}}});var K3=w(G3=>{var vhe=G3,{isObject:bhe}=Sr();vhe.getObjectTagging=async function(t,r={}){r.subres=Object.assign({tagging:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),t=this._objectName(t);let i=this._objectRequestParams("GET",t,r);i.successStatuses=[200];let n=await this.request(i),o=await this.parseXML(n.data),{Tag:s}=o.TagSet;s=s&&bhe(s)?[s]:s||[];let a={};return s.forEach(c=>{a[c.Key]=c.Value}),{status:n.status,res:n.res,tag:a}}});var gr=w(Og=>{"use strict";Object.defineProperty(Og,"__esModule",{value:!0});Og.obj2xml=void 0;var _he=bc();function cs(e){return Object.prototype.toString.call(e).replace(/(.*? |])/g,"").toLowerCase()}function HT(e,t){let r="";return t&&t.headers&&(r=`<?xml version="1.0" encoding="UTF-8"?>
|
|
237
237
|
`),t&&t.firstUpperCase&&(e=_he.formatObjKey(e,"firstUpperCase")),cs(e)==="object"?Object.keys(e).forEach(i=>{cs(e[i])!=="undefined"&&cs(e[i])!=="null"&&(cs(e[i])==="string"||cs(e[i])==="number"?r+=`<${i}>${e[i]}</${i}>`:cs(e[i])==="object"?r+=`<${i}>${HT(e[i])}</${i}>`:cs(e[i])==="array"?r+=e[i].map(n=>`<${i}>${HT(n)}</${i}>`).join(""):r+=`<${i}>${e[i].toString()}</${i}>`)}):r+=e.toString(),r}Og.obj2xml=HT});var VT=w(Cg=>{"use strict";Object.defineProperty(Cg,"__esModule",{value:!0});Cg.checkValid=void 0;function whe(e,t){t.forEach(r=>{if(r.validator)r.validator(e);else if(r.pattern&&!r.pattern.test(e))throw new Error(r.msg)})}Cg.checkValid=whe});var ZT=w(Ag=>{"use strict";Object.defineProperty(Ag,"__esModule",{value:!0});Ag.checkObjectTag=void 0;var{checkValid:xhe}=VT(),{isObject:She}=Sr(),X3=[{validator:e=>{if(typeof e!="string")throw new Error("the key and value of the tag must be String")}},{pattern:/^[a-zA-Z0-9 +-=._:/]+$/,msg:"tag can contain letters, numbers, spaces, and the following symbols: plus sign (+), hyphen (-), equal sign (=), period (.), underscore (_), colon (:), and forward slash (/)"}],Ehe={key:[...X3,{pattern:/^.{1,128}$/,msg:"tag key can be a maximum of 128 bytes in length"}],value:[...X3,{pattern:/^.{0,256}$/,msg:"tag value can be a maximum of 256 bytes in length"}]};function khe(e){if(!She(e))throw new Error("tag must be Object");let t=Object.entries(e);if(t.length>10)throw new Error("maximum of 10 tags for a object");let r=["key","value"];t.forEach(i=>{i.forEach((n,o)=>{xhe(n,Ehe[r[o]])})})}Ag.checkObjectTag=khe});var Y3=w(J3=>{var{obj2xml:The}=gr(),{checkObjectTag:Ihe}=ZT(),Ohe=J3;Ohe.putObjectTagging=async function(t,r,i={}){Ihe(r),i.subres=Object.assign({tagging:""},i.subres),i.versionId&&(i.subres.versionId=i.versionId),t=this._objectName(t);let n=this._objectRequestParams("PUT",t,i);n.successStatuses=[200],r=Object.keys(r).map(a=>({Key:a,Value:r[a]}));let o={Tagging:{TagSet:{Tag:r}}};n.mime="xml",n.content=The(o);let s=await this.request(n);return{res:s.res,status:s.status}}});var eW=w(Q3=>{var Che=Q3;Che.deleteObjectTagging=async function(t,r={}){r.subres=Object.assign({tagging:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),t=this._objectName(t);let i=this._objectRequestParams("DELETE",t,r);i.successStatuses=[204];let n=await this.request(i);return{status:n.status,res:n.res}}});var ui=w($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:!0});$g.isArray=void 0;$g.isArray=e=>Object.prototype.toString.call(e)==="[object Array]"});var GT=w(Rg=>{"use strict";Object.defineProperty(Rg,"__esModule",{value:!0});Rg.parseRestoreInfo=void 0;Rg.parseRestoreInfo=e=>{let t;if(e&&(t={ongoingRequest:e.includes("true")},!t.ongoingRequest)){let r=e.match(/expiry-date="(.*)"/);r&&r[1]&&(t.expiryDate=new Date(r[1]))}return t}});var oW=w(iW=>{var rW=iW,{isObject:Ahe}=Sr(),{isArray:tW}=ui(),{parseRestoreInfo:$he}=GT();rW.getBucketVersions=nW;rW.listObjectVersions=nW;async function nW(e={},t={}){if(e.versionIdMarker&&e.keyMarker===void 0)throw new Error("A version-id marker cannot be specified without a key marker");t.subres=Object.assign({versions:""},t.subres),t.versionId&&(t.subres.versionId=t.versionId);let r=this._objectRequestParams("GET","",t);r.xmlResponse=!0,r.successStatuses=[200],r.query=Dhe(e);let i=await this.request(r),n=i.data.Version||[],o=i.data.DeleteMarker||[],s=this;n&&(Array.isArray(n)||(n=[n]),n=n.map(c=>({name:c.Key,url:s._objectUrl(c.Key),lastModified:c.LastModified,isLatest:c.IsLatest==="true",versionId:c.VersionId,etag:c.ETag,type:c.Type,size:Number(c.Size),storageClass:c.StorageClass,owner:{id:c.Owner.ID,displayName:c.Owner.DisplayName},restoreInfo:$he(c.RestoreInfo)}))),o&&(tW(o)||(o=[o]),o=o.map(c=>({name:c.Key,lastModified:c.LastModified,versionId:c.VersionId,owner:{id:c.Owner.ID,displayName:c.Owner.DisplayName}})));let a=i.data.CommonPrefixes||null;return a&&(tW(a)||(a=[a]),a=a.map(c=>c.Prefix)),{res:i.res,objects:n,deleteMarker:o,prefixes:a,nextMarker:i.data.NextKeyMarker||null,NextVersionIdMarker:i.data.NextVersionIdMarker||null,nextKeyMarker:i.data.NextKeyMarker||null,nextVersionIdMarker:i.data.NextVersionIdMarker||null,isTruncated:i.data.IsTruncated==="true"}}function Rhe(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Dhe(e={}){let t={};return Ahe(e)&&Object.keys(e).forEach(r=>{t[Rhe(r)]=e[r]}),t}});var cW=w(aW=>{var sW=Ki(),{obj2xml:Nhe}=gr(),Phe=aW;Phe.deleteMulti=async function(t,r={}){let i=[];if(!t||!t.length)throw new Error("names is required");for(let l=0;l<t.length;l++){let f={};if(typeof t[l]=="string")f.Key=sW.escape(this._objectName(t[l]));else{let{key:p,versionId:d}=t[l];f.Key=sW.escape(this._objectName(p)),f.VersionId=d}i.push(f)}let n={Delete:{Quiet:!!r.quiet,Object:i}},o=Nhe(n,{headers:!0});r.subres=Object.assign({delete:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId);let s=this._objectRequestParams("POST","",r);s.mime="xml",s.content=o,s.xmlResponse=!0,s.successStatuses=[200];let a=await this.request(s),c=a.data,u=c&&c.Deleted||null;return u&&(Array.isArray(u)||(u=[u])),{res:a.res,deleted:u||[]}}});var lW=w(uW=>{var qhe=uW;qhe.getACL=async function(t,r={}){r.subres=Object.assign({acl:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),t=this._objectName(t);let i=this._objectRequestParams("GET",t,r);i.successStatuses=[200],i.xmlResponse=!0;let n=await this.request(i);return{acl:n.data.AccessControlList.Grant,owner:{id:n.data.Owner.ID,displayName:n.data.Owner.DisplayName},res:n.res}}});var dW=w(fW=>{var jhe=fW;jhe.putACL=async function(t,r,i){i=i||{},i.subres=Object.assign({acl:""},i.subres),i.versionId&&(i.subres.versionId=i.versionId),i.headers=i.headers||{},i.headers["x-oss-object-acl"]=r,t=this._objectName(t);let n=this._objectRequestParams("PUT",t,i);return n.successStatuses=[200],{res:(await this.request(n)).res}}});var pW=w(Dg=>{"use strict";Object.defineProperty(Dg,"__esModule",{value:!0});Dg.checkEnv=void 0;function Mhe(e){process.browser&&console.warn(e)}Dg.checkEnv=Mhe});var mW=w(hW=>{var{checkEnv:Lhe}=pW(),Fhe=hW;Fhe.head=async function(t,r={}){Lhe("Because HeadObject has gzip enabled, head cannot get the file size correctly. If you need to get the file size, please use getObjectMeta"),r.subres=Object.assign({},r.subres),r.versionId&&(r.subres.versionId=r.versionId);let i=this._objectRequestParams("HEAD",t,r);i.successStatuses=[200,304];let n=await this.request(i),o={meta:null,res:n.res,status:n.status};return n.status===200&&Object.keys(n.headers).forEach(s=>{s.indexOf("x-oss-meta-")===0&&(o.meta||(o.meta={}),o.meta[s.substring(11)]=n.headers[s])}),o}});var yW=w(gW=>{var zhe=gW;zhe.delete=async function(t,r={}){r.subres=Object.assign({},r.subres),r.versionId&&(r.subres.versionId=r.versionId);let i=this._objectRequestParams("DELETE",t,r);return i.successStatuses=[204],{res:(await this.request(i)).res}}});var _W=w(bW=>{var Uhe=B("fs"),vW=is(),{isObject:Bhe}=Sr(),Whe=bW;Whe.get=async function(t,r,i={}){let n=null,o=!1;vW.writableStream(r)?n=r:vW.string(r)?(n=Uhe.createWriteStream(r),o=!0):Bhe(r)&&(i=r),i=i||{};let s=process&&process.browser,a=i.responseCacheControl===null?"":"no-cache",c=s&&a?{"response-cache-control":a}:{};i.subres=Object.assign(c,i.subres),i.versionId&&(i.subres.versionId=i.versionId),i.process&&(i.subres["x-oss-process"]=i.process);let u;try{let l=this._objectRequestParams("GET",t,i);l.writeStream=n,l.successStatuses=[200,206,304],u=await this.request(l),o&&n.destroy()}catch(l){throw o&&(n.destroy(),await this._deleteFileSafe(r)),l}return{res:u.res,content:u.data}}});var wW=w(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.postAsyncFetch=void 0;var Hhe=gr();async function Vhe(e,t,r={}){r.subres=Object.assign({asyncFetch:""},r.subres),r.headers=r.headers||{},e=this._objectName(e);let{host:i="",contentMD5:n="",callback:o="",storageClass:s="",ignoreSameKey:a=!0}=r,c={AsyncFetchTaskConfiguration:{Url:t,Object:e,Host:i,ContentMD5:n,Callback:o,StorageClass:s,IgnoreSameKey:a}},u=this._objectRequestParams("POST","",r);u.mime="xml",u.xmlResponse=!0,u.successStatuses=[200],u.content=Hhe.obj2xml(c);let l=await this.request(u);return{res:l.res,status:l.status,taskId:l.data.TaskId}}Ng.postAsyncFetch=Vhe});var xW=w(Pg=>{"use strict";Object.defineProperty(Pg,"__esModule",{value:!0});Pg.getAsyncFetch=void 0;var Zhe=bc();async function Ghe(e,t={}){t.subres=Object.assign({asyncFetch:""},t.subres),t.headers=t.headers||{};let r=this._objectRequestParams("GET","",t);r.headers["x-oss-task-id"]=e,r.successStatuses=[200],r.xmlResponse=!0;let i=await this.request(r),n=Zhe.formatObjKey(i.data.TaskInfo,"firstLowerCase");return{res:i.res,status:i.status,state:i.data.State,taskInfo:n}}Pg.getAsyncFetch=Ghe});var EW=w(SW=>{var Khe=B("url"),{isIP:Xhe}=as(),Jhe=SW;Jhe.generateObjectUrl=function(t,r){if(Xhe(this.options.endpoint.hostname))throw new Error("can not get the object URL when endpoint is IP");if(r)r[r.length-1]!=="/"&&(r+="/");else{r=this.options.endpoint.format();let i=Khe.parse(r),{bucket:n}=this.options;i.hostname=`${n}.${i.hostname}`,i.host=`${n}.${i.host}`,r=i.format()}return r+this._escape(this._objectName(t))}});var TW=w(kW=>{var{isIP:Yhe}=as(),Qhe=kW;Qhe.getObjectUrl=function(t,r){if(Yhe(this.options.endpoint.hostname))throw new Error("can not get the object URL when endpoint is IP");return r?r[r.length-1]!=="/"&&(r+="/"):r=this.options.endpoint.format(),r+this._escape(this._objectName(t))}});var OW=w(IW=>{var eme=B("url"),tme=Ki(),rme=Ur(),nme=ss(),{isIP:ime}=as(),ome=IW;ome.signatureUrl=function(t,r,i=!0){if(ime(this.options.endpoint.hostname))throw new Error("can not get the object URL when endpoint is IP");if(i&&/^\?/.test(t))throw new Error(`Invalid object name ${t}`);r=r||{},t=this._objectName(t),r.method=r.method||"GET";let n=tme.timestamp()+(r.expires||1800),o={bucket:this.options.bucket,object:t},s=this._getResource(o);this.options.stsToken&&(r["security-token"]=this.options.stsToken);let a=nme._signatureForURL(this.options.accessKeySecret,r,s,n),c=eme.parse(this._getReqUrl(o));return c.query={OSSAccessKeyId:this.options.accessKeyId,Expires:n,Signature:a.Signature},rme(a.subResource).to(c.query),c.format()}});var AW=w(CW=>{var sme=B("url"),ame=Ki(),cme=Ur(),ume=ss(),{isIP:lme}=as(),{setSTSToken:fme}=bg(),{isFunction:dme}=Sg(),pme=CW;pme.asyncSignatureUrl=async function(t,r,i=!0){if(lme(this.options.endpoint.hostname))throw new Error("can not get the object URL when endpoint is IP");if(i&&/^\?/.test(t))throw new Error(`Invalid object name ${t}`);r=r||{},t=this._objectName(t),r.method=r.method||"GET";let n=ame.timestamp()+(r.expires||1800),o={bucket:this.options.bucket,object:t},s=this._getResource(o);this.options.stsToken&&dme(this.options.refreshSTSToken)&&await fme.call(this),this.options.stsToken&&(r["security-token"]=this.options.stsToken);let a=ume._signatureForURL(this.options.accessKeySecret,r,s,n),c=sme.parse(this._getReqUrl(o));return c.query={OSSAccessKeyId:this.options.accessKeyId,Expires:n,Signature:a.Signature},cme(a.subResource).to(c.query),c.format()}});var RW=w($W=>{var hme=dg(),mme=B("url"),us=ss(),{setSTSToken:gme}=bg(),{isFunction:yme}=Sg(),{getStandardRegion:vme}=kg(),bme=$W;bme.signatureUrlV4=async function(t,r,i,n,o){let{cloudBoxId:s}=this.options,a=us.getProduct(s),c=us.getSignRegion(vme(this.options.region),s),u=i&&i.headers||{},l=Object.assign({},i&&i.queries||{}),p=hme(new Date,"UTC:yyyymmdd'T'HHMMss'Z'"),d=p.split("T")[0],h=us.fixAdditionalHeaders(o);h.length>0&&(l["x-oss-additional-headers"]=h.join(";")),l["x-oss-credential"]=us.getCredential(d,c,this.options.accessKeyId,a),l["x-oss-date"]=p,l["x-oss-expires"]=r,l["x-oss-signature-version"]="OSS4-HMAC-SHA256",this.options.stsToken&&yme(this.options.refreshSTSToken)&&await gme.call(this),this.options.stsToken&&(l["x-oss-security-token"]=this.options.stsToken);let m=us.getCanonicalRequest(t,{headers:u,queries:l},this.options.bucket,n,h),_=us.getStringToSign(c,p,m,a);l["x-oss-signature"]=us.getSignatureV4(this.options.accessKeySecret,d,c,_,a);let k=mme.parse(this._getReqUrl({bucket:this.options.bucket,object:n}));return k.query=Object.assign({},l),k.format()}});var DW=w(wc=>{"use strict";var _me=wc&&wc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wc,"__esModule",{value:!0});wc.signPostObjectPolicyV4=void 0;var wme=_me(dg()),xme=kg(),Sme=Ig(),Eme=ss();function kme(e,t){let r=Buffer.from(Sme.policy2Str(e),"utf8").toString("base64"),n=wme.default(t,"UTC:yyyymmdd'T'HHMMss'Z'").split("T")[0];return Eme.getSignatureV4(this.options.accessKeySecret,n,xme.getStandardRegion(this.options.region),r)}wc.signPostObjectPolicyV4=kme});var PW=w(NW=>{var vt=Ga(),bt=NW;vt(bt,j3());vt(bt,L3());vt(bt,z3());vt(bt,W3());vt(bt,Z3());vt(bt,K3());vt(bt,Y3());vt(bt,eW());vt(bt,oW());vt(bt,cW());vt(bt,lW());vt(bt,dW());vt(bt,mW());vt(bt,yW());vt(bt,_W());vt(bt,wW());vt(bt,xW());vt(bt,EW());vt(bt,TW());vt(bt,OW());vt(bt,AW());vt(bt,RW());vt(bt,DW())});var KT=w(qW=>{qW.encodeCallback=function(t,r){if(t.headers=t.headers||{},!Object.prototype.hasOwnProperty.call(t.headers,"x-oss-callback")&&r.callback){let i={callbackUrl:encodeURI(r.callback.url),callbackBody:r.callback.body};r.callback.host&&(i.callbackHost=r.callback.host),r.callback.contentType&&(i.callbackBodyType=r.callback.contentType),r.callback.callbackSNI&&(i.callbackSNI=r.callback.callbackSNI);let n=Buffer.from(JSON.stringify(i)).toString("base64");if(t.headers["x-oss-callback"]=n,r.callback.customValue){let o={};Object.keys(r.callback.customValue).forEach(s=>{o[`x:${s}`]=r.callback.customValue[s].toString()}),t.headers["x-oss-callback-var"]=Buffer.from(JSON.stringify(o)).toString("base64")}}}});var Jl=w(qg=>{"use strict";Object.defineProperty(qg,"__esModule",{value:!0});qg.isBuffer=void 0;function Tme(e){return Buffer.isBuffer(e)}qg.isBuffer=Tme});var zW=w(FW=>{var Ime=Va()("ali-oss:object"),Yl=B("fs"),jW=is(),Ome=Ur(),Cme=B("path"),Ame=Wl(),MW=KT(),{Transform:$me}=B("stream"),Rme=wT(),{isBuffer:Dme}=Jl(),{retry:Nme}=wg(),{obj2xml:Pme}=gr(),{parseRestoreInfo:LW}=GT(),kr=FW;kr.append=async function(t,r,i){i=i||{},i.position===void 0&&(i.position="0"),i.subres={append:"",position:i.position},i.method="POST";let n=await this.put(t,r,i);return n.nextAppendPosition=n.res.headers["x-oss-next-append-position"],n};kr.put=async function(t,r,i){let n;if(i=i||{},t=this._objectName(t),Dme(r))n=r;else if(jW.string(r)){if(!Yl.statSync(r).isFile())throw new Error(`${r} is not file`);i.mime=i.mime||Ame.getType(Cme.extname(r)),i.contentLength=await this._getFileSize(r);let l=()=>Yl.createReadStream(r);return await Nme((p,d,h)=>this.putStream(p,d(),h),this.options.retryMax,{errorHandler:p=>!!(h=>{let m=[-1,-2].includes(h.status),_=this.options.requestErrorRetryHandle||(()=>!0);return m&&_(h)})(p)})(t,l,i)}else{if(jW.readableStream(r))return await this.putStream(t,r,i);throw new TypeError("Must provide String/Buffer/ReadableStream for put.")}i.headers=i.headers||{},this._convertMetaToHeaders(i.meta,i.headers);let o=i.method||"PUT",s=this._objectRequestParams(o,t,i);MW.encodeCallback(s,i),s.mime=i.mime,s.content=n,s.successStatuses=[200];let a=await this.request(s),c={name:t,url:this._objectUrl(t),res:a.res};return s.headers&&s.headers["x-oss-callback"]&&(c.data=JSON.parse(a.data.toString())),c};kr.putStream=async function(t,r,i){i=i||{},i.headers=i.headers||{},t=this._objectName(t),i.contentLength?i.headers["Content-Length"]=i.contentLength:i.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(i.meta,i.headers);let n=i.method||"PUT",o=this._objectRequestParams(n,t,i);MW.encodeCallback(o,i),o.mime=i.mime;let s=new $me;s._transform=function(l,f,p){this.push(l),p()},o.stream=Rme(r,s),o.successStatuses=[200];let a=await this.request(o),c={name:t,url:this._objectUrl(t),res:a.res};return o.headers&&o.headers["x-oss-callback"]&&(c.data=JSON.parse(a.data.toString())),c};kr.getStream=async function(t,r){r=r||{},r.process&&(r.subres=r.subres||{},r.subres["x-oss-process"]=r.process);let i=this._objectRequestParams("GET",t,r);i.customResponse=!0,i.successStatuses=[200,206,304];let n=await this.request(i);return{stream:n.res,res:{status:n.status,headers:n.headers}}};kr.putMeta=async function(t,r,i){return await this.copy(t,t,{meta:r||{},timeout:i&&i.timeout,ctx:i&&i.ctx})};kr.list=async function(t,r){let i=this._objectRequestParams("GET","",r);i.query=t,i.xmlResponse=!0,i.successStatuses=[200];let n=await this.request(i),o=n.data.Contents||[],s=this;o&&(Array.isArray(o)||(o=[o]),o=o.map(c=>({name:c.Key,url:s._objectUrl(c.Key),lastModified:c.LastModified,etag:c.ETag,type:c.Type,size:Number(c.Size),storageClass:c.StorageClass,owner:{id:c.Owner.ID,displayName:c.Owner.DisplayName},restoreInfo:LW(c.RestoreInfo)})));let a=n.data.CommonPrefixes||null;return a&&(Array.isArray(a)||(a=[a]),a=a.map(c=>c.Prefix)),{res:n.res,objects:o,prefixes:a,nextMarker:n.data.NextMarker||null,isTruncated:n.data.IsTruncated==="true"}};kr.listV2=async function(t={},r={}){let i=t["continuation-token"]||t.continuationToken;delete t["continuation-token"],delete t.continuationToken,i&&(r.subres=Object.assign({"continuation-token":i},r.subres));let n=this._objectRequestParams("GET","",r);n.query=Object.assign({"list-type":2},t),delete n.query["continuation-token"],delete t.continuationToken,n.xmlResponse=!0,n.successStatuses=[200];let o=await this.request(n),s=o.data.Contents||[],a=this;s&&(Array.isArray(s)||(s=[s]),s=s.map(u=>{let l=null;return u.Owner&&(l={id:u.Owner.ID,displayName:u.Owner.DisplayName}),{name:u.Key,url:a._objectUrl(u.Key),lastModified:u.LastModified,etag:u.ETag,type:u.Type,size:Number(u.Size),storageClass:u.StorageClass,owner:l,restoreInfo:LW(u.RestoreInfo)}}));let c=o.data.CommonPrefixes||null;return c&&(Array.isArray(c)||(c=[c]),c=c.map(u=>u.Prefix)),{res:o.res,objects:s,prefixes:c,isTruncated:o.data.IsTruncated==="true",keyCount:+o.data.KeyCount,continuationToken:o.data.ContinuationToken||null,nextContinuationToken:o.data.NextContinuationToken||null}};kr.restore=async function(t,r={type:"Archive"}){r=r||{},r.subres=Object.assign({restore:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId);let i=this._objectRequestParams("POST",t,r),n={RestoreRequest:{Days:r.Days?r.Days:2}};return(r.type==="ColdArchive"||r.type==="DeepColdArchive")&&(n.RestoreRequest.JobParameters={Tier:r.JobParameters?r.JobParameters:"Standard"}),i.content=Pme(n,{headers:!0}),i.mime="xml",i.successStatuses=[202],{res:(await this.request(i)).res}};kr._objectUrl=function(t){return this._getReqUrl({bucket:this.options.bucket,object:t})};kr._objectRequestParams=function(e,t,r){if(!this.options.bucket&&!this.options.cname)throw new Error("Please create a bucket first");r=r||{},t=this._objectName(t);let i={object:t,bucket:this.options.bucket,method:e,subres:r&&r.subres,additionalHeaders:r&&r.additionalHeaders,timeout:r&&r.timeout,ctx:r&&r.ctx};return r.headers&&(i.headers={},Ome(r.headers).to(i.headers)),i};kr._objectName=function(e){return e.replace(/^\/+/,"")};kr._statFile=function(e){return new Promise((t,r)=>{Yl.stat(e,(i,n)=>{i?r(i):t(n)})})};kr._convertMetaToHeaders=function(e,t){e&&Object.keys(e).forEach(r=>{t[`x-oss-meta-${r}`]=e[r]})};kr._deleteFileSafe=function(e){return new Promise(t=>{Yl.exists(e,r=>{r?Yl.unlink(e,i=>{i&&Ime("unlink %j error: %s",e,i),t()}):t()})})}});var UW=w((XT,xc)=>{(function(e,t){typeof XT=="object"&&typeof xc<"u"?xc.exports=t(e):typeof define=="function"&&define.amd?define(t):t(e)})(typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:XT,function(e){"use strict";e=e||{};var t=e.Base64,r="2.6.4",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=(function(P){for(var D={},V=0,$=P.length;V<$;V++)D[P.charAt(V)]=V;return D})(i),o=String.fromCharCode,s=function(P){if(P.length<2){var D=P.charCodeAt(0);return D<128?P:D<2048?o(192|D>>>6)+o(128|D&63):o(224|D>>>12&15)+o(128|D>>>6&63)+o(128|D&63)}else{var D=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return o(240|D>>>18&7)+o(128|D>>>12&63)+o(128|D>>>6&63)+o(128|D&63)}},a=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,c=function(P){return P.replace(a,s)},u=function(P){var D=[0,2,1][P.length%3],V=P.charCodeAt(0)<<16|(P.length>1?P.charCodeAt(1):0)<<8|(P.length>2?P.charCodeAt(2):0),$=[i.charAt(V>>>18),i.charAt(V>>>12&63),D>=2?"=":i.charAt(V>>>6&63),D>=1?"=":i.charAt(V&63)];return $.join("")},l=e.btoa&&typeof e.btoa=="function"?function(P){return e.btoa(P)}:function(P){if(P.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return P.replace(/[\s\S]{1,3}/g,u)},f=function(P){return l(c(String(P)))},p=function(P){return P.replace(/[+\/]/g,function(D){return D=="+"?"-":"_"}).replace(/=/g,"")},d=function(P,D){return D?p(f(P)):f(P)},h=function(P){return d(P,!0)},m;e.Uint8Array&&(m=function(P,D){for(var V="",$=0,U=P.length;$<U;$+=3){var Z=P[$],J=P[$+1],j=P[$+2],pe=Z<<16|J<<8|j;V+=i.charAt(pe>>>18)+i.charAt(pe>>>12&63)+(typeof J<"u"?i.charAt(pe>>>6&63):"=")+(typeof j<"u"?i.charAt(pe&63):"=")}return D?p(V):V});var _=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,k=function(P){switch(P.length){case 4:var D=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),V=D-65536;return o((V>>>10)+55296)+o((V&1023)+56320);case 3:return o((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return o((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},S=function(P){return P.replace(_,k)},v=function(P){var D=P.length,V=D%4,$=(D>0?n[P.charAt(0)]<<18:0)|(D>1?n[P.charAt(1)]<<12:0)|(D>2?n[P.charAt(2)]<<6:0)|(D>3?n[P.charAt(3)]:0),U=[o($>>>16),o($>>>8&255),o($&255)];return U.length-=[0,0,2,1][V],U.join("")},g=e.atob&&typeof e.atob=="function"?function(P){return e.atob(P)}:function(P){return P.replace(/\S{1,4}/g,v)},y=function(P){return g(String(P).replace(/[^A-Za-z0-9\+\/]/g,""))},T=function(P){return S(g(P))},R=function(P){return String(P).replace(/[-_]/g,function(D){return D=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},I=function(P){return T(R(P))},b;e.Uint8Array&&(b=function(P){return Uint8Array.from(y(R(P)),function(D){return D.charCodeAt(0)})});var O=function(){var P=e.Base64;return e.Base64=t,P};if(e.Base64={VERSION:r,atob:y,btoa:l,fromBase64:I,toBase64:d,utob:c,encode:d,encodeURI:h,btou:S,decode:I,noConflict:O,fromUint8Array:m,toUint8Array:b},typeof Object.defineProperty=="function"){var A=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}};e.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",A(function(){return I(this)})),Object.defineProperty(String.prototype,"toBase64",A(function(P){return d(this,P)})),Object.defineProperty(String.prototype,"toBase64URI",A(function(){return d(this,!0)}))}}return e.Meteor&&(Base64=e.Base64),typeof xc<"u"&&xc.exports?xc.exports.Base64=e.Base64:typeof define=="function"&&define.amd&&define([],function(){return e.Base64}),{Base64:e.Base64}})});var HW=w(WW=>{var{checkBucketName:qme}=Me(),jme=B("querystring"),{Base64:{encode:BW}}=UW(),Mme=WW;Mme.processObjectSave=async function(t,r,i,n){JT(t,"sourceObject"),JT(r,"targetObject"),JT(i,"process"),r=this._objectName(r),n&&qme(n);let o=this._objectRequestParams("POST",t,{subres:"x-oss-process"}),s=n?`,b_${BW(n)}`:"";r=BW(r);let a={"x-oss-process":`${i}|sys/saveas,o_${r}${s}`};o.content=jme.stringify(a);let c=await this.request(o);return{res:c.res,status:c.res.status}};function JT(e,t){if(!e)throw new Error(`${t} is required`);if(typeof e!="string")throw new Error(`${t} must be String`)}});var ZW=w(VW=>{var Lme=Ga(),Fme=VW;Lme(Fme,HW())});var KW=w(GW=>{var{checkBucketName:zme}=Me(),Ume=GW;Ume.getBucketRequestPayment=async function(t,r){r=r||{},zme(t);let i=this._bucketRequestParams("GET",t,"requestPayment",r);i.successStatuses=[200],i.xmlResponse=!0;let n=await this.request(i);return{status:n.status,res:n.res,payer:n.data.Payer}}});var JW=w(XW=>{var{checkBucketName:Bme}=Me(),{obj2xml:Wme}=gr(),Hme=XW,Vme=["BucketOwner","Requester"];Hme.putBucketRequestPayment=async function(t,r,i){if(i=i||{},!r||Vme.indexOf(r)<0)throw new Error("payer must be BucketOwner or Requester");Bme(t);let n=this._bucketRequestParams("PUT",t,"requestPayment",i);n.successStatuses=[200];let s=Wme({RequestPaymentConfiguration:{Payer:r}},{headers:!0});n.mime="xml",n.content=s;let a=await this.request(n);return{status:a.status,res:a.res}}});var QW=w(YW=>{var Zme=YW,{checkBucketName:Gme}=Me(),{obj2xml:Kme}=gr();Zme.putBucketEncryption=async function(t,r){r=r||{},Gme(t);let i=this._bucketRequestParams("PUT",t,"encryption",r);i.successStatuses=[200];let n={ServerSideEncryptionRule:{ApplyServerSideEncryptionByDefault:{SSEAlgorithm:r.SSEAlgorithm}}};r.KMSMasterKeyID!==void 0&&(n.ServerSideEncryptionRule.ApplyServerSideEncryptionByDefault.KMSMasterKeyID=r.KMSMasterKeyID);let o=Kme(n,{headers:!0});i.mime="xml",i.content=o;let s=await this.request(i);return{status:s.status,res:s.res}}});var t8=w(e8=>{var{checkBucketName:Xme}=Me(),Jme=e8;Jme.getBucketEncryption=async function(t){Xme(t);let r=this._bucketRequestParams("GET",t,"encryption");r.successStatuses=[200],r.xmlResponse=!0;let i=await this.request(r);return{encryption:i.data.ApplyServerSideEncryptionByDefault,status:i.status,res:i.res}}});var n8=w(r8=>{var{checkBucketName:Yme}=Me(),Qme=r8;Qme.deleteBucketEncryption=async function(t){Yme(t);let r=this._bucketRequestParams("DELETE",t,"encryption");r.successStatuses=[204],r.xmlResponse=!0;let i=await this.request(r);return{status:i.status,res:i.res}}});var YT=w(jg=>{"use strict";Object.defineProperty(jg,"__esModule",{value:!0});jg.formatTag=void 0;var ege=Sr();function tge(e){e.Tagging!==void 0?e=e.Tagging.TagSet.Tag:e.TagSet!==void 0?e=e.TagSet.Tag:e.Tag!==void 0&&(e=e.Tag),e=e&&ege.isObject(e)?[e]:e||[];let t={};return e.forEach(r=>{t[r.Key]=r.Value}),t}jg.formatTag=tge});var o8=w(i8=>{var rge=i8,{checkBucketName:nge}=Me(),{formatTag:ige}=YT();rge.getBucketTags=async function(t,r={}){nge(t);let i=this._bucketRequestParams("GET",t,"tagging",r);i.successStatuses=[200];let n=await this.request(i),o=await this.parseXML(n.data);return{status:n.status,res:n.res,tag:ige(o)}}});var a8=w(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});Mg.checkBucketTag=void 0;var{checkValid:oge}=VT(),{isObject:sge}=Sr(),s8=[{validator:e=>{if(typeof e!="string")throw new Error("the key and value of the tag must be String")}}],age={key:[...s8,{pattern:/^.{1,64}$/,msg:"tag key can be a maximum of 64 bytes in length"},{pattern:/^(?!https*:\/\/|Aliyun)/,msg:"tag key can not startsWith: http://, https://, Aliyun"}],value:[...s8,{pattern:/^.{0,128}$/,msg:"tag value can be a maximum of 128 bytes in length"}]};Mg.checkBucketTag=e=>{if(!sge(e))throw new Error("bucket tag must be Object");let t=Object.entries(e);if(t.length>20)throw new Error("maximum of 20 tags for a bucket");let r=["key","value"];t.forEach(i=>{i.forEach((n,o)=>{oge(n,age[r[o]])})})}});var u8=w(c8=>{var{checkBucketName:cge}=Me(),{obj2xml:uge}=gr(),{checkBucketTag:lge}=a8(),fge=c8;fge.putBucketTags=async function(t,r,i={}){cge(t),lge(r);let n=this._bucketRequestParams("PUT",t,"tagging",i);n.successStatuses=[200],r=Object.keys(r).map(a=>({Key:a,Value:r[a]}));let o={Tagging:{TagSet:{Tag:r}}};n.mime="xml",n.content=uge(o);let s=await this.request(n);return{res:s.res,status:s.status}}});var f8=w(l8=>{var{checkBucketName:dge}=Me(),pge=l8;pge.deleteBucketTags=async function(t,r={}){dge(t);let i=this._bucketRequestParams("DELETE",t,"tagging",r);i.successStatuses=[204];let n=await this.request(i);return{status:n.status,res:n.res}}});var p8=w(d8=>{var hge=d8,{checkBucketName:mge}=Me(),{obj2xml:gge}=gr();hge.putBucket=async function(t,r={}){mge(t,!0);let i=this._bucketRequestParams("PUT",t,"",r),n={},o={CreateBucketConfiguration:n},s=r.StorageClass||r.storageClass,a=r.DataRedundancyType||r.dataRedundancyType;(s||a)&&(s&&(n.StorageClass=s),a&&(n.DataRedundancyType=a),i.mime="xml",i.content=gge(o,{headers:!0}));let{acl:c,headers:u={}}=r;c&&(u["x-oss-acl"]=c),i.headers=u,i.successStatuses=[200];let l=await this.request(i);return{bucket:l.headers.location&&l.headers.location.substring(1)||null,res:l.res}}});var m8=w(h8=>{var{checkBucketName:yge}=Me(),{isObject:vge}=Sr(),bge=h8;bge.getBucketWebsite=async function(t,r){yge(t);let i=this._bucketRequestParams("GET",t,"website",r);i.successStatuses=[200],i.xmlResponse=!0;let n=await this.request(i),o=[];return n.data.RoutingRules&&n.data.RoutingRules.RoutingRule&&(vge(n.data.RoutingRules.RoutingRule)?o=[n.data.RoutingRules.RoutingRule]:o=n.data.RoutingRules.RoutingRule),{index:n.data.IndexDocument&&n.data.IndexDocument.Suffix||"",supportSubDir:n.data.IndexDocument&&n.data.IndexDocument.SupportSubDir||"false",type:n.data.IndexDocument&&n.data.IndexDocument.Type,routingRules:o,error:n.data.ErrorDocument&&n.data.ErrorDocument.Key||null,res:n.res}}});var y8=w(g8=>{var{checkBucketName:_ge}=Me(),{obj2xml:wge}=gr(),{isArray:xge}=ui(),Sge=g8;Sge.putBucketWebsite=async function(t,r={},i){_ge(t);let n=this._bucketRequestParams("PUT",t,"website",i),o={Suffix:r.index||"index.html"},s={IndexDocument:o},a={WebsiteConfiguration:s};if(r.supportSubDir&&(o.SupportSubDir=r.supportSubDir),r.type&&(o.Type=r.type),r.error&&(s.ErrorDocument={Key:r.error}),r.routingRules!==void 0){if(!xge(r.routingRules))throw new Error("RoutingRules must be Array");s.RoutingRules={RoutingRule:r.routingRules}}return a=wge(a),n.content=a,n.mime="xml",n.successStatuses=[200],{res:(await this.request(n)).res}}});var b8=w(v8=>{var{checkBucketName:Ege}=Me(),kge=v8;kge.deleteBucketWebsite=async function(t,r){Ege(t);let i=this._bucketRequestParams("DELETE",t,"website",r);return i.successStatuses=[204],{res:(await this.request(i)).res}}});var x8=w(w8=>{var{checkBucketName:Tge}=Me(),{isArray:_8}=ui(),{formatObjKey:Ige}=bc(),Oge=w8;Oge.getBucketLifecycle=async function(t,r){Tge(t);let i=this._bucketRequestParams("GET",t,"lifecycle",r);i.successStatuses=[200],i.xmlResponse=!0;let n=await this.request(i),o=n.data.Rule||null;return o&&(_8(o)||(o=[o]),o=o.map(s=>(s.ID&&(s.id=s.ID,delete s.ID),s.Tag&&!_8(s.Tag)&&(s.Tag=[s.Tag]),Ige(s,"firstLowerCase")))),{rules:o,res:n.res}}});var QT=w(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.deepCopyWith=Qi.deepCopy=void 0;var S8=Jl();Qi.deepCopy=e=>{if(e===null||typeof e!="object")return e;if(S8.isBuffer(e))return e.slice();let t=Array.isArray(e)?[]:{};return Object.keys(e).forEach(r=>{t[r]=Qi.deepCopy(e[r])}),t};Qi.deepCopyWith=(e,t)=>{function r(i,n,o){let s=t(i,n,o);if(s!==void 0)return s;if(i===null||typeof i!="object")return i;if(S8.isBuffer(i))return i.slice();let a=Array.isArray(i)?[]:{};return Object.keys(i).forEach(c=>{a[c]=r(i[c],c,i)}),a}return t?r(e,"",null):Qi.deepCopy(e)}});var E8=w(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});Lg.getStrBytesCount=void 0;function Cge(e){let t=0;for(let r=0;r<e.length;r++){let i=e.charAt(r);/^[\u00-\uff]$/.test(i)?t+=1:t+=2}return t}Lg.getStrBytesCount=Cge});var C8=w(O8=>{var{checkBucketName:Age}=Me(),{isArray:Fg}=ui(),{deepCopy:$ge}=QT(),{isObject:k8}=Sr(),{obj2xml:Rge}=gr(),{checkObjectTag:Dge}=ZT(),{getStrBytesCount:Nge}=E8(),Pge=O8;Pge.putBucketLifecycle=async function(t,r,i){if(Age(t),!Fg(r))throw new Error("rules must be Array");let n=this._bucketRequestParams("PUT",t,"lifecycle",i),o=[],s={LifecycleConfiguration:{Rule:o}};r.forEach(u=>{qge(u),Mge(u),u.id&&(u.ID=u.id,delete u.id),o.push(u)});let a=Rge(s,{headers:!0,firstUpperCase:!0});return n.content=a,n.mime="xml",n.successStatuses=[200],{res:(await this.request(n)).res}};function qge(e){e.days&&(e.expiration={days:e.days}),e.date&&(e.expiration={createdBeforeDate:e.date})}function eI(e,t){let{days:r,createdBeforeDate:i}=e;if(!r&&!i)throw new Error(`${t} must includes days or createdBeforeDate`);if(r&&(Fg(r)||!/^[1-9][0-9]*$/.test(r)))throw new Error("days must be a positive integer");if(i&&!/\d{4}-\d{2}-\d{2}T00:00:00.000Z/.test(i))throw new Error("createdBeforeDate must be date and conform to iso8601 format")}function T8(e,t){let{noncurrentDays:r}=e;if(r){if(r&&(Fg(r)||!/^[1-9][0-9]*$/.test(r)))throw new Error("noncurrentDays must be a positive integer")}else throw new Error(`${t} must includes noncurrentDays`)}function jge(e){if(!Fg(e)&&!k8(e))throw new Error("tag must be Object or Array");e=k8(e)?[e]:e;let t={};$ge(e).forEach(i=>{t[i.key]=i.value}),Dge(t)}function I8(e){if(!["IA","Archive","ColdArchive","DeepColdArchive"].includes(e))throw new Error("StorageClass must be IA or Archive or ColdArchive or DeepColdArchive")}function Mge(e){if(e.id&&Nge(e.id)>255)throw new Error("ID is composed of 255 bytes at most");if(e.prefix===void 0)throw new Error("Rule must includes prefix");if(!["Enabled","Disabled"].includes(e.status))throw new Error("Status must be Enabled or Disabled");if(!e.expiration&&!e.noncurrentVersionExpiration&&!e.abortMultipartUpload&&!e.transition&&!e.noncurrentVersionTransition)throw new Error("Rule must includes expiration or noncurrentVersionExpiration or abortMultipartUpload or transition or noncurrentVersionTransition");if(e.transition&&(I8(e.transition.storageClass),eI(e.transition,"Transition")),e.expiration){if(!e.expiration.expiredObjectDeleteMarker)eI(e.expiration,"Expiration");else if(e.expiration.days||e.expiration.createdBeforeDate)throw new Error("expiredObjectDeleteMarker cannot be used with days or createdBeforeDate")}if(e.abortMultipartUpload&&eI(e.abortMultipartUpload,"AbortMultipartUpload"),e.noncurrentVersionTransition&&(I8(e.noncurrentVersionTransition.storageClass),T8(e.noncurrentVersionTransition,"NoncurrentVersionTransition")),e.noncurrentVersionExpiration&&T8(e.noncurrentVersionExpiration,"NoncurrentVersionExpiration"),e.tag){if(e.abortMultipartUpload)throw new Error("Tag cannot be used with abortMultipartUpload");jge(e.tag)}}});var $8=w(A8=>{var{checkBucketName:Lge}=Me(),Fge=A8;Fge.deleteBucketLifecycle=async function(t,r){Lge(t);let i=this._bucketRequestParams("DELETE",t,"lifecycle",r);return i.successStatuses=[204],{res:(await this.request(i)).res}}});var D8=w(R8=>{var{checkBucketName:zge}=Me(),Uge=R8;Uge.getBucketPolicy=async function(t,r={}){zge(t);let i=this._bucketRequestParams("GET",t,"policy",r),n=await this.request(i);i.successStatuses=[200];let o=null;return n.res.status===200&&(o=JSON.parse(n.res.data.toString())),{policy:o,status:n.status,res:n.res}}});var P8=w(N8=>{var{checkBucketName:Bge}=Me(),{policy2Str:Wge}=Ig(),{isObject:Hge}=Sr(),Vge=N8;Vge.putBucketPolicy=async function(t,r,i={}){if(Bge(t),!Hge(r))throw new Error("policy is not Object");let n=this._bucketRequestParams("PUT",t,"policy",i);n.content=Wge(r),n.successStatuses=[200];let o=await this.request(n);return{status:o.status,res:o.res}}});var j8=w(q8=>{var{checkBucketName:Zge}=Me(),Gge=q8;Gge.deleteBucketPolicy=async function(t,r={}){Zge(t);let i=this._bucketRequestParams("DELETE",t,"policy",r);i.successStatuses=[204];let n=await this.request(i);return{status:n.status,res:n.res}}});var L8=w(M8=>{var{checkBucketName:Kge}=Me(),Xge=M8;Xge.getBucketVersioning=async function(t,r){Kge(t);let i=this._bucketRequestParams("GET",t,"versioning",r);i.xmlResponse=!0,i.successStatuses=[200];let n=await this.request(i),o=n.data.Status;return{status:n.status,versionStatus:o,res:n.res}}});var z8=w(F8=>{var{checkBucketName:Jge}=Me(),{obj2xml:Yge}=gr(),Qge=F8;Qge.putBucketVersioning=async function(t,r,i={}){if(Jge(t),!["Enabled","Suspended"].includes(r))throw new Error("status must be Enabled or Suspended");let n=this._bucketRequestParams("PUT",t,"versioning",i),o={VersioningConfiguration:{Status:r}};n.mime="xml",n.content=Yge(o,{headers:!0});let s=await this.request(n);return{res:s.res,status:s.status}}});var tI=w(zg=>{"use strict";Object.defineProperty(zg,"__esModule",{value:!0});zg.dataFix=void 0;var eye=Sr(),tye=["true","TRUE","1",1],rye=["false","FALSE","0",0];function U8(e,t,r){if(!eye.isObject(e))return;let{remove:i=[],rename:n={},camel:o=[],bool:s=[],lowerFirst:a=!1}=t;return i.forEach(c=>delete e[c]),Object.entries(n).forEach(c=>{e[c[0]]&&(e[c[1]]||(e[c[1]]=e[c[0]],delete e[c[0]]))}),o.forEach(c=>{if(!e[c])return;let u=c.replace(/^(.)/,l=>l.toLowerCase()).replace(/-(\w)/g,(l,f)=>f.toUpperCase());e[u]||(e[u]=e[c])}),s.forEach(c=>{e[c]=nye(e[c])}),typeof r=="function"&&r(e),iye(e,a),U8}zg.dataFix=U8;function nye(e){return e?tye.includes(e)?!0:rye.includes(e)?!1:e:!1}function iye(e,t){t&&Object.keys(e).forEach(r=>{let i=r.replace(/^\w/,n=>n.toLowerCase());typeof e[i]>"u"&&(e[i]=e[r],delete e[r])})}});var rI=w(Ug=>{"use strict";Object.defineProperty(Ug,"__esModule",{value:!0});Ug.formatInventoryConfig=void 0;var oye=tI(),sye=Sr(),W8=ui(),aye=bc();function cye(e,t=!1){return t&&sye.isObject(e)&&(e=[e]),W8.isArray(e)?e=e.map(B8):e=B8(e),e}Ug.formatInventoryConfig=cye;function B8(e){return oye.dataFix(e,{bool:["IsEnabled"]},t=>{var r,i;t.prefix=t.Filter.Prefix,delete t.Filter,t.OSSBucketDestination=t.Destination.OSSBucketDestination,t.OSSBucketDestination.rolename=t.OSSBucketDestination.RoleArn.replace(/.*\//,""),delete t.OSSBucketDestination.RoleArn,t.OSSBucketDestination.bucket=t.OSSBucketDestination.Bucket.replace(/.*:::/,""),delete t.OSSBucketDestination.Bucket,delete t.Destination,t.frequency=t.Schedule.Frequency,delete t.Schedule.Frequency,!((r=t?.OptionalFields)===null||r===void 0)&&r.Field&&!W8.isArray((i=t.OptionalFields)===null||i===void 0?void 0:i.Field)&&(t.OptionalFields.Field=[t.OptionalFields.Field])}),e=aye.formatObjKey(e,"firstLowerCase",{exclude:["OSSBucketDestination","SSE-OSS","SSE-KMS"]}),e}});var H8=w(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.getBucketInventory=void 0;var uye=Me(),lye=rI();async function fye(e,t,r={}){let i=Object.assign({inventory:"",inventoryId:t},r.subres);uye.checkBucketName(e);let n=this._bucketRequestParams("GET",e,i,r);n.successStatuses=[200],n.xmlResponse=!0;let o=await this.request(n);return{status:o.status,res:o.res,inventory:lye.formatInventoryConfig(o.data)}}Bg.getBucketInventory=fye});var V8=w(Wg=>{"use strict";Object.defineProperty(Wg,"__esModule",{value:!0});Wg.deleteBucketInventory=void 0;var dye=Me();async function pye(e,t,r={}){let i=Object.assign({inventory:"",inventoryId:t},r.subres);dye.checkBucketName(e);let n=this._bucketRequestParams("DELETE",e,i,r);n.successStatuses=[204];let o=await this.request(n);return{status:o.status,res:o.res}}Wg.deleteBucketInventory=pye});var Z8=w(Hg=>{"use strict";Object.defineProperty(Hg,"__esModule",{value:!0});Hg.listBucketInventory=void 0;var hye=Me(),mye=rI();async function gye(e,t={}){let{continuationToken:r}=t,i=Object.assign({inventory:""},r&&{"continuation-token":r},t.subres);hye.checkBucketName(e);let n=this._bucketRequestParams("GET",e,i,t);n.successStatuses=[200],n.xmlResponse=!0;let o=await this.request(n),{data:s,res:a,status:c}=o;return{isTruncated:s.IsTruncated==="true",nextContinuationToken:s.NextContinuationToken,inventoryList:mye.formatInventoryConfig(s.InventoryConfiguration,!0),status:c,res:a}}Hg.listBucketInventory=gye});var G8=w(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});Vg.putBucketInventory=void 0;var yye=Me(),vye=gr();async function bye(e,t,r={}){let i=Object.assign({inventory:"",inventoryId:t.id},r.subres);yye.checkBucketName(e);let{OSSBucketDestination:n,optionalFields:o,includedObjectVersions:s}=t,a="acs:oss:::",c=`acs:ram::${n.accountId}:role/`,u={InventoryConfiguration:{Id:t.id,IsEnabled:t.isEnabled,Filter:{Prefix:t.prefix||""},Destination:{OSSBucketDestination:{Format:n.format,AccountId:n.accountId,RoleArn:`${c}${n.rolename}`,Bucket:`${a}${n.bucket}`,Prefix:n.prefix||"",Encryption:n.encryption||""}},Schedule:{Frequency:t.frequency},IncludedObjectVersions:s,OptionalFields:{Field:o?.field||[]}}},l=vye.obj2xml(u,{headers:!0,firstUpperCase:!0}),f=this._bucketRequestParams("PUT",e,i,r);f.successStatuses=[200],f.mime="xml",f.content=l;let p=await this.request(f);return{status:p.status,res:p.res}}Vg.putBucketInventory=bye});var K8=w(Zg=>{"use strict";Object.defineProperty(Zg,"__esModule",{value:!0});Zg.abortBucketWorm=void 0;var _ye=Me();async function wye(e,t){_ye.checkBucketName(e);let r=this._bucketRequestParams("DELETE",e,"worm",t),i=await this.request(r);return{res:i.res,status:i.status}}Zg.abortBucketWorm=wye});var X8=w(Gg=>{"use strict";Object.defineProperty(Gg,"__esModule",{value:!0});Gg.completeBucketWorm=void 0;var xye=Me();async function Sye(e,t,r){xye.checkBucketName(e);let i=this._bucketRequestParams("POST",e,{wormId:t},r),n=await this.request(i);return{res:n.res,status:n.status}}Gg.completeBucketWorm=Sye});var J8=w(Kg=>{"use strict";Object.defineProperty(Kg,"__esModule",{value:!0});Kg.extendBucketWorm=void 0;var Eye=Me(),kye=gr();async function Tye(e,t,r,i){Eye.checkBucketName(e);let n=this._bucketRequestParams("POST",e,{wormExtend:"",wormId:t},i),o={ExtendWormConfiguration:{RetentionPeriodInDays:r}};n.mime="xml",n.content=kye.obj2xml(o,{headers:!0}),n.successStatuses=[200];let s=await this.request(n);return{res:s.res,status:s.status}}Kg.extendBucketWorm=Tye});var Y8=w(Xg=>{"use strict";Object.defineProperty(Xg,"__esModule",{value:!0});Xg.getBucketWorm=void 0;var Iye=Me(),Oye=tI();async function Cye(e,t){Iye.checkBucketName(e);let r=this._bucketRequestParams("GET",e,"worm",t);r.successStatuses=[200],r.xmlResponse=!0;let i=await this.request(r);return Oye.dataFix(i.data,{lowerFirst:!0,rename:{RetentionPeriodInDays:"days"}}),Object.assign(Object.assign({},i.data),{res:i.res,status:i.status})}Xg.getBucketWorm=Cye});var Q8=w(Jg=>{"use strict";Object.defineProperty(Jg,"__esModule",{value:!0});Jg.initiateBucketWorm=void 0;var Aye=gr(),$ye=Me();async function Rye(e,t,r){$ye.checkBucketName(e);let i=this._bucketRequestParams("POST",e,"worm",r),n={InitiateWormConfiguration:{RetentionPeriodInDays:t}};i.mime="xml",i.content=Aye.obj2xml(n,{headers:!0}),i.successStatuses=[200];let o=await this.request(i);return{res:o.res,wormId:o.res.headers["x-oss-worm-id"],status:o.status}}Jg.initiateBucketWorm=Rye});var eH=w(Yg=>{"use strict";Object.defineProperty(Yg,"__esModule",{value:!0});Yg.getBucketStat=void 0;var Dye=Me();async function Nye(e,t){e=e||this.options.bucket,Dye.checkBucketName(e);let r=this._bucketRequestParams("GET",e,"stat",t);r.successStatuses=[200],r.xmlResponse=!0;let i=await this.request(r);return{res:i.res,stat:i.data}}Yg.getBucketStat=Nye});var rH=w(tH=>{var Ve=Ga(),Ze=tH;Ve(Ze,KW());Ve(Ze,JW());Ve(Ze,QW());Ve(Ze,t8());Ve(Ze,n8());Ve(Ze,o8());Ve(Ze,u8());Ve(Ze,f8());Ve(Ze,p8());Ve(Ze,m8());Ve(Ze,y8());Ve(Ze,b8());Ve(Ze,x8());Ve(Ze,C8());Ve(Ze,$8());Ve(Ze,D8());Ve(Ze,P8());Ve(Ze,j8());Ve(Ze,L8());Ve(Ze,z8());Ve(Ze,H8());Ve(Ze,V8());Ve(Ze,Z8());Ve(Ze,G8());Ve(Ze,K8());Ve(Ze,X8());Ve(Ze,J8());Ve(Ze,Y8());Ve(Ze,Q8());Ve(Ze,eH())});var iH=w(nH=>{var nI=B("assert"),{isArray:ey}=ui(),{checkBucketName:ir}=Me(),{formatTag:Pye}=YT(),qt=nH;function Qg(e){return e?ey(e)?e:[e]:[]}qt.listBuckets=async function(t={},r={}){let{subres:i={}}=t,n={};for(let a in t)a!=="subres"&&(n[a]=t[a]);let o=this._bucketRequestParams("GET","",Object.assign(i,r.subres),r);o.query=n;let s=await this.request(o);if(s.status===200){let a=await this.parseXML(s.data),c=a.Buckets||null;return c&&(c.Bucket&&(c=c.Bucket),ey(c)||(c=[c]),c=c.map(u=>({name:u.Name,region:u.Location,creationDate:u.CreationDate,storageClass:u.StorageClass,StorageClass:u.StorageClass,tag:Pye(u)}))),{buckets:c,owner:{id:a.Owner.ID,displayName:a.Owner.DisplayName},isTruncated:a.IsTruncated==="true",nextMarker:a.NextMarker||null,res:s.res}}throw await this.requestError(s)};qt.useBucket=function(t){return ir(t),this.setBucket(t)};qt.setBucket=function(t){return ir(t),this.options.bucket=t,this};qt.getBucket=function(){return this.options.bucket};qt.getBucketLocation=async function(t,r){ir(t),t=t||this.getBucket();let i=this._bucketRequestParams("GET",t,"location",r);i.successStatuses=[200],i.xmlResponse=!0;let n=await this.request(i);return{location:n.data,res:n.res}};qt.getBucketInfo=async function(t,r){ir(t),t=t||this.getBucket();let i=this._bucketRequestParams("GET",t,"bucketInfo",r);i.successStatuses=[200],i.xmlResponse=!0;let n=await this.request(i);return{bucket:n.data.Bucket,res:n.res}};qt.deleteBucket=async function(t,r){ir(t);let i=this._bucketRequestParams("DELETE",t,"",r),n=await this.request(i);if(n.status===200||n.status===204)return{res:n.res};throw await this.requestError(n)};qt.putBucketACL=async function(t,r,i){ir(t);let n=this._bucketRequestParams("PUT",t,"acl",i);n.headers={"x-oss-acl":r},n.successStatuses=[200];let o=await this.request(n);return{bucket:o.headers.location&&o.headers.location.substring(1)||null,res:o.res}};qt.getBucketACL=async function(t,r){ir(t);let i=this._bucketRequestParams("GET",t,"acl",r);i.successStatuses=[200],i.xmlResponse=!0;let n=await this.request(i);return{acl:n.data.AccessControlList.Grant,owner:{id:n.data.Owner.ID,displayName:n.data.Owner.DisplayName},res:n.res}};qt.putBucketLogging=async function(t,r,i){ir(t);let n=this._bucketRequestParams("PUT",t,"logging",i),o=`<?xml version="1.0" encoding="UTF-8"?>
|
|
238
238
|
<BucketLoggingStatus>
|
|
239
239
|
<LoggingEnabled>
|
|
@@ -260,16 +260,16 @@ ${o}${n}`,a=this.signature(s),c=Uye.parse(this._getReqUrl(i));return c.protocol=
|
|
|
260
260
|
`,s+=`<ETag>${p.etag}</ETag>
|
|
261
261
|
`,s+=`</Part>
|
|
262
262
|
`}s+="</CompleteMultipartUpload>",n=n||{};let a={};a=Zye(n,f=>{if(Gye(f))return null}),a.subres={uploadId:r},a.headers=_H(a.headers,["x-oss-server-side-encryption","x-oss-storage-class"]);let c=this._objectRequestParams("POST",t,a);Vye.encodeCallback(c,a),c.mime="xml",c.content=s,c.headers&&c.headers["x-oss-callback"]||(c.xmlResponse=!0),c.successStatuses=[200];let u=await this.request(c);n.progress&&await n.progress(1,null,u.res);let l={res:u.res,bucket:c.bucket,name:t,etag:u.res.headers.etag};return c.headers&&c.headers["x-oss-callback"]&&(l.data=JSON.parse(u.data.toString())),l};ls._uploadPart=async function(t,r,i,n,o){o=o||{};let s={};ef(o).to(s),s.headers=s.headers||{},s.headers["Content-Length"]=n.size,s.headers=_H(s.headers,["x-oss-server-side-encryption","x-oss-storage-class"]),s.subres={partNumber:i,uploadId:r};let a=this._objectRequestParams("PUT",t,s);a.mime=s.mime,process&&process.browser?a.content=n.content:a.stream=n.stream,a.successStatuses=[200],a.disabledMD5=o.disabledMD5;let u=await this.request(a);if(!u.res.headers.etag)throw new Error(`Please set the etag of expose-headers in OSS
|
|
263
|
-
https://help.aliyun.com/document_detail/32069.html`);return n.stream&&(n.stream=null,a.stream=null),{name:t,etag:u.res.headers.etag,res:u.res}}});var EH=w((
|
|
264
|
-
<Style><Content>${n}</Content></Style>`;let a=await this.ossClient.request(s);return a=await this._parseResponse(a),{res:a.res,data:a.data}},t.prototype.getStyle=async function(i,n){let o=this.ossClient._objectRequestParams("GET",`/?style&styleName=${i}`,n);o.successStatuses=[200];let s=await this.ossClient.request(o);return s=await this._parseResponse(s),{res:s.res,data:s.data}},t.prototype.listStyle=async function(i){let n=this.ossClient._objectRequestParams("GET","/?style",i);n.successStatuses=[200];let o=await this.ossClient.request(n);return o=await this._parseResponse(o),{res:o.res,data:o.data.Style}},t.prototype.deleteStyle=async function(i,n){let o=this.ossClient._objectRequestParams("DELETE",`/?style&styleName=${i}`,n);return o.successStatuses=[204],{res:(await this.ossClient.request(o)).res}},t.prototype.signatureUrl=function(i){return this.ossClient.signatureUrl(i)},t.prototype._parseResponse=async function(i){let n=i.data.toString(),o=i.res.headers["content-type"];if(o==="application/json"){let s=JSON.parse(n);i.data={},s&&Object.keys(s).forEach(a=>{i.data[a]=parseFloat(s[a].value,10)||s[a].value})}else o==="application/xml"&&(i.data=await this.ossClient.parseXML(n));return i},t}});var uI=w((
|
|
263
|
+
https://help.aliyun.com/document_detail/32069.html`);return n.stream&&(n.stream=null,a.stream=null),{name:t,etag:u.res.headers.etag,res:u.res}}});var EH=w(($$e,SH)=>{SH.exports=function(e){function t(r){if(!(this instanceof t))return new t(r);if(!r.bucket)throw new Error("require bucket for image service instance");if(!r.imageHost)throw new Error("require imageHost for image service instance");r.endpoint=r.imageHost,this.ossClient=new e(r),this.ossClient.options.imageHost=r.imageHost}return t.prototype.get=async function(i,n,o){return await this.ossClient.get(i,n,o)},t.prototype.getStream=async function(i,n){return await this.ossClient.getStream(i,n)},t.prototype.getExif=async function(i,n){let o=this.ossClient._objectRequestParams("GET",`${i}@exif`,n);o.successStatuses=[200];let s=await this.ossClient.request(o);return s=await this._parseResponse(s),{res:s.res,data:s.data}},t.prototype.getInfo=async function(i,n){let o=this.ossClient._objectRequestParams("GET",`${i}@infoexif`,n);o.successStatuses=[200];let s=await this.ossClient.request(o);return s=await this._parseResponse(s),{res:s.res,data:s.data}},t.prototype.putStyle=async function(i,n,o){let s=this.ossClient._objectRequestParams("PUT",`/?style&styleName=${i}`,o);s.successStatuses=[200],s.content=`<?xml version="1.0" encoding="UTF-8"?>
|
|
264
|
+
<Style><Content>${n}</Content></Style>`;let a=await this.ossClient.request(s);return a=await this._parseResponse(a),{res:a.res,data:a.data}},t.prototype.getStyle=async function(i,n){let o=this.ossClient._objectRequestParams("GET",`/?style&styleName=${i}`,n);o.successStatuses=[200];let s=await this.ossClient.request(o);return s=await this._parseResponse(s),{res:s.res,data:s.data}},t.prototype.listStyle=async function(i){let n=this.ossClient._objectRequestParams("GET","/?style",i);n.successStatuses=[200];let o=await this.ossClient.request(n);return o=await this._parseResponse(o),{res:o.res,data:o.data.Style}},t.prototype.deleteStyle=async function(i,n){let o=this.ossClient._objectRequestParams("DELETE",`/?style&styleName=${i}`,n);return o.successStatuses=[204],{res:(await this.ossClient.request(o)).res}},t.prototype.signatureUrl=function(i){return this.ossClient.signatureUrl(i)},t.prototype._parseResponse=async function(i){let n=i.data.toString(),o=i.res.headers["content-type"];if(o==="application/json"){let s=JSON.parse(n);i.data={},s&&Object.keys(s).forEach(a=>{i.data[a]=parseFloat(s[a].value,10)||s[a].value})}else o==="application/xml"&&(i.data=await this.ossClient.parseXML(n));return i},t}});var uI=w((R$e,cI)=>{"use strict";function Kye(e){if(this._ready=!!this._ready,this._readyCallbacks=this._readyCallbacks||[],arguments.length===0)return new Promise(function(t){if(this._ready)return t();this._readyCallbacks.push(t)}.bind(this));typeof e=="function"?this._readyCallbacks.push(e):this._ready=!!e,this._ready&&this._readyCallbacks.splice(0,1/0).forEach(function(t){process.nextTick(t)})}function kH(e){e.ready=Kye}cI.exports=kH;cI.exports.mixin=kH});var CH=w((D$e,OH)=>{"use strict";var Xye=uI(),TH=B("events").EventEmitter,IH=B("util");OH.exports=iy;function iy(){TH.call(this),this.on("error",this.defaultErrorHandler.bind(this))}IH.inherits(iy,TH);Xye.mixin(iy.prototype);iy.prototype.defaultErrorHandler=function(e){if(!(this.listeners("error").length>1)){console.error(`
|
|
265
265
|
[%s][pid: %s][%s][%s] %s: %s
|
|
266
266
|
Error Stack:
|
|
267
267
|
%s`,Date(),process.pid,this.constructor.name,__filename,e.name,e.message,e.stack);var t=[];for(var r in e)r==="name"||r==="message"||t.push(IH.format(" %s: %j",r,e[r]));t.length&&console.error(`Error Additions:
|
|
268
268
|
%s`,t.join(`
|
|
269
|
-
`)),console.error()}}});var qH=w((
|
|
269
|
+
`)),console.error()}}});var qH=w((N$e,PH)=>{"use strict";var lI=B("os"),Jye=B("fs"),Yye=B("child_process"),Qye="/etc/resolv.conf";function NH(){var e="eth",t=lI.platform();return t==="darwin"?e="en":t==="win32"&&(e=null),e}function eve(){return lI.platform()==="win32"?"ipconfig/all":"/sbin/ifconfig"}function AH(e,t){return t==="IPv4"?e==="IPv4"||e===4:t==="IPv6"?e==="IPv6"||e===6:e===t}function Tr(e,t){typeof e=="function"&&(t=e,e=null);var r={ip:Tr.ip(e),ipv6:Tr.ipv6(e),mac:null};Tr.mac(e,function(i,n){n&&(r.mac=n),t(i,r)})}Tr.interface=function(e,t){var r=lI.networkInterfaces(),i=!t;t=t||NH(),e=e||"IPv4";for(var n=-1;n<8;n++){var o=t+(n>=0?n:""),s=r[o];if(s)for(var a=0;a<s.length;a++){var c=s[a];if(AH(c.family,e))return c}}if(i)for(var u in r)for(var s=r[u],n=0;n<s.length;n++){var c=s[n];if(AH(c.family,e)&&!c.address.startsWith("127."))return c}};Tr.ip=function(e){var t=Tr.interface("IPv4",e);return t&&t.address};Tr.ipv6=function(e){var t=Tr.interface("IPv6",e);return t&&t.address};var $H=/^(\w+)\:\s+flags=/,RH=/^(\w+)\s{2,}link encap:\w+/i,DH=Tr.MAC_RE=/(?:ether|HWaddr)\s+((?:[a-z0-9]{2}\:){5}[a-z0-9]{2})/i,tve=Tr.MAC_IP_RE=/inet\s(?:addr\:)?(\d+\.\d+\.\d+\.\d+)/;function rve(e,t,r){for(var i=e.split(`
|
|
270
270
|
`),n=0;n<i.length;n++){var o=i[n].trimRight(),s=$H.exec(o)||RH.exec(o);if(s){var a=s[1];if(a.indexOf(t)===0){var c=null,u=null,l=DH.exec(o);for(l&&(u=l[1]),n++;;){if(o=i[n],!o||$H.exec(o)||RH.exec(o)){n--;break}u||(l=DH.exec(o),l&&(u=l[1])),c||(l=tve.exec(o),l&&(c=l[1])),n++}if(c===r)return u}}}}Tr.mac=function(e,t){typeof e=="function"&&(t=e,e=null),e=e||NH();var r=Tr.interface("IPv4",e);if(!r)return t();if(!process.env.CI&&(r.mac==="ff:00:00:00:00:00"||r.mac==="00:00:00:00:00:00")&&(r.mac=""),r.mac)return t(null,r.mac);Yye.exec(eve(),{timeout:5e3},function(i,n,o){if(i||!n)return t(i);var s=rve(n||"",e,r.address);t(null,s)})};var nve=/^nameserver\s+(\d+\.\d+\.\d+\.\d+)$/i;Tr.dns=function(e,t){typeof e=="function"&&(t=e,e=null),e=e||Qye,Jye.readFile(e,"utf8",function(r,i){if(r)return t(r);var n=[];i=i||"";for(var o=i.split(`
|
|
271
|
-
`),s=0;s<o.length;s++){var a=o[s].trim(),c=nve.exec(a);c&&n.push(c[1])}t(null,n)})};PH.exports=Tr});var LH=w((
|
|
272
|
-
raw xml: ${n}`,a.status=t.status,a.requestId=t.headers&&t.headers["x-oss-request-id"],a}let s=o.Message||`unknow request error, status: ${t.status}`;return o.Condition&&(s+=` (condition: ${o.Condition})`),r=new Error(s),r.name=o.Code?`${o.Code}Error`:"UnknownError",r.status=t.status,r.code=o.Code,r.requestId=o.RequestId,r.ecCode=o.EC,r.hostId=o.HostId,r};if(t.name==="ResponseTimeoutError")r=new Error(t.message),r.name=t.name;else if(!t.data||!t.data.length)if(t.status===-1||t.status===-2)r=new Error(t.message),r.name=t.name,r.status=t.status,r.code=t.name;else{if(t.status===404)r=new Error("Object not exists"),r.name="NoSuchKeyError",r.status=404,r.code="NoSuchKey";else if(t.status===412)r=new Error("Pre condition failed"),r.name="PreconditionFailedError",r.status=412,r.code="PreconditionFailed";else{r=new Error(`Unknow error, status: ${t.status}`),r.name="UnknownError",r.status=t.status,r.res=t;let n=t.headers&&t.headers["x-oss-err"];if(n){let o=Buffer.from(n,"base64").toString("utf8");r=await i(o)}}r.requestId=t.headers&&t.headers["x-oss-request-id"],r.host=""}else{let n=String(t.data);tf("request response error data: %s",n),r=await i(n)}return tf("generate error %j",r),r};_t.setSLDEnabled=function(t){return this.options.sldEnable=!!t,this}});import Mx from"node:fs";import fn from"node:path";import{homedir as Ny}from"node:os";import{basename as k_e,dirname as T_e,join as Py,resolve as WI}from"node:path";var HI=".dsh",TZ=`~/${HI}`,VI="DSH_HOME";function ZI(){return Py(Ny(),HI)}function IZ(e){return e==="~"?Ny():e.startsWith("~/")||e.startsWith("~\\")?Py(Ny(),e.slice(2)):e}function io(e,t=process.env){let r=t[VI];return WI(IZ(e??(r!==void 0&&r.trim().length>0?r:ZI())))}function GI(...e){return Py(io(),...e)}function KI(e){return e===WI(ZI())?TZ:`$${VI}`}var ye={};Mn(ye,{$brand:()=>jy,$input:()=>i_,$output:()=>n_,NEVER:()=>qy,TimePrecision:()=>c_,ZodAny:()=>Jw,ZodArray:()=>tx,ZodBase64:()=>Md,ZodBase64URL:()=>Ld,ZodBigInt:()=>Hs,ZodBigIntFormat:()=>Ud,ZodBoolean:()=>Ws,ZodCIDRv4:()=>qd,ZodCIDRv6:()=>jd,ZodCUID:()=>Cd,ZodCUID2:()=>Ad,ZodCatch:()=>Sx,ZodCodec:()=>uu,ZodCustom:()=>lu,ZodCustomStringFormat:()=>Us,ZodDate:()=>iu,ZodDefault:()=>yx,ZodDiscriminatedUnion:()=>nx,ZodE164:()=>Fd,ZodEmail:()=>Td,ZodEmoji:()=>Id,ZodEnum:()=>Fs,ZodError:()=>iK,ZodExactOptional:()=>hx,ZodFile:()=>dx,ZodFirstPartyTypeKind:()=>qx,ZodFunction:()=>Dx,ZodGUID:()=>Qc,ZodIPv4:()=>Nd,ZodIPv6:()=>Pd,ZodISODate:()=>_d,ZodISODateTime:()=>bd,ZodISODuration:()=>xd,ZodISOTime:()=>wd,ZodIntersection:()=>ix,ZodIssueCode:()=>sK,ZodJWT:()=>zd,ZodKSUID:()=>Dd,ZodLazy:()=>Ax,ZodLiteral:()=>fx,ZodMAC:()=>Ww,ZodMap:()=>ux,ZodNaN:()=>kx,ZodNanoID:()=>Od,ZodNever:()=>Qw,ZodNonOptional:()=>Gd,ZodNull:()=>Kw,ZodNullable:()=>gx,ZodNumber:()=>Bs,ZodNumberFormat:()=>ho,ZodObject:()=>su,ZodOptional:()=>Zd,ZodPipe:()=>cu,ZodPrefault:()=>bx,ZodPreprocess:()=>Tx,ZodPromise:()=>Rx,ZodReadonly:()=>Ix,ZodRealError:()=>br,ZodRecord:()=>Ls,ZodSet:()=>lx,ZodString:()=>zs,ZodStringFormat:()=>Qe,ZodSuccess:()=>xx,ZodSymbol:()=>Zw,ZodTemplateLiteral:()=>Cx,ZodTransform:()=>px,ZodTuple:()=>sx,ZodType:()=>Ee,ZodULID:()=>$d,ZodURL:()=>nu,ZodUUID:()=>un,ZodUndefined:()=>Gw,ZodUnion:()=>au,ZodUnknown:()=>Yw,ZodVoid:()=>ex,ZodXID:()=>Rd,ZodXor:()=>rx,_ZodString:()=>kd,_default:()=>vx,_function:()=>jA,any:()=>hA,array:()=>ou,base64:()=>JC,base64url:()=>YC,bigint:()=>uA,boolean:()=>Vw,catch:()=>Ex,check:()=>MA,cidrv4:()=>KC,cidrv6:()=>XC,clone:()=>or,codec:()=>DA,coerce:()=>jx,config:()=>wt,core:()=>zn,cuid:()=>zC,cuid2:()=>UC,custom:()=>LA,date:()=>gA,decode:()=>jw,decodeAsync:()=>Lw,describe:()=>FA,discriminatedUnion:()=>xA,e164:()=>QC,email:()=>$C,emoji:()=>LC,encode:()=>qw,encodeAsync:()=>Mw,endsWith:()=>Cs,enum:()=>Hd,exactOptional:()=>mx,file:()=>CA,flattenError:()=>Lc,float32:()=>oA,float64:()=>sA,formatError:()=>Fc,fromJSONSchema:()=>ZA,function:()=>jA,getErrorMap:()=>cK,globalRegistry:()=>Gt,gt:()=>an,gte:()=>ar,guid:()=>RC,hash:()=>iA,hex:()=>nA,hostname:()=>rA,httpUrl:()=>MC,includes:()=>Is,instanceof:()=>UA,int:()=>Sd,int32:()=>aA,int64:()=>lA,intersection:()=>ox,invertCodec:()=>NA,ipv4:()=>VC,ipv6:()=>GC,iso:()=>Ms,json:()=>WA,jwt:()=>eA,keyof:()=>yA,ksuid:()=>HC,lazy:()=>$x,length:()=>fo,literal:()=>OA,locales:()=>Gc,looseObject:()=>_A,looseRecord:()=>EA,lowercase:()=>ks,lt:()=>sn,lte:()=>Cr,mac:()=>ZC,map:()=>kA,maxLength:()=>lo,maxSize:()=>bi,meta:()=>zA,mime:()=>As,minLength:()=>Fn,minSize:()=>cn,multipleOf:()=>vi,nan:()=>RA,nanoid:()=>FC,nativeEnum:()=>IA,negative:()=>ud,never:()=>Bd,nonnegative:()=>fd,nonoptional:()=>wx,nonpositive:()=>ld,normalize:()=>$s,null:()=>Xw,nullable:()=>tu,nullish:()=>AA,number:()=>Hw,object:()=>vA,optional:()=>eu,overwrite:()=>Gr,parse:()=>Rw,parseAsync:()=>Dw,partialRecord:()=>SA,pipe:()=>Ed,positive:()=>cd,prefault:()=>_x,preprocess:()=>HA,prettifyError:()=>Xy,promise:()=>qA,property:()=>dd,readonly:()=>Ox,record:()=>cx,refine:()=>Nx,regex:()=>Es,regexes:()=>Or,registry:()=>zf,safeDecode:()=>zw,safeDecodeAsync:()=>Bw,safeEncode:()=>Fw,safeEncodeAsync:()=>Uw,safeParse:()=>Nw,safeParseAsync:()=>Pw,set:()=>TA,setErrorMap:()=>aK,size:()=>uo,slugify:()=>Ps,startsWith:()=>Os,strictObject:()=>bA,string:()=>Yc,stringFormat:()=>tA,stringbool:()=>BA,success:()=>$A,superRefine:()=>Px,symbol:()=>dA,templateLiteral:()=>PA,toJSONSchema:()=>gd,toLowerCase:()=>Ds,toUpperCase:()=>Ns,transform:()=>Vd,treeifyError:()=>Ky,trim:()=>Rs,tuple:()=>ax,uint32:()=>cA,uint64:()=>fA,ulid:()=>BC,undefined:()=>pA,union:()=>Wd,unknown:()=>po,uppercase:()=>Ts,url:()=>jC,util:()=>ae,uuid:()=>DC,uuidv4:()=>NC,uuidv6:()=>PC,uuidv7:()=>qC,void:()=>mA,xid:()=>WC,xor:()=>wA});var zn={};Mn(zn,{$ZodAny:()=>kb,$ZodArray:()=>Ab,$ZodAsyncError:()=>Zr,$ZodBase64:()=>mb,$ZodBase64URL:()=>gb,$ZodBigInt:()=>Df,$ZodBigIntFormat:()=>wb,$ZodBoolean:()=>Wc,$ZodCIDRv4:()=>db,$ZodCIDRv6:()=>pb,$ZodCUID:()=>eb,$ZodCUID2:()=>tb,$ZodCatch:()=>Gb,$ZodCheck:()=>tt,$ZodCheckBigIntFormat:()=>Av,$ZodCheckEndsWith:()=>Uv,$ZodCheckGreaterThan:()=>If,$ZodCheckIncludes:()=>Fv,$ZodCheckLengthEquals:()=>qv,$ZodCheckLessThan:()=>Tf,$ZodCheckLowerCase:()=>Mv,$ZodCheckMaxLength:()=>Nv,$ZodCheckMaxSize:()=>$v,$ZodCheckMimeType:()=>Wv,$ZodCheckMinLength:()=>Pv,$ZodCheckMinSize:()=>Rv,$ZodCheckMultipleOf:()=>Ov,$ZodCheckNumberFormat:()=>Cv,$ZodCheckOverwrite:()=>Hv,$ZodCheckProperty:()=>Bv,$ZodCheckRegex:()=>jv,$ZodCheckSizeEquals:()=>Dv,$ZodCheckStartsWith:()=>zv,$ZodCheckStringFormat:()=>xs,$ZodCheckUpperCase:()=>Lv,$ZodCodec:()=>Vc,$ZodCustom:()=>r_,$ZodCustomStringFormat:()=>bb,$ZodDate:()=>Cb,$ZodDefault:()=>Wb,$ZodDiscriminatedUnion:()=>Db,$ZodE164:()=>yb,$ZodEmail:()=>Xv,$ZodEmoji:()=>Yv,$ZodEncodeError:()=>pi,$ZodEnum:()=>Mb,$ZodError:()=>Mc,$ZodExactOptional:()=>Ub,$ZodFile:()=>Fb,$ZodFunction:()=>Qb,$ZodGUID:()=>Gv,$ZodIPv4:()=>ub,$ZodIPv6:()=>lb,$ZodISODate:()=>sb,$ZodISODateTime:()=>ob,$ZodISODuration:()=>cb,$ZodISOTime:()=>ab,$ZodIntersection:()=>Nb,$ZodJWT:()=>vb,$ZodKSUID:()=>ib,$ZodLazy:()=>t_,$ZodLiteral:()=>Lb,$ZodMAC:()=>fb,$ZodMap:()=>qb,$ZodNaN:()=>Kb,$ZodNanoID:()=>Qv,$ZodNever:()=>Ib,$ZodNonOptional:()=>Vb,$ZodNull:()=>Eb,$ZodNullable:()=>Bb,$ZodNumber:()=>Rf,$ZodNumberFormat:()=>_b,$ZodObject:()=>TO,$ZodObjectJIT:()=>$b,$ZodOptional:()=>Pf,$ZodPipe:()=>qf,$ZodPrefault:()=>Hb,$ZodPreprocess:()=>Xb,$ZodPromise:()=>e_,$ZodReadonly:()=>Jb,$ZodRealError:()=>vr,$ZodRecord:()=>Pb,$ZodRegistry:()=>Ff,$ZodSet:()=>jb,$ZodString:()=>co,$ZodStringFormat:()=>Ye,$ZodSuccess:()=>Zb,$ZodSymbol:()=>xb,$ZodTemplateLiteral:()=>Yb,$ZodTransform:()=>zb,$ZodTuple:()=>Nf,$ZodType:()=>we,$ZodULID:()=>rb,$ZodURL:()=>Jv,$ZodUUID:()=>Kv,$ZodUndefined:()=>Sb,$ZodUnion:()=>Hc,$ZodUnknown:()=>Tb,$ZodVoid:()=>Ob,$ZodXID:()=>nb,$ZodXor:()=>Rb,$brand:()=>jy,$constructor:()=>z,$input:()=>i_,$output:()=>n_,Doc:()=>Bc,JSONSchema:()=>OC,JSONSchemaGenerator:()=>yd,NEVER:()=>qy,TimePrecision:()=>c_,_any:()=>C_,_array:()=>q_,_base64:()=>id,_base64url:()=>od,_bigint:()=>x_,_boolean:()=>__,_catch:()=>XG,_check:()=>IC,_cidrv4:()=>rd,_cidrv6:()=>nd,_coercedBigint:()=>S_,_coercedBoolean:()=>w_,_coercedDate:()=>N_,_coercedNumber:()=>h_,_coercedString:()=>s_,_cuid:()=>Kf,_cuid2:()=>Xf,_custom:()=>M_,_date:()=>D_,_decode:()=>yf,_decodeAsync:()=>bf,_default:()=>ZG,_discriminatedUnion:()=>PG,_e164:()=>sd,_email:()=>Uf,_emoji:()=>Zf,_encode:()=>gf,_encodeAsync:()=>vf,_endsWith:()=>Cs,_enum:()=>zG,_file:()=>j_,_float32:()=>g_,_float64:()=>y_,_gt:()=>an,_gte:()=>ar,_guid:()=>Kc,_includes:()=>Is,_int:()=>m_,_int32:()=>v_,_int64:()=>E_,_intersection:()=>qG,_ipv4:()=>ed,_ipv6:()=>td,_isoDate:()=>l_,_isoDateTime:()=>u_,_isoDuration:()=>d_,_isoTime:()=>f_,_jwt:()=>ad,_ksuid:()=>Qf,_lazy:()=>eK,_length:()=>fo,_literal:()=>BG,_lowercase:()=>ks,_lt:()=>sn,_lte:()=>Cr,_mac:()=>a_,_map:()=>LG,_max:()=>Cr,_maxLength:()=>lo,_maxSize:()=>bi,_mime:()=>As,_min:()=>ar,_minLength:()=>Fn,_minSize:()=>cn,_multipleOf:()=>vi,_nan:()=>P_,_nanoid:()=>Gf,_nativeEnum:()=>UG,_negative:()=>ud,_never:()=>$_,_nonnegative:()=>fd,_nonoptional:()=>GG,_nonpositive:()=>ld,_normalize:()=>$s,_null:()=>O_,_nullable:()=>VG,_number:()=>p_,_optional:()=>HG,_overwrite:()=>Gr,_parse:()=>vs,_parseAsync:()=>bs,_pipe:()=>JG,_positive:()=>cd,_promise:()=>tK,_property:()=>dd,_readonly:()=>YG,_record:()=>MG,_refine:()=>L_,_regex:()=>Es,_safeDecode:()=>wf,_safeDecodeAsync:()=>Sf,_safeEncode:()=>_f,_safeEncodeAsync:()=>xf,_safeParse:()=>_s,_safeParseAsync:()=>ws,_set:()=>FG,_size:()=>uo,_slugify:()=>Ps,_startsWith:()=>Os,_string:()=>o_,_stringFormat:()=>qs,_stringbool:()=>B_,_success:()=>KG,_superRefine:()=>F_,_symbol:()=>T_,_templateLiteral:()=>QG,_toLowerCase:()=>Ds,_toUpperCase:()=>Ns,_transform:()=>WG,_trim:()=>Rs,_tuple:()=>jG,_uint32:()=>b_,_uint64:()=>k_,_ulid:()=>Jf,_undefined:()=>I_,_union:()=>DG,_unknown:()=>A_,_uppercase:()=>Ts,_url:()=>Xc,_uuid:()=>Bf,_uuidv4:()=>Wf,_uuidv6:()=>Hf,_uuidv7:()=>Vf,_void:()=>R_,_xid:()=>Yf,_xor:()=>NG,clone:()=>or,config:()=>wt,createStandardJSONSchemaMethod:()=>js,createToJSONSchemaMethod:()=>W_,decode:()=>t5,decodeAsync:()=>n5,describe:()=>z_,encode:()=>e5,encodeAsync:()=>r5,extractDefs:()=>wi,finalize:()=>xi,flattenError:()=>Lc,formatError:()=>Fc,globalConfig:()=>oo,globalRegistry:()=>Gt,initializeContext:()=>_i,isValidBase64:()=>hb,isValidBase64URL:()=>xO,isValidJWT:()=>SO,locales:()=>Gc,meta:()=>U_,parse:()=>hf,parseAsync:()=>mf,prettifyError:()=>Xy,process:()=>He,regexes:()=>Or,registry:()=>zf,safeDecode:()=>o5,safeDecodeAsync:()=>a5,safeEncode:()=>i5,safeEncodeAsync:()=>s5,safeParse:()=>Jy,safeParseAsync:()=>Yy,toDotPath:()=>tO,toJSONSchema:()=>gd,treeifyError:()=>Ky,util:()=>ae,version:()=>Vv});var XI,qy=Object.freeze({status:"aborted"});function z(e,t,r){function i(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=s.prototype,l=Object.keys(u);for(let f=0;f<l.length;f++){let p=l[f];p in a||(a[p]=u[p].bind(a))}}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function s(a){var c;let u=r?.Parent?new o:this;i(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var jy=Symbol("zod_brand"),Zr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},pi=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(XI=globalThis).__zod_globalConfig??(XI.__zod_globalConfig={});var oo=globalThis.__zod_globalConfig;function wt(e){return e&&Object.assign(oo,e),oo}var ae={};Mn(ae,{BIGINT_FORMAT_RANGES:()=>Zy,Class:()=>Ly,NUMBER_FORMAT_RANGES:()=>Vy,aborted:()=>yi,allowsEval:()=>Uy,assert:()=>RZ,assertEqual:()=>OZ,assertIs:()=>AZ,assertNever:()=>$Z,assertNotEqual:()=>CZ,assignProp:()=>mi,base64ToUint8Array:()=>YI,base64urlToUint8Array:()=>KZ,cached:()=>gs,captureStackTrace:()=>pf,cleanEnum:()=>GZ,cleanRegex:()=>Nc,clone:()=>or,cloneDef:()=>NZ,createTransparentProxy:()=>FZ,defineLazy:()=>Ie,esc:()=>df,escapeRegex:()=>Dr,explicitlyAborted:()=>Gy,extend:()=>BZ,finalizeIssue:()=>sr,floatSafeRemainder:()=>Fy,getElementAtPath:()=>PZ,getEnumValues:()=>Dc,getLengthableOrigin:()=>jc,getParsedType:()=>LZ,getSizableOrigin:()=>qc,hexToUint8Array:()=>JZ,isObject:()=>so,isPlainObject:()=>gi,issue:()=>ys,joinValues:()=>W,jsonStringifyReplacer:()=>ms,merge:()=>HZ,mergeDefs:()=>Ln,normalizeParams:()=>ce,nullish:()=>hi,numKeys:()=>MZ,objectClone:()=>DZ,omit:()=>UZ,optionalKeys:()=>Hy,parsedType:()=>oe,partial:()=>VZ,pick:()=>zZ,prefixIssues:()=>yr,primitiveTypes:()=>Wy,promiseAllObject:()=>qZ,propertyKeyTypes:()=>Pc,randomString:()=>jZ,required:()=>ZZ,safeExtend:()=>WZ,shallowClone:()=>By,slugify:()=>zy,stringifyPrimitive:()=>ie,uint8ArrayToBase64:()=>QI,uint8ArrayToBase64url:()=>XZ,uint8ArrayToHex:()=>YZ,unwrapMessage:()=>Rc});function OZ(e){return e}function CZ(e){return e}function AZ(e){}function $Z(e){throw new Error("Unexpected value in exhaustive check")}function RZ(e){}function Dc(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}function W(e,t="|"){return e.map(r=>ie(r)).join(t)}function ms(e,t){return typeof t=="bigint"?t.toString():t}function gs(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function hi(e){return e==null}function Nc(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Fy(e,t){let r=e/t,i=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}var JI=Symbol("evaluating");function Ie(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==JI)return i===void 0&&(i=JI,i=r()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function DZ(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function mi(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ln(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function NZ(e){return Ln(e._zod.def)}function PZ(e,t){return t?t.reduce((r,i)=>r?.[i],e):e}function qZ(e){let t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n})}function jZ(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function df(e){return JSON.stringify(e)}function zy(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var pf="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function so(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Uy=gs(()=>{if(oo.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function gi(e){if(so(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(so(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function By(e){return gi(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function MZ(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var LZ=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Pc=new Set(["string","number","symbol"]),Wy=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Dr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function or(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}function ce(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function FZ(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,o){return t??(t=e()),Reflect.set(t,i,n,o)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function ie(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Hy(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Vy={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Zy={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zZ(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Ln(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=r.shape[a])}return mi(this,"shape",s),s},checks:[]});return or(e,o)}function UZ(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Ln(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return mi(this,"shape",s),s},checks:[]});return or(e,o)}function BZ(e,t){if(!gi(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Ln(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return mi(this,"shape",o),o}});return or(e,n)}function WZ(e,t){if(!gi(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Ln(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return mi(this,"shape",i),i}});return or(e,r)}function HZ(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=Ln(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return mi(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return or(e,r)}function VZ(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Ln(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return mi(this,"shape",c),c},checks:[]});return or(t,s)}function ZZ(e,t,r){let i=Ln(t._zod.def,{get shape(){let n=t._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new e({type:"nonoptional",innerType:n[s]});return mi(this,"shape",o),o}});return or(t,i)}function yi(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Gy(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function yr(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Rc(e){return typeof e=="string"?e:e?.message}function sr(e,t,r){let i=e.message?e.message:Rc(e.inst?._zod.def?.error?.(e))??Rc(t?.error?.(e))??Rc(r.customError?.(e))??Rc(r.localeError?.(e))??"Invalid input",{inst:n,continue:o,input:s,...a}=e;return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=s),a}function qc(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function jc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function oe(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function ys(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}function GZ(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function YI(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function QI(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function KZ(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return YI(t+r)}function XZ(e){return QI(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function JZ(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}function YZ(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ly=class{constructor(...t){}};var eO=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ms,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Mc=z("$ZodError",eO),vr=z("$ZodError",eO,{Parent:Error});function Lc(e,t=r=>r.message){let r={},i=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function Fc(e,t=r=>r.message){let r={_errors:[]},i=(n,o=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)r._errors.push(t(s));else{let c=r,u=0;for(;u<a.length;){let l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(t(s))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return i(e),r}function Ky(e,t=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var s,a;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},[...o,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...o,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...o,...c.path]);else{let u=[...o,...c.path];if(u.length===0){r.errors.push(t(c));continue}let l=r,f=0;for(;f<u.length;){let p=u[f],d=f===u.length-1;typeof p=="string"?(l.properties??(l.properties={}),(s=l.properties)[p]??(s[p]={errors:[]}),l=l.properties[p]):(l.items??(l.items=[]),(a=l.items)[p]??(a[p]={errors:[]}),l=l.items[p]),d&&l.errors.push(t(c)),f++}}};return i(e),r}function tO(e){let t=[],r=e.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function Xy(e){let t=[],r=[...e.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${tO(i.path)}`);return t.join(`
|
|
271
|
+
`),s=0;s<o.length;s++){var a=o[s].trim(),c=nve.exec(a);c&&n.push(c[1])}t(null,n)})};PH.exports=Tr});var LH=w((P$e,MH)=>{var jH=CH(),ive=B("util"),ove=uI(),sve=Ur(),ave=qH().ip(),cve="roundRobin",uve="masterSlave";MH.exports=function(e){function t(o){if(!(this instanceof t))return new t(o);if(!o||!Array.isArray(o.cluster))throw new Error("require options.cluster to be an array");jH.call(this),this.clients=[],this.availables={};for(let a=0;a<o.cluster.length;a++){let c=o.cluster[a];sve(o).pick("timeout","agent","urllib").to(c),this.clients.push(new e(c)),this.availables[a]=!0}this.schedule=o.schedule||cve,this.masterOnly=!!o.masterOnly,this.index=0;let s=o.heartbeatInterval||1e4;this._checkAvailableLock=!1,this._timerId=this._deferInterval(this._checkAvailable.bind(this,!0),s),this._ignoreStatusFile=o.ignoreStatusFile||!1,this._init()}ive.inherits(t,jH);let r=t.prototype;ove.mixin(r);let i=["head","get","getStream","list","getACL"],n=["put","putStream","delete","deleteMulti","copy","putMeta","putACL"];return i.forEach(o=>{r[o]=async function(...s){let a=this.chooseAvailable(),c;try{return await a[o](...s)}catch(u){if(u.status&&u.status>=200&&u.status<500)throw u;c=u}for(let u=0;u<this.clients.length;u++){let l=this.clients[u];if(l!==a)try{return await l[o].apply(a,s)}catch(f){if(f.status&&f.status>=200&&f.status<500)throw f;c=f}}throw c.message+=" (all clients are down)",c}}),n.forEach(o=>{r[o]=async function(...s){return(await Promise.all(this.clients.map(c=>c[o](...s))))[0]}}),r.signatureUrl=function(...s){return this.chooseAvailable().signatureUrl(...s)},r.getObjectUrl=function(...s){return this.chooseAvailable().getObjectUrl(...s)},r._init=function(){let s=this;(async()=>{await s._checkAvailable(s._ignoreStatusFile),s.ready(!0)})().catch(a=>{s.emit("error",a)})},r._checkAvailable=async function(s){let a=`._ali-oss/check.status.${ave}.txt`;if(s||await this.put(a,Buffer.from(`check available started at ${Date()}`)),this._checkAvailableLock)return;this._checkAvailableLock=!0;let c=[];for(let u=0;u<this.clients.length;u++){let l=this.clients[u],f=await this._checkStatus(l,a);f||(f=await this._checkStatus(l,a)),f||(f=await this._checkStatus(l,a),f||c.push(l._objectUrl(a))),this.availables[u]=f}if(this._checkAvailableLock=!1,c.length>0){let u=new Error(`${c.length} data node down, please check status file: ${c.join(", ")}`);u.name="CheckAvailableError",this.emit("error",u)}},r._checkStatus=async function(s,a){let c=!0;try{await s.head(a)}catch(u){(!u.status||u.status>=500||u.status<200)&&(c=!1)}return c},r.chooseAvailable=function(){if(this.schedule===uve){if(this.masterOnly)return this.clients[0];for(let a=0;a<this.clients.length;a++)if(this.availables[a])return this.clients[a];return this.clients[0]}let s=this.clients.length;for(;s>0;){let a=this._nextRRIndex();if(this.availables[a])return this.clients[a];s--}return this.clients[0]},r._nextRRIndex=function(){let s=this.index++;return this.index>=this.clients.length&&(this.index=0),s},r._error=function(s){if(s)throw s},r._createCallback=function(s,a,c){return()=>{c=c||this._error,a.call(s).then(()=>{c()},c)}},r._deferInterval=function(s,a,c){return setInterval(this._createCallback(this,s,c),a)},r.close=function(){clearInterval(this._timerId),this._timerId=null},t}});var zH=w((q$e,FH)=>{var fI=Va()("ali-oss:sts"),lve=B("crypto"),fve=B("querystring"),dve=Ur(),pve=fm(),hve=is(),mve=Za(),gve=qT(),yve=new pve;function oy(e){if(!(this instanceof oy))return new oy(e);if(!e||!e.accessKeyId||!e.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");this.options={endpoint:e.endpoint||"https://sts.aliyuncs.com",format:"JSON",apiVersion:"2015-04-01",sigMethod:"HMAC-SHA1",sigVersion:"1.0",timeout:"60s"},dve(e).to(this.options),this.options.urllib?this.urllib=this.options.urllib:(this.urllib=gve,this.agent=this.options.agent||yve)}FH.exports=oy;var sy=oy.prototype;sy.assumeRole=async function(t,r,i,n,o){let s=this.options,a={Action:"AssumeRole",RoleArn:t,RoleSessionName:n||"app",DurationSeconds:i||3600,Format:s.format,Version:s.apiVersion,AccessKeyId:s.accessKeyId,SignatureMethod:s.sigMethod,SignatureVersion:s.sigVersion,SignatureNonce:Math.random(),Timestamp:new Date().toISOString()};if(r){let p;if(hve.string(r))try{p=JSON.stringify(JSON.parse(r))}catch(d){throw new Error(`Policy string is not a valid JSON: ${d.message}`)}else p=JSON.stringify(r);a.Policy=p}let c=this._getSignature("POST",a,s.accessKeySecret);a.Signature=c;let u=s.endpoint,l={agent:this.agent,timeout:mve(o&&o.timeout||s.timeout),method:"POST",content:fve.stringify(a),headers:{"Content-Type":"application/x-www-form-urlencoded"},ctx:o&&o.ctx},f=await this.urllib.request(u,l);if(fI("response %s %s, got %s, headers: %j",l.method,u,f.status,f.headers),Math.floor(f.status/100)!==2){let p=await this._requestError(f);throw p.params=l,p}return f.data=JSON.parse(f.data),{res:f.res,credentials:f.data.Credentials}};sy._requestError=async function(t){let r=new Error;r.status=t.status;try{let i=await JSON.parse(t.data)||{};r.code=i.Code,r.message=`${i.Code}: ${i.Message}`,r.requestId=i.RequestId}catch{r.message=`UnknownError: ${String(t.data)}`}return r};sy._getSignature=function(t,r,i){let n=this,o=Object.keys(r).sort().map(c=>`${n._escape(c)}=${n._escape(r[c])}`).join("&"),s=`${t.toUpperCase()}&${this._escape("/")}&${this._escape(o)}`;fI("string to sign: %s",s);let a=lve.createHmac("sha1",`${i}&`);return a=a.update(s).digest("base64"),fI("signature: %s",a),a};sy._escape=function(t){return encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}});var ZH=w((j$e,VH)=>{var tf=Va()("ali-oss"),vve=rF(),bve=kz(),_ve=fm(),wve=fm().HttpsAgent,Rn=Ga(),xve=Lz(),Sve=Ki(),Eve=qT(),kve=qB(),UH=MB(),ay=ss(),Tve=S3(),{createRequest:Ive}=N3(),{encoder:Ove}=UT(),{getReqUrl:Cve}=BT(),{setSTSToken:Ave}=bg(),{retry:$ve}=wg(),{isFunction:Rve}=Sg(),{getStandardRegion:Dve}=kg(),BH=new _ve,WH=new wve;function rn(e,t){if(!(this instanceof rn))return new rn(e,t);e&&e.inited?this.options=e:this.options=rn.initOptions(e),this.options.urllib?this.urllib=this.options.urllib:(this.urllib=Eve,this.options.maxSockets&&(BH.maxSockets=this.options.maxSockets,WH.maxSockets=this.options.maxSockets),this.agent=this.options.agent||BH,this.httpsAgent=this.options.httpsAgent||WH),this.ctx=t,this.userAgent=this._getUserAgent(),this.stsTokenFreshTime=new Date}VH.exports=rn;rn.initOptions=function(t){return Tve(t)};var _t=rn.prototype;Rn(_t,PW());Rn(_t,zW());Rn(_t,ZW());Rn(_t,rH());Rn(_t,iH());Rn(_t,uH());Rn(_t,pH());Rn(_t,gH());Rn(_t,vH());Rn(_t,xH());rn.ImageClient=EH()(rn);rn.ClusterClient=LH()(rn);rn.STS=zH();_t.signature=function(t){return tf("authorization stringToSign: %s",t),ay.computeSignature(this.options.accessKeySecret,t,this.options.headerEncoding)};_t._getReqUrl=Cve;_t.authorization=function(t,r,i,n){let o=ay.buildCanonicalString(t.toUpperCase(),r,{headers:n,parameters:i});return ay.authorization(this.options.accessKeyId,this.options.accessKeySecret,o,this.options.headerEncoding)};_t.authorizationV4=function(t,r,i,n,o){let{cloudBoxId:s}=this.options,a=s===void 0?Dve(this.options.region):s;return ay.authorizationV4(this.options.accessKeyId,this.options.accessKeySecret,a,t,r,i,n,o,this.options.headerEncoding,s)};_t.request=async function(e){return this.options.retryMax?await $ve(HH.bind(this),this.options.retryMax,{errorHandler:t=>!!(i=>{if(e.stream)return!1;let n=[-1,-2].includes(i.status),o=this.options.requestErrorRetryHandle||(()=>!0);return n&&o(i)})(t)})(e):await HH.call(this,e)};async function HH(e){this.options.stsToken&&Rve(this.options.refreshSTSToken)&&await Ave.call(this);let t=Ive.call(this,e),r,i;try{r=await this.urllib.request(t.url,t.params),tf("response %s %s, got %s, headers: %j",e.method,t.url,r.status,r.headers)}catch(o){i=o}let n;if(r&&e.successStatuses&&e.successStatuses.indexOf(r.status)===-1?(n=await this.requestError(r),n.params=e):i&&(n=await this.requestError(i)),n)throw e.customResponse&&r&&r.res&&await vve(r.res),n.name==="ResponseTimeoutError"&&(n.message=`${n.message.split(",")[0]}, please increase the timeout, see more details at https://github.com/ali-sdk/ali-oss#responsetimeouterror`),n.name==="ConnectionTimeoutError"&&(n.message=`${n.message.split(",")[0]}, please increase the timeout or reduce the partSize, see more details at https://github.com/ali-sdk/ali-oss#connectiontimeouterror`),n;return e.xmlResponse&&(r.data=await this.parseXML(r.data)),r}_t._getResource=function(t){let r="/";return t.bucket&&(r+=`${t.bucket}/`),t.object&&(r+=Ove(t.object,this.options.headerEncoding)),r};_t._escape=function(t){return Sve.encodeURIComponent(t).replace(/%2F/g,"/")};_t._getUserAgent=function(){let r=`aliyun-sdk-${process&&process.browser?"js":"nodejs"}/${kve.version}`,i=xve.description;return!i&&process&&(i=`Node.js ${process.version.slice(1)} on ${process.platform} ${process.arch}`),this._checkUserAgent(`${r} ${i}`)};_t._checkUserAgent=function(t){return t.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")};_t.checkBrowserAndVersion=function(t,r){return UH.name===t&&UH.version.split(".")[0]===r};_t.parseXML=function(t){return new Promise((r,i)=>{Buffer.isBuffer(t)&&(t=t.toString()),bve.parseString(t,{explicitRoot:!1,explicitArray:!1},(n,o)=>{n?i(n):r(o)})})};_t.requestError=async function(t){let r=null,i=async n=>{let o;try{o=await this.parseXML(n)||{}}catch(a){return tf(n),a.message+=`
|
|
272
|
+
raw xml: ${n}`,a.status=t.status,a.requestId=t.headers&&t.headers["x-oss-request-id"],a}let s=o.Message||`unknow request error, status: ${t.status}`;return o.Condition&&(s+=` (condition: ${o.Condition})`),r=new Error(s),r.name=o.Code?`${o.Code}Error`:"UnknownError",r.status=t.status,r.code=o.Code,r.requestId=o.RequestId,r.ecCode=o.EC,r.hostId=o.HostId,r};if(t.name==="ResponseTimeoutError")r=new Error(t.message),r.name=t.name;else if(!t.data||!t.data.length)if(t.status===-1||t.status===-2)r=new Error(t.message),r.name=t.name,r.status=t.status,r.code=t.name;else{if(t.status===404)r=new Error("Object not exists"),r.name="NoSuchKeyError",r.status=404,r.code="NoSuchKey";else if(t.status===412)r=new Error("Pre condition failed"),r.name="PreconditionFailedError",r.status=412,r.code="PreconditionFailed";else{r=new Error(`Unknow error, status: ${t.status}`),r.name="UnknownError",r.status=t.status,r.res=t;let n=t.headers&&t.headers["x-oss-err"];if(n){let o=Buffer.from(n,"base64").toString("utf8");r=await i(o)}}r.requestId=t.headers&&t.headers["x-oss-request-id"],r.host=""}else{let n=String(t.data);tf("request response error data: %s",n),r=await i(n)}return tf("generate error %j",r),r};_t.setSLDEnabled=function(t){return this.options.sldEnable=!!t,this}});import Mx from"node:fs";import fn from"node:path";import{homedir as Ny}from"node:os";import{basename as T_e,dirname as I_e,join as Py,resolve as WI}from"node:path";var HI=".dsh",TZ=`~/${HI}`,VI="DSH_HOME";function ZI(){return Py(Ny(),HI)}function IZ(e){return e==="~"?Ny():e.startsWith("~/")||e.startsWith("~\\")?Py(Ny(),e.slice(2)):e}function io(e,t=process.env){let r=t[VI];return WI(IZ(e??(r!==void 0&&r.trim().length>0?r:ZI())))}function GI(...e){return Py(io(),...e)}function KI(e){return e===WI(ZI())?TZ:`$${VI}`}var ye={};Mn(ye,{$brand:()=>jy,$input:()=>i_,$output:()=>n_,NEVER:()=>qy,TimePrecision:()=>c_,ZodAny:()=>Jw,ZodArray:()=>tx,ZodBase64:()=>Md,ZodBase64URL:()=>Ld,ZodBigInt:()=>Hs,ZodBigIntFormat:()=>Ud,ZodBoolean:()=>Ws,ZodCIDRv4:()=>qd,ZodCIDRv6:()=>jd,ZodCUID:()=>Cd,ZodCUID2:()=>Ad,ZodCatch:()=>Sx,ZodCodec:()=>uu,ZodCustom:()=>lu,ZodCustomStringFormat:()=>Us,ZodDate:()=>iu,ZodDefault:()=>yx,ZodDiscriminatedUnion:()=>nx,ZodE164:()=>Fd,ZodEmail:()=>Td,ZodEmoji:()=>Id,ZodEnum:()=>Fs,ZodError:()=>iK,ZodExactOptional:()=>hx,ZodFile:()=>dx,ZodFirstPartyTypeKind:()=>qx,ZodFunction:()=>Dx,ZodGUID:()=>Qc,ZodIPv4:()=>Nd,ZodIPv6:()=>Pd,ZodISODate:()=>_d,ZodISODateTime:()=>bd,ZodISODuration:()=>xd,ZodISOTime:()=>wd,ZodIntersection:()=>ix,ZodIssueCode:()=>sK,ZodJWT:()=>zd,ZodKSUID:()=>Dd,ZodLazy:()=>Ax,ZodLiteral:()=>fx,ZodMAC:()=>Ww,ZodMap:()=>ux,ZodNaN:()=>kx,ZodNanoID:()=>Od,ZodNever:()=>Qw,ZodNonOptional:()=>Gd,ZodNull:()=>Kw,ZodNullable:()=>gx,ZodNumber:()=>Bs,ZodNumberFormat:()=>ho,ZodObject:()=>su,ZodOptional:()=>Zd,ZodPipe:()=>cu,ZodPrefault:()=>bx,ZodPreprocess:()=>Tx,ZodPromise:()=>Rx,ZodReadonly:()=>Ix,ZodRealError:()=>br,ZodRecord:()=>Ls,ZodSet:()=>lx,ZodString:()=>zs,ZodStringFormat:()=>Qe,ZodSuccess:()=>xx,ZodSymbol:()=>Zw,ZodTemplateLiteral:()=>Cx,ZodTransform:()=>px,ZodTuple:()=>sx,ZodType:()=>Ee,ZodULID:()=>$d,ZodURL:()=>nu,ZodUUID:()=>un,ZodUndefined:()=>Gw,ZodUnion:()=>au,ZodUnknown:()=>Yw,ZodVoid:()=>ex,ZodXID:()=>Rd,ZodXor:()=>rx,_ZodString:()=>kd,_default:()=>vx,_function:()=>jA,any:()=>hA,array:()=>ou,base64:()=>JC,base64url:()=>YC,bigint:()=>uA,boolean:()=>Vw,catch:()=>Ex,check:()=>MA,cidrv4:()=>KC,cidrv6:()=>XC,clone:()=>or,codec:()=>DA,coerce:()=>jx,config:()=>wt,core:()=>zn,cuid:()=>zC,cuid2:()=>UC,custom:()=>LA,date:()=>gA,decode:()=>jw,decodeAsync:()=>Lw,describe:()=>FA,discriminatedUnion:()=>xA,e164:()=>QC,email:()=>$C,emoji:()=>LC,encode:()=>qw,encodeAsync:()=>Mw,endsWith:()=>Cs,enum:()=>Hd,exactOptional:()=>mx,file:()=>CA,flattenError:()=>Lc,float32:()=>oA,float64:()=>sA,formatError:()=>Fc,fromJSONSchema:()=>ZA,function:()=>jA,getErrorMap:()=>cK,globalRegistry:()=>Gt,gt:()=>an,gte:()=>ar,guid:()=>RC,hash:()=>iA,hex:()=>nA,hostname:()=>rA,httpUrl:()=>MC,includes:()=>Is,instanceof:()=>UA,int:()=>Sd,int32:()=>aA,int64:()=>lA,intersection:()=>ox,invertCodec:()=>NA,ipv4:()=>VC,ipv6:()=>GC,iso:()=>Ms,json:()=>WA,jwt:()=>eA,keyof:()=>yA,ksuid:()=>HC,lazy:()=>$x,length:()=>fo,literal:()=>OA,locales:()=>Gc,looseObject:()=>_A,looseRecord:()=>EA,lowercase:()=>ks,lt:()=>sn,lte:()=>Cr,mac:()=>ZC,map:()=>kA,maxLength:()=>lo,maxSize:()=>bi,meta:()=>zA,mime:()=>As,minLength:()=>Fn,minSize:()=>cn,multipleOf:()=>vi,nan:()=>RA,nanoid:()=>FC,nativeEnum:()=>IA,negative:()=>ud,never:()=>Bd,nonnegative:()=>fd,nonoptional:()=>wx,nonpositive:()=>ld,normalize:()=>$s,null:()=>Xw,nullable:()=>tu,nullish:()=>AA,number:()=>Hw,object:()=>vA,optional:()=>eu,overwrite:()=>Gr,parse:()=>Rw,parseAsync:()=>Dw,partialRecord:()=>SA,pipe:()=>Ed,positive:()=>cd,prefault:()=>_x,preprocess:()=>HA,prettifyError:()=>Xy,promise:()=>qA,property:()=>dd,readonly:()=>Ox,record:()=>cx,refine:()=>Nx,regex:()=>Es,regexes:()=>Or,registry:()=>zf,safeDecode:()=>zw,safeDecodeAsync:()=>Bw,safeEncode:()=>Fw,safeEncodeAsync:()=>Uw,safeParse:()=>Nw,safeParseAsync:()=>Pw,set:()=>TA,setErrorMap:()=>aK,size:()=>uo,slugify:()=>Ps,startsWith:()=>Os,strictObject:()=>bA,string:()=>Yc,stringFormat:()=>tA,stringbool:()=>BA,success:()=>$A,superRefine:()=>Px,symbol:()=>dA,templateLiteral:()=>PA,toJSONSchema:()=>gd,toLowerCase:()=>Ds,toUpperCase:()=>Ns,transform:()=>Vd,treeifyError:()=>Ky,trim:()=>Rs,tuple:()=>ax,uint32:()=>cA,uint64:()=>fA,ulid:()=>BC,undefined:()=>pA,union:()=>Wd,unknown:()=>po,uppercase:()=>Ts,url:()=>jC,util:()=>ae,uuid:()=>DC,uuidv4:()=>NC,uuidv6:()=>PC,uuidv7:()=>qC,void:()=>mA,xid:()=>WC,xor:()=>wA});var zn={};Mn(zn,{$ZodAny:()=>kb,$ZodArray:()=>Ab,$ZodAsyncError:()=>Zr,$ZodBase64:()=>mb,$ZodBase64URL:()=>gb,$ZodBigInt:()=>Df,$ZodBigIntFormat:()=>wb,$ZodBoolean:()=>Wc,$ZodCIDRv4:()=>db,$ZodCIDRv6:()=>pb,$ZodCUID:()=>eb,$ZodCUID2:()=>tb,$ZodCatch:()=>Gb,$ZodCheck:()=>tt,$ZodCheckBigIntFormat:()=>Av,$ZodCheckEndsWith:()=>Uv,$ZodCheckGreaterThan:()=>If,$ZodCheckIncludes:()=>Fv,$ZodCheckLengthEquals:()=>qv,$ZodCheckLessThan:()=>Tf,$ZodCheckLowerCase:()=>Mv,$ZodCheckMaxLength:()=>Nv,$ZodCheckMaxSize:()=>$v,$ZodCheckMimeType:()=>Wv,$ZodCheckMinLength:()=>Pv,$ZodCheckMinSize:()=>Rv,$ZodCheckMultipleOf:()=>Ov,$ZodCheckNumberFormat:()=>Cv,$ZodCheckOverwrite:()=>Hv,$ZodCheckProperty:()=>Bv,$ZodCheckRegex:()=>jv,$ZodCheckSizeEquals:()=>Dv,$ZodCheckStartsWith:()=>zv,$ZodCheckStringFormat:()=>xs,$ZodCheckUpperCase:()=>Lv,$ZodCodec:()=>Vc,$ZodCustom:()=>r_,$ZodCustomStringFormat:()=>bb,$ZodDate:()=>Cb,$ZodDefault:()=>Wb,$ZodDiscriminatedUnion:()=>Db,$ZodE164:()=>yb,$ZodEmail:()=>Xv,$ZodEmoji:()=>Yv,$ZodEncodeError:()=>pi,$ZodEnum:()=>Mb,$ZodError:()=>Mc,$ZodExactOptional:()=>Ub,$ZodFile:()=>Fb,$ZodFunction:()=>Qb,$ZodGUID:()=>Gv,$ZodIPv4:()=>ub,$ZodIPv6:()=>lb,$ZodISODate:()=>sb,$ZodISODateTime:()=>ob,$ZodISODuration:()=>cb,$ZodISOTime:()=>ab,$ZodIntersection:()=>Nb,$ZodJWT:()=>vb,$ZodKSUID:()=>ib,$ZodLazy:()=>t_,$ZodLiteral:()=>Lb,$ZodMAC:()=>fb,$ZodMap:()=>qb,$ZodNaN:()=>Kb,$ZodNanoID:()=>Qv,$ZodNever:()=>Ib,$ZodNonOptional:()=>Vb,$ZodNull:()=>Eb,$ZodNullable:()=>Bb,$ZodNumber:()=>Rf,$ZodNumberFormat:()=>_b,$ZodObject:()=>TO,$ZodObjectJIT:()=>$b,$ZodOptional:()=>Pf,$ZodPipe:()=>qf,$ZodPrefault:()=>Hb,$ZodPreprocess:()=>Xb,$ZodPromise:()=>e_,$ZodReadonly:()=>Jb,$ZodRealError:()=>vr,$ZodRecord:()=>Pb,$ZodRegistry:()=>Ff,$ZodSet:()=>jb,$ZodString:()=>co,$ZodStringFormat:()=>Ye,$ZodSuccess:()=>Zb,$ZodSymbol:()=>xb,$ZodTemplateLiteral:()=>Yb,$ZodTransform:()=>zb,$ZodTuple:()=>Nf,$ZodType:()=>we,$ZodULID:()=>rb,$ZodURL:()=>Jv,$ZodUUID:()=>Kv,$ZodUndefined:()=>Sb,$ZodUnion:()=>Hc,$ZodUnknown:()=>Tb,$ZodVoid:()=>Ob,$ZodXID:()=>nb,$ZodXor:()=>Rb,$brand:()=>jy,$constructor:()=>z,$input:()=>i_,$output:()=>n_,Doc:()=>Bc,JSONSchema:()=>OC,JSONSchemaGenerator:()=>yd,NEVER:()=>qy,TimePrecision:()=>c_,_any:()=>C_,_array:()=>q_,_base64:()=>id,_base64url:()=>od,_bigint:()=>x_,_boolean:()=>__,_catch:()=>XG,_check:()=>IC,_cidrv4:()=>rd,_cidrv6:()=>nd,_coercedBigint:()=>S_,_coercedBoolean:()=>w_,_coercedDate:()=>N_,_coercedNumber:()=>h_,_coercedString:()=>s_,_cuid:()=>Kf,_cuid2:()=>Xf,_custom:()=>M_,_date:()=>D_,_decode:()=>yf,_decodeAsync:()=>bf,_default:()=>ZG,_discriminatedUnion:()=>PG,_e164:()=>sd,_email:()=>Uf,_emoji:()=>Zf,_encode:()=>gf,_encodeAsync:()=>vf,_endsWith:()=>Cs,_enum:()=>zG,_file:()=>j_,_float32:()=>g_,_float64:()=>y_,_gt:()=>an,_gte:()=>ar,_guid:()=>Kc,_includes:()=>Is,_int:()=>m_,_int32:()=>v_,_int64:()=>E_,_intersection:()=>qG,_ipv4:()=>ed,_ipv6:()=>td,_isoDate:()=>l_,_isoDateTime:()=>u_,_isoDuration:()=>d_,_isoTime:()=>f_,_jwt:()=>ad,_ksuid:()=>Qf,_lazy:()=>eK,_length:()=>fo,_literal:()=>BG,_lowercase:()=>ks,_lt:()=>sn,_lte:()=>Cr,_mac:()=>a_,_map:()=>LG,_max:()=>Cr,_maxLength:()=>lo,_maxSize:()=>bi,_mime:()=>As,_min:()=>ar,_minLength:()=>Fn,_minSize:()=>cn,_multipleOf:()=>vi,_nan:()=>P_,_nanoid:()=>Gf,_nativeEnum:()=>UG,_negative:()=>ud,_never:()=>$_,_nonnegative:()=>fd,_nonoptional:()=>GG,_nonpositive:()=>ld,_normalize:()=>$s,_null:()=>O_,_nullable:()=>VG,_number:()=>p_,_optional:()=>HG,_overwrite:()=>Gr,_parse:()=>vs,_parseAsync:()=>bs,_pipe:()=>JG,_positive:()=>cd,_promise:()=>tK,_property:()=>dd,_readonly:()=>YG,_record:()=>MG,_refine:()=>L_,_regex:()=>Es,_safeDecode:()=>wf,_safeDecodeAsync:()=>Sf,_safeEncode:()=>_f,_safeEncodeAsync:()=>xf,_safeParse:()=>_s,_safeParseAsync:()=>ws,_set:()=>FG,_size:()=>uo,_slugify:()=>Ps,_startsWith:()=>Os,_string:()=>o_,_stringFormat:()=>qs,_stringbool:()=>B_,_success:()=>KG,_superRefine:()=>F_,_symbol:()=>T_,_templateLiteral:()=>QG,_toLowerCase:()=>Ds,_toUpperCase:()=>Ns,_transform:()=>WG,_trim:()=>Rs,_tuple:()=>jG,_uint32:()=>b_,_uint64:()=>k_,_ulid:()=>Jf,_undefined:()=>I_,_union:()=>DG,_unknown:()=>A_,_uppercase:()=>Ts,_url:()=>Xc,_uuid:()=>Bf,_uuidv4:()=>Wf,_uuidv6:()=>Hf,_uuidv7:()=>Vf,_void:()=>R_,_xid:()=>Yf,_xor:()=>NG,clone:()=>or,config:()=>wt,createStandardJSONSchemaMethod:()=>js,createToJSONSchemaMethod:()=>W_,decode:()=>t5,decodeAsync:()=>n5,describe:()=>z_,encode:()=>e5,encodeAsync:()=>r5,extractDefs:()=>wi,finalize:()=>xi,flattenError:()=>Lc,formatError:()=>Fc,globalConfig:()=>oo,globalRegistry:()=>Gt,initializeContext:()=>_i,isValidBase64:()=>hb,isValidBase64URL:()=>xO,isValidJWT:()=>SO,locales:()=>Gc,meta:()=>U_,parse:()=>hf,parseAsync:()=>mf,prettifyError:()=>Xy,process:()=>He,regexes:()=>Or,registry:()=>zf,safeDecode:()=>o5,safeDecodeAsync:()=>a5,safeEncode:()=>i5,safeEncodeAsync:()=>s5,safeParse:()=>Jy,safeParseAsync:()=>Yy,toDotPath:()=>tO,toJSONSchema:()=>gd,treeifyError:()=>Ky,util:()=>ae,version:()=>Vv});var XI,qy=Object.freeze({status:"aborted"});function z(e,t,r){function i(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=s.prototype,l=Object.keys(u);for(let f=0;f<l.length;f++){let p=l[f];p in a||(a[p]=u[p].bind(a))}}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function s(a){var c;let u=r?.Parent?new o:this;i(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var jy=Symbol("zod_brand"),Zr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},pi=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(XI=globalThis).__zod_globalConfig??(XI.__zod_globalConfig={});var oo=globalThis.__zod_globalConfig;function wt(e){return e&&Object.assign(oo,e),oo}var ae={};Mn(ae,{BIGINT_FORMAT_RANGES:()=>Zy,Class:()=>Ly,NUMBER_FORMAT_RANGES:()=>Vy,aborted:()=>yi,allowsEval:()=>Uy,assert:()=>RZ,assertEqual:()=>OZ,assertIs:()=>AZ,assertNever:()=>$Z,assertNotEqual:()=>CZ,assignProp:()=>mi,base64ToUint8Array:()=>YI,base64urlToUint8Array:()=>KZ,cached:()=>gs,captureStackTrace:()=>pf,cleanEnum:()=>GZ,cleanRegex:()=>Nc,clone:()=>or,cloneDef:()=>NZ,createTransparentProxy:()=>FZ,defineLazy:()=>Ie,esc:()=>df,escapeRegex:()=>Dr,explicitlyAborted:()=>Gy,extend:()=>BZ,finalizeIssue:()=>sr,floatSafeRemainder:()=>Fy,getElementAtPath:()=>PZ,getEnumValues:()=>Dc,getLengthableOrigin:()=>jc,getParsedType:()=>LZ,getSizableOrigin:()=>qc,hexToUint8Array:()=>JZ,isObject:()=>so,isPlainObject:()=>gi,issue:()=>ys,joinValues:()=>W,jsonStringifyReplacer:()=>ms,merge:()=>HZ,mergeDefs:()=>Ln,normalizeParams:()=>ce,nullish:()=>hi,numKeys:()=>MZ,objectClone:()=>DZ,omit:()=>UZ,optionalKeys:()=>Hy,parsedType:()=>oe,partial:()=>VZ,pick:()=>zZ,prefixIssues:()=>yr,primitiveTypes:()=>Wy,promiseAllObject:()=>qZ,propertyKeyTypes:()=>Pc,randomString:()=>jZ,required:()=>ZZ,safeExtend:()=>WZ,shallowClone:()=>By,slugify:()=>zy,stringifyPrimitive:()=>ie,uint8ArrayToBase64:()=>QI,uint8ArrayToBase64url:()=>XZ,uint8ArrayToHex:()=>YZ,unwrapMessage:()=>Rc});function OZ(e){return e}function CZ(e){return e}function AZ(e){}function $Z(e){throw new Error("Unexpected value in exhaustive check")}function RZ(e){}function Dc(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}function W(e,t="|"){return e.map(r=>ie(r)).join(t)}function ms(e,t){return typeof t=="bigint"?t.toString():t}function gs(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function hi(e){return e==null}function Nc(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Fy(e,t){let r=e/t,i=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}var JI=Symbol("evaluating");function Ie(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==JI)return i===void 0&&(i=JI,i=r()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function DZ(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function mi(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ln(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function NZ(e){return Ln(e._zod.def)}function PZ(e,t){return t?t.reduce((r,i)=>r?.[i],e):e}function qZ(e){let t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n})}function jZ(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function df(e){return JSON.stringify(e)}function zy(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var pf="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function so(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Uy=gs(()=>{if(oo.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function gi(e){if(so(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(so(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function By(e){return gi(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function MZ(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var LZ=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Pc=new Set(["string","number","symbol"]),Wy=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Dr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function or(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}function ce(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function FZ(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,o){return t??(t=e()),Reflect.set(t,i,n,o)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function ie(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Hy(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Vy={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Zy={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zZ(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Ln(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=r.shape[a])}return mi(this,"shape",s),s},checks:[]});return or(e,o)}function UZ(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Ln(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return mi(this,"shape",s),s},checks:[]});return or(e,o)}function BZ(e,t){if(!gi(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Ln(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return mi(this,"shape",o),o}});return or(e,n)}function WZ(e,t){if(!gi(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Ln(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return mi(this,"shape",i),i}});return or(e,r)}function HZ(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=Ln(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return mi(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return or(e,r)}function VZ(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Ln(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return mi(this,"shape",c),c},checks:[]});return or(t,s)}function ZZ(e,t,r){let i=Ln(t._zod.def,{get shape(){let n=t._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new e({type:"nonoptional",innerType:n[s]});return mi(this,"shape",o),o}});return or(t,i)}function yi(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Gy(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function yr(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Rc(e){return typeof e=="string"?e:e?.message}function sr(e,t,r){let i=e.message?e.message:Rc(e.inst?._zod.def?.error?.(e))??Rc(t?.error?.(e))??Rc(r.customError?.(e))??Rc(r.localeError?.(e))??"Invalid input",{inst:n,continue:o,input:s,...a}=e;return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=s),a}function qc(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function jc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function oe(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function ys(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}function GZ(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function YI(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function QI(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function KZ(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return YI(t+r)}function XZ(e){return QI(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function JZ(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}function YZ(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ly=class{constructor(...t){}};var eO=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ms,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Mc=z("$ZodError",eO),vr=z("$ZodError",eO,{Parent:Error});function Lc(e,t=r=>r.message){let r={},i=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function Fc(e,t=r=>r.message){let r={_errors:[]},i=(n,o=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)r._errors.push(t(s));else{let c=r,u=0;for(;u<a.length;){let l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(t(s))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return i(e),r}function Ky(e,t=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var s,a;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},[...o,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...o,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...o,...c.path]);else{let u=[...o,...c.path];if(u.length===0){r.errors.push(t(c));continue}let l=r,f=0;for(;f<u.length;){let p=u[f],d=f===u.length-1;typeof p=="string"?(l.properties??(l.properties={}),(s=l.properties)[p]??(s[p]={errors:[]}),l=l.properties[p]):(l.items??(l.items=[]),(a=l.items)[p]??(a[p]={errors:[]}),l=l.items[p]),d&&l.errors.push(t(c)),f++}}};return i(e),r}function tO(e){let t=[],r=e.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function Xy(e){let t=[],r=[...e.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${tO(i.path)}`);return t.join(`
|
|
273
273
|
`)}var vs=e=>(t,r,i,n)=>{let o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Zr;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map(c=>sr(c,o,wt())));throw pf(a,n?.callee),a}return s.value},hf=vs(vr),bs=e=>async(t,r,i,n)=>{let o=i?{...i,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(n?.Err??e)(s.issues.map(c=>sr(c,o,wt())));throw pf(a,n?.callee),a}return s.value},mf=bs(vr),_s=e=>(t,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new Zr;return o.issues.length?{success:!1,error:new(e??Mc)(o.issues.map(s=>sr(s,n,wt())))}:{success:!0,data:o.value}},Jy=_s(vr),ws=e=>async(t,r,i)=>{let n=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>sr(s,n,wt())))}:{success:!0,data:o.value}},Yy=ws(vr),gf=e=>(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return vs(e)(t,r,n)},e5=gf(vr),yf=e=>(t,r,i)=>vs(e)(t,r,i),t5=yf(vr),vf=e=>async(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return bs(e)(t,r,n)},r5=vf(vr),bf=e=>async(t,r,i)=>bs(e)(t,r,i),n5=bf(vr),_f=e=>(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return _s(e)(t,r,n)},i5=_f(vr),wf=e=>(t,r,i)=>_s(e)(t,r,i),o5=wf(vr),xf=e=>async(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return ws(e)(t,r,n)},s5=xf(vr),Sf=e=>async(t,r,i)=>ws(e)(t,r,i),a5=Sf(vr);var Or={};Mn(Or,{base64:()=>hv,base64url:()=>Ef,bigint:()=>wv,boolean:()=>Sv,browserEmail:()=>m5,cidrv4:()=>dv,cidrv6:()=>pv,cuid:()=>Qy,cuid2:()=>ev,date:()=>yv,datetime:()=>bv,domain:()=>v5,duration:()=>ov,e164:()=>gv,email:()=>av,emoji:()=>cv,extendedDuration:()=>c5,guid:()=>sv,hex:()=>b5,hostname:()=>y5,html5Email:()=>d5,httpProtocol:()=>mv,idnEmail:()=>h5,integer:()=>xv,ipv4:()=>uv,ipv6:()=>lv,ksuid:()=>nv,lowercase:()=>Tv,mac:()=>fv,md5_base64:()=>w5,md5_base64url:()=>x5,md5_hex:()=>_5,nanoid:()=>iv,null:()=>Ev,number:()=>kf,rfc5322Email:()=>p5,sha1_base64:()=>E5,sha1_base64url:()=>k5,sha1_hex:()=>S5,sha256_base64:()=>I5,sha256_base64url:()=>O5,sha256_hex:()=>T5,sha384_base64:()=>A5,sha384_base64url:()=>$5,sha384_hex:()=>C5,sha512_base64:()=>D5,sha512_base64url:()=>N5,sha512_hex:()=>R5,string:()=>_v,time:()=>vv,ulid:()=>tv,undefined:()=>kv,unicodeEmail:()=>rO,uppercase:()=>Iv,uuid:()=>ao,uuid4:()=>u5,uuid6:()=>l5,uuid7:()=>f5,xid:()=>rv});var Qy=/^[cC][0-9a-z]{6,}$/,ev=/^[0-9a-z]+$/,tv=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rv=/^[0-9a-vA-V]{20}$/,nv=/^[A-Za-z0-9]{27}$/,iv=/^[a-zA-Z0-9_-]{21}$/,ov=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,c5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,sv=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ao=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,u5=ao(4),l5=ao(6),f5=ao(7),av=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,d5=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,p5=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,rO=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,h5=rO,m5=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,g5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function cv(){return new RegExp(g5,"u")}var uv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,lv=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,fv=e=>{let t=Dr(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},dv=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,pv=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,hv=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ef=/^[A-Za-z0-9_-]*$/,y5=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,v5=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,mv=/^https?$/,gv=/^\+[1-9]\d{6,14}$/,nO="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",yv=new RegExp(`^${nO}$`);function iO(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function vv(e){return new RegExp(`^${iO(e)}$`)}function bv(e){let t=iO({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${nO}T(?:${i})$`)}var _v=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},wv=/^-?\d+n?$/,xv=/^-?\d+$/,kf=/^-?\d+(?:\.\d+)?$/,Sv=/^(?:true|false)$/i,Ev=/^null$/i;var kv=/^undefined$/i;var Tv=/^[^A-Z]*$/,Iv=/^[^a-z]*$/,b5=/^[0-9a-fA-F]*$/;function zc(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Uc(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var _5=/^[0-9a-fA-F]{32}$/,w5=zc(22,"=="),x5=Uc(22),S5=/^[0-9a-fA-F]{40}$/,E5=zc(27,"="),k5=Uc(27),T5=/^[0-9a-fA-F]{64}$/,I5=zc(43,"="),O5=Uc(43),C5=/^[0-9a-fA-F]{96}$/,A5=zc(64,""),$5=Uc(64),R5=/^[0-9a-fA-F]{128}$/,D5=zc(86,"=="),N5=Uc(86);var tt=z("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),sO={number:"number",bigint:"bigint",object:"date"},Tf=z("$ZodCheckLessThan",(e,t)=>{tt.init(e,t);let r=sO[typeof t.value];e._zod.onattach.push(i=>{let n=i._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),If=z("$ZodCheckGreaterThan",(e,t)=>{tt.init(e,t);let r=sO[typeof t.value];e._zod.onattach.push(i=>{let n=i._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ov=z("$ZodCheckMultipleOf",(e,t)=>{tt.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Fy(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Cv=z("$ZodCheckNumberFormat",(e,t)=>{tt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[n,o]=Vy[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=n,a.maximum=o,r&&(a.pattern=xv)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}a<n&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Av=z("$ZodCheckBigIntFormat",(e,t)=>{tt.init(e,t);let[r,i]=Zy[t.format];e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,o.minimum=r,o.maximum=i}),e._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),$v=z("$ZodCheckMaxSize",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!hi(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let n=i.value;n.size<=t.maximum||i.issues.push({origin:qc(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Rv=z("$ZodCheckMinSize",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!hi(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;n.size>=t.minimum||i.issues.push({origin:qc(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Dv=z("$ZodCheckSizeEquals",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!hi(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=i=>{let n=i.value,o=n.size;if(o===t.size)return;let s=o>t.size;i.issues.push({origin:qc(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Nv=z("$ZodCheckMaxLength",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!hi(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let n=i.value;if(n.length<=t.maximum)return;let s=jc(n);i.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Pv=z("$ZodCheckMinLength",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!hi(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;if(n.length>=t.minimum)return;let s=jc(n);i.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),qv=z("$ZodCheckLengthEquals",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!hi(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=i=>{let n=i.value,o=n.length;if(o===t.length)return;let s=jc(n),a=o>t.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),xs=z("$ZodCheckStringFormat",(e,t)=>{var r,i;tt.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),jv=z("$ZodCheckRegex",(e,t)=>{xs.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Mv=z("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Tv),xs.init(e,t)}),Lv=z("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Iv),xs.init(e,t)}),Fv=z("$ZodCheckIncludes",(e,t)=>{tt.init(e,t);let r=Dr(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),zv=z("$ZodCheckStartsWith",(e,t)=>{tt.init(e,t);let r=new RegExp(`^${Dr(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Uv=z("$ZodCheckEndsWith",(e,t)=>{tt.init(e,t);let r=new RegExp(`.*${Dr(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function oO(e,t,r){e.issues.length&&t.issues.push(...yr(r,e.issues))}var Bv=z("$ZodCheckProperty",(e,t)=>{tt.init(e,t),e._zod.check=r=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>oO(n,r,t.property));oO(i,r,t.property)}}),Wv=z("$ZodCheckMimeType",(e,t)=>{tt.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),Hv=z("$ZodCheckOverwrite",(e,t)=>{tt.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Bc=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
|
|
274
274
|
`).filter(s=>s),n=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...r,n.join(`
|
|
275
275
|
`))}};var Vv={major:4,minor:4,patch:3};var we=z("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Vv;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let n of i)for(let o of n._zod.onattach)o(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(s,a,c)=>{let u=yi(s),l;for(let f of a){if(f._zod.def.when){if(Gy(s)||!f._zod.def.when(s))continue}else if(u)continue;let p=s.issues.length,d=f._zod.check(s);if(d instanceof Promise&&c?.async===!1)throw new Zr;if(l||d instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await d,s.issues.length!==p&&(u||(u=yi(s,p)))});else{if(s.issues.length===p)continue;u||(u=yi(s,p))}}return l?l.then(()=>s):s},o=(s,a,c)=>{if(yi(s))return s.aborted=!0,s;let u=n(a,i,c);if(u instanceof Promise){if(c.async===!1)throw new Zr;return u.then(l=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){let u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>o(l,s,a)):o(u,s,a)}let c=e._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new Zr;return c.then(u=>n(u,i,a))}return n(c,i,a)}}Ie(e,"~standard",()=>({validate:n=>{try{let o=Jy(e,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Yy(e,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),co=z("$ZodString",(e,t)=>{we.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_v(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ye=z("$ZodStringFormat",(e,t)=>{xs.init(e,t),co.init(e,t)}),Gv=z("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=sv),Ye.init(e,t)}),Kv=z("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ao(i))}else t.pattern??(t.pattern=ao());Ye.init(e,t)}),Xv=z("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=av),Ye.init(e,t)}),Jv=z("$ZodURL",(e,t)=>{Ye.init(e,t),e._zod.check=r=>{try{let i=r.value.trim();if(!t.normalize&&t.protocol?.source===mv.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Yv=z("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=cv()),Ye.init(e,t)}),Qv=z("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=iv),Ye.init(e,t)}),eb=z("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Qy),Ye.init(e,t)}),tb=z("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ev),Ye.init(e,t)}),rb=z("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tv),Ye.init(e,t)}),nb=z("$ZodXID",(e,t)=>{t.pattern??(t.pattern=rv),Ye.init(e,t)}),ib=z("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=nv),Ye.init(e,t)}),ob=z("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=bv(t)),Ye.init(e,t)}),sb=z("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=yv),Ye.init(e,t)}),ab=z("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=vv(t)),Ye.init(e,t)}),cb=z("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ov),Ye.init(e,t)}),ub=z("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=uv),Ye.init(e,t),e._zod.bag.format="ipv4"}),lb=z("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=lv),Ye.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),fb=z("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=fv(t.delimiter)),Ye.init(e,t),e._zod.bag.format="mac"}),db=z("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=dv),Ye.init(e,t)}),pb=z("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=pv),Ye.init(e,t),e._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[n,o]=i;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function hb(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var mb=z("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=hv),Ye.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{hb(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function xO(e){if(!Ef.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return hb(r)}var gb=z("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ef),Ye.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{xO(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),yb=z("$ZodE164",(e,t)=>{t.pattern??(t.pattern=gv),Ye.init(e,t)});function SO(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var vb=z("$ZodJWT",(e,t)=>{Ye.init(e,t),e._zod.check=r=>{SO(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),bb=z("$ZodCustomStringFormat",(e,t)=>{Ye.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Rf=z("$ZodNumber",(e,t)=>{we.init(e,t),e._zod.pattern=e._zod.bag.pattern??kf,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),r}}),_b=z("$ZodNumberFormat",(e,t)=>{Cv.init(e,t),Rf.init(e,t)}),Wc=z("$ZodBoolean",(e,t)=>{we.init(e,t),e._zod.pattern=Sv,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Df=z("$ZodBigInt",(e,t)=>{we.init(e,t),e._zod.pattern=wv,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),wb=z("$ZodBigIntFormat",(e,t)=>{Av.init(e,t),Df.init(e,t)}),xb=z("$ZodSymbol",(e,t)=>{we.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Sb=z("$ZodUndefined",(e,t)=>{we.init(e,t),e._zod.pattern=kv,e._zod.values=new Set([void 0]),e._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Eb=z("$ZodNull",(e,t)=>{we.init(e,t),e._zod.pattern=Ev,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),kb=z("$ZodAny",(e,t)=>{we.init(e,t),e._zod.parse=r=>r}),Tb=z("$ZodUnknown",(e,t)=>{we.init(e,t),e._zod.parse=r=>r}),Ib=z("$ZodNever",(e,t)=>{we.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Ob=z("$ZodVoid",(e,t)=>{we.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Cb=z("$ZodDate",(e,t)=>{we.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),r}});function cO(e,t,r){e.issues.length&&t.issues.push(...yr(r,e.issues)),t.value[r]=e.value}var Ab=z("$ZodArray",(e,t)=>{we.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let o=[];for(let s=0;s<n.length;s++){let a=n[s],c=t.element._zod.run({value:a,issues:[]},i);c instanceof Promise?o.push(c.then(u=>cO(u,r,s))):cO(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function $f(e,t,r,i,n,o){let s=r in i;if(e.issues.length){if(n&&o&&!s)return;t.issues.push(...yr(r,e.issues))}if(!s&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?s&&(t.value[r]=void 0):t.value[r]=e.value}function EO(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=Hy(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function kO(e,t,r,i,n,o){let s=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optin==="optional",f=c.optout==="optional";for(let p in t){if(p==="__proto__"||a.has(p))continue;if(u==="never"){s.push(p);continue}let d=c.run({value:t[p],issues:[]},i);d instanceof Promise?e.push(d.then(h=>$f(h,r,p,t,l,f))):$f(d,r,p,t,l,f)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}var TO=z("$ZodObject",(e,t)=>{if(we.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}let i=gs(()=>EO(t));Ie(e._zod,"propValues",()=>{let a=t.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let f of l.values)c[u].add(f)}}return c});let n=so,o=t.catchall,s;e._zod.parse=(a,c)=>{s??(s=i.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let l=[],f=s.shape;for(let p of s.keys){let d=f[p],h=d._zod.optin==="optional",m=d._zod.optout==="optional",_=d._zod.run({value:u[p],issues:[]},c);_ instanceof Promise?l.push(_.then(k=>$f(k,a,p,u,h,m))):$f(_,a,p,u,h,m)}return o?kO(l,u,a,c,i.value,e):l.length?Promise.all(l).then(()=>a):a}}),$b=z("$ZodObjectJIT",(e,t)=>{TO.init(e,t);let r=e._zod.parse,i=gs(()=>EO(t)),n=p=>{let d=new Bc(["shape","payload","ctx"]),h=i.value,m=v=>{let g=df(v);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};d.write("const input = payload.value;");let _=Object.create(null),k=0;for(let v of h.keys)_[v]=`key_${k++}`;d.write("const newResult = {};");for(let v of h.keys){let g=_[v],y=df(v),T=p[v],R=T?._zod?.optin==="optional",I=T?._zod?.optout==="optional";d.write(`const ${g} = ${m(v)};`),R&&I?d.write(`
|
|
@@ -588,13 +588,13 @@ ${bM}`}async function yie(e){let t=Tt.join(e,"AGENTS.md"),r="";try{r=await Dt.re
|
|
|
588
588
|
WHERE status = 'awaiting_ack' AND sent_at <= ?`).all(t),n=this.db.prepare(`SELECT delivery_id, logical_key, attempt_count, sent_at, content_json
|
|
589
589
|
FROM event_outbox
|
|
590
590
|
WHERE status = 'awaiting_ack' AND sent_at <= ?`).all(t),o=i.map(c=>{let u=JSON.parse(c.context_json),l=JSON.parse(c.payload_json),f={kind:"chat",deliveryId:c.delivery_id,logicalKey:c.logical_key,requestId:c.request_id,attemptCount:c.attempt_count,sentAt:c.sent_at,messageId:u.messageId,sessionId:u.sessionId};return typeof l.state=="string"&&(f.payloadKind=l.state),f}),s=n.map(c=>{let u=JSON.parse(c.content_json),l={kind:"event",deliveryId:c.delivery_id,logicalKey:c.logical_key,attemptCount:c.attempt_count,sentAt:c.sent_at};return typeof u.event_type=="string"&&(l.payloadKind=u.event_type),l}),a=[...o,...s];return{deadCandidates:a.filter(c=>c.attemptCount>=r),requeueCandidates:a.filter(c=>c.attemptCount<r)}}requeueAwaitingDeliveries(t=Number.MAX_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){let i=0,n=0;for(let o of["delivery_outbox","event_outbox"]){let s=this.db.prepare(`UPDATE ${o} SET status = 'dead', last_error = 'delivery acknowledgement timed out', updated_at = ? WHERE status = 'awaiting_ack' AND sent_at <= ? AND attempt_count >= ?`).run(Date.now(),t,r),a=this.db.prepare(`UPDATE ${o} SET status = 'pending', last_error = 'delivery acknowledgement timed out', updated_at = ? WHERE status = 'awaiting_ack' AND sent_at <= ? AND attempt_count < ?`).run(Date.now(),t,r);n+=Number(s.changes),i+=Number(a.changes)}return{requeued:i,dead:n}}listProcessingRequests(){return this.listRunningRequests()}parseDelivery(t){return{deliveryId:t.delivery_id,requestId:t.request_id,accountId:t.account_id,logicalKey:t.logical_key,context:JSON.parse(t.context_json),payload:JSON.parse(t.payload_json),attemptCount:t.attempt_count}}parseEventDelivery(t){return{deliveryId:t.delivery_id,logicalKey:t.logical_key,content:JSON.parse(t.content_json),attemptCount:t.attempt_count}}};import{createHash as use,randomUUID as lse}from"node:crypto";var rse=Vr(AL(),1),nse=Vr(Oh(),1),ise=Vr(Da(),1),ose=Vr($E(),1),sse=Vr(NE(),1),ase=Vr(FE(),1),LL=Vr(Rh(),1),cse=Vr(ML(),1);var Nt=LL.default;var UE=3e4,FL=65e3,fse=15e3,dse=60,Nh=15e3,pse=512*1024,hse=50,BE=1e3,hl=10,Ph=15e3,mse=4*1024*1024,ml="openclaw_bot_event with content.event_type=delivery, content.operation_type=ack, content.delivery_id=<id>";function gse(e,t,r){let i=Math.min(r,t*2**Math.min(e,8));return i+Math.floor(Math.random()*Math.max(1,Math.min(1e3,i/5)))}var qh=class{config;store;logger;onChat;onSkill;onState;onEvent;socket;reconnectTimer;businessHeartbeatTimer;businessHeartbeatAckTimer;transportHeartbeatTimer;flushRetryTimer;ackRetryTimer;flushPromise;flushRequested=!1;stopped=!0;reconnectAttempt=0;pongPending=!1;businessHeartbeatSentCount=0;businessHeartbeatAckCount=0;lastBusinessHeartbeatSentAt;lastBusinessHeartbeatAckAt;constructor(t,r,i,n,o=async()=>{},s=()=>{},a=async()=>{}){this.config=t,this.store=r,this.logger=i,this.onChat=n,this.onSkill=o,this.onState=s,this.onEvent=a}start(){if(!this.stopped)throw new Error("mbh-chat socket already started");this.stopped=!1,this.connect()}async stop(){this.stopped=!0,this.onState("stopped"),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.stopHeartbeat(),this.flushRetryTimer&&clearTimeout(this.flushRetryTimer),this.ackRetryTimer&&clearTimeout(this.ackRetryTimer),this.reconnectTimer=void 0,this.flushRetryTimer=void 0,this.ackRetryTimer=void 0,this.flushRequested=!1;let t=this.socket;this.socket=void 0,t&&(t.readyState===Nt.OPEN||t.readyState===Nt.CONNECTING)&&await new Promise(r=>{let i=()=>r();t.once("close",i),t.close(1e3,"bridge stopped"),setTimeout(i,2e3).unref()})}enqueue(t,r,i){let n=this.store.enqueueDelivery(t,r,i);return this.triggerFlush(),n}enqueueTerminal(t,r,i,n,o){let s=r.message_tags&&typeof r.message_tags=="object"&&!Array.isArray(r.message_tags)?r.message_tags:{},a=r.state==="final"?{...r,message_tags:{...s,isFinal:1}}:r,c=this.store.completeRequestWithDelivery(t,a,i,n,o);return this.triggerFlush(),c}enqueueEvent(t,r){try{return this.enqueueManagementEvent({...r,domain_id:this.config.domainId,app_id:this.config.appId,bot_id:t.botId,agent_id:t.agentId,session_id:t.sessionId,user_id:t.userId}),!0}catch(i){return this.logger.warn("mbh-chat event could not be persisted",{error:te(i),sessionId:t.sessionId}),!1}}flush(){return this.flushPromise?(this.flushRequested=!0,this.flushPromise):(this.flushRequested=!1,this.flushPromise=this.flushPending().finally(()=>{this.flushPromise=void 0,this.flushRequested&&!this.stopped&&this.socket?.readyState===Nt.OPEN&&(this.flushRequested=!1,queueMicrotask(()=>this.triggerFlush()))}),this.flushPromise)}async sendEvent(t){try{return this.enqueueManagementEvent(t),await this.flush(),!0}catch(r){return this.logger.error("mbh-chat management feedback could not be persisted",{error:te(r)}),!1}}connect(){if(this.stopped)return;this.onState("connecting"),this.logger.info("connecting to mbh-chat",{endpoint:this.config.wsUrl});let t=new Nt(this.config.wsUrl,{maxPayload:mse});this.socket=t,t.on("open",()=>{if(!(this.socket!==t||this.stopped)){if(this.reconnectAttempt=0,this.logger.info("connected to mbh-chat"),this.config.deliveryAckMode==="business"){let r=this.store.requeueAwaitingDeliveries();(r.requeued>0||r.dead>0)&&this.logger.info("restored unacknowledged mbh-chat deliveries",r)}else{let r=this.store.finalizeAwaitingDeliveries();r>0&&this.logger.info("finalized legacy awaiting-ack mbh-chat deliveries in transport mode",{count:r})}this.onState("awaiting-heartbeat"),this.startHeartbeat(),this.triggerFlush()}}),t.on("pong",()=>{this.socket===t&&(this.pongPending=!1)}),t.on("message",(r,i)=>{if(i){this.logger.warn("ignoring binary mbh-chat frame");return}try{let n=RM(r.toString());if("kind"in n){if(n.kind==="heartbeat"){this.acknowledgeBusinessHeartbeat(t),this.onState("connected");return}if(n.kind==="skill"){let o=n.content.operation_type;if(!["install","enable","update","remove","disable"].includes(o)){this.logger.error("unsupported mbh-chat skill operation",{operationType:o,bytes:Buffer.byteLength(r.toString())}),this.sendEvent({...n.content,status:"fail",error:`unsupported skill operation: ${o}`});return}this.onSkill(n).catch(s=>{this.logger.error("inbound mbh-chat skill handler failed",{error:te(s)})});return}if(n.kind==="event"){let o=AM(n);if(o){for(let s of o)this.store.acknowledgeDelivery(s)||this.logger.warn("ignored unknown mbh-chat delivery acknowledgement",{deliveryId:s,expectedAck:ml});return}this.onEvent(n).catch(s=>{this.logger.error("inbound mbh-chat event handler failed",{error:te(s)})});return}n.kind==="ignored"&&this.logger.warn("ignoring unsupported mbh-chat event",{messageType:n.messageType});return}this.onChat(n).catch(o=>{this.logger.error("inbound mbh-chat handler failed",{error:te(o)}),this.replyToFailedChat(n,"bridge_error","\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")})}catch(n){if(n instanceof ol&&n.reply){this.logger.warn("invalid mbh-chat chat frame; returning terminal feedback",{error:n.message,messageId:n.reply.content.message_id}),this.replyToFailedChat(n.reply,"invalid_input",n.userMessage);return}this.logger.warn("invalid mbh-chat frame",{error:te(n)})}}),t.on("error",r=>{this.onState("error"),this.logger.warn("mbh-chat WebSocket error",{error:r.message})}),t.on("close",(r,i)=>{if(this.socket===t&&(this.socket=void 0,this.config.deliveryAckMode==="business"&&this.store.requeueAwaitingDeliveries(),this.stopHeartbeat(),this.onState("disconnected"),this.logger.warn("mbh-chat disconnected",{code:r,reason:i.toString()}),!this.stopped)){let n=gse(this.reconnectAttempt++,this.config.reconnectMinMs,this.config.reconnectMaxMs);this.logger.info("reconnecting to mbh-chat",{delayMs:n,attempt:this.reconnectAttempt}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=void 0,this.connect()},n)}})}startHeartbeat(){this.stopHeartbeat(),this.pongPending=!1,this.businessHeartbeatSentCount=0,this.businessHeartbeatAckCount=0,this.lastBusinessHeartbeatSentAt=void 0,this.lastBusinessHeartbeatAckAt=void 0,this.sendHeartbeat({first:!0}),this.businessHeartbeatTimer=setInterval(()=>{this.sendHeartbeat()},UE),this.transportHeartbeatTimer=setInterval(()=>{let t=this.socket;if(t?.readyState===Nt.OPEN){if(this.pongPending){this.logger.warn("mbh-chat heartbeat pong timeout; terminating stale connection"),t.terminate();return}this.pongPending=!0;try{t.ping()}catch(r){this.pongPending=!1,this.logger.warn("mbh-chat heartbeat ping threw",{error:te(r)}),t.terminate()}}},fse)}stopHeartbeat(){this.businessHeartbeatTimer&&clearInterval(this.businessHeartbeatTimer),this.businessHeartbeatAckTimer&&clearTimeout(this.businessHeartbeatAckTimer),this.transportHeartbeatTimer&&clearInterval(this.transportHeartbeatTimer),this.businessHeartbeatTimer=void 0,this.businessHeartbeatAckTimer=void 0,this.transportHeartbeatTimer=void 0,this.pongPending=!1}armBusinessHeartbeatAckTimeout(t){this.businessHeartbeatAckTimer&&clearTimeout(this.businessHeartbeatAckTimer),this.businessHeartbeatAckTimer=setTimeout(()=>{if(this.businessHeartbeatAckTimer=void 0,this.socket!==t||t.readyState!==Nt.OPEN)return;let r=Date.now();this.logger.warn("mbh-chat business heartbeat acknowledgement timeout; terminating stale connection",{timeoutMs:FL,lastSentAgoMs:this.lastBusinessHeartbeatSentAt===void 0?void 0:r-this.lastBusinessHeartbeatSentAt,lastAckAgoMs:this.lastBusinessHeartbeatAckAt===void 0?void 0:r-this.lastBusinessHeartbeatAckAt,bufferedAmount:t.bufferedAmount}),t.terminate()},FL),this.businessHeartbeatAckTimer.unref()}acknowledgeBusinessHeartbeat(t){if(this.socket!==t)return;let r=Date.now();this.lastBusinessHeartbeatAckAt=r,this.businessHeartbeatAckCount+=1,this.armBusinessHeartbeatAckTimeout(t),(this.businessHeartbeatAckCount===1||this.businessHeartbeatAckCount%dse===0)&&this.logger.info("mbh-chat business heartbeat acknowledged",{acknowledgement:this.businessHeartbeatAckCount,lastSendLatencyMs:this.lastBusinessHeartbeatSentAt===void 0?void 0:r-this.lastBusinessHeartbeatSentAt})}sendHeartbeat(t){let r=this.socket;if(r?.readyState!==Nt.OPEN)return;let i=Date.now(),n=this.lastBusinessHeartbeatSentAt,o=n===void 0?0:Math.max(0,i-n-UE);this.lastBusinessHeartbeatSentAt=i,this.businessHeartbeatSentCount+=1;let s=this.businessHeartbeatSentCount;this.businessHeartbeatAckTimer||this.armBusinessHeartbeatAckTimeout(r),o>=UE/2&&this.logger.warn("mbh-chat business heartbeat timer delayed",{heartbeat:s,driftMs:o,bufferedAmount:r.bufferedAmount});try{r.send(JSON.stringify({messageType:"openclaw_bot_heartbeat",_userId:Number(this.config.userId)||0,source:"client",content:{bot_token:this.config.botToken,status:"1"}}),a=>{if(a){this.logger.warn("mbh-chat heartbeat send failed; terminating connection",{error:a.message}),this.socket===r&&r.readyState===Nt.OPEN&&r.terminate();return}t?.first&&this.logger.info("mbh-chat first heartbeat sent",{heartbeat:s,bufferedAmount:r.bufferedAmount})})}catch(a){this.logger.warn("mbh-chat heartbeat send threw; terminating connection",{error:te(a)}),this.socket===r&&r.readyState===Nt.OPEN&&r.terminate()}}replyToFailedChat(t,r,i){let n=Qn(this.config.accountId,t.content.message_id.trim());try{let o=vh(t,this.config.accountId,n,this.config);this.enqueueTerminal(o,{response:i,state:"final",final_tag:r,is_finish:1},"final","failed",r)}catch(o){this.logger.error("could not persist mbh-chat failure feedback",{requestId:n,tag:r,error:te(o)})}}async flushPending(){let t=0;for(;;){let r=this.socket;if(r?.readyState!==Nt.OPEN)return t;if(r.bufferedAmount>pse)return this.scheduleFlush(hse),t;let i=this.store.listPendingDeliveries(200),n=this.store.listPendingEventDeliveries(200);if(i.length===0&&n.length===0)return t;let o=0;for(let s of i){if(this.socket!==r||r.readyState!==Nt.OPEN)return t;s.attemptCount>=1&&this.config.deliveryAckMode==="business"&&this.logger.warn("mbh-chat resending chat delivery without business acknowledgement",{attempt:s.attemptCount+1,expectedAck:ml}),this.store.markDeliveryAttempt(s.deliveryId);try{await this.sendDelivery(r,s),this.config.deliveryAckMode==="business"?(this.store.markDeliverySent(s.deliveryId),this.scheduleAcknowledgementRetry()):this.store.markDeliveryDelivered(s.deliveryId),t+=1,o+=1}catch(a){let c=this.store.markDeliveryFailed(s.deliveryId,te(a),hl);if(this.logger.warn(c?"mbh-chat delivery moved to dead letter":"mbh-chat delivery remains pending",{deliveryId:s.deliveryId,attemptCount:s.attemptCount+1,error:te(a)}),c)continue;return this.scheduleFlush(BE),t}}for(let s of n){if(this.socket!==r||r.readyState!==Nt.OPEN)return t;s.attemptCount>=1&&this.config.deliveryAckMode==="business"&&this.logger.warn("mbh-chat resending event delivery without business acknowledgement",{...this.deliveryDiagnosticFields(s),attempt:s.attemptCount+1,expectedAck:ml}),this.store.markDeliveryAttempt(s.deliveryId,!0);try{await this.sendEventDelivery(r,s),this.config.deliveryAckMode==="business"?(this.store.markDeliverySent(s.deliveryId,!0),this.scheduleAcknowledgementRetry()):this.store.markDeliveryDelivered(s.deliveryId,!0),t+=1,o+=1}catch(a){let c=this.store.markDeliveryFailed(s.deliveryId,te(a),hl,!0);if(this.logger.warn(c?"mbh-chat event delivery moved to dead letter":"mbh-chat event delivery remains pending",{deliveryId:s.deliveryId,attemptCount:s.attemptCount+1,error:te(a)}),c)continue;return this.scheduleFlush(BE),t}}if(o===0)return t}}scheduleFlush(t){this.stopped||this.flushRetryTimer||(this.flushRetryTimer=setTimeout(()=>{this.flushRetryTimer=void 0,this.triggerFlush()},t),this.flushRetryTimer.unref())}triggerFlush(){if(!this.stopped){if(this.flushPromise){this.flushRequested=!0;return}this.flush().catch(t=>{this.logger.error("mbh-chat Outbox flush failed",{error:te(t)}),this.scheduleFlush(BE)})}}scheduleAcknowledgementRetry(){this.config.deliveryAckMode!=="business"||this.stopped||this.ackRetryTimer||(this.ackRetryTimer=setTimeout(()=>{this.ackRetryTimer=void 0;let t=Date.now()-Ph,r=this.store.listExpiredAwaitingDeliveries(t,hl),i=this.store.requeueAwaitingDeliveries(t,hl);i.dead>0&&this.logger.error("mbh-chat deliveries exhausted acknowledgement retries",{count:i.dead,ackTimeoutMs:Ph,maxAttempts:hl,expectedAck:ml,deliveries:this.deliveryDiagnosticFieldsList(r.deadCandidates)}),i.requeued>0?(this.logger.warn("mbh-chat delivery acknowledgement timed out; will resend",{count:i.requeued,ackTimeoutMs:Ph,expectedAck:ml,deliveries:this.deliveryDiagnosticFieldsList(r.requeueCandidates)}),this.triggerFlush()):this.store.countAwaitingDeliveries()>0&&this.scheduleAcknowledgementRetry()},Ph),this.ackRetryTimer.unref())}deliveryDiagnosticFields(t){return"requestId"in t?{kind:"chat",deliveryId:t.deliveryId,logicalKey:t.logicalKey,requestId:t.requestId,attemptCount:t.attemptCount,payloadState:t.payload.state,messageId:t.context.messageId,sessionId:t.context.sessionId}:{kind:"event",deliveryId:t.deliveryId,logicalKey:t.logicalKey,attemptCount:t.attemptCount,eventType:typeof t.content.event_type=="string"?t.content.event_type:void 0}}deliveryDiagnosticFieldsList(t,r=20){return t.slice(0,r).map(i=>({kind:i.kind,deliveryId:i.deliveryId,logicalKey:i.logicalKey,requestId:i.requestId,attemptCount:i.attemptCount,payloadKind:i.payloadKind,messageId:i.messageId,sessionId:i.sessionId,sentAt:i.sentAt}))}enqueueManagementEvent(t){let r={...t};for(let s of["bot_token","token","authorization"])delete r[s];let i=typeof r.websocket_trace_id=="string"?r.websocket_trace_id.trim():"",n=i?`event:${use("sha256").update(`${String(r.event_type??"")}\0${String(r.operation_type??"")}\0${i}\0${String(r.status??"")}`).digest("hex")}`:`event:${lse()}`,o=this.store.enqueueEventDelivery(r,n);return this.triggerFlush(),o}sendDelivery(t,r){let i=r.context,n={...r.payload,bot_token:this.config.botToken,domain_id:this.config.domainId,app_id:this.config.appId,bot_id:i.botId,agent_id:i.agentId,session_id:i.sessionId,message_id:i.messageId,delivery_id:r.deliveryId,idempotency_key:r.deliveryId,request_id:r.requestId},o=JSON.stringify({messageType:"openclaw_bot_chat",_userId:i.userId,source:"client",content:JSON.stringify(n)});return new Promise((s,a)=>{let c=!1,u=f=>{c||(c=!0,clearTimeout(l),f?a(f):s())},l=setTimeout(()=>u(new Error(`send callback timed out after ${Nh}ms`)),Nh);try{t.send(o,f=>u(f))}catch(f){u(f instanceof Error?f:new Error(String(f)))}})}sendEventDelivery(t,r){let i=JSON.stringify({messageType:"openclaw_bot_event",_userId:Number(r.content.user_id)||Number(this.config.userId)||0,source:"client",content:{bot_token:this.config.botToken,...r.content,domain_id:this.config.domainId,app_id:this.config.appId,delivery_id:r.deliveryId,idempotency_key:r.deliveryId}});return new Promise((n,o)=>{let s=!1,a=u=>{s||(s=!0,clearTimeout(c),u?o(u):n())},c=setTimeout(()=>a(new Error(`send callback timed out after ${Nh}ms`)),Nh);try{t.send(i,u=>a(u))}catch(u){a(u instanceof Error?u:new Error(String(u)))}})}};var zL="MBHCHAT_DSH_SESSION_COOKIE",yse=/^dsh-auth-[A-Za-z0-9_-]+=[A-Za-z0-9._-]+$/u;function jh(e=process.env){let t=e[zL]?.trim();if(t){if(!yse.test(t))throw new Error(`${zL} is not a valid DSH authentication cookie`);return t}}function wn(e,t={}){return e?{...t,cookie:e}:{...t}}var La="dsh/cron.list",Bi="/api/cron-automations",UL="mbh-chat";function gl(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}function vse(e){if(!Nr(e)||e.status==="deleted")return;let t=e;return{id:t.id,name:t.name,description:t.prompt,enabled:t.status==="active"||t.status==="dispatching",createdAtMs:Date.parse(t.createdAt),updatedAtMs:Date.parse(t.updatedAt),schedule:{kind:"cron",expr:t.cron,tz:t.timezone},payload:{kind:"agentTurn",message:t.prompt,timeoutSeconds:600},agentId:t.agentId,sessionTarget:"isolated",wakeMode:"now",delivery:{mode:"announce",bestEffort:!0},state:{nextRunAtMs:Date.parse(t.nextRunAt),...t.lastRunAt?{lastRunAtMs:Date.parse(t.lastRunAt)}:{}}}}function bse(e){return Nr(e)&&typeof e.id=="string"&&typeof e.name=="string"&&typeof e.agentId=="string"&&typeof e.enabled=="boolean"&&gl(e.createdAtMs)&&gl(e.updatedAtMs)&&Nr(e.schedule)&&typeof e.schedule.kind=="string"&&Nr(e.payload)&&typeof e.payload.kind=="string"&&Nr(e.state)&&(e.state.nextRunAtMs===void 0||gl(e.state.nextRunAtMs))&&(e.state.runningAtMs===void 0||gl(e.state.runningAtMs))&&(e.state.lastRunAtMs===void 0||gl(e.state.lastRunAtMs))}function yl(e){if(!Nr(e)||e.type!==La||e.version!==1)throw new Error("cron list snapshot must be a dsh/cron.list document");let t=Array.isArray(e.jobs)?e.jobs:Array.isArray(e.crons)?e.crons.map(vse).filter(i=>i!==void 0):void 0;if(!t)throw new Error("cron list snapshot must contain jobs");let r=t.filter(bse);return{type:La,version:1,sequence:typeof e.sequence=="number"?e.sequence:0,generatedAt:typeof e.generatedAt=="string"?e.generatedAt:new Date().toISOString(),reason:typeof e.reason=="string"?e.reason:"unknown",jobs:r,invalidJobCount:t.length-r.length}}function Fa(e){let t=e.split(":").filter(i=>i.length>0),r=t.map(i=>i.toLowerCase());return t.length>=6&&r[0]==="agent"&&r[2]==="mobook"&&r[3]==="direct"?{agentId:t[4]??"",sessionId:t[5]??""}:{agentId:t.at(-2)??"",sessionId:t.at(-1)??""}}function Lo(e){let t=e.split(":").filter(i=>i.length>0),r=t.map(i=>i.toLowerCase());return t.length>=6&&r[0]==="agent"&&r[2]==="mobook"&&r[3]==="direct"}function WE(e,t){return{version:1,jobs:e.flatMap(r=>{let i=(r.sessionKey??t(r))?.trim();if(!i||!Lo(i))return[];let n=Fa(i),{dshSessionId:o,...s}=r;return[{...s,description:r.description??(typeof r.payload.message=="string"?r.payload.message:""),sessionKey:i,sessionTarget:r.payload.kind==="systemEvent"?"main":"isolated",wakeMode:"now",delivery:{...r.delivery,mode:"announce",to:`dcg-cron:${i}`,channel:UL,bestEffort:!0,...n.agentId?{accountId:n.agentId}:{}}}]})}}function _se(e){let t=[],r=e;for(;;){let i=/\r?\n\r?\n/.exec(r);if(!i||i.index<0)return{events:t,rest:r};let n=r.slice(0,i.index);r=r.slice(i.index+i[0].length);let o="message",s=[];for(let a of n.split(/\r?\n/))a.startsWith("event:")?o=a.slice(6).trim():a.startsWith("data:")&&s.push(a.slice(5).trimStart());s.length>0&&t.push({event:o,data:s.join(`
|
|
591
|
-
`)})}}var vl=class{baseUrl;fetchImpl;sessionCookie;constructor(t,r=fetch,i=jh()){this.baseUrl=t,this.fetchImpl=r,this.sessionCookie=i}url(t){return new URL(t,this.baseUrl.endsWith("/")?this.baseUrl:`${this.baseUrl}/`)}async patch(t,r){return(await this.fetchImpl(this.url(`${Bi}/${encodeURIComponent(t)}`),{method:"PATCH",headers:wn(this.sessionCookie,{"content-type":"application/json"}),body:JSON.stringify(r),signal:AbortSignal.timeout(15e3)})).ok}async patchJob(t,r){let i=await this.fetchImpl(this.url(`${Bi}/${encodeURIComponent(t)}`),{method:"PATCH",headers:wn(this.sessionCookie,{"content-type":"application/json"}),body:JSON.stringify(r),signal:AbortSignal.timeout(15e3)});if(!i.ok)return;let n=await i.json().catch(()=>{});return yl({type:La,version:1,jobs:[n]}).jobs.find(o=>o.id===t)}setEnabled(t,r){return this.patch(t,{enabled:r})}async delete(t){let r=await this.fetchImpl(this.url(`${Bi}/${encodeURIComponent(t)}`),{method:"DELETE",headers:wn(this.sessionCookie),signal:AbortSignal.timeout(15e3)});return r.ok?"deleted":r.status===404?"not_found":"failed"}async runOnce(t){let r=await this.fetchImpl(this.url(`${Bi}/${encodeURIComponent(t)}/run`),{method:"POST",headers:wn(this.sessionCookie),signal:AbortSignal.timeout(15e3)}),i=await r.json().catch(()=>{}),n=Nr(i)&&typeof i.status=="string"?i.status:void 0;return n==="dispatched"||n==="not_found"||n==="already_running"||n==="delivery_unavailable"?n:r.status===404?"not_found":r.status===202?"already_running":r.ok&&Nr(i)&&i.delivered===!0?"dispatched":"delivery_unavailable"}async list(){let t=await this.fetchImpl(this.url(`${Bi}`),{method:"GET",headers:wn(this.sessionCookie),signal:AbortSignal.timeout(15e3)});if(!t.ok)return;let r=await t.json().catch(()=>{});if(!(!Nr(r)||!Array.isArray(r.jobs)))return yl({type:La,version:1,sequence:0,generatedAt:new Date().toISOString(),reason:"fetch",jobs:r.jobs})}async subscribe(t,r,i=()=>{}){let n=await this.fetchImpl(this.url(`${Bi}/events`),{method:"GET",headers:wn(this.sessionCookie,{accept:"text/event-stream"}),signal:r});if(!n.ok||!n.body)throw new Error(`cron SSE failed with HTTP ${n.status}`);let o=n.body.getReader(),s=new TextDecoder,a="";for(;;){let{value:c,done:u}=await o.read();if(u){if(!r.aborted)throw new Error("cron SSE stream ended");return}a+=s.decode(c,{stream:!0});let{events:l,rest:f}=_se(a);a=f;for(let p of l)if(p.event==="cron-list")try{t(yl(JSON.parse(p.data)))}catch(d){i(d)}}}};var wse=100,xse=1e3,Sse=3e4;function HE(e){let{updatedAtMs:t,state:r,...i}=e;return JSON.stringify(i,(n,o)=>o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).sort(([s],[a])=>s.localeCompare(a))):o)}function Ese(e,t){return new Promise(r=>{if(e.aborted){r();return}let i=()=>{clearTimeout(n),e.removeEventListener("abort",i),r()},n=setTimeout(i,t);n.unref(),e.addEventListener("abort",i,{once:!0})})}var Mh=class{options;client;abort;loop;debounce;publishTail=Promise.resolve();lastFingerprint;lastSnapshot;lastJobs=new Map;lastContexts=new Map;constructor(t){this.options=t,this.client=new vl(t.dshBaseUrl,t.fetchImpl)}start(){this.loop||(this.abort=new AbortController,this.loop=this.run(this.abort.signal))}async stop(){this.abort?.abort(),this.debounce&&clearTimeout(this.debounce),this.debounce=void 0,await this.loop?.catch(()=>{}),await this.publishTail,this.loop=void 0,this.abort=void 0}async applyControl(t,r){if(t==="remove"){let o=await this.client.delete(r);return{applied:o!=="failed",...o==="not_found"?{reconciled:!0}:{}}}if(t==="enable")return{applied:await this.client.setEnabled(r,!0)};if(t==="disable")return{applied:await this.client.setEnabled(r,!1)};let i=await this.ensureSessionForCron(r);if(i)return{applied:!1,runStatus:i};await this.ensureSessionFollowed(r);let n=await this.client.runOnce(r);return n==="delivery_unavailable"&&(n=await this.rebindAndRetryRun(r,n)),{applied:n==="dispatched"||n==="already_running",runStatus:n}}notifySessionAvailable(){this.lastSnapshot&&this.schedulePublish(this.lastSnapshot)}businessKeyForCronId(t){let r=this.lastSnapshot?.jobs.find(i=>i.id===t);if(r)return this.sessionKeyFor(r)}async bindDshSessionId(t,r){if(!Lo(t))return;let i=this.lastSnapshot??await this.client.list();if(!i)return;let n=i.jobs.filter(o=>o.sessionKey===t&&(!o.dshSessionId||o.dshSessionId!==r));n.length!==0&&await Promise.all(n.map(async o=>{await this.client.patch(o.id,{dshSessionId:r})?(this.options.logger.info("bound cron job to mbh-chat session",{cronId:o.id,sessionKey:t,dshSessionId:r}),this.followCronSession(r)):this.options.logger.warn("failed to patch cron dshSessionId binding",{cronId:o.id,sessionKey:t,dshSessionId:r})}))}async bindAllKnownDshSessions(){let t=this.lastSnapshot??await this.client.list();if(!t)return;let r=new Map;for(let i of t.jobs){if(!i.sessionKey||!Lo(i.sessionKey))continue;let n=this.options.store.getSession(i.sessionKey)??await this.options.provisionSession?.(i);!n||i.dshSessionId===n||r.set(i.id,n)}r.size!==0&&await Promise.all([...r.entries()].map(async([i,n])=>{await this.client.patch(i,{dshSessionId:n})?(this.options.logger.info("bound cron job to pre-existing mbh-chat session",{cronId:i,dshSessionId:n}),this.followCronSession(n)):this.options.logger.warn("failed to patch cron dshSessionId binding",{cronId:i,dshSessionId:n})}))}async run(t){let r=0;for(;!t.aborted;)try{await this.client.subscribe(i=>this.schedulePublish(i),t,i=>this.options.logger.warn("ignored invalid cron catalog SSE event",{error:te(i)})),r=0}catch(i){if(t.aborted)return;r+=1;let n=Math.min(Sse,xse*2**Math.min(r-1,8));this.options.logger.warn("cron catalog SSE disconnected; retrying",{delayMs:n,error:te(i)}),await Ese(t,n)}}schedulePublish(t){this.lastSnapshot=t,this.debounce&&clearTimeout(this.debounce),this.debounce=setTimeout(()=>{this.debounce=void 0,this.publishTail=this.publishTail.then(()=>this.publish(t)).catch(r=>this.options.logger.warn("failed to publish cron catalog to Mobook",{error:te(r)}))},this.options.debounceMs??wse),this.debounce.unref()}async rebindAndRetryRun(t,r){let n=(await this.client.list().catch(()=>{}))?.jobs.find(s=>s.id===t);if(!n?.sessionKey||!Lo(n.sessionKey))return r;let o=this.options.store.getSession(n.sessionKey);return!o||o===n.dshSessionId||!await this.client.patch(t,{dshSessionId:o})?r:(this.options.logger.info("rebound stale cron DSH session before manual run",{cronId:t,dshSessionId:o}),await this.followCronSession(o),this.client.runOnce(t))}async ensureSessionForCron(t){let r=await this.client.list().catch(()=>{});if(!r)return"delivery_unavailable";let i=r.jobs.find(s=>s.id===t);if(!i)return"not_found";let n=this.sessionKeyFor(i);if(!n||!Lo(n))return"delivery_unavailable";let o=this.options.store.getSession(n)??await this.options.provisionSession?.(i);if(!o||i.dshSessionId!==o&&!await this.client.patch(t,{dshSessionId:o}))return"delivery_unavailable"}contextFor(t){if(t.sessionKey)return this.options.store.getLatestContextForBusinessKey(t.sessionKey);let r=this.options.store.getBusinessKeyByDshSessionId(t.dshSessionId??t.agentId);return r?this.options.store.getLatestContextForBusinessKey(r):void 0}sessionKeyFor(t){return t.sessionKey?t.sessionKey:this.options.store.getBusinessKeyByDshSessionId(t.dshSessionId??t.agentId)}send(t,r){return this.options.dcg.enqueueEvent(t,r)!==!1}async publish(t){let r=[];for(let u of t.jobs){let l=this.sessionKeyFor(u);if(!l){r.push(u);continue}let f=Fa(l),p=this.options.store.getSession(l),d={...u.sessionKey===l?{}:{sessionKey:l},...p&&u.dshSessionId!==p?{dshSessionId:p}:{},...f.agentId&&u.agentId!==f.agentId?{agentId:f.agentId}:{}};if(Object.keys(d).length>0){let h=await this.client.patchJob(u.id,d);if(!h){this.options.logger.warn("failed to persist cron sessionKey binding",{cronId:u.id});return}r.push(h)}else r.push(u)}let i=WE(r,u=>this.sessionKeyFor(u)),n=JSON.stringify(i.jobs.map(u=>[u.id,HE(u)]).sort());if(n===this.lastFingerprint)return;if(t.jobs.length>0&&i.jobs.length===0){this.options.logger.warn("skipping Mobook cron catalog publish; no mbh-chat session mapping is available yet");return}let o=new Set(i.jobs.map(u=>u.id)),s=new Set,a=new Set;for(let u of i.jobs){let l=HE(u);if(this.lastJobs.get(u.id)===l)continue;let f=r.find(d=>d.id===u.id),p=f?this.contextFor(f):void 0;if(!p){this.options.logger.warn("skipping cron install; no mapped mbh-chat session is available",{cronId:u.id}),s.add(u.id);continue}if(!this.send(p,{event_type:"cron",operation_type:"install",data:u})){this.options.logger.warn("cron install event was not sent; will retry",{cronId:u.id});return}this.lastJobs.set(u.id,l),this.lastContexts.set(u.id,p),this.lastFingerprint=void 0,this.options.logger.info("enqueued cron install to Mobook",{cronId:u.id,sequence:t.sequence})}if(t.invalidJobCount===0)for(let u of this.lastJobs.keys()){if(o.has(u))continue;let l=this.lastContexts.get(u);if(!l){this.options.logger.warn("skipping cron remove; no mapped mbh-chat session is available",{cronId:u}),a.add(u);continue}if(!this.send(l,{event_type:"cron",operation_type:"remove",data:{id:u,jobId:u,action:"removed"}})){this.options.logger.warn("cron remove event was not sent; will retry",{cronId:u});return}this.lastJobs.delete(u),this.lastContexts.delete(u),this.lastFingerprint=void 0}else this.options.logger.warn("cron snapshot contained invalid jobs; preserving previously published jobs",{invalidJobCount:t.invalidJobCount});let c=new Map([...this.lastJobs].filter(([u])=>o.has(u)||a.has(u)));for(let u of i.jobs)s.has(u.id)||c.set(u.id,HE(u));if(t.invalidJobCount>0)for(let[u,l]of this.lastJobs)c.has(u)||c.set(u,l);this.lastJobs=c,this.lastFingerprint=t.invalidJobCount===0&&s.size===0&&a.size===0?n:void 0,this.followBoundJobs(r),this.options.logger.info("published cron catalog to Mobook",{jobs:i.jobs.length,sequence:t.sequence})}async ensureSessionFollowed(t){let i=(this.lastSnapshot??await this.client.list().catch(()=>{}))?.jobs.find(s=>s.id===t);if(!i)return;let n=this.sessionKeyFor(i),o=n?this.options.store.getSession(n):void 0;o&&await this.followCronSession(o)}followBoundJobs(t){let r=new Set;for(let i of t){let n=this.sessionKeyFor(i),o=n?this.options.store.getSession(n):void 0;!o||r.has(o)||(r.add(o),this.followCronSession(o))}}async followCronSession(t){this.options.followSession&&await this.options.followSession(t)}};import{timingSafeEqual as kse}from"node:crypto";import za from"node:fs";import Tse from"node:http";import Ise from"node:path";var BL=1024*1024,tIe=64*1024;function Ose(e,t){if(!e?.startsWith("Bearer "))return!1;let r=Buffer.from(e.slice(7)),i=Buffer.from(t);return r.length===i.length&&kse(r,i)}async function Cse(e){let t=[],r=0;for await(let i of e){let n=Buffer.isBuffer(i)?i:Buffer.from(i);if(r+=n.length,r>BL)throw new Error(`request body exceeds ${BL} bytes`);t.push(n)}return JSON.parse(Buffer.concat(t).toString("utf8"))}function Ua(e,t,r){let i=JSON.stringify(r);e.writeHead(t,{"content-type":"application/json; charset=utf-8","content-length":Buffer.byteLength(i)}),e.end(i)}var Lh=class{socketPath;token;handler;statusProvider;server;constructor(t,r,i,n){this.socketPath=t,this.token=r,this.handler=i,this.statusProvider=n}async start(){if(this.server)throw new Error("message control server already started");if(process.platform!=="win32"){za.mkdirSync(Ise.dirname(this.socketPath),{recursive:!0});try{if(!za.lstatSync(this.socketPath).isSocket())throw new Error(`refusing to replace non-socket control path: ${this.socketPath}`);za.unlinkSync(this.socketPath)}catch(r){if(r.code!=="ENOENT")throw r}}let t=Tse.createServer((r,i)=>{this.handle(r,i)});this.server=t,await new Promise((r,i)=>{let n=s=>{t.off("listening",o),i(s)},o=()=>{t.off("error",n),r()};t.once("error",n),t.once("listening",o),t.listen(this.socketPath)}),process.platform!=="win32"&&za.chmodSync(this.socketPath,384)}async stop(){let t=this.server;if(this.server=void 0,t&&await new Promise(r=>t.close(()=>r())),process.platform!=="win32")try{za.lstatSync(this.socketPath).isSocket()&&za.unlinkSync(this.socketPath)}catch(r){if(r.code!=="ENOENT")throw r}}async handle(t,r){let i=t.method==="POST"&&t.url==="/v1/message",n=t.method==="GET"&&t.url==="/v1/status";if(!i&&!n){Ua(r,404,{error:"not found"});return}if(!Ose(t.headers.authorization,this.token)){Ua(r,401,{error:"unauthorized"});return}if(n){if(!this.statusProvider){Ua(r,404,{error:"not found"});return}Ua(r,200,this.statusProvider());return}let o=new AbortController,s=()=>o.abort(new Error("control client disconnected"));t.once("aborted",s);try{let a=await Cse(t),c=await this.handler(a,o.signal);Ua(r,c.success?200:422,c)}catch(a){Ua(r,400,{success:!1,sentMediaCount:0,queued:!1,error:a instanceof Error?a.message:String(a)})}finally{t.off("aborted",s)}}};import{createHash as Ase}from"node:crypto";var Fo=class extends Error{status;constructor(t,r){super(t),this.status=r,this.name="DcgApiRequestError"}};function $se(e){return e!==null&&typeof e=="object"?JSON.stringify(e):String(e)}function Rse(e,t,r,i,n="1.0.0"){let o={timestamp:t,path:r,version:n,...e},s=Object.keys(o).sort().map(a=>o[a]===void 0?"":`${a}${$se(o[a])}`).join("")+i;return Ase("md5").update(s).digest("hex").toUpperCase()}function Dse(e,t){try{let r=new URL(t,e);return`POST ${r.origin}${r.pathname}`}catch{return`POST ${t.split("?",1)[0]??""}`}}var Fh=class{config;logger;fetchImpl;timeoutMs;constructor(t,r,i=fetch,n=6e4){this.config=t,this.logger=r,this.fetchImpl=i,this.timeoutMs=n}async post(t,r,i={}){if(!t.startsWith("/")||t.startsWith("//"))throw new Error("mbh-chat API request path must be an origin-relative path");let n=new URL(this.config.apiBaseUrl),o=new URL(t,n);if(o.origin!==n.origin)throw new Error("mbh-chat API request path must stay on the configured origin");let s=typeof i.appId=="number"&&Number.isFinite(i.appId)?Math.trunc(i.appId):typeof i.appId=="string"&&i.appId.trim()?i.appId.trim():this.config.appId,a={...r,_appId:s},c=Date.now(),u=AbortSignal.timeout(this.timeoutMs),l=i.signal?AbortSignal.any([i.signal,u]):u,f=Dse(this.config.apiBaseUrl,t);try{let p=await this.fetchImpl(o,{method:"POST",signal:l,headers:{"content-type":"application/json",appKey:this.config.apiAppKey,sign:Rse(a,c,t,this.config.apiSignKey,this.config.apiVersion),timestamp:String(c),version:this.config.apiVersion,...i.userToken?{authorization:i.userToken}:{}},body:JSON.stringify(a)});if(!p.ok)throw await p.body?.cancel(),new Fo(`mbh-chat API request failed with HTTP ${p.status}`,p.status);let d=await p.json();if(!d||typeof d!="object"||Array.isArray(d))throw new Fo("mbh-chat API returned a non-object JSON response",p.status);return d}catch(p){let d=p instanceof Fo?p.status:void 0;throw this.logger.warn("mbh-chat API request failed",{request:f,...d!==void 0?{status:d}:{},error:p instanceof Error?p.message:String(p)}),p}}};var zh=class{ttlMs;tokens=new Map;pending=new Map;constructor(t=3600*1e3){if(this.ttlMs=t,!Number.isFinite(t)||t<=0)throw new Error("user-token cache ttlMs must be positive")}key(t,r){return`${t}\0${r.userId}\0${r.appId}`}get(t,r){let i=this.key(t,r),n=this.tokens.get(i);if(n){if(Date.now()>=n.expiresAt){this.tokens.delete(i);return}return n.token}}set(t,r,i){this.tokens.set(this.key(t,r),{token:i,expiresAt:Date.now()+this.ttlMs})}delete(t,r){this.tokens.delete(this.key(t,r))}async getOrLoad(t,r,i){let n=this.get(t,r);if(n)return n;let o=this.key(t,r),s=this.pending.get(o);if(s)return s;let a=i().then(c=>{if(!c)throw new Error("mbh-chat user-token lookup returned an empty token");return this.set(t,r,c),c}).finally(()=>this.pending.delete(o));return this.pending.set(o,a),a}clear(){this.tokens.clear(),this.pending.clear()}};var WL=1001;function bl(e,t){let r=t.code===void 0?"unknown":String(t.code),i=typeof t.message=="string"?t.message.replace(/[\u0000-\u001f\u007f]+/g," ").slice(0,300):"";return new Error(`${e} failed (code=${r})${i?`: ${i}`:""}`)}function Nse(e){return Number(e.code)===401||/illegal authorization/iu.test(e.message??"")}function Uh(e,t,r){let i=e==null||e===""?t:e,n=typeof i=="number"?i:Number(String(i).trim());if(!Number.isSafeInteger(n)||n<0)throw new Error(`${r} must be a non-negative safe integer`);return n}function Pse(e){let t=e.match(/^(.*?)-(\d+(?:-\d+)*)$/);return t?t[1]??"":""}var Bh=class{config;client;tokenCache;constructor(t,r,i){this.config=t,this.client=new Fh(t,r,i?.fetchImpl,i?.timeoutMs),this.tokenCache=i?.tokenCache??new zh}context(t){return{appId:typeof t?.appId=="number"&&Number.isFinite(t.appId)?String(Math.trunc(t.appId)):typeof t?.appId=="string"&&t.appId.trim()?t.appId.trim():this.config.appId,userId:Number.isFinite(t?.userId)?t?.userId??0:Number(this.config.userId)||0}}async queryUserTokenByBotToken(t,r){let i=this.context(r),n=await this.client.post("/organization/queryUserTokenByBotTokenV2",{botToken:t,_userId:i.userId},{appId:i.appId,...r?.signal?{signal:r.signal}:{}});if(!n.data?.token)throw bl("mbh-chat user-token lookup",n);return n.data.token}async getUserToken(t,r){let i=t.trim();if(!i)throw new Error("botToken is required for mbh-chat API authentication");let n=this.context(r);return this.tokenCache.getOrLoad(i,n,()=>this.queryUserTokenByBotToken(i,r))}async withUserToken(t,r,i,n){let o=t.trim(),s=this.context(r),a=await this.getUserToken(o,r);for(let c=0;;c+=1){try{let u=await i(a);if(c!==0||!n?.(u))return u}catch(u){if(c!==0||!(u instanceof Fo)||u.status!==401)throw u}this.tokenCache.delete(o,s),a=await this.getUserToken(o,r)}}async generateSignUrl(t,r,i){if(!t.trim())throw new Error("fileUrl is required for mbh-chat generateSignUrl");let n=this.context(i),o=await this.withUserToken(r,i,s=>this.client.post("/user/generateSignUrl",{loudPlatform:0,fileName:t},{appId:n.appId,userToken:s,...i?.signal?{signal:i.signal}:{}}));if(Number(o.code)!==0||!o.data?.filePath)throw bl("mbh-chat generateSignUrl",o);return o.data.filePath}async getOnlineAgents(t,r,i={}){let n=t.trim(),o=r.trim();if(!n)throw new Error("cloneCode is required for Agent package lookup");if(!o)throw new Error("botToken is required for mbh-chat Agent package lookup");let s=this.context(i),a=Uh(i.userId,s.userId,"_userId"),c=Uh(i.domainId,this.config.domainId,"_domainId"),u=await this.withUserToken(o,i,p=>this.client.post("/resource/getOnlineAgents",{_orgId:WL,_domainId:c,pageNo:1,names:[Pse(n)],withDownload:!0,_userId:a},{appId:40,userToken:p,...i.signal?{signal:i.signal}:{}}));if(Number(u.code)!==0)throw bl("mbh-chat Agent package lookup",u);let l=he(u.data)?.list;if(!Array.isArray(l))throw new Error("mbh-chat Agent package lookup returned an invalid list");let f=l.map(p=>he(p)).map(p=>Ke(p?Se(p,"downloadUrl","download_url"):void 0)).find(Boolean);if(!f)throw new Error(`Agent ${n} has no downloadable package`);return f}async getOnlineSkills(t,r,i={}){let n=t.trim(),o=r.trim();if(!n)throw new Error("skillCode is required for Skill package lookup");if(!o)throw new Error("botToken is required for mbh-chat Skill package lookup");let s=this.context(i),a=Uh(i.userId,s.userId,"_userId"),c=Uh(i.domainId,this.config.domainId,"_domainId"),u=await this.withUserToken(o,i,p=>this.client.post("/resource/getOnlineSkills",{_orgId:WL,_domainId:c,pageNo:1,names:[n],withDownload:!0,_userId:a},{appId:40,userToken:p,...i.signal?{signal:i.signal}:{}}));if(Number(u.code)!==0)throw bl("mbh-chat Skill package lookup",u);let l=he(u.data)?.list;if(!Array.isArray(l))throw new Error("mbh-chat Skill package lookup returned an invalid list");let f=l.map(p=>he(p)).map(p=>Ke(p?Se(p,"downloadUrl","download_url"):void 0)).find(Boolean);if(!f)throw new Error(`Skill ${n} has no downloadable package`);return f}async getStsToken(t,r,i,n){if(!t.trim())throw new Error("sourceFileName is required for mbh-chat STS credentials");let o=this.context(n),s=await this.withUserToken(r,n,a=>this.client.post("/user/getStsTokenByAsync",{sourceFileName:t,isPrivate:i},{appId:o.appId,userToken:a,...n?.signal?{signal:n.signal}:{}}),Nse);if(!s.data?.bucket)throw bl("mbh-chat STS credential lookup",s);return s.data}};var GH=Vr(ZH(),1);import{extname as Nve}from"node:path";import{fileURLToPath as Pve}from"node:url";var qve=GH.default,jve=1024*1024,Mve=900*1e3;function Lve(e){if(typeof e=="string"){let t=e.trim();if(t.startsWith("file:"))try{return Pve(t)}catch{return e}return e}if(Buffer.isBuffer(e))return e;if(e&&typeof e=="object"){if(ArrayBuffer.isView(e)&&!(e instanceof DataView)&&!Buffer.isBuffer(e)){let i=e;return Buffer.from(i.buffer,i.byteOffset,i.byteLength)}let t=e,r=t.path??t.filePath;if(typeof r=="string"&&r.trim())return r.trim()}return e}var Fve={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".webp":"image/webp",".bmp":"image/bmp",".svg":"image/svg+xml",".ico":"image/x-icon",".avif":"image/avif",".heic":"image/heic",".heif":"image/heif",".pdf":"application/pdf",".epub":"application/epub+zip",".mp4":"video/mp4",".webm":"video/webm",".mov":"video/quicktime",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".opus":"audio/opus",".m4a":"audio/mp4",".aac":"audio/aac",".flac":"audio/flac",".txt":"text/plain; charset=utf-8",".log":"text/plain; charset=utf-8",".csv":"text/csv; charset=utf-8",".html":"text/html; charset=utf-8",".htm":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".json":"application/json; charset=utf-8",".xml":"application/xml; charset=utf-8",".md":"text/markdown; charset=utf-8",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation"};function dI(e){let t=e.split(/[/\\]/).pop()??e,r=Nve(t).toLowerCase();return r?Fve[r]:void 0}function zve(e,t){if(typeof e=="string")return dI(e)??"application/octet-stream";if(Buffer.isBuffer(e)){if(t){let n=dI(t);if(n)return n}return"application/octet-stream"}let r=e.type?.trim();if(r&&r!=="application/octet-stream")return r;let i=typeof e.name=="string"&&e.name?e.name:"";if(i){let n=dI(i);if(n)return n}return r||"application/octet-stream"}function Uve(e){let t=e.split(";",1)[0]?.trim().toLowerCase()??"";return t==="application/epub+zip"||t==="image/svg+xml"||t==="application/xml"||t==="text/javascript"||t==="application/javascript"?"attachment":"inline"}async function Bve(e){if(Buffer.isBuffer(e))return{content:e,fileName:"file"};if(typeof e=="string")return{content:e,fileName:e.split(/[/\\]/).pop()??"file"};let t=Buffer.from(await e.arrayBuffer()),r=e.name;return{content:t,fileName:typeof r=="string"&&r?r:"file"}}var pI=class{api;logger;constructor(t,r){this.api=t,this.logger=r}async upload(t,r,i=1,n,o){let s=Lve(t),{content:a,fileName:c}=await Bve(s),u=await this.api.getStsToken(c,r,i,o),l=zve(s,c),f=n?.onProgress,p={accessKeyId:u.tempAccessKeyId,accessKeySecret:u.tempAccessKeySecret,stsToken:u.tempSecurityToken,bucket:u.bucket,endpoint:u.endPoint,region:u.region,secure:!0,cname:!0,authorizationV4:!0,timeout:n?.timeoutMs??Mve},d=new qve(p),h=`${u.uploadDir}${u.ossFileKey}`;try{let m,_={progress:g=>{f?.(g)},parallel:4,partSize:jve,mime:l,headers:{"Content-Disposition":Uve(l)}};if(m=await d.multipartUpload(h,a,_),m?.res?.status!==200)throw new Error(`OSS upload failed with status ${m?.res?.status??"unknown"}`);let S=(m?.res?.requestUrls||[])[0]||"",v=i===1&&m.name||S;if(!v)throw new Error("OSS upload succeeded but returned no object name or URL");return v}catch(m){throw this.logger.error("OSS upload failed",{error:m instanceof Error?m.message:String(m)}),m}}};function KH(e,t){let r=new pI(e,t);return r.upload.bind(r)}var cy=class{tails=new Map;generations=new Map;enqueue(t,r){let i=this.tails.get(t)??Promise.resolve(),n=this.generations.get(t)??0,o=i.catch(()=>{}).then(async()=>{(this.generations.get(t)??0)===n&&await r()});return this.tails.set(t,o),o.finally(()=>{this.tails.get(t)===o&&(this.tails.delete(t),this.generations.delete(t))}).catch(()=>{}),o}cancelPending(t){this.tails.has(t)&&this.generations.set(t,(this.generations.get(t)??0)+1)}cancelAllPending(){for(let t of this.tails.keys())this.cancelPending(t)}};import{randomUUID as mI}from"node:crypto";import Jve from"node:fs";import Ir from"node:fs/promises";import Yve from"node:os";import fi from"node:path";var YH=Vr(fE(),1);import Wve from"node:fs";import XH from"node:fs/promises";import rf from"node:path";import{Transform as Hve}from"node:stream";import{pipeline as Vve}from"node:stream/promises";var QH=500*1024*1024,hI=1024*1024*1024,JH=2e4;function Zve(e){if((e.flags&2048)!==0)return new TextDecoder("utf-8").decode(e.pathBuffer);try{return new TextDecoder("utf-8",{fatal:!0}).decode(e.pathBuffer)}catch{return new TextDecoder("gbk").decode(e.pathBuffer)}}function Gve(e){let t=e.replaceAll("\\","/"),r=t.split("/").filter(Boolean);if(t.startsWith("/")||/^[a-z]:\//i.test(t)||r.some(i=>i==="."||i===".."))throw new Error(`skill archive contains an unsafe path: ${e}`);return t}function Kve(e){let t=e.map(n=>n.replaceAll("\\","/").replace(/\/+$/,"")).filter(Boolean);if(t.length===0)return;let r=new Set(t.map(n=>n.split("/").filter(Boolean)[0]).filter(Boolean));if(r.size!==1)return;let i=[...r][0];return i&&t.some(n=>n.startsWith(`${i}/`))&&t.every(n=>n===i||n.startsWith(`${i}/`))?i:void 0}function Xve(e,t){let r=rf.resolve(e,t),i=rf.relative(rf.resolve(e),r);if(!i||i.startsWith("..")||rf.isAbsolute(i))throw new Error(`skill archive contains an unsafe path: ${t}`);return r}var uy=class extends Hve{limitBytes;budget;constructor(t,r){super(),this.limitBytes=t,this.budget=r}_transform(t,r,i){if(this.budget.used+=t.length,this.budget.used>this.limitBytes){i(new Error(`skill archive expands beyond ${this.limitBytes} bytes`));return}i(null,t)}};async function eV(e,t){let r=await YH.default.Open.buffer(e);if(r.files.length>JH)throw new Error(`skill archive exceeds ${JH} entries`);let i=r.files.reduce((a,c)=>a+c.uncompressedSize,0);if(!Number.isSafeInteger(i)||i>hI)throw new Error(`skill archive expands beyond ${hI} bytes`);let n=r.files.map(a=>Gve(Zve(a))),o=Kve(n),s={used:0};for(let a=0;a<r.files.length;a+=1){let c=r.files[a],u=n[a];if(!c||!u)continue;let l=u.replaceAll("\\","/");if(o&&(l===o||l===`${o}/`)||(o&&l.startsWith(`${o}/`)&&(l=l.slice(o.length+1)),l=l.replace(/\/+$/,""),!l))continue;let f=Xve(t,l);if(c.type==="Directory"){await XH.mkdir(f,{recursive:!0});continue}if(c.type!=="File")throw new Error(`skill archive contains an unsupported entry: ${u}`);await XH.mkdir(rf.dirname(f),{recursive:!0}),await Vve(c.stream(),new uy(hI,s),Wve.createWriteStream(f,{mode:384}))}}var Qve=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function tV(e){let t=new Map;if(!Array.isArray(e.skills_scope))return t;for(let r of e.skills_scope){let i=he(r);if(!i)continue;let n=Ke(Se(i,"skill_code","skillCode","code"));if(!n)continue;let o=Ke(Se(i,"short_name","shortName","skill_name","skillName","name"));o&&t.set(n,o)}return t}function fy(e){let t=Array.isArray(e.skills_scope)?he(e.skills_scope[0]):void 0,r=Array.isArray(e.intent_recognition)?e.intent_recognition.map(he).filter(c=>!!c).find(c=>Ke(Se(c,"biz_type","bizType")).toLowerCase()==="skill"):void 0,i=t??r;if(!i)return;let n=Ke(Se(i,"skill_code","skillCode"))||(i===r?Ke(i.name):"");if(!n)return;let o=Ke(Se(i,"short_name","shortName","name"))||n,s=Ke(Se(i,"url","download_url","downloadUrl","skill_url","skillUrl")),a=Se(i,"skill_id","skillId","id");return{code:n,url:s,name:o,...typeof a=="string"||typeof a=="number"?{id:a}:{}}}var ly=class{logger;options;dshHome;skillsRoot;skillsDisplayRoot;operations=new Map;constructor(t,r={}){this.logger=t,this.options=r,this.dshHome=io(),this.skillsRoot=GI("skills"),this.skillsDisplayRoot=fi.join(KI(this.dshHome),"skills")}normalizeCode(t){let r=t.trim();if(!Qve.test(r))throw new Error(`invalid mbh-chat skill code: ${r||"<empty>"}`);return r}skillPath(t){return fi.join(this.skillsRoot,this.normalizeCode(t))}skillDisplayPath(t){return fi.join(this.skillsDisplayRoot,this.normalizeCode(t))}exists(t){try{return Jve.existsSync(fi.join(this.skillPath(t),"SKILL.md"))}catch{return!1}}install(t,r){return this.serialized(r,async()=>{let i,n;try{if(i=this.normalizeCode(r),n=this.skillPath(i),!t.trim())throw new Error("skill url is empty")}catch(c){return{success:!1,status:"fail",error:te(c)}}let o=fi.dirname(n),s=fi.join(o,`.${i}.${mI()}.tmp`),a=fi.join(o,`.${i}.${mI()}.bak`);try{await Ir.mkdir(o,{recursive:!0,mode:448}),await rl(async()=>{await Ir.rm(s,{recursive:!0,force:!0}),await Ir.mkdir(s,{recursive:!0,mode:448});let u=await this.download(t);await eV(u,s);let l=fi.join(s,"SKILL.md");if(!(await Ir.stat(l).catch(()=>{}))?.isFile())throw new Error("skill archive does not contain a root SKILL.md")});let c=await Ir.stat(n).then(()=>!0,()=>!1);c&&await Ir.rename(n,a);try{await Ir.rename(s,n)}catch(u){throw c&&await Ir.rename(a,n).catch(()=>{}),u}return await Ir.rm(a,{recursive:!0,force:!0}).catch(u=>{this.logger.warn("could not remove the previous mbh-chat skill backup",{code:i,error:te(u)})}),this.logger.info("installed mbh-chat skill",{code:i,path:this.skillDisplayPath(i)}),{success:!0,status:"ok"}}catch(c){return await Ir.rm(s,{recursive:!0,force:!0}).catch(()=>{}),this.logger.error("mbh-chat skill installation failed",{code:i,error:te(c)}),{success:!1,status:"fail",error:te(c)}}})}uninstall(t){return this.serialized(t,async()=>{try{let r=this.normalizeCode(t),i=this.skillPath(r);return await Ir.rm(i,{recursive:!0,force:!0}),this.logger.info("uninstalled mbh-chat skill",{code:r,path:this.skillDisplayPath(r)}),{success:!0,status:"ok"}}catch(r){return this.logger.error("mbh-chat skill removal failed",{code:t,error:te(r)}),{success:!1,status:"fail",error:te(r)}}})}eventContent(t,r){return{event_type:"skill",operation_type:"install",skill_url:t.url,skill_code:t.code,...t.id!==void 0?{skill_id:t.id}:{},...r?{bot_token:r}:{}}}serialized(t,r){let i=t.trim(),o=(this.operations.get(i)??Promise.resolve({success:!0,status:"ok"})).catch(()=>{}).then(r);return this.operations.set(i,o),o.finally(()=>{this.operations.get(i)===o&&this.operations.delete(i)}),o}async download(t){let r=await Ir.mkdtemp(fi.join(Yve.tmpdir(),"mbh-chat-skill-"));try{let i=await Ks([{url:t,name:"skill.zip"}],{storageRoot:r,requestId:mI(),maxBytes:QH,maxFiles:1,maxInlineImageBytes:1,fetchTimeoutMs:18e4,concurrency:1,allowPrivateNetwork:this.options.allowPrivateNetwork??!1,...this.options.fetchImpl?{fetchImpl:this.options.fetchImpl}:{}}),n=i.media[0];if(!n)throw new Error(i.failures[0]?.reason||"skill download failed");return await Ir.readFile(n.localPath)}finally{await Ir.rm(r,{recursive:!0,force:!0}).catch(()=>{})}}};function rV(e,t){let r=Object.getOwnPropertyDescriptor(e,"constructor")?.value;if(typeof r!="function")return!1;try{return r.name===t&&r.prototype===e&&Function.prototype.toString.call(r)===Function.prototype.toString.call(t==="Array"?Array:Object)}catch{return!1}}function nV(e){return Object.getPrototypeOf(e)===null&&rV(e,"Object")}function ebe(e){let t=Object.getPrototypeOf(e);if(!Array.isArray(t)||!rV(t,"Array"))return!1;let r=Object.getPrototypeOf(t);return typeof r=="object"&&r!==null&&nV(r)}function tbe(e){let t=Object.getPrototypeOf(e);return t===null||typeof t=="object"&&nV(t)}function rbe(e){let t=Reflect.ownKeys(e);if(!t.some(r=>typeof r!="string"||!Object.prototype.propertyIsEnumerable.call(e,r)))return t}function nbe(e,t){let r=new Set,i,n=(s,a)=>{s!==void 0&&(s.kind==="root"?i=a:s.kind==="array"?s.target[s.index]=a:Object.defineProperty(s.target,s.key,{value:a,enumerable:!0,configurable:!0,writable:!0}))},o=[{kind:"visit",value:e,...t?{destination:{kind:"root"}}:{}}];for(let s=o.pop();s!==void 0;s=o.pop()){if(s.kind==="leave"){r.delete(s.source);continue}if(s.kind==="array-item"){if(!Object.prototype.hasOwnProperty.call(s.source,s.index))return;o.push({kind:"visit",value:s.source[s.index],...s.target===void 0?{}:{destination:{kind:"array",target:s.target,index:s.index}}});continue}if(s.kind==="object-property"){o.push({kind:"visit",value:s.source[s.key],...s.target===void 0?{}:{destination:{kind:"object",target:s.target,key:s.key}}});continue}let a=s.value;if(a===null){n(s.destination,null);continue}if(typeof a=="boolean"||typeof a=="string"){n(s.destination,a);continue}if(typeof a=="number"){if(!Number.isFinite(a)||Object.is(a,-0))return;n(s.destination,a);continue}if(typeof a!="object"||r.has(a))return;if(Array.isArray(a)){if(!ebe(a))return;let l=a.length;if(Reflect.ownKeys(a).length!==l+1)return;let f=t?[]:void 0;f!==void 0&&n(s.destination,f),r.add(a),o.push({kind:"leave",source:a});for(let p=l-1;p>=0;p--)o.push({kind:"array-item",source:a,index:p,...f===void 0?{}:{target:f}});continue}if(!tbe(a))return;let c=rbe(a);if(c===void 0)return;let u=t?{}:void 0;u!==void 0&&n(s.destination,u),r.add(a),o.push({kind:"leave",source:a});for(let l=c.length-1;l>=0;l--){let f=c[l];if(f===void 0)return;o.push({kind:"object-property",source:a,key:f,...u===void 0?{}:{target:u}})}}return t?i:!0}function iV(e){return nbe(e,!0)}function gI(e){let t=new WeakSet,r=[{kind:"visit",node:e}];for(;r.length>0;){let i=r.pop();if(i===void 0)continue;if(i.kind==="property"){r.push({kind:"visit",node:i.source[i.key]});continue}let n=i.node;if(n===null||typeof n!="object"||n instanceof AbortSignal||t.has(n))continue;t.add(n),Object.freeze(n);let o=Object.keys(n);for(let s=o.length-1;s>=0;s--){let a=o[s];a!==void 0&&r.push({kind:"property",source:n,key:a})}}return e}function aV(e){if(!Number.isSafeInteger(e))throw new TypeError(`Assistant stream time must be a safe integer, got ${String(e)}`);return e}function sbe(e,t){if(!Number.isSafeInteger(e)||e<0||Object.is(e,-0))throw new TypeError(`${t} index must be a non-negative safe integer`);return e}function abe(e){let t=iV(e);if(t===void 0)throw new TypeError("Assistant stream chunk must be losslessly JSON-serializable");return t}function cV(e){let t=[];for(let r of e){let i=cbe(r);if(i.type==="chunk"){t.push({time:i.time,chunk:i.chunk});continue}let n=i.type==="tool-call-chunks"?i.args:i.texts,o=i.time0;for(let s=0;s<n.length;s+=1){s>0&&(o+=i.dt[s-1]);let a;i.type==="text-chunks"?a={type:"text-delta",index:i.index,text:n[s]}:i.type==="reasoning-chunks"?a={type:"reasoning-delta",index:i.index,text:n[s]}:a={type:"tool-call-delta",index:i.index,id:i.id,...Object.hasOwn(i,"name")?{name:i.name}:{},argumentsDelta:n[s]},t.push({time:o,chunk:a})}}return t}function cbe(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Assistant stream record must be an object");let t=e;switch(t.type){case"text-chunks":case"reasoning-chunks":{yI(t,["type","time0","index","dt","texts"],t.type);let r=sV(t.texts,`${t.type} texts`);if(r.length===0)throw new TypeError(`${t.type} texts must be non-empty`);return oV(t,r.length,t.type),t}case"tool-call-chunks":{let r=Object.hasOwn(t,"name")?["type","time0","index","dt","id","name","args"]:["type","time0","index","dt","id","args"];yI(t,r,t.type);let i=sV(t.args,"tool-call-chunks args");if(i.length===0)throw new TypeError("tool-call-chunks args must be non-empty");if(typeof t.id!="string"||t.id.length===0)throw new TypeError("tool-call-chunks id must be a non-empty string");if(t.name!==void 0&&(typeof t.name!="string"||t.name.length===0))throw new TypeError("tool-call-chunks name must be a non-empty string");return oV(t,i.length,t.type),t}case"chunk":{yI(t,["type","time","chunk"],"chunk");let r=aV(t.time);if(typeof t.chunk!="object"||t.chunk===null||Array.isArray(t.chunk))throw new TypeError("Assistant stream raw chunk must be a lossless JSON object");let i;try{i=abe(t.chunk)}catch(n){throw new TypeError("Assistant stream raw chunk must be a lossless JSON object",{cause:n})}return gI({type:"chunk",time:r,chunk:i})}default:throw new TypeError(`Unsupported Assistant stream record ${JSON.stringify(t.type)}`)}}function oV(e,t,r){if(aV(e.time0),sbe(e.index,r),!Array.isArray(e.dt)||e.dt.some(n=>!Number.isSafeInteger(n)))throw new TypeError(`${r} dt must contain safe integers`);if(e.dt.length!==t-1)throw new TypeError(`${r} dt length must be one less than its members`);let i=e.time0;for(let n of e.dt)if(i+=n,!Number.isSafeInteger(i))throw new TypeError(`${r} member times must stay safe integers`)}function sV(e,t){if(!Array.isArray(e)||e.some(r=>typeof r!="string"))throw new TypeError(`${t} must be a string array`);return e}function yI(e,t,r){if(Object.keys(e).length!==t.length||!t.every(i=>Object.hasOwn(e,i)))throw new TypeError(`${r} Assistant stream record must contain exactly ${t.join(", ")}`)}import{randomUUID as uV}from"node:crypto";var vI=class{baseUrl;logger;sessionCookie;socket;streams=new Map;opening;closed;constructor(t,r,i){this.baseUrl=t,this.logger=r,this.sessionCookie=i}async*open(t,r,i,n){let o=uV(),s=[],a,c=l=>{s.push(l),a?.(),a=void 0};this.streams.set(o,c);let u=()=>{this.send({type:"cancel",streamId:o}),c({kind:"end"})};i.addEventListener("abort",u,{once:!0});try{if(await this.ensureOpen(),this.closed)throw this.closed;for(this.send({type:"open",streamId:o,endpoint:t,payload:r}),n?.(),i.aborted&&u();;){for(;s.length>0;){let l=s.shift();if(!l||l.kind==="end")return;if(l.kind==="error")throw l.error;yield l.value}await new Promise(l=>{a=l})}}finally{i.removeEventListener("abort",u),this.streams.delete(o),i.aborted||this.send({type:"cancel",streamId:o})}}close(t){this.closed=t??new Error("mbh-chat Remote mux closed");for(let i of this.streams.values())i({kind:"end"});this.streams.clear();let r=this.socket;this.socket=void 0,this.opening=void 0,r&&(r.readyState===Nt.CONNECTING?r.terminate():r.readyState===Nt.OPEN&&r.close(1e3,"bridge stream stopped"))}async ensureOpen(){if(this.socket?.readyState===Nt.OPEN)return;if(this.opening)return this.opening;let t=new URL("/api/remote.mux",this.baseUrl);t.protocol=t.protocol==="https:"?"wss:":"ws:";let r=new Nt(t,{headers:wn(this.sessionCookie)});this.socket=r,this.opening=new Promise((i,n)=>{let o=s=>{this.close(s),n(s)};r.once("open",()=>{r.once("close",()=>this.close(new Error("mbh-chat Remote mux closed"))),i()}),r.once("error",s=>o(s instanceof Error?s:new Error(String(s))))}),r.on("message",(i,n)=>{if(n){this.logger.warn("dropping binary mbh-chat WebSocket frame",{path:"/api/remote.mux"});return}let o;try{o=JSON.parse(i.toString())}catch(a){this.logger.warn("dropping malformed mbh-chat Remote mux frame",{error:a instanceof Error?a.message:String(a)});return}let s=this.streams.get(o.streamId);s&&(o.type==="item"?s({kind:"frame",value:o.value}):o.type==="error"?s({kind:"error",error:Object.assign(new Error(`mbh-chat ${o.error.code}: ${o.error.message}`),{code:o.error.code})}):s({kind:"end"}))}),await this.opening}send(t){this.socket?.readyState===Nt.OPEN&&this.socket.send(JSON.stringify(t))}},dy=class{baseUrl;logger;timeoutMs;sessionCookie;mux;eventClientId;constructor(t,r,i=3e4,n=jh()){this.baseUrl=t,this.logger=r,this.timeoutMs=i,this.sessionCookie=n}sessions={create:(t,r)=>this.invoke("session/create",{request:t},r),prompt:(t,r)=>this.invoke("session/prompt",{request:t},r),cancel:(t,r)=>this.invoke("session/cancel",{request:t},r),selectModel:(t,r)=>this.invoke("session/selectModel",{request:t},r),modelCatalog:t=>this.invoke("session/modelCatalog",{},t),page:(t,r)=>this.invoke("session/page",{request:t},r),follow:(t,r,i)=>this.openStream("session/follow",{request:t},r,i)};openEvents(t,r){return this.openStream("$events",{},t,r)}respondEvent(t,r){let i=t.clientId??this.eventClientId;if(!i)throw new Error("mbh-chat event stream is not ready");return this.invoke("$events/result",{clientId:i,eventId:t.eventId,outcome:t.outcome},r)}disconnect(){this.eventClientId=void 0,this.mux?.close(),this.mux=void 0}async invoke(t,r,i){let n=uV(),o=await fetch(new URL(`/api/${t}`,this.baseUrl),{method:"POST",headers:wn(this.sessionCookie,{"Content-Type":"application/json"}),body:JSON.stringify({type:"client-request",rpcId:n,method:t,payload:{args:r}}),signal:i?AbortSignal.any([i,AbortSignal.timeout(this.timeoutMs)]):AbortSignal.timeout(this.timeoutMs)});if(!o.ok)throw Object.assign(new Error(`mbh-chat ${t} returned HTTP ${o.status}`),{code:"http-error"});return await o.json()}openStream(t,r,i,n){return this.mux??=new vI(this.baseUrl,this.logger,this.sessionCookie),this.mux.open(t,{args:r},i,n)}};function Wr(e){if(e.result.ok)return e.result.value;let t=new Error(`mbh-chat ${e.result.error.code}: ${e.result.error.message}`);throw Object.assign(t,{code:e.result.error.code}),t}function bI(e){if(!(typeof e!="object"||e===null||!("code"in e)))return typeof e.code=="string"?e.code:void 0}var ube=new Set(["session/not-found","session-not-found"]);function _I(e){return e!==void 0&&ube.has(e)}function wI(e){return _I(bI(e))}function nf(){let e,t;return{promise:new Promise((i,n)=>{e=i,t=n}),resolve:e,reject:t}}var lbe=3e3;function fbe(e,t,r){let i=Math.min(r,t*2**Math.min(e,8));return i+Math.floor(Math.random()*Math.max(1,Math.min(1e3,i/5)))}function xI(e,t){return new Promise(r=>{if(t.aborted)return r();let i=setTimeout(n,e);function n(){clearTimeout(i),t.removeEventListener("abort",n),r()}t.addEventListener("abort",n,{once:!0})})}function dbe(e,t){return t?t.aborted?Promise.reject(t.reason??new Error("mbh-chat operation aborted")):new Promise((r,i)=>{let n=()=>o(()=>i(t.reason??new Error("mbh-chat operation aborted"))),o=s=>{t.removeEventListener("abort",n),s()};t.addEventListener("abort",n,{once:!0}),e.then(s=>o(()=>r(s)),s=>o(()=>i(s)))}):e}function pbe(e){let t=bI(e);return t?!(t==="session/not-found"||t==="session-not-found"||t==="gateway/bad-request"||/corrupt|invalid|validation/iu.test(t)):/closed|ended before|ECONN|socket|network|fetch failed/iu.test(te(e))}var py=class{reconnectMinMs;reconnectMaxMs;logger;api;rootAbort;generationAbort;handlers;loopPromise;connected=!1;followedSessions=new Set;followAborts=new Map;followReadiness=new Map;liveFollows=new Set;followCursors=new Map;recoveries=new Map;connectionWaiters=new Set;constructor(t,r,i,n){this.reconnectMinMs=r,this.reconnectMaxMs=i,this.logger=n,this.api=new dy(t,n)}start(t){if(this.loopPromise)throw new Error("mbh-chat connection already started");this.handlers=t,this.rootAbort=new AbortController,this.loopPromise=this.run(t,this.rootAbort.signal)}async stop(){this.rootAbort?.abort();let t=new Error("mbh-chat connection stopped before becoming ready");for(let r of this.connectionWaiters)r.reject(t);this.connectionWaiters.clear();for(let r of this.followReadiness.values())r.reject(t);this.followReadiness.clear();for(let r of this.recoveries.values())r.completion.reject(t);this.liveFollows.clear(),this.followCursors.clear(),this.recoveries.clear(),await this.loopPromise,this.loopPromise=void 0,this.rootAbort=void 0,this.handlers=void 0,this.api.disconnect()}isConnected(){return this.connected}followSession(t,r={}){if(this.followedSessions.add(t),this.liveFollows.has(t))return Promise.resolve();let i=this.followReadiness.get(t);i||(i=nf(),this.followReadiness.set(t,i)),this.connected&&this.generationAbort&&!this.followAborts.has(t)&&this.startFollow(t,this.generationAbort.signal);let n=i.promise;return n.catch(()=>{}),r.requireReady?dbe(n,r.signal):Promise.race([n,xI(lbe,this.generationAbort?.signal??new AbortController().signal).then(()=>{this.liveFollows.has(t)||this.logger.warn("mbh-chat session follow was not ready before timeout",{sessionId:t})})])}recoverSession(t,r,i,n){this.recoveries.get(t)?.completion.reject(new Error(`mbh-chat replaced recovery for session ${t}`));let s=nf();s.promise.catch(()=>{}),this.recoveries.set(t,{...r?{executionRpcId:r}:{},onSnapshot:i,completion:s});let a=()=>{let c=this.recoveries.get(t);!c||c.completion!==s||(this.recoveries.delete(t),s.reject(n?.reason??new Error(`mbh-chat recovery aborted for session ${t}`)))};return n?.addEventListener("abort",a,{once:!0}),s.promise.finally(()=>n?.removeEventListener("abort",a)).catch(()=>{}),n?.aborted?a():this.followSession(t).catch(c=>{let u=this.recoveries.get(t);!u||u.completion!==s||(this.recoveries.delete(t),s.reject(c))}),s.promise}unfollowSession(t){this.followedSessions.delete(t),this.liveFollows.delete(t),this.followCursors.delete(t);let r=this.recoveries.get(t);this.recoveries.delete(t),r?.completion.reject(new Error(`mbh-chat stopped recovering session ${t}`)),this.followAborts.get(t)?.abort(),this.followAborts.delete(t),this.followReadiness.get(t)?.reject(new Error(`mbh-chat stopped following session ${t}`)),this.followReadiness.delete(t)}whenConnected(t){return this.connected?Promise.resolve():new Promise((r,i)=>{let n=()=>{a(),r()},o=u=>{a(),i(u)},s=()=>o(t?.reason??new Error("waiting for mbh-chat connection was aborted")),a=()=>{this.connectionWaiters.delete(c),t?.removeEventListener("abort",s)},c={resolve:n,reject:o};this.connectionWaiters.add(c),t?.addEventListener("abort",s,{once:!0}),t?.aborted&&s()})}async setConnected(t,r){if(t||(this.connected=!1),await r.onConnection?.(t),t){this.connected=!0;for(let i of this.connectionWaiters)i.resolve();this.connectionWaiters.clear()}}async run(t,r){let i=0;for(;!r.aborted;){let n=new AbortController;this.generationAbort=n;let o=()=>n.abort();r.addEventListener("abort",o,{once:!0});let s=nf(),a=!1,c;try{c=this.pumpEvents(t,n.signal,s.resolve);let u=c.then(()=>{throw new Error("a mbh-chat event stream closed")});await Promise.race([s.promise,u]),a=!0,i=0,await this.setConnected(!0,t);for(let l of this.followedSessions)this.startFollow(l,n.signal);await u}catch(u){r.aborted||this.logger.warn("mbh-chat connection lost",{error:te(u)})}finally{if(this.generationAbort=void 0,n.abort(),this.stopFollows(),this.api.disconnect(),await Promise.allSettled(c?[c]:[]),r.removeEventListener("abort",o),a)try{await this.setConnected(!1,t)}catch(u){this.logger.error("mbh-chat connection-state handler failed during disconnect",{error:te(u)})}}if(!r.aborted){let u=fbe(i++,this.reconnectMinMs,this.reconnectMaxMs);this.logger.info("reconnecting to mbh-chat Host",{delayMs:u,attempt:i}),await xI(u,r)}}}async pumpEvents(t,r,i){let n=!1;for await(let o of this.api.openEvents(r)){if(o.type==="ready"){this.api.eventClientId=o.clientId,n||(n=!0,i());continue}try{await t.onRemoteEvent(o)}catch(s){this.logger.error("mbh-chat event handler failed",{error:te(s)})}}}markFollowReady(t){this.liveFollows.add(t),this.followReadiness.get(t)?.resolve()}async startFollow(t,r){if(this.followAborts.has(t))return;let i=new AbortController;this.followAborts.set(t,i);let n=AbortSignal.any([r,i.signal]),o=!1,s=new Map;try{for await(let a of this.api.sessions.follow({address:{kind:"session",sessionId:t},assistantStream:!0,maxMessages:1e3},n)){if(a.type==="snapshot"){o=!0;let c=this.followCursors.get(t),u=this.recoveries.get(t);if(u){let f=await this.recoveryRecords(t,a,u.executionRpcId,n);this.recoveries.get(t)===u&&this.recoveries.delete(t);try{await u.onSnapshot(f),u.completion.resolve()}catch(p){throw u.completion.reject(p),p}}else if(c!==void 0)for(let f of a.records)f.seq>c&&this.handlers?.onSessionEvent(t,f);this.followCursors.set(t,a.cursor);let l=a.assistantStream?.activeAttempt;if(l){s.set(l.attemptId,{turn:l.turn,step:l.step});for(let[f,p]of cV(l.stream).entries())this.handlers?.onAssistantChunk(t,{attemptId:l.attemptId,index:f,turn:l.turn,step:l.step,time:p.time,chunk:p.chunk})}this.markFollowReady(t);continue}if(a.type==="assistant-stream"){let c=a.frame;if(c.type==="start")s.set(c.attemptId,{turn:c.turn,step:c.step});else if(c.type==="end")s.delete(c.attemptId);else{let u=s.get(c.attemptId);u&&this.handlers?.onAssistantChunk(t,{attemptId:c.attemptId,index:c.index,turn:u.turn,step:u.step,time:c.time,chunk:c.chunk})}continue}if(a.type==="event")try{this.handlers?.onSessionEvent(t,a.event),this.followCursors.set(t,a.event.seq)}catch(c){this.logger.error("mbh-chat session event handler failed",{sessionId:t,error:te(c)})}}if(!n.aborted)throw new Error(o?`mbh-chat session follow ended unexpectedly for ${t}`:`mbh-chat session follow ended before receiving a snapshot for ${t}`)}catch(a){if(!r.aborted&&!i.signal.aborted)if(pbe(a))o&&this.followedSessions.has(t)&&this.followReadiness.set(t,nf()),this.logger.warn("mbh-chat session follow ended; retrying",{sessionId:t,error:te(a)}),xI(this.reconnectMinMs,r).then(()=>{r.aborted||!this.followedSessions.has(t)||this.followAborts.has(t)||this.generationAbort?.signal!==r||this.startFollow(t,r)});else{let c=this.recoveries.get(t);c&&(this.recoveries.delete(t),c.completion.reject(a)),this.followReadiness.get(t)?.reject(a),this.logger.warn("mbh-chat session follow ended",{sessionId:t,error:te(a)})}}finally{this.followAborts.get(t)===i&&(this.followAborts.delete(t),this.liveFollows.delete(t))}}async recoveryRecords(t,r,i,n){let o=[...r.records],s=r.hasMore;for(;s&&lV(o,i)<0;){let c=o[0]?.seq;if(c===void 0)break;let u=Wr(await this.api.sessions.page({address:{kind:"session",sessionId:t},throughSeq:r.cursor,beforeSeq:c,maxMessages:1e3},n));if(u.records.length===0)break;o=[...u.records,...o],s=u.hasMore}let a=lV(o,i);return a<0?{matched:!1,records:[]}:{matched:!0,records:o.slice(a)}}stopFollows(){let t=[...this.liveFollows];for(let r of this.followAborts.values())r.abort();this.followAborts.clear(),this.liveFollows.clear();for(let r of t)this.followedSessions.has(r)&&this.followReadiness.set(r,nf())}};function lV(e,t){let r=-1;for(let i=e.length-1;i>=0;i-=1){let n=e[i];if(n?.type!=="user/message"||!n.data||typeof n.data!="object")continue;let o=n.data.source;if(!(!o||typeof o!="object"||o.kind!=="user")&&!(t&&o.rpcId!==t)){r=i;break}}if(r<0)return-1;for(let i=r;i>=0;i-=1)if(e[i]?.type==="turn/start")return i;return r}var of=0;function SI(e=Date.now()){return of=Math.max(e,of+1),String(of)}function fV(e,t=Date.now()){if(e){let i=Number(e);return Number.isSafeInteger(i)&&(of=Math.max(of,i)),{notification:e,chat:SI(t)}}return{notification:SI(t),chat:SI(t)}}function kc(e){let t,r=new Promise(s=>{t=s}),i=e.deadlineAt??Date.now()+e.taskTimeoutMs,n=Math.max(1,Math.min(e.turnTimeoutMs,i-Date.now())),o={context:e.context,botToken:e.botToken,businessKey:e.businessKey,dshSessionId:e.dshSessionId,...e.turn!==void 0?{turn:e.turn}:{},turnStartedAt:void 0,timeTakenMs:void 0,chunkIndex:e.chunkIndex??0,pendingText:"",cronText:"",cronAttachments:[],stepText:new Map,assistantStreamIndexes:new Map,pendingReasoning:"",stepReasoning:new Map,reasoningLineIndex:0,reasoningStarted:!1,reasoningMessageKey:void 0,reasoningSort:void 0,reasoningVisibleChars:0,reasoningLimitReached:!1,reasoningTruncationCount:0,skillNames:new Map(e.skillNames),toolCalls:new Map,pendingSubagents:new Set,subagentParents:new Map,settledSubagents:new Set,finalized:!1,followup:e.followup,deadlineAt:i,completion:r,resolveCompletion:t,submissionAbort:void 0,timeout:setTimeout(()=>e.onTimeout(o),n)};return o}async function dV(e,t,r,i){let n=new Map;for(let u of e.store.listActiveSubagentsForRoot(t))(!r||u.requestId===r)&&n.set(u.childSessionId,u.parentSessionId);for(let[u,l]of i??[])n.set(u,l);let o=!1,s=!1,a,c=u=>{e.store.settleSubagent(u,"cancelled"),n.delete(u)};for(let u=1;u<=e.config.task.maxAttempts;u+=1){let l=p=>{let d=0,h=p,m=new Set;for(;!m.has(h);){m.add(h);let _=n.get(h);if(!_)break;d+=1,h=_}return d},f=[...n].sort(([p],[d])=>l(d)-l(p));for(let[p,d]of f)try{Wr(await e.dsh.api.sessions.cancel({sessionId:p})),c(p)}catch(h){if(wI(h)){c(p);continue}a=h,e.logger.warn("subagent interrupt failed",{parentSessionId:d,childSessionId:p,attempt:u,error:te(h)})}if(!o)try{Wr(await e.dsh.api.sessions.cancel({sessionId:t})),o=!0}catch(p){wI(p)?(o=!0,s=!0):(a=p,e.logger.warn("model/tool cancellation failed",{dshSessionId:t,attempt:u,error:te(p)}))}if(o&&n.size===0)return s?"absent":"cancelled";if(u<e.config.task.maxAttempts){let p=Math.min(e.config.task.retryMaxMs,e.config.task.retryBaseMs*2**(u-1));await new Promise(d=>setTimeout(d,p))}}throw a instanceof Error?a:new Error("execution cancellation could not be confirmed")}var Wt={invalidGenerationLength:"\u5F53\u524D\u6A21\u578B\u7684\u751F\u6210\u957F\u5EA6\u914D\u7F6E\u4E0D\u53EF\u7528\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u540E\u91CD\u8BD5\uFF1B\u5982\u4ECD\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u3002",modelUnavailable:"\u5F53\u524D\u6A21\u578B\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u6216\u5207\u6362\u6A21\u578B\u3002",unsupportedInput:"\u5F53\u524D\u5185\u5BB9\u6682\u65F6\u65E0\u6CD5\u5904\u7406\uFF0C\u8BF7\u7F29\u77ED\u5185\u5BB9\u6216\u79FB\u9664\u5F02\u5E38\u5B57\u7B26\u540E\u91CD\u8BD5\u3002",emptyResponse:"\u6A21\u578B\u672A\u751F\u6210\u6709\u6548\u56DE\u590D\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\uFF1B\u5982\u4ECD\u5931\u8D25\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u3002",contextTooLong:"\u5F53\u524D\u5BF9\u8BDD\u5185\u5BB9\u8FC7\u957F\uFF0C\u8BF7\u7F29\u77ED\u5185\u5BB9\u6216\u65B0\u5EFA\u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002",imageTooLarge:"\u56FE\u7247\u8FC7\u5927\uFF0C\u8D85\u51FA\u5355\u8FB9\u50CF\u7D208192\u4E0A\u9650\uFF0C\u8BF7\u538B\u7F29\u6216\u88C1\u526A\u540E\u518D\u8BD5\u3002",attachmentInvalid:"\u9644\u4EF6\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",authenticationFailed:"\u6A21\u578B\u670D\u52A1\u8BA4\u8BC1\u5F02\u5E38\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u5904\u7406\u3002",permissionDenied:"\u5F53\u524D\u6A21\u578B\u6682\u4E0D\u53EF\u8BBF\u95EE\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u6216\u8054\u7CFB\u7BA1\u7406\u5458\u786E\u8BA4\u6743\u9650\u3002",quotaExhausted:"\u6A21\u578B\u670D\u52A1\u989D\u5EA6\u4E0D\u8DB3\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u6216\u8054\u7CFB\u7BA1\u7406\u5458\u3002",serviceBusy:"\u6A21\u578B\u670D\u52A1\u5F53\u524D\u7E41\u5FD9\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",timedOut:"\u6A21\u578B\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\uFF1B\u5982\u591A\u6B21\u5931\u8D25\uFF0C\u8BF7\u7F29\u77ED\u4EFB\u52A1\u5185\u5BB9\u3002",connectionFailed:"\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u6A21\u578B\u670D\u52A1\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",serviceUnavailable:"\u6A21\u578B\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",contentBlocked:"\u5F53\u524D\u5185\u5BB9\u672A\u80FD\u901A\u8FC7\u6A21\u578B\u670D\u52A1\u7684\u5B89\u5168\u68C0\u67E5\uFF0C\u8BF7\u8C03\u6574\u5185\u5BB9\u540E\u91CD\u8BD5\u3002",incompatibleRequest:"\u5F53\u524D\u8BF7\u6C42\u4E0E\u6A21\u578B\u914D\u7F6E\u4E0D\u517C\u5BB9\uFF0C\u8BF7\u8C03\u6574\u5185\u5BB9\u6216\u5207\u6362\u6A21\u578B\u540E\u91CD\u8BD5\u3002",interrupted:"\u672C\u6B21\u5904\u7406\u5DF2\u4E2D\u65AD\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",unknown:"\u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u56DE\u590D\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"};function pV(e){let t=e.indexOf("{"),r=e.lastIndexOf("}");if(!(t<0||r<=t))try{return he(JSON.parse(e.slice(t,r+1)))}catch{return}}function hy(e){let t=he(e)??pV(te(e).trim()),r=he(t?.details);return t?.code==="AR_AUTH_REJECTED"&&String(r?.gateway_error_code??"")==="1003"}function hV(e){let t=e.trim().replace(/^\[错误\]\s*/u,"").trim();if(!(!t||t.length>200)&&!/[\r\n]|\bat\s+\S+|[/\\][\w.-]+|token|secret|api.?key|password/iu.test(t))return t}function hbe(e){let t=pV(e);if(t)try{return typeof t.message!="string"?void 0:hV(t.message)}catch{return}}function mbe(e){let t=te(e).trim();if(/per-side pixel limit|image exceeds.{0,80}pixel/iu.test(t))return Wt.imageTooLarge;if(/attachment-invalid/iu.test(t))return Wt.attachmentInvalid;let r=hbe(t);return r||(/range of max_tokens|max_tokens.*(?:invalid|range|between|must be)/iu.test(t)?Wt.invalidGenerationLength:/no available channel|model (?:not found|unavailable)|unsupported model|unknown model|model .* does not exist/iu.test(t)?Wt.modelUnavailable:/tokenization failed|tokenizer.*(?:error|failed)/iu.test(t)?Wt.unsupportedInput:/completed response with no content|empty response|no content returned/iu.test(t)?Wt.emptyResponse:/context length|maximum context|context window|too many tokens|prompt is too long/iu.test(t)?Wt.contextTooLong:/content (?:policy|filter)|safety (?:policy|filter)|moderation|harmful content/iu.test(t)?Wt.contentBlocked:/\b(401|unauthorized|invalid api.?key|authentication failed|authentication error)\b/iu.test(t)?Wt.authenticationFailed:/\b(403|forbidden|permission denied|access denied)\b/iu.test(t)?Wt.permissionDenied:/\b402\b|insufficient (?:balance|credits?|quota)|quota (?:exceeded|exhausted)/iu.test(t)?Wt.quotaExhausted:/\b429\b|rate.?limit|too many requests|overload|server busy|service busy/iu.test(t)?Wt.serviceBusy:/timeout|timed out|deadline exceeded/iu.test(t)?Wt.timedOut:/econnrefused|econnreset|enotfound|socket hang up|network error|fetch failed|connection (?:closed|failed|lost)/iu.test(t)?Wt.connectionFailed:/\b5\d\d\b|bad gateway|service unavailable|upstream.*(?:error|failed)/iu.test(t)?Wt.serviceUnavailable:/invalidparameter|invalid parameter|\b400\b|bad request|unsupported (?:input|format)/iu.test(t)?Wt.incompatibleRequest:/abort(?:ed|error)?|cancel(?:led|ed)/iu.test(t)?Wt.interrupted:hV(t)??Wt.unknown)}function to(e){return`[\u9519\u8BEF] ${mbe(e)}`}var mV=2e3;function fs(e){return e.time/1e3+e.seq/1e9}function my(e,t){return Array.isArray(e)?e.map(r=>{let i=he(r);return i?.type===t&&typeof i.text=="string"?i.text:""}).join(""):""}function EI(e,t){let r=e.trim()||t;return r.length<=mV?r:`${r.slice(0,mV)}\u2026\u2026\uFF08\u5185\u5BB9\u5DF2\u622A\u65AD\uFF09`}function kI(e){return Array.isArray(e)?e.map(t=>{let r=he(t);if(!r)return"";if((r.type==="text"||r.type==="reasoning")&&typeof r.text=="string")return r.text;if(r.type==="image")return"[\u56FE\u7247]";try{return JSON.stringify(r)}catch{return"[\u65E0\u6CD5\u5C55\u793A\u7684\u5DE5\u5177\u7ED3\u679C]"}}).filter(Boolean).join(`
|
|
591
|
+
`)})}}var vl=class{baseUrl;fetchImpl;sessionCookie;constructor(t,r=fetch,i=jh()){this.baseUrl=t,this.fetchImpl=r,this.sessionCookie=i}url(t){return new URL(t,this.baseUrl.endsWith("/")?this.baseUrl:`${this.baseUrl}/`)}async patch(t,r){return(await this.fetchImpl(this.url(`${Bi}/${encodeURIComponent(t)}`),{method:"PATCH",headers:wn(this.sessionCookie,{"content-type":"application/json"}),body:JSON.stringify(r),signal:AbortSignal.timeout(15e3)})).ok}async patchJob(t,r){let i=await this.fetchImpl(this.url(`${Bi}/${encodeURIComponent(t)}`),{method:"PATCH",headers:wn(this.sessionCookie,{"content-type":"application/json"}),body:JSON.stringify(r),signal:AbortSignal.timeout(15e3)});if(!i.ok)return;let n=await i.json().catch(()=>{});return yl({type:La,version:1,jobs:[n]}).jobs.find(o=>o.id===t)}setEnabled(t,r){return this.patch(t,{enabled:r})}async delete(t){let r=await this.fetchImpl(this.url(`${Bi}/${encodeURIComponent(t)}`),{method:"DELETE",headers:wn(this.sessionCookie),signal:AbortSignal.timeout(15e3)});return r.ok?"deleted":r.status===404?"not_found":"failed"}async runOnce(t){let r=await this.fetchImpl(this.url(`${Bi}/${encodeURIComponent(t)}/run`),{method:"POST",headers:wn(this.sessionCookie),signal:AbortSignal.timeout(15e3)}),i=await r.json().catch(()=>{}),n=Nr(i)&&typeof i.status=="string"?i.status:void 0;return n==="dispatched"||n==="not_found"||n==="already_running"||n==="delivery_unavailable"?n:r.status===404?"not_found":r.status===202?"already_running":r.ok&&Nr(i)&&i.delivered===!0?"dispatched":"delivery_unavailable"}async list(){let t=await this.fetchImpl(this.url(`${Bi}`),{method:"GET",headers:wn(this.sessionCookie),signal:AbortSignal.timeout(15e3)});if(!t.ok)return;let r=await t.json().catch(()=>{});if(!(!Nr(r)||!Array.isArray(r.jobs)))return yl({type:La,version:1,sequence:0,generatedAt:new Date().toISOString(),reason:"fetch",jobs:r.jobs})}async subscribe(t,r,i=()=>{}){let n=await this.fetchImpl(this.url(`${Bi}/events`),{method:"GET",headers:wn(this.sessionCookie,{accept:"text/event-stream"}),signal:r});if(!n.ok||!n.body)throw new Error(`cron SSE failed with HTTP ${n.status}`);let o=n.body.getReader(),s=new TextDecoder,a="";for(;;){let{value:c,done:u}=await o.read();if(u){if(!r.aborted)throw new Error("cron SSE stream ended");return}a+=s.decode(c,{stream:!0});let{events:l,rest:f}=_se(a);a=f;for(let p of l)if(p.event==="cron-list")try{t(yl(JSON.parse(p.data)))}catch(d){i(d)}}}};var wse=100,xse=1e3,Sse=3e4;function HE(e){let{updatedAtMs:t,state:r,...i}=e;return JSON.stringify(i,(n,o)=>o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).sort(([s],[a])=>s.localeCompare(a))):o)}function Ese(e,t){return new Promise(r=>{if(e.aborted){r();return}let i=()=>{clearTimeout(n),e.removeEventListener("abort",i),r()},n=setTimeout(i,t);n.unref(),e.addEventListener("abort",i,{once:!0})})}var Mh=class{options;client;abort;loop;debounce;publishTail=Promise.resolve();lastFingerprint;lastSnapshot;lastJobs=new Map;lastContexts=new Map;constructor(t){this.options=t,this.client=new vl(t.dshBaseUrl,t.fetchImpl)}start(){this.loop||(this.abort=new AbortController,this.loop=this.run(this.abort.signal))}async stop(){this.abort?.abort(),this.debounce&&clearTimeout(this.debounce),this.debounce=void 0,await this.loop?.catch(()=>{}),await this.publishTail,this.loop=void 0,this.abort=void 0}async applyControl(t,r){if(t==="remove"){let o=await this.client.delete(r);return{applied:o!=="failed",...o==="not_found"?{reconciled:!0}:{}}}if(t==="enable")return{applied:await this.client.setEnabled(r,!0)};if(t==="disable")return{applied:await this.client.setEnabled(r,!1)};let i=await this.ensureSessionForCron(r);if(i)return{applied:!1,runStatus:i};await this.ensureSessionFollowed(r);let n=await this.client.runOnce(r);return n==="delivery_unavailable"&&(n=await this.rebindAndRetryRun(r,n)),{applied:n==="dispatched"||n==="already_running",runStatus:n}}notifySessionAvailable(){this.lastSnapshot&&this.schedulePublish(this.lastSnapshot)}businessKeyForCronId(t){let r=this.lastSnapshot?.jobs.find(i=>i.id===t);if(r)return this.sessionKeyFor(r)}async bindDshSessionId(t,r){if(!Lo(t))return;let i=this.lastSnapshot??await this.client.list();if(!i)return;let n=i.jobs.filter(o=>o.sessionKey===t&&(!o.dshSessionId||o.dshSessionId!==r));n.length!==0&&await Promise.all(n.map(async o=>{await this.client.patch(o.id,{dshSessionId:r})?(this.options.logger.info("bound cron job to mbh-chat session",{cronId:o.id,sessionKey:t,dshSessionId:r}),this.followCronSession(r)):this.options.logger.warn("failed to patch cron dshSessionId binding",{cronId:o.id,sessionKey:t,dshSessionId:r})}))}async bindAllKnownDshSessions(){let t=this.lastSnapshot??await this.client.list();if(!t)return;let r=new Map;for(let i of t.jobs){if(!i.sessionKey||!Lo(i.sessionKey))continue;let n=this.options.store.getSession(i.sessionKey)??await this.options.provisionSession?.(i);!n||i.dshSessionId===n||r.set(i.id,n)}r.size!==0&&await Promise.all([...r.entries()].map(async([i,n])=>{await this.client.patch(i,{dshSessionId:n})?(this.options.logger.info("bound cron job to pre-existing mbh-chat session",{cronId:i,dshSessionId:n}),this.followCronSession(n)):this.options.logger.warn("failed to patch cron dshSessionId binding",{cronId:i,dshSessionId:n})}))}async run(t){let r=0;for(;!t.aborted;)try{await this.client.subscribe(i=>this.schedulePublish(i),t,i=>this.options.logger.warn("ignored invalid cron catalog SSE event",{error:te(i)})),r=0}catch(i){if(t.aborted)return;r+=1;let n=Math.min(Sse,xse*2**Math.min(r-1,8));this.options.logger.warn("cron catalog SSE disconnected; retrying",{delayMs:n,error:te(i)}),await Ese(t,n)}}schedulePublish(t){this.lastSnapshot=t,this.debounce&&clearTimeout(this.debounce),this.debounce=setTimeout(()=>{this.debounce=void 0,this.publishTail=this.publishTail.then(()=>this.publish(t)).catch(r=>this.options.logger.warn("failed to publish cron catalog to Mobook",{error:te(r)}))},this.options.debounceMs??wse),this.debounce.unref()}async rebindAndRetryRun(t,r){let n=(await this.client.list().catch(()=>{}))?.jobs.find(s=>s.id===t);if(!n?.sessionKey||!Lo(n.sessionKey))return r;let o=this.options.store.getSession(n.sessionKey);return!o||o===n.dshSessionId||!await this.client.patch(t,{dshSessionId:o})?r:(this.options.logger.info("rebound stale cron DSH session before manual run",{cronId:t,dshSessionId:o}),await this.followCronSession(o),this.client.runOnce(t))}async ensureSessionForCron(t){let r=await this.client.list().catch(()=>{});if(!r)return"delivery_unavailable";let i=r.jobs.find(s=>s.id===t);if(!i)return"not_found";let n=this.sessionKeyFor(i);if(!n||!Lo(n))return"delivery_unavailable";let o=this.options.store.getSession(n)??await this.options.provisionSession?.(i);if(!o||i.dshSessionId!==o&&!await this.client.patch(t,{dshSessionId:o}))return"delivery_unavailable"}contextFor(t){if(t.sessionKey)return this.options.store.getLatestContextForBusinessKey(t.sessionKey);let r=this.options.store.getBusinessKeyByDshSessionId(t.dshSessionId??t.agentId);return r?this.options.store.getLatestContextForBusinessKey(r):void 0}sessionKeyFor(t){return t.sessionKey?t.sessionKey:this.options.store.getBusinessKeyByDshSessionId(t.dshSessionId??t.agentId)}send(t,r){return this.options.dcg.enqueueEvent(t,r)!==!1}async publish(t){let r=[];for(let u of t.jobs){let l=this.sessionKeyFor(u);if(!l){r.push(u);continue}let f=Fa(l),p=this.options.store.getSession(l),d={...u.sessionKey===l?{}:{sessionKey:l},...p&&u.dshSessionId!==p?{dshSessionId:p}:{},...f.agentId&&u.agentId!==f.agentId?{agentId:f.agentId}:{}};if(Object.keys(d).length>0){let h=await this.client.patchJob(u.id,d);if(!h){this.options.logger.warn("failed to persist cron sessionKey binding",{cronId:u.id});return}r.push(h)}else r.push(u)}let i=WE(r,u=>this.sessionKeyFor(u)),n=JSON.stringify(i.jobs.map(u=>[u.id,HE(u)]).sort());if(n===this.lastFingerprint)return;if(t.jobs.length>0&&i.jobs.length===0){this.options.logger.warn("skipping Mobook cron catalog publish; no mbh-chat session mapping is available yet");return}let o=new Set(i.jobs.map(u=>u.id)),s=new Set,a=new Set;for(let u of i.jobs){let l=HE(u);if(this.lastJobs.get(u.id)===l)continue;let f=r.find(d=>d.id===u.id),p=f?this.contextFor(f):void 0;if(!p){this.options.logger.warn("skipping cron install; no mapped mbh-chat session is available",{cronId:u.id}),s.add(u.id);continue}if(!this.send(p,{event_type:"cron",operation_type:"install",data:u})){this.options.logger.warn("cron install event was not sent; will retry",{cronId:u.id});return}this.lastJobs.set(u.id,l),this.lastContexts.set(u.id,p),this.lastFingerprint=void 0,this.options.logger.info("enqueued cron install to Mobook",{cronId:u.id,sequence:t.sequence})}if(t.invalidJobCount===0)for(let u of this.lastJobs.keys()){if(o.has(u))continue;let l=this.lastContexts.get(u);if(!l){this.options.logger.warn("skipping cron remove; no mapped mbh-chat session is available",{cronId:u}),a.add(u);continue}if(!this.send(l,{event_type:"cron",operation_type:"remove",data:{id:u,jobId:u,action:"removed"}})){this.options.logger.warn("cron remove event was not sent; will retry",{cronId:u});return}this.lastJobs.delete(u),this.lastContexts.delete(u),this.lastFingerprint=void 0}else this.options.logger.warn("cron snapshot contained invalid jobs; preserving previously published jobs",{invalidJobCount:t.invalidJobCount});let c=new Map([...this.lastJobs].filter(([u])=>o.has(u)||a.has(u)));for(let u of i.jobs)s.has(u.id)||c.set(u.id,HE(u));if(t.invalidJobCount>0)for(let[u,l]of this.lastJobs)c.has(u)||c.set(u,l);this.lastJobs=c,this.lastFingerprint=t.invalidJobCount===0&&s.size===0&&a.size===0?n:void 0,this.followBoundJobs(r),this.options.logger.info("published cron catalog to Mobook",{jobs:i.jobs.length,sequence:t.sequence})}async ensureSessionFollowed(t){let i=(this.lastSnapshot??await this.client.list().catch(()=>{}))?.jobs.find(s=>s.id===t);if(!i)return;let n=this.sessionKeyFor(i),o=n?this.options.store.getSession(n):void 0;o&&await this.followCronSession(o)}followBoundJobs(t){let r=new Set;for(let i of t){let n=this.sessionKeyFor(i),o=n?this.options.store.getSession(n):void 0;!o||r.has(o)||(r.add(o),this.followCronSession(o))}}async followCronSession(t){this.options.followSession&&await this.options.followSession(t)}};import{timingSafeEqual as kse}from"node:crypto";import za from"node:fs";import Tse from"node:http";import Ise from"node:path";var BL=1024*1024,rIe=64*1024;function Ose(e,t){if(!e?.startsWith("Bearer "))return!1;let r=Buffer.from(e.slice(7)),i=Buffer.from(t);return r.length===i.length&&kse(r,i)}async function Cse(e){let t=[],r=0;for await(let i of e){let n=Buffer.isBuffer(i)?i:Buffer.from(i);if(r+=n.length,r>BL)throw new Error(`request body exceeds ${BL} bytes`);t.push(n)}return JSON.parse(Buffer.concat(t).toString("utf8"))}function Ua(e,t,r){let i=JSON.stringify(r);e.writeHead(t,{"content-type":"application/json; charset=utf-8","content-length":Buffer.byteLength(i)}),e.end(i)}var Lh=class{socketPath;token;handler;statusProvider;server;constructor(t,r,i,n){this.socketPath=t,this.token=r,this.handler=i,this.statusProvider=n}async start(){if(this.server)throw new Error("message control server already started");if(process.platform!=="win32"){za.mkdirSync(Ise.dirname(this.socketPath),{recursive:!0});try{if(!za.lstatSync(this.socketPath).isSocket())throw new Error(`refusing to replace non-socket control path: ${this.socketPath}`);za.unlinkSync(this.socketPath)}catch(r){if(r.code!=="ENOENT")throw r}}let t=Tse.createServer((r,i)=>{this.handle(r,i)});this.server=t,await new Promise((r,i)=>{let n=s=>{t.off("listening",o),i(s)},o=()=>{t.off("error",n),r()};t.once("error",n),t.once("listening",o),t.listen(this.socketPath)}),process.platform!=="win32"&&za.chmodSync(this.socketPath,384)}async stop(){let t=this.server;if(this.server=void 0,t&&await new Promise(r=>t.close(()=>r())),process.platform!=="win32")try{za.lstatSync(this.socketPath).isSocket()&&za.unlinkSync(this.socketPath)}catch(r){if(r.code!=="ENOENT")throw r}}async handle(t,r){let i=t.method==="POST"&&t.url==="/v1/message",n=t.method==="GET"&&t.url==="/v1/status";if(!i&&!n){Ua(r,404,{error:"not found"});return}if(!Ose(t.headers.authorization,this.token)){Ua(r,401,{error:"unauthorized"});return}if(n){if(!this.statusProvider){Ua(r,404,{error:"not found"});return}Ua(r,200,this.statusProvider());return}let o=new AbortController,s=()=>o.abort(new Error("control client disconnected"));t.once("aborted",s);try{let a=await Cse(t),c=await this.handler(a,o.signal);Ua(r,c.success?200:422,c)}catch(a){Ua(r,400,{success:!1,sentMediaCount:0,queued:!1,error:a instanceof Error?a.message:String(a)})}finally{t.off("aborted",s)}}};import{createHash as Ase}from"node:crypto";var Fo=class extends Error{status;constructor(t,r){super(t),this.status=r,this.name="DcgApiRequestError"}};function $se(e){return e!==null&&typeof e=="object"?JSON.stringify(e):String(e)}function Rse(e,t,r,i,n="1.0.0"){let o={timestamp:t,path:r,version:n,...e},s=Object.keys(o).sort().map(a=>o[a]===void 0?"":`${a}${$se(o[a])}`).join("")+i;return Ase("md5").update(s).digest("hex").toUpperCase()}function Dse(e,t){try{let r=new URL(t,e);return`POST ${r.origin}${r.pathname}`}catch{return`POST ${t.split("?",1)[0]??""}`}}var Fh=class{config;logger;fetchImpl;timeoutMs;constructor(t,r,i=fetch,n=6e4){this.config=t,this.logger=r,this.fetchImpl=i,this.timeoutMs=n}async post(t,r,i={}){if(!t.startsWith("/")||t.startsWith("//"))throw new Error("mbh-chat API request path must be an origin-relative path");let n=new URL(this.config.apiBaseUrl),o=new URL(t,n);if(o.origin!==n.origin)throw new Error("mbh-chat API request path must stay on the configured origin");let s=typeof i.appId=="number"&&Number.isFinite(i.appId)?Math.trunc(i.appId):typeof i.appId=="string"&&i.appId.trim()?i.appId.trim():this.config.appId,a={...r,_appId:s},c=Date.now(),u=AbortSignal.timeout(this.timeoutMs),l=i.signal?AbortSignal.any([i.signal,u]):u,f=Dse(this.config.apiBaseUrl,t);try{let p=await this.fetchImpl(o,{method:"POST",signal:l,headers:{"content-type":"application/json",appKey:this.config.apiAppKey,sign:Rse(a,c,t,this.config.apiSignKey,this.config.apiVersion),timestamp:String(c),version:this.config.apiVersion,...i.userToken?{authorization:i.userToken}:{}},body:JSON.stringify(a)});if(!p.ok)throw await p.body?.cancel(),new Fo(`mbh-chat API request failed with HTTP ${p.status}`,p.status);let d=await p.json();if(!d||typeof d!="object"||Array.isArray(d))throw new Fo("mbh-chat API returned a non-object JSON response",p.status);return d}catch(p){let d=p instanceof Fo?p.status:void 0;throw this.logger.warn("mbh-chat API request failed",{request:f,...d!==void 0?{status:d}:{},error:p instanceof Error?p.message:String(p)}),p}}};var zh=class{ttlMs;tokens=new Map;pending=new Map;constructor(t=3600*1e3){if(this.ttlMs=t,!Number.isFinite(t)||t<=0)throw new Error("user-token cache ttlMs must be positive")}key(t,r){return`${t}\0${r.userId}\0${r.appId}`}get(t,r){let i=this.key(t,r),n=this.tokens.get(i);if(n){if(Date.now()>=n.expiresAt){this.tokens.delete(i);return}return n.token}}set(t,r,i){this.tokens.set(this.key(t,r),{token:i,expiresAt:Date.now()+this.ttlMs})}delete(t,r){this.tokens.delete(this.key(t,r))}async getOrLoad(t,r,i){let n=this.get(t,r);if(n)return n;let o=this.key(t,r),s=this.pending.get(o);if(s)return s;let a=i().then(c=>{if(!c)throw new Error("mbh-chat user-token lookup returned an empty token");return this.set(t,r,c),c}).finally(()=>this.pending.delete(o));return this.pending.set(o,a),a}clear(){this.tokens.clear(),this.pending.clear()}};var WL=1001;function bl(e,t){let r=t.code===void 0?"unknown":String(t.code),i=typeof t.message=="string"?t.message.replace(/[\u0000-\u001f\u007f]+/g," ").slice(0,300):"";return new Error(`${e} failed (code=${r})${i?`: ${i}`:""}`)}function Nse(e){return Number(e.code)===401||/illegal authorization/iu.test(e.message??"")}function Uh(e,t,r){let i=e==null||e===""?t:e,n=typeof i=="number"?i:Number(String(i).trim());if(!Number.isSafeInteger(n)||n<0)throw new Error(`${r} must be a non-negative safe integer`);return n}function Pse(e){let t=e.match(/^(.*?)-(\d+(?:-\d+)*)$/);return t?t[1]??"":""}var Bh=class{config;client;tokenCache;constructor(t,r,i){this.config=t,this.client=new Fh(t,r,i?.fetchImpl,i?.timeoutMs),this.tokenCache=i?.tokenCache??new zh}context(t){return{appId:typeof t?.appId=="number"&&Number.isFinite(t.appId)?String(Math.trunc(t.appId)):typeof t?.appId=="string"&&t.appId.trim()?t.appId.trim():this.config.appId,userId:Number.isFinite(t?.userId)?t?.userId??0:Number(this.config.userId)||0}}async queryUserTokenByBotToken(t,r){let i=this.context(r),n=await this.client.post("/organization/queryUserTokenByBotTokenV2",{botToken:t,_userId:i.userId},{appId:i.appId,...r?.signal?{signal:r.signal}:{}});if(!n.data?.token)throw bl("mbh-chat user-token lookup",n);return n.data.token}async getUserToken(t,r){let i=t.trim();if(!i)throw new Error("botToken is required for mbh-chat API authentication");let n=this.context(r);return this.tokenCache.getOrLoad(i,n,()=>this.queryUserTokenByBotToken(i,r))}async withUserToken(t,r,i,n){let o=t.trim(),s=this.context(r),a=await this.getUserToken(o,r);for(let c=0;;c+=1){try{let u=await i(a);if(c!==0||!n?.(u))return u}catch(u){if(c!==0||!(u instanceof Fo)||u.status!==401)throw u}this.tokenCache.delete(o,s),a=await this.getUserToken(o,r)}}async generateSignUrl(t,r,i){if(!t.trim())throw new Error("fileUrl is required for mbh-chat generateSignUrl");let n=this.context(i),o=await this.withUserToken(r,i,s=>this.client.post("/user/generateSignUrl",{loudPlatform:0,fileName:t},{appId:n.appId,userToken:s,...i?.signal?{signal:i.signal}:{}}));if(Number(o.code)!==0||!o.data?.filePath)throw bl("mbh-chat generateSignUrl",o);return o.data.filePath}async getOnlineAgents(t,r,i={}){let n=t.trim(),o=r.trim();if(!n)throw new Error("cloneCode is required for Agent package lookup");if(!o)throw new Error("botToken is required for mbh-chat Agent package lookup");let s=this.context(i),a=Uh(i.userId,s.userId,"_userId"),c=Uh(i.domainId,this.config.domainId,"_domainId"),u=await this.withUserToken(o,i,p=>this.client.post("/resource/getOnlineAgents",{_orgId:WL,_domainId:c,pageNo:1,names:[Pse(n)],withDownload:!0,_userId:a},{appId:40,userToken:p,...i.signal?{signal:i.signal}:{}}));if(Number(u.code)!==0)throw bl("mbh-chat Agent package lookup",u);let l=he(u.data)?.list;if(!Array.isArray(l))throw new Error("mbh-chat Agent package lookup returned an invalid list");let f=l.map(p=>he(p)).map(p=>Ke(p?Se(p,"downloadUrl","download_url"):void 0)).find(Boolean);if(!f)throw new Error(`Agent ${n} has no downloadable package`);return f}async getOnlineSkills(t,r,i={}){let n=t.trim(),o=r.trim();if(!n)throw new Error("skillCode is required for Skill package lookup");if(!o)throw new Error("botToken is required for mbh-chat Skill package lookup");let s=this.context(i),a=Uh(i.userId,s.userId,"_userId"),c=Uh(i.domainId,this.config.domainId,"_domainId"),u=await this.withUserToken(o,i,p=>this.client.post("/resource/getOnlineSkills",{_orgId:WL,_domainId:c,pageNo:1,names:[n],withDownload:!0,_userId:a},{appId:40,userToken:p,...i.signal?{signal:i.signal}:{}}));if(Number(u.code)!==0)throw bl("mbh-chat Skill package lookup",u);let l=he(u.data)?.list;if(!Array.isArray(l))throw new Error("mbh-chat Skill package lookup returned an invalid list");let f=l.map(p=>he(p)).map(p=>Ke(p?Se(p,"downloadUrl","download_url"):void 0)).find(Boolean);if(!f)throw new Error(`Skill ${n} has no downloadable package`);return f}async getStsToken(t,r,i,n){if(!t.trim())throw new Error("sourceFileName is required for mbh-chat STS credentials");let o=this.context(n),s=await this.withUserToken(r,n,a=>this.client.post("/user/getStsTokenByAsync",{sourceFileName:t,isPrivate:i},{appId:o.appId,userToken:a,...n?.signal?{signal:n.signal}:{}}),Nse);if(!s.data?.bucket)throw bl("mbh-chat STS credential lookup",s);return s.data}};var GH=Vr(ZH(),1);import{extname as Nve}from"node:path";import{fileURLToPath as Pve}from"node:url";var qve=GH.default,jve=1024*1024,Mve=900*1e3;function Lve(e){if(typeof e=="string"){let t=e.trim();if(t.startsWith("file:"))try{return Pve(t)}catch{return e}return e}if(Buffer.isBuffer(e))return e;if(e&&typeof e=="object"){if(ArrayBuffer.isView(e)&&!(e instanceof DataView)&&!Buffer.isBuffer(e)){let i=e;return Buffer.from(i.buffer,i.byteOffset,i.byteLength)}let t=e,r=t.path??t.filePath;if(typeof r=="string"&&r.trim())return r.trim()}return e}var Fve={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".webp":"image/webp",".bmp":"image/bmp",".svg":"image/svg+xml",".ico":"image/x-icon",".avif":"image/avif",".heic":"image/heic",".heif":"image/heif",".pdf":"application/pdf",".epub":"application/epub+zip",".mp4":"video/mp4",".webm":"video/webm",".mov":"video/quicktime",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".opus":"audio/opus",".m4a":"audio/mp4",".aac":"audio/aac",".flac":"audio/flac",".txt":"text/plain; charset=utf-8",".log":"text/plain; charset=utf-8",".csv":"text/csv; charset=utf-8",".html":"text/html; charset=utf-8",".htm":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".json":"application/json; charset=utf-8",".xml":"application/xml; charset=utf-8",".md":"text/markdown; charset=utf-8",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation"};function dI(e){let t=e.split(/[/\\]/).pop()??e,r=Nve(t).toLowerCase();return r?Fve[r]:void 0}function zve(e,t){if(typeof e=="string")return dI(e)??"application/octet-stream";if(Buffer.isBuffer(e)){if(t){let n=dI(t);if(n)return n}return"application/octet-stream"}let r=e.type?.trim();if(r&&r!=="application/octet-stream")return r;let i=typeof e.name=="string"&&e.name?e.name:"";if(i){let n=dI(i);if(n)return n}return r||"application/octet-stream"}function Uve(e){let t=e.split(";",1)[0]?.trim().toLowerCase()??"";return t==="application/epub+zip"||t==="image/svg+xml"||t==="application/xml"||t==="text/javascript"||t==="application/javascript"?"attachment":"inline"}async function Bve(e){if(Buffer.isBuffer(e))return{content:e,fileName:"file"};if(typeof e=="string")return{content:e,fileName:e.split(/[/\\]/).pop()??"file"};let t=Buffer.from(await e.arrayBuffer()),r=e.name;return{content:t,fileName:typeof r=="string"&&r?r:"file"}}var pI=class{api;logger;constructor(t,r){this.api=t,this.logger=r}async upload(t,r,i=1,n,o){let s=Lve(t),{content:a,fileName:c}=await Bve(s),u=await this.api.getStsToken(c,r,i,o),l=zve(s,c),f=n?.onProgress,p={accessKeyId:u.tempAccessKeyId,accessKeySecret:u.tempAccessKeySecret,stsToken:u.tempSecurityToken,bucket:u.bucket,endpoint:u.endPoint,region:u.region,secure:!0,cname:!0,authorizationV4:!0,timeout:n?.timeoutMs??Mve},d=new qve(p),h=`${u.uploadDir}${u.ossFileKey}`;try{let m,_={progress:g=>{f?.(g)},parallel:4,partSize:jve,mime:l,headers:{"Content-Disposition":Uve(l)}};if(m=await d.multipartUpload(h,a,_),m?.res?.status!==200)throw new Error(`OSS upload failed with status ${m?.res?.status??"unknown"}`);let S=(m?.res?.requestUrls||[])[0]||"",v=i===1&&m.name||S;if(!v)throw new Error("OSS upload succeeded but returned no object name or URL");return v}catch(m){throw this.logger.error("OSS upload failed",{error:m instanceof Error?m.message:String(m)}),m}}};function KH(e,t){let r=new pI(e,t);return r.upload.bind(r)}var cy=class{tails=new Map;generations=new Map;enqueue(t,r){let i=this.tails.get(t)??Promise.resolve(),n=this.generations.get(t)??0,o=i.catch(()=>{}).then(async()=>{(this.generations.get(t)??0)===n&&await r()});return this.tails.set(t,o),o.finally(()=>{this.tails.get(t)===o&&(this.tails.delete(t),this.generations.delete(t))}).catch(()=>{}),o}cancelPending(t){this.tails.has(t)&&this.generations.set(t,(this.generations.get(t)??0)+1)}cancelAllPending(){for(let t of this.tails.keys())this.cancelPending(t)}};import{randomUUID as mI}from"node:crypto";import Jve from"node:fs";import Ir from"node:fs/promises";import Yve from"node:os";import fi from"node:path";var YH=Vr(fE(),1);import Wve from"node:fs";import XH from"node:fs/promises";import rf from"node:path";import{Transform as Hve}from"node:stream";import{pipeline as Vve}from"node:stream/promises";var QH=500*1024*1024,hI=1024*1024*1024,JH=2e4;function Zve(e){if((e.flags&2048)!==0)return new TextDecoder("utf-8").decode(e.pathBuffer);try{return new TextDecoder("utf-8",{fatal:!0}).decode(e.pathBuffer)}catch{return new TextDecoder("gbk").decode(e.pathBuffer)}}function Gve(e){let t=e.replaceAll("\\","/"),r=t.split("/").filter(Boolean);if(t.startsWith("/")||/^[a-z]:\//i.test(t)||r.some(i=>i==="."||i===".."))throw new Error(`skill archive contains an unsafe path: ${e}`);return t}function Kve(e){let t=e.map(n=>n.replaceAll("\\","/").replace(/\/+$/,"")).filter(Boolean);if(t.length===0)return;let r=new Set(t.map(n=>n.split("/").filter(Boolean)[0]).filter(Boolean));if(r.size!==1)return;let i=[...r][0];return i&&t.some(n=>n.startsWith(`${i}/`))&&t.every(n=>n===i||n.startsWith(`${i}/`))?i:void 0}function Xve(e,t){let r=rf.resolve(e,t),i=rf.relative(rf.resolve(e),r);if(!i||i.startsWith("..")||rf.isAbsolute(i))throw new Error(`skill archive contains an unsafe path: ${t}`);return r}var uy=class extends Hve{limitBytes;budget;constructor(t,r){super(),this.limitBytes=t,this.budget=r}_transform(t,r,i){if(this.budget.used+=t.length,this.budget.used>this.limitBytes){i(new Error(`skill archive expands beyond ${this.limitBytes} bytes`));return}i(null,t)}};async function eV(e,t){let r=await YH.default.Open.buffer(e);if(r.files.length>JH)throw new Error(`skill archive exceeds ${JH} entries`);let i=r.files.reduce((a,c)=>a+c.uncompressedSize,0);if(!Number.isSafeInteger(i)||i>hI)throw new Error(`skill archive expands beyond ${hI} bytes`);let n=r.files.map(a=>Gve(Zve(a))),o=Kve(n),s={used:0};for(let a=0;a<r.files.length;a+=1){let c=r.files[a],u=n[a];if(!c||!u)continue;let l=u.replaceAll("\\","/");if(o&&(l===o||l===`${o}/`)||(o&&l.startsWith(`${o}/`)&&(l=l.slice(o.length+1)),l=l.replace(/\/+$/,""),!l))continue;let f=Xve(t,l);if(c.type==="Directory"){await XH.mkdir(f,{recursive:!0});continue}if(c.type!=="File")throw new Error(`skill archive contains an unsupported entry: ${u}`);await XH.mkdir(rf.dirname(f),{recursive:!0}),await Vve(c.stream(),new uy(hI,s),Wve.createWriteStream(f,{mode:384}))}}var Qve=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function tV(e){let t=new Map;if(!Array.isArray(e.skills_scope))return t;for(let r of e.skills_scope){let i=he(r);if(!i)continue;let n=Ke(Se(i,"skill_code","skillCode","code"));if(!n)continue;let o=Ke(Se(i,"short_name","shortName","skill_name","skillName","name"));o&&t.set(n,o)}return t}function fy(e){let t=Array.isArray(e.skills_scope)?he(e.skills_scope[0]):void 0,r=Array.isArray(e.intent_recognition)?e.intent_recognition.map(he).filter(c=>!!c).find(c=>Ke(Se(c,"biz_type","bizType")).toLowerCase()==="skill"):void 0,i=t??r;if(!i)return;let n=Ke(Se(i,"skill_code","skillCode"))||(i===r?Ke(i.name):"");if(!n)return;let o=Ke(Se(i,"short_name","shortName","name"))||n,s=Ke(Se(i,"url","download_url","downloadUrl","skill_url","skillUrl")),a=Se(i,"skill_id","skillId","id");return{code:n,url:s,name:o,...typeof a=="string"||typeof a=="number"?{id:a}:{}}}var ly=class{logger;options;dshHome;skillsRoot;skillsDisplayRoot;operations=new Map;constructor(t,r={}){this.logger=t,this.options=r,this.dshHome=io(),this.skillsRoot=GI("skills"),this.skillsDisplayRoot=fi.join(KI(this.dshHome),"skills")}normalizeCode(t){let r=t.trim();if(!Qve.test(r))throw new Error(`invalid mbh-chat skill code: ${r||"<empty>"}`);return r}skillPath(t){return fi.join(this.skillsRoot,this.normalizeCode(t))}skillDisplayPath(t){return fi.join(this.skillsDisplayRoot,this.normalizeCode(t))}exists(t){try{return Jve.existsSync(fi.join(this.skillPath(t),"SKILL.md"))}catch{return!1}}install(t,r){return this.serialized(r,async()=>{let i,n;try{if(i=this.normalizeCode(r),n=this.skillPath(i),!t.trim())throw new Error("skill url is empty")}catch(c){return{success:!1,status:"fail",error:te(c)}}let o=fi.dirname(n),s=fi.join(o,`.${i}.${mI()}.tmp`),a=fi.join(o,`.${i}.${mI()}.bak`);try{await Ir.mkdir(o,{recursive:!0,mode:448}),await rl(async()=>{await Ir.rm(s,{recursive:!0,force:!0}),await Ir.mkdir(s,{recursive:!0,mode:448});let u=await this.download(t);await eV(u,s);let l=fi.join(s,"SKILL.md");if(!(await Ir.stat(l).catch(()=>{}))?.isFile())throw new Error("skill archive does not contain a root SKILL.md")});let c=await Ir.stat(n).then(()=>!0,()=>!1);c&&await Ir.rename(n,a);try{await Ir.rename(s,n)}catch(u){throw c&&await Ir.rename(a,n).catch(()=>{}),u}return await Ir.rm(a,{recursive:!0,force:!0}).catch(u=>{this.logger.warn("could not remove the previous mbh-chat skill backup",{code:i,error:te(u)})}),this.logger.info("installed mbh-chat skill",{code:i,path:this.skillDisplayPath(i)}),{success:!0,status:"ok"}}catch(c){return await Ir.rm(s,{recursive:!0,force:!0}).catch(()=>{}),this.logger.error("mbh-chat skill installation failed",{code:i,error:te(c)}),{success:!1,status:"fail",error:te(c)}}})}uninstall(t){return this.serialized(t,async()=>{try{let r=this.normalizeCode(t),i=this.skillPath(r);return await Ir.rm(i,{recursive:!0,force:!0}),this.logger.info("uninstalled mbh-chat skill",{code:r,path:this.skillDisplayPath(r)}),{success:!0,status:"ok"}}catch(r){return this.logger.error("mbh-chat skill removal failed",{code:t,error:te(r)}),{success:!1,status:"fail",error:te(r)}}})}eventContent(t,r){return{event_type:"skill",operation_type:"install",skill_url:t.url,skill_code:t.code,...t.id!==void 0?{skill_id:t.id}:{},...r?{bot_token:r}:{}}}serialized(t,r){let i=t.trim(),o=(this.operations.get(i)??Promise.resolve({success:!0,status:"ok"})).catch(()=>{}).then(r);return this.operations.set(i,o),o.finally(()=>{this.operations.get(i)===o&&this.operations.delete(i)}),o}async download(t){let r=await Ir.mkdtemp(fi.join(Yve.tmpdir(),"mbh-chat-skill-"));try{let i=await Ks([{url:t,name:"skill.zip"}],{storageRoot:r,requestId:mI(),maxBytes:QH,maxFiles:1,maxInlineImageBytes:1,fetchTimeoutMs:18e4,concurrency:1,allowPrivateNetwork:this.options.allowPrivateNetwork??!1,...this.options.fetchImpl?{fetchImpl:this.options.fetchImpl}:{}}),n=i.media[0];if(!n)throw new Error(i.failures[0]?.reason||"skill download failed");return await Ir.readFile(n.localPath)}finally{await Ir.rm(r,{recursive:!0,force:!0}).catch(()=>{})}}};function rV(e,t){let r=Object.getOwnPropertyDescriptor(e,"constructor")?.value;if(typeof r!="function")return!1;try{return r.name===t&&r.prototype===e&&Function.prototype.toString.call(r)===Function.prototype.toString.call(t==="Array"?Array:Object)}catch{return!1}}function nV(e){return Object.getPrototypeOf(e)===null&&rV(e,"Object")}function ebe(e){let t=Object.getPrototypeOf(e);if(!Array.isArray(t)||!rV(t,"Array"))return!1;let r=Object.getPrototypeOf(t);return typeof r=="object"&&r!==null&&nV(r)}function tbe(e){let t=Object.getPrototypeOf(e);return t===null||typeof t=="object"&&nV(t)}function rbe(e){let t=Reflect.ownKeys(e);if(!t.some(r=>typeof r!="string"||!Object.prototype.propertyIsEnumerable.call(e,r)))return t}function nbe(e,t){let r=new Set,i,n=(s,a)=>{s!==void 0&&(s.kind==="root"?i=a:s.kind==="array"?s.target[s.index]=a:Object.defineProperty(s.target,s.key,{value:a,enumerable:!0,configurable:!0,writable:!0}))},o=[{kind:"visit",value:e,...t?{destination:{kind:"root"}}:{}}];for(let s=o.pop();s!==void 0;s=o.pop()){if(s.kind==="leave"){r.delete(s.source);continue}if(s.kind==="array-item"){if(!Object.prototype.hasOwnProperty.call(s.source,s.index))return;o.push({kind:"visit",value:s.source[s.index],...s.target===void 0?{}:{destination:{kind:"array",target:s.target,index:s.index}}});continue}if(s.kind==="object-property"){o.push({kind:"visit",value:s.source[s.key],...s.target===void 0?{}:{destination:{kind:"object",target:s.target,key:s.key}}});continue}let a=s.value;if(a===null){n(s.destination,null);continue}if(typeof a=="boolean"||typeof a=="string"){n(s.destination,a);continue}if(typeof a=="number"){if(!Number.isFinite(a)||Object.is(a,-0))return;n(s.destination,a);continue}if(typeof a!="object"||r.has(a))return;if(Array.isArray(a)){if(!ebe(a))return;let l=a.length;if(Reflect.ownKeys(a).length!==l+1)return;let f=t?[]:void 0;f!==void 0&&n(s.destination,f),r.add(a),o.push({kind:"leave",source:a});for(let p=l-1;p>=0;p--)o.push({kind:"array-item",source:a,index:p,...f===void 0?{}:{target:f}});continue}if(!tbe(a))return;let c=rbe(a);if(c===void 0)return;let u=t?{}:void 0;u!==void 0&&n(s.destination,u),r.add(a),o.push({kind:"leave",source:a});for(let l=c.length-1;l>=0;l--){let f=c[l];if(f===void 0)return;o.push({kind:"object-property",source:a,key:f,...u===void 0?{}:{target:u}})}}return t?i:!0}function iV(e){return nbe(e,!0)}function gI(e){let t=new WeakSet,r=[{kind:"visit",node:e}];for(;r.length>0;){let i=r.pop();if(i===void 0)continue;if(i.kind==="property"){r.push({kind:"visit",node:i.source[i.key]});continue}let n=i.node;if(n===null||typeof n!="object"||n instanceof AbortSignal||t.has(n))continue;t.add(n),Object.freeze(n);let o=Object.keys(n);for(let s=o.length-1;s>=0;s--){let a=o[s];a!==void 0&&r.push({kind:"property",source:n,key:a})}}return e}function aV(e){if(!Number.isSafeInteger(e))throw new TypeError(`Assistant stream time must be a safe integer, got ${String(e)}`);return e}function sbe(e,t){if(!Number.isSafeInteger(e)||e<0||Object.is(e,-0))throw new TypeError(`${t} index must be a non-negative safe integer`);return e}function abe(e){let t=iV(e);if(t===void 0)throw new TypeError("Assistant stream chunk must be losslessly JSON-serializable");return t}function cV(e){let t=[];for(let r of e){let i=cbe(r);if(i.type==="chunk"){t.push({time:i.time,chunk:i.chunk});continue}let n=i.type==="tool-call-chunks"?i.args:i.texts,o=i.time0;for(let s=0;s<n.length;s+=1){s>0&&(o+=i.dt[s-1]);let a;i.type==="text-chunks"?a={type:"text-delta",index:i.index,text:n[s]}:i.type==="reasoning-chunks"?a={type:"reasoning-delta",index:i.index,text:n[s]}:a={type:"tool-call-delta",index:i.index,id:i.id,...Object.hasOwn(i,"name")?{name:i.name}:{},argumentsDelta:n[s]},t.push({time:o,chunk:a})}}return t}function cbe(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Assistant stream record must be an object");let t=e;switch(t.type){case"text-chunks":case"reasoning-chunks":{yI(t,["type","time0","index","dt","texts"],t.type);let r=sV(t.texts,`${t.type} texts`);if(r.length===0)throw new TypeError(`${t.type} texts must be non-empty`);return oV(t,r.length,t.type),t}case"tool-call-chunks":{let r=Object.hasOwn(t,"name")?["type","time0","index","dt","id","name","args"]:["type","time0","index","dt","id","args"];yI(t,r,t.type);let i=sV(t.args,"tool-call-chunks args");if(i.length===0)throw new TypeError("tool-call-chunks args must be non-empty");if(typeof t.id!="string"||t.id.length===0)throw new TypeError("tool-call-chunks id must be a non-empty string");if(t.name!==void 0&&(typeof t.name!="string"||t.name.length===0))throw new TypeError("tool-call-chunks name must be a non-empty string");return oV(t,i.length,t.type),t}case"chunk":{yI(t,["type","time","chunk"],"chunk");let r=aV(t.time);if(typeof t.chunk!="object"||t.chunk===null||Array.isArray(t.chunk))throw new TypeError("Assistant stream raw chunk must be a lossless JSON object");let i;try{i=abe(t.chunk)}catch(n){throw new TypeError("Assistant stream raw chunk must be a lossless JSON object",{cause:n})}return gI({type:"chunk",time:r,chunk:i})}default:throw new TypeError(`Unsupported Assistant stream record ${JSON.stringify(t.type)}`)}}function oV(e,t,r){if(aV(e.time0),sbe(e.index,r),!Array.isArray(e.dt)||e.dt.some(n=>!Number.isSafeInteger(n)))throw new TypeError(`${r} dt must contain safe integers`);if(e.dt.length!==t-1)throw new TypeError(`${r} dt length must be one less than its members`);let i=e.time0;for(let n of e.dt)if(i+=n,!Number.isSafeInteger(i))throw new TypeError(`${r} member times must stay safe integers`)}function sV(e,t){if(!Array.isArray(e)||e.some(r=>typeof r!="string"))throw new TypeError(`${t} must be a string array`);return e}function yI(e,t,r){if(Object.keys(e).length!==t.length||!t.every(i=>Object.hasOwn(e,i)))throw new TypeError(`${r} Assistant stream record must contain exactly ${t.join(", ")}`)}import{randomUUID as uV}from"node:crypto";var vI=class{baseUrl;logger;sessionCookie;socket;streams=new Map;opening;closed;constructor(t,r,i){this.baseUrl=t,this.logger=r,this.sessionCookie=i}async*open(t,r,i,n){let o=uV(),s=[],a,c=l=>{s.push(l),a?.(),a=void 0};this.streams.set(o,c);let u=()=>{this.send({type:"cancel",streamId:o}),c({kind:"end"})};i.addEventListener("abort",u,{once:!0});try{if(await this.ensureOpen(),this.closed)throw this.closed;for(this.send({type:"open",streamId:o,endpoint:t,payload:r}),n?.(),i.aborted&&u();;){for(;s.length>0;){let l=s.shift();if(!l||l.kind==="end")return;if(l.kind==="error")throw l.error;yield l.value}await new Promise(l=>{a=l})}}finally{i.removeEventListener("abort",u),this.streams.delete(o),i.aborted||this.send({type:"cancel",streamId:o})}}close(t){this.closed=t??new Error("mbh-chat Remote mux closed");for(let i of this.streams.values())i({kind:"end"});this.streams.clear();let r=this.socket;this.socket=void 0,this.opening=void 0,r&&(r.readyState===Nt.CONNECTING?r.terminate():r.readyState===Nt.OPEN&&r.close(1e3,"bridge stream stopped"))}async ensureOpen(){if(this.socket?.readyState===Nt.OPEN)return;if(this.opening)return this.opening;let t=new URL("/api/remote.mux",this.baseUrl);t.protocol=t.protocol==="https:"?"wss:":"ws:";let r=new Nt(t,{headers:wn(this.sessionCookie)});this.socket=r,this.opening=new Promise((i,n)=>{let o=s=>{this.close(s),n(s)};r.once("open",()=>{r.once("close",()=>this.close(new Error("mbh-chat Remote mux closed"))),i()}),r.once("error",s=>o(s instanceof Error?s:new Error(String(s))))}),r.on("message",(i,n)=>{if(n){this.logger.warn("dropping binary mbh-chat WebSocket frame",{path:"/api/remote.mux"});return}let o;try{o=JSON.parse(i.toString())}catch(a){this.logger.warn("dropping malformed mbh-chat Remote mux frame",{error:a instanceof Error?a.message:String(a)});return}let s=this.streams.get(o.streamId);s&&(o.type==="item"?s({kind:"frame",value:o.value}):o.type==="error"?s({kind:"error",error:Object.assign(new Error(`mbh-chat ${o.error.code}: ${o.error.message}`),{code:o.error.code})}):s({kind:"end"}))}),await this.opening}send(t){this.socket?.readyState===Nt.OPEN&&this.socket.send(JSON.stringify(t))}},dy=class{baseUrl;logger;timeoutMs;sessionCookie;mux;eventClientId;constructor(t,r,i=3e4,n=jh()){this.baseUrl=t,this.logger=r,this.timeoutMs=i,this.sessionCookie=n}sessions={create:(t,r)=>this.invoke("session/create",{request:t},r),prompt:(t,r)=>this.invoke("session/prompt",{request:t},r),cancel:(t,r)=>this.invoke("session/cancel",{request:t},r),selectModel:(t,r)=>this.invoke("session/selectModel",{request:t},r),modelCatalog:t=>this.invoke("session/modelCatalog",{},t),page:(t,r)=>this.invoke("session/page",{request:t},r),follow:(t,r,i)=>this.openStream("session/follow",{request:t},r,i)};openEvents(t,r){return this.openStream("$events",{},t,r)}respondEvent(t,r){let i=t.clientId??this.eventClientId;if(!i)throw new Error("mbh-chat event stream is not ready");return this.invoke("$events/result",{clientId:i,eventId:t.eventId,outcome:t.outcome},r)}disconnect(){this.eventClientId=void 0,this.mux?.close(),this.mux=void 0}async invoke(t,r,i){let n=uV(),o=await fetch(new URL(`/api/${t}`,this.baseUrl),{method:"POST",headers:wn(this.sessionCookie,{"Content-Type":"application/json"}),body:JSON.stringify({type:"client-request",rpcId:n,method:t,payload:{args:r}}),signal:i?AbortSignal.any([i,AbortSignal.timeout(this.timeoutMs)]):AbortSignal.timeout(this.timeoutMs)});if(!o.ok)throw Object.assign(new Error(`mbh-chat ${t} returned HTTP ${o.status}`),{code:"http-error"});return await o.json()}openStream(t,r,i,n){return this.mux??=new vI(this.baseUrl,this.logger,this.sessionCookie),this.mux.open(t,{args:r},i,n)}};function Wr(e){if(e.result.ok)return e.result.value;let t=new Error(`mbh-chat ${e.result.error.code}: ${e.result.error.message}`);throw Object.assign(t,{code:e.result.error.code}),t}function bI(e){if(!(typeof e!="object"||e===null||!("code"in e)))return typeof e.code=="string"?e.code:void 0}var ube=new Set(["session/not-found","session-not-found"]);function _I(e){return e!==void 0&&ube.has(e)}function wI(e){return _I(bI(e))}function nf(){let e,t;return{promise:new Promise((i,n)=>{e=i,t=n}),resolve:e,reject:t}}var lbe=3e3;function fbe(e,t,r){let i=Math.min(r,t*2**Math.min(e,8));return i+Math.floor(Math.random()*Math.max(1,Math.min(1e3,i/5)))}function xI(e,t){return new Promise(r=>{if(t.aborted)return r();let i=setTimeout(n,e);function n(){clearTimeout(i),t.removeEventListener("abort",n),r()}t.addEventListener("abort",n,{once:!0})})}function dbe(e,t){return t?t.aborted?Promise.reject(t.reason??new Error("mbh-chat operation aborted")):new Promise((r,i)=>{let n=()=>o(()=>i(t.reason??new Error("mbh-chat operation aborted"))),o=s=>{t.removeEventListener("abort",n),s()};t.addEventListener("abort",n,{once:!0}),e.then(s=>o(()=>r(s)),s=>o(()=>i(s)))}):e}function pbe(e){let t=bI(e);return t?!(t==="session/not-found"||t==="session-not-found"||t==="gateway/bad-request"||/corrupt|invalid|validation/iu.test(t)):/closed|ended before|ECONN|socket|network|fetch failed/iu.test(te(e))}var py=class{reconnectMinMs;reconnectMaxMs;logger;api;rootAbort;generationAbort;handlers;loopPromise;connected=!1;followedSessions=new Set;followAborts=new Map;followReadiness=new Map;liveFollows=new Set;followCursors=new Map;recoveries=new Map;connectionWaiters=new Set;constructor(t,r,i,n){this.reconnectMinMs=r,this.reconnectMaxMs=i,this.logger=n,this.api=new dy(t,n)}start(t){if(this.loopPromise)throw new Error("mbh-chat connection already started");this.handlers=t,this.rootAbort=new AbortController,this.loopPromise=this.run(t,this.rootAbort.signal)}async stop(){this.rootAbort?.abort();let t=new Error("mbh-chat connection stopped before becoming ready");for(let r of this.connectionWaiters)r.reject(t);this.connectionWaiters.clear();for(let r of this.followReadiness.values())r.reject(t);this.followReadiness.clear();for(let r of this.recoveries.values())r.completion.reject(t);this.liveFollows.clear(),this.followCursors.clear(),this.recoveries.clear(),await this.loopPromise,this.loopPromise=void 0,this.rootAbort=void 0,this.handlers=void 0,this.api.disconnect()}isConnected(){return this.connected}followSession(t,r={}){if(this.followedSessions.add(t),this.liveFollows.has(t))return Promise.resolve();let i=this.followReadiness.get(t);i||(i=nf(),this.followReadiness.set(t,i)),this.connected&&this.generationAbort&&!this.followAborts.has(t)&&this.startFollow(t,this.generationAbort.signal);let n=i.promise;return n.catch(()=>{}),r.requireReady?dbe(n,r.signal):Promise.race([n,xI(lbe,this.generationAbort?.signal??new AbortController().signal).then(()=>{this.liveFollows.has(t)||this.logger.warn("mbh-chat session follow was not ready before timeout",{sessionId:t})})])}recoverSession(t,r,i,n){this.recoveries.get(t)?.completion.reject(new Error(`mbh-chat replaced recovery for session ${t}`));let s=nf();s.promise.catch(()=>{}),this.recoveries.set(t,{...r?{executionRpcId:r}:{},onSnapshot:i,completion:s});let a=()=>{let c=this.recoveries.get(t);!c||c.completion!==s||(this.recoveries.delete(t),s.reject(n?.reason??new Error(`mbh-chat recovery aborted for session ${t}`)))};return n?.addEventListener("abort",a,{once:!0}),s.promise.finally(()=>n?.removeEventListener("abort",a)).catch(()=>{}),n?.aborted?a():this.followSession(t).catch(c=>{let u=this.recoveries.get(t);!u||u.completion!==s||(this.recoveries.delete(t),s.reject(c))}),s.promise}unfollowSession(t){this.followedSessions.delete(t),this.liveFollows.delete(t),this.followCursors.delete(t);let r=this.recoveries.get(t);this.recoveries.delete(t),r?.completion.reject(new Error(`mbh-chat stopped recovering session ${t}`)),this.followAborts.get(t)?.abort(),this.followAborts.delete(t),this.followReadiness.get(t)?.reject(new Error(`mbh-chat stopped following session ${t}`)),this.followReadiness.delete(t)}whenConnected(t){return this.connected?Promise.resolve():new Promise((r,i)=>{let n=()=>{a(),r()},o=u=>{a(),i(u)},s=()=>o(t?.reason??new Error("waiting for mbh-chat connection was aborted")),a=()=>{this.connectionWaiters.delete(c),t?.removeEventListener("abort",s)},c={resolve:n,reject:o};this.connectionWaiters.add(c),t?.addEventListener("abort",s,{once:!0}),t?.aborted&&s()})}async setConnected(t,r){if(t||(this.connected=!1),await r.onConnection?.(t),t){this.connected=!0;for(let i of this.connectionWaiters)i.resolve();this.connectionWaiters.clear()}}async run(t,r){let i=0;for(;!r.aborted;){let n=new AbortController;this.generationAbort=n;let o=()=>n.abort();r.addEventListener("abort",o,{once:!0});let s=nf(),a=!1,c;try{c=this.pumpEvents(t,n.signal,s.resolve);let u=c.then(()=>{throw new Error("a mbh-chat event stream closed")});await Promise.race([s.promise,u]),a=!0,i=0,await this.setConnected(!0,t);for(let l of this.followedSessions)this.startFollow(l,n.signal);await u}catch(u){r.aborted||this.logger.warn("mbh-chat connection lost",{error:te(u)})}finally{if(this.generationAbort=void 0,n.abort(),this.stopFollows(),this.api.disconnect(),await Promise.allSettled(c?[c]:[]),r.removeEventListener("abort",o),a)try{await this.setConnected(!1,t)}catch(u){this.logger.error("mbh-chat connection-state handler failed during disconnect",{error:te(u)})}}if(!r.aborted){let u=fbe(i++,this.reconnectMinMs,this.reconnectMaxMs);this.logger.info("reconnecting to mbh-chat Host",{delayMs:u,attempt:i}),await xI(u,r)}}}async pumpEvents(t,r,i){let n=!1;for await(let o of this.api.openEvents(r)){if(o.type==="ready"){this.api.eventClientId=o.clientId,n||(n=!0,i());continue}try{await t.onRemoteEvent(o)}catch(s){this.logger.error("mbh-chat event handler failed",{error:te(s)})}}}markFollowReady(t){this.liveFollows.add(t),this.followReadiness.get(t)?.resolve()}async startFollow(t,r){if(this.followAborts.has(t))return;let i=new AbortController;this.followAborts.set(t,i);let n=AbortSignal.any([r,i.signal]),o=!1,s=new Map;try{for await(let a of this.api.sessions.follow({address:{kind:"session",sessionId:t},assistantStream:!0,maxMessages:1e3},n)){if(a.type==="snapshot"){o=!0;let c=this.followCursors.get(t),u=this.recoveries.get(t);if(u){let f=await this.recoveryRecords(t,a,u.executionRpcId,n);this.recoveries.get(t)===u&&this.recoveries.delete(t);try{await u.onSnapshot(f),u.completion.resolve()}catch(p){throw u.completion.reject(p),p}}else if(c!==void 0)for(let f of a.records)f.seq>c&&this.handlers?.onSessionEvent(t,f);this.followCursors.set(t,a.cursor);let l=a.assistantStream?.activeAttempt;if(l){s.set(l.attemptId,{turn:l.turn,step:l.step});for(let[f,p]of cV(l.stream).entries())this.handlers?.onAssistantChunk(t,{attemptId:l.attemptId,index:f,turn:l.turn,step:l.step,time:p.time,chunk:p.chunk})}this.markFollowReady(t);continue}if(a.type==="assistant-stream"){let c=a.frame;if(c.type==="start")s.set(c.attemptId,{turn:c.turn,step:c.step});else if(c.type==="end")s.delete(c.attemptId);else{let u=s.get(c.attemptId);u&&this.handlers?.onAssistantChunk(t,{attemptId:c.attemptId,index:c.index,turn:u.turn,step:u.step,time:c.time,chunk:c.chunk})}continue}if(a.type==="event")try{this.handlers?.onSessionEvent(t,a.event),this.followCursors.set(t,a.event.seq)}catch(c){this.logger.error("mbh-chat session event handler failed",{sessionId:t,error:te(c)})}}if(!n.aborted)throw new Error(o?`mbh-chat session follow ended unexpectedly for ${t}`:`mbh-chat session follow ended before receiving a snapshot for ${t}`)}catch(a){if(!r.aborted&&!i.signal.aborted)if(pbe(a))o&&this.followedSessions.has(t)&&this.followReadiness.set(t,nf()),this.logger.warn("mbh-chat session follow ended; retrying",{sessionId:t,error:te(a)}),xI(this.reconnectMinMs,r).then(()=>{r.aborted||!this.followedSessions.has(t)||this.followAborts.has(t)||this.generationAbort?.signal!==r||this.startFollow(t,r)});else{let c=this.recoveries.get(t);c&&(this.recoveries.delete(t),c.completion.reject(a)),this.followReadiness.get(t)?.reject(a),this.logger.warn("mbh-chat session follow ended",{sessionId:t,error:te(a)})}}finally{this.followAborts.get(t)===i&&(this.followAborts.delete(t),this.liveFollows.delete(t))}}async recoveryRecords(t,r,i,n){let o=[...r.records],s=r.hasMore;for(;s&&lV(o,i)<0;){let c=o[0]?.seq;if(c===void 0)break;let u=Wr(await this.api.sessions.page({address:{kind:"session",sessionId:t},throughSeq:r.cursor,beforeSeq:c,maxMessages:1e3},n));if(u.records.length===0)break;o=[...u.records,...o],s=u.hasMore}let a=lV(o,i);return a<0?{matched:!1,records:[]}:{matched:!0,records:o.slice(a)}}stopFollows(){let t=[...this.liveFollows];for(let r of this.followAborts.values())r.abort();this.followAborts.clear(),this.liveFollows.clear();for(let r of t)this.followedSessions.has(r)&&this.followReadiness.set(r,nf())}};function lV(e,t){let r=-1;for(let i=e.length-1;i>=0;i-=1){let n=e[i];if(n?.type!=="user/message"||!n.data||typeof n.data!="object")continue;let o=n.data.source;if(!(!o||typeof o!="object"||o.kind!=="user")&&!(t&&o.rpcId!==t)){r=i;break}}if(r<0)return-1;for(let i=r;i>=0;i-=1)if(e[i]?.type==="turn/start")return i;return r}var of=0;function SI(e=Date.now()){return of=Math.max(e,of+1),String(of)}function fV(e,t=Date.now()){if(e){let i=Number(e);return Number.isSafeInteger(i)&&(of=Math.max(of,i)),{notification:e,chat:SI(t)}}return{notification:SI(t),chat:SI(t)}}function kc(e){let t,r=new Promise(s=>{t=s}),i=e.deadlineAt??Date.now()+e.taskTimeoutMs,n=Math.max(1,Math.min(e.turnTimeoutMs,i-Date.now())),o={context:e.context,botToken:e.botToken,businessKey:e.businessKey,dshSessionId:e.dshSessionId,...e.turn!==void 0?{turn:e.turn}:{},turnStartedAt:void 0,timeTakenMs:void 0,chunkIndex:e.chunkIndex??0,pendingText:"",cronText:"",cronAttachments:[],stepText:new Map,assistantStreamIndexes:new Map,pendingReasoning:"",stepReasoning:new Map,reasoningLineIndex:0,reasoningStarted:!1,reasoningMessageKey:void 0,reasoningSort:void 0,reasoningVisibleChars:0,reasoningLimitReached:!1,reasoningTruncationCount:0,skillNames:new Map(e.skillNames),toolCalls:new Map,pendingSubagents:new Set,subagentParents:new Map,settledSubagents:new Set,finalized:!1,followup:e.followup,deadlineAt:i,completion:r,resolveCompletion:t,submissionAbort:void 0,timeout:setTimeout(()=>e.onTimeout(o),n)};return o}async function dV(e,t,r,i){let n=new Map;for(let u of e.store.listActiveSubagentsForRoot(t))(!r||u.requestId===r)&&n.set(u.childSessionId,u.parentSessionId);for(let[u,l]of i??[])n.set(u,l);let o=!1,s=!1,a,c=u=>{e.store.settleSubagent(u,"cancelled"),n.delete(u)};for(let u=1;u<=e.config.task.maxAttempts;u+=1){let l=p=>{let d=0,h=p,m=new Set;for(;!m.has(h);){m.add(h);let _=n.get(h);if(!_)break;d+=1,h=_}return d},f=[...n].sort(([p],[d])=>l(d)-l(p));for(let[p,d]of f)try{Wr(await e.dsh.api.sessions.cancel({sessionId:p})),c(p)}catch(h){if(wI(h)){c(p);continue}a=h,e.logger.warn("subagent interrupt failed",{parentSessionId:d,childSessionId:p,attempt:u,error:te(h)})}if(!o)try{Wr(await e.dsh.api.sessions.cancel({sessionId:t})),o=!0}catch(p){wI(p)?(o=!0,s=!0):(a=p,e.logger.warn("model/tool cancellation failed",{dshSessionId:t,attempt:u,error:te(p)}))}if(o&&n.size===0)return s?"absent":"cancelled";if(u<e.config.task.maxAttempts){let p=Math.min(e.config.task.retryMaxMs,e.config.task.retryBaseMs*2**(u-1));await new Promise(d=>setTimeout(d,p))}}throw a instanceof Error?a:new Error("execution cancellation could not be confirmed")}var Wt={invalidGenerationLength:"\u5F53\u524D\u6A21\u578B\u7684\u751F\u6210\u957F\u5EA6\u914D\u7F6E\u4E0D\u53EF\u7528\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u540E\u91CD\u8BD5\uFF1B\u5982\u4ECD\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u3002",modelUnavailable:"\u5F53\u524D\u6A21\u578B\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u6216\u5207\u6362\u6A21\u578B\u3002",unsupportedInput:"\u5F53\u524D\u5185\u5BB9\u6682\u65F6\u65E0\u6CD5\u5904\u7406\uFF0C\u8BF7\u7F29\u77ED\u5185\u5BB9\u6216\u79FB\u9664\u5F02\u5E38\u5B57\u7B26\u540E\u91CD\u8BD5\u3002",emptyResponse:"\u6A21\u578B\u672A\u751F\u6210\u6709\u6548\u56DE\u590D\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\uFF1B\u5982\u4ECD\u5931\u8D25\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u3002",contextTooLong:"\u5F53\u524D\u5BF9\u8BDD\u5185\u5BB9\u8FC7\u957F\uFF0C\u8BF7\u7F29\u77ED\u5185\u5BB9\u6216\u65B0\u5EFA\u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002",imageTooLarge:"\u56FE\u7247\u8FC7\u5927\uFF0C\u8D85\u51FA\u5355\u8FB9\u50CF\u7D208192\u4E0A\u9650\uFF0C\u8BF7\u538B\u7F29\u6216\u88C1\u526A\u540E\u518D\u8BD5\u3002",attachmentInvalid:"\u9644\u4EF6\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",authenticationFailed:"\u6A21\u578B\u670D\u52A1\u8BA4\u8BC1\u5F02\u5E38\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u5904\u7406\u3002",permissionDenied:"\u5F53\u524D\u6A21\u578B\u6682\u4E0D\u53EF\u8BBF\u95EE\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u6216\u8054\u7CFB\u7BA1\u7406\u5458\u786E\u8BA4\u6743\u9650\u3002",quotaExhausted:"\u6A21\u578B\u670D\u52A1\u989D\u5EA6\u4E0D\u8DB3\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u6216\u8054\u7CFB\u7BA1\u7406\u5458\u3002",serviceBusy:"\u6A21\u578B\u670D\u52A1\u5F53\u524D\u7E41\u5FD9\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",timedOut:"\u6A21\u578B\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\uFF1B\u5982\u591A\u6B21\u5931\u8D25\uFF0C\u8BF7\u7F29\u77ED\u4EFB\u52A1\u5185\u5BB9\u3002",connectionFailed:"\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u6A21\u578B\u670D\u52A1\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",serviceUnavailable:"\u6A21\u578B\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",contentBlocked:"\u5F53\u524D\u5185\u5BB9\u672A\u80FD\u901A\u8FC7\u6A21\u578B\u670D\u52A1\u7684\u5B89\u5168\u68C0\u67E5\uFF0C\u8BF7\u8C03\u6574\u5185\u5BB9\u540E\u91CD\u8BD5\u3002",incompatibleRequest:"\u5F53\u524D\u8BF7\u6C42\u4E0E\u6A21\u578B\u914D\u7F6E\u4E0D\u517C\u5BB9\uFF0C\u8BF7\u8C03\u6574\u5185\u5BB9\u6216\u5207\u6362\u6A21\u578B\u540E\u91CD\u8BD5\u3002",interrupted:"\u672C\u6B21\u5904\u7406\u5DF2\u4E2D\u65AD\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",unknown:"\u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u56DE\u590D\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"};function pV(e){let t=e.indexOf("{"),r=e.lastIndexOf("}");if(!(t<0||r<=t))try{return he(JSON.parse(e.slice(t,r+1)))}catch{return}}function hy(e){let t=he(e)??pV(te(e).trim()),r=he(t?.details);return t?.code==="AR_AUTH_REJECTED"&&String(r?.gateway_error_code??"")==="1003"}function hV(e){let t=e.trim().replace(/^\[错误\]\s*/u,"").trim();if(!(!t||t.length>200)&&!/[\r\n]|\bat\s+\S+|[/\\][\w.-]+|token|secret|api.?key|password/iu.test(t))return t}function hbe(e){let t=pV(e);if(t)try{return typeof t.message!="string"?void 0:hV(t.message)}catch{return}}function mbe(e){let t=te(e).trim();if(/per-side pixel limit|image exceeds.{0,80}pixel/iu.test(t))return Wt.imageTooLarge;if(/attachment-invalid/iu.test(t))return Wt.attachmentInvalid;let r=hbe(t);return r||(/range of max_tokens|max_tokens.*(?:invalid|range|between|must be)/iu.test(t)?Wt.invalidGenerationLength:/no available channel|model (?:not found|unavailable)|unsupported model|unknown model|model .* does not exist/iu.test(t)?Wt.modelUnavailable:/tokenization failed|tokenizer.*(?:error|failed)/iu.test(t)?Wt.unsupportedInput:/completed response with no content|empty response|no content returned/iu.test(t)?Wt.emptyResponse:/context length|maximum context|context window|too many tokens|prompt is too long/iu.test(t)?Wt.contextTooLong:/content (?:policy|filter)|safety (?:policy|filter)|moderation|harmful content/iu.test(t)?Wt.contentBlocked:/\b(401|unauthorized|invalid api.?key|authentication failed|authentication error)\b/iu.test(t)?Wt.authenticationFailed:/\b(403|forbidden|permission denied|access denied)\b/iu.test(t)?Wt.permissionDenied:/\b402\b|insufficient (?:balance|credits?|quota)|quota (?:exceeded|exhausted)/iu.test(t)?Wt.quotaExhausted:/\b429\b|rate.?limit|too many requests|overload|server busy|service busy/iu.test(t)?Wt.serviceBusy:/timeout|timed out|deadline exceeded/iu.test(t)?Wt.timedOut:/econnrefused|econnreset|enotfound|socket hang up|network error|fetch failed|connection (?:closed|failed|lost)/iu.test(t)?Wt.connectionFailed:/\b5\d\d\b|bad gateway|service unavailable|upstream.*(?:error|failed)/iu.test(t)?Wt.serviceUnavailable:/invalidparameter|invalid parameter|\b400\b|bad request|unsupported (?:input|format)/iu.test(t)?Wt.incompatibleRequest:/abort(?:ed|error)?|cancel(?:led|ed)/iu.test(t)?Wt.interrupted:hV(t)??Wt.unknown)}function to(e){return`[\u9519\u8BEF] ${mbe(e)}`}var mV=2e3;function fs(e){return e.time/1e3+e.seq/1e9}function my(e,t){return Array.isArray(e)?e.map(r=>{let i=he(r);return i?.type===t&&typeof i.text=="string"?i.text:""}).join(""):""}function EI(e,t){let r=e.trim()||t;return r.length<=mV?r:`${r.slice(0,mV)}\u2026\u2026\uFF08\u5185\u5BB9\u5DF2\u622A\u65AD\uFF09`}function kI(e){return Array.isArray(e)?e.map(t=>{let r=he(t);if(!r)return"";if((r.type==="text"||r.type==="reasoning")&&typeof r.text=="string")return r.text;if(r.type==="image")return"[\u56FE\u7247]";try{return JSON.stringify(r)}catch{return"[\u65E0\u6CD5\u5C55\u793A\u7684\u5DE5\u5177\u7ED3\u679C]"}}).filter(Boolean).join(`
|
|
592
592
|
`):""}function gV(e){return/^started subagent\s+(\S+)\s*$/u.exec(kI(e))?.[1]}function gy(e){if(e.type!=="user/message")return;let t=he(he(e.data)?.source);return t?.kind==="subagent-settled"&&typeof t.senderSessionId=="string"?t.senderSessionId:void 0}function yV(e){let t=he(e),r=typeof t?.kind=="string"?t.kind:"unknown";if(r==="completed")return{tag:"end",status:"succeeded"};if(r==="aborted")return{tag:"abort",status:"cancelled"};if(r==="interrupted")return{tag:"interrupted",status:"cancelled"};if(r==="max-tokens")return{tag:"max_tokens",status:"failed",response:"[\u9519\u8BEF] \u6A21\u578B\u8F93\u51FA\u8FBE\u5230\u957F\u5EA6\u4E0A\u9650"};if(r==="blocked")return{tag:"blocked",status:"failed",response:"[\u9519\u8BEF] \u672C\u8F6E\u88AB\u5BBF\u4E3B\u7B56\u7565\u963B\u6B62"};if(r==="error"){let i=he(t?.error),n=typeof i?.message=="string"?i.message:"mbh-chat agent turn failed";return{tag:"error",status:"failed",response:to(n)}}return{tag:"error",status:"failed",response:`[\u9519\u8BEF] \u672A\u8BC6\u522B\u7684 mbh-chat \u7ED3\u675F\u72B6\u6001\uFF1A${r}`}}function vV(e){if(e.type!=="turn/end")return;let t=he(he(e.data)?.reason);if(t?.kind!=="error")return;let r=he(t.error);return typeof r?.message=="string"&&r.message.trim()?r.message:void 0}function bV(e){let t=he(e.data);if(e.type==="assistant/message"){let n=he(t?.message);return Array.isArray(n?.content)?n.content.some(o=>{let s=he(o);return s?.type==="tool-call"&&(!Tc(s.id)||!Tc(s.name))}):!1}if(e.type==="tool/call")return!Tc(t?.callId)||!Tc(t?.name);if(e.type!=="tool/result")return!1;let r=he(t?.message),i=he(r?.source);return Tc(i?.callId)?Array.isArray(r?.content)?r.content.some(n=>{let o=he(n);return o?.type==="tool-result"&&!Tc(o.toolCallId)}):!1:!0}function Tc(e){return typeof e=="string"&&e.trim().length>0}function _V(e){return e.type==="user/message"?my(he(e.data)?.content,"text"):JSON.stringify(e.data??"")}function yy(e,t){let r=`${t}:`,i=_V(e).split(`
|
|
593
593
|
`).find(n=>n.startsWith(r));if(i)try{let n=JSON.parse(i.slice(r.length).trim());return typeof n=="string"&&n.trim()?n.trim():void 0}catch{return}}function vy(e){let t=_V(e);return t.includes("SCHEDULED TASK DUE")||t.includes("CRON AUTOMATION DUE")}function TI(e,t){return e==="allow-once"||t?"allowed-once":"rejected"}import wV from"node:path";function sf(e){let t=e.toLowerCase();return/cannot read properties of undefined \(reading ['"]prepare['"]\)/u.test(t)||/session event ['"]turn\/end['"] carries non-json-serializable data/u.test(t)||/messages\[\d+\]/u.test(t)&&t.includes("missing field")&&t.includes("tool_call_id")||t.includes("stored session")&&t.includes("is corrupt")&&t.includes("failed validation")||t.includes("insufficient tool messages")||t.includes("tool_calls")&&t.includes("followed by tool")}var by=class{config;store;getDsh;logger;getCronSync;activeBySession;finish;cancelExecution;quarantineUnconfirmedExecution;hostDefaultProvider;constructor(t,r,i,n,o,s,a,c,u){this.config=t,this.store=r,this.getDsh=i,this.logger=n,this.getCronSync=o,this.activeBySession=s,this.finish=a,this.cancelExecution=c,this.quarantineUnconfirmedExecution=u}clearHostDefaultProvider(){this.hostDefaultProvider=void 0}followSessionReady(t){return this.getDsh().followSession?.(t,{requireReady:!0,signal:AbortSignal.timeout(this.config.supervisor.startTimeoutMs)})??Promise.resolve()}async ensureSession(t,r,i,n){let o=this.store.getSessionBinding(t);if(o){let s=!!o.workspaceDir&&!!i.workspaceDir&&wV.resolve(o.workspaceDir)!==wV.resolve(i.workspaceDir),a=i.managed&&!o.workspaceDir,c=!!o.agentPreset&&o.agentPreset!==i.agentPreset;if(s||a||c)this.store.removeSession(t),this.logger.info("discarded stale mbh-chat session route",{businessKey:t,dshSessionId:o.dshSessionId,workspaceMismatch:s||a,presetMismatch:c});else{this.store.bindSession(t,o.dshSessionId,n,{...i.workspaceDir?{workspaceDir:i.workspaceDir}:{},...o.agentPreset?{agentPreset:o.agentPreset}:{}});try{await this.followSessionReady(o.dshSessionId)}catch(u){let l=te(u);if(!sf(l))throw this.getDsh().unfollowSession?.(o.dshSessionId),u;return this.store.removeSession(t),this.getDsh().unfollowSession?.(o.dshSessionId),this.logger.info("discarded stored corrupt mbh-chat session before prompt",{businessKey:t,dshSessionId:o.dshSessionId,error:l}),this.createSession(t,r,i,n)}return r?.trim()&&await this.selectModel(o.dshSessionId,r.trim()),o.dshSessionId}}return this.createSession(t,r,i,n)}async createSession(t,r,i,n){let o={...i.workspaceDir?{cwd:i.workspaceDir}:{},...i.agentPreset?{agentPreset:i.agentPreset}:{}},a=Wr(await this.getDsh().api.sessions.create(o)).sessionId;this.store.bindSession(t,a,n,{...i.workspaceDir?{workspaceDir:i.workspaceDir}:{},...i.agentPreset?{agentPreset:i.agentPreset}:{}});try{await this.followSessionReady(a)}catch(u){throw this.store.removeSession(t),this.getDsh().unfollowSession?.(a),u}this.getCronSync()?.notifySessionAvailable(),this.getCronSync()?.bindDshSessionId(t,a).catch(u=>{this.logger.warn("failed to bind cron jobs to new mbh-chat session",{businessKey:t,dshSessionId:a,error:te(u)})});let c=r?.trim()||this.config.dsh.model;return c&&await this.selectModel(a,c),this.logger.info("created mbh-chat session mapping",{businessKey:t,dshSessionId:a,workspaceDir:i.workspaceDir,agentPreset:i.agentPreset,managedAgent:i.agent?.cloneCode}),a}async invalidateAgentSessions(t,r){let i=new Set;for(let n of t)for(let o of this.store.listSessionBindingsForAgent(n)){let s=this.activeBySession.get(o.dshSessionId);try{s&&!s.finalized?await this.cancelExecution(s):Wr(await this.getDsh().api.sessions.cancel({sessionId:o.dshSessionId}))}catch(a){i.add(n),this.quarantineUnconfirmedExecution?.(o.businessKey,o.dshSessionId,`${r}_cancel_unconfirmed`,!1),this.logger.warn("could not cancel invalidated Agent session",{cloneCode:n,dshSessionId:o.dshSessionId,error:te(a)})}s&&!s.finalized&&this.finish(s,r,"cancelled","[\u9519\u8BEF] \u4E13\u5BB6\u914D\u7F6E\u5DF2\u53D8\u66F4\uFF0C\u672C\u8F6E\u5DF2\u4E2D\u65AD\uFF0C\u8BF7\u91CD\u8BD5"),this.store.removeSession(o.businessKey),this.getDsh().unfollowSession?.(o.dshSessionId)}return[...i]}async selectModel(t,r){let i=r.indexOf("/"),n=i>0?r.slice(0,i):this.config.dsh.modelProvider,o=i>0?r.slice(i+1):r;if(!n){if(!this.hostDefaultProvider){let s=Wr(await this.getDsh().api.sessions.modelCatalog());this.hostDefaultProvider=s.default.provider}n=this.hostDefaultProvider}if(!n)throw new Error(`model ${r} has no provider and mbh-chat Host reports no default provider`);Wr(await this.getDsh().api.sessions.selectModel({sessionId:t,provider:n,model:o,...this.config.dsh.reasoningEffort?{reasoningEffort:this.config.dsh.reasoningEffort}:{}})),this.logger.info("selected mbh-chat model",{dshSessionId:t,provider:n,model:o})}};var II=10,OI=100,CI=128,AI=256,af=4e3,_y=2e3;function gbe(e,t){if(typeof e!="string"||!e.trim())throw new Error(`user question ${t} must be a non-empty string`);return e.trim()}function wy(e,t,r){let i=gbe(e,t);if(i.length>r)throw new Error(`user question ${t} exceeds ${r} characters`);return i}function ybe(e,t,r){return typeof e=="number"&&Number.isFinite(e)?String(Math.trunc(e)):wy(e,t,r)}function vbe(e){if(e.eventType!=="user_question")return;let t=ybe(e.content.session_id,"session_id",AI),r=wy(e.content.tool_call_id,"tool_call_id",CI);if(e.operationType==="cancel")return{action:"cancel",sessionId:t,toolCallId:r};if(e.operationType!=="answer")throw new Error("user question operation_type must be answer or cancel");if(!Array.isArray(e.content.answers)||e.content.answers.length===0)throw new Error("user question answers must be a non-empty array");if(e.content.answers.length>II)throw new Error(`user question answers must contain at most ${II} items`);return{action:"answer",sessionId:t,toolCallId:r,answers:e.content.answers.map(i=>{if(!i||typeof i!="object"||Array.isArray(i))throw new Error("user question answer must be an object");let n=i;if(!Array.isArray(n.selected)||n.selected.length>OI||!n.selected.every(a=>typeof a=="string"))throw new Error(`user question answer selected must be a string array of at most ${OI} items`);let o=n.custom;if(o!==void 0&&typeof o!="string")throw new Error("user question answer.custom must be a string");let s=o?.trim();if(s&&s.length>af)throw new Error(`user question answer.custom exceeds ${af} characters`);return{id:wy(n.id,"answer.id",CI),selected:n.selected.map(a=>wy(a,"answer.selected",_y)),...s===void 0?{}:{custom:s}}})}}function bbe(e,t){if(t.length!==e.length)throw new Error("user question answer count does not match the request");return t.map((r,i)=>{let n=e[i];if(r.id!==n.id)throw new Error(`user question answer id does not match ${n.id}`);let o=new Set((n.options??[]).map(l=>l.label)),s=r.selected.map(l=>l.trim());if(s.some(l=>!l))throw new Error(`user question ${n.id} contains an empty selection`);if(new Set(s).size!==s.length)throw new Error(`user question ${n.id} contains duplicate selections`);let a=s.filter(l=>o.has(l)),c=s.filter(l=>!o.has(l)),u=r.custom?.trim()||c.join(`
|
|
594
594
|
`);if(u.length>af)throw new Error(`user question ${n.id} custom answer exceeds ${af} characters`);if(n.multiSelect!==!0&&u)return{id:r.id,selected:[],custom:u};if(n.multiSelect!==!0&&a.length>1)throw new Error(`user question ${n.id} accepts only one selection`);return{id:r.id,selected:a,...u?{custom:u}:{}}})}function cf(e,t,r){return{version:1,type:"ask_user_question",interaction_id:e.rpcId,session_id:e.context.sessionId,...e.toolCallId?{tool_call_id:e.toolCallId}:{},status:t,questions:e.frame.questions.map(i=>({id:i.id,question:i.question,...i.header===void 0?{}:{header:i.header},...i.options===void 0?{}:{options:i.options},...i.multiSelect===void 0?{}:{multi_select:i.multiSelect}})),...r===void 0?{}:{answers:r}}}async function SV(e,t){let r=vbe(t);if(!r)return!1;let i=[...e.pendingUserQuestions.values()].filter(l=>l.context.sessionId!==r.sessionId||l.context.userId!==t._userId?!1:l.toolCallId===void 0||l.toolCallId===r.toolCallId);if(i.length>1)return e.logger.warn("rejected ambiguous user question response",{toolCallId:r.toolCallId,sessionId:r.sessionId,matches:i.length}),!1;let n=i[0];if(!n)return e.logger.info("ignored stale user question response",{toolCallId:r.toolCallId,sessionId:r.sessionId}),!1;let o=r.action==="answer"?bbe(n.frame.questions,r.answers):void 0,s=o?{ok:!0,value:{answers:o}}:{ok:!1,error:{code:"cancelled",message:"the user cancelled this question request",details:{}}},a=r.action==="answer"?"answered":"cancelled";n.submitted={status:a,...o?{answers:o}:{}};let c;try{c=await e.dsh.api.respondEvent({eventId:n.rpcId,outcome:s.ok?{kind:"result",value:s.value}:{kind:"rejected",error:{name:"Error",message:s.error.message,code:s.error.code,details:s.error.details}}})}catch(l){throw e.pendingUserQuestions.get(n.rpcId)===n&&delete n.submitted,l}if(!c.result.ok)return e.pendingUserQuestions.get(n.rpcId)===n&&delete n.submitted,e.logger.warn("DSH rejected user question response",{interactionId:n.rpcId}),!1;e.pendingUserQuestions.delete(n.rpcId);let u=$I(e,n.frame.sessionId);return u&&e.turns.resumeAfterUserInput(u),e.dcg.enqueue(n.context,{response:"",state:"chunk",is_finish:0,interaction:cf(n,a,o)},`question:${n.rpcId}:${a}`),!0}function EV(e,t){for(let[r,i]of e.pendingUserQuestions)if(!(t&&i.frame.sessionId!==t)){e.pendingUserQuestions.delete(r);try{e.dcg.enqueue(i.context,{response:"",state:"chunk",is_finish:0,interaction:cf(i,"cancelled")},`question:${r}:cancelled`)}catch(n){e.logger.warn("could not persist user-question cancellation",{interactionId:r,error:n instanceof Error?n.message:String(n)})}}}async function kV(e,t){let r=_be(t.request,t.agentId),i=r?$I(e,r.sessionId):void 0;if(!r||!i||i.followup){e.logger.warn("rejected user question without an interactive user",{eventId:t.eventId,agentId:t.agentId,sessionId:r?.sessionId,reason:r?i?"followup":"no_live_run":"invalid_request"});let s=e.pendingUserQuestions.get(t.eventId);if(s){e.pendingUserQuestions.delete(t.eventId);try{e.dcg.enqueue(s.context,{response:"",state:"chunk",is_finish:0,interaction:cf(s,"cancelled")},`question:${t.eventId}:cancelled`)}catch(a){e.logger.warn("could not persist stale user-question cancellation",{eventId:t.eventId,error:a instanceof Error?a.message:String(a)})}}await xV(e,t.eventId,"\u5F53\u524D\u8FD0\u884C\u6CA1\u6709\u53EF\u4EA4\u4E92\u7684\u7528\u6237","cancelled");return}let n=[...i.toolCalls].reverse().find(([,s])=>s.name==="ask_user_question"&&!s.settled)?.[0],o={rpcId:t.eventId,frame:r,context:i.context,...n?{toolCallId:n}:{}};e.pendingUserQuestions.set(t.eventId,o);try{e.store.markRequestToolWaiting(i.context.requestId),e.turns.pauseForUserInput(i),e.dcg.enqueue(i.context,{response:"",state:"waiting_input",is_finish:0,interaction:cf(o,"pending")},`question:${t.eventId}:requested`)}catch(s){e.pendingUserQuestions.delete(t.eventId),e.logger.warn("could not persist user question for MBHChat",{eventId:t.eventId,error:s instanceof Error?s.message:String(s)});try{e.store.markRequestRunningAfterTool(i.context.requestId)}catch(a){e.logger.warn("could not restore task state after user-question delivery failure",{eventId:t.eventId,error:a instanceof Error?a.message:String(a)})}try{e.turns.resumeAfterUserInput(i)}catch(a){e.logger.warn("could not resume turn timeout after user-question delivery failure",{eventId:t.eventId,error:a instanceof Error?a.message:String(a)})}await xV(e,t.eventId,"\u65E0\u6CD5\u5C06\u95EE\u9898\u53D1\u9001\u7ED9\u5F53\u524D\u7528\u6237","delivery_failed");return}e.logger.info("forwarded user question to MBHChat",{sessionId:r.sessionId,rpcId:t.eventId})}function TV(e,t){let r=e.pendingUserQuestions.get(t);if(!r)return;e.pendingUserQuestions.delete(t);let i=$I(e,r.frame.sessionId);i&&e.turns.resumeAfterUserInput(i),e.dcg.enqueue(r.context,{response:"",state:"chunk",is_finish:0,interaction:cf(r,"cancelled",r.submitted?.answers)},`question:${t}:cancelled`)}function $I(e,t){let r=e.turns.liveRun(t);return r||e.turns.liveRuns().find(i=>!i.finalized&&i.dshSessionId===t)}function _be(e,t){let r=ds(e.sessionId,AI)??ds(t,AI),i=e.questions;if(!r||!Array.isArray(i)||i.length===0||i.length>II)return;let n=[];for(let o of i){let s=he(o);if(!s)return;let a=ds(s.id,CI),c=ds(s.question,af);if(!a||!c)return;let u;if(s.options!==void 0){if(!Array.isArray(s.options)||s.options.length>OI)return;u=[];for(let f of s.options){let p=he(f),d=ds(p?.label,_y);if(!d)return;let h=ds(p?.description,_y);if(p?.description!==void 0&&!h)return;u.push({label:d,...h?{description:h}:{}})}}let l=ds(s.header,_y);if(s.header!==void 0&&!l||s.multiSelect!==void 0&&typeof s.multiSelect!="boolean")return;n.push({id:a,question:c,...l?{header:l}:{},...u?{options:u}:{},...typeof s.multiSelect=="boolean"?{multiSelect:s.multiSelect}:{}})}return{sessionId:r,questions:n}}function ds(e,t){if(typeof e!="string")return;let r=e.trim();return r&&r.length<=t?r:void 0}async function xV(e,t,r,i){try{(await e.dsh.api.respondEvent({eventId:t,outcome:{kind:"rejected",error:{name:"Error",message:r,code:i}}})).result.ok||e.logger.warn("DSH rejected user-question rejection",{eventId:t,code:i})}catch(n){e.logger.warn("could not reject user question through DSH",{eventId:t,code:i,error:n instanceof Error?n.message:String(n)})}}async function IV(e,t){if(t.type==="waterfall"&&t.event==="approval/request"){let r=RI(t.request,"sessionId"),i=RI(t.request,"approvalId"),n=RI(t.request,"toolName"),o=r?e.turns.liveRun(r):void 0,s=TI(e.config.dsh.approvalPolicy,o?.followup===!0);await e.dsh.api.respondEvent({eventId:t.eventId,outcome:{kind:"result",value:{sessionId:r,approvalId:i,outcome:s}}}),e.logger.info("answered headless approval",{sessionId:r,toolName:n,outcome:s});return}if(t.type==="waterfall"&&t.event==="user-questions/request"){await kV(e,t);return}if(t.type==="cancel"){TV(e,t.eventId);return}if(t.type==="emit"){if(t.event==="api-session/removed"){let r=String(t.args[0]??"");if(!r)return;e.unfollowSession?.(r),e.store.removeSessionByDshId(r);for(let i of e.turns.liveRuns())i.dshSessionId===r&&e.turns.finish(i,"session_removed","failed","[\u9519\u8BEF] mbh-chat \u4F1A\u8BDD\u5DF2\u88AB\u79FB\u9664");return}t.event==="api-session/error"&&wbe(e,String(t.args[0]??""),t.args[1])}}function RI(e,t){let r=e[t];return typeof r=="string"&&r?r:void 0}function wbe(e,t,r){if(!t)return;if(hy(r)){let n=e.turns.liveRun(t);n&&e.turns.finishInsufficientBalance(n);return}let i=String(r??"");if(!sf(i)){e.logger.error("mbh-chat applySessionError error",{sessionId:t,message:i});let n=e.turns.liveRun(t);n&&e.turns.finish(n,"error","failed",to(r));return}DI(e,t,i)}function DI(e,t,r){if(e.handledCorruptSessions.has(t))return;e.handledCorruptSessions.add(t);let i=e.stopRequestedSessions.delete(t);if(i?e.logger.info("ignored late mbh-chat agent error after stop",{dshSessionId:t,error:r}):e.logger.error("mbh-chat handleCorruptSessionError error",{sessionId:t,message:r}),e.unfollowSession?.(t),e.store.removeSessionByDshId(t),e.logger.info("discarded mbh-chat session with corrupt history",{dshSessionId:t,error:r,followsStop:i}),i){for(let o of e.turns.liveRuns())o.dshSessionId===t&&e.turns.finish(o,"stop","cancelled","");return}let n=e.corruptSessionRecoveries.get(t);n&&!n.active.finalized&&n.recover(r);for(let o of e.turns.liveRuns())o.dshSessionId===t&&o!==n?.active&&e.turns.finish(o,"session_invalidated","cancelled","")}var OV=["\u751F\u6210\u6587\u4EF6\u65F6\uFF0C\u6700\u7EC8\u56DE\u590D\u524D\u8C03\u7528\u4E00\u6B21 mbhchat_message\uFF0C\u628A\u5168\u90E8\u7EDD\u5BF9\u8DEF\u5F84\u653E\u5165\u540C\u4E00\u4E2A media \u6570\u7EC4\uFF1B\u4EC5 success=true \u65F6\u53EF\u79F0\u5DF2\u53D1\u9001\u3002","\u9644\u4EF6\u5148\u53D1\u9001\uFF0C\u666E\u901A\u6B63\u6587\u53EA\u5728\u6700\u7EC8\u56DE\u590D\u4E2D\u8FD4\u56DE\u4E14\u4E0D\u91CD\u590D\uFF1B\u5B9A\u65F6\u4EFB\u52A1\u540C\u6837\u3002"],CV=`<file_delivery_rules source="mbh-chat-host">
|
|
595
595
|
${OV.map(e=>`- ${e}`).join(`
|
|
596
596
|
`)}
|
|
597
|
-
</file_delivery_rules>`,
|
|
597
|
+
</file_delivery_rules>`,eRe=["\u5411\u5F53\u524D\u4E66\u7075\u58A8\u5B9D\u7528\u6237\u53D1\u9001\u6587\u672C\u6216\u9644\u4EF6\u3002",...OV.map(e=>`- ${e}`)].join(`
|
|
598
598
|
`);var xbe=`# \u8BED\u8A00\u653F\u7B56
|
|
599
599
|
|
|
600
600
|
- \u4EE5\u4E0B\u53EA\u7EA6\u675F\u8868\u8FBE\u65B9\u5F0F\uFF0C\u4E0D\u6539\u53D8\u4EFB\u52A1\u5185\u5BB9\u3001\u6743\u9650\u548C\u5B89\u5168\u8981\u6C42\uFF1B\u524D\u6587\u4E2D\u4E0E\u6B64\u51B2\u7A81\u7684\u8BED\u8A00\u6216\u5C55\u793A\u7EA6\u5B9A\u4EE5\u672C\u8282\u4E3A\u51C6\u3002
|
|
@@ -632,5 +632,5 @@ path: ${Pr(n)}
|
|
|
632
632
|
|
|
633
633
|
`),h=d?[{type:"text",text:d}]:[];for(let m of f.media)m.inlineImage&&h.push({type:"image",mediaType:m.inlineImage.mediaType,data:m.inlineImage.data,name:m.fileName});return h}};async function BV(e,t){let r=t.content,i=r.operation_type;try{let n=i==="install"||i==="enable"||i==="update"?await e.skillManager.install(r.skill_url??"",r.skill_code??""):await e.skillManager.uninstall(r.skill_code??"");await e.dcg.sendEvent({...r,status:n.status,...n.success?{}:{error:n.error}})}catch(n){await e.dcg.sendEvent({...r,status:"fail",error:te(n)})}}async function WV(e,t){if(t.eventType==="user_question"){try{await SV(e,t)}catch(r){e.logger.warn("user question response invalid",{error:te(r)})}return}if(t.eventType==="agent"){await zbe(e,t);return}await Ube(e,t)}async function zbe(e,t){try{let r=await e.agentManager.handleEvent(t),i=r.success&&(t.operationType==="create"||t.operationType==="remove")?await e.sessions.invalidateAgentSessions(r.affectedCloneCodes,`agent_${t.operationType}`):[];await e.dcg.sendEvent({...t.content,status:r.status,...r.updatedCodes?{updated_codes:r.updatedCodes}:{},...r.skippedCodes?{skipped_codes:r.skippedCodes}:{},...r.failedCodes?{failed_codes:r.failedCodes}:{},...r.failedReasons?{failed_reasons:r.failedReasons}:{},...r.cacheOnly!==void 0?{cache_only:r.cacheOnly}:{},...i.length>0?{session_cleanup_pending:!0,session_cleanup_clone_codes:i}:{},...r.success?{}:{error:r.message}}),e.logger.info("applied mbh-chat Agent operation",{operationType:t.operationType,success:r.success,affectedCloneCodes:r.affectedCloneCodes})}catch(r){await e.dcg.sendEvent({...t.content,status:"fail",error:te(r)}),e.logger.warn("mbh-chat Agent operation failed",{operationType:t.operationType,error:te(r)})}}async function Ube(e,t){let r=$M(t);if(!r){if(t.eventType==="cron"){await e.dcg.sendEvent({...t.content,status:"fail",error:`unsupported cron operation or missing job_id: ${t.operationType}`});return}e.logger.info("ignored mbh-chat event",{eventType:t.eventType,operationType:t.operationType});return}if(!e.cronSync){e.logger.warn("Mobook cron catalog control arrived before catalog sync started",{operation:r.operation,cronId:r.cronId}),await e.dcg.sendEvent({...t.content,status:"fail",error:"cron catalog sync is not ready"});return}r.operation==="run"&&r.messageId&&e.pendingCronMessageIds.set(r.cronId,r.messageId);let i;try{i=await e.cronSync.applyControl(r.operation,r.cronId)}catch(n){r.messageId&&e.pendingCronMessageIds.get(r.cronId)===r.messageId&&e.pendingCronMessageIds.delete(r.cronId),await e.dcg.sendEvent({...t.content,status:"fail",error:te(n)}),e.logger.warn("Mobook cron catalog control failed",{operation:r.operation,cronId:r.cronId,error:te(n)});return}i.runStatus!=="dispatched"&&r.messageId&&e.pendingCronMessageIds.get(r.cronId)===r.messageId&&e.pendingCronMessageIds.delete(r.cronId),e.logger.info("applied Mobook cron catalog control",{operation:r.operation,cronId:r.cronId,ok:i.applied,...i.runStatus?{runStatus:i.runStatus}:{},...i.reconciled?{reconciled:!0}:{}}),i.applied||e.logger.warn("Mobook cron catalog control did not apply",{operation:r.operation,cronId:r.cronId,...i.runStatus?{runStatus:i.runStatus}:{}}),await e.dcg.sendEvent({...t.content,status:i.applied?"ok":"fail",...i.runStatus?{run_status:i.runStatus}:{},...i.reconciled!==void 0?{reconciled:i.reconciled}:{}})}import ZV from"node:path";import PI from"node:fs";import Cc from"node:path";var Bbe=new Set([".exe",".dmg",".pkg",".apk",".ipa"]),Wbe=new Set([...KA,...Bbe]);function HV(e){if(!e||typeof e!="object")return"\u8BF7\u6C42\u5FC5\u987B\u662F\u5BF9\u8C61";if(typeof e.sessionId!="string"||!e.sessionId.trim())return"\u7F3A\u5C11 mbh-chat sessionId";if(typeof e.callId!="string"||!e.callId.trim())return"\u7F3A\u5C11\u5DE5\u5177 callId";if(!e.args||typeof e.args!="object")return"\u7F3A\u5C11\u5DE5\u5177\u53C2\u6570";if(e.args.target!==void 0&&typeof e.args.target!="string")return"target \u5FC5\u987B\u662F\u5B57\u7B26\u4E32";if(e.args.content!==void 0&&typeof e.args.content!="string")return"content \u5FC5\u987B\u662F\u5B57\u7B26\u4E32";if(e.workspaceDir!==void 0&&typeof e.workspaceDir!="string")return"workspaceDir \u5FC5\u987B\u662F\u5B57\u7B26\u4E32";if(e.args.media!==void 0&&!Array.isArray(e.args.media))return"media \u5FC5\u987B\u662F\u6570\u7EC4";if((e.args.media??[]).some(t=>!t||typeof t.file!="string"||!t.file.trim()))return"media \u4E2D\u6BCF\u9879\u90FD\u5FC5\u987B\u5305\u542B\u975E\u7A7A file";if(!e.args.content?.trim()&&(e.args.media?.length??0)===0)return"content \u548C media \u81F3\u5C11\u63D0\u4F9B\u4E00\u9879"}function VV(e,t,r){if(!Cc.isAbsolute(e))throw new Error(`\u9644\u4EF6\u5FC5\u987B\u4F7F\u7528\u7EDD\u5BF9\u8DEF\u5F84\uFF1A${e}`);let i,n;try{i=PI.realpathSync(e),n=PI.statSync(i)}catch{throw new Error(`\u9644\u4EF6\u4E0D\u5B58\u5728\u6216\u4E0D\u53EF\u8BFB\uFF1A${e}`)}if(!n.isFile()||n.size===0)throw new Error(`\u9644\u4EF6\u5FC5\u987B\u662F\u975E\u7A7A\u666E\u901A\u6587\u4EF6\uFF1A${e}`);if(n.size>r)throw new Error(`\u9644\u4EF6\u8D85\u8FC7\u5927\u5C0F\u4E0A\u9650 ${r} bytes\uFF1A${Cc.basename(e)}`);let o=Cc.extname(i).toLowerCase();if(!Wbe.has(o))throw new Error(`\u4E0D\u5141\u8BB8\u53D1\u9001\u6B64\u6587\u4EF6\u7C7B\u578B\uFF1A${o||"\u65E0\u6269\u5C55\u540D"}`);if(!t.some(a=>{try{let c=PI.realpathSync(a),u=Cc.relative(c,i);return u===""||!u.startsWith(`..${Cc.sep}`)&&u!==".."&&!Cc.isAbsolute(u)}catch{return!1}}))throw new Error(`\u9644\u4EF6\u8DEF\u5F84\u4E0D\u5728\u5F53\u524D mbh-chat \u5DE5\u4F5C\u533A\u5185\uFF1A${e}`);return i}async function GV(e){let{request:t,signal:r,config:i,activeBySession:n,ossUpload:o,dcg:s,logger:a}=e,c=HV(t);if(c)return{success:!1,sentMediaCount:0,queued:!1,error:c};let u=n.get(t.sessionId);if(!u||u.finalized)return{success:!1,sentMediaCount:0,queued:!1,error:"\u5F53\u524D\u4F1A\u8BDD\u6CA1\u6709\u6D3B\u8DC3\u8BF7\u6C42\uFF0C\u5DF2\u62D2\u7EDD\u8FC7\u671F\u53D1\u9001"};let l=t.args.target?.trim();if(l&&l.toLowerCase()!==u.businessKey.toLowerCase())return{success:!1,sentMediaCount:0,queued:!1,error:"target \u4E0E\u5F53\u524D mbh-chat SessionKey \u4E0D\u4E00\u81F4"};let f=t.args.media??[];if(f.length>20)return{success:!1,sentMediaCount:0,queued:!1,error:"\u5355\u6B21\u6700\u591A\u53D1\u9001 20 \u4E2A\u9644\u4EF6"};let p=[t.workspaceDir,i.dsh.workspaceCwd,i.dsh.outputRoot,"/workspace","/mobook",...i.outboundExtraRoots].filter(_=>!!_?.trim()),d=[],h=new Set;try{for(let _ of f){let k=VV(_.file,p,i.media.maxBytes);h.has(k)||(h.add(k),d.push(k))}}catch(_){return{success:!1,sentMediaCount:0,queued:!1,error:te(_)}}let m=[];try{for(let S of d){if(r.aborted)throw r.reason??new Error("mbhchat_message aborted");let v=await o(S,u.botToken,1,void 0,{appId:i.account.appId,userId:u.context.userId,signal:r});if(!v)throw new Error(`\u9644\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF1A${ZV.basename(S)}`);m.push({url:v,name:ZV.basename(S)})}let _=t.args.content?.trim()??"",k=[...new Set(f.map(S=>S.file))].sort((S,v)=>v.length-S.length);for(let S of k)_=_.split(S).join("");if(_=_.trim(),u.followup)_&&(u.cronText+=u.cronText?`
|
|
634
634
|
${_}`:_),u.cronAttachments.push(...m);else{let S={response:_,state:"chunk",chunk_idx:u.chunkIndex++,is_finish:0,...m.length>0?{files:m}:{}};s.enqueue(u.context,S,`message-tool:${t.callId}`),await s.flush()}return a.info("mbhchat_message queued",{dshSessionId:t.sessionId,callId:t.callId,sentMediaCount:m.length}),{success:!0,sentMediaCount:m.length,queued:!0}}catch(_){return a.warn("mbhchat_message failed",{dshSessionId:t.sessionId,callId:t.callId,error:te(_)}),{success:!1,sentMediaCount:0,queued:!1,error:te(_)}}}import{randomUUID as YV}from"node:crypto";import Gbe from"node:path";import{createHash as Hbe}from"node:crypto";import Vbe from"node:fs/promises";import Dn from"node:path";function Zbe(e){return Hbe("sha256").update(e).digest("hex").slice(0,24)}function KV(e,t){let r=Dn.resolve(e);if(!t)return r;let i=Dn.resolve(t);if(i===r)return r;let n=Dn.dirname(r),o=Dn.dirname(n);return i===o||i===n?r:Dn.join(i,"output")}async function XV(e,t){let r=Dn.join(e,Zbe(t)),i={root:r,files:Dn.join(r,"files"),tmp:Dn.join(r,"tmp"),previews:Dn.join(r,"previews"),downloads:Dn.join(r,"downloads")};return await Promise.all(Object.values(i).map(n=>Vbe.mkdir(n,{recursive:!0}))),i}function JV(e){return['<session_output source="mbh-chat-host">',`paths: ${Pr(e)}`,"- \u65B0\u6587\u4EF6\u6309 files\u3001tmp\u3001previews\u3001downloads \u7684\u7528\u9014\u5199\u5165\u5E76\u5728\u672C\u4F1A\u8BDD\u590D\u7528\uFF1B\u4EC5\u7528\u6237\u660E\u786E\u8981\u6C42\u4FEE\u6539\u5DF2\u6709\u9879\u76EE\u6587\u4EF6\u65F6\u539F\u4F4D\u7F16\u8F91\u3002","- \u4E0D\u5F97\u628A\u65B0\u4EA7\u7269\u5199\u5165 DSH_HOME\u3001\u5171\u4EAB\u5DE5\u4F5C\u533A\u6839\u76EE\u5F55\u6216\u5176\u4ED6\u4F1A\u8BDD\u76EE\u5F55\u3002","</session_output>"].join(`
|
|
635
|
-
`)}async function QV(e,t,r,i){if(!e.started)return;let n=FV(t.content);n?.source==="intent"&&e.intentFeedback.matched(r,"\u4E13\u5BB6",n.value.name);let s=(n&&!Ia(n.value.agentCode,n.value.cloneCode)?!await e.agentManager.hasWorkspace(n.value.cloneCode):!1)?e.intentFeedback.beginInstall(r,"\u4E13\u5BB6",n?.value.name??"\u4E13\u5BB6"):void 0,a=await e.inboundPrompt.prepareAgentRoute(t);s&&e.intentFeedback.finishInstall(r,s,!("error"in a));let c=0;if("error"in a){if(!n){e.turns.sendImmediateFinal(r,"agent_not_installed","failed",a.error);return}e.dcg.enqueue(r,{response:`${n.value.name}\u5B89\u88C5\u5931\u8D25\uFF0C\u7531\u4E66\u7075\u58A8\u5B9D\u4E3A\u60A8\u89E3\u7B54\u3002`,state:"chunk",chunk_idx:c++,message_tags:{source:"agent_install_failed"},is_finish:-1},"agent:install-failed"),a={...e.config.dsh.workspaceCwd?{workspaceDir:e.config.dsh.workspaceCwd}:{},agentPreset:e.config.dsh.agentPreset,managed:!1}}let u=zV(t.content);u?.source==="intent"&&e.intentFeedback.matched(r,"\u6280\u80FD",u.value.name);let f=(u?!e.skillManager.exists(u.value.code):!1)?e.intentFeedback.beginInstall(r,"\u6280\u80FD",u?.value.name??"\u6280\u80FD"):void 0,p=await e.inboundPrompt.prepareSelectedSkill(t);f&&e.intentFeedback.finishInstall(r,f,!p.error);let d=p.error;d&&e.dcg.enqueue(r,{response:d,state:"chunk",chunk_idx:c++,message_tags:{source:"skill_install_failed"},is_finish:-1},"skill:install-failed"),e.intentFeedback.knowledgeSearch(r,ky(t.content));let h=a.managed&&a.workspaceDir?KV(e.config.dsh.outputRoot,a.workspaceDir):e.config.dsh.outputRoot,m=await XV(h,r.businessKey),_=await e.inboundPrompt.promptContent(t,r.requestId,p.promptPrefix,a.workspaceDir?Gbe.join(a.workspaceDir,"inbound"):e.config.media.storageRoot,JV(m),e.store.hasPostStopContextBoundary(r.businessKey));if(_.length===0){e.turns.sendImmediateFinal(r,"not_text","succeeded","\u4F60\u9700\u8981\u6211\u5E2E\u4F60\u505A\u4EC0\u4E48\u5462\uFF1F");return}if(await e.dsh.whenConnected(e.connectionWaitSignal()),!e.started)return;if(i!==void 0&&i<=Date.now())throw new Error("task preparation timed out");let k=await e.sessions.ensureSession(r.businessKey,t.content.model,a,r);if(e.stopRequestedSessions.delete(k),!e.started)return;let S=YV();if(!e.store.markRequestRunning(r.requestId,k,S)){e.logger.warn("mbh-chat request was no longer waiting before execution",{requestId:r.requestId});return}let v=kc({context:r,botToken:t.content.bot_token?.trim()||e.config.account.botToken,businessKey:r.businessKey,dshSessionId:k,chunkIndex:c,skillNames:tV(t.content),followup:!1,turnTimeoutMs:e.config.turnTimeoutMs,taskTimeoutMs:e.config.task.timeoutMs,...i===void 0?{}:{deadlineAt:i},onTimeout:U=>{e.turns.onTurnTimeout(U)}});e.activeBySession.set(k,v);let g=new AbortController;v.submissionAbort=g;let y=_,T=0,R=!1,I=new Set,b=()=>{if(S=YV(),!e.store.updateRequestExecutionRpc(r.requestId,S))throw new Error("could not persist the DSH prompt identity before submission")},O=async U=>{let Z=await e.dsh.api.sessions.prompt({requestId:S,sessionId:U,mode:"queue",content:y,clientTimeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},g.signal);return!Z.result.ok&&Z.result.error.code==="attachment-error"&&y.some(J=>J.type==="image")&&(e.logger.warn("mbh-chat rejected inline image input; retrying with readable local attachment paths",{requestId:r.requestId,reason:Z.result.error.message}),y=y.filter(J=>J.type==="text"),b(),Z=await e.dsh.api.sessions.prompt({requestId:S,sessionId:U,mode:"queue",content:y,clientTimeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},g.signal)),Z},A=async(U,Z)=>{if(Wr(U),!g.signal.aborted&&!e.stopRequestedSessions.has(Z))return!0;e.logger.info("mbh-chat prompt was accepted after its run was interrupted; cancelling again",{requestId:r.requestId,dshSessionId:Z});try{await e.cancelActiveExecution(v)}catch(J){e.logger.warn("could not reconfirm cancellation after a late prompt acceptance",{requestId:r.requestId,dshSessionId:Z,error:te(J)})}return!1},P=U=>{I.delete(U),e.corruptSessionRecoveries.get(U)?.active===v&&e.corruptSessionRecoveries.delete(U)},D=async(U,Z)=>{e.cancelPendingUserQuestions(U),e.turns.detachForSessionRetry(v,U),e.store.removeSession(r.businessKey);let J=await e.sessions.ensureSession(r.businessKey,t.content.model,a,r);if(!e.started||v.finalized){e.store.removeSession(r.businessKey),P(U);return}if(v.deadlineAt<=Date.now())throw new Error("task timed out while recovering the session");return k=J,e.store.updateRequestExecutionSession(r.requestId,J),b(),P(U),e.turns.attachAfterSessionRetry(v,J),V(J),e.logger.info("recreated mbh-chat session and resubmitting the current request",{requestId:r.requestId,oldDshSessionId:U,dshSessionId:J,reason:Z}),J},V=U=>{I.add(U),e.corruptSessionRecoveries.set(U,{active:v,recover:Z=>{v.finalized||R||v.dshSessionId!==U||(R=!0,$(U,Z))}})};async function $(U,Z){try{if(T+=1,T>1)throw new Error("session history recovery was already attempted");let J=await D(U,Z);if(!J||!await A(await O(J),J))return}catch(J){e.logger.error("could not recover corrupt mbh-chat session",{requestId:r.requestId,dshSessionId:U,error:te(J)}),v.finalized||e.turns.finish(v,"session_recovery_failed","failed","[\u9519\u8BEF] \u4F1A\u8BDD\u81EA\u52A8\u6062\u590D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{R=!1}}try{V(k);try{let U=k,Z=await O(k);if(!Z.result.ok&&_I(Z.result.error.code)){let J=await D(k,Z.result.error.code);if(!J)return;U=J,Z=await O(J)}if(!await A(Z,U))return}catch(U){if(g.signal.aborted){e.logger.info("mbh-chat prompt submission interrupted",{requestId:r.requestId,dshSessionId:k}),await v.completion;return}e.logger.error("mbh-chat prompt submission failed",{requestId:r.requestId,dshSessionId:k,error:te(U)}),e.turns.finish(v,"error","failed",to(U))}await v.completion}finally{for(let U of I)P(U)}}var Kbe="\uFEFF",Xbe="cron_running";function Iy(e,t,r,i=!0){let n=e.store.getBusinessKeyByDshSessionId(t);if(!n&&vy(r)){let h=yy(r,"cron_id");h&&(n=e.resolveCronBusinessKey?.(h))}if(!n){e.logger.warn("unsolicited mbh-chat session event has no mapped mbh-chat session",{dshSessionId:t,type:r.type});return}let o=e.store.getLatestContextForBusinessKey(n);if(!o){e.logger.warn("unsolicited mbh-chat session event has no prior outbound context",{dshSessionId:t,businessKey:n});return}let s=yy(r,"cron_id"),a=s?e.pendingCronMessageIds.get(s):void 0;s&&a&&e.pendingCronMessageIds.delete(s);let c=fV(a),u={...o,messageId:c.notification,requestId:Qn(o.accountId,c.notification)},l={...o,messageId:c.chat,requestId:Qn(o.accountId,c.chat)},f=he(r.data),p=kc({context:l,botToken:e.config.botToken,businessKey:n,dshSessionId:t,...typeof f?.turn=="number"?{turn:f.turn}:{},followup:!0,turnTimeoutMs:e.config.turnTimeoutMs,taskTimeoutMs:e.config.taskTimeoutMs,onTimeout:h=>{e.onTurnTimeout(h)}});e.trackRun(p),i&&e.activeBySession.set(t,p);let d=yy(r,"name")??"\u5B9A\u65F6\u4EFB\u52A1";try{e.dcg.enqueue(l,{response:Kbe,state:"chunk",message_tags:{source:Xbe,uid:l.messageId},is_finish:0},"cron:loading")}catch(h){e.logger.warn("could not persist cron loading message",{cronId:s,requestId:l.requestId,error:te(h)})}return e.dcg.enqueueEvent(u,{event_type:"notify",operation_type:"cron",title:d,message_id:u.messageId,desc:""}),e.logger.info("started mbh-chat followup run for unsolicited mbh-chat turn",{dshSessionId:t,requestId:l.requestId,sessionId:l.sessionId,type:r.type}),p}var Jbe=/(?:\r?\n+|[。!?!?;;]+[”’"'))】》」』]*\s*)/gu,Ybe=/(?:[,,、::]|\s+)/gu;function eZ(e,t){let r=[];t.lastIndex=0;for(let i=t.exec(e);i;i=t.exec(e))r.push(i.index+i[0].length);return r}function Qbe(e,t){let r=Math.min(t,e.length);if(r>0&&r<e.length){let i=e.charCodeAt(r-1),n=e.charCodeAt(r);i>=55296&&i<=56319&&n>=56320&&n<=57343&&(r-=1)}return r}function qI(e,t){if(!e)return 0;let r=eZ(e,Jbe),i=r.filter(s=>s>=t.minChars);if(e.length<=t.maxChars)return t.keepLastComplete&&i.length>=2?i[i.length-2]??0:!t.keepLastComplete&&i.length>=1?i[i.length-1]??0:0;let n=r.filter(s=>s<=t.maxChars).at(-1);if(n&&n>=Math.floor(t.maxChars/3))return n;let o=eZ(e.slice(0,t.maxChars),Ybe).filter(s=>s>=Math.floor(t.maxChars/2)).at(-1);return o||Qbe(e,t.maxChars)}function Nn(e,t){return e.followup?{...t,state:"chunk",is_finish:t.thought_chain?t.is_finish??1:0,message_tags:{source:"cron_running",uid:e.context.messageId}}:t}var e_e=24,t_e=512,r_e=32,jI=118,nZ=135,n_e=4,tZ=["\u6B63\u5728\u63D0\u70BC\u5173\u952E\u4FE1\u606F","\u6B63\u5728\u786E\u8BA4\u5904\u7406\u7ED3\u679C","\u5173\u952E\u5185\u5BB9\u6574\u7406\u8FDB\u884C\u4E2D","\u6B63\u5728\u6C47\u805A\u6838\u5FC3\u4FE1\u606F","\u6B63\u5728\u5F52\u7EB3\u5173\u952E\u4FE1\u606F","\u6B63\u5728\u590D\u67E5\u5904\u7406\u7ED3\u679C","\u6838\u5FC3\u4FE1\u606F\u68B3\u7406\u4E2D","\u6B63\u5728\u68C0\u67E5\u6574\u7406\u7ED3\u679C","\u6B63\u5728\u9A8C\u8BC1\u5904\u7406\u7ED3\u679C","\u5173\u952E\u4FE1\u606F\u786E\u8BA4\u4E2D"],rZ=/(?:\r?\n+|(?:[。!?!?;;]|…{1,2})[”’"'))】》」』]*\s*)/gu,i_e=/^I'll.+?\bskill\b.*\.$/u,o_e=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,s_e=[/^\s*(?:i(?:'ll| will| am going to| need to)|let me)\s+(?:(?:first|now)\s+)?(?:(?:start|begin)(?:ning)?\s+by\s+)?(?:read(?:ing)?|load(?:ing)?|review(?:ing)?|inspect(?:ing)?|check(?:ing)?|open(?:ing)?|analy[sz](?:e|ing)|examin(?:e|ing)|process(?:ing)?|look(?:ing)?\s+(?:at|through)|use|call(?:ing)?)\b/iu,/^\s*first,?\s+i(?:'ll| will| am going to)\s+(?:read|load|review|inspect|check|open|analy[sz]e|examine|process|use|call)\b/iu,/^\s*to begin(?: with)?,?\s+i(?:'ll| will)\s+(?:read|load|review|inspect|check|open|analy[sz]e|examine|process|use|call)\b/iu],a_e=/(?:\.mobook(?:-harness)?|\.openclaw|channels\.[\w-]+|opts\.params|getOpenclaw|run_workflow|--user(?:_id)?|\[REDACTED\])/iu,c_e="\u6B63\u5728\u6838\u5BF9\u672C\u5730\u914D\u7F6E\u4E0E\u4EFB\u52A1\u53C2\u6570";function u_e(e){let r=Oc(e).trim();return a_e.test(r)?c_e:!r||o_e.test(r)?e:(r.match(/[A-Za-z]+(?:'[A-Za-z]+)?/gu)?.length??0)>=4&&s_e.some(n=>n.test(r))?"":e}function l_e(e,t){return Oc(e.replace(i_e,"\u6B63\u5728\u8BFB\u53D6\u6280\u80FD\u76F8\u5173\u6587\u4EF6"),t)}function Ac(e,t,r){e.finalized||!r||(e.pendingText+=r,f_e(e,t))}function Oy(e,t){if(!e.pendingText||e.finalized){e.pendingText="";return}let r=e.pendingText;e.pendingText="",iZ(e,t,r)}function f_e(e,t){for(;!e.finalized;){if(!e.pendingText)return;let r=qI(e.pendingText,{minChars:e_e,maxChars:t_e});if(r===0)return;iZ(e,t,e.pendingText.slice(0,r)),e.pendingText=e.pendingText.slice(r)}}function iZ(e,t,r){if(!r)return;let i=l_e(r,e.botToken);if(e.followup){e.cronText+=i;return}let n=e.chunkIndex++;t.enqueue(e.context,{response:i,state:"chunk",chunk_idx:n},`chunk:${n}`)}function Cy(e,t,r,i,n){if(!(e.finalized||!r)&&(e.reasoningMessageKey&&e.reasoningMessageKey!==i&&ps(e,t,"complete"),e.reasoningMessageKey||(e.reasoningMessageKey=i,e.reasoningSort=n,e.reasoningVisibleChars=0,e.reasoningLimitReached=!1),!e.reasoningLimitReached))for(e.pendingReasoning+=r;!e.finalized;){if(!e.pendingReasoning)return;let o=nZ-e.reasoningVisibleChars;if(e.pendingReasoning.length>o){p_e(e,t,o);return}let s=qI(e.pendingReasoning,{minChars:r_e,maxChars:jI,keepLastComplete:!0});if(s===0)return;let a=e.pendingReasoning.slice(0,s);e.pendingReasoning=e.pendingReasoning.slice(s),e.reasoningVisibleChars+=a.length,lf(e,t,a,!1,"start_stream")}}function ps(e,t,r){e.reasoningMessageKey&&(d_e(e,t,!0,r),e.reasoningMessageKey=void 0,e.reasoningSort=void 0,e.reasoningStarted=!1)}function d_e(e,t,r,i){let n=e.pendingReasoning;if(e.pendingReasoning="",e.finalized||!n&&(!r||!e.reasoningStarted))return;let o=nZ-e.reasoningVisibleChars;if(!e.reasoningLimitReached&&n.length>o){let s=n.slice(0,oZ(n,Math.min(o,jI)));e.reasoningVisibleChars+=s.length,e.reasoningLimitReached=!0,lf(e,t,`${s}${sZ(e)}`,r,i);return}if(e.reasoningLimitReached){lf(e,t,"",r,i);return}e.reasoningVisibleChars+=n.length,lf(e,t,n,r,i)}function oZ(e,t){if(t<=0)return 0;let r=e.slice(0,t);rZ.lastIndex=0;let i=rZ.exec(r);return i?i.index+i[0].length:0}function p_e(e,t,r){let i=oZ(e.pendingReasoning,Math.min(r,jI)),n=e.pendingReasoning.slice(0,i);e.pendingReasoning="",e.reasoningVisibleChars+=n.length,e.reasoningLimitReached=!0,lf(e,t,`${n}${sZ(e)}`,!1,"start_stream")}function sZ(e){return e.reasoningTruncationCount+=1,e.reasoningTruncationCount%n_e!==0?"":tZ[Math.floor(Math.random()*tZ.length)]}function lf(e,t,r,i,n){let o=u_e(r);if(!o&&(!i||!e.reasoningStarted))return;o&&(e.reasoningStarted=!0);let s=e.reasoningLineIndex++,a=e.reasoningMessageKey??`reasoning:${e.turn??0}:0`,c=(e.reasoningSort??Date.now()/1e3)+s/1e9;t.enqueue(e.context,Nn(e,NV({context:e.context,content:o,sort:c,finished:i,status:n,messageKey:a,botToken:e.botToken})),`thought:${s}`)}function MI(e,t,r){for(let[i,n]of e.toolCalls){if(n.settled)continue;n.settled=!0;let o=r==="cancelled";t.enqueue(e.context,Nn(e,Hr({context:e.context,title:fu(n.name),name:Vs[n.name]?.name||"\u5DE5\u5177\u6267\u884C",toolCallId:i,content:o?"\u5DE5\u5177\u6267\u884C\u5DF2\u4E2D\u65AD":"\u5DE5\u5177\u6267\u884C\u672A\u8FD4\u56DE\u7ED3\u679C",sort:n.sort,finished:!0,status:o?"cancel":"fail",isError:!0,botToken:e.botToken})),`tool:${i}:result`)}}function aZ(e){e.pendingText="",e.stepText.clear(),e.assistantStreamIndexes?.clear(),e.pendingReasoning="",e.stepReasoning.clear(),e.reasoningMessageKey=void 0,e.reasoningSort=void 0,e.reasoningStarted=!1,e.reasoningVisibleChars=0,e.reasoningLimitReached=!1,e.reasoningTruncationCount=0,e.turnStartedAt=void 0,e.timeTakenMs=void 0,e.toolCalls.clear(),delete e.turn}function LI(e,t){for(let r of e)if(!r.finalized&&r.pendingSubagents.has(t))return r}function cZ(e,t,r,i){let n=gy(i);if(n)return e.find(o=>o.dshSessionId===r&&o.pendingSubagents.has(n))??t??LI(e,r)}function uZ(e,t,r,i,n,o){if(o(e),gy(t)){zI(e,t,r,i,n,o);return}t.type==="tool/result"&&FI(e,t.data.message.content,r,i,n,o)}function FI(e,t,r,i,n,o){let s=gV(t);s&&(e.settledSubagents.delete(s)||(e.pendingSubagents.add(s),e.subagentParents.set(s,r),e.followup||(i.trackSubagent(e.context.requestId,r,s),i.markRequestToolWaiting(e.context.requestId)),lZ(e,n,s,Date.now()/1e3),o(e)))}function zI(e,t,r,i,n,o){let s=gy(t);if(!s)return;e.pendingSubagents.delete(s)||(e.settledSubagents.add(s),lZ(e,n,s,fs(t))),e.subagentParents.delete(s);let a=he(he(t.data)?.source),c=typeof a?.summary=="string"?a.summary.trim():"completed",u=c.toLowerCase(),l=/(aborted|cancelled|canceled|interrupted)/.test(u)?"cancel":/(failed|failure|error)/.test(u)?"fail":"complete";e.followup||(i.trackSubagent(e.context.requestId,r,s),i.settleSubagent(s,l==="complete"?"completed":l==="cancel"?"cancelled":"failed")),n.enqueue(e.context,Nn(e,Hr({context:e.context,title:"subagent",name:"\u5B50 Agent",toolCallId:s,content:`\u5B50 Agent \u5DF2\u7ED3\u675F\uFF1A${c}`,sort:fs(t),finished:!0,status:l,isError:l==="fail",botToken:e.botToken})),`subagent:${s}:result`),BI(e,i),o(e)}function lZ(e,t,r,i){t.enqueue(e.context,Nn(e,Hr({context:e.context,title:"subagent",name:"\u5B50 Agent",toolCallId:r,content:"\u5B50 Agent \u5DF2\u542F\u52A8",sort:i,finished:!1,status:"start_stream",isError:!1,botToken:e.botToken})),`subagent:${r}:start`)}function UI(e,t,r,i){let n=i==="cancelled";for(let o of e.pendingSubagents)e.followup||t.settleSubagent(o,n?"cancelled":"failed"),r.enqueue(e.context,Nn(e,Hr({context:e.context,title:"subagent",name:"\u5B50 Agent",toolCallId:o,content:n?"\u5B50 Agent \u6267\u884C\u5DF2\u4E2D\u65AD":"\u5B50 Agent \u672A\u8FD4\u56DE\u5B8C\u6574\u7ED3\u679C",sort:Date.now()/1e3,finished:!0,status:n?"cancel":"fail",isError:!0,botToken:e.botToken})),`subagent:${o}:result`);e.pendingSubagents.clear(),e.subagentParents.clear(),e.settledSubagents.clear()}function BI(e,t){e.followup||e.pendingSubagents.size>0||[...e.toolCalls.values()].some(r=>!r.settled)||t.markRequestRunningAfterTool(e.context.requestId)}var h_e=new Set(["read","read_image","glob","grep","skill"]),fZ=/(?:^|[\s;&|()<>"'`])(?:[^\s;&|()<>"'`]*[\\/])?cat(?:\.exe)?(?=$|[\s;&|()<>"'`])/iu;function m_e(e,t){if(e!=="bash"&&e!=="pwsh")return!1;try{let r=he(JSON.parse(t)),i=typeof r?.command=="string"?r.command:t;return fZ.test(i)}catch{return fZ.test(t)}}function g_e(e,t,r){if(t!=="skill")return r;try{let i=he(JSON.parse(r));if(!i)return r;let n=[i.code,i.skill_code,i.skillCode,i.name].find(s=>typeof s=="string"&&s.trim().length>0);if(!n)return r;let o=n.trim();return JSON.stringify({description:e.skillNames?.get(o)??o})}catch{return r}}function dZ(e,t,r){if(r.type==="user/message"){if(vy(r)){let c=e.hasLiveRun(t),u=Iy(e,t,r,!c);c&&u&&e.queuePendingTurn(t,{kind:"resume",active:u});return}let a=cZ(e.liveRuns(),e.liveRun(t),t,r);a&&(zI(a,r,t,e.store,e.dcg,c=>e.armTurnTimeout(c)),a.dshSessionId===t&&e.queuePendingTurn(t,{kind:"resume",active:a}));return}let i=LI(e.liveRuns(),t);if(i){uZ(i,r,t,e.store,e.dcg,a=>e.armTurnTimeout(a));return}let n=he(r.data),o=typeof n?.turn=="number"?n.turn:void 0,s=o===void 0?e.liveRun(t):e.turnOwner(t,o);if(r.type==="turn/start"){if(o===void 0||(s=e.ownerForTurnStart(t,o),!s))return;s.turnStartedAt=r.time,s.timeTakenMs=void 0,e.armTurnTimeout(s);return}if(s??=e.liveRun(t),!!s&&!(o!==void 0&&s.turn!==void 0&&o!==s.turn)){if(e.armTurnTimeout(s),r.type==="assistant/message"){y_e(s,r,e.dcg);return}if(r.type==="tool/call"){v_e(s,r,e.store,e.dcg);return}if(r.type==="tool/result"){b_e(s,r,t,e.store,e.dcg,a=>e.armTurnTimeout(a));return}r.type==="turn/end"&&(s.timeTakenMs=s.turnStartedAt===void 0?void 0:r.time-s.turnStartedAt,__e(e,s,o,n?.reason))}}function pZ(e,t,r){let i=e.turnOwner(t,r.turn)??e.liveRun(t);if(!i||i.finalized||i.turn!==void 0&&i.turn!==r.turn)return;let n=i.assistantStreamIndexes??=new Map;if(r.index<(n.get(r.attemptId)??0))return;n.set(r.attemptId,r.index+1),e.armTurnTimeout(i);let o=`${r.turn}:${r.step}`,s=r.chunk;s.type==="text-delta"?(i.stepText.set(o,(i.stepText.get(o)??"")+s.text),Ac(i,e.dcg,s.text)):s.type==="reasoning-delta"&&(i.stepReasoning.set(o,(i.stepReasoning.get(o)??"")+s.text),Cy(i,e.dcg,s.text,`reasoning:${o}`,r.time/1e3+r.index/1e9))}function y_e(e,t,r){let i=he(t.data),n=he(i?.message),o=my(n?.content,"text"),s=my(n?.content,"reasoning"),a=typeof i?.step=="number"?i.step:0,c=`${i?.turn??e.turn??0}:${a}`,u=e.stepText.get(c)??"";!u&&o?Ac(e,r,o):o.startsWith(u)&&o.length>u.length&&Ac(e,r,o.slice(u.length));let l=e.stepReasoning.get(c)??"",f=`reasoning:${c}`,p=fs(t);!l&&s?Cy(e,r,s,f,p):s.startsWith(l)&&s.length>l.length&&Cy(e,r,s.slice(l.length),f,p),Oy(e,r),e.reasoningMessageKey===f&&ps(e,r,"complete")}function v_e(e,t,r,i){ps(e,i,"complete");let n=String(t.data.callId);if(e.toolCalls.has(n))return;let o=fs(t);e.toolCalls.set(n,{name:t.data.name,sort:o,settled:!1,hideResult:m_e(t.data.name,t.data.arguments)}),e.followup||r.markRequestToolWaiting(e.context.requestId),i.enqueue(e.context,Nn(e,Hr({context:e.context,title:fu(t.data.name),name:Vs[t.data.name]?.name||"\u5DE5\u5177\u6267\u884C",toolCallId:n,content:EI(g_e(e,t.data.name,t.data.arguments),"\u6B63\u5728\u6267\u884C"),sort:o,finished:!1,status:"start_stream",isError:!1,botToken:e.botToken})),`tool:${n}:start`)}function b_e(e,t,r,i,n,o){let s=String(t.data.message.source.callId),a=e.toolCalls.get(s);if(a?.settled)return;let c=t.data.message;FI(e,c.content,r,i,n,o);let u=t.data.error?.code==="interrupted",l=c.isError===!0||t.data.error!==void 0,f=a?.name||"\u5DE5\u5177\u6267\u884C",p=a?.sort??fs(t),d=h_e.has(f)||a?.hideResult?l?"\u6267\u884C\u5931\u8D25":"\u6267\u884C\u5B8C\u6210":EI(kI(c.content),l?"\u6267\u884C\u5931\u8D25":"\u6267\u884C\u5B8C\u6210");e.toolCalls.set(s,{name:f,sort:p,settled:!0,hideResult:a?.hideResult??!1}),BI(e,i),n.enqueue(e.context,Nn(e,Hr({context:e.context,title:fu(f),name:Vs[f]?.name||"\u5DE5\u5177\u6267\u884C",toolCallId:s,content:d,sort:p,finished:!0,status:u?"cancel":l?"fail":"complete",isError:l,botToken:e.botToken})),`tool:${s}:result`)}function __e(e,t,r,i){let n=he(i),o=he(n?.error);if(n?.kind==="error"&&hy(o?.message??o)){r!==void 0&&e.releaseTurnOwner(t.dshSessionId,r),e.finishInsufficientBalance(t);return}let s=yV(i);if(r!==void 0&&e.releaseTurnOwner(t.dshSessionId,r),s.status==="succeeded"&&t.pendingSubagents.size>0){e.logger.info("keeping MBHChat message open for background subagents",{dshSessionId:t.dshSessionId,requestId:t.context.requestId,pendingSubagents:[...t.pendingSubagents]}),e.armTurnTimeout(t);return}if(s.status!=="succeeded"&&t.pendingSubagents.size>0){e.finishAfterCascade(t,s.tag,s.status,s.response??"");return}e.finish(t,s.tag,s.status,s.response)}var Ay=class{config;store;getDcg;logger;activeBySession;pendingCronMessageIds;cancelExecution;resolveCronBusinessKey;quarantineUnconfirmedExecution;runsBySession=new Map;turnOwners=new Map;pendingTurns=new Map;terminatingRuns=new WeakSet;constructor(t,r,i,n,o,s,a,c,u){this.config=t,this.store=r,this.getDcg=i,this.logger=n,this.activeBySession=o,this.pendingCronMessageIds=s,this.cancelExecution=a,this.resolveCronBusinessKey=c,this.quarantineUnconfirmedExecution=u}get dcg(){return this.getDcg()}liveRun(t){let r=this.activeBySession.get(t);if(!(!r||r.finalized))return this.trackRun(r),r}liveRuns(){let t=new Set;for(let r of this.activeBySession.values())r.finalized||t.add(r);for(let r of this.runsBySession.values())for(let i of r)i.finalized||t.add(i);return[...t]}handleSessionEvent(t,r){dZ(this,t,r)}handleAssistantChunk(t,r){pZ(this,t,r)}queueText(t,r){Ac(t,this.dcg,r)}detachForSessionRetry(t,r){t.finalized||t.dshSessionId!==r||(clearTimeout(t.timeout),MI(t,this.dcg,"cancelled"),UI(t,this.store,this.dcg,"cancelled"),ps(t,this.dcg,"cancel"),aZ(t),this.forgetRun(t,r,{keepReplacement:!1}))}attachAfterSessionRetry(t,r){t.finalized||(t.dshSessionId=r,this.activeBySession.set(r,t),this.armTurnTimeout(t))}finish(t,r,i,n=""){this.finishRun(t,r,i,n)}finishInsufficientBalance(t){this.finishRun(t,"insufficient_balance","failed","\u58A8\u6EF4\u4E0D\u8DB3",{discardPendingText:!0,forceDirectTerminal:!0,beforeTerminal:()=>{let r=t.chunkIndex++;this.dcg.enqueue(t.context,{response:"\u60A8\u7684\u58A8\u6EF4\u5DF2\u6D88\u8017\u5B8C\uFF0C\u60A8\u53EF\u4EE5\u901A\u8FC7\u5145\u503C\u58A8\u6EF4\u6765\u7EE7\u7EED\u4F7F\u7528\u3002",state:"chunk",chunk_idx:r,message_tags:{insufficient_balance:1},is_finish:-1},"insufficient_balance")}})}finishRun(t,r,i,n,o={}){if(!t.finalized){clearTimeout(t.timeout);try{MI(t,this.dcg,i),UI(t,this.store,this.dcg,i),ps(t,this.dcg,DV(i)),o.discardPendingText?t.pendingText="":Oy(t,this.dcg),o.beforeTerminal?.();let s=t.timeTakenMs===void 0?{}:{timeTakenMs:t.timeTakenMs},a={response:t.followup&&!o.forceDirectTerminal?"":n,state:"final",final_tag:r,is_finish:1,message_tags:{isFinal:1,...s},...t.context.model?{model:t.context.model}:{}};if(t.followup&&!o.forceDirectTerminal){let c=t.cronText&&n?`${t.cronText}
|
|
636
|
-
${n}`:t.cronText||n;(c||t.cronAttachments.length>0)&&this.dcg.enqueue(t.context,{response:c,message_tags:{source:"cron_running",uid:t.context.messageId,...t.cronAttachments.length>0?{mark:"empty_text_file"}:{}},state:"chunk",is_finish:0,...t.cronAttachments.length>0?{files:t.cronAttachments}:{}},"cron:content"),this.dcg.enqueue(t.context,{...a,message_tags:{source:"cron_running",uid:t.context.messageId,isFinal:1,...s}},"final")}else this.dcg.enqueueTerminal(t.context,a,"final",i,r)}catch(s){this.logger.error("could not persist terminal request and delivery",{requestId:t.context.requestId,tag:r,error:te(s)})}finally{t.finalized=!0,this.forgetRun(t,t.dshSessionId,{keepReplacement:!0}),t.resolveCompletion()}}}suspend(t){t.finalized||(clearTimeout(t.timeout),t.submissionAbort?.abort(new Error("Bridge suspended the active prompt submission")),t.finalized=!0,this.forgetRun(t,t.dshSessionId,{keepReplacement:!0}),t.resolveCompletion())}sendImmediateFinal(t,r,i,n){try{this.dcg.enqueueTerminal(t,{response:n,state:"final",final_tag:r,is_finish:1,message_tags:{isFinal:1}},"final",i,r)}catch(o){this.logger.error("could not persist immediate terminal request and delivery",{requestId:t.requestId,tag:r,error:te(o)})}}async onTurnTimeout(t){if(t.finalized)return;let r=Date.now()>=t.deadlineAt,i=r?"task_timeout":"timeout",n=r?"[\u9519\u8BEF] \u4EFB\u52A1\u5DF2\u8D85\u8FC7\u6267\u884C\u65F6\u9650\uFF0C\u5DF2\u8BF7\u6C42\u505C\u6B62":"[\u9519\u8BEF] mbh-chat \u672C\u8F6E\u957F\u65F6\u95F4\u65E0\u6D3B\u52A8\uFF0C\u5DF2\u8BF7\u6C42\u505C\u6B62";this.logger.error(r?"mbh-chat task timed out":"mbh-chat turn timed out",{dshSessionId:t.dshSessionId,requestId:t.context.requestId});try{await this.cancelExecution(t),t.finalized||this.finish(t,i,"failed",n)}catch(o){this.quarantineUnconfirmedExecution?.(t,"timeout_cancel_unconfirmed"),this.logger.error("mbh-chat timeout cancel failed",{dshSessionId:t.dshSessionId,error:te(o)}),t.finalized||this.finish(t,"timeout_cancel_unconfirmed","failed","[\u9519\u8BEF] mbh-chat \u672C\u8F6E\u957F\u65F6\u95F4\u65E0\u6D3B\u52A8\uFF0C\u4F46\u672A\u80FD\u786E\u8BA4\u505C\u6B62\uFF0C\u8BF7\u68C0\u67E5 Agent Host \u72B6\u6001")}}pauseForUserInput(t){t.finalized||(clearTimeout(t.timeout),t.timeout=setTimeout(()=>{this.onTurnTimeout(t)},Math.max(1,t.deadlineAt-Date.now())))}resumeAfterUserInput(t){this.armTurnTimeout(t)}async finishAfterCascade(t,r,i,n){if(!(t.finalized||this.terminatingRuns.has(t))){this.terminatingRuns.add(t),clearTimeout(t.timeout);try{await this.cancelExecution(t),this.finish(t,r,i,n)}catch(o){this.quarantineUnconfirmedExecution?.(t,`${r}_cancel_unconfirmed`),this.logger.error("mbh-chat terminal cascade cancellation failed",{dshSessionId:t.dshSessionId,requestId:t.context.requestId,error:te(o)}),this.finish(t,`${r}_cancel_unconfirmed`,"failed",n||"[\u9519\u8BEF] \u4EFB\u52A1\u5DF2\u7EC8\u6B62\uFF0C\u4F46\u672A\u80FD\u786E\u8BA4\u6A21\u578B\u3001\u5DE5\u5177\u4E0E\u5B50 Agent \u5747\u5DF2\u505C\u6B62")}}}trackRun(t){let r=this.runsBySession.get(t.dshSessionId);r||(r=new Set,this.runsBySession.set(t.dshSessionId,r)),r.add(t)}hasLiveRun(t){return this.liveRuns().some(r=>r.dshSessionId===t)}queuePendingTurn(t,r){let i=this.pendingTurns.get(t)??[];i.push(r),this.pendingTurns.set(t,i)}ownerForTurnStart(t,r){let i=this.turnOwners.get(t)?.get(r);if(i&&!i.finalized)return i;let n=this.liveRun(t);if(n&&n.turn===void 0)n.turn=r;else{let s=this.pendingTurns.get(t),a=s?.shift();s?.length===0&&this.pendingTurns.delete(t),a?.kind==="resume"?n=a.active.finalized?void 0:a.active:a?.kind==="cron"?n=Iy(this,t,a.event,!1):(!n||n.finalized)&&(n=void 0),n&&(n.turn=r)}if(!n)return;this.trackRun(n);let o=this.turnOwners.get(t);return o||(o=new Map,this.turnOwners.set(t,o)),o.set(r,n),this.activeBySession.set(t,n),n}turnOwner(t,r){return this.turnOwners.get(t)?.get(r)}releaseTurnOwner(t,r){this.turnOwners.get(t)?.delete(r)}armTurnTimeout(t){if(t.finalized)return;clearTimeout(t.timeout);let r=Math.max(1,Math.min(this.config.turnTimeoutMs,t.deadlineAt-Date.now()));t.timeout=setTimeout(()=>{this.onTurnTimeout(t)},r)}forgetRun(t,r,i){let n=this.runsBySession.get(r);n?.delete(t),n?.size===0&&this.runsBySession.delete(r);let o=this.pendingTurns.get(r);if(o){let a=o.filter(c=>c.kind!=="resume"||c.active!==t);a.length>0?this.pendingTurns.set(r,a):this.pendingTurns.delete(r)}let s=this.turnOwners.get(r);if(s){for(let[a,c]of s)c===t&&s.delete(a);s.size===0&&this.turnOwners.delete(r)}if(this.activeBySession.get(r)===t){if(i.keepReplacement){let a=n?[...n].find(c=>!c.finalized):void 0;a?this.activeBySession.set(r,a):this.activeBySession.delete(r);return}this.activeBySession.delete(r)}}};function hZ(e){let t=te(e).toLowerCase();return/(429|rate.?limit|too many requests|overload|busy)/.test(t)?"throttled":/(timeout|timed out|temporar|unavailable|econn|enet|eai_again|socket|network|fetch failed|connection|host.*ready)/.test(t)?"transient":"permanent"}function mZ(e,t,r){if(t==="permanent")return 0;let i=t==="throttled"?4:1;return Math.min(r.maxDelayMs,r.baseDelayMs*i*2**Math.max(0,e-1))}function gZ(e,t){if(!e.started)return;let r=Date.now(),i=Math.min(t.nextRetryAt??r,t.deadlineAt??Number.MAX_SAFE_INTEGER),n=Math.max(0,i-r),o=e.retryTimers.get(t.requestId);if(o&&clearTimeout(o),n>0){let s=setTimeout(()=>{e.retryTimers.delete(t.requestId),e.enqueueWaitingRequest(t)},n);s.unref(),e.retryTimers.set(t.requestId,s);return}e.enqueueWaitingRequest(t)}function yZ(e,t){e.queue.enqueue(t.context.businessKey,()=>e.executeWaitingRequest(t.requestId)).catch(r=>{e.logger.error("task queue orchestration failed",{requestId:t.requestId,error:te(r)})})}async function vZ(e,t){if(!e.started)return;let r=e.store.getWaitingRequest(t);if(!r)return;let i=Date.now();if(r.deadlineAt!==void 0&&r.deadlineAt<=i){e.turns.sendImmediateFinal(r.context,"task_timeout","failed","[\u9519\u8BEF] \u4EFB\u52A1\u5DF2\u8D85\u8FC7\u6267\u884C\u65F6\u9650");return}if(r.attemptCount>=e.config.task.maxAttempts){e.turns.sendImmediateFinal(r.context,"retry_exhausted","failed","[\u9519\u8BEF] \u4EFB\u52A1\u91CD\u8BD5\u6B21\u6570\u5DF2\u8017\u5C3D");return}let n=e.store.beginRequestAttempt(t);if(n!==void 0)try{await e.runPrompt(r.message,r.context,r.deadlineAt)}catch(o){if(!e.started)return;let s=e.store.getWaitingRequest(t);if(!s)return;let a=hZ(o),c=mZ(n,a,{baseDelayMs:e.config.task.retryBaseMs,maxDelayMs:e.config.task.retryMaxMs}),u=Date.now()+c;if(a!=="permanent"&&n<e.config.task.maxAttempts&&(s.deadlineAt===void 0||u<s.deadlineAt)&&e.store.scheduleRequestRetry(t,te(o),u)){e.logger.warn("scheduled task retry",{requestId:t,attempt:n,failureClass:a,delayMs:c}),e.scheduleWaitingRequest({...s,attemptCount:n,nextRetryAt:u});return}let f=a==="permanent"?"task_error":"retry_exhausted";e.logger.error("mbh-chat task failed after retry handling",{requestId:t,attempt:n,failureClass:a,error:te(o)}),e.turns.sendImmediateFinal(r.context,f,"failed",to(o))}}var $y=class{config;logger;store;dsh;dcg;requestApi;ossUpload;messageControl;skillManager;agentManager;inboundPrompt;intentFeedback;sessions;turns;bridgeStatus=new yh;cronSync;queue=new cy;activeBySession=new Map;corruptSessionRecoveries=new Map;pendingCronMessageIds=new Map;pendingUserQuestions=new Map;sessionsToCancelOnReconnect=new Set;stopRequestedSessions=new Set;handledCorruptSessions=new Set;invalidToolHistorySessions=new Set;cancelQuarantinedChain=Promise.resolve();quarantinedRetryTimer;retryTimers=new Map;startupRecovery=Promise.resolve();runAbort;started=!1;constructor(t){this.config=t,this.logger=new Zs(t.logLevel),this.store=new bh(t.stateDb,t.task.timeoutMs),this.dsh=new py(t.dsh.baseUrl,t.dsh.reconnectMinMs,t.dsh.reconnectMaxMs,this.logger),this.requestApi=new Bh(t.api,this.logger),this.skillManager=new ly(this.logger,{allowPrivateNetwork:t.media.allowPrivateNetwork}),this.agentManager=new gh(this.logger,{storageRoot:t.agent.storageRoot,allowPrivateNetwork:t.media.allowPrivateNetwork,resolveDownloadUrl:(r,i)=>this.requestApi.getOnlineAgents(r,i.botToken,i)}),this.dcg=new qh(t.account,this.store,this.logger,r=>this.handleInbound(r),r=>this.handleSkillEvent(r),r=>this.bridgeStatus.setDcgState(r),r=>this.handleInboundEvent(r)),this.ossUpload=KH(this.requestApi,this.logger),this.turns=new Ay({turnTimeoutMs:t.turnTimeoutMs,taskTimeoutMs:t.task.timeoutMs,botToken:t.account.botToken},this.store,()=>this.dcg,this.logger,this.activeBySession,this.pendingCronMessageIds,r=>this.cancelActiveExecution(r),r=>this.cronSync?.businessKeyForCronId(r),(r,i)=>this.quarantineUnconfirmedExecution(r.businessKey,r.dshSessionId,i)),this.inboundPrompt=new Ty(t,this.agentManager,this.skillManager,this.requestApi,()=>this.dcg,this.logger),this.intentFeedback=new Ey((r,i,n)=>{this.dcg.enqueue(r,i,n)}),this.sessions=new by(t,this.store,()=>this.dsh,this.logger,()=>this.cronSync,this.activeBySession,(r,i,n,o)=>this.turns.finish(r,i,n,o),r=>this.cancelActiveExecution(r),(r,i,n,o)=>this.quarantineUnconfirmedExecution(r,i,n,o)),this.messageControl=t.messageControl?new Lh(t.messageControl.socketPath,t.messageControl.token,(r,i)=>this.handleMbhchatMessage(r,i),()=>this.bridgeStatus.snapshot()):void 0}async start(){if(this.started)throw new Error("bridge already started");this.started=!0,this.runAbort=new AbortController,this.bridgeStatus.start(),await this.messageControl?.start();for(let s of this.store.listQuarantinedSessions())this.sessionsToCancelOnReconnect.add(s);let t=this.store.listWaitingRequests(),r=this.store.listActiveRequests(),i=[...new Set([...r,...t].map(s=>s.context.businessKey))];this.logger.info("mbh-chat bridge recovery state loaded",{activeCount:r.length,waitingCount:t.length,sessionKeys:i}),this.dsh.start({onRemoteEvent:s=>this.handleRemoteEvent(s),onSessionEvent:(s,a)=>this.handleSessionEvent(s,a),onAssistantChunk:(s,a)=>this.handleAssistantChunk(s,a),onConnection:async s=>{this.bridgeStatus.setDshConnected(s);try{await this.handleDshConnectionChange(s)}catch(a){this.logger.error("mbh-chat connection transition handling failed",{connected:s,error:te(a)})}}});let n=this.recoverActiveRequests(r,{waitForCancel:!1});this.startupRecovery=n,await this.dsh.whenConnected(this.connectionWaitSignal());let o=this.store.pruneDeliveredDeliveries(this.config.outboxRetentionMs===0?0:Date.now()-this.config.outboxRetentionMs,this.config.outboxMaxDelivered);this.config.outboxRetentionMs>0&&this.store.pruneManagementEvents(Date.now()-this.config.outboxRetentionMs),o>0&&this.logger.info("pruned delivered Outbox history",{count:o}),this.cronSync=new Mh({dshBaseUrl:this.config.dsh.baseUrl,store:this.store,dcg:this.dcg,logger:this.logger,followSession:s=>this.dsh.followSession(s),provisionSession:s=>this.provisionCronSession(s)}),this.dcg.start(),this.cronSync.start(),this.cronSync.bindAllKnownDshSessions().catch(s=>{this.logger.warn("failed to bind cron jobs to pre-existing mbh-chat sessions",{error:te(s)})});for(let s of t)s.context.requestId=s.requestId,this.scheduleWaitingRequest(s);t.length>0&&this.logger.warn("recovered waiting requests",{count:t.length});try{await n}finally{this.startupRecovery===n&&(this.startupRecovery=Promise.resolve())}this.logger.info("mbh-chat bridge started",{stateDb:this.config.stateDb})}async provisionCronSession(t){if(!t.sessionKey)return;let r=Fa(t.sessionKey);if(!r.sessionId)return;let i=this.store.getLatestContextForSessionId(r.sessionId),n=i??{accountId:this.config.account.accountId,requestId:`cron-provision:${t.id}`,businessKey:t.sessionKey,userId:Number(this.config.account.userId)||0,sessionId:r.sessionId,messageId:`cron:${t.id}`,domainId:this.config.account.domainId,appId:this.config.account.appId,agentId:r.agentId},o=await this.sessions.ensureSession(t.sessionKey,void 0,{...this.config.dsh.workspaceCwd?{workspaceDir:this.config.dsh.workspaceCwd}:{},agentPreset:this.config.dsh.agentPreset,managed:!1},n);return this.logger.info("restored cron DSH session for exact Web session",{cronId:t.id,sessionId:r.sessionId,dshSessionId:o,restoredFromWebSessionList:!!i}),o}async stop(){if(!this.started)return;this.started=!1;let t=[],r=async(n,o)=>{try{await o()}catch(s){t.push({step:n,error:s}),this.logger.warn("Bridge shutdown step failed",{step:n,error:te(s)})}};await r("cancel queued requests",()=>this.queue.cancelAllPending()),await r("clear retry timers",()=>{for(let n of this.retryTimers.values())clearTimeout(n);this.retryTimers.clear(),this.quarantinedRetryTimer&&clearTimeout(this.quarantinedRetryTimer),this.quarantinedRetryTimer=void 0}),await r("abort runtime waits",()=>this.runAbort?.abort(new Error("Bridge is stopping"))),await r("stop status tracker",()=>this.bridgeStatus.stop()),await r("release pending user questions",()=>this.pendingUserQuestions.clear()),await r("log bridge interruption state",()=>{let n=this.store.listActiveRequests(),o=this.store.listWaitingRequests();this.logger.info("mbh-chat bridge interruption state saved",{activeCount:n.length,waitingCount:o.length,sessionKeys:[...new Set([...n,...o].map(s=>s.context.businessKey))]})});let i=[];await r("collect active runs",()=>{i=[...new Set([...this.turns.liveRuns(),...[...this.corruptSessionRecoveries.values()].map(n=>n.active)])]}),await r("log persisted active chats",()=>{for(let n of this.store.listActiveRequests())this.logger.info("preserving active mbh-chat chat for Bridge restart",{sessionKey:n.context.businessKey,requestId:n.requestId,...n.dshSessionId?{dshSessionId:n.dshSessionId}:{}})}),await r("suspend active runs",()=>{for(let n of i)try{this.turns.suspend(n)}catch(o){t.push({step:`suspend active run ${n.dshSessionId}`,error:o}),this.logger.warn("Bridge shutdown step failed",{step:`suspend active run ${n.dshSessionId}`,error:te(o)})}this.corruptSessionRecoveries.clear()}),await r("stop cron synchronization",()=>this.cronSync?.stop()),await r("flush outbound queue",()=>this.dcg.flush()),await r("stop outbound socket",()=>this.dcg.stop()),await r("stop DSH connection",()=>this.dsh.stop()),await r("stop message control",()=>this.messageControl?.stop()),await r("finish quarantined cancellation queue",()=>this.cancelQuarantinedChain),await r("clear runtime state",()=>{this.pendingCronMessageIds.clear(),this.sessionsToCancelOnReconnect.clear(),this.stopRequestedSessions.clear(),this.handledCorruptSessions.clear(),this.invalidToolHistorySessions.clear()}),await r("close state store",()=>this.store.close()),this.runAbort=void 0,t.length>0?this.logger.error("mbh-chat bridge stopped with cleanup failures",{failures:t.map(({step:n,error:o})=>({step:n,error:te(o)}))}):this.logger.info("mbh-chat bridge stopped")}async recoverActiveRequests(t,r){let i=[],n=[];for(let o of t){if(!o.dshSessionId){this.store.markRequestTerminal(o.requestId,"failed","bridge_recovery_missing_session"),this.logger.warn("discarded mbh-chat recovery record without a DSH session",{requestId:o.requestId});continue}let s=kc({context:o.context,botToken:this.config.account.botToken,businessKey:o.context.businessKey,dshSessionId:o.dshSessionId,followup:!1,turnTimeoutMs:this.config.turnTimeoutMs,taskTimeoutMs:this.config.task.timeoutMs,...o.deadlineAt===void 0?{}:{deadlineAt:o.deadlineAt},onTimeout:c=>{this.turns.onTurnTimeout(c)}});this.activeBySession.set(o.dshSessionId,s);let a=this.store.listActiveSubagents(o.requestId);for(let c of a)s.pendingSubagents.add(c.childSessionId),s.subagentParents.set(c.childSessionId,c.parentSessionId);n.push({request:o,active:s,subagents:a})}await Promise.all(n.map(async({request:o,active:s,subagents:a})=>{let c=this.connectionWaitSignal();try{for(let u of a)await this.dsh.recoverSession(u.childSessionId,void 0,({matched:l,records:f})=>{if(l)for(let p of f)this.handleSessionEvent(u.childSessionId,p)},c);await this.dsh.recoverSession(o.dshSessionId,o.executionRpcId,({matched:u,records:l})=>{if(!u){this.store.markRequestTerminal(o.requestId,"failed","bridge_recovery_not_found"),this.turns.suspend(s),this.logger.warn("discarded stale mbh-chat recovery record without re-executing it",{requestId:o.requestId,dshSessionId:o.dshSessionId});return}for(let f of l)this.handleSessionEvent(o.dshSessionId,f);i.push(o.context.businessKey),this.logger.info("restored mbh-chat chat from its existing DSH execution",{sessionKey:o.context.businessKey,requestId:o.requestId,dshSessionId:o.dshSessionId,replayedEvents:l.length,stillRunning:!s.finalized})},c)}catch(u){if(!this.started||this.runAbort?.signal.aborted){this.turns.suspend(s),this.logger.info("preserved mbh-chat recovery because the Bridge is stopping",{sessionKey:o.context.businessKey,requestId:o.requestId,dshSessionId:o.dshSessionId});return}for(let l of a)this.unfollowSession(l.childSessionId);this.unfollowSession(o.dshSessionId),c.aborted&&this.quarantineUnconfirmedExecution(o.context.businessKey,o.dshSessionId,"bridge_recovery_timeout"),this.store.markRequestTerminal(o.requestId,"failed","bridge_recovery_unavailable"),this.turns.suspend(s),this.logger.warn("discarded unavailable mbh-chat recovery record without re-executing it",{requestId:o.requestId,dshSessionId:o.dshSessionId,error:te(u)})}})),t.length>0&&this.logger.info("finished restoring persisted mbh-chat chats",{count:i.length,sessionKeys:i})}async handleDshConnectionChange(t){if(!this.started)return;let r=this.turns.liveRuns(),i=[...new Set(r.map(n=>n.businessKey))];if(!t){this.sessions.clearHostDefaultProvider(),this.logger.warn("DSH event stream disconnected; retaining active executions for follow recovery",{count:r.length,sessionKeys:i});return}this.logger.info("DSH event stream reconnected; resuming saved sessions",{count:r.length,sessionKeys:i}),this.cancelQuarantinedSessions().catch(n=>{this.logger.warn("could not cancel mbh-chat session left behind by stream loss",{error:te(n)})})}cancelQuarantinedSessions(){let t=this.cancelQuarantinedChain.then(()=>this.runCancelQuarantinedSessions());return this.cancelQuarantinedChain=t.then(()=>{},()=>{}),t}async runCancelQuarantinedSessions(){for(let t of[...this.sessionsToCancelOnReconnect])try{let r=await this.cancelExecutionTree(t);if(this.sessionsToCancelOnReconnect.delete(t),r==="absent"){this.store.removeQuarantinedSession(t),this.logger.info("dropped quarantined mbh-chat session that is no longer attached",{dshSessionId:t});continue}let i=this.store.resolveQuarantinedSession(t);this.logger.info("cancelled quarantined mbh-chat session",{dshSessionId:t,resolution:i})}catch(r){this.logger.warn("could not cancel mbh-chat session left behind by stream loss",{dshSessionId:t,error:te(r)})}this.sessionsToCancelOnReconnect.size>0&&this.scheduleQuarantinedCancellationRetry()}quarantineUnconfirmedExecution(t,r,i,n=!0){this.sessionsToCancelOnReconnect.add(r);try{this.store.quarantineSession(t,r,i,n)}catch(o){this.logger.error("could not persist quarantined mbh-chat session",{businessKey:t,dshSessionId:r,reason:i,error:te(o)})}this.scheduleQuarantinedCancellationRetry()}scheduleQuarantinedCancellationRetry(){if(!this.started||this.quarantinedRetryTimer||this.sessionsToCancelOnReconnect.size===0)return;let t=Math.max(1e3,this.config.task.retryMaxMs);this.quarantinedRetryTimer=setTimeout(()=>{this.quarantinedRetryTimer=void 0,this.cancelQuarantinedSessions().catch(r=>{this.logger.warn("background quarantined-session cancellation failed",{error:te(r)}),this.scheduleQuarantinedCancellationRetry()})},t),this.quarantinedRetryTimer.unref()}async handleInbound(t){let r=Qn(this.config.account.accountId,t.content.message_id.trim()),i=vh(t,this.config.account.accountId,r,this.config.account),n=this.store.claimInbound(t,i);if(n.kind==="duplicate"){this.logger.info("duplicate inbound suppressed",{messageId:t.content.message_id,requestId:n.requestId,status:n.status}),this.dcg.flush().catch(c=>{this.logger.error("duplicate-triggered Outbox flush failed",{error:te(c)})});return}if(n.kind==="conflict"){this.logger.error("inbound idempotency conflict",{messageId:t.content.message_id,requestId:n.requestId});return}i.requestId=n.requestId;let o=t.content.text.trim(),s=Ei(t.content).map(c=>c.name);if(this.logger.info("accepted inbound chat",{messageId:t.content.message_id,sessionId:i.sessionId,businessKey:i.businessKey,text:o,...s.length>0?{files:s}:{}}),this.cronSync?.notifySessionAvailable(),o==="/stop"){await this.handleStop(i);return}this.intentFeedback.messageReceived(i,t.content.text),this.prewarmMappedSession(i.businessKey);let a=this.store.getWaitingRequest(i.requestId);if(!a)throw new Error(`claimed task ${i.requestId} is not in waiting state`);this.scheduleWaitingRequest({...a,message:t,context:i})}prewarmMappedSession(t){let r=this.store.getSession(t);r&&this.dsh.followSession(r).catch(i=>{this.logger.warn("mbh-chat session follow prewarm failed",{businessKey:t,dshSessionId:r,error:te(i)})})}scheduleWaitingRequest(t){gZ(this,t)}enqueueWaitingRequest(t){yZ(this,t)}async executeWaitingRequest(t){await this.startupRecovery,this.started&&await vZ(this,t)}async handleSkillEvent(t){await this.claimManagementEvent(t.content)&&await BV(this,t)}async handleInboundEvent(t){(t.eventType==="agent"||t.eventType==="cron")&&!await this.claimManagementEvent(t.content)||await WV(this,t)}async claimManagementEvent(t){let r=typeof t.websocket_trace_id=="string"?t.websocket_trace_id.trim():"";if(!r)return!0;try{let i=this.store.claimManagementEvent(r,t);return i==="claimed"?!0:i==="duplicate"?(this.logger.info("duplicate management event suppressed",{traceId:r}),this.dcg.flush().catch(n=>{this.logger.warn("duplicate management event Outbox flush failed",{error:te(n)})}),!1):(await this.dcg.sendEvent({...t,status:"fail",error:"management event idempotency conflict"}),this.logger.error("management event idempotency conflict",{traceId:r}),!1)}catch(i){return await this.dcg.sendEvent({...t,status:"fail",error:te(i)}),this.logger.error("management event could not be claimed",{traceId:r,error:te(i)}),!1}}async handleStop(t){this.queue.cancelPending(t.businessKey);let r=this.store.listWaitingRequestsForBusinessKey(t.businessKey,t.requestId);for(let o of r){let s=this.retryTimers.get(o.requestId);s&&clearTimeout(s),this.retryTimers.delete(o.requestId),this.turns.sendImmediateFinal(o.context,"stop","cancelled","")}r.length>0&&this.logger.info("cancelled waiting mbh-chat tasks",{businessKey:t.businessKey,count:r.length});let i=this.store.getSession(t.businessKey);if(!i){this.completeStopControl(t,"cancelled","stop");return}this.cancelPendingUserQuestions(i);let n=this.turns.liveRun(i);this.stopRequestedSessions.add(i);try{n?await this.cancelActiveExecution(n):await this.cancelExecutionTree(i),n&&!n.finalized&&this.turns.finish(n,"stop","cancelled",""),this.store.markPostStopContextBoundary(t.businessKey),this.completeStopControl(t,"cancelled","stop"),this.logger.info("cancelled active mbh-chat turn",{dshSessionId:i,businessKey:t.businessKey})}catch(o){this.stopRequestedSessions.delete(i),this.quarantineUnconfirmedExecution(t.businessKey,i,"stop_cancel_unconfirmed"),this.logger.warn("mbh-chat cancel failed",{dshSessionId:i,error:te(o)}),n&&!n.finalized&&this.turns.finish(n,"stop_cancel_unconfirmed","failed","[\u9519\u8BEF] \u672A\u80FD\u786E\u8BA4\u6A21\u578B\u3001\u5DE5\u5177\u4E0E\u5B50 Agent \u5747\u5DF2\u505C\u6B62"),this.completeStopControl(t,"failed","stop_cancel_unconfirmed")}}completeStopControl(t,r,i){this.store.markRequestTerminal(t.requestId,r,i)}cancelPendingUserQuestions(t){EV(this,t)}async cancelActiveExecution(t){t.submissionAbort?.abort(new Error("mbh-chat execution was cancelled")),await this.cancelExecutionTree(t.dshSessionId,t.context.requestId,t.subagentParents)}async cancelExecutionTree(t,r,i){return dV(this,t,r,i)}async runPrompt(t,r,i){await QV(this,t,r,i)}connectionWaitSignal(){let t=this.runAbort?.signal,r=AbortSignal.timeout(this.config.supervisor.startTimeoutMs);return t?AbortSignal.any([t,r]):r}handleMbhchatMessage(t,r){return GV({request:t,signal:r,config:this.config,activeBySession:this.activeBySession,ossUpload:this.ossUpload,dcg:this.dcg,logger:this.logger})}prepareSelectedSkill(t){return this.inboundPrompt.prepareSelectedSkill(t)}promptContent(t,r,i,n,o,s){return this.inboundPrompt.promptContent(t,r,i,n,o,s)}ensureSession(t,r,i,n){return this.sessions.ensureSession(t,r,i,n)}async handleRemoteEvent(t){await IV(this,t)}handleSessionEvent(t,r){if(bV(r)&&!this.invalidToolHistorySessions.has(t)&&(this.invalidToolHistorySessions.add(t),this.logger.warn("detected mbh-chat session with invalid tool identity",{dshSessionId:t,eventType:r.type})),r.type!=="turn/end"){this.turns.handleSessionEvent(t,r);return}let i=vV(r);if(i&&sf(i)){this.invalidToolHistorySessions.delete(t),DI(this,t,i);return}let n=this.invalidToolHistorySessions.delete(t);this.stopRequestedSessions.delete(t),this.turns.handleSessionEvent(t,r),n&&(this.store.removeSessionByDshId(t),this.unfollowSession(t),this.logger.warn("discarded mbh-chat session with invalid tool identity after turn end",{dshSessionId:t}))}handleAssistantChunk(t,r){this.turns.handleAssistantChunk(t,r)}onTurnTimeout(t){return this.turns.onTurnTimeout(t)}unfollowSession(t){this.dsh.unfollowSession?.(t)}};async function w_e(){let e=s$(),t=a$(`${e.stateDb}.lock`),r=new $y(e),i=!1,n=async o=>{if(!i){i=!0,console.log(`${new Date().toISOString()} INFO received ${o}, stopping bridge`);try{await r.stop()}finally{t.release()}}};process.once("SIGINT",()=>{n("SIGINT")}),process.once("SIGTERM",()=>{n("SIGTERM")});try{await r.start()}catch(o){try{await r.stop()}finally{t.release()}throw o}}w_e().catch(e=>{console.error(`${new Date().toISOString()} ERROR bridge startup failed: ${te(e)}`),process.exitCode=1});
|
|
635
|
+
`)}async function QV(e,t,r,i){if(!e.started)return;let n=FV(t.content);n?.source==="intent"&&e.intentFeedback.matched(r,"\u4E13\u5BB6",n.value.name);let s=(n&&!Ia(n.value.agentCode,n.value.cloneCode)?!await e.agentManager.hasWorkspace(n.value.cloneCode):!1)?e.intentFeedback.beginInstall(r,"\u4E13\u5BB6",n?.value.name??"\u4E13\u5BB6"):void 0,a=await e.inboundPrompt.prepareAgentRoute(t);s&&e.intentFeedback.finishInstall(r,s,!("error"in a));let c=0;if("error"in a){if(!n){e.turns.sendImmediateFinal(r,"agent_not_installed","failed",a.error);return}e.dcg.enqueue(r,{response:`${n.value.name}\u5B89\u88C5\u5931\u8D25\uFF0C\u7531\u4E66\u7075\u58A8\u5B9D\u4E3A\u60A8\u89E3\u7B54\u3002`,state:"chunk",chunk_idx:c++,message_tags:{source:"agent_install_failed"},is_finish:-1},"agent:install-failed"),a={...e.config.dsh.workspaceCwd?{workspaceDir:e.config.dsh.workspaceCwd}:{},agentPreset:e.config.dsh.agentPreset,managed:!1}}let u=zV(t.content);u?.source==="intent"&&e.intentFeedback.matched(r,"\u6280\u80FD",u.value.name);let f=(u?!e.skillManager.exists(u.value.code):!1)?e.intentFeedback.beginInstall(r,"\u6280\u80FD",u?.value.name??"\u6280\u80FD"):void 0,p=await e.inboundPrompt.prepareSelectedSkill(t);f&&e.intentFeedback.finishInstall(r,f,!p.error);let d=p.error;d&&e.dcg.enqueue(r,{response:d,state:"chunk",chunk_idx:c++,message_tags:{source:"skill_install_failed"},is_finish:-1},"skill:install-failed"),e.intentFeedback.knowledgeSearch(r,ky(t.content));let h=a.managed&&a.workspaceDir?KV(e.config.dsh.outputRoot,a.workspaceDir):e.config.dsh.outputRoot,m=await XV(h,r.businessKey),_=await e.inboundPrompt.promptContent(t,r.requestId,p.promptPrefix,a.workspaceDir?Gbe.join(a.workspaceDir,"inbound"):e.config.media.storageRoot,JV(m),e.store.hasPostStopContextBoundary(r.businessKey));if(_.length===0){e.turns.sendImmediateFinal(r,"not_text","succeeded","\u4F60\u9700\u8981\u6211\u5E2E\u4F60\u505A\u4EC0\u4E48\u5462\uFF1F");return}if(await e.dsh.whenConnected(e.connectionWaitSignal()),!e.started)return;if(i!==void 0&&i<=Date.now())throw new Error("task preparation timed out");let k=await e.sessions.ensureSession(r.businessKey,t.content.model,a,r);if(e.stopRequestedSessions.delete(k),!e.started)return;let S=YV();if(!e.store.markRequestRunning(r.requestId,k,S)){e.logger.warn("mbh-chat request was no longer waiting before execution",{requestId:r.requestId});return}let v=kc({context:r,botToken:t.content.bot_token?.trim()||e.config.account.botToken,businessKey:r.businessKey,dshSessionId:k,chunkIndex:c,skillNames:tV(t.content),followup:!1,turnTimeoutMs:e.config.turnTimeoutMs,taskTimeoutMs:e.config.task.timeoutMs,...i===void 0?{}:{deadlineAt:i},onTimeout:U=>{e.turns.onTurnTimeout(U)}});e.activeBySession.set(k,v);let g=new AbortController;v.submissionAbort=g;let y=_,T=0,R=!1,I=new Set,b=()=>{if(S=YV(),!e.store.updateRequestExecutionRpc(r.requestId,S))throw new Error("could not persist the DSH prompt identity before submission")},O=async U=>{let Z=await e.dsh.api.sessions.prompt({requestId:S,sessionId:U,mode:"queue",content:y,clientTimeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},g.signal);return!Z.result.ok&&Z.result.error.code==="attachment-error"&&y.some(J=>J.type==="image")&&(e.logger.warn("mbh-chat rejected inline image input; retrying with readable local attachment paths",{requestId:r.requestId,reason:Z.result.error.message}),y=y.filter(J=>J.type==="text"),b(),Z=await e.dsh.api.sessions.prompt({requestId:S,sessionId:U,mode:"queue",content:y,clientTimeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},g.signal)),Z},A=async(U,Z)=>{if(Wr(U),!g.signal.aborted&&!e.stopRequestedSessions.has(Z))return!0;e.logger.info("mbh-chat prompt was accepted after its run was interrupted; cancelling again",{requestId:r.requestId,dshSessionId:Z});try{await e.cancelActiveExecution(v)}catch(J){e.logger.warn("could not reconfirm cancellation after a late prompt acceptance",{requestId:r.requestId,dshSessionId:Z,error:te(J)})}return!1},P=U=>{I.delete(U),e.corruptSessionRecoveries.get(U)?.active===v&&e.corruptSessionRecoveries.delete(U)},D=async(U,Z)=>{e.cancelPendingUserQuestions(U),e.turns.detachForSessionRetry(v,U),e.store.removeSession(r.businessKey);let J=await e.sessions.ensureSession(r.businessKey,t.content.model,a,r);if(!e.started||v.finalized){e.store.removeSession(r.businessKey),P(U);return}if(v.deadlineAt<=Date.now())throw new Error("task timed out while recovering the session");return k=J,e.store.updateRequestExecutionSession(r.requestId,J),b(),P(U),e.turns.attachAfterSessionRetry(v,J),V(J),e.logger.info("recreated mbh-chat session and resubmitting the current request",{requestId:r.requestId,oldDshSessionId:U,dshSessionId:J,reason:Z}),J},V=U=>{I.add(U),e.corruptSessionRecoveries.set(U,{active:v,recover:Z=>{v.finalized||R||v.dshSessionId!==U||(R=!0,$(U,Z))}})};async function $(U,Z){try{if(T+=1,T>1)throw new Error("session history recovery was already attempted");let J=await D(U,Z);if(!J||!await A(await O(J),J))return}catch(J){e.logger.error("could not recover corrupt mbh-chat session",{requestId:r.requestId,dshSessionId:U,error:te(J)}),v.finalized||e.turns.finish(v,"session_recovery_failed","failed","[\u9519\u8BEF] \u4F1A\u8BDD\u81EA\u52A8\u6062\u590D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{R=!1}}try{V(k);try{let U=k,Z=await O(k);if(!Z.result.ok&&_I(Z.result.error.code)){let J=await D(k,Z.result.error.code);if(!J)return;U=J,Z=await O(J)}if(!await A(Z,U))return}catch(U){if(g.signal.aborted){e.logger.info("mbh-chat prompt submission interrupted",{requestId:r.requestId,dshSessionId:k}),await v.completion;return}e.logger.error("mbh-chat prompt submission failed",{requestId:r.requestId,dshSessionId:k,error:te(U)}),e.turns.finish(v,"error","failed",to(U))}await v.completion}finally{for(let U of I)P(U)}}var Kbe="\uFEFF",Xbe="cron_running";function Iy(e,t,r,i=!0){let n=e.store.getBusinessKeyByDshSessionId(t);if(!n&&vy(r)){let h=yy(r,"cron_id");h&&(n=e.resolveCronBusinessKey?.(h))}if(!n){e.logger.warn("unsolicited mbh-chat session event has no mapped mbh-chat session",{dshSessionId:t,type:r.type});return}let o=e.store.getLatestContextForBusinessKey(n);if(!o){e.logger.warn("unsolicited mbh-chat session event has no prior outbound context",{dshSessionId:t,businessKey:n});return}let s=yy(r,"cron_id"),a=s?e.pendingCronMessageIds.get(s):void 0;s&&a&&e.pendingCronMessageIds.delete(s);let c=fV(a),u={...o,messageId:c.notification,requestId:Qn(o.accountId,c.notification)},l={...o,messageId:c.chat,requestId:Qn(o.accountId,c.chat)},f=he(r.data),p=kc({context:l,botToken:e.config.botToken,businessKey:n,dshSessionId:t,...typeof f?.turn=="number"?{turn:f.turn}:{},followup:!0,turnTimeoutMs:e.config.turnTimeoutMs,taskTimeoutMs:e.config.taskTimeoutMs,onTimeout:h=>{e.onTurnTimeout(h)}});e.trackRun(p),i&&e.activeBySession.set(t,p);let d=yy(r,"name")??"\u5B9A\u65F6\u4EFB\u52A1";try{e.dcg.enqueue(l,{response:Kbe,state:"chunk",message_tags:{source:Xbe,uid:l.messageId},is_finish:0},"cron:loading")}catch(h){e.logger.warn("could not persist cron loading message",{cronId:s,requestId:l.requestId,error:te(h)})}return e.dcg.enqueueEvent(u,{event_type:"notify",operation_type:"cron",title:d,message_id:u.messageId,desc:""}),e.logger.info("started mbh-chat followup run for unsolicited mbh-chat turn",{dshSessionId:t,requestId:l.requestId,sessionId:l.sessionId,type:r.type}),p}var Jbe=/(?:\r?\n+|[。!?!?;;]+[”’"'))】》」』]*\s*)/gu,Ybe=/(?:[,,、::]|\s+)/gu;function eZ(e,t){let r=[];t.lastIndex=0;for(let i=t.exec(e);i;i=t.exec(e))r.push(i.index+i[0].length);return r}function Qbe(e,t){let r=Math.min(t,e.length);if(r>0&&r<e.length){let i=e.charCodeAt(r-1),n=e.charCodeAt(r);i>=55296&&i<=56319&&n>=56320&&n<=57343&&(r-=1)}return r}function qI(e,t){if(!e)return 0;let r=eZ(e,Jbe),i=r.filter(s=>s>=t.minChars);if(e.length<=t.maxChars)return t.keepLastComplete&&i.length>=2?i[i.length-2]??0:!t.keepLastComplete&&i.length>=1?i[i.length-1]??0:0;let n=r.filter(s=>s<=t.maxChars).at(-1);if(n&&n>=Math.floor(t.maxChars/3))return n;let o=eZ(e.slice(0,t.maxChars),Ybe).filter(s=>s>=Math.floor(t.maxChars/2)).at(-1);return o||Qbe(e,t.maxChars)}function Nn(e,t){return e.followup?{...t,state:"chunk",is_finish:t.thought_chain?t.is_finish??1:0,message_tags:{source:"cron_running",uid:e.context.messageId}}:t}var e_e=24,t_e=512,r_e=32,jI=118,nZ=135,n_e=4,tZ=["\u6B63\u5728\u63D0\u70BC\u5173\u952E\u4FE1\u606F","\u6B63\u5728\u786E\u8BA4\u5904\u7406\u7ED3\u679C","\u5173\u952E\u5185\u5BB9\u6574\u7406\u8FDB\u884C\u4E2D","\u6B63\u5728\u6C47\u805A\u6838\u5FC3\u4FE1\u606F","\u6B63\u5728\u5F52\u7EB3\u5173\u952E\u4FE1\u606F","\u6B63\u5728\u590D\u67E5\u5904\u7406\u7ED3\u679C","\u6838\u5FC3\u4FE1\u606F\u68B3\u7406\u4E2D","\u6B63\u5728\u68C0\u67E5\u6574\u7406\u7ED3\u679C","\u6B63\u5728\u9A8C\u8BC1\u5904\u7406\u7ED3\u679C","\u5173\u952E\u4FE1\u606F\u786E\u8BA4\u4E2D"],rZ=/(?:\r?\n+|(?:[。!?!?;;]|…{1,2})[”’"'))】》」』]*\s*)/gu,i_e=/^I'll.+?\bskill\b.*\.$/u,o_e=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,s_e=[/^\s*(?:i(?:'ll| will| am going to| need to)|let me)\s+(?:(?:first|now)\s+)?(?:(?:start|begin)(?:ning)?\s+by\s+)?(?:read(?:ing)?|load(?:ing)?|review(?:ing)?|inspect(?:ing)?|check(?:ing)?|open(?:ing)?|analy[sz](?:e|ing)|examin(?:e|ing)|process(?:ing)?|look(?:ing)?\s+(?:at|through)|use|call(?:ing)?)\b/iu,/^\s*first,?\s+i(?:'ll| will| am going to)\s+(?:read|load|review|inspect|check|open|analy[sz]e|examine|process|use|call)\b/iu,/^\s*to begin(?: with)?,?\s+i(?:'ll| will)\s+(?:read|load|review|inspect|check|open|analy[sz]e|examine|process|use|call)\b/iu],a_e=[{pattern:/[^.!?\r\n]*\bI['’]m\s+preparing\b[^.!?\r\n]*\bscript\b[^.!?\r\n]*[.!?]?/giu,replacement:"\u6211\u6B63\u51C6\u5907\u4F7F\u7528\u6280\u80FD\u6267\u884C\u811A\u672C\uFF0C\u4F20\u9012\u6587\u4EF6\u8DEF\u5F84\u548C\u4E3B\u9898\u53C2\u6570\u3002"},{pattern:/[^.!?\r\n]*\bcheck\b[^.!?\r\n]*\bskill\b[^.!?\r\n]*\bverify\b[^.!?\r\n]*[.!?]?/giu,replacement:"\u6211\u9700\u8981\u68C0\u67E5\u6280\u80FD\u76EE\u5F55\u7ED3\u6784\uFF0C\u5E76\u9A8C\u8BC1\u662F\u5426\u53EF\u7528\u3002"}],c_e=/(?:\.mobook(?:-harness)?|\.openclaw|channels\.[\w-]+|opts\.params|getOpenclaw|run_workflow|--user(?:_id)?|\[REDACTED\])/iu,u_e="\u6B63\u5728\u6838\u5BF9\u672C\u5730\u914D\u7F6E\u4E0E\u4EFB\u52A1\u53C2\u6570";function l_e(e){let t=a_e.reduce((o,{pattern:s,replacement:a})=>o.replace(s,a),e),i=Oc(t).trim();return c_e.test(i)?u_e:!i||o_e.test(i)?t:(i.match(/[A-Za-z]+(?:'[A-Za-z]+)?/gu)?.length??0)>=4&&s_e.some(o=>o.test(i))?"":t}function f_e(e,t){return Oc(e.replace(i_e,"\u6B63\u5728\u8BFB\u53D6\u6280\u80FD\u76F8\u5173\u6587\u4EF6"),t)}function Ac(e,t,r){e.finalized||!r||(e.pendingText+=r,d_e(e,t))}function Oy(e,t){if(!e.pendingText||e.finalized){e.pendingText="";return}let r=e.pendingText;e.pendingText="",iZ(e,t,r)}function d_e(e,t){for(;!e.finalized;){if(!e.pendingText)return;let r=qI(e.pendingText,{minChars:e_e,maxChars:t_e});if(r===0)return;iZ(e,t,e.pendingText.slice(0,r)),e.pendingText=e.pendingText.slice(r)}}function iZ(e,t,r){if(!r)return;let i=f_e(r,e.botToken);if(e.followup){e.cronText+=i;return}let n=e.chunkIndex++;t.enqueue(e.context,{response:i,state:"chunk",chunk_idx:n},`chunk:${n}`)}function Cy(e,t,r,i,n){if(!(e.finalized||!r)&&(e.reasoningMessageKey&&e.reasoningMessageKey!==i&&ps(e,t,"complete"),e.reasoningMessageKey||(e.reasoningMessageKey=i,e.reasoningSort=n,e.reasoningVisibleChars=0,e.reasoningLimitReached=!1),!e.reasoningLimitReached))for(e.pendingReasoning+=r;!e.finalized;){if(!e.pendingReasoning)return;let o=nZ-e.reasoningVisibleChars;if(e.pendingReasoning.length>o){h_e(e,t,o);return}let s=qI(e.pendingReasoning,{minChars:r_e,maxChars:jI,keepLastComplete:!0});if(s===0)return;let a=e.pendingReasoning.slice(0,s);e.pendingReasoning=e.pendingReasoning.slice(s),e.reasoningVisibleChars+=a.length,lf(e,t,a,!1,"start_stream")}}function ps(e,t,r){e.reasoningMessageKey&&(p_e(e,t,!0,r),e.reasoningMessageKey=void 0,e.reasoningSort=void 0,e.reasoningStarted=!1)}function p_e(e,t,r,i){let n=e.pendingReasoning;if(e.pendingReasoning="",e.finalized||!n&&(!r||!e.reasoningStarted))return;let o=nZ-e.reasoningVisibleChars;if(!e.reasoningLimitReached&&n.length>o){let s=n.slice(0,oZ(n,Math.min(o,jI)));e.reasoningVisibleChars+=s.length,e.reasoningLimitReached=!0,lf(e,t,`${s}${sZ(e)}`,r,i);return}if(e.reasoningLimitReached){lf(e,t,"",r,i);return}e.reasoningVisibleChars+=n.length,lf(e,t,n,r,i)}function oZ(e,t){if(t<=0)return 0;let r=e.slice(0,t);rZ.lastIndex=0;let i=rZ.exec(r);return i?i.index+i[0].length:0}function h_e(e,t,r){let i=oZ(e.pendingReasoning,Math.min(r,jI)),n=e.pendingReasoning.slice(0,i);e.pendingReasoning="",e.reasoningVisibleChars+=n.length,e.reasoningLimitReached=!0,lf(e,t,`${n}${sZ(e)}`,!1,"start_stream")}function sZ(e){return e.reasoningTruncationCount+=1,e.reasoningTruncationCount%n_e!==0?"":tZ[Math.floor(Math.random()*tZ.length)]}function lf(e,t,r,i,n){let o=l_e(r);if(!o&&(!i||!e.reasoningStarted))return;o&&(e.reasoningStarted=!0);let s=e.reasoningLineIndex++,a=e.reasoningMessageKey??`reasoning:${e.turn??0}:0`,c=(e.reasoningSort??Date.now()/1e3)+s/1e9;t.enqueue(e.context,Nn(e,NV({context:e.context,content:o,sort:c,finished:i,status:n,messageKey:a,botToken:e.botToken})),`thought:${s}`)}function MI(e,t,r){for(let[i,n]of e.toolCalls){if(n.settled)continue;n.settled=!0;let o=r==="cancelled";t.enqueue(e.context,Nn(e,Hr({context:e.context,title:fu(n.name),name:Vs[n.name]?.name||"\u5DE5\u5177\u6267\u884C",toolCallId:i,content:o?"\u5DE5\u5177\u6267\u884C\u5DF2\u4E2D\u65AD":"\u5DE5\u5177\u6267\u884C\u672A\u8FD4\u56DE\u7ED3\u679C",sort:n.sort,finished:!0,status:o?"cancel":"fail",isError:!0,botToken:e.botToken})),`tool:${i}:result`)}}function aZ(e){e.pendingText="",e.stepText.clear(),e.assistantStreamIndexes?.clear(),e.pendingReasoning="",e.stepReasoning.clear(),e.reasoningMessageKey=void 0,e.reasoningSort=void 0,e.reasoningStarted=!1,e.reasoningVisibleChars=0,e.reasoningLimitReached=!1,e.reasoningTruncationCount=0,e.turnStartedAt=void 0,e.timeTakenMs=void 0,e.toolCalls.clear(),delete e.turn}function LI(e,t){for(let r of e)if(!r.finalized&&r.pendingSubagents.has(t))return r}function cZ(e,t,r,i){let n=gy(i);if(n)return e.find(o=>o.dshSessionId===r&&o.pendingSubagents.has(n))??t??LI(e,r)}function uZ(e,t,r,i,n,o){if(o(e),gy(t)){zI(e,t,r,i,n,o);return}t.type==="tool/result"&&FI(e,t.data.message.content,r,i,n,o)}function FI(e,t,r,i,n,o){let s=gV(t);s&&(e.settledSubagents.delete(s)||(e.pendingSubagents.add(s),e.subagentParents.set(s,r),e.followup||(i.trackSubagent(e.context.requestId,r,s),i.markRequestToolWaiting(e.context.requestId)),lZ(e,n,s,Date.now()/1e3),o(e)))}function zI(e,t,r,i,n,o){let s=gy(t);if(!s)return;e.pendingSubagents.delete(s)||(e.settledSubagents.add(s),lZ(e,n,s,fs(t))),e.subagentParents.delete(s);let a=he(he(t.data)?.source),c=typeof a?.summary=="string"?a.summary.trim():"completed",u=c.toLowerCase(),l=/(aborted|cancelled|canceled|interrupted)/.test(u)?"cancel":/(failed|failure|error)/.test(u)?"fail":"complete";e.followup||(i.trackSubagent(e.context.requestId,r,s),i.settleSubagent(s,l==="complete"?"completed":l==="cancel"?"cancelled":"failed")),n.enqueue(e.context,Nn(e,Hr({context:e.context,title:"subagent",name:"\u5B50 Agent",toolCallId:s,content:`\u5B50 Agent \u5DF2\u7ED3\u675F\uFF1A${c}`,sort:fs(t),finished:!0,status:l,isError:l==="fail",botToken:e.botToken})),`subagent:${s}:result`),BI(e,i),o(e)}function lZ(e,t,r,i){t.enqueue(e.context,Nn(e,Hr({context:e.context,title:"subagent",name:"\u5B50 Agent",toolCallId:r,content:"\u5B50 Agent \u5DF2\u542F\u52A8",sort:i,finished:!1,status:"start_stream",isError:!1,botToken:e.botToken})),`subagent:${r}:start`)}function UI(e,t,r,i){let n=i==="cancelled";for(let o of e.pendingSubagents)e.followup||t.settleSubagent(o,n?"cancelled":"failed"),r.enqueue(e.context,Nn(e,Hr({context:e.context,title:"subagent",name:"\u5B50 Agent",toolCallId:o,content:n?"\u5B50 Agent \u6267\u884C\u5DF2\u4E2D\u65AD":"\u5B50 Agent \u672A\u8FD4\u56DE\u5B8C\u6574\u7ED3\u679C",sort:Date.now()/1e3,finished:!0,status:n?"cancel":"fail",isError:!0,botToken:e.botToken})),`subagent:${o}:result`);e.pendingSubagents.clear(),e.subagentParents.clear(),e.settledSubagents.clear()}function BI(e,t){e.followup||e.pendingSubagents.size>0||[...e.toolCalls.values()].some(r=>!r.settled)||t.markRequestRunningAfterTool(e.context.requestId)}var m_e=new Set(["read","read_image","glob","grep","skill"]),fZ=/(?:^|[\s;&|()<>"'`])(?:[^\s;&|()<>"'`]*[\\/])?cat(?:\.exe)?(?=$|[\s;&|()<>"'`])/iu;function g_e(e,t){if(e!=="bash"&&e!=="pwsh")return!1;try{let r=he(JSON.parse(t)),i=typeof r?.command=="string"?r.command:t;return fZ.test(i)}catch{return fZ.test(t)}}function y_e(e,t,r){if(t!=="skill")return r;try{let i=he(JSON.parse(r));if(!i)return r;let n=[i.code,i.skill_code,i.skillCode,i.name].find(s=>typeof s=="string"&&s.trim().length>0);if(!n)return r;let o=n.trim();return JSON.stringify({description:e.skillNames?.get(o)??o})}catch{return r}}function dZ(e,t,r){if(r.type==="user/message"){if(vy(r)){let c=e.hasLiveRun(t),u=Iy(e,t,r,!c);c&&u&&e.queuePendingTurn(t,{kind:"resume",active:u});return}let a=cZ(e.liveRuns(),e.liveRun(t),t,r);a&&(zI(a,r,t,e.store,e.dcg,c=>e.armTurnTimeout(c)),a.dshSessionId===t&&e.queuePendingTurn(t,{kind:"resume",active:a}));return}let i=LI(e.liveRuns(),t);if(i){uZ(i,r,t,e.store,e.dcg,a=>e.armTurnTimeout(a));return}let n=he(r.data),o=typeof n?.turn=="number"?n.turn:void 0,s=o===void 0?e.liveRun(t):e.turnOwner(t,o);if(r.type==="turn/start"){if(o===void 0||(s=e.ownerForTurnStart(t,o),!s))return;s.turnStartedAt=r.time,s.timeTakenMs=void 0,e.armTurnTimeout(s);return}if(s??=e.liveRun(t),!!s&&!(o!==void 0&&s.turn!==void 0&&o!==s.turn)){if(e.armTurnTimeout(s),r.type==="assistant/message"){v_e(s,r,e.dcg);return}if(r.type==="tool/call"){b_e(s,r,e.store,e.dcg);return}if(r.type==="tool/result"){__e(s,r,t,e.store,e.dcg,a=>e.armTurnTimeout(a));return}r.type==="turn/end"&&(s.timeTakenMs=s.turnStartedAt===void 0?void 0:r.time-s.turnStartedAt,w_e(e,s,o,n?.reason))}}function pZ(e,t,r){let i=e.turnOwner(t,r.turn)??e.liveRun(t);if(!i||i.finalized||i.turn!==void 0&&i.turn!==r.turn)return;let n=i.assistantStreamIndexes??=new Map;if(r.index<(n.get(r.attemptId)??0))return;n.set(r.attemptId,r.index+1),e.armTurnTimeout(i);let o=`${r.turn}:${r.step}`,s=r.chunk;s.type==="text-delta"?(i.stepText.set(o,(i.stepText.get(o)??"")+s.text),Ac(i,e.dcg,s.text)):s.type==="reasoning-delta"&&(i.stepReasoning.set(o,(i.stepReasoning.get(o)??"")+s.text),Cy(i,e.dcg,s.text,`reasoning:${o}`,r.time/1e3+r.index/1e9))}function v_e(e,t,r){let i=he(t.data),n=he(i?.message),o=my(n?.content,"text"),s=my(n?.content,"reasoning"),a=typeof i?.step=="number"?i.step:0,c=`${i?.turn??e.turn??0}:${a}`,u=e.stepText.get(c)??"";!u&&o?Ac(e,r,o):o.startsWith(u)&&o.length>u.length&&Ac(e,r,o.slice(u.length));let l=e.stepReasoning.get(c)??"",f=`reasoning:${c}`,p=fs(t);!l&&s?Cy(e,r,s,f,p):s.startsWith(l)&&s.length>l.length&&Cy(e,r,s.slice(l.length),f,p),Oy(e,r),e.reasoningMessageKey===f&&ps(e,r,"complete")}function b_e(e,t,r,i){ps(e,i,"complete");let n=String(t.data.callId);if(e.toolCalls.has(n))return;let o=fs(t);e.toolCalls.set(n,{name:t.data.name,sort:o,settled:!1,hideResult:g_e(t.data.name,t.data.arguments)}),e.followup||r.markRequestToolWaiting(e.context.requestId),i.enqueue(e.context,Nn(e,Hr({context:e.context,title:fu(t.data.name),name:Vs[t.data.name]?.name||"\u5DE5\u5177\u6267\u884C",toolCallId:n,content:EI(y_e(e,t.data.name,t.data.arguments),"\u6B63\u5728\u6267\u884C"),sort:o,finished:!1,status:"start_stream",isError:!1,botToken:e.botToken})),`tool:${n}:start`)}function __e(e,t,r,i,n,o){let s=String(t.data.message.source.callId),a=e.toolCalls.get(s);if(a?.settled)return;let c=t.data.message;FI(e,c.content,r,i,n,o);let u=t.data.error?.code==="interrupted",l=c.isError===!0||t.data.error!==void 0,f=a?.name||"\u5DE5\u5177\u6267\u884C",p=a?.sort??fs(t),d=m_e.has(f)||a?.hideResult?l?"\u6267\u884C\u5931\u8D25":"\u6267\u884C\u5B8C\u6210":EI(kI(c.content),l?"\u6267\u884C\u5931\u8D25":"\u6267\u884C\u5B8C\u6210");e.toolCalls.set(s,{name:f,sort:p,settled:!0,hideResult:a?.hideResult??!1}),BI(e,i),n.enqueue(e.context,Nn(e,Hr({context:e.context,title:fu(f),name:Vs[f]?.name||"\u5DE5\u5177\u6267\u884C",toolCallId:s,content:d,sort:p,finished:!0,status:u?"cancel":l?"fail":"complete",isError:l,botToken:e.botToken})),`tool:${s}:result`)}function w_e(e,t,r,i){let n=he(i),o=he(n?.error);if(n?.kind==="error"&&hy(o?.message??o)){r!==void 0&&e.releaseTurnOwner(t.dshSessionId,r),e.finishInsufficientBalance(t);return}let s=yV(i);if(r!==void 0&&e.releaseTurnOwner(t.dshSessionId,r),s.status==="succeeded"&&t.pendingSubagents.size>0){e.logger.info("keeping MBHChat message open for background subagents",{dshSessionId:t.dshSessionId,requestId:t.context.requestId,pendingSubagents:[...t.pendingSubagents]}),e.armTurnTimeout(t);return}if(s.status!=="succeeded"&&t.pendingSubagents.size>0){e.finishAfterCascade(t,s.tag,s.status,s.response??"");return}e.finish(t,s.tag,s.status,s.response)}var Ay=class{config;store;getDcg;logger;activeBySession;pendingCronMessageIds;cancelExecution;resolveCronBusinessKey;quarantineUnconfirmedExecution;runsBySession=new Map;turnOwners=new Map;pendingTurns=new Map;terminatingRuns=new WeakSet;constructor(t,r,i,n,o,s,a,c,u){this.config=t,this.store=r,this.getDcg=i,this.logger=n,this.activeBySession=o,this.pendingCronMessageIds=s,this.cancelExecution=a,this.resolveCronBusinessKey=c,this.quarantineUnconfirmedExecution=u}get dcg(){return this.getDcg()}liveRun(t){let r=this.activeBySession.get(t);if(!(!r||r.finalized))return this.trackRun(r),r}liveRuns(){let t=new Set;for(let r of this.activeBySession.values())r.finalized||t.add(r);for(let r of this.runsBySession.values())for(let i of r)i.finalized||t.add(i);return[...t]}handleSessionEvent(t,r){dZ(this,t,r)}handleAssistantChunk(t,r){pZ(this,t,r)}queueText(t,r){Ac(t,this.dcg,r)}detachForSessionRetry(t,r){t.finalized||t.dshSessionId!==r||(clearTimeout(t.timeout),MI(t,this.dcg,"cancelled"),UI(t,this.store,this.dcg,"cancelled"),ps(t,this.dcg,"cancel"),aZ(t),this.forgetRun(t,r,{keepReplacement:!1}))}attachAfterSessionRetry(t,r){t.finalized||(t.dshSessionId=r,this.activeBySession.set(r,t),this.armTurnTimeout(t))}finish(t,r,i,n=""){this.finishRun(t,r,i,n)}finishInsufficientBalance(t){this.finishRun(t,"insufficient_balance","failed","\u58A8\u6EF4\u4E0D\u8DB3",{discardPendingText:!0,forceDirectTerminal:!0,beforeTerminal:()=>{let r=t.chunkIndex++;this.dcg.enqueue(t.context,{response:"\u60A8\u7684\u58A8\u6EF4\u5DF2\u6D88\u8017\u5B8C\uFF0C\u60A8\u53EF\u4EE5\u901A\u8FC7\u5145\u503C\u58A8\u6EF4\u6765\u7EE7\u7EED\u4F7F\u7528\u3002",state:"chunk",chunk_idx:r,message_tags:{insufficient_balance:1},is_finish:-1},"insufficient_balance")}})}finishRun(t,r,i,n,o={}){if(!t.finalized){clearTimeout(t.timeout);try{MI(t,this.dcg,i),UI(t,this.store,this.dcg,i),ps(t,this.dcg,DV(i)),o.discardPendingText?t.pendingText="":Oy(t,this.dcg),o.beforeTerminal?.();let s=t.timeTakenMs===void 0?{}:{timeTakenMs:t.timeTakenMs},a={response:t.followup&&!o.forceDirectTerminal?"":n,state:"final",final_tag:r,is_finish:1,message_tags:{isFinal:1,...s},...t.context.model?{model:t.context.model}:{}};if(t.followup&&!o.forceDirectTerminal){let c=t.cronText&&n?`${t.cronText}
|
|
636
|
+
${n}`:t.cronText||n;(c||t.cronAttachments.length>0)&&this.dcg.enqueue(t.context,{response:c,message_tags:{source:"cron_running",uid:t.context.messageId,...t.cronAttachments.length>0?{mark:"empty_text_file"}:{}},state:"chunk",is_finish:0,...t.cronAttachments.length>0?{files:t.cronAttachments}:{}},"cron:content"),this.dcg.enqueue(t.context,{...a,message_tags:{source:"cron_running",uid:t.context.messageId,isFinal:1,...s}},"final")}else this.dcg.enqueueTerminal(t.context,a,"final",i,r)}catch(s){this.logger.error("could not persist terminal request and delivery",{requestId:t.context.requestId,tag:r,error:te(s)})}finally{t.finalized=!0,this.forgetRun(t,t.dshSessionId,{keepReplacement:!0}),t.resolveCompletion()}}}suspend(t){t.finalized||(clearTimeout(t.timeout),t.submissionAbort?.abort(new Error("Bridge suspended the active prompt submission")),t.finalized=!0,this.forgetRun(t,t.dshSessionId,{keepReplacement:!0}),t.resolveCompletion())}sendImmediateFinal(t,r,i,n){try{this.dcg.enqueueTerminal(t,{response:n,state:"final",final_tag:r,is_finish:1,message_tags:{isFinal:1}},"final",i,r)}catch(o){this.logger.error("could not persist immediate terminal request and delivery",{requestId:t.requestId,tag:r,error:te(o)})}}async onTurnTimeout(t){if(t.finalized)return;let r=Date.now()>=t.deadlineAt,i=r?"task_timeout":"timeout",n=r?"[\u9519\u8BEF] \u4EFB\u52A1\u5DF2\u8D85\u8FC7\u6267\u884C\u65F6\u9650\uFF0C\u5DF2\u8BF7\u6C42\u505C\u6B62":"[\u9519\u8BEF] mbh-chat \u672C\u8F6E\u957F\u65F6\u95F4\u65E0\u6D3B\u52A8\uFF0C\u5DF2\u8BF7\u6C42\u505C\u6B62";this.logger.error(r?"mbh-chat task timed out":"mbh-chat turn timed out",{dshSessionId:t.dshSessionId,requestId:t.context.requestId});try{await this.cancelExecution(t),t.finalized||this.finish(t,i,"failed",n)}catch(o){this.quarantineUnconfirmedExecution?.(t,"timeout_cancel_unconfirmed"),this.logger.error("mbh-chat timeout cancel failed",{dshSessionId:t.dshSessionId,error:te(o)}),t.finalized||this.finish(t,"timeout_cancel_unconfirmed","failed","[\u9519\u8BEF] mbh-chat \u672C\u8F6E\u957F\u65F6\u95F4\u65E0\u6D3B\u52A8\uFF0C\u4F46\u672A\u80FD\u786E\u8BA4\u505C\u6B62\uFF0C\u8BF7\u68C0\u67E5 Agent Host \u72B6\u6001")}}pauseForUserInput(t){t.finalized||(clearTimeout(t.timeout),t.timeout=setTimeout(()=>{this.onTurnTimeout(t)},Math.max(1,t.deadlineAt-Date.now())))}resumeAfterUserInput(t){this.armTurnTimeout(t)}async finishAfterCascade(t,r,i,n){if(!(t.finalized||this.terminatingRuns.has(t))){this.terminatingRuns.add(t),clearTimeout(t.timeout);try{await this.cancelExecution(t),this.finish(t,r,i,n)}catch(o){this.quarantineUnconfirmedExecution?.(t,`${r}_cancel_unconfirmed`),this.logger.error("mbh-chat terminal cascade cancellation failed",{dshSessionId:t.dshSessionId,requestId:t.context.requestId,error:te(o)}),this.finish(t,`${r}_cancel_unconfirmed`,"failed",n||"[\u9519\u8BEF] \u4EFB\u52A1\u5DF2\u7EC8\u6B62\uFF0C\u4F46\u672A\u80FD\u786E\u8BA4\u6A21\u578B\u3001\u5DE5\u5177\u4E0E\u5B50 Agent \u5747\u5DF2\u505C\u6B62")}}}trackRun(t){let r=this.runsBySession.get(t.dshSessionId);r||(r=new Set,this.runsBySession.set(t.dshSessionId,r)),r.add(t)}hasLiveRun(t){return this.liveRuns().some(r=>r.dshSessionId===t)}queuePendingTurn(t,r){let i=this.pendingTurns.get(t)??[];i.push(r),this.pendingTurns.set(t,i)}ownerForTurnStart(t,r){let i=this.turnOwners.get(t)?.get(r);if(i&&!i.finalized)return i;let n=this.liveRun(t);if(n&&n.turn===void 0)n.turn=r;else{let s=this.pendingTurns.get(t),a=s?.shift();s?.length===0&&this.pendingTurns.delete(t),a?.kind==="resume"?n=a.active.finalized?void 0:a.active:a?.kind==="cron"?n=Iy(this,t,a.event,!1):(!n||n.finalized)&&(n=void 0),n&&(n.turn=r)}if(!n)return;this.trackRun(n);let o=this.turnOwners.get(t);return o||(o=new Map,this.turnOwners.set(t,o)),o.set(r,n),this.activeBySession.set(t,n),n}turnOwner(t,r){return this.turnOwners.get(t)?.get(r)}releaseTurnOwner(t,r){this.turnOwners.get(t)?.delete(r)}armTurnTimeout(t){if(t.finalized)return;clearTimeout(t.timeout);let r=Math.max(1,Math.min(this.config.turnTimeoutMs,t.deadlineAt-Date.now()));t.timeout=setTimeout(()=>{this.onTurnTimeout(t)},r)}forgetRun(t,r,i){let n=this.runsBySession.get(r);n?.delete(t),n?.size===0&&this.runsBySession.delete(r);let o=this.pendingTurns.get(r);if(o){let a=o.filter(c=>c.kind!=="resume"||c.active!==t);a.length>0?this.pendingTurns.set(r,a):this.pendingTurns.delete(r)}let s=this.turnOwners.get(r);if(s){for(let[a,c]of s)c===t&&s.delete(a);s.size===0&&this.turnOwners.delete(r)}if(this.activeBySession.get(r)===t){if(i.keepReplacement){let a=n?[...n].find(c=>!c.finalized):void 0;a?this.activeBySession.set(r,a):this.activeBySession.delete(r);return}this.activeBySession.delete(r)}}};function hZ(e){let t=te(e).toLowerCase();return/(429|rate.?limit|too many requests|overload|busy)/.test(t)?"throttled":/(timeout|timed out|temporar|unavailable|econn|enet|eai_again|socket|network|fetch failed|connection|host.*ready)/.test(t)?"transient":"permanent"}function mZ(e,t,r){if(t==="permanent")return 0;let i=t==="throttled"?4:1;return Math.min(r.maxDelayMs,r.baseDelayMs*i*2**Math.max(0,e-1))}function gZ(e,t){if(!e.started)return;let r=Date.now(),i=Math.min(t.nextRetryAt??r,t.deadlineAt??Number.MAX_SAFE_INTEGER),n=Math.max(0,i-r),o=e.retryTimers.get(t.requestId);if(o&&clearTimeout(o),n>0){let s=setTimeout(()=>{e.retryTimers.delete(t.requestId),e.enqueueWaitingRequest(t)},n);s.unref(),e.retryTimers.set(t.requestId,s);return}e.enqueueWaitingRequest(t)}function yZ(e,t){e.queue.enqueue(t.context.businessKey,()=>e.executeWaitingRequest(t.requestId)).catch(r=>{e.logger.error("task queue orchestration failed",{requestId:t.requestId,error:te(r)})})}async function vZ(e,t){if(!e.started)return;let r=e.store.getWaitingRequest(t);if(!r)return;let i=Date.now();if(r.deadlineAt!==void 0&&r.deadlineAt<=i){e.turns.sendImmediateFinal(r.context,"task_timeout","failed","[\u9519\u8BEF] \u4EFB\u52A1\u5DF2\u8D85\u8FC7\u6267\u884C\u65F6\u9650");return}if(r.attemptCount>=e.config.task.maxAttempts){e.turns.sendImmediateFinal(r.context,"retry_exhausted","failed","[\u9519\u8BEF] \u4EFB\u52A1\u91CD\u8BD5\u6B21\u6570\u5DF2\u8017\u5C3D");return}let n=e.store.beginRequestAttempt(t);if(n!==void 0)try{await e.runPrompt(r.message,r.context,r.deadlineAt)}catch(o){if(!e.started)return;let s=e.store.getWaitingRequest(t);if(!s)return;let a=hZ(o),c=mZ(n,a,{baseDelayMs:e.config.task.retryBaseMs,maxDelayMs:e.config.task.retryMaxMs}),u=Date.now()+c;if(a!=="permanent"&&n<e.config.task.maxAttempts&&(s.deadlineAt===void 0||u<s.deadlineAt)&&e.store.scheduleRequestRetry(t,te(o),u)){e.logger.warn("scheduled task retry",{requestId:t,attempt:n,failureClass:a,delayMs:c}),e.scheduleWaitingRequest({...s,attemptCount:n,nextRetryAt:u});return}let f=a==="permanent"?"task_error":"retry_exhausted";e.logger.error("mbh-chat task failed after retry handling",{requestId:t,attempt:n,failureClass:a,error:te(o)}),e.turns.sendImmediateFinal(r.context,f,"failed",to(o))}}var $y=class{config;logger;store;dsh;dcg;requestApi;ossUpload;messageControl;skillManager;agentManager;inboundPrompt;intentFeedback;sessions;turns;bridgeStatus=new yh;cronSync;queue=new cy;activeBySession=new Map;corruptSessionRecoveries=new Map;pendingCronMessageIds=new Map;pendingUserQuestions=new Map;sessionsToCancelOnReconnect=new Set;stopRequestedSessions=new Set;handledCorruptSessions=new Set;invalidToolHistorySessions=new Set;cancelQuarantinedChain=Promise.resolve();quarantinedRetryTimer;retryTimers=new Map;startupRecovery=Promise.resolve();runAbort;started=!1;constructor(t){this.config=t,this.logger=new Zs(t.logLevel),this.store=new bh(t.stateDb,t.task.timeoutMs),this.dsh=new py(t.dsh.baseUrl,t.dsh.reconnectMinMs,t.dsh.reconnectMaxMs,this.logger),this.requestApi=new Bh(t.api,this.logger),this.skillManager=new ly(this.logger,{allowPrivateNetwork:t.media.allowPrivateNetwork}),this.agentManager=new gh(this.logger,{storageRoot:t.agent.storageRoot,allowPrivateNetwork:t.media.allowPrivateNetwork,resolveDownloadUrl:(r,i)=>this.requestApi.getOnlineAgents(r,i.botToken,i)}),this.dcg=new qh(t.account,this.store,this.logger,r=>this.handleInbound(r),r=>this.handleSkillEvent(r),r=>this.bridgeStatus.setDcgState(r),r=>this.handleInboundEvent(r)),this.ossUpload=KH(this.requestApi,this.logger),this.turns=new Ay({turnTimeoutMs:t.turnTimeoutMs,taskTimeoutMs:t.task.timeoutMs,botToken:t.account.botToken},this.store,()=>this.dcg,this.logger,this.activeBySession,this.pendingCronMessageIds,r=>this.cancelActiveExecution(r),r=>this.cronSync?.businessKeyForCronId(r),(r,i)=>this.quarantineUnconfirmedExecution(r.businessKey,r.dshSessionId,i)),this.inboundPrompt=new Ty(t,this.agentManager,this.skillManager,this.requestApi,()=>this.dcg,this.logger),this.intentFeedback=new Ey((r,i,n)=>{this.dcg.enqueue(r,i,n)}),this.sessions=new by(t,this.store,()=>this.dsh,this.logger,()=>this.cronSync,this.activeBySession,(r,i,n,o)=>this.turns.finish(r,i,n,o),r=>this.cancelActiveExecution(r),(r,i,n,o)=>this.quarantineUnconfirmedExecution(r,i,n,o)),this.messageControl=t.messageControl?new Lh(t.messageControl.socketPath,t.messageControl.token,(r,i)=>this.handleMbhchatMessage(r,i),()=>this.bridgeStatus.snapshot()):void 0}async start(){if(this.started)throw new Error("bridge already started");this.started=!0,this.runAbort=new AbortController,this.bridgeStatus.start(),await this.messageControl?.start();for(let s of this.store.listQuarantinedSessions())this.sessionsToCancelOnReconnect.add(s);let t=this.store.listWaitingRequests(),r=this.store.listActiveRequests(),i=[...new Set([...r,...t].map(s=>s.context.businessKey))];this.logger.info("mbh-chat bridge recovery state loaded",{activeCount:r.length,waitingCount:t.length,sessionKeys:i}),this.dsh.start({onRemoteEvent:s=>this.handleRemoteEvent(s),onSessionEvent:(s,a)=>this.handleSessionEvent(s,a),onAssistantChunk:(s,a)=>this.handleAssistantChunk(s,a),onConnection:async s=>{this.bridgeStatus.setDshConnected(s);try{await this.handleDshConnectionChange(s)}catch(a){this.logger.error("mbh-chat connection transition handling failed",{connected:s,error:te(a)})}}});let n=this.recoverActiveRequests(r,{waitForCancel:!1});this.startupRecovery=n,await this.dsh.whenConnected(this.connectionWaitSignal());let o=this.store.pruneDeliveredDeliveries(this.config.outboxRetentionMs===0?0:Date.now()-this.config.outboxRetentionMs,this.config.outboxMaxDelivered);this.config.outboxRetentionMs>0&&this.store.pruneManagementEvents(Date.now()-this.config.outboxRetentionMs),o>0&&this.logger.info("pruned delivered Outbox history",{count:o}),this.cronSync=new Mh({dshBaseUrl:this.config.dsh.baseUrl,store:this.store,dcg:this.dcg,logger:this.logger,followSession:s=>this.dsh.followSession(s),provisionSession:s=>this.provisionCronSession(s)}),this.dcg.start(),this.cronSync.start(),this.cronSync.bindAllKnownDshSessions().catch(s=>{this.logger.warn("failed to bind cron jobs to pre-existing mbh-chat sessions",{error:te(s)})});for(let s of t)s.context.requestId=s.requestId,this.scheduleWaitingRequest(s);t.length>0&&this.logger.warn("recovered waiting requests",{count:t.length});try{await n}finally{this.startupRecovery===n&&(this.startupRecovery=Promise.resolve())}this.logger.info("mbh-chat bridge started",{stateDb:this.config.stateDb})}async provisionCronSession(t){if(!t.sessionKey)return;let r=Fa(t.sessionKey);if(!r.sessionId)return;let i=this.store.getLatestContextForSessionId(r.sessionId),n=i??{accountId:this.config.account.accountId,requestId:`cron-provision:${t.id}`,businessKey:t.sessionKey,userId:Number(this.config.account.userId)||0,sessionId:r.sessionId,messageId:`cron:${t.id}`,domainId:this.config.account.domainId,appId:this.config.account.appId,agentId:r.agentId},o=await this.sessions.ensureSession(t.sessionKey,void 0,{...this.config.dsh.workspaceCwd?{workspaceDir:this.config.dsh.workspaceCwd}:{},agentPreset:this.config.dsh.agentPreset,managed:!1},n);return this.logger.info("restored cron DSH session for exact Web session",{cronId:t.id,sessionId:r.sessionId,dshSessionId:o,restoredFromWebSessionList:!!i}),o}async stop(){if(!this.started)return;this.started=!1;let t=[],r=async(n,o)=>{try{await o()}catch(s){t.push({step:n,error:s}),this.logger.warn("Bridge shutdown step failed",{step:n,error:te(s)})}};await r("cancel queued requests",()=>this.queue.cancelAllPending()),await r("clear retry timers",()=>{for(let n of this.retryTimers.values())clearTimeout(n);this.retryTimers.clear(),this.quarantinedRetryTimer&&clearTimeout(this.quarantinedRetryTimer),this.quarantinedRetryTimer=void 0}),await r("abort runtime waits",()=>this.runAbort?.abort(new Error("Bridge is stopping"))),await r("stop status tracker",()=>this.bridgeStatus.stop()),await r("release pending user questions",()=>this.pendingUserQuestions.clear()),await r("log bridge interruption state",()=>{let n=this.store.listActiveRequests(),o=this.store.listWaitingRequests();this.logger.info("mbh-chat bridge interruption state saved",{activeCount:n.length,waitingCount:o.length,sessionKeys:[...new Set([...n,...o].map(s=>s.context.businessKey))]})});let i=[];await r("collect active runs",()=>{i=[...new Set([...this.turns.liveRuns(),...[...this.corruptSessionRecoveries.values()].map(n=>n.active)])]}),await r("log persisted active chats",()=>{for(let n of this.store.listActiveRequests())this.logger.info("preserving active mbh-chat chat for Bridge restart",{sessionKey:n.context.businessKey,requestId:n.requestId,...n.dshSessionId?{dshSessionId:n.dshSessionId}:{}})}),await r("suspend active runs",()=>{for(let n of i)try{this.turns.suspend(n)}catch(o){t.push({step:`suspend active run ${n.dshSessionId}`,error:o}),this.logger.warn("Bridge shutdown step failed",{step:`suspend active run ${n.dshSessionId}`,error:te(o)})}this.corruptSessionRecoveries.clear()}),await r("stop cron synchronization",()=>this.cronSync?.stop()),await r("flush outbound queue",()=>this.dcg.flush()),await r("stop outbound socket",()=>this.dcg.stop()),await r("stop DSH connection",()=>this.dsh.stop()),await r("stop message control",()=>this.messageControl?.stop()),await r("finish quarantined cancellation queue",()=>this.cancelQuarantinedChain),await r("clear runtime state",()=>{this.pendingCronMessageIds.clear(),this.sessionsToCancelOnReconnect.clear(),this.stopRequestedSessions.clear(),this.handledCorruptSessions.clear(),this.invalidToolHistorySessions.clear()}),await r("close state store",()=>this.store.close()),this.runAbort=void 0,t.length>0?this.logger.error("mbh-chat bridge stopped with cleanup failures",{failures:t.map(({step:n,error:o})=>({step:n,error:te(o)}))}):this.logger.info("mbh-chat bridge stopped")}async recoverActiveRequests(t,r){let i=[],n=[];for(let o of t){if(!o.dshSessionId){this.store.markRequestTerminal(o.requestId,"failed","bridge_recovery_missing_session"),this.logger.warn("discarded mbh-chat recovery record without a DSH session",{requestId:o.requestId});continue}let s=kc({context:o.context,botToken:this.config.account.botToken,businessKey:o.context.businessKey,dshSessionId:o.dshSessionId,followup:!1,turnTimeoutMs:this.config.turnTimeoutMs,taskTimeoutMs:this.config.task.timeoutMs,...o.deadlineAt===void 0?{}:{deadlineAt:o.deadlineAt},onTimeout:c=>{this.turns.onTurnTimeout(c)}});this.activeBySession.set(o.dshSessionId,s);let a=this.store.listActiveSubagents(o.requestId);for(let c of a)s.pendingSubagents.add(c.childSessionId),s.subagentParents.set(c.childSessionId,c.parentSessionId);n.push({request:o,active:s,subagents:a})}await Promise.all(n.map(async({request:o,active:s,subagents:a})=>{let c=this.connectionWaitSignal();try{for(let u of a)await this.dsh.recoverSession(u.childSessionId,void 0,({matched:l,records:f})=>{if(l)for(let p of f)this.handleSessionEvent(u.childSessionId,p)},c);await this.dsh.recoverSession(o.dshSessionId,o.executionRpcId,({matched:u,records:l})=>{if(!u){this.store.markRequestTerminal(o.requestId,"failed","bridge_recovery_not_found"),this.turns.suspend(s),this.logger.warn("discarded stale mbh-chat recovery record without re-executing it",{requestId:o.requestId,dshSessionId:o.dshSessionId});return}for(let f of l)this.handleSessionEvent(o.dshSessionId,f);i.push(o.context.businessKey),this.logger.info("restored mbh-chat chat from its existing DSH execution",{sessionKey:o.context.businessKey,requestId:o.requestId,dshSessionId:o.dshSessionId,replayedEvents:l.length,stillRunning:!s.finalized})},c)}catch(u){if(!this.started||this.runAbort?.signal.aborted){this.turns.suspend(s),this.logger.info("preserved mbh-chat recovery because the Bridge is stopping",{sessionKey:o.context.businessKey,requestId:o.requestId,dshSessionId:o.dshSessionId});return}for(let l of a)this.unfollowSession(l.childSessionId);this.unfollowSession(o.dshSessionId),c.aborted&&this.quarantineUnconfirmedExecution(o.context.businessKey,o.dshSessionId,"bridge_recovery_timeout"),this.store.markRequestTerminal(o.requestId,"failed","bridge_recovery_unavailable"),this.turns.suspend(s),this.logger.warn("discarded unavailable mbh-chat recovery record without re-executing it",{requestId:o.requestId,dshSessionId:o.dshSessionId,error:te(u)})}})),t.length>0&&this.logger.info("finished restoring persisted mbh-chat chats",{count:i.length,sessionKeys:i})}async handleDshConnectionChange(t){if(!this.started)return;let r=this.turns.liveRuns(),i=[...new Set(r.map(n=>n.businessKey))];if(!t){this.sessions.clearHostDefaultProvider(),this.logger.warn("DSH event stream disconnected; retaining active executions for follow recovery",{count:r.length,sessionKeys:i});return}this.logger.info("DSH event stream reconnected; resuming saved sessions",{count:r.length,sessionKeys:i}),this.cancelQuarantinedSessions().catch(n=>{this.logger.warn("could not cancel mbh-chat session left behind by stream loss",{error:te(n)})})}cancelQuarantinedSessions(){let t=this.cancelQuarantinedChain.then(()=>this.runCancelQuarantinedSessions());return this.cancelQuarantinedChain=t.then(()=>{},()=>{}),t}async runCancelQuarantinedSessions(){for(let t of[...this.sessionsToCancelOnReconnect])try{let r=await this.cancelExecutionTree(t);if(this.sessionsToCancelOnReconnect.delete(t),r==="absent"){this.store.removeQuarantinedSession(t),this.logger.info("dropped quarantined mbh-chat session that is no longer attached",{dshSessionId:t});continue}let i=this.store.resolveQuarantinedSession(t);this.logger.info("cancelled quarantined mbh-chat session",{dshSessionId:t,resolution:i})}catch(r){this.logger.warn("could not cancel mbh-chat session left behind by stream loss",{dshSessionId:t,error:te(r)})}this.sessionsToCancelOnReconnect.size>0&&this.scheduleQuarantinedCancellationRetry()}quarantineUnconfirmedExecution(t,r,i,n=!0){this.sessionsToCancelOnReconnect.add(r);try{this.store.quarantineSession(t,r,i,n)}catch(o){this.logger.error("could not persist quarantined mbh-chat session",{businessKey:t,dshSessionId:r,reason:i,error:te(o)})}this.scheduleQuarantinedCancellationRetry()}scheduleQuarantinedCancellationRetry(){if(!this.started||this.quarantinedRetryTimer||this.sessionsToCancelOnReconnect.size===0)return;let t=Math.max(1e3,this.config.task.retryMaxMs);this.quarantinedRetryTimer=setTimeout(()=>{this.quarantinedRetryTimer=void 0,this.cancelQuarantinedSessions().catch(r=>{this.logger.warn("background quarantined-session cancellation failed",{error:te(r)}),this.scheduleQuarantinedCancellationRetry()})},t),this.quarantinedRetryTimer.unref()}async handleInbound(t){let r=Qn(this.config.account.accountId,t.content.message_id.trim()),i=vh(t,this.config.account.accountId,r,this.config.account),n=this.store.claimInbound(t,i);if(n.kind==="duplicate"){this.logger.info("duplicate inbound suppressed",{messageId:t.content.message_id,requestId:n.requestId,status:n.status}),this.dcg.flush().catch(c=>{this.logger.error("duplicate-triggered Outbox flush failed",{error:te(c)})});return}if(n.kind==="conflict"){this.logger.error("inbound idempotency conflict",{messageId:t.content.message_id,requestId:n.requestId});return}i.requestId=n.requestId;let o=t.content.text.trim(),s=Ei(t.content).map(c=>c.name);if(this.logger.info("accepted inbound chat",{messageId:t.content.message_id,sessionId:i.sessionId,businessKey:i.businessKey,text:o,...s.length>0?{files:s}:{}}),this.cronSync?.notifySessionAvailable(),o==="/stop"){await this.handleStop(i);return}this.intentFeedback.messageReceived(i,t.content.text),this.prewarmMappedSession(i.businessKey);let a=this.store.getWaitingRequest(i.requestId);if(!a)throw new Error(`claimed task ${i.requestId} is not in waiting state`);this.scheduleWaitingRequest({...a,message:t,context:i})}prewarmMappedSession(t){let r=this.store.getSession(t);r&&this.dsh.followSession(r).catch(i=>{this.logger.warn("mbh-chat session follow prewarm failed",{businessKey:t,dshSessionId:r,error:te(i)})})}scheduleWaitingRequest(t){gZ(this,t)}enqueueWaitingRequest(t){yZ(this,t)}async executeWaitingRequest(t){await this.startupRecovery,this.started&&await vZ(this,t)}async handleSkillEvent(t){await this.claimManagementEvent(t.content)&&await BV(this,t)}async handleInboundEvent(t){(t.eventType==="agent"||t.eventType==="cron")&&!await this.claimManagementEvent(t.content)||await WV(this,t)}async claimManagementEvent(t){let r=typeof t.websocket_trace_id=="string"?t.websocket_trace_id.trim():"";if(!r)return!0;try{let i=this.store.claimManagementEvent(r,t);return i==="claimed"?!0:i==="duplicate"?(this.logger.info("duplicate management event suppressed",{traceId:r}),this.dcg.flush().catch(n=>{this.logger.warn("duplicate management event Outbox flush failed",{error:te(n)})}),!1):(await this.dcg.sendEvent({...t,status:"fail",error:"management event idempotency conflict"}),this.logger.error("management event idempotency conflict",{traceId:r}),!1)}catch(i){return await this.dcg.sendEvent({...t,status:"fail",error:te(i)}),this.logger.error("management event could not be claimed",{traceId:r,error:te(i)}),!1}}async handleStop(t){this.queue.cancelPending(t.businessKey);let r=this.store.listWaitingRequestsForBusinessKey(t.businessKey,t.requestId);for(let o of r){let s=this.retryTimers.get(o.requestId);s&&clearTimeout(s),this.retryTimers.delete(o.requestId),this.turns.sendImmediateFinal(o.context,"stop","cancelled","")}r.length>0&&this.logger.info("cancelled waiting mbh-chat tasks",{businessKey:t.businessKey,count:r.length});let i=this.store.getSession(t.businessKey);if(!i){this.completeStopControl(t,"cancelled","stop");return}this.cancelPendingUserQuestions(i);let n=this.turns.liveRun(i);this.stopRequestedSessions.add(i);try{n?await this.cancelActiveExecution(n):await this.cancelExecutionTree(i),n&&!n.finalized&&this.turns.finish(n,"stop","cancelled",""),this.store.markPostStopContextBoundary(t.businessKey),this.completeStopControl(t,"cancelled","stop"),this.logger.info("cancelled active mbh-chat turn",{dshSessionId:i,businessKey:t.businessKey})}catch(o){this.stopRequestedSessions.delete(i),this.quarantineUnconfirmedExecution(t.businessKey,i,"stop_cancel_unconfirmed"),this.logger.warn("mbh-chat cancel failed",{dshSessionId:i,error:te(o)}),n&&!n.finalized&&this.turns.finish(n,"stop_cancel_unconfirmed","failed","[\u9519\u8BEF] \u672A\u80FD\u786E\u8BA4\u6A21\u578B\u3001\u5DE5\u5177\u4E0E\u5B50 Agent \u5747\u5DF2\u505C\u6B62"),this.completeStopControl(t,"failed","stop_cancel_unconfirmed")}}completeStopControl(t,r,i){this.store.markRequestTerminal(t.requestId,r,i)}cancelPendingUserQuestions(t){EV(this,t)}async cancelActiveExecution(t){t.submissionAbort?.abort(new Error("mbh-chat execution was cancelled")),await this.cancelExecutionTree(t.dshSessionId,t.context.requestId,t.subagentParents)}async cancelExecutionTree(t,r,i){return dV(this,t,r,i)}async runPrompt(t,r,i){await QV(this,t,r,i)}connectionWaitSignal(){let t=this.runAbort?.signal,r=AbortSignal.timeout(this.config.supervisor.startTimeoutMs);return t?AbortSignal.any([t,r]):r}handleMbhchatMessage(t,r){return GV({request:t,signal:r,config:this.config,activeBySession:this.activeBySession,ossUpload:this.ossUpload,dcg:this.dcg,logger:this.logger})}prepareSelectedSkill(t){return this.inboundPrompt.prepareSelectedSkill(t)}promptContent(t,r,i,n,o,s){return this.inboundPrompt.promptContent(t,r,i,n,o,s)}ensureSession(t,r,i,n){return this.sessions.ensureSession(t,r,i,n)}async handleRemoteEvent(t){await IV(this,t)}handleSessionEvent(t,r){if(bV(r)&&!this.invalidToolHistorySessions.has(t)&&(this.invalidToolHistorySessions.add(t),this.logger.warn("detected mbh-chat session with invalid tool identity",{dshSessionId:t,eventType:r.type})),r.type!=="turn/end"){this.turns.handleSessionEvent(t,r);return}let i=vV(r);if(i&&sf(i)){this.invalidToolHistorySessions.delete(t),DI(this,t,i);return}let n=this.invalidToolHistorySessions.delete(t);this.stopRequestedSessions.delete(t),this.turns.handleSessionEvent(t,r),n&&(this.store.removeSessionByDshId(t),this.unfollowSession(t),this.logger.warn("discarded mbh-chat session with invalid tool identity after turn end",{dshSessionId:t}))}handleAssistantChunk(t,r){this.turns.handleAssistantChunk(t,r)}onTurnTimeout(t){return this.turns.onTurnTimeout(t)}unfollowSession(t){this.dsh.unfollowSession?.(t)}};async function x_e(){let e=s$(),t=a$(`${e.stateDb}.lock`),r=new $y(e),i=!1,n=async o=>{if(!i){i=!0,console.log(`${new Date().toISOString()} INFO received ${o}, stopping bridge`);try{await r.stop()}finally{t.release()}}};process.once("SIGINT",()=>{n("SIGINT")}),process.once("SIGTERM",()=>{n("SIGTERM")});try{await r.start()}catch(o){try{await r.stop()}finally{t.release()}throw o}}x_e().catch(e=>{console.error(`${new Date().toISOString()} ERROR bridge startup failed: ${te(e)}`),process.exitCode=1});
|