mirror of
git://soft.sys114.com/mainsail
synced 2026-02-04 14:30:36 +09:00
7 lines
106 KiB
JavaScript
7 lines
106 KiB
JavaScript
import{c as he,a as xt}from"./overlayscrollbars-CiKU261J.js";import{I as yt,m as Rt,B as kt,H as At,P as vt,W as Tt,C as Bt,n as Lt}from"./index-Bku7SJna.js";import{m as Ct,n as Ut,r as Mt}from"./vuetify-Ce4WN_Dg.js";import"./echarts-DzoUeqWp.js";var gt={exports:{}},ge={exports:{}},Ve;function qe(){if(Ve)return ge.exports;Ve=1;var F=typeof Reflect=="object"?Reflect:null,x=F&&typeof F.apply=="function"?F.apply:function(y,R,V){return Function.prototype.apply.call(y,R,V)},A;F&&typeof F.ownKeys=="function"?A=F.ownKeys:Object.getOwnPropertySymbols?A=function(y){return Object.getOwnPropertyNames(y).concat(Object.getOwnPropertySymbols(y))}:A=function(y){return Object.getOwnPropertyNames(y)};function I(g){console&&console.warn&&console.warn(g)}var D=Number.isNaN||function(y){return y!==y};function v(){v.init.call(this)}ge.exports=v,ge.exports.once=p,v.EventEmitter=v,v.prototype._events=void 0,v.prototype._eventsCount=0,v.prototype._maxListeners=void 0;var b=10;function s(g){if(typeof g!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof g)}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return b},set:function(g){if(typeof g!="number"||g<0||D(g))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+g+".");b=g}}),v.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},v.prototype.setMaxListeners=function(y){if(typeof y!="number"||y<0||D(y))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+y+".");return this._maxListeners=y,this};function E(g){return g._maxListeners===void 0?v.defaultMaxListeners:g._maxListeners}v.prototype.getMaxListeners=function(){return E(this)},v.prototype.emit=function(y){for(var R=[],V=1;V<arguments.length;V++)R.push(arguments[V]);var H=y==="error",z=this._events;if(z!==void 0)H=H&&z.error===void 0;else if(!H)return!1;if(H){var J;if(R.length>0&&(J=R[0]),J instanceof Error)throw J;var te=new Error("Unhandled error."+(J?" ("+J.message+")":""));throw te.context=J,te}var ne=z[y];if(ne===void 0)return!1;if(typeof ne=="function")x(ne,this,R);else for(var ie=ne.length,ae=L(ne,ie),V=0;V<ie;++V)x(ae[V],this,R);return!0};function U(g,y,R,V){var H,z,J;if(s(R),z=g._events,z===void 0?(z=g._events=Object.create(null),g._eventsCount=0):(z.newListener!==void 0&&(g.emit("newListener",y,R.listener?R.listener:R),z=g._events),J=z[y]),J===void 0)J=z[y]=R,++g._eventsCount;else if(typeof J=="function"?J=z[y]=V?[R,J]:[J,R]:V?J.unshift(R):J.push(R),H=E(g),H>0&&J.length>H&&!J.warned){J.warned=!0;var te=new Error("Possible EventEmitter memory leak detected. "+J.length+" "+String(y)+" listeners added. Use emitter.setMaxListeners() to increase limit");te.name="MaxListenersExceededWarning",te.emitter=g,te.type=y,te.count=J.length,I(te)}return g}v.prototype.addListener=function(y,R){return U(this,y,R,!1)},v.prototype.on=v.prototype.addListener,v.prototype.prependListener=function(y,R){return U(this,y,R,!0)};function W(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function O(g,y,R){var V={fired:!1,wrapFn:void 0,target:g,type:y,listener:R},H=W.bind(V);return H.listener=R,V.wrapFn=H,H}v.prototype.once=function(y,R){return s(R),this.on(y,O(this,y,R)),this},v.prototype.prependOnceListener=function(y,R){return s(R),this.prependListener(y,O(this,y,R)),this},v.prototype.removeListener=function(y,R){var V,H,z,J,te;if(s(R),H=this._events,H===void 0)return this;if(V=H[y],V===void 0)return this;if(V===R||V.listener===R)--this._eventsCount===0?this._events=Object.create(null):(delete H[y],H.removeListener&&this.emit("removeListener",y,V.listener||R));else if(typeof V!="function"){for(z=-1,J=V.length-1;J>=0;J--)if(V[J]===R||V[J].listener===R){te=V[J].listener,z=J;break}if(z<0)return this;z===0?V.shift():j(V,z),V.length===1&&(H[y]=V[0]),H.removeListener!==void 0&&this.emit("removeListener",y,te||R)}return this},v.prototype.off=v.prototype.removeListener,v.prototype.removeAllListeners=function(y){var R,V,H;if(V=this._events,V===void 0)return this;if(V.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):V[y]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete V[y]),this;if(arguments.length===0){var z=Object.keys(V),J;for(H=0;H<z.length;++H)J=z[H],J!=="removeListener"&&this.removeAllListeners(J);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(R=V[y],typeof R=="function")this.removeListener(y,R);else if(R!==void 0)for(H=R.length-1;H>=0;H--)this.removeListener(y,R[H]);return this};function N(g,y,R){var V=g._events;if(V===void 0)return[];var H=V[y];return H===void 0?[]:typeof H=="function"?R?[H.listener||H]:[H]:R?P(H):L(H,H.length)}v.prototype.listeners=function(y){return N(this,y,!0)},v.prototype.rawListeners=function(y){return N(this,y,!1)},v.listenerCount=function(g,y){return typeof g.listenerCount=="function"?g.listenerCount(y):M.call(g,y)},v.prototype.listenerCount=M;function M(g){var y=this._events;if(y!==void 0){var R=y[g];if(typeof R=="function")return 1;if(R!==void 0)return R.length}return 0}v.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function L(g,y){for(var R=new Array(y),V=0;V<y;++V)R[V]=g[V];return R}function j(g,y){for(;y+1<g.length;y++)g[y]=g[y+1];g.pop()}function P(g){for(var y=new Array(g.length),R=0;R<y.length;++R)y[R]=g[R].listener||g[R];return y}function p(g,y){return new Promise(function(R,V){function H(J){g.removeListener(y,z),V(J)}function z(){typeof g.removeListener=="function"&&g.removeListener("error",H),R([].slice.call(arguments))}C(g,y,z,{once:!0}),y!=="error"&&_(g,H,{once:!0})})}function _(g,y,R){typeof g.on=="function"&&C(g,"error",y,R)}function C(g,y,R,V){if(typeof g.on=="function")V.once?g.once(y,R):g.on(y,R);else if(typeof g.addEventListener=="function")g.addEventListener(y,function H(z){V.once&&g.removeEventListener(y,H),R(z)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof g)}return ge.exports}var me={exports:{}},Ye;function pe(){return Ye||(Ye=1,typeof Object.create=="function"?me.exports=function(x,A){A&&(x.super_=A,x.prototype=Object.create(A.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}))}:me.exports=function(x,A){if(A){x.super_=A;var I=function(){};I.prototype=A.prototype,x.prototype=new I,x.prototype.constructor=x}}),me.exports}var Se,ze;function mt(){return ze||(ze=1,Se=qe().EventEmitter),Se}var xe={},ve={},Ke;function Dt(){if(Ke)return ve;Ke=1,ve.byteLength=s,ve.toByteArray=U,ve.fromByteArray=N;for(var F=[],x=[],A=typeof Uint8Array<"u"?Uint8Array:Array,I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=0,v=I.length;D<v;++D)F[D]=I[D],x[I.charCodeAt(D)]=D;x[45]=62,x[95]=63;function b(M){var L=M.length;if(L%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var j=M.indexOf("=");j===-1&&(j=L);var P=j===L?0:4-j%4;return[j,P]}function s(M){var L=b(M),j=L[0],P=L[1];return(j+P)*3/4-P}function E(M,L,j){return(L+j)*3/4-j}function U(M){var L,j=b(M),P=j[0],p=j[1],_=new A(E(M,P,p)),C=0,g=p>0?P-4:P,y;for(y=0;y<g;y+=4)L=x[M.charCodeAt(y)]<<18|x[M.charCodeAt(y+1)]<<12|x[M.charCodeAt(y+2)]<<6|x[M.charCodeAt(y+3)],_[C++]=L>>16&255,_[C++]=L>>8&255,_[C++]=L&255;return p===2&&(L=x[M.charCodeAt(y)]<<2|x[M.charCodeAt(y+1)]>>4,_[C++]=L&255),p===1&&(L=x[M.charCodeAt(y)]<<10|x[M.charCodeAt(y+1)]<<4|x[M.charCodeAt(y+2)]>>2,_[C++]=L>>8&255,_[C++]=L&255),_}function W(M){return F[M>>18&63]+F[M>>12&63]+F[M>>6&63]+F[M&63]}function O(M,L,j){for(var P,p=[],_=L;_<j;_+=3)P=(M[_]<<16&16711680)+(M[_+1]<<8&65280)+(M[_+2]&255),p.push(W(P));return p.join("")}function N(M){for(var L,j=M.length,P=j%3,p=[],_=16383,C=0,g=j-P;C<g;C+=_)p.push(O(M,C,C+_>g?g:C+_));return P===1?(L=M[j-1],p.push(F[L>>2]+F[L<<4&63]+"==")):P===2&&(L=(M[j-2]<<8)+M[j-1],p.push(F[L>>10]+F[L>>4&63]+F[L<<2&63]+"=")),p.join("")}return ve}var we={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Je;function Ft(){return Je||(Je=1,we.read=function(F,x,A,I,D){var v,b,s=D*8-I-1,E=(1<<s)-1,U=E>>1,W=-7,O=A?D-1:0,N=A?-1:1,M=F[x+O];for(O+=N,v=M&(1<<-W)-1,M>>=-W,W+=s;W>0;v=v*256+F[x+O],O+=N,W-=8);for(b=v&(1<<-W)-1,v>>=-W,W+=I;W>0;b=b*256+F[x+O],O+=N,W-=8);if(v===0)v=1-U;else{if(v===E)return b?NaN:(M?-1:1)*(1/0);b=b+Math.pow(2,I),v=v-U}return(M?-1:1)*b*Math.pow(2,v-I)},we.write=function(F,x,A,I,D,v){var b,s,E,U=v*8-D-1,W=(1<<U)-1,O=W>>1,N=D===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=I?0:v-1,L=I?1:-1,j=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(s=isNaN(x)?1:0,b=W):(b=Math.floor(Math.log(x)/Math.LN2),x*(E=Math.pow(2,-b))<1&&(b--,E*=2),b+O>=1?x+=N/E:x+=N*Math.pow(2,1-O),x*E>=2&&(b++,E/=2),b+O>=W?(s=0,b=W):b+O>=1?(s=(x*E-1)*Math.pow(2,D),b=b+O):(s=x*Math.pow(2,O-1)*Math.pow(2,D),b=0));D>=8;F[A+M]=s&255,M+=L,s/=256,D-=8);for(b=b<<D|s,U+=D;U>0;F[A+M]=b&255,M+=L,b/=256,U-=8);F[A+M-L]|=j*128}),we}/*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <https://feross.org>
|
||
* @license MIT
|
||
*/var $e;function Ee(){return $e||($e=1,function(F){var x=Dt(),A=Ft(),I=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=s,F.SlowBuffer=_,F.INSPECT_MAX_BYTES=50;var D=2147483647;F.kMaxLength=D,s.TYPED_ARRAY_SUPPORT=v(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function v(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function b(r){if(r>D)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,s.prototype),e}function s(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return O(r)}return E(r,e,t)}s.poolSize=8192;function E(r,e,t){if(typeof r=="string")return N(r,e);if(ArrayBuffer.isView(r))return L(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(T(r,ArrayBuffer)||r&&T(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(T(r,SharedArrayBuffer)||r&&T(r.buffer,SharedArrayBuffer)))return j(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var f=r.valueOf&&r.valueOf();if(f!=null&&f!==r)return s.from(f,e,t);var m=P(r);if(m)return m;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return s.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}s.from=function(r,e,t){return E(r,e,t)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function U(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function W(r,e,t){return U(r),r<=0?b(r):e!==void 0?typeof t=="string"?b(r).fill(e,t):b(r).fill(e):b(r)}s.alloc=function(r,e,t){return W(r,e,t)};function O(r){return U(r),b(r<0?0:p(r)|0)}s.allocUnsafe=function(r){return O(r)},s.allocUnsafeSlow=function(r){return O(r)};function N(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=C(r,e)|0,f=b(t),m=f.write(r,e);return m!==t&&(f=f.slice(0,m)),f}function M(r){for(var e=r.length<0?0:p(r.length)|0,t=b(e),f=0;f<e;f+=1)t[f]=r[f]&255;return t}function L(r){if(T(r,Uint8Array)){var e=new Uint8Array(r);return j(e.buffer,e.byteOffset,e.byteLength)}return M(r)}function j(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var f;return e===void 0&&t===void 0?f=new Uint8Array(r):t===void 0?f=new Uint8Array(r,e):f=new Uint8Array(r,e,t),Object.setPrototypeOf(f,s.prototype),f}function P(r){if(s.isBuffer(r)){var e=p(r.length)|0,t=b(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||Y(r.length)?b(0):M(r);if(r.type==="Buffer"&&Array.isArray(r.data))return M(r.data)}function p(r){if(r>=D)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D.toString(16)+" bytes");return r|0}function _(r){return+r!=r&&(r=0),s.alloc(+r)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(T(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),T(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var f=e.length,m=t.length,k=0,q=Math.min(f,m);k<q;++k)if(e[k]!==t[k]){f=e[k],m=t[k];break}return f<m?-1:m<f?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return s.alloc(0);var f;if(t===void 0)for(t=0,f=0;f<e.length;++f)t+=e[f].length;var m=s.allocUnsafe(t),k=0;for(f=0;f<e.length;++f){var q=e[f];if(T(q,Uint8Array))k+q.length>m.length?s.from(q).copy(m,k):Uint8Array.prototype.set.call(m,q,k);else if(s.isBuffer(q))q.copy(m,k);else throw new TypeError('"list" argument must be an Array of Buffers');k+=q.length}return m};function C(r,e){if(s.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||T(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var t=r.length,f=arguments.length>2&&arguments[2]===!0;if(!f&&t===0)return 0;for(var m=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return S(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return i(r).length;default:if(m)return f?-1:S(r).length;e=(""+e).toLowerCase(),m=!0}}s.byteLength=C;function g(r,e,t){var f=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return l(this,e,t);case"utf8":case"utf-8":return ae(this,e,t);case"ascii":return oe(this,e,t);case"latin1":case"binary":return fe(this,e,t);case"base64":return ie(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n(this,e,t);default:if(f)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),f=!0}}s.prototype._isBuffer=!0;function y(r,e,t){var f=r[e];r[e]=r[t],r[t]=f}s.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?ae(this,0,e):g.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},I&&(s.prototype[I]=s.prototype.inspect),s.prototype.compare=function(e,t,f,m,k){if(T(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),f===void 0&&(f=e?e.length:0),m===void 0&&(m=0),k===void 0&&(k=this.length),t<0||f>e.length||m<0||k>this.length)throw new RangeError("out of range index");if(m>=k&&t>=f)return 0;if(m>=k)return-1;if(t>=f)return 1;if(t>>>=0,f>>>=0,m>>>=0,k>>>=0,this===e)return 0;for(var q=k-m,$=f-t,X=Math.min(q,$),ee=this.slice(m,k),re=e.slice(t,f),Q=0;Q<X;++Q)if(ee[Q]!==re[Q]){q=ee[Q],$=re[Q];break}return q<$?-1:$<q?1:0};function R(r,e,t,f,m){if(r.length===0)return-1;if(typeof t=="string"?(f=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Y(t)&&(t=m?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(m)return-1;t=r.length-1}else if(t<0)if(m)t=0;else return-1;if(typeof e=="string"&&(e=s.from(e,f)),s.isBuffer(e))return e.length===0?-1:V(r,e,t,f,m);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?m?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):V(r,[e],t,f,m);throw new TypeError("val must be string, number or Buffer")}function V(r,e,t,f,m){var k=1,q=r.length,$=e.length;if(f!==void 0&&(f=String(f).toLowerCase(),f==="ucs2"||f==="ucs-2"||f==="utf16le"||f==="utf-16le")){if(r.length<2||e.length<2)return-1;k=2,q/=2,$/=2,t/=2}function X(He,Ge){return k===1?He[Ge]:He.readUInt16BE(Ge*k)}var ee;if(m){var re=-1;for(ee=t;ee<q;ee++)if(X(r,ee)===X(e,re===-1?0:ee-re)){if(re===-1&&(re=ee),ee-re+1===$)return re*k}else re!==-1&&(ee-=ee-re),re=-1}else for(t+$>q&&(t=q-$),ee=t;ee>=0;ee--){for(var Q=!0,se=0;se<$;se++)if(X(r,ee+se)!==X(e,se)){Q=!1;break}if(Q)return ee}return-1}s.prototype.includes=function(e,t,f){return this.indexOf(e,t,f)!==-1},s.prototype.indexOf=function(e,t,f){return R(this,e,t,f,!0)},s.prototype.lastIndexOf=function(e,t,f){return R(this,e,t,f,!1)};function H(r,e,t,f){t=Number(t)||0;var m=r.length-t;f?(f=Number(f),f>m&&(f=m)):f=m;var k=e.length;f>k/2&&(f=k/2);for(var q=0;q<f;++q){var $=parseInt(e.substr(q*2,2),16);if(Y($))return q;r[t+q]=$}return q}function z(r,e,t,f){return o(S(e,r.length-t),r,t,f)}function J(r,e,t,f){return o(G(e),r,t,f)}function te(r,e,t,f){return o(i(e),r,t,f)}function ne(r,e,t,f){return o(K(e,r.length-t),r,t,f)}s.prototype.write=function(e,t,f,m){if(t===void 0)m="utf8",f=this.length,t=0;else if(f===void 0&&typeof t=="string")m=t,f=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(f)?(f=f>>>0,m===void 0&&(m="utf8")):(m=f,f=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var k=this.length-t;if((f===void 0||f>k)&&(f=k),e.length>0&&(f<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");m||(m="utf8");for(var q=!1;;)switch(m){case"hex":return H(this,e,t,f);case"utf8":case"utf-8":return z(this,e,t,f);case"ascii":case"latin1":case"binary":return J(this,e,t,f);case"base64":return te(this,e,t,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,e,t,f);default:if(q)throw new TypeError("Unknown encoding: "+m);m=(""+m).toLowerCase(),q=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ie(r,e,t){return e===0&&t===r.length?x.fromByteArray(r):x.fromByteArray(r.slice(e,t))}function ae(r,e,t){t=Math.min(r.length,t);for(var f=[],m=e;m<t;){var k=r[m],q=null,$=k>239?4:k>223?3:k>191?2:1;if(m+$<=t){var X,ee,re,Q;switch($){case 1:k<128&&(q=k);break;case 2:X=r[m+1],(X&192)===128&&(Q=(k&31)<<6|X&63,Q>127&&(q=Q));break;case 3:X=r[m+1],ee=r[m+2],(X&192)===128&&(ee&192)===128&&(Q=(k&15)<<12|(X&63)<<6|ee&63,Q>2047&&(Q<55296||Q>57343)&&(q=Q));break;case 4:X=r[m+1],ee=r[m+2],re=r[m+3],(X&192)===128&&(ee&192)===128&&(re&192)===128&&(Q=(k&15)<<18|(X&63)<<12|(ee&63)<<6|re&63,Q>65535&&Q<1114112&&(q=Q))}}q===null?(q=65533,$=1):q>65535&&(q-=65536,f.push(q>>>10&1023|55296),q=56320|q&1023),f.push(q),m+=$}return le(f)}var ue=4096;function le(r){var e=r.length;if(e<=ue)return String.fromCharCode.apply(String,r);for(var t="",f=0;f<e;)t+=String.fromCharCode.apply(String,r.slice(f,f+=ue));return t}function oe(r,e,t){var f="";t=Math.min(r.length,t);for(var m=e;m<t;++m)f+=String.fromCharCode(r[m]&127);return f}function fe(r,e,t){var f="";t=Math.min(r.length,t);for(var m=e;m<t;++m)f+=String.fromCharCode(r[m]);return f}function l(r,e,t){var f=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>f)&&(t=f);for(var m="",k=e;k<t;++k)m+=Z[r[k]];return m}function n(r,e,t){for(var f=r.slice(e,t),m="",k=0;k<f.length-1;k+=2)m+=String.fromCharCode(f[k]+f[k+1]*256);return m}s.prototype.slice=function(e,t){var f=this.length;e=~~e,t=t===void 0?f:~~t,e<0?(e+=f,e<0&&(e=0)):e>f&&(e=f),t<0?(t+=f,t<0&&(t=0)):t>f&&(t=f),t<e&&(t=e);var m=this.subarray(e,t);return Object.setPrototypeOf(m,s.prototype),m};function h(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,f){e=e>>>0,t=t>>>0,f||h(e,t,this.length);for(var m=this[e],k=1,q=0;++q<t&&(k*=256);)m+=this[e+q]*k;return m},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,f){e=e>>>0,t=t>>>0,f||h(e,t,this.length);for(var m=this[e+--t],k=1;t>0&&(k*=256);)m+=this[e+--t]*k;return m},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e=e>>>0,t||h(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||h(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||h(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||h(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||h(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,f){e=e>>>0,t=t>>>0,f||h(e,t,this.length);for(var m=this[e],k=1,q=0;++q<t&&(k*=256);)m+=this[e+q]*k;return k*=128,m>=k&&(m-=Math.pow(2,8*t)),m},s.prototype.readIntBE=function(e,t,f){e=e>>>0,t=t>>>0,f||h(e,t,this.length);for(var m=t,k=1,q=this[e+--m];m>0&&(k*=256);)q+=this[e+--m]*k;return k*=128,q>=k&&(q-=Math.pow(2,8*t)),q},s.prototype.readInt8=function(e,t){return e=e>>>0,t||h(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e=e>>>0,t||h(e,2,this.length);var f=this[e]|this[e+1]<<8;return f&32768?f|4294901760:f},s.prototype.readInt16BE=function(e,t){e=e>>>0,t||h(e,2,this.length);var f=this[e+1]|this[e]<<8;return f&32768?f|4294901760:f},s.prototype.readInt32LE=function(e,t){return e=e>>>0,t||h(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e=e>>>0,t||h(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e=e>>>0,t||h(e,4,this.length),A.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e=e>>>0,t||h(e,4,this.length),A.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||h(e,8,this.length),A.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||h(e,8,this.length),A.read(this,e,!1,52,8)};function u(r,e,t,f,m,k){if(!s.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>m||e<k)throw new RangeError('"value" argument is out of bounds');if(t+f>r.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,f,m){if(e=+e,t=t>>>0,f=f>>>0,!m){var k=Math.pow(2,8*f)-1;u(this,e,t,f,k,0)}var q=1,$=0;for(this[t]=e&255;++$<f&&(q*=256);)this[t+$]=e/q&255;return t+f},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,f,m){if(e=+e,t=t>>>0,f=f>>>0,!m){var k=Math.pow(2,8*f)-1;u(this,e,t,f,k,0)}var q=f-1,$=1;for(this[t+q]=e&255;--q>=0&&($*=256);)this[t+q]=e/$&255;return t+f},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeIntLE=function(e,t,f,m){if(e=+e,t=t>>>0,!m){var k=Math.pow(2,8*f-1);u(this,e,t,f,k-1,-k)}var q=0,$=1,X=0;for(this[t]=e&255;++q<f&&($*=256);)e<0&&X===0&&this[t+q-1]!==0&&(X=1),this[t+q]=(e/$>>0)-X&255;return t+f},s.prototype.writeIntBE=function(e,t,f,m){if(e=+e,t=t>>>0,!m){var k=Math.pow(2,8*f-1);u(this,e,t,f,k-1,-k)}var q=f-1,$=1,X=0;for(this[t+q]=e&255;--q>=0&&($*=256);)e<0&&X===0&&this[t+q+1]!==0&&(X=1),this[t+q]=(e/$>>0)-X&255;return t+f},s.prototype.writeInt8=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function d(r,e,t,f,m,k){if(t+f>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function w(r,e,t,f,m){return e=+e,t=t>>>0,m||d(r,e,t,4),A.write(r,e,t,f,23,4),t+4}s.prototype.writeFloatLE=function(e,t,f){return w(this,e,t,!0,f)},s.prototype.writeFloatBE=function(e,t,f){return w(this,e,t,!1,f)};function B(r,e,t,f,m){return e=+e,t=t>>>0,m||d(r,e,t,8),A.write(r,e,t,f,52,8),t+8}s.prototype.writeDoubleLE=function(e,t,f){return B(this,e,t,!0,f)},s.prototype.writeDoubleBE=function(e,t,f){return B(this,e,t,!1,f)},s.prototype.copy=function(e,t,f,m){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(f||(f=0),!m&&m!==0&&(m=this.length),t>=e.length&&(t=e.length),t||(t=0),m>0&&m<f&&(m=f),m===f||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(f<0||f>=this.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("sourceEnd out of bounds");m>this.length&&(m=this.length),e.length-t<m-f&&(m=e.length-t+f);var k=m-f;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,f,m):Uint8Array.prototype.set.call(e,this.subarray(f,m),t),k},s.prototype.fill=function(e,t,f,m){if(typeof e=="string"){if(typeof t=="string"?(m=t,t=0,f=this.length):typeof f=="string"&&(m=f,f=this.length),m!==void 0&&typeof m!="string")throw new TypeError("encoding must be a string");if(typeof m=="string"&&!s.isEncoding(m))throw new TypeError("Unknown encoding: "+m);if(e.length===1){var k=e.charCodeAt(0);(m==="utf8"&&k<128||m==="latin1")&&(e=k)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<f)throw new RangeError("Out of range index");if(f<=t)return this;t=t>>>0,f=f===void 0?this.length:f>>>0,e||(e=0);var q;if(typeof e=="number")for(q=t;q<f;++q)this[q]=e;else{var $=s.isBuffer(e)?e:s.from(e,m),X=$.length;if(X===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(q=0;q<f-t;++q)this[q+t]=$[q%X]}return this};var c=/[^+/0-9A-Za-z-_]/g;function a(r){if(r=r.split("=")[0],r=r.trim().replace(c,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function S(r,e){e=e||1/0;for(var t,f=r.length,m=null,k=[],q=0;q<f;++q){if(t=r.charCodeAt(q),t>55295&&t<57344){if(!m){if(t>56319){(e-=3)>-1&&k.push(239,191,189);continue}else if(q+1===f){(e-=3)>-1&&k.push(239,191,189);continue}m=t;continue}if(t<56320){(e-=3)>-1&&k.push(239,191,189),m=t;continue}t=(m-55296<<10|t-56320)+65536}else m&&(e-=3)>-1&&k.push(239,191,189);if(m=null,t<128){if((e-=1)<0)break;k.push(t)}else if(t<2048){if((e-=2)<0)break;k.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;k.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;k.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return k}function G(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function K(r,e){for(var t,f,m,k=[],q=0;q<r.length&&!((e-=2)<0);++q)t=r.charCodeAt(q),f=t>>8,m=t%256,k.push(m),k.push(f);return k}function i(r){return x.toByteArray(a(r))}function o(r,e,t,f){for(var m=0;m<f&&!(m+t>=e.length||m>=r.length);++m)e[m+t]=r[m];return m}function T(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function Y(r){return r!==r}var Z=function(){for(var r="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var f=t*16,m=0;m<16;++m)e[f+m]=r[t]+r[m];return e}()}(xe)),xe}var Re,Ze;function Ot(){if(Ze)return Re;Ze=1;function F(L,j){var P=Object.keys(L);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(L);j&&(p=p.filter(function(_){return Object.getOwnPropertyDescriptor(L,_).enumerable})),P.push.apply(P,p)}return P}function x(L){for(var j=1;j<arguments.length;j++){var P=arguments[j]!=null?arguments[j]:{};j%2?F(Object(P),!0).forEach(function(p){A(L,p,P[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(L,Object.getOwnPropertyDescriptors(P)):F(Object(P)).forEach(function(p){Object.defineProperty(L,p,Object.getOwnPropertyDescriptor(P,p))})}return L}function A(L,j,P){return j=b(j),j in L?Object.defineProperty(L,j,{value:P,enumerable:!0,configurable:!0,writable:!0}):L[j]=P,L}function I(L,j){if(!(L instanceof j))throw new TypeError("Cannot call a class as a function")}function D(L,j){for(var P=0;P<j.length;P++){var p=j[P];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,b(p.key),p)}}function v(L,j,P){return j&&D(L.prototype,j),Object.defineProperty(L,"prototype",{writable:!1}),L}function b(L){var j=s(L,"string");return typeof j=="symbol"?j:String(j)}function s(L,j){if(typeof L!="object"||L===null)return L;var P=L[Symbol.toPrimitive];if(P!==void 0){var p=P.call(L,j);if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(L)}var E=Ee(),U=E.Buffer,W=yt,O=W.inspect,N=O&&O.custom||"inspect";function M(L,j,P){U.prototype.copy.call(L,j,P)}return Re=function(){function L(){I(this,L),this.head=null,this.tail=null,this.length=0}return v(L,[{key:"push",value:function(P){var p={data:P,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(P){var p={data:P,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var P=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,P}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(P){if(this.length===0)return"";for(var p=this.head,_=""+p.data;p=p.next;)_+=P+p.data;return _}},{key:"concat",value:function(P){if(this.length===0)return U.alloc(0);for(var p=U.allocUnsafe(P>>>0),_=this.head,C=0;_;)M(_.data,p,C),C+=_.data.length,_=_.next;return p}},{key:"consume",value:function(P,p){var _;return P<this.head.data.length?(_=this.head.data.slice(0,P),this.head.data=this.head.data.slice(P)):P===this.head.data.length?_=this.shift():_=p?this._getString(P):this._getBuffer(P),_}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(P){var p=this.head,_=1,C=p.data;for(P-=C.length;p=p.next;){var g=p.data,y=P>g.length?g.length:P;if(y===g.length?C+=g:C+=g.slice(0,P),P-=y,P===0){y===g.length?(++_,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=g.slice(y));break}++_}return this.length-=_,C}},{key:"_getBuffer",value:function(P){var p=U.allocUnsafe(P),_=this.head,C=1;for(_.data.copy(p),P-=_.data.length;_=_.next;){var g=_.data,y=P>g.length?g.length:P;if(g.copy(p,p.length-P,0,y),P-=y,P===0){y===g.length?(++C,_.next?this.head=_.next:this.head=this.tail=null):(this.head=_,_.data=g.slice(y));break}++C}return this.length-=C,p}},{key:N,value:function(P,p){return O(this,x(x({},p),{},{depth:0,customInspect:!1}))}}]),L}(),Re}var ke,Xe;function wt(){if(Xe)return ke;Xe=1;function F(b,s){var E=this,U=this._readableState&&this._readableState.destroyed,W=this._writableState&&this._writableState.destroyed;return U||W?(s?s(b):b&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(D,this,b)):process.nextTick(D,this,b)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(b||null,function(O){!s&&O?E._writableState?E._writableState.errorEmitted?process.nextTick(A,E):(E._writableState.errorEmitted=!0,process.nextTick(x,E,O)):process.nextTick(x,E,O):s?(process.nextTick(A,E),s(O)):process.nextTick(A,E)}),this)}function x(b,s){D(b,s),A(b)}function A(b){b._writableState&&!b._writableState.emitClose||b._readableState&&!b._readableState.emitClose||b.emit("close")}function I(){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 D(b,s){b.emit("error",s)}function v(b,s){var E=b._readableState,U=b._writableState;E&&E.autoDestroy||U&&U.autoDestroy?b.destroy(s):b.emit("error",s)}return ke={destroy:F,undestroy:I,errorOrDestroy:v},ke}var Ae={},Qe;function ye(){if(Qe)return Ae;Qe=1;function F(s,E){s.prototype=Object.create(E.prototype),s.prototype.constructor=s,s.__proto__=E}var x={};function A(s,E,U){U||(U=Error);function W(N,M,L){return typeof E=="string"?E:E(N,M,L)}var O=function(N){F(M,N);function M(L,j,P){return N.call(this,W(L,j,P))||this}return M}(U);O.prototype.name=U.name,O.prototype.code=s,x[s]=O}function I(s,E){if(Array.isArray(s)){var U=s.length;return s=s.map(function(W){return String(W)}),U>2?"one of ".concat(E," ").concat(s.slice(0,U-1).join(", "),", or ")+s[U-1]:U===2?"one of ".concat(E," ").concat(s[0]," or ").concat(s[1]):"of ".concat(E," ").concat(s[0])}else return"of ".concat(E," ").concat(String(s))}function D(s,E,U){return s.substr(0,E.length)===E}function v(s,E,U){return(U===void 0||U>s.length)&&(U=s.length),s.substring(U-E.length,U)===E}function b(s,E,U){return typeof U!="number"&&(U=0),U+E.length>s.length?!1:s.indexOf(E,U)!==-1}return A("ERR_INVALID_OPT_VALUE",function(s,E){return'The value "'+E+'" is invalid for option "'+s+'"'},TypeError),A("ERR_INVALID_ARG_TYPE",function(s,E,U){var W;typeof E=="string"&&D(E,"not ")?(W="must not be",E=E.replace(/^not /,"")):W="must be";var O;if(v(s," argument"))O="The ".concat(s," ").concat(W," ").concat(I(E,"type"));else{var N=b(s,".")?"property":"argument";O='The "'.concat(s,'" ').concat(N," ").concat(W," ").concat(I(E,"type"))}return O+=". Received type ".concat(typeof U),O},TypeError),A("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),A("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),A("ERR_STREAM_PREMATURE_CLOSE","Premature close"),A("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),A("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),A("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),A("ERR_STREAM_WRITE_AFTER_END","write after end"),A("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),A("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),A("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ae.codes=x,Ae}var Te,et;function bt(){if(et)return Te;et=1;var F=ye().codes.ERR_INVALID_OPT_VALUE;function x(I,D,v){return I.highWaterMark!=null?I.highWaterMark:D?I[v]:null}function A(I,D,v,b){var s=x(D,b,v);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var E=b?v:"highWaterMark";throw new F(E,s)}return Math.floor(s)}return I.objectMode?16:16*1024}return Te={getHighWaterMark:A},Te}var Be,tt;function It(){if(tt)return Be;tt=1,Be=F;function F(A,I){if(x("noDeprecation"))return A;var D=!1;function v(){if(!D){if(x("throwDeprecation"))throw new Error(I);x("traceDeprecation")?console.trace(I):console.warn(I),D=!0}return A.apply(this,arguments)}return v}function x(A){try{if(!he.localStorage)return!1}catch{return!1}var I=he.localStorage[A];return I==null?!1:String(I).toLowerCase()==="true"}return Be}var Le,rt;function Et(){if(rt)return Le;rt=1,Le=H;function F(c){var a=this;this.next=null,this.entry=null,this.finish=function(){B(a,c)}}var x;H.WritableState=R;var A={deprecate:It()},I=mt(),D=Ee().Buffer,v=(typeof he<"u"?he:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function b(c){return D.from(c)}function s(c){return D.isBuffer(c)||c instanceof v}var E=wt(),U=bt(),W=U.getHighWaterMark,O=ye().codes,N=O.ERR_INVALID_ARG_TYPE,M=O.ERR_METHOD_NOT_IMPLEMENTED,L=O.ERR_MULTIPLE_CALLBACK,j=O.ERR_STREAM_CANNOT_PIPE,P=O.ERR_STREAM_DESTROYED,p=O.ERR_STREAM_NULL_VALUES,_=O.ERR_STREAM_WRITE_AFTER_END,C=O.ERR_UNKNOWN_ENCODING,g=E.errorOrDestroy;pe()(H,I);function y(){}function R(c,a,S){x=x||ce(),c=c||{},typeof S!="boolean"&&(S=a instanceof x),this.objectMode=!!c.objectMode,S&&(this.objectMode=this.objectMode||!!c.writableObjectMode),this.highWaterMark=W(this,c,"writableHighWaterMark",S),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var G=c.decodeStrings===!1;this.decodeStrings=!G,this.defaultEncoding=c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(K){le(a,K)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=c.emitClose!==!1,this.autoDestroy=!!c.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new F(this)}R.prototype.getBuffer=function(){for(var a=this.bufferedRequest,S=[];a;)S.push(a),a=a.next;return S},function(){try{Object.defineProperty(R.prototype,"buffer",{get:A.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var V;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(V=Function.prototype[Symbol.hasInstance],Object.defineProperty(H,Symbol.hasInstance,{value:function(a){return V.call(this,a)?!0:this!==H?!1:a&&a._writableState instanceof R}})):V=function(a){return a instanceof this};function H(c){x=x||ce();var a=this instanceof x;if(!a&&!V.call(H,this))return new H(c);this._writableState=new R(c,this,a),this.writable=!0,c&&(typeof c.write=="function"&&(this._write=c.write),typeof c.writev=="function"&&(this._writev=c.writev),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.final=="function"&&(this._final=c.final)),I.call(this)}H.prototype.pipe=function(){g(this,new j)};function z(c,a){var S=new _;g(c,S),process.nextTick(a,S)}function J(c,a,S,G){var K;return S===null?K=new p:typeof S!="string"&&!a.objectMode&&(K=new N("chunk",["string","Buffer"],S)),K?(g(c,K),process.nextTick(G,K),!1):!0}H.prototype.write=function(c,a,S){var G=this._writableState,K=!1,i=!G.objectMode&&s(c);return i&&!D.isBuffer(c)&&(c=b(c)),typeof a=="function"&&(S=a,a=null),i?a="buffer":a||(a=G.defaultEncoding),typeof S!="function"&&(S=y),G.ending?z(this,S):(i||J(this,G,c,S))&&(G.pendingcb++,K=ne(this,G,i,c,a,S)),K},H.prototype.cork=function(){this._writableState.corked++},H.prototype.uncork=function(){var c=this._writableState;c.corked&&(c.corked--,!c.writing&&!c.corked&&!c.bufferProcessing&&c.bufferedRequest&&l(this,c))},H.prototype.setDefaultEncoding=function(a){if(typeof a=="string"&&(a=a.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((a+"").toLowerCase())>-1))throw new C(a);return this._writableState.defaultEncoding=a,this},Object.defineProperty(H.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function te(c,a,S){return!c.objectMode&&c.decodeStrings!==!1&&typeof a=="string"&&(a=D.from(a,S)),a}Object.defineProperty(H.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ne(c,a,S,G,K,i){if(!S){var o=te(a,G,K);G!==o&&(S=!0,K="buffer",G=o)}var T=a.objectMode?1:G.length;a.length+=T;var Y=a.length<a.highWaterMark;if(Y||(a.needDrain=!0),a.writing||a.corked){var Z=a.lastBufferedRequest;a.lastBufferedRequest={chunk:G,encoding:K,isBuf:S,callback:i,next:null},Z?Z.next=a.lastBufferedRequest:a.bufferedRequest=a.lastBufferedRequest,a.bufferedRequestCount+=1}else ie(c,a,!1,T,G,K,i);return Y}function ie(c,a,S,G,K,i,o){a.writelen=G,a.writecb=o,a.writing=!0,a.sync=!0,a.destroyed?a.onwrite(new P("write")):S?c._writev(K,a.onwrite):c._write(K,i,a.onwrite),a.sync=!1}function ae(c,a,S,G,K){--a.pendingcb,S?(process.nextTick(K,G),process.nextTick(d,c,a),c._writableState.errorEmitted=!0,g(c,G)):(K(G),c._writableState.errorEmitted=!0,g(c,G),d(c,a))}function ue(c){c.writing=!1,c.writecb=null,c.length-=c.writelen,c.writelen=0}function le(c,a){var S=c._writableState,G=S.sync,K=S.writecb;if(typeof K!="function")throw new L;if(ue(S),a)ae(c,S,G,a,K);else{var i=n(S)||c.destroyed;!i&&!S.corked&&!S.bufferProcessing&&S.bufferedRequest&&l(c,S),G?process.nextTick(oe,c,S,i,K):oe(c,S,i,K)}}function oe(c,a,S,G){S||fe(c,a),a.pendingcb--,G(),d(c,a)}function fe(c,a){a.length===0&&a.needDrain&&(a.needDrain=!1,c.emit("drain"))}function l(c,a){a.bufferProcessing=!0;var S=a.bufferedRequest;if(c._writev&&S&&S.next){var G=a.bufferedRequestCount,K=new Array(G),i=a.corkedRequestsFree;i.entry=S;for(var o=0,T=!0;S;)K[o]=S,S.isBuf||(T=!1),S=S.next,o+=1;K.allBuffers=T,ie(c,a,!0,a.length,K,"",i.finish),a.pendingcb++,a.lastBufferedRequest=null,i.next?(a.corkedRequestsFree=i.next,i.next=null):a.corkedRequestsFree=new F(a),a.bufferedRequestCount=0}else{for(;S;){var Y=S.chunk,Z=S.encoding,r=S.callback,e=a.objectMode?1:Y.length;if(ie(c,a,!1,e,Y,Z,r),S=S.next,a.bufferedRequestCount--,a.writing)break}S===null&&(a.lastBufferedRequest=null)}a.bufferedRequest=S,a.bufferProcessing=!1}H.prototype._write=function(c,a,S){S(new M("_write()"))},H.prototype._writev=null,H.prototype.end=function(c,a,S){var G=this._writableState;return typeof c=="function"?(S=c,c=null,a=null):typeof a=="function"&&(S=a,a=null),c!=null&&this.write(c,a),G.corked&&(G.corked=1,this.uncork()),G.ending||w(this,G,S),this},Object.defineProperty(H.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function n(c){return c.ending&&c.length===0&&c.bufferedRequest===null&&!c.finished&&!c.writing}function h(c,a){c._final(function(S){a.pendingcb--,S&&g(c,S),a.prefinished=!0,c.emit("prefinish"),d(c,a)})}function u(c,a){!a.prefinished&&!a.finalCalled&&(typeof c._final=="function"&&!a.destroyed?(a.pendingcb++,a.finalCalled=!0,process.nextTick(h,c,a)):(a.prefinished=!0,c.emit("prefinish")))}function d(c,a){var S=n(a);if(S&&(u(c,a),a.pendingcb===0&&(a.finished=!0,c.emit("finish"),a.autoDestroy))){var G=c._readableState;(!G||G.autoDestroy&&G.endEmitted)&&c.destroy()}return S}function w(c,a,S){a.ending=!0,d(c,a),S&&(a.finished?process.nextTick(S):c.once("finish",S)),a.ended=!0,c.writable=!1}function B(c,a,S){var G=c.entry;for(c.entry=null;G;){var K=G.callback;a.pendingcb--,K(S),G=G.next}a.corkedRequestsFree.next=c}return Object.defineProperty(H.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(a){this._writableState&&(this._writableState.destroyed=a)}}),H.prototype.destroy=E.destroy,H.prototype._undestroy=E.undestroy,H.prototype._destroy=function(c,a){a(c)},Le}var Ce,nt;function ce(){if(nt)return Ce;nt=1;var F=Object.keys||function(U){var W=[];for(var O in U)W.push(O);return W};Ce=b;var x=_t(),A=Et();pe()(b,x);for(var I=F(A.prototype),D=0;D<I.length;D++){var v=I[D];b.prototype[v]||(b.prototype[v]=A.prototype[v])}function b(U){if(!(this instanceof b))return new b(U);x.call(this,U),A.call(this,U),this.allowHalfOpen=!0,U&&(U.readable===!1&&(this.readable=!1),U.writable===!1&&(this.writable=!1),U.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",s)))}Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(b.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(b.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function s(){this._writableState.ended||process.nextTick(E,this)}function E(U){U.end()}return Object.defineProperty(b.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(W){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=W,this._writableState.destroyed=W)}}),Ce}var Ue={},be={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var it;function Pt(){return it||(it=1,function(F,x){var A=Ee(),I=A.Buffer;function D(b,s){for(var E in b)s[E]=b[E]}I.from&&I.alloc&&I.allocUnsafe&&I.allocUnsafeSlow?F.exports=A:(D(A,x),x.Buffer=v);function v(b,s,E){return I(b,s,E)}v.prototype=Object.create(I.prototype),D(I,v),v.from=function(b,s,E){if(typeof b=="number")throw new TypeError("Argument must not be a number");return I(b,s,E)},v.alloc=function(b,s,E){if(typeof b!="number")throw new TypeError("Argument must be a number");var U=I(b);return s!==void 0?typeof E=="string"?U.fill(s,E):U.fill(s):U.fill(0),U},v.allocUnsafe=function(b){if(typeof b!="number")throw new TypeError("Argument must be a number");return I(b)},v.allocUnsafeSlow=function(b){if(typeof b!="number")throw new TypeError("Argument must be a number");return A.SlowBuffer(b)}}(be,be.exports)),be.exports}var at;function ot(){if(at)return Ue;at=1;var F=Pt().Buffer,x=F.isEncoding||function(p){switch(p=""+p,p&&p.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 A(p){if(!p)return"utf8";for(var _;;)switch(p){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 p;default:if(_)return;p=(""+p).toLowerCase(),_=!0}}function I(p){var _=A(p);if(typeof _!="string"&&(F.isEncoding===x||!x(p)))throw new Error("Unknown encoding: "+p);return _||p}Ue.StringDecoder=D;function D(p){this.encoding=I(p);var _;switch(this.encoding){case"utf16le":this.text=O,this.end=N,_=4;break;case"utf8":this.fillLast=E,_=4;break;case"base64":this.text=M,this.end=L,_=3;break;default:this.write=j,this.end=P;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=F.allocUnsafe(_)}D.prototype.write=function(p){if(p.length===0)return"";var _,C;if(this.lastNeed){if(_=this.fillLast(p),_===void 0)return"";C=this.lastNeed,this.lastNeed=0}else C=0;return C<p.length?_?_+this.text(p,C):this.text(p,C):_||""},D.prototype.end=W,D.prototype.text=U,D.prototype.fillLast=function(p){if(this.lastNeed<=p.length)return p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,p.length),this.lastNeed-=p.length};function v(p){return p<=127?0:p>>5===6?2:p>>4===14?3:p>>3===30?4:p>>6===2?-1:-2}function b(p,_,C){var g=_.length-1;if(g<C)return 0;var y=v(_[g]);return y>=0?(y>0&&(p.lastNeed=y-1),y):--g<C||y===-2?0:(y=v(_[g]),y>=0?(y>0&&(p.lastNeed=y-2),y):--g<C||y===-2?0:(y=v(_[g]),y>=0?(y>0&&(y===2?y=0:p.lastNeed=y-3),y):0))}function s(p,_,C){if((_[0]&192)!==128)return p.lastNeed=0,"<22>";if(p.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return p.lastNeed=1,"<22>";if(p.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return p.lastNeed=2,"<22>"}}function E(p){var _=this.lastTotal-this.lastNeed,C=s(this,p);if(C!==void 0)return C;if(this.lastNeed<=p.length)return p.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,_,0,p.length),this.lastNeed-=p.length}function U(p,_){var C=b(this,p,_);if(!this.lastNeed)return p.toString("utf8",_);this.lastTotal=C;var g=p.length-(C-this.lastNeed);return p.copy(this.lastChar,0,g),p.toString("utf8",_,g)}function W(p){var _=p&&p.length?this.write(p):"";return this.lastNeed?_+"<22>":_}function O(p,_){if((p.length-_)%2===0){var C=p.toString("utf16le",_);if(C){var g=C.charCodeAt(C.length-1);if(g>=55296&&g<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1],C.slice(0,-1)}return C}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=p[p.length-1],p.toString("utf16le",_,p.length-1)}function N(p){var _=p&&p.length?this.write(p):"";if(this.lastNeed){var C=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,C)}return _}function M(p,_){var C=(p.length-_)%3;return C===0?p.toString("base64",_):(this.lastNeed=3-C,this.lastTotal=3,C===1?this.lastChar[0]=p[p.length-1]:(this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1]),p.toString("base64",_,p.length-C))}function L(p){var _=p&&p.length?this.write(p):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function j(p){return p.toString(this.encoding)}function P(p){return p&&p.length?this.write(p):""}return Ue}var Me,st;function We(){if(st)return Me;st=1;var F=ye().codes.ERR_STREAM_PREMATURE_CLOSE;function x(v){var b=!1;return function(){if(!b){b=!0;for(var s=arguments.length,E=new Array(s),U=0;U<s;U++)E[U]=arguments[U];v.apply(this,E)}}}function A(){}function I(v){return v.setHeader&&typeof v.abort=="function"}function D(v,b,s){if(typeof b=="function")return D(v,null,b);b||(b={}),s=x(s||A);var E=b.readable||b.readable!==!1&&v.readable,U=b.writable||b.writable!==!1&&v.writable,W=function(){v.writable||N()},O=v._writableState&&v._writableState.finished,N=function(){U=!1,O=!0,E||s.call(v)},M=v._readableState&&v._readableState.endEmitted,L=function(){E=!1,M=!0,U||s.call(v)},j=function(C){s.call(v,C)},P=function(){var C;if(E&&!M)return(!v._readableState||!v._readableState.ended)&&(C=new F),s.call(v,C);if(U&&!O)return(!v._writableState||!v._writableState.ended)&&(C=new F),s.call(v,C)},p=function(){v.req.on("finish",N)};return I(v)?(v.on("complete",N),v.on("abort",P),v.req?p():v.on("request",p)):U&&!v._writableState&&(v.on("end",W),v.on("close",W)),v.on("end",L),v.on("finish",N),b.error!==!1&&v.on("error",j),v.on("close",P),function(){v.removeListener("complete",N),v.removeListener("abort",P),v.removeListener("request",p),v.req&&v.req.removeListener("finish",N),v.removeListener("end",W),v.removeListener("close",W),v.removeListener("finish",N),v.removeListener("end",L),v.removeListener("error",j),v.removeListener("close",P)}}return Me=D,Me}var De,ut;function Nt(){if(ut)return De;ut=1;var F;function x(C,g,y){return g=A(g),g in C?Object.defineProperty(C,g,{value:y,enumerable:!0,configurable:!0,writable:!0}):C[g]=y,C}function A(C){var g=I(C,"string");return typeof g=="symbol"?g:String(g)}function I(C,g){if(typeof C!="object"||C===null)return C;var y=C[Symbol.toPrimitive];if(y!==void 0){var R=y.call(C,g);if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(C)}var D=We(),v=Symbol("lastResolve"),b=Symbol("lastReject"),s=Symbol("error"),E=Symbol("ended"),U=Symbol("lastPromise"),W=Symbol("handlePromise"),O=Symbol("stream");function N(C,g){return{value:C,done:g}}function M(C){var g=C[v];if(g!==null){var y=C[O].read();y!==null&&(C[U]=null,C[v]=null,C[b]=null,g(N(y,!1)))}}function L(C){process.nextTick(M,C)}function j(C,g){return function(y,R){C.then(function(){if(g[E]){y(N(void 0,!0));return}g[W](y,R)},R)}}var P=Object.getPrototypeOf(function(){}),p=Object.setPrototypeOf((F={get stream(){return this[O]},next:function(){var g=this,y=this[s];if(y!==null)return Promise.reject(y);if(this[E])return Promise.resolve(N(void 0,!0));if(this[O].destroyed)return new Promise(function(z,J){process.nextTick(function(){g[s]?J(g[s]):z(N(void 0,!0))})});var R=this[U],V;if(R)V=new Promise(j(R,this));else{var H=this[O].read();if(H!==null)return Promise.resolve(N(H,!1));V=new Promise(this[W])}return this[U]=V,V}},x(F,Symbol.asyncIterator,function(){return this}),x(F,"return",function(){var g=this;return new Promise(function(y,R){g[O].destroy(null,function(V){if(V){R(V);return}y(N(void 0,!0))})})}),F),P),_=function(g){var y,R=Object.create(p,(y={},x(y,O,{value:g,writable:!0}),x(y,v,{value:null,writable:!0}),x(y,b,{value:null,writable:!0}),x(y,s,{value:null,writable:!0}),x(y,E,{value:g._readableState.endEmitted,writable:!0}),x(y,W,{value:function(H,z){var J=R[O].read();J?(R[U]=null,R[v]=null,R[b]=null,H(N(J,!1))):(R[v]=H,R[b]=z)},writable:!0}),y));return R[U]=null,D(g,function(V){if(V&&V.code!=="ERR_STREAM_PREMATURE_CLOSE"){var H=R[b];H!==null&&(R[U]=null,R[v]=null,R[b]=null,H(V)),R[s]=V;return}var z=R[v];z!==null&&(R[U]=null,R[v]=null,R[b]=null,z(N(void 0,!0))),R[E]=!0}),g.on("readable",L.bind(null,R)),R};return De=_,De}var Fe,ft;function jt(){return ft||(ft=1,Fe=function(){throw new Error("Readable.from is not available in the browser")}),Fe}var Oe,lt;function _t(){if(lt)return Oe;lt=1,Oe=z;var F;z.ReadableState=H,qe().EventEmitter;var x=function(o,T){return o.listeners(T).length},A=mt(),I=Ee().Buffer,D=(typeof he<"u"?he:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function v(i){return I.from(i)}function b(i){return I.isBuffer(i)||i instanceof D}var s=yt,E;s&&s.debuglog?E=s.debuglog("stream"):E=function(){};var U=Ot(),W=wt(),O=bt(),N=O.getHighWaterMark,M=ye().codes,L=M.ERR_INVALID_ARG_TYPE,j=M.ERR_STREAM_PUSH_AFTER_EOF,P=M.ERR_METHOD_NOT_IMPLEMENTED,p=M.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,_,C,g;pe()(z,A);var y=W.errorOrDestroy,R=["error","close","destroy","pause","resume"];function V(i,o,T){if(typeof i.prependListener=="function")return i.prependListener(o,T);!i._events||!i._events[o]?i.on(o,T):Array.isArray(i._events[o])?i._events[o].unshift(T):i._events[o]=[T,i._events[o]]}function H(i,o,T){F=F||ce(),i=i||{},typeof T!="boolean"&&(T=o instanceof F),this.objectMode=!!i.objectMode,T&&(this.objectMode=this.objectMode||!!i.readableObjectMode),this.highWaterMark=N(this,i,"readableHighWaterMark",T),this.buffer=new U,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=i.emitClose!==!1,this.autoDestroy=!!i.autoDestroy,this.destroyed=!1,this.defaultEncoding=i.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,i.encoding&&(_||(_=ot().StringDecoder),this.decoder=new _(i.encoding),this.encoding=i.encoding)}function z(i){if(F=F||ce(),!(this instanceof z))return new z(i);var o=this instanceof F;this._readableState=new H(i,this,o),this.readable=!0,i&&(typeof i.read=="function"&&(this._read=i.read),typeof i.destroy=="function"&&(this._destroy=i.destroy)),A.call(this)}Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(o){this._readableState&&(this._readableState.destroyed=o)}}),z.prototype.destroy=W.destroy,z.prototype._undestroy=W.undestroy,z.prototype._destroy=function(i,o){o(i)},z.prototype.push=function(i,o){var T=this._readableState,Y;return T.objectMode?Y=!0:typeof i=="string"&&(o=o||T.defaultEncoding,o!==T.encoding&&(i=I.from(i,o),o=""),Y=!0),J(this,i,o,!1,Y)},z.prototype.unshift=function(i){return J(this,i,null,!0,!1)};function J(i,o,T,Y,Z){E("readableAddChunk",o);var r=i._readableState;if(o===null)r.reading=!1,le(i,r);else{var e;if(Z||(e=ne(r,o)),e)y(i,e);else if(r.objectMode||o&&o.length>0)if(typeof o!="string"&&!r.objectMode&&Object.getPrototypeOf(o)!==I.prototype&&(o=v(o)),Y)r.endEmitted?y(i,new p):te(i,r,o,!0);else if(r.ended)y(i,new j);else{if(r.destroyed)return!1;r.reading=!1,r.decoder&&!T?(o=r.decoder.write(o),r.objectMode||o.length!==0?te(i,r,o,!1):l(i,r)):te(i,r,o,!1)}else Y||(r.reading=!1,l(i,r))}return!r.ended&&(r.length<r.highWaterMark||r.length===0)}function te(i,o,T,Y){o.flowing&&o.length===0&&!o.sync?(o.awaitDrain=0,i.emit("data",T)):(o.length+=o.objectMode?1:T.length,Y?o.buffer.unshift(T):o.buffer.push(T),o.needReadable&&oe(i)),l(i,o)}function ne(i,o){var T;return!b(o)&&typeof o!="string"&&o!==void 0&&!i.objectMode&&(T=new L("chunk",["string","Buffer","Uint8Array"],o)),T}z.prototype.isPaused=function(){return this._readableState.flowing===!1},z.prototype.setEncoding=function(i){_||(_=ot().StringDecoder);var o=new _(i);this._readableState.decoder=o,this._readableState.encoding=this._readableState.decoder.encoding;for(var T=this._readableState.buffer.head,Y="";T!==null;)Y+=o.write(T.data),T=T.next;return this._readableState.buffer.clear(),Y!==""&&this._readableState.buffer.push(Y),this._readableState.length=Y.length,this};var ie=1073741824;function ae(i){return i>=ie?i=ie:(i--,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i++),i}function ue(i,o){return i<=0||o.length===0&&o.ended?0:o.objectMode?1:i!==i?o.flowing&&o.length?o.buffer.head.data.length:o.length:(i>o.highWaterMark&&(o.highWaterMark=ae(i)),i<=o.length?i:o.ended?o.length:(o.needReadable=!0,0))}z.prototype.read=function(i){E("read",i),i=parseInt(i,10);var o=this._readableState,T=i;if(i!==0&&(o.emittedReadable=!1),i===0&&o.needReadable&&((o.highWaterMark!==0?o.length>=o.highWaterMark:o.length>0)||o.ended))return E("read: emitReadable",o.length,o.ended),o.length===0&&o.ended?S(this):oe(this),null;if(i=ue(i,o),i===0&&o.ended)return o.length===0&&S(this),null;var Y=o.needReadable;E("need readable",Y),(o.length===0||o.length-i<o.highWaterMark)&&(Y=!0,E("length less than watermark",Y)),o.ended||o.reading?(Y=!1,E("reading or ended",Y)):Y&&(E("do read"),o.reading=!0,o.sync=!0,o.length===0&&(o.needReadable=!0),this._read(o.highWaterMark),o.sync=!1,o.reading||(i=ue(T,o)));var Z;return i>0?Z=a(i,o):Z=null,Z===null?(o.needReadable=o.length<=o.highWaterMark,i=0):(o.length-=i,o.awaitDrain=0),o.length===0&&(o.ended||(o.needReadable=!0),T!==i&&o.ended&&S(this)),Z!==null&&this.emit("data",Z),Z};function le(i,o){if(E("onEofChunk"),!o.ended){if(o.decoder){var T=o.decoder.end();T&&T.length&&(o.buffer.push(T),o.length+=o.objectMode?1:T.length)}o.ended=!0,o.sync?oe(i):(o.needReadable=!1,o.emittedReadable||(o.emittedReadable=!0,fe(i)))}}function oe(i){var o=i._readableState;E("emitReadable",o.needReadable,o.emittedReadable),o.needReadable=!1,o.emittedReadable||(E("emitReadable",o.flowing),o.emittedReadable=!0,process.nextTick(fe,i))}function fe(i){var o=i._readableState;E("emitReadable_",o.destroyed,o.length,o.ended),!o.destroyed&&(o.length||o.ended)&&(i.emit("readable"),o.emittedReadable=!1),o.needReadable=!o.flowing&&!o.ended&&o.length<=o.highWaterMark,c(i)}function l(i,o){o.readingMore||(o.readingMore=!0,process.nextTick(n,i,o))}function n(i,o){for(;!o.reading&&!o.ended&&(o.length<o.highWaterMark||o.flowing&&o.length===0);){var T=o.length;if(E("maybeReadMore read 0"),i.read(0),T===o.length)break}o.readingMore=!1}z.prototype._read=function(i){y(this,new P("_read()"))},z.prototype.pipe=function(i,o){var T=this,Y=this._readableState;switch(Y.pipesCount){case 0:Y.pipes=i;break;case 1:Y.pipes=[Y.pipes,i];break;default:Y.pipes.push(i);break}Y.pipesCount+=1,E("pipe count=%d opts=%j",Y.pipesCount,o);var Z=(!o||o.end!==!1)&&i!==process.stdout&&i!==process.stderr,r=Z?t:re;Y.endEmitted?process.nextTick(r):T.once("end",r),i.on("unpipe",e);function e(Q,se){E("onunpipe"),Q===T&&se&&se.hasUnpiped===!1&&(se.hasUnpiped=!0,k())}function t(){E("onend"),i.end()}var f=h(T);i.on("drain",f);var m=!1;function k(){E("cleanup"),i.removeListener("close",X),i.removeListener("finish",ee),i.removeListener("drain",f),i.removeListener("error",$),i.removeListener("unpipe",e),T.removeListener("end",t),T.removeListener("end",re),T.removeListener("data",q),m=!0,Y.awaitDrain&&(!i._writableState||i._writableState.needDrain)&&f()}T.on("data",q);function q(Q){E("ondata");var se=i.write(Q);E("dest.write",se),se===!1&&((Y.pipesCount===1&&Y.pipes===i||Y.pipesCount>1&&K(Y.pipes,i)!==-1)&&!m&&(E("false write response, pause",Y.awaitDrain),Y.awaitDrain++),T.pause())}function $(Q){E("onerror",Q),re(),i.removeListener("error",$),x(i,"error")===0&&y(i,Q)}V(i,"error",$);function X(){i.removeListener("finish",ee),re()}i.once("close",X);function ee(){E("onfinish"),i.removeListener("close",X),re()}i.once("finish",ee);function re(){E("unpipe"),T.unpipe(i)}return i.emit("pipe",T),Y.flowing||(E("pipe resume"),T.resume()),i};function h(i){return function(){var T=i._readableState;E("pipeOnDrain",T.awaitDrain),T.awaitDrain&&T.awaitDrain--,T.awaitDrain===0&&x(i,"data")&&(T.flowing=!0,c(i))}}z.prototype.unpipe=function(i){var o=this._readableState,T={hasUnpiped:!1};if(o.pipesCount===0)return this;if(o.pipesCount===1)return i&&i!==o.pipes?this:(i||(i=o.pipes),o.pipes=null,o.pipesCount=0,o.flowing=!1,i&&i.emit("unpipe",this,T),this);if(!i){var Y=o.pipes,Z=o.pipesCount;o.pipes=null,o.pipesCount=0,o.flowing=!1;for(var r=0;r<Z;r++)Y[r].emit("unpipe",this,{hasUnpiped:!1});return this}var e=K(o.pipes,i);return e===-1?this:(o.pipes.splice(e,1),o.pipesCount-=1,o.pipesCount===1&&(o.pipes=o.pipes[0]),i.emit("unpipe",this,T),this)},z.prototype.on=function(i,o){var T=A.prototype.on.call(this,i,o),Y=this._readableState;return i==="data"?(Y.readableListening=this.listenerCount("readable")>0,Y.flowing!==!1&&this.resume()):i==="readable"&&!Y.endEmitted&&!Y.readableListening&&(Y.readableListening=Y.needReadable=!0,Y.flowing=!1,Y.emittedReadable=!1,E("on readable",Y.length,Y.reading),Y.length?oe(this):Y.reading||process.nextTick(d,this)),T},z.prototype.addListener=z.prototype.on,z.prototype.removeListener=function(i,o){var T=A.prototype.removeListener.call(this,i,o);return i==="readable"&&process.nextTick(u,this),T},z.prototype.removeAllListeners=function(i){var o=A.prototype.removeAllListeners.apply(this,arguments);return(i==="readable"||i===void 0)&&process.nextTick(u,this),o};function u(i){var o=i._readableState;o.readableListening=i.listenerCount("readable")>0,o.resumeScheduled&&!o.paused?o.flowing=!0:i.listenerCount("data")>0&&i.resume()}function d(i){E("readable nexttick read 0"),i.read(0)}z.prototype.resume=function(){var i=this._readableState;return i.flowing||(E("resume"),i.flowing=!i.readableListening,w(this,i)),i.paused=!1,this};function w(i,o){o.resumeScheduled||(o.resumeScheduled=!0,process.nextTick(B,i,o))}function B(i,o){E("resume",o.reading),o.reading||i.read(0),o.resumeScheduled=!1,i.emit("resume"),c(i),o.flowing&&!o.reading&&i.read(0)}z.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function c(i){var o=i._readableState;for(E("flow",o.flowing);o.flowing&&i.read()!==null;);}z.prototype.wrap=function(i){var o=this,T=this._readableState,Y=!1;i.on("end",function(){if(E("wrapped end"),T.decoder&&!T.ended){var e=T.decoder.end();e&&e.length&&o.push(e)}o.push(null)}),i.on("data",function(e){if(E("wrapped data"),T.decoder&&(e=T.decoder.write(e)),!(T.objectMode&&e==null)&&!(!T.objectMode&&(!e||!e.length))){var t=o.push(e);t||(Y=!0,i.pause())}});for(var Z in i)this[Z]===void 0&&typeof i[Z]=="function"&&(this[Z]=function(t){return function(){return i[t].apply(i,arguments)}}(Z));for(var r=0;r<R.length;r++)i.on(R[r],this.emit.bind(this,R[r]));return this._read=function(e){E("wrapped _read",e),Y&&(Y=!1,i.resume())},this},typeof Symbol=="function"&&(z.prototype[Symbol.asyncIterator]=function(){return C===void 0&&(C=Nt()),C(this)}),Object.defineProperty(z.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(z.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(z.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(o){this._readableState&&(this._readableState.flowing=o)}}),z._fromList=a,Object.defineProperty(z.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function a(i,o){if(o.length===0)return null;var T;return o.objectMode?T=o.buffer.shift():!i||i>=o.length?(o.decoder?T=o.buffer.join(""):o.buffer.length===1?T=o.buffer.first():T=o.buffer.concat(o.length),o.buffer.clear()):T=o.buffer.consume(i,o.decoder),T}function S(i){var o=i._readableState;E("endReadable",o.endEmitted),o.endEmitted||(o.ended=!0,process.nextTick(G,o,i))}function G(i,o){if(E("endReadableNT",i.endEmitted,i.length),!i.endEmitted&&i.length===0&&(i.endEmitted=!0,o.readable=!1,o.emit("end"),i.autoDestroy)){var T=o._writableState;(!T||T.autoDestroy&&T.finished)&&o.destroy()}}typeof Symbol=="function"&&(z.from=function(i,o){return g===void 0&&(g=jt()),g(z,i,o)});function K(i,o){for(var T=0,Y=i.length;T<Y;T++)if(i[T]===o)return T;return-1}return Oe}var Ie,ht;function St(){if(ht)return Ie;ht=1,Ie=s;var F=ye().codes,x=F.ERR_METHOD_NOT_IMPLEMENTED,A=F.ERR_MULTIPLE_CALLBACK,I=F.ERR_TRANSFORM_ALREADY_TRANSFORMING,D=F.ERR_TRANSFORM_WITH_LENGTH_0,v=ce();pe()(s,v);function b(W,O){var N=this._transformState;N.transforming=!1;var M=N.writecb;if(M===null)return this.emit("error",new A);N.writechunk=null,N.writecb=null,O!=null&&this.push(O),M(W);var L=this._readableState;L.reading=!1,(L.needReadable||L.length<L.highWaterMark)&&this._read(L.highWaterMark)}function s(W){if(!(this instanceof s))return new s(W);v.call(this,W),this._transformState={afterTransform:b.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,W&&(typeof W.transform=="function"&&(this._transform=W.transform),typeof W.flush=="function"&&(this._flush=W.flush)),this.on("prefinish",E)}function E(){var W=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(O,N){U(W,O,N)}):U(this,null,null)}s.prototype.push=function(W,O){return this._transformState.needTransform=!1,v.prototype.push.call(this,W,O)},s.prototype._transform=function(W,O,N){N(new x("_transform()"))},s.prototype._write=function(W,O,N){var M=this._transformState;if(M.writecb=N,M.writechunk=W,M.writeencoding=O,!M.transforming){var L=this._readableState;(M.needTransform||L.needReadable||L.length<L.highWaterMark)&&this._read(L.highWaterMark)}},s.prototype._read=function(W){var O=this._transformState;O.writechunk!==null&&!O.transforming?(O.transforming=!0,this._transform(O.writechunk,O.writeencoding,O.afterTransform)):O.needTransform=!0},s.prototype._destroy=function(W,O){v.prototype._destroy.call(this,W,function(N){O(N)})};function U(W,O,N){if(O)return W.emit("error",O);if(N!=null&&W.push(N),W._writableState.length)throw new D;if(W._transformState.transforming)throw new I;return W.push(null)}return Ie}var Pe,ct;function qt(){if(ct)return Pe;ct=1,Pe=x;var F=St();pe()(x,F);function x(A){if(!(this instanceof x))return new x(A);F.call(this,A)}return x.prototype._transform=function(A,I,D){D(null,A)},Pe}var Ne,dt;function Wt(){if(dt)return Ne;dt=1;var F;function x(N){var M=!1;return function(){M||(M=!0,N.apply(void 0,arguments))}}var A=ye().codes,I=A.ERR_MISSING_ARGS,D=A.ERR_STREAM_DESTROYED;function v(N){if(N)throw N}function b(N){return N.setHeader&&typeof N.abort=="function"}function s(N,M,L,j){j=x(j);var P=!1;N.on("close",function(){P=!0}),F===void 0&&(F=We()),F(N,{readable:M,writable:L},function(_){if(_)return j(_);P=!0,j()});var p=!1;return function(_){if(!P&&!p){if(p=!0,b(N))return N.abort();if(typeof N.destroy=="function")return N.destroy();j(_||new D("pipe"))}}}function E(N){N()}function U(N,M){return N.pipe(M)}function W(N){return!N.length||typeof N[N.length-1]!="function"?v:N.pop()}function O(){for(var N=arguments.length,M=new Array(N),L=0;L<N;L++)M[L]=arguments[L];var j=W(M);if(Array.isArray(M[0])&&(M=M[0]),M.length<2)throw new I("streams");var P,p=M.map(function(_,C){var g=C<M.length-1,y=C>0;return s(_,g,y,function(R){P||(P=R),R&&p.forEach(E),!g&&(p.forEach(E),j(P))})});return M.reduce(U)}return Ne=O,Ne}var je,pt;function Ht(){if(pt)return je;pt=1,je=A;var F=qe().EventEmitter,x=pe();x(A,F),A.Readable=_t(),A.Writable=Et(),A.Duplex=ce(),A.Transform=St(),A.PassThrough=qt(),A.finished=We(),A.pipeline=Wt(),A.Stream=A;function A(){F.call(this)}return A.prototype.pipe=function(I,D){var v=this;function b(M){I.writable&&I.write(M)===!1&&v.pause&&v.pause()}v.on("data",b);function s(){v.readable&&v.resume&&v.resume()}I.on("drain",s),!I._isStdio&&(!D||D.end!==!1)&&(v.on("end",U),v.on("close",W));var E=!1;function U(){E||(E=!0,I.end())}function W(){E||(E=!0,typeof I.destroy=="function"&&I.destroy())}function O(M){if(N(),F.listenerCount(this,"error")===0)throw M}v.on("error",O),I.on("error",O);function N(){v.removeListener("data",b),I.removeListener("drain",s),v.removeListener("end",U),v.removeListener("close",W),v.removeListener("error",O),I.removeListener("error",O),v.removeListener("end",N),v.removeListener("close",N),I.removeListener("close",N)}return v.on("end",N),v.on("close",N),I.on("close",N),I.emit("pipe",v),I},je}(function(F,x){(function(A,I){F.exports=I(Ht())})(he,function(A){function I(l){return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},I(l)}function D(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function v(l,n){for(var h=0;h<n.length;h++){var u=n[h];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}function b(l,n,h){return n&&v(l.prototype,n),h&&v(l,h),l}function s(l,n,h){return n in l?Object.defineProperty(l,n,{value:h,enumerable:!0,configurable:!0,writable:!0}):l[n]=h,l}function E(l,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),n&&W(l,n)}function U(l){return U=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},U(l)}function W(l,n){return W=Object.setPrototypeOf||function(h,u){return h.__proto__=u,h},W(l,n)}function O(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function N(l,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return O(l)}function M(l){var n=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var h,u=U(l);if(n){var d=U(this).constructor;h=Reflect.construct(u,arguments,d)}else h=u.apply(this,arguments);return N(this,h)}}function L(l,n){return function(h){if(Array.isArray(h))return h}(l)||function(h,u){var d=h==null?null:typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(d!=null){var w,B,c=[],a=!0,S=!1;try{for(d=d.call(h);!(a=(w=d.next()).done)&&(c.push(w.value),!u||c.length!==u);a=!0);}catch(G){S=!0,B=G}finally{try{a||d.return==null||d.return()}finally{if(S)throw B}}return c}}(l,n)||j(l,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(l,n){if(l){if(typeof l=="string")return P(l,n);var h=Object.prototype.toString.call(l).slice(8,-1);return h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set"?Array.from(l):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?P(l,n):void 0}}function P(l,n){(n==null||n>l.length)&&(n=l.length);for(var h=0,u=new Array(n);h<n;h++)u[h]=l[h];return u}function p(l,n){var h=typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(!h){if(Array.isArray(l)||(h=j(l))||n){h&&(l=h);var u=0,d=function(){};return{s:d,n:function(){return u>=l.length?{done:!0}:{done:!1,value:l[u++]}},e:function(a){throw a},f:d}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var w,B=!0,c=!1;return{s:function(){h=h.call(l)},n:function(){var a=h.next();return B=a.done,a},e:function(a){c=!0,w=a},f:function(){try{B||h.return==null||h.return()}finally{if(c)throw w}}}}var _,C;function g(l){if(_){for(var n=arguments.length,h=new Array(n>1?n-1:0),u=1;u<n;u++)h[u-1]=arguments[u];_.apply(void 0,[l].concat(h))}}function y(l){if(C){for(var n=arguments.length,h=new Array(n>1?n-1:0),u=1;u<n;u++)h[u-1]=arguments[u];C.apply(void 0,[l].concat(h))}}var R=function(){function l(n){D(this,l),this.payload=n,this.nri=(96&this.payload[0])>>5,this.ntype=31&this.payload[0],this.isvcl=this.ntype==1||this.ntype==5,this.stype="",this.isfmb=!1}return b(l,[{key:"toString",value:function(){return"".concat(l.type(this),": NRI: ").concat(this.getNri())}},{key:"getNri",value:function(){return this.nri}},{key:"type",value:function(){return this.ntype}},{key:"isKeyframe",value:function(){return this.ntype===l.IDR}},{key:"getPayload",value:function(){return this.payload}},{key:"getPayloadSize",value:function(){return this.payload.byteLength}},{key:"getSize",value:function(){return 4+this.getPayloadSize()}},{key:"getData",value:function(){var n=new Uint8Array(this.getSize());return new DataView(n.buffer).setUint32(0,this.getSize()-4),n.set(this.getPayload(),4),n}}],[{key:"NDR",get:function(){return 1}},{key:"IDR",get:function(){return 5}},{key:"SEI",get:function(){return 6}},{key:"SPS",get:function(){return 7}},{key:"PPS",get:function(){return 8}},{key:"AUD",get:function(){return 9}},{key:"TYPES",get:function(){var n;return s(n={},l.IDR,"IDR"),s(n,l.SEI,"SEI"),s(n,l.SPS,"SPS"),s(n,l.PPS,"PPS"),s(n,l.NDR,"NDR"),s(n,l.AUD,"AUD"),n}},{key:"type",value:function(n){return n.ntype in l.TYPES?l.TYPES[n.ntype]:"UNKNOWN"}}]),l}();function V(l,n){var h=new Uint8Array((0|l.byteLength)+(0|n.byteLength));return h.set(l,0),h.set(n,0|l.byteLength),h}var H=function(){function l(n){D(this,l),this.data=n,this.index=0,this.bitLength=8*n.byteLength}return b(l,[{key:"setData",value:function(n){this.data=n,this.index=0,this.bitLength=8*n.byteLength}},{key:"bitsAvailable",get:function(){return this.bitLength-this.index}},{key:"skipBits",value:function(n){if(this.bitsAvailable<n)return!1;this.index+=n}},{key:"readBits",value:function(n){var h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],u=this.getBits(n,this.index,h);return u}},{key:"getBits",value:function(n,h){var u=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(this.bitsAvailable<n)return 0;var d=h%8,w=this.data[h/8|0]&255>>>d,B=8-d;if(B>=n)return u&&(this.index+=n),w>>B-n;u&&(this.index+=B);var c=n-B;return w<<c|this.getBits(c,h+B,u)}},{key:"skipLZ",value:function(){var n;for(n=0;n<this.bitLength-this.index;++n)if(this.getBits(1,this.index+n,!1)!==0)return this.index+=n,n;return n}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var n=this.skipLZ();return this.readBits(n+1)-1}},{key:"readEG",value:function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)}},{key:"readBoolean",value:function(){return this.readBits(1)===1}},{key:"readUByte",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;return this.readBits(8*n)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}}]),l}(),z=function(){function l(n){D(this,l),this.remuxer=n,this.track=n.mp4track}return b(l,[{key:"parseSPS",value:function(n){var h=l.readSPS(new Uint8Array(n));this.track.fps=h.fps,this.track.width=h.width,this.track.height=h.height,this.track.sps=[new Uint8Array(n)],this.track.codec="avc1.";for(var u=new DataView(n.buffer,n.byteOffset+1,4),d=0;d<3;++d){var w=u.getUint8(d).toString(16);w.length<2&&(w="0"+w),this.track.codec+=w}}},{key:"parsePPS",value:function(n){this.track.pps=[new Uint8Array(n)]}},{key:"parseNAL",value:function(n){if(!n)return!1;var h=!1;switch(n.type()){case R.IDR:case R.NDR:h=!0;break;case R.PPS:this.track.pps||(this.parsePPS(n.getPayload()),!this.remuxer.readyToDecode&&this.track.pps&&this.track.sps&&(this.remuxer.readyToDecode=!0)),h=!0;break;case R.SPS:this.track.sps||(this.parseSPS(n.getPayload()),!this.remuxer.readyToDecode&&this.track.pps&&this.track.sps&&(this.remuxer.readyToDecode=!0)),h=!0;break;case R.AUD:g("AUD - ignoing");break;case R.SEI:g("SEI - ignoing")}return h}}],[{key:"extractNALu",value:function(n){for(var h,u,d=0,w=n.byteLength,B=0,c=[],a=0;d<w;)switch(h=n[d++],B){case 0:h===0&&(B=1);break;case 1:B=h===0?2:0;break;case 2:case 3:h===0?B=3:(h===1&&d<w&&(a!=d-B-1&&c.push(n.subarray(a,d-B-1)),a=d),B=0)}return a<w&&(u=n.subarray(a,w)),[c,u]}},{key:"skipScalingList",value:function(n,h){for(var u=8,d=8,w=0;w<h;w++)d!==0&&(d=(u+n.readEG()+256)%256),u=d===0?u:d}},{key:"readSPS",value:function(n){var h,u,d,w,B,c,a=new H(n),S=0,G=0,K=0,i=0,o=1,T=0;a.readUByte();for(var Y=[],Z=n.byteLength,r=1;r<Z;r++)r+2<Z&&a.readBits(24,!1)===3?(Y.push(a.readBits(8)),Y.push(a.readBits(8)),r+=2,a.readBits(8)):Y.push(a.readBits(8));if(a.setData(new Uint8Array(Y)),h=a.readUByte(),a.readBits(5),a.skipBits(3),a.readUByte(),a.skipUEG(),h===100||h===110||h===122||h===244||h===44||h===83||h===86||h===118||h===128){var e=a.readUEG();if(e===3&&a.skipBits(1),a.skipUEG(),a.skipUEG(),a.skipBits(1),a.readBoolean()){c=e!==3?8:12;for(var t=0;t<c;++t)a.readBoolean()&&(t<6?l.skipScalingList(a,16):l.skipScalingList(a,64))}}a.skipUEG();var f=a.readUEG();if(f===0)a.readUEG();else if(f===1){a.skipBits(1),a.skipEG(),a.skipEG(),u=a.readUEG();for(var m=0;m<u;++m)a.skipEG()}if(a.skipUEG(),a.skipBits(1),d=a.readUEG(),w=a.readUEG(),(B=a.readBits(1))===0&&a.skipBits(1),a.skipBits(1),a.readBoolean()&&(S=a.readUEG(),G=a.readUEG(),K=a.readUEG(),i=a.readUEG()),a.readBoolean()){if(a.readBoolean()){var k;switch(a.readUByte()){case 1:k=[1,1];break;case 2:k=[12,11];break;case 3:k=[10,11];break;case 4:k=[16,11];break;case 5:k=[40,33];break;case 6:k=[24,11];break;case 7:k=[20,11];break;case 8:k=[32,11];break;case 9:k=[80,33];break;case 10:k=[18,11];break;case 11:k=[15,11];break;case 12:k=[64,33];break;case 13:k=[160,99];break;case 14:k=[4,3];break;case 15:k=[3,2];break;case 16:k=[2,1];break;case 255:k=[a.readUByte()<<8|a.readUByte(),a.readUByte()<<8|a.readUByte()]}k&&k[0]>0&&k[1]>0&&(o=k[0]/k[1])}if(a.readBoolean()&&a.skipBits(1),a.readBoolean()&&(a.skipBits(4),a.readBoolean()&&a.skipBits(24)),a.readBoolean()&&(a.skipUEG(),a.skipUEG()),a.readBoolean()){var q=a.readUInt(),$=a.readUInt();a.readBoolean()&&(T=$/(2*q))}}return{fps:T>0?T:void 0,width:Math.ceil((16*(d+1)-2*S-2*G)*o),height:(2-B)*(w+1)*16-(B?2:4)*(K+i)}}},{key:"parseHeader",value:function(n){var h=new H(n.getPayload());h.readUByte(),n.isfmb=h.readUEG()===0,n.stype=h.readUEG()}}]),l}(),J=function(){function l(n){D(this,l),this.remuxer=n,this.track=n.mp4track}return b(l,[{key:"extractAAC",value:function(n){var h,u,d=0,w=n.byteLength,B=[];if(!l.isAACPattern(n))return y("Invalid ADTS audio format"),B;for(h=l.getHeaderLength(n),this.aacHeader||(this.aacHeader=n.subarray(0,h));d<w;)u=l.getFrameLength(n),B.push(n.subarray(h,u)),n=n.slice(u),d+=u;return B}},{key:"setAACConfig",value:function(){var n,h,u,d=new Uint8Array(2),w=this.aacHeader;w&&(n=1+((192&w[2])>>>6),h=(60&w[2])>>>2,u=(1&w[2])<<2,u|=(192&w[3])>>>6,d[0]=n<<3,d[0]|=(14&h)>>1,d[1]|=(1&h)<<7,d[1]|=u<<3,this.track.codec="mp4a.40."+n,this.track.channelCount=u,this.track.config=d,this.remuxer.readyToDecode=!0)}}],[{key:"samplingRateMap",get:function(){return[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]}},{key:"getHeaderLength",value:function(n){return 1&n[1]?7:9}},{key:"getFrameLength",value:function(n){return(3&n[3])<<11|n[4]<<3|(224&n[5])>>>5}},{key:"isAACPattern",value:function(n){return n[0]===255&&(240&n[1])==240&&(6&n[1])==0}}]),l}(),te=function(){function l(n){D(this,l),this.listener={},this.type=""|n}return b(l,[{key:"on",value:function(n,h){return this.listener[n]||(this.listener[n]=[]),this.listener[n].push(h),!0}},{key:"off",value:function(n,h){if(this.listener[n]){var u=this.listener[n].indexOf(h);return u>-1&&this.listener[n].splice(u,1),!0}return!1}},{key:"offAll",value:function(){this.listener={}}},{key:"dispatch",value:function(n,h){return!!this.listener[n]&&(this.listener[n].map(function(u){u.apply(null,[h])}),!0)}}]),l}(),ne=function(){function l(){D(this,l)}return b(l,null,[{key:"init",value:function(){var n;for(n in l.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},l.types)l.types.hasOwnProperty(n)&&(l.types[n]=[n.charCodeAt(0),n.charCodeAt(1),n.charCodeAt(2),n.charCodeAt(3)]);var h=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),u=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);l.HDLR_TYPES={video:h,audio:u};var d=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),w=new Uint8Array([0,0,0,0,0,0,0,0]);l.STTS=l.STSC=l.STCO=w,l.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),l.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),l.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),l.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var B=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);l.FTYP=l.box(l.types.ftyp,B,a,B,c),l.DINF=l.box(l.types.dinf,l.box(l.types.dref,d))}},{key:"box",value:function(n){for(var h=arguments.length,u=new Array(h>1?h-1:0),d=1;d<h;d++)u[d-1]=arguments[d];for(var w,B=8,c=u.length,a=c;c--;)B+=u[c].byteLength;for((w=new Uint8Array(B))[0]=B>>24&255,w[1]=B>>16&255,w[2]=B>>8&255,w[3]=255&B,w.set(n,4),c=0,B=8;c<a;++c)w.set(u[c],B),B+=u[c].byteLength;return w}},{key:"hdlr",value:function(n){return l.box(l.types.hdlr,l.HDLR_TYPES[n])}},{key:"mdat",value:function(n){return l.box(l.types.mdat,n)}},{key:"mdhd",value:function(n,h){return l.box(l.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,255&n,h>>24,h>>16&255,h>>8&255,255&h,85,196,0,0]))}},{key:"mdia",value:function(n){return l.box(l.types.mdia,l.mdhd(n.timescale,n.duration),l.hdlr(n.type),l.minf(n))}},{key:"mfhd",value:function(n){return l.box(l.types.mfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n]))}},{key:"minf",value:function(n){return n.type==="audio"?l.box(l.types.minf,l.box(l.types.smhd,l.SMHD),l.DINF,l.stbl(n)):l.box(l.types.minf,l.box(l.types.vmhd,l.VMHD),l.DINF,l.stbl(n))}},{key:"moof",value:function(n,h,u){return l.box(l.types.moof,l.mfhd(n),l.traf(u,h))}},{key:"moov",value:function(n,h,u){for(var d=n.length,w=[];d--;)w[d]=l.trak(n[d]);return l.box.apply(null,[l.types.moov,l.mvhd(u,h)].concat(w).concat(l.mvex(n)))}},{key:"mvex",value:function(n){for(var h=n.length,u=[];h--;)u[h]=l.trex(n[h]);return l.box.apply(null,[l.types.mvex].concat(u))}},{key:"mvhd",value:function(n,h){var u=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,n>>24&255,n>>16&255,n>>8&255,255&n,h>>24&255,h>>16&255,h>>8&255,255&h,0,1,0,0,1,0,0,0,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,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,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,255,255,255,255]);return l.box(l.types.mvhd,u)}},{key:"sdtp",value:function(n){var h,u,d=n.samples||[],w=new Uint8Array(4+d.length);for(u=0;u<d.length;u++)h=d[u].flags,w[u+4]=h.dependsOn<<4|h.isDependedOn<<2|h.hasRedundancy;return l.box(l.types.sdtp,w)}},{key:"stbl",value:function(n){return l.box(l.types.stbl,l.stsd(n),l.box(l.types.stts,l.STTS),l.box(l.types.stsc,l.STSC),l.box(l.types.stsz,l.STSZ),l.box(l.types.stco,l.STCO))}},{key:"avc1",value:function(n){var h,u,d,w=[],B=[];for(h=0;h<n.sps.length;h++)d=(u=n.sps[h]).byteLength,w.push(d>>>8&255),w.push(255&d),w=w.concat(Array.prototype.slice.call(u));for(h=0;h<n.pps.length;h++)d=(u=n.pps[h]).byteLength,B.push(d>>>8&255),B.push(255&d),B=B.concat(Array.prototype.slice.call(u));var c=l.box(l.types.avcC,new Uint8Array([1,w[3],w[4],w[5],255,224|n.sps.length].concat(w).concat([n.pps.length]).concat(B))),a=n.width,S=n.height;return l.box(l.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,a>>8&255,255&a,S>>8&255,255&S,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,98,105,110,101,108,112,114,111,46,114,117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c,l.box(l.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))}},{key:"esds",value:function(n){var h=n.config.byteLength,u=new Uint8Array(26+h+3);return u.set([0,0,0,0,3,23+h,0,1,0,4,15+h,64,21,0,0,0,0,0,0,0,0,0,0,0,5,h]),u.set(n.config,26),u.set([6,1,2],26+h),u}},{key:"mp4a",value:function(n){var h=n.audiosamplerate;return l.box(l.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n.channelCount,0,16,0,0,0,0,h>>8&255,255&h,0,0]),l.box(l.types.esds,l.esds(n)))}},{key:"stsd",value:function(n){return n.type==="audio"?l.box(l.types.stsd,l.STSD,l.mp4a(n)):l.box(l.types.stsd,l.STSD,l.avc1(n))}},{key:"tkhd",value:function(n){var h=n.id,u=n.duration,d=n.width,w=n.height,B=n.volume;return l.box(l.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,h>>24&255,h>>16&255,h>>8&255,255&h,0,0,0,0,u>>24,u>>16&255,u>>8&255,255&u,0,0,0,0,0,0,0,0,0,0,0,0,B>>0&255,B%1*10>>0&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,d>>8&255,255&d,0,0,w>>8&255,255&w,0,0]))}},{key:"traf",value:function(n,h){var u=l.sdtp(n),d=n.id;return l.box(l.types.traf,l.box(l.types.tfhd,new Uint8Array([0,0,0,0,d>>24,d>>16&255,d>>8&255,255&d])),l.box(l.types.tfdt,new Uint8Array([0,0,0,0,h>>24,h>>16&255,h>>8&255,255&h])),l.trun(n,u.length+16+16+8+16+8+8),u)}},{key:"trak",value:function(n){return n.duration=n.duration||4294967295,l.box(l.types.trak,l.tkhd(n),l.mdia(n))}},{key:"trex",value:function(n){var h=n.id;return l.box(l.types.trex,new Uint8Array([0,0,0,0,h>>24,h>>16&255,h>>8&255,255&h,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(n,h){var u,d,w,B,c,a,S=n.samples||[],G=S.length,K=12+16*G,i=new Uint8Array(K);for(h+=8+K,i.set([0,0,15,1,G>>>24&255,G>>>16&255,G>>>8&255,255&G,h>>>24&255,h>>>16&255,h>>>8&255,255&h],0),u=0;u<G;u++)w=(d=S[u]).duration,B=d.size,c=d.flags,a=d.cts,i.set([w>>>24&255,w>>>16&255,w>>>8&255,255&w,B>>>24&255,B>>>16&255,B>>>8&255,255&B,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.paddingValue<<1|c.isNonSync,61440&c.degradPrio,15&c.degradPrio,a>>>24&255,a>>>16&255,a>>>8&255,255&a],12+16*u);return l.box(l.types.trun,i)}},{key:"initSegment",value:function(n,h,u){l.types||l.init();var d,w=l.moov(n,h,u);return(d=new Uint8Array(l.FTYP.byteLength+w.byteLength)).set(l.FTYP),d.set(w,l.FTYP.byteLength),d}}]),l}(),ie=1,ae=function(){function l(){D(this,l)}return b(l,[{key:"flush",value:function(){this.mp4track.len=0,this.mp4track.samples=[]}},{key:"isReady",value:function(){return!(!this.readyToDecode||!this.samples.length)||null}}],[{key:"getTrackID",value:function(){return ie++}}]),l}(),ue=function(l){E(h,l);var n=M(h);function h(u){var d;return D(this,h),(d=n.call(this)).readyToDecode=!1,d.nextDts=0,d.dts=0,d.mp4track={id:ae.getTrackID(),type:"audio",channelCount:0,len:0,fragmented:!0,timescale:u,duration:u,samples:[],config:"",codec:""},d.samples=[],d.aac=new J(O(d)),d}return b(h,[{key:"resetTrack",value:function(){this.readyToDecode=!1,this.mp4track.codec="",this.mp4track.channelCount="",this.mp4track.config="",this.mp4track.timescale=this.timescale,this.nextDts=0,this.dts=0}},{key:"remux",value:function(u){if(u.length>0)for(var d=0;d<u.length;d++){var w=u[d],B=w.units,c=B.byteLength;this.samples.push({units:B,size:c,duration:w.duration}),this.mp4track.len+=c,this.readyToDecode||this.aac.setAACConfig()}}},{key:"getPayload",value:function(){if(!this.isReady())return null;var u,d,w=new Uint8Array(this.mp4track.len),B=0,c=this.mp4track.samples;for(this.dts=this.nextDts;this.samples.length;){var a=this.samples.shift();a.units,(d=a.duration)<=0?(g("remuxer: invalid sample duration at DTS: ".concat(this.nextDts," :").concat(d)),this.mp4track.len-=a.size):(this.nextDts+=d,u={size:a.size,duration:d,cts:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},w.set(a.units,B),B+=a.size,c.push(u))}return c.length?new Uint8Array(w.buffer,0,this.mp4track.len):null}},{key:"getAacParser",value:function(){return this.aac}}]),h}(ae),le=function(l){E(h,l);var n=M(h);function h(u){var d;return D(this,h),(d=n.call(this)).readyToDecode=!1,d.nextDts=0,d.dts=0,d.mp4track={id:ae.getTrackID(),type:"video",len:0,fragmented:!0,sps:"",pps:"",fps:30,width:0,height:0,timescale:u,duration:u,samples:[]},d.samples=[],d.h264=new z(O(d)),d}return b(h,[{key:"resetTrack",value:function(){this.readyToDecode=!1,this.mp4track.sps="",this.mp4track.pps="",this.nextDts=0,this.dts=0}},{key:"remux",value:function(u){var d,w=p(u);try{for(w.s();!(d=w.n()).done;){var B,c=d.value,a=[],S=0,G=p(c.units);try{for(G.s();!(B=G.n()).done;){var K=B.value;this.h264.parseNAL(K)&&(a.push(K),S+=K.getSize())}}catch(i){G.e(i)}finally{G.f()}a.length>0&&this.readyToDecode&&(this.mp4track.len+=S,this.samples.push({units:a,size:S,keyFrame:c.keyFrame,duration:c.duration,compositionTimeOffset:c.compositionTimeOffset}))}}catch(i){w.e(i)}finally{w.f()}}},{key:"getPayload",value:function(){if(!this.isReady())return null;var u,d,w=new Uint8Array(this.mp4track.len),B=0,c=this.mp4track.samples;for(this.dts=this.nextDts;this.samples.length;){var a=this.samples.shift(),S=a.units;if((d=a.duration)<=0)g("remuxer: invalid sample duration at DTS: ".concat(this.nextDts," :").concat(d)),this.mp4track.len-=a.size;else{this.nextDts+=d,u={size:a.size,duration:d,cts:a.compositionTimeOffset||0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,isNonSync:a.keyFrame?0:1,dependsOn:a.keyFrame?2:1}};var G,K=p(S);try{for(K.s();!(G=K.n()).done;){var i=G.value;w.set(i.getData(),B),B+=i.getSize()}}catch(o){K.e(o)}finally{K.f()}c.push(u)}}return c.length?new Uint8Array(w.buffer,0,this.mp4track.len):null}}]),h}(ae),oe=function(l){E(h,l);var n=M(h);function h(u){var d;return D(this,h),(d=n.call(this,"remuxer")).initialized=!1,d.trackTypes=[],d.tracks={},d.seq=1,d.env=u,d.timescale=1e3,d.mediaDuration=0,d.aacParser=null,d}return b(h,[{key:"addTrack",value:function(u){if(u!=="video"&&u!=="both"||(this.tracks.video=new le(this.timescale),this.trackTypes.push("video")),u==="audio"||u==="both"){var d=new ue(this.timescale);this.aacParser=d.getAacParser(),this.tracks.audio=d,this.trackTypes.push("audio")}}},{key:"reset",value:function(){var u,d=p(this.trackTypes);try{for(d.s();!(u=d.n()).done;){var w=u.value;this.tracks[w].resetTrack()}}catch(B){d.e(B)}finally{d.f()}this.initialized=!1}},{key:"destroy",value:function(){this.tracks={},this.offAll()}},{key:"flush",value:function(){if(this.initialized){var u,d=p(this.trackTypes);try{for(d.s();!(u=d.n()).done;){var w=u.value,B=this.tracks[w],c=B.getPayload();if(c&&c.byteLength){var a={type:w,payload:V(ne.moof(this.seq,B.dts,B.mp4track),ne.mdat(c)),dts:B.dts};w==="video"&&(a.fps=B.mp4track.fps),this.dispatch("buffer",a);var S=(G=B.dts/this.timescale,K=void 0,i=void 0,o=void 0,T=void 0,T="",K=Math.floor(G),(i=parseInt(K/3600,10)%24)>0&&(T+=(i<10?"0"+i:i)+":"),T+=((o=parseInt(K/60,10)%60)<10?"0"+o:o)+":"+((K=K<0?0:K%60)<10?"0"+K:K));g("put segment (".concat(w,"): dts: ").concat(B.dts," frames: ").concat(B.mp4track.samples.length," second: ").concat(S)),B.flush(),this.seq++}}}catch(Y){d.e(Y)}finally{d.f()}}else this.isReady()&&(this.dispatch("ready"),this.initSegment(),this.initialized=!0,this.flush());var G,K,i,o,T}},{key:"initSegment",value:function(){var u,d=[],w=p(this.trackTypes);try{for(w.s();!(u=w.n()).done;){var B=u.value,c=this.tracks[B];if(this.env=="browser"){var a={type:B,payload:ne.initSegment([c.mp4track],this.mediaDuration,this.timescale)};this.dispatch("buffer",a)}else d.push(c.mp4track)}}catch(G){w.e(G)}finally{w.f()}if(this.env=="node"){var S={type:"all",payload:ne.initSegment(d,this.mediaDuration,this.timescale)};this.dispatch("buffer",S)}g("Initial segment generated.")}},{key:"isReady",value:function(){var u,d=p(this.trackTypes);try{for(d.s();!(u=d.n()).done;){var w=u.value;if(!this.tracks[w].readyToDecode||!this.tracks[w].samples.length)return!1}}catch(B){d.e(B)}finally{d.f()}return!0}},{key:"remux",value:function(u){var d,w=p(this.trackTypes);try{for(w.s();!(d=w.n()).done;){var B=d.value,c=u[B];B==="audio"&&this.tracks.video&&!this.tracks.video.readyToDecode||c.length>0&&this.tracks[B].remux(c)}}catch(a){w.e(a)}finally{w.f()}this.flush()}}]),h}(te),fe=function(l){E(h,l);var n=M(h);function h(u,d){var w;return D(this,h),(w=n.call(this,"buffer")).type=d,w.queue=new Uint8Array,w.cleaning=!1,w.pendingCleaning=0,w.cleanOffset=30,w.cleanRanges=[],w.sourceBuffer=u,w.sourceBuffer.addEventListener("updateend",function(){w.pendingCleaning>0&&(w.initCleanup(w.pendingCleaning),w.pendingCleaning=0),w.cleaning=!1,w.cleanRanges.length&&w.doCleanup()}),w.sourceBuffer.addEventListener("error",function(){w.dispatch("error",{type:w.type,name:"buffer",error:"buffer error"})}),w}return b(h,[{key:"destroy",value:function(){this.queue=null,this.sourceBuffer=null,this.offAll()}},{key:"doCleanup",value:function(){if(this.cleanRanges.length){var u=this.cleanRanges.shift();g("".concat(this.type," remove range [").concat(u[0]," - ").concat(u[1],")")),this.cleaning=!0,this.sourceBuffer.remove(u[0],u[1])}else this.cleaning=!1}},{key:"initCleanup",value:function(u){try{if(this.sourceBuffer.updating)return void(this.pendingCleaning=u);if(this.sourceBuffer.buffered&&this.sourceBuffer.buffered.length&&!this.cleaning){for(var d=0;d<this.sourceBuffer.buffered.length;++d){var w=this.sourceBuffer.buffered.start(d),B=this.sourceBuffer.buffered.end(d);u-w>this.cleanOffset&&w<(B=u-this.cleanOffset)&&this.cleanRanges.push([w,B])}this.doCleanup()}}catch(c){y("Error occured while cleaning ".concat(this.type," buffer - ").concat(c.name,": ").concat(c.message))}}},{key:"doAppend",value:function(){if(this.queue.length&&this.sourceBuffer&&!this.sourceBuffer.updating)try{this.sourceBuffer.appendBuffer(this.queue),this.queue=new Uint8Array}catch(d){var u="unexpectedError";d.name==="QuotaExceededError"?(g("".concat(this.type," buffer quota full")),u="QuotaExceeded"):(y("Error occured while appending ".concat(this.type," buffer - ").concat(d.name,": ").concat(d.message)),u="InvalidStateError"),this.dispatch("error",{type:this.type,name:u,error:"buffer error"})}}},{key:"feed",value:function(u){this.queue=V(this.queue,u)}}]),h}(te);return function(l){E(h,l);var n=M(h);function h(u){var d;return D(this,h),(d=n.call(this,"jmuxer")).isReset=!1,d.options=Object.assign({},{node:"",mode:"both",flushingTime:500,maxDelay:500,clearBuffer:!0,fps:30,readFpsFromTrack:!1,debug:!1,onReady:function(){},onError:function(){},onMissingVideoFrames:function(){},onMissingAudioFrames:function(){}},u),d.env=(typeof process>"u"?"undefined":I(process))==="object"&&typeof window>"u"?"node":"browser",d.options.debug&&(_=console.log,C=console.error),d.options.fps||(d.options.fps=30),d.frameDuration=1e3/d.options.fps|0,d.remuxController=new oe(d.env),d.remuxController.addTrack(d.options.mode),d.initData(),d.remuxController.on("buffer",d.onBuffer.bind(O(d))),d.env=="browser"&&(d.remuxController.on("ready",d.createBuffer.bind(O(d))),d.initBrowser()),d}return b(h,[{key:"initData",value:function(){this.lastCleaningTime=Date.now(),this.kfPosition=[],this.kfCounter=0,this.pendingUnits={},this.remainingData=new Uint8Array,this.startInterval()}},{key:"initBrowser",value:function(){typeof this.options.node=="string"&&this.options.node==""&&y("no video element were found to render, provide a valid video element"),this.node=typeof this.options.node=="string"?document.getElementById(this.options.node):this.options.node,this.mseReady=!1,this.setupMSE()}},{key:"createStream",value:function(){var u=this.feed.bind(this),d=this.destroy.bind(this);return this.stream=new A.Duplex({writableObjectMode:!0,read:function(w){},write:function(w,B,c){u(w),c()},final:function(w){d(),w()}}),this.stream}},{key:"setupMSE",value:function(){if(window.MediaSource=window.MediaSource||window.WebKitMediaSource,!window.MediaSource)throw"Oops! Browser does not support media source extension.";this.isMSESupported=!!window.MediaSource,this.mediaSource=new MediaSource,this.url=URL.createObjectURL(this.mediaSource),this.node.src=this.url,this.mseEnded=!1,this.mediaSource.addEventListener("sourceopen",this.onMSEOpen.bind(this)),this.mediaSource.addEventListener("sourceclose",this.onMSEClose.bind(this)),this.mediaSource.addEventListener("webkitsourceopen",this.onMSEOpen.bind(this)),this.mediaSource.addEventListener("webkitsourceclose",this.onMSEClose.bind(this))}},{key:"endMSE",value:function(){if(!this.mseEnded)try{this.mseEnded=!0,this.mediaSource.endOfStream()}catch{y("mediasource is not available to end")}}},{key:"feed",value:function(u){var d,w,B,c=!1,a={video:[],audio:[]};if(u&&this.remuxController){if(B=u.duration?parseInt(u.duration):0,u.video){u.video=V(this.remainingData,u.video);var S=L(z.extractNALu(u.video),2);if(d=S[0],w=S[1],this.remainingData=w||new Uint8Array,!(d.length>0))return y("Failed to extract any NAL units from video data:",w),void(typeof this.options.onMissingVideoFrames=="function"&&this.options.onMissingVideoFrames.call(null,u));a.video=this.getVideoFrames(d,B,u.compositionTimeOffset),c=!0}if(u.audio){if(!((d=this.remuxController.aacParser.extractAAC(u.audio)).length>0))return y("Failed to extract audio data from:",u.audio),void(typeof this.options.onMissingAudioFrames=="function"&&this.options.onMissingAudioFrames.call(null,u));a.audio=this.getAudioFrames(d,B),c=!0}c?this.remuxController.remux(a):y("Input object must have video and/or audio property. Make sure it is a valid typed array")}}},{key:"getVideoFrames",value:function(u,d,w){var B,c=this,a=[],S=[],G=0,K=!1,i=!1;this.pendingUnits.units&&(a=this.pendingUnits.units,i=this.pendingUnits.vcl,K=this.pendingUnits.keyFrame,this.pendingUnits={});var o,T=p(u);try{for(T.s();!(o=T.n()).done;){var Y=o.value,Z=new R(Y);Z.type()!==R.IDR&&Z.type()!==R.NDR||z.parseHeader(Z),a.length&&i&&(Z.isfmb||!Z.isvcl)&&(S.push({units:a,keyFrame:K}),a=[],K=!1,i=!1),a.push(Z),K=K||Z.isKeyframe(),i=i||Z.isvcl}}catch(e){T.e(e)}finally{T.f()}if(a.length)if(d)if(i)S.push({units:a,keyFrame:K});else{var r=S.length-1;r>=0&&(S[r].units=S[r].units.concat(a))}else this.pendingUnits={units:a,keyFrame:K,vcl:i};return B=d?d/S.length|0:this.frameDuration,G=d?d-B*S.length:0,S.map(function(e){e.duration=B,e.compositionTimeOffset=w,G>0&&(e.duration++,G--),c.kfCounter++,e.keyFrame&&c.options.clearBuffer&&c.kfPosition.push(c.kfCounter*B/1e3)}),g("jmuxer: No. of frames of the last chunk: ".concat(S.length)),S}},{key:"getAudioFrames",value:function(u,d){var w,B,c=[],a=0,S=p(u);try{for(S.s();!(B=S.n()).done;){var G=B.value;c.push({units:G})}}catch(K){S.e(K)}finally{S.f()}return w=d?d/c.length|0:this.frameDuration,a=d?d-w*c.length:0,c.map(function(K){K.duration=w,a>0&&(K.duration++,a--)}),c}},{key:"destroy",value:function(){if(this.stopInterval(),this.stream&&(this.remuxController.flush(),this.stream.push(null),this.stream=null),this.remuxController&&(this.remuxController.destroy(),this.remuxController=null),this.bufferControllers){for(var u in this.bufferControllers)this.bufferControllers[u].destroy();this.bufferControllers=null,this.endMSE()}this.node=!1,this.mseReady=!1,this.videoStarted=!1,this.mediaSource=null}},{key:"reset",value:function(){if(this.stopInterval(),this.isReset=!0,this.node.pause(),this.remuxController&&this.remuxController.reset(),this.bufferControllers){for(var u in this.bufferControllers)this.bufferControllers[u].destroy();this.bufferControllers=null,this.endMSE()}this.initData(),this.env=="browser"&&this.initBrowser(),g("JMuxer was reset")}},{key:"createBuffer",value:function(){if(this.mseReady&&this.remuxController&&this.remuxController.isReady()&&!this.bufferControllers)for(var u in this.bufferControllers={},this.remuxController.tracks){var d=this.remuxController.tracks[u];if(!h.isSupported("".concat(u,'/mp4; codecs="').concat(d.mp4track.codec,'"')))return y("Browser does not support codec"),!1;var w=this.mediaSource.addSourceBuffer("".concat(u,'/mp4; codecs="').concat(d.mp4track.codec,'"'));this.bufferControllers[u]=new fe(w,u),this.bufferControllers[u].on("error",this.onBufferError.bind(this))}}},{key:"startInterval",value:function(){var u=this;this.interval=setInterval(function(){u.options.flushingTime?u.applyAndClearBuffer():u.bufferControllers&&u.cancelDelay()},this.options.flushingTime||1e3)}},{key:"stopInterval",value:function(){this.interval&&clearInterval(this.interval)}},{key:"cancelDelay",value:function(){if(this.node.buffered&&this.node.buffered.length>0&&!this.node.seeking){var u=this.node.buffered.end(0);u-this.node.currentTime>this.options.maxDelay/1e3&&(console.log("delay"),this.node.currentTime=u-.001)}}},{key:"releaseBuffer",value:function(){for(var u in this.bufferControllers)this.bufferControllers[u].doAppend()}},{key:"applyAndClearBuffer",value:function(){this.bufferControllers&&(this.releaseBuffer(),this.clearBuffer())}},{key:"getSafeClearOffsetOfBuffer",value:function(u){for(var d,w=this.options.mode==="audio"&&u||0,B=0;B<this.kfPosition.length&&!(this.kfPosition[B]>=u);B++)d=this.kfPosition[B];return d&&(this.kfPosition=this.kfPosition.filter(function(c){return c<d&&(w=c),c>=d})),w}},{key:"clearBuffer",value:function(){if(this.options.clearBuffer&&Date.now()-this.lastCleaningTime>1e4){for(var u in this.bufferControllers){var d=this.getSafeClearOffsetOfBuffer(this.node.currentTime);this.bufferControllers[u].initCleanup(d)}this.lastCleaningTime=Date.now()}}},{key:"onBuffer",value:function(u){this.options.readFpsFromTrack&&u.fps!==void 0&&this.options.fps!=u.fps&&(this.options.fps=u.fps,this.frameDuration=Math.ceil(1e3/u.fps),g("JMuxer changed FPS to ".concat(u.fps," from track data"))),this.env=="browser"?this.bufferControllers&&this.bufferControllers[u.type]&&this.bufferControllers[u.type].feed(u.payload):this.stream&&this.stream.push(u.payload),this.options.flushingTime===0&&this.applyAndClearBuffer()}},{key:"onMSEOpen",value:function(){this.mseReady=!0,URL.revokeObjectURL(this.url),typeof this.options.onReady=="function"&&this.options.onReady.call(null,this.isReset)}},{key:"onMSEClose",value:function(){this.mseReady=!1,this.videoStarted=!1}},{key:"onBufferError",value:function(u){if(u.name=="QuotaExceeded")return g("JMuxer cleaning ".concat(u.type," buffer due to QuotaExceeded error")),void this.bufferControllers[u.type].initCleanup(this.node.currentTime);u.name=="InvalidStateError"?(g("JMuxer is reseting due to InvalidStateError"),this.reset()):this.endMSE(),typeof this.options.onError=="function"&&this.options.onError.call(null,u)}}],[{key:"isSupported",value:function(u){return window.MediaSource&&window.MediaSource.isTypeSupported(u)}}]),h}(te)})})(gt);var Gt=gt.exports;const Vt=xt(Gt);var Yt=Object.defineProperty,zt=Object.getOwnPropertyDescriptor,_e=(F,x,A,I)=>{for(var D=I>1?void 0:I?zt(x,A):x,v=F.length-1,b;v>=0;v--)(b=F[v])&&(D=(I?b(x,A,D):b(D))||D);return I&&D&&Yt(x,A,D),D};let de=class extends Rt(kt,At){constructor(){super(...arguments),this.jmuxer=null,this.status="connecting"}get url(){var F;return this.convertUrl((F=this.camSettings)==null?void 0:F.stream_url,this.printerUrl)}get webcamStyle(){var F,x,A;return{transform:this.generateTransform((F=this.camSettings.flip_horizontal)!=null?F:!1,(x=this.camSettings.flip_vertical)!=null?x:!1,(A=this.camSettings.rotation)!=null?A:0)}}mounted(){this.play()}play(){var I;if(this.status="connecting",(I=this.jmuxer)==null||I.destroy(),!this.url.startsWith("ws://")&&!this.url.startsWith("wss://")){console.error("jmuxer error: only websocket streams supported (ws://.. or wss://..)"),this.status="error";return}const F=this.$refs.video,x=this.camSettings.target_fps||10;this.jmuxer=new Vt({node:F,mode:"video",flushingTime:0,fps:x,onReady:D=>{this.status="connected",console.log("jmuxer ready:",D)},onError:D=>{this.status="error",console.log("jmuxer error:",D)}});const A=new WebSocket(this.url);A.binaryType="arraybuffer",A.addEventListener("message",D=>{var v;(v=this.jmuxer)==null||v.feed({video:new Uint8Array(D.data)})}),A.addEventListener("error",D=>{this.status="error",console.log("jmuxer ws error:",D)})}beforeUnmount(){var F;(F=this.jmuxer)==null||F.destroy()}onCamSettingsChanged(){this.play()}};_e([vt({required:!0})],de.prototype,"camSettings",2);_e([vt({default:null})],de.prototype,"printerUrl",2);_e([Tt("camSettings",{deep:!0})],de.prototype,"onCamSettingsChanged",1);de=_e([Bt],de);var Kt=function(){var x=this,A=x._self._c;return x._self._setupProxy,A("div",[A("video",{ref:"video",staticClass:"webcamImage",style:x.webcamStyle,attrs:{autoplay:""}}),x.status!=="connected"?A(Ct,[A(Ut,{staticClass:"_webcam_jmuxer_output text-center d-flex flex-column justify-center align-center"},[x.status==="connecting"?A(Mt,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):x._e(),A("span",{staticClass:"mt-3"},[x._v(x._s(x.status))])],1)],1):x._e()],1)},Jt=[],$t=Lt(de,Kt,Jt,!1,null,"90b79f69");const tr=$t.exports;export{tr as default};
|