<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">(self.webpackChunkPeerTube=self.webpackChunkPeerTube||[]).push([[6136],{20608:function(k,M,b){"use strict";var w=this&amp;&amp;this.__importDefault||function(_){return _&amp;&amp;_.__esModule?_:{default:_}};Object.defineProperty(M,"__esModule",{value:!0}),M.BandwidthApproximator=void 0;const O=(0,w(b(30221)).default)("p2pml:bandwidth-approximator"),P=2e3;class d{constructor(T,c){this.value=T,this.timeStamp=c}}M.BandwidthApproximator=class v{constructor(){this.lastBytes=[],this.currentBytesSum=0,this.lastBandwidth=[],this.addBytes=(T,c)=&gt;{for(O("Add %d bytes.",T),this.lastBytes.push(new d(T,c)),this.currentBytesSum+=T;c-this.lastBytes[0].timeStamp&gt;P;)this.currentBytesSum-=this.lastBytes.shift().value;const u=Math.min(P,c);this.lastBandwidth.push(new d(this.currentBytesSum/u,c))},this.getBandwidth=T=&gt;{for(;0!==this.lastBandwidth.length&amp;&amp;T-this.lastBandwidth[0].timeStamp&gt;4e4;)this.lastBandwidth.shift();let c=0;for(const u of this.lastBandwidth)u.value&gt;c&amp;&amp;(c=u.value);return O("Max bandwidth: %d.",c),c},this.getSmoothInterval=()=&gt;P,this.getMeasureInterval=()=&gt;4e4}}},50584:function(k,M,b){"use strict";var w=b(85752).default,C=this&amp;&amp;this.__importDefault||function(v){return v&amp;&amp;v.__esModule?v:{default:v}};Object.defineProperty(M,"__esModule",{value:!0}),M.HttpMediaManager=void 0;const O=C(b(30221)),P=b(79776);class E extends P.STEEmitter{}M.HttpMediaManager=class d extends E{constructor(_){var T;super(),T=this,this.settings=_,this.xhrRequests=new Map,this.failedSegments=new Map,this.debug=(0,O.default)("p2pml:http-media-manager"),this.download=(c,u)=&gt;{if(this.isDownloading(c))return;this.cleanTimedOutFailedSegments(),this.emit("segment-start-load",c);const g=c.priority&lt;=this.settings.skipSegmentBuilderPriority?c.url:this.buildSegmentUrl(c);this.debug("http segment download",g,c.id),c.requestUrl=g;const h=new XMLHttpRequest;if(h.open("GET",g,!0),h.responseType="arraybuffer",c.range)h.setRequestHeader("Range",c.range),u=void 0;else if(void 0!==u&amp;&amp;this.settings.httpUseRanges){let l=0;for(const r of u)l+=r.byteLength;h.setRequestHeader("Range",`bytes=${l}-`),this.debug("continue download from",l)}else u=void 0;this.setupXhrEvents(h,c,u),this.settings.xhrSetup&amp;&amp;this.settings.xhrSetup(h,g),this.xhrRequests.set(c.id,{xhr:h,segment:c,initialPriority:c.priority,segmentUrl:g}),h.send()},this.updatePriority=c=&gt;{const u=this.xhrRequests.get(c.id);if(!u)throw new Error("Cannot update priority of not downloaded segment "+c.id);c.priority&lt;=this.settings.skipSegmentBuilderPriority&amp;&amp;u.initialPriority&gt;this.settings.skipSegmentBuilderPriority&amp;&amp;u.segmentUrl!==c.url&amp;&amp;(this.debug("aborting http segment because the segment is now in a high priority",c.id),this.abort(c),this.download(c))},this.abort=c=&gt;{const u=this.xhrRequests.get(c.id);u&amp;&amp;(u.xhr.abort(),this.xhrRequests.delete(c.id),this.debug("http segment abort",c.id))},this.isDownloading=c=&gt;this.xhrRequests.has(c.id),this.isFailed=c=&gt;{const u=this.failedSegments.get(c.id);return void 0!==u&amp;&amp;u&gt;this.now()},this.getActiveDownloads=()=&gt;this.xhrRequests,this.getActiveDownloadsCount=()=&gt;this.xhrRequests.size,this.destroy=()=&gt;{this.xhrRequests.forEach(c=&gt;c.xhr.abort()),this.xhrRequests.clear()},this.setupXhrEvents=(c,u,g)=&gt;{let h=0;c.addEventListener("progress",l=&gt;{this.emit("bytes-downloaded",u,l.loaded-h),h=l.loaded,l.lengthComputable&amp;&amp;this.emit("segment-size",u,l.total)}),c.addEventListener("load",function(){var l=w(function*(r){if(c.status&lt;200||c.status&gt;=300)return void T.segmentFailure(u,r,c);let i=c.response;if(void 0!==g&amp;&amp;206===c.status){let a=0;for(const t of g)a+=t.byteLength;const n=new Uint8Array(a+i.byteLength);let e=0;for(const t of g)n.set(new Uint8Array(t),e),e+=t.byteLength;n.set(new Uint8Array(i),e),i=n.buffer}yield T.segmentDownloadFinished(u,i,c)});return function(r){return l.apply(this,arguments)}}()),c.addEventListener("error",l=&gt;{this.segmentFailure(u,l,c)}),c.addEventListener("timeout",l=&gt;{this.segmentFailure(u,l,c)})},this.segmentDownloadFinished=function(){var c=w(function*(u,g,h){if(u.responseUrl=null===h.responseURL?void 0:h.responseURL,T.settings.segmentValidator)try{yield T.settings.segmentValidator(Object.assign(Object.assign({},u),{data:g}),"http")}catch(l){return T.debug("segment validator failed",l),void T.segmentFailure(u,l,h)}T.xhrRequests.delete(u.id),T.emit("segment-loaded",u,g)});return function(u,g,h){return c.apply(this,arguments)}}(),this.segmentFailure=(c,u,g)=&gt;{c.responseUrl=null===g.responseURL?void 0:g.responseURL,this.xhrRequests.delete(c.id),this.failedSegments.set(c.id,this.now()+this.settings.httpFailedSegmentTimeout),this.emit("segment-error",c,u)},this.cleanTimedOutFailedSegments=()=&gt;{const c=this.now(),u=[];this.failedSegments.forEach((g,h)=&gt;{g&lt;c&amp;&amp;u.push(h)}),u.forEach(g=&gt;this.failedSegments.delete(g))},this.now=()=&gt;performance.now()}buildSegmentUrl(_){return this.settings.segmentUrlBuilder?this.settings.segmentUrlBuilder(_):_.url}}},71224:function(k,M,b){"use strict";var w=b(85752).default,C=this&amp;&amp;this.__importDefault||function(l){return l&amp;&amp;l.__esModule?l:{default:l}};Object.defineProperty(M,"__esModule",{value:!0}),M.HybridLoader=void 0;const O=C(b(30221)),P=b(91656),E=C(b(81872)),d=b(78328),v=b(50584),_=b(67904),T=b(14896),c=b(20608),u=b(54032),g={cachedSegmentExpiration:3e5,cachedSegmentsCount:30,useP2P:!0,consumeOnly:!1,requiredSegmentsPriority:1,skipSegmentBuilderPriority:1,simultaneousHttpDownloads:2,httpDownloadProbability:.1,httpDownloadProbabilityInterval:1e3,httpDownloadProbabilitySkipIfNoPeers:!1,httpFailedSegmentTimeout:1e4,httpDownloadMaxPriority:20,httpDownloadInitialTimeout:0,httpDownloadInitialTimeoutPerSegment:4e3,httpUseRanges:!1,simultaneousP2PDownloads:3,p2pDownloadMaxPriority:20,p2pSegmentDownloadTimeout:6e4,webRtcMaxMessageSize:65535,trackerAnnounce:["wss://tracker.novage.com.ua","wss://tracker.openwebtorrent.com"],peerRequestsPerAnnounce:10,rtcConfig:E.default.config};class h extends P.EventEmitter{constructor(r={}){var i;super(),i=this,this.debug=(0,O.default)("p2pml:hybrid-loader"),this.debugSegments=(0,O.default)("p2pml:hybrid-loader-segments"),this.segmentsQueue=[],this.bandwidthApproximator=new c.BandwidthApproximator,this.httpDownloadInitialTimeoutTimestamp=-1/0,this.createHttpManager=()=&gt;new v.HttpMediaManager(this.settings),this.createP2PManager=()=&gt;new _.P2PMediaManager(this.segmentsStorage,this.settings),this.load=function(){var n=w(function*(e,t){i.initRandomDownloadIntervalIfNeeded(),e.length&gt;0&amp;&amp;(i.masterSwarmId=e[0].masterSwarmId),void 0!==i.masterSwarmId&amp;&amp;i.p2pManager.setStreamSwarmId(t,i.masterSwarmId),i.debug("load segments");let s=i.abortUnknownSegments(e);if(i.debug.enabled)for(const f of e)i.segmentsQueue.find(I=&gt;I.id===f.id)||i.debug("add segment",f.id);if(i.segmentsQueue=e,void 0===i.masterSwarmId)return;let o=yield i.segmentsStorage.getSegmentsMap(i.masterSwarmId);s=i.processSegmentsQueue(o)||s,(yield i.cleanSegmentsStorage())&amp;&amp;(o=yield i.segmentsStorage.getSegmentsMap(i.masterSwarmId),s=!0),s&amp;&amp;!i.settings.consumeOnly&amp;&amp;i.p2pManager.sendSegmentsMapToAll(i.createSegmentsMap(o))});return function(e,t){return n.apply(this,arguments)}}(),this.getSegment=function(){var n=w(function*(e){return void 0===i.masterSwarmId?void 0:i.segmentsStorage.getSegment(e,i.masterSwarmId)});return function(e){return n.apply(this,arguments)}}(),this.getSettings=()=&gt;this.settings,this.getDetails=()=&gt;({peerId:this.p2pManager.getPeerId()}),this.getBandwidthEstimate=()=&gt;this.bandwidthApproximator.getBandwidth(this.now()),this.destroy=w(function*(){void 0!==i.httpRandomDownloadInterval&amp;&amp;(clearInterval(i.httpRandomDownloadInterval),i.httpRandomDownloadInterval=void 0),i.httpDownloadInitialTimeoutTimestamp=-1/0,i.segmentsQueue=[],i.httpManager.destroy(),i.p2pManager.destroy(),i.masterSwarmId=void 0,yield i.segmentsStorage.destroy()}),this.processInitialSegmentTimeout=w(function*(){if(void 0!==i.httpRandomDownloadInterval){if(void 0!==i.masterSwarmId){const n=yield i.segmentsStorage.getSegmentsMap(i.masterSwarmId);i.processSegmentsQueue(n)&amp;&amp;!i.settings.consumeOnly&amp;&amp;i.p2pManager.sendSegmentsMapToAll(i.createSegmentsMap(n))}i.httpDownloadInitialTimeoutTimestamp!==-1/0&amp;&amp;setTimeout(i.processInitialSegmentTimeout,i.settings.httpDownloadInitialTimeoutPerSegment)}}),this.processSegmentsQueue=n=&gt;{if(this.debugSegments(`process segments queue. priority: ${this.segmentsQueue.length&gt;0?this.segmentsQueue[0].priority:0}, queue length: ${this.segmentsQueue.length}`),void 0===this.masterSwarmId||0===this.segmentsQueue.length)return!1;let s,t=!1,o=!0;if(this.httpDownloadInitialTimeoutTimestamp!==-1/0){let I;for(const S of this.segmentsQueue)if(!n.has(S.id)){I=S.priority;break}const R=this.now()-this.httpDownloadInitialTimeoutTimestamp;o=R&gt;=this.settings.httpDownloadInitialTimeout||void 0!==I&amp;&amp;R&gt;this.settings.httpDownloadInitialTimeoutPerSegment&amp;&amp;I&lt;=0,o&amp;&amp;(this.debugSegments("cancel initial HTTP download timeout - timed out"),this.httpDownloadInitialTimeoutTimestamp=-1/0)}let f=!1;for(let I=0;I&lt;this.segmentsQueue.length;I++){const R=this.segmentsQueue[I];if(n.has(R.id))continue;if(this.httpManager.isDownloading(R)){this.httpManager.updatePriority(R);continue}const S=o&amp;&amp;R.priority&lt;=this.settings.requiredSegmentsPriority;if(S&amp;&amp;!this.httpManager.isFailed(R)){if(this.httpManager.getActiveDownloadsCount()&gt;=this.settings.simultaneousHttpDownloads)for(let y=this.segmentsQueue.length-1;y&gt;I;y--){const j=this.segmentsQueue[y];if(this.httpManager.isDownloading(j)){this.debugSegments("cancel HTTP download",j.priority,j.id),this.httpManager.abort(j);break}}if(this.httpManager.getActiveDownloadsCount()&lt;this.settings.simultaneousHttpDownloads){const y=this.p2pManager.abort(R);this.httpManager.download(R,y),this.debugSegments("HTTP download (priority)",R.priority,R.id),t=!0;continue}}if(S&amp;&amp;this.httpManager.isFailed(R)&amp;&amp;(f=!0),!this.p2pManager.isDownloading(R)){if(R.priority&lt;=this.settings.requiredSegmentsPriority){if(s=s||this.p2pManager.getOverallSegmentsMap(),s.get(R.id)!==T.MediaPeerSegmentStatus.Loaded)continue;if(this.p2pManager.getActiveDownloadsCount()&gt;=this.settings.simultaneousP2PDownloads)for(let y=this.segmentsQueue.length-1;y&gt;I;y--){const j=this.segmentsQueue[y];if(this.p2pManager.isDownloading(j)){this.debugSegments("cancel P2P download",j.priority,j.id),this.p2pManager.abort(j);break}}if(this.p2pManager.getActiveDownloadsCount()&lt;this.settings.simultaneousP2PDownloads&amp;&amp;this.p2pManager.download(R)){this.debugSegments("P2P download (priority)",R.priority,R.id);continue}continue}this.p2pManager.getActiveDownloadsCount()&lt;this.settings.simultaneousP2PDownloads&amp;&amp;R.priority&lt;=this.settings.p2pDownloadMaxPriority&amp;&amp;this.p2pManager.download(R)&amp;&amp;this.debugSegments("P2P download",R.priority,R.id)}}return f&amp;&amp;setTimeout(w(function*(){if(void 0===i.masterSwarmId)return;const I=yield i.segmentsStorage.getSegmentsMap(i.masterSwarmId);i.processSegmentsQueue(I)}),this.settings.httpFailedSegmentTimeout),t},this.downloadRandomSegmentOverHttp=w(function*(){if(void 0===i.masterSwarmId||void 0===i.httpRandomDownloadInterval||i.httpDownloadInitialTimeoutTimestamp!==-1/0||i.httpManager.getActiveDownloadsCount()&gt;=i.settings.simultaneousHttpDownloads||i.settings.httpDownloadProbabilitySkipIfNoPeers&amp;&amp;0===i.p2pManager.getPeers().size||i.settings.consumeOnly)return;const n=yield i.segmentsStorage.getSegmentsMap(i.masterSwarmId),e=i.p2pManager.getOverallSegmentsMap(),t=i.segmentsQueue.filter(o=&gt;!i.p2pManager.isDownloading(o)&amp;&amp;!i.httpManager.isDownloading(o)&amp;&amp;!e.has(o.id)&amp;&amp;!i.httpManager.isFailed(o)&amp;&amp;o.priority&lt;=i.settings.httpDownloadMaxPriority&amp;&amp;!n.has(o.id));if(0===t.length||Math.random()&gt;i.settings.httpDownloadProbability*t.length)return;const s=t[Math.floor(Math.random()*t.length)];i.debugSegments("HTTP download (random)",s.priority,s.id),i.httpManager.download(s),i.p2pManager.sendSegmentsMapToAll(i.createSegmentsMap(n))}),this.onSegmentStartLoad=(n,e)=&gt;{this.emit(d.Events.SegmentStartLoad,n,e)},this.onPieceBytesDownloaded=(n,e,t,s)=&gt;{this.bandwidthApproximator.addBytes(t,this.now()),this.emit(d.Events.PieceBytesDownloaded,n,e,t,s)},this.onPieceBytesUploaded=(n,e,t,s)=&gt;{this.emit(d.Events.PieceBytesUploaded,n,e,t,s)},this.onSegmentLoaded=function(){var n=w(function*(e,t,s){if(i.debugSegments("segment loaded",e.id,e.id),void 0===i.masterSwarmId)return;e.data=t,e.downloadBandwidth=i.bandwidthApproximator.getBandwidth(i.now()),yield i.segmentsStorage.storeSegment(e),i.emit(d.Events.SegmentLoaded,e,s);const o=yield i.segmentsStorage.getSegmentsMap(i.masterSwarmId);i.processSegmentsQueue(o),i.settings.consumeOnly||i.p2pManager.sendSegmentsMapToAll(i.createSegmentsMap(o))});return function(e,t,s){return n.apply(this,arguments)}}(),this.onSegmentError=function(){var n=w(function*(e,t,s){if(i.debugSegments("segment error",e.id,e.id,s,t),i.emit(d.Events.SegmentError,e,t,s),void 0!==i.masterSwarmId){const o=yield i.segmentsStorage.getSegmentsMap(i.masterSwarmId);i.processSegmentsQueue(o)&amp;&amp;!i.settings.consumeOnly&amp;&amp;i.p2pManager.sendSegmentsMapToAll(i.createSegmentsMap(o))}});return function(e,t,s){return n.apply(this,arguments)}}(),this.onSegmentSize=function(){var n=w(function*(e,t){i.debugSegments("segment size",e.id,t),i.emit(d.Events.SegmentSize,e,t)});return function(e,t){return n.apply(this,arguments)}}(),this.getStreamSwarmId=n=&gt;void 0===n.streamId?n.masterSwarmId:`${n.masterSwarmId}+${n.streamId}`,this.createSegmentsMap=n=&gt;{const e={},t=(s,o)=&gt;{const f=this.getStreamSwarmId(s),I=s.sequence;let R=e[f];void 0===R&amp;&amp;(R=["",[]],e[f]=R);const S=R[1];R[0]+=0===S.length?I:`|${I}`,S.push(o)};for(const s of n.values())t(s.segment,T.MediaPeerSegmentStatus.Loaded);for(const s of this.httpManager.getActiveDownloads().values())t(s.segment,T.MediaPeerSegmentStatus.LoadingByHttp);return e},this.onPeerConnect=function(){var n=w(function*(e){i.emit(d.Events.PeerConnect,e),!i.settings.consumeOnly&amp;&amp;void 0!==i.masterSwarmId&amp;&amp;i.p2pManager.sendSegmentsMap(e.id,i.createSegmentsMap(yield i.segmentsStorage.getSegmentsMap(i.masterSwarmId)))});return function(e){return n.apply(this,arguments)}}(),this.onPeerClose=n=&gt;{this.emit(d.Events.PeerClose,n)},this.onTrackerUpdate=function(){var n=w(function*(e){if(i.httpDownloadInitialTimeoutTimestamp!==-1/0&amp;&amp;void 0!==e.incomplete&amp;&amp;e.incomplete&lt;=1&amp;&amp;(i.debugSegments("cancel initial HTTP download timeout - no peers"),i.httpDownloadInitialTimeoutTimestamp=-1/0,void 0!==i.masterSwarmId)){const t=yield i.segmentsStorage.getSegmentsMap(i.masterSwarmId);i.processSegmentsQueue(t)&amp;&amp;!i.settings.consumeOnly&amp;&amp;i.p2pManager.sendSegmentsMapToAll(i.createSegmentsMap(t))}});return function(e){return n.apply(this,arguments)}}(),this.cleanSegmentsStorage=w(function*(){return void 0!==i.masterSwarmId&amp;&amp;i.segmentsStorage.clean(i.masterSwarmId,n=&gt;void 0!==i.segmentsQueue.find(e=&gt;e.id===n))}),this.now=()=&gt;performance.now(),this.initRandomDownloadIntervalIfNeeded=()=&gt;{void 0===this.httpRandomDownloadInterval&amp;&amp;(this.httpRandomDownloadInterval=setInterval(this.downloadRandomSegmentOverHttp,this.settings.httpDownloadProbabilityInterval),this.settings.httpDownloadInitialTimeout&gt;0&amp;&amp;this.settings.httpDownloadInitialTimeoutPerSegment&gt;0&amp;&amp;(this.debugSegments("enable initial HTTP download timeout",this.settings.httpDownloadInitialTimeout,"per segment",this.settings.httpDownloadInitialTimeoutPerSegment),this.httpDownloadInitialTimeoutTimestamp=this.now(),setTimeout(this.processInitialSegmentTimeout,this.settings.httpDownloadInitialTimeoutPerSegment+100)))},this.abortUnknownSegments=n=&gt;{let e=!1;for(const t of this.segmentsQueue)n.find(s=&gt;s.id===t.id)||(this.debug("remove segment",t.id),this.httpManager.isDownloading(t)?(e=!0,this.httpManager.abort(t)):this.p2pManager.abort(t),this.emit(d.Events.SegmentAbort,t));return e},this.settings=Object.assign(Object.assign({},g),r);const{bufferedSegmentsCount:a}=r;"number"==typeof a&amp;&amp;(void 0===r.p2pDownloadMaxPriority&amp;&amp;(this.settings.p2pDownloadMaxPriority=a),void 0===r.httpDownloadMaxPriority&amp;&amp;(this.settings.p2pDownloadMaxPriority=a)),this.segmentsStorage=void 0===this.settings.segmentsStorage?new u.SegmentsMemoryStorage(this.settings):this.settings.segmentsStorage,this.debug("loader settings",this.settings),this.httpManager=this.createHttpManager(),this.httpManager.on("segment-start-load",n=&gt;this.onSegmentStartLoad("http",n)),this.httpManager.on("segment-loaded",this.onSegmentLoaded),this.httpManager.on("segment-error",this.onSegmentError),this.httpManager.on("segment-size",this.onSegmentSize),this.httpManager.on("bytes-downloaded",(n,e)=&gt;{this.onPieceBytesDownloaded("http",n,e)}),this.p2pManager=this.createP2PManager(),this.p2pManager.on("segment-start-load",n=&gt;this.onSegmentStartLoad("p2p",n)),this.p2pManager.on("segment-loaded",this.onSegmentLoaded),this.p2pManager.on("segment-error",this.onSegmentError),this.p2pManager.on("segment-size",this.onSegmentSize),this.p2pManager.on("peer-data-updated",w(function*(){if(void 0===i.masterSwarmId)return;const n=yield i.segmentsStorage.getSegmentsMap(i.masterSwarmId);i.processSegmentsQueue(n)&amp;&amp;!i.settings.consumeOnly&amp;&amp;i.p2pManager.sendSegmentsMapToAll(i.createSegmentsMap(n))})),this.p2pManager.on("bytes-downloaded",(n,e,t)=&gt;this.onPieceBytesDownloaded("p2p",n,e,t)),this.p2pManager.on("bytes-uploaded",(n,e,t)=&gt;this.onPieceBytesUploaded("p2p",n,e,t)),this.p2pManager.on("peer-connected",this.onPeerConnect),this.p2pManager.on("peer-closed",this.onPeerClose),this.p2pManager.on("tracker-update",this.onTrackerUpdate)}}M.HybridLoader=h,h.isSupported=()=&gt;void 0!==window.RTCPeerConnection.prototype.createDataChannel},98888:function(k,M,b){"use strict";var w=this&amp;&amp;this.__createBinding||(Object.create?function(O,P,E,d){void 0===d&amp;&amp;(d=E);var v=Object.getOwnPropertyDescriptor(P,E);(!v||("get"in v?!P.__esModule:v.writable||v.configurable))&amp;&amp;(v={enumerable:!0,get:function(){return P[E]}}),Object.defineProperty(O,d,v)}:function(O,P,E,d){void 0===d&amp;&amp;(d=E),O[d]=P[E]}),C=this&amp;&amp;this.__exportStar||function(O,P){for(var E in O)"default"!==E&amp;&amp;!Object.prototype.hasOwnProperty.call(P,E)&amp;&amp;w(P,O,E)};Object.defineProperty(M,"__esModule",{value:!0}),M.version=void 0,M.version="0.6.2",C(b(78328),M),C(b(71224),M)},78328:(k,M)=&gt;{"use strict";var w;Object.defineProperty(M,"__esModule",{value:!0}),M.Events=void 0,(w=M.Events||(M.Events={})).SegmentLoaded="segment_loaded",w.SegmentError="segment_error",w.SegmentSize="segment_size",w.SegmentAbort="segment_abort",w.SegmentStartLoad="segment_start_load",w.PeerConnect="peer_connect",w.PeerClose="peer_close",w.PieceBytesDownloaded="piece_bytes_downloaded",w.PieceBytesUploaded="piece_bytes_uploaded"},14896:function(k,M,b){"use strict";var w=this&amp;&amp;this.__importDefault||function(T){return T&amp;&amp;T.__esModule?T:{default:T}};Object.defineProperty(M,"__esModule",{value:!0}),M.MediaPeer=M.MediaPeerSegmentStatus=void 0;const C=w(b(30221)),O=b(60773),P=b(79776);var d,T,E=function(T){return T[T.SegmentData=0]="SegmentData",T[T.SegmentAbsent=1]="SegmentAbsent",T[T.SegmentsMap=2]="SegmentsMap",T[T.SegmentRequest=3]="SegmentRequest",T[T.CancelSegmentRequest=4]="CancelSegmentRequest",T}(E||{});(T=d=M.MediaPeerSegmentStatus||(M.MediaPeerSegmentStatus={}))[T.Loaded=0]="Loaded",T[T.LoadingByHttp=1]="LoadingByHttp";class v{constructor(c,u){this.id=c,this.size=u,this.bytesDownloaded=0,this.pieces=[]}}M.MediaPeer=class _ extends P.STEEmitter{constructor(c,u){super(),this.peer=c,this.settings=u,this.remoteAddress="",this.downloadingSegmentId=null,this.downloadingSegment=null,this.segmentsMap=new Map,this.debug=(0,C.default)("p2pml:media-peer"),this.timer=null,this.onPeerConnect=()=&gt;{this.debug("peer connect",this.id,this),this.remoteAddress=this.peer.remoteAddress,this.emit("connect",this)},this.onPeerClose=()=&gt;{this.debug("peer close",this.id,this),this.terminateSegmentRequest(),this.emit("close",this)},this.onPeerError=g=&gt;{this.debug("peer error",this.id,g,this)},this.receiveSegmentPiece=g=&gt;{if(!this.downloadingSegment)return void this.debug("peer segment not requested",this.id,this);this.downloadingSegment.bytesDownloaded+=g.byteLength,this.downloadingSegment.pieces.push(g);const h=this.downloadingSegment.id;if(this.emit("bytes-downloaded",this,h,g.byteLength),this.downloadingSegment.bytesDownloaded===this.downloadingSegment.size){const l=new Uint8Array(this.downloadingSegment.size);let r=0;for(const i of this.downloadingSegment.pieces)l.set(new Uint8Array(i),r),r+=i.byteLength;this.debug("peer segment download done",this.id,h,this),this.terminateSegmentRequest(),this.emit("segment-loaded",this,h,l.buffer)}else this.downloadingSegment.bytesDownloaded&gt;this.downloadingSegment.size&amp;&amp;(this.debug("peer segment download bytes mismatch",this.id,h,this),this.terminateSegmentRequest(),this.emit("segment-error",this,h,"Too many bytes received for segment"))},this.getJsonCommand=g=&gt;{const h=new Uint8Array(g);if(123===h[0]&amp;&amp;34===h[1]&amp;&amp;125===h[g.byteLength-1])try{return JSON.parse((new TextDecoder).decode(g))}catch{return null}return null},this.onPeerData=g=&gt;{const h=this.getJsonCommand(g);if(null!==h){if(this.downloadingSegment){this.debug("peer segment download is interrupted by a command",this.id,this);const l=this.downloadingSegment.id;return this.terminateSegmentRequest(),void this.emit("segment-error",this,l,"Segment download is interrupted by a command")}switch(this.debug("peer receive command",this.id,h,this),h.c){case E.SegmentsMap:this.segmentsMap=this.createSegmentsMap(h.m),this.emit("data-updated");break;case E.SegmentRequest:this.emit("segment-request",this,h.i);break;case E.SegmentData:this.downloadingSegmentId&amp;&amp;this.downloadingSegmentId===h.i&amp;&amp;"number"==typeof h.s&amp;&amp;h.s&gt;=0&amp;&amp;(this.downloadingSegment=new v(h.i,h.s),this.emit("segment-start-load",this.downloadingSegment.id),this.emit("segment-size",this.downloadingSegment.id,this.downloadingSegment.size),this.cancelResponseTimeoutTimer());break;case E.SegmentAbsent:this.downloadingSegmentId&amp;&amp;this.downloadingSegmentId===h.i&amp;&amp;(this.terminateSegmentRequest(),this.segmentsMap.delete(h.i),this.emit("segment-absent",this,h.i))}}else this.receiveSegmentPiece(g)},this.createSegmentsMap=g=&gt;{if(!(g instanceof Object))return new Map;const h=new Map;for(const l of Object.keys(g)){const r=g[l];if(!(r instanceof Array&amp;&amp;2===r.length&amp;&amp;"string"==typeof r[0]&amp;&amp;r[1]instanceof Array))return new Map;const i=r[0].split("|"),a=r[1];if(i.length!==a.length)return new Map;for(let n=0;n&lt;i.length;n++){const e=a[n];if("number"!=typeof e||void 0===d[e])return new Map;h.set(`${l}+${i[n]}`,e)}}return h},this.sendCommand=g=&gt;{this.debug("peer send command",this.id,g,this),this.peer.write(JSON.stringify(g))},this.destroy=()=&gt;{this.debug("peer destroy",this.id,this),this.terminateSegmentRequest(),this.peer.destroy()},this.getDownloadingSegmentId=()=&gt;this.downloadingSegmentId,this.getSegmentsMap=()=&gt;this.segmentsMap,this.sendSegmentsMap=g=&gt;{this.sendCommand({c:E.SegmentsMap,m:g})},this.sendSegmentData=(g,h)=&gt;{this.sendCommand({c:E.SegmentData,i:g,s:h.byteLength});let l=h.byteLength;for(;l&gt;0;){const r=l&gt;=this.settings.webRtcMaxMessageSize?this.settings.webRtcMaxMessageSize:l,i=O.Buffer.from(h,h.byteLength-l,r);this.peer.write(i),l-=r}this.emit("bytes-uploaded",this,g,h.byteLength)},this.sendSegmentAbsent=g=&gt;{this.sendCommand({c:E.SegmentAbsent,i:g})},this.requestSegment=g=&gt;{if(this.downloadingSegmentId)throw new Error("A segment is already downloading: "+this.downloadingSegmentId);this.sendCommand({c:E.SegmentRequest,i:g}),this.downloadingSegmentId=g,this.runResponseTimeoutTimer()},this.cancelSegmentRequest=()=&gt;{let g;if(this.downloadingSegmentId){const h=this.downloadingSegmentId;g=this.downloadingSegment?this.downloadingSegment.pieces:void 0,this.terminateSegmentRequest(),this.sendCommand({c:E.CancelSegmentRequest,i:h})}return g},this.runResponseTimeoutTimer=()=&gt;{this.timer=setTimeout(()=&gt;{if(this.timer=null,!this.downloadingSegmentId)return;const g=this.downloadingSegmentId;this.cancelSegmentRequest(),this.emit("segment-timeout",this,g)},this.settings.p2pSegmentDownloadTimeout)},this.cancelResponseTimeoutTimer=()=&gt;{this.timer&amp;&amp;(clearTimeout(this.timer),this.timer=null)},this.terminateSegmentRequest=()=&gt;{this.downloadingSegmentId=null,this.downloadingSegment=null,this.cancelResponseTimeoutTimer()},this.peer.on("connect",this.onPeerConnect),this.peer.on("close",this.onPeerClose),this.peer.on("error",this.onPeerError),this.peer.on("data",this.onPeerData),this.id=c.id}}},67904:function(k,M,b){"use strict";var w=b(85752).default,C=this&amp;&amp;this.__importDefault||function(i){return i&amp;&amp;i.__esModule?i:{default:i}};Object.defineProperty(M,"__esModule",{value:!0}),M.P2PMediaManager=void 0;const O=C(b(30221)),P=C(b(65208)),E=b(60773),d=C(b(99548)),v=b(79776),_=b(14896),g=`-WW${b(98888).version.replace(/\d*./g,i=&gt;("0"+parseInt(i,10)%100).slice(-2)).slice(0,4)}-`;class h{constructor(a,n){this.peerId=a,this.segment=n}}M.P2PMediaManager=class r extends v.STEEmitter{constructor(a,n){var e;super(),e=this,this.segmentsStorage=a,this.settings=n,this.trackerClient=null,this.peers=new Map,this.peerCandidates=new Map,this.peerSegmentRequests=new Map,this.streamSwarmId=null,this.debug=(0,O.default)("p2pml:p2p-media-manager"),this.pendingTrackerClient=null,this.getPeers=()=&gt;this.peers,this.getPeerId=()=&gt;E.Buffer.from(this.peerId).toString("hex"),this.setStreamSwarmId=(t,s)=&gt;{if(this.streamSwarmId===t)return;this.destroy(!0),this.streamSwarmId=t,this.masterSwarmId=s,this.debug("stream swarm ID",this.streamSwarmId),this.pendingTrackerClient={isDestroyed:!1};const o=this.pendingTrackerClient,f=(new d.default).update(`2${this.streamSwarmId}`).digest();o.isDestroyed?null!==this.trackerClient&amp;&amp;(this.trackerClient.destroy(),this.trackerClient=null):(this.pendingTrackerClient=null,this.createClient(f))},this.createClient=t=&gt;{if(!this.settings.useP2P)return;const s={infoHash:E.Buffer.from(t,0,20),peerId:E.Buffer.from(this.peerId,0,20),announce:this.settings.trackerAnnounce,rtcConfig:this.settings.rtcConfig,port:6881,getAnnounceOpts:()=&gt;({numwant:this.settings.peerRequestsPerAnnounce})};let o=this.trackerClient;this.trackerClient=new P.default(s),this.trackerClient.on("error",this.onTrackerError),this.trackerClient.on("warning",this.onTrackerWarning),this.trackerClient.on("update",this.onTrackerUpdate),this.trackerClient.on("peer",this.onTrackerPeer),this.trackerClient.start(),null!==o&amp;&amp;(o.destroy(),o=null)},this.onTrackerError=t=&gt;{this.debug("tracker error",t)},this.onTrackerWarning=t=&gt;{this.debug("tracker warning",t)},this.onTrackerUpdate=t=&gt;{this.debug("tracker update",t),this.emit("tracker-update",t)},this.onTrackerPeer=t=&gt;{if(this.debug("tracker peer",t.id,t),this.peers.has(t.id))return this.debug("tracker peer already connected",t.id,t),void t.destroy();const s=new _.MediaPeer(t,this.settings);s.on("connect",this.onPeerConnect),s.on("close",this.onPeerClose),s.on("data-updated",this.onPeerDataUpdated),s.on("segment-request",this.onSegmentRequest),s.on("segment-loaded",this.onSegmentLoaded),s.on("segment-absent",this.onSegmentAbsent),s.on("segment-error",this.onSegmentError),s.on("segment-size",this.onSegmentSize),s.on("segment-start-load",this.onSegmentStartLoad),s.on("segment-timeout",this.onSegmentTimeout),s.on("bytes-downloaded",this.onPieceBytesDownloaded),s.on("bytes-uploaded",this.onPieceBytesUploaded);let o=this.peerCandidates.get(s.id);o||(o=[],this.peerCandidates.set(s.id,o)),o.push(s)},this.download=t=&gt;{if(this.isDownloading(t))return!1;const s=[];for(const f of this.peers.values())null===f.getDownloadingSegmentId()&amp;&amp;f.getSegmentsMap().get(t.id)===_.MediaPeerSegmentStatus.Loaded&amp;&amp;s.push(f);if(0===s.length)return!1;const o=s[Math.floor(Math.random()*s.length)];return o.requestSegment(t.id),this.peerSegmentRequests.set(t.id,new h(o.id,t)),!0},this.abort=t=&gt;{let s;const o=this.peerSegmentRequests.get(t.id);if(o){const f=this.peers.get(o.peerId);f&amp;&amp;(s=f.cancelSegmentRequest()),this.peerSegmentRequests.delete(t.id)}return s},this.isDownloading=t=&gt;this.peerSegmentRequests.has(t.id),this.getActiveDownloadsCount=()=&gt;this.peerSegmentRequests.size,this.destroy=(t=!1)=&gt;{this.streamSwarmId=null,this.trackerClient&amp;&amp;(this.trackerClient.stop(),t?(this.trackerClient.removeAllListeners("error"),this.trackerClient.removeAllListeners("warning"),this.trackerClient.removeAllListeners("update"),this.trackerClient.removeAllListeners("peer")):(this.trackerClient.destroy(),this.trackerClient=null)),this.pendingTrackerClient&amp;&amp;(this.pendingTrackerClient.isDestroyed=!0,this.pendingTrackerClient=null),this.peers.forEach(s=&gt;s.destroy()),this.peers.clear(),this.peerSegmentRequests.clear();for(const s of this.peerCandidates.values())for(const o of s)o.destroy();this.peerCandidates.clear()},this.sendSegmentsMapToAll=t=&gt;{this.peers.forEach(s=&gt;s.sendSegmentsMap(t))},this.sendSegmentsMap=(t,s)=&gt;{const o=this.peers.get(t);o&amp;&amp;o.sendSegmentsMap(s)},this.getOverallSegmentsMap=()=&gt;{const t=new Map;for(const s of this.peers.values())for(const[o,f]of s.getSegmentsMap())f===_.MediaPeerSegmentStatus.Loaded?t.set(o,_.MediaPeerSegmentStatus.Loaded):t.get(o)||t.set(o,_.MediaPeerSegmentStatus.LoadingByHttp);return t},this.onPieceBytesDownloaded=(t,s,o)=&gt;{const f=this.peerSegmentRequests.get(s);f&amp;&amp;this.emit("bytes-downloaded",f.segment,o,t.id)},this.onPieceBytesUploaded=function(){var t=w(function*(s,o,f){if(void 0===e.masterSwarmId)return;const I=yield e.segmentsStorage.getSegment(o,e.masterSwarmId);I&amp;&amp;e.emit("bytes-uploaded",I,f,s.id)});return function(s,o,f){return t.apply(this,arguments)}}(),this.onPeerConnect=t=&gt;{if(this.peers.get(t.id))return this.debug("tracker peer already connected (in peer connect)",t.id,t),void t.destroy();this.peers.set(t.id,t);const o=this.peerCandidates.get(t.id);if(o){for(const f of o)f!==t&amp;&amp;f.destroy();this.peerCandidates.delete(t.id)}this.emit("peer-connected",{id:t.id,remoteAddress:t.remoteAddress})},this.onPeerClose=t=&gt;{if(this.peers.get(t.id)!==t){const s=this.peerCandidates.get(t.id);if(!s)return;const o=s.indexOf(t);return-1!==o&amp;&amp;s.splice(o,1),void(0===s.length&amp;&amp;this.peerCandidates.delete(t.id))}for(const[s,o]of this.peerSegmentRequests)o.peerId===t.id&amp;&amp;this.peerSegmentRequests.delete(s);this.peers.delete(t.id),this.emit("peer-data-updated"),this.emit("peer-closed",t.id)},this.onPeerDataUpdated=()=&gt;{this.emit("peer-data-updated")},this.onSegmentRequest=function(){var t=w(function*(s,o){if(void 0===e.masterSwarmId)return;const f=yield e.segmentsStorage.getSegment(o,e.masterSwarmId);f&amp;&amp;f.data?s.sendSegmentData(o,f.data):s.sendSegmentAbsent(o)});return function(s,o){return t.apply(this,arguments)}}(),this.onSegmentLoaded=function(){var t=w(function*(s,o,f){const I=e.peerSegmentRequests.get(o);if(!I)return;const R=I.segment;if(e.settings.segmentValidator)try{yield e.settings.segmentValidator(Object.assign(Object.assign({},R),{data:f}),"p2p",s.id)}catch(S){return e.debug("segment validator failed",S),e.peerSegmentRequests.delete(o),e.emit("segment-error",R,S,s.id),void e.onPeerClose(s)}e.peerSegmentRequests.delete(o),e.emit("segment-loaded",R,f,s.id)});return function(s,o,f){return t.apply(this,arguments)}}(),this.onSegmentAbsent=(t,s)=&gt;{this.peerSegmentRequests.delete(s),this.emit("peer-data-updated")},this.onSegmentError=(t,s,o)=&gt;{const f=this.peerSegmentRequests.get(s);f&amp;&amp;(this.peerSegmentRequests.delete(s),this.emit("segment-error",f.segment,o,t.id))},this.onSegmentSize=(t,s)=&gt;{const o=this.peerSegmentRequests.get(t);o&amp;&amp;this.emit("segment-size",o.segment,s)},this.onSegmentStartLoad=(t,s)=&gt;{const o=this.peerSegmentRequests.get(t);o&amp;&amp;this.emit("segment-start-load",o.segment,s)},this.onSegmentTimeout=(t,s)=&gt;{const o=this.peerSegmentRequests.get(s);o&amp;&amp;(this.peerSegmentRequests.delete(s),t.destroy(),this.peers.delete(o.peerId)&amp;&amp;this.emit("peer-data-updated"))},this.peerId=n.useP2P?function l(){let n=g;for(let e=0;e&lt;20-g.length;e++)n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return(new TextEncoder).encode(n).buffer}():new ArrayBuffer(0),this.debug.enabled&amp;&amp;this.debug("peer ID",this.getPeerId(),(new TextDecoder).decode(this.peerId))}}},54032:(k,M,b)=&gt;{"use strict";var w=b(85752).default;Object.defineProperty(M,"__esModule",{value:!0}),M.SegmentsMemoryStorage=void 0,M.SegmentsMemoryStorage=class C{constructor(P){var E=this;this.settings=P,this.cache=new Map,this.storeSegment=function(){var d=w(function*(v){E.cache.set(v.id,{segment:v,lastAccessed:performance.now()})});return function(v){return d.apply(this,arguments)}}(),this.getSegmentsMap=w(function*(){return E.cache}),this.getSegment=function(){var d=w(function*(v){const _=E.cache.get(v);if(void 0!==_)return _.lastAccessed=performance.now(),_.segment});return function(v){return d.apply(this,arguments)}}(),this.hasSegment=function(){var d=w(function*(v){return E.cache.has(v)});return function(v){return d.apply(this,arguments)}}(),this.clean=function(){var d=w(function*(v,_){const T=[],c=[],u=performance.now();for(const h of E.cache.values())u-h.lastAccessed&gt;E.settings.cachedSegmentExpiration?T.push(h.segment.id):c.push(h);let g=c.length-E.settings.cachedSegmentsCount;if(g&gt;0){c.sort((h,l)=&gt;h.lastAccessed-l.lastAccessed);for(const h of c)if((void 0===_||!_(h.segment.id))&amp;&amp;(T.push(h.segment.id),g--,0===g))break}return T.forEach(h=&gt;E.cache.delete(h)),T.length&gt;0});return function(v,_){return d.apply(this,arguments)}}(),this.destroy=w(function*(){E.cache.clear()})}}},79776:(k,M,b)=&gt;{"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.STEEmitter=void 0;const w=b(91656);M.STEEmitter=class C extends w.EventEmitter{constructor(){super(...arguments),this.on=(P,E)=&gt;super.on(P,E),this.emit=(P,...E)=&gt;super.emit(P,...E)}}},32068:(k,M)=&gt;{"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.byteRangeToString=M.compareByteRanges=M.getByteRange=void 0,M.getByteRange=function b(O){return O.rangeEnd&amp;&amp;void 0!==O.rangeStart?{offset:O.rangeStart,length:O.rangeEnd-O.rangeStart}:void 0},M.compareByteRanges=function w(O,P){return void 0===O?void 0===P:void 0!==P&amp;&amp;O.length===P.length&amp;&amp;O.offset===P.offset},M.byteRangeToString=function C(O){if(void 0!==O)return`bytes=${O.offset}-${O.offset+O.length-1}`}},37096:(k,M,b)=&gt;{"use strict";var w=b(85752).default;Object.defineProperty(M,"__esModule",{value:!0}),M.Engine=void 0;const C=b(91656),O=b(98888),P=b(65224),E=b(47448);M.Engine=class d extends C.EventEmitter{constructor(_={}){super(),this.currentLoaders=[],this.loader=new O.HybridLoader(_.loader),this.segmentManager=new P.SegmentManager(this.loader,_.segments),Object.keys(O.Events).map(T=&gt;O.Events[T]).forEach(T=&gt;this.loader.on(T,(...c)=&gt;this.emit(T,...c)))}static isSupported(){return O.HybridLoader.isSupported()}createLoaderClass(){var _;this.abortCurrentRequest();const T=this;return _=class{constructor(){var u=this;this.load=function(){var g=w(function*(h,l,r){!0!==h.url.endsWith(".m3u8")&amp;&amp;T.addLoaderImpl(u),u.context=h,u.callbacks=r,yield u.impl.load(h,l,r)});return function(h,l,r){return g.apply(this,arguments)}}(),this.abort=()=&gt;{this.context&amp;&amp;this.impl.abort(this.context,this.callbacks)},this.destroy=()=&gt;{this.context&amp;&amp;this.impl.abort(this.context),T.removeLoaderImpl(this)},this.getResponseHeader=()=&gt;{},this.impl=new E.HlsJsLoader(T.segmentManager),this.stats=this.impl.stats}},_.getEngine=()=&gt;T,_}destroy(){var _=this;return w(function*(){_.currentLoaders=[],yield _.segmentManager.destroy()})()}abortCurrentRequest(){for(const _ of this.currentLoaders)_.abort();this.currentLoaders=[]}getSettings(){return{segments:this.segmentManager.getSettings(),loader:this.loader.getSettings()}}getDetails(){return{loader:this.loader.getDetails()}}setPlayingSegment(_,T,c,u){this.segmentManager.setPlayingSegment(_,T,c,u)}setPlayingSegmentByCurrentTime(_){this.segmentManager.setPlayingSegmentByCurrentTime(_)}addLoaderImpl(_){this.currentLoaders.push(_)}removeLoaderImpl(_){this.currentLoaders=this.currentLoaders.filter(T=&gt;T!==_)}}},47448:function(k,M,b){"use strict";var w=b(85752).default,C=this&amp;&amp;this.__importDefault||function(v){return v&amp;&amp;v.__esModule?v:{default:v}};Object.defineProperty(M,"__esModule",{value:!0}),M.HlsJsLoader=void 0;const O=C(b(30221)),P=b(98888),E=b(32068);class d{constructor(_){this.segmentManager=_,this.debug=(0,O.default)("p2pml:hlsjs-loader"),this.stats={loaded:0,total:0,aborted:!1,retry:0,chunkCount:0,bwEstimate:0,loading:{start:0,end:0,first:0},parsing:{start:0,end:0},buffering:{start:0,end:0,first:0}},this.boundOnSegmentAbort=this.onSegmentAbort.bind(this),this.boundOnUpdateSegmentSize=this.onUpdateSegmentSize.bind(this),this.boundOnUpdateLoaded=this.onUpdateLoaded.bind(this),this.boundOnSegmentStartLoad=this.onSegmentStartLoad.bind(this),this.debugId=""}load(_,T,c){var u=this;return w(function*(){if(u.context=_,u.callbacks=c,d.updateStatsToStartLoading(u.stats),u.context.type){u.debug(`Loading playlist ${u.context.url}.`);try{const g=yield u.segmentManager.loadPlaylist(u.context.url);u.debug(`Playlist ${u.context.url} loaded.`),u.successPlaylist(g,u.context,u.callbacks)}catch(g){u.error(g,u.context,u.callbacks)}}else if(u.context.frag){u.loader=u.segmentManager.loader,u.byteRange=(0,E.getByteRange)(u.context),u.debugId=u.byteRange?`${u.context.url} / ${u.byteRange.offset}`:u.context.url,u.debug(`Loading fragment ${u.debugId}.`),u.interval=setInterval(()=&gt;d.updateStatsToStartLoading(u.stats),200),u.loader.on(P.Events.SegmentAbort,u.boundOnSegmentAbort),u.loader.on(P.Events.SegmentSize,u.boundOnUpdateSegmentSize),u.loader.on(P.Events.SegmentStartLoad,u.boundOnSegmentStartLoad);try{const g=yield u.segmentManager.loadSegment(u.context.url,u.byteRange),{content:h}=g;h?(u.successSegment(h,u.context,u.callbacks),u.debug(`Loaded fragment ${u.debugId}.`)):(u.cleanup(),u.debug(`Loaded empty fragment ${u.debugId} (aborted?).`))}catch(g){setTimeout(()=&gt;u.error(g,u.context,u.callbacks),0),u.debug(`Error in fragment ${u.debugId} loading.`,g)}}else console.warn("Unknown load request",u.context)})()}abort(_,T){if(this.stats.loading.end||this.stats.aborted)return;this.debug(`Aborting by hls.js fragment ${this.debugId} loading.`),this.cleanup(),this.segmentManager.abortSegment(_.url,(0,E.getByteRange)(_)),this.stats.aborted=!0;const c=null==T?void 0:T.onAbort;c&amp;&amp;c(this.stats,_,void 0)}successPlaylist(_,T,c){this.cleanup();const u=performance.now();this.stats.loading.end=u,this.stats.loaded=_.response.length,this.stats.total=_.response.length,c.onSuccess({url:_.responseURL,data:_.response},this.stats,T,void 0)}successSegment(_,T,c){this.cleanup();const u=performance.now();this.stats.loading.end=u,this.stats.loaded=_.byteLength,this.stats.total=_.byteLength,c.onProgress&amp;&amp;c.onProgress(this.stats,T,_,void 0),c.onSuccess({url:T.url,data:_},this.stats,T,void 0)}error(_,T,c){this.cleanup(),c.onError(_,T,void 0)}cleanup(){this.interval&amp;&amp;(clearInterval(this.interval),this.interval=void 0),this.loader&amp;&amp;(this.loader.off(P.Events.SegmentStartLoad,this.boundOnSegmentStartLoad),this.loader.off(P.Events.SegmentSize,this.boundOnUpdateSegmentSize),this.loader.off(P.Events.PieceBytesDownloaded,this.boundOnUpdateLoaded),this.loader.off(P.Events.SegmentAbort,this.boundOnSegmentAbort))}onSegmentAbort(_){var T;if(!this.isSegment(_))return;this.debug(`Aborting by p2p-media-loader fragment ${this.debugId||""}.`),this.stats.aborted=!0;const c=null===(T=this.callbacks)||void 0===T?void 0:T.onAbort;c&amp;&amp;c(this.stats,this.context,void 0),this.cleanup()}onUpdateSegmentSize(_,T){this.isSegment(_)&amp;&amp;(this.stats.total=T)}onUpdateLoaded(_,T,c){this.isSegment(T)&amp;&amp;(this.stats.loaded+=c)}onSegmentStartLoad(_,T){!this.interval||"http"!==_||!this.isSegment(T)||(clearInterval(this.interval),this.interval=void 0,d.updateStatsToStartLoading(this.stats),this.loader.on(P.Events.PieceBytesDownloaded,this.boundOnUpdateLoaded))}isSegment(_){return _.url===this.context.url&amp;&amp;_.range===(0,E.byteRangeToString)(this.byteRange)}static updateStatsToStartLoading(_){if(_.aborted)return;const T=performance.now();_.loading.start=T,_.loading.first=T}}M.HlsJsLoader=d},16136:function(k,M,b){"use strict";var w=b(85752).default,C=this&amp;&amp;this.__createBinding||(Object.create?function(r,i,a,n){void 0===n&amp;&amp;(n=a);var e=Object.getOwnPropertyDescriptor(i,a);(!e||("get"in e?!i.__esModule:e.writable||e.configurable))&amp;&amp;(e={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(r,n,e)}:function(r,i,a,n){void 0===n&amp;&amp;(n=a),r[n]=i[a]}),O=this&amp;&amp;this.__exportStar||function(r,i){for(var a in r)"default"!==a&amp;&amp;!Object.prototype.hasOwnProperty.call(i,a)&amp;&amp;C(i,r,a)},P=this&amp;&amp;this.__importDefault||function(r){return r&amp;&amp;r.__esModule?r:{default:r}};Object.defineProperty(M,"__esModule",{value:!0}),M.initJwPlayer=M.initMediaElementJsPlayer=M.initVideoJsHlsJsPlugin=M.initVideoJsContribHlsJsPlayer=M.initFlowplayerHlsJsPlayer=M.initClapprPlayer=M.initHlsJsPlayer=M.version=void 0,M.version="0.6.2",O(b(37096),M),O(b(65224),M);const d=(0,P(b(30221)).default)("p2pml:hlsjs-init");function v(r){r&amp;&amp;r.config&amp;&amp;r.config.loader&amp;&amp;"function"==typeof r.config.loader.getEngine&amp;&amp;l(r,r.config.loader.getEngine())}function l(r,i){r.on("hlsFragChanged",(a,n)=&gt;{d("HLS Frag changed.",n);const e=n.frag;i.setPlayingSegment(e.url,2!==e.byteRange.length?void 0:{offset:e.byteRange[0],length:e.byteRange[1]-e.byteRange[0]},e.start,e.duration)}),r.on("hlsDestroying",w(function*(){yield i.destroy()})),r.on("hlsError",(a,n)=&gt;{if("bufferStalledError"===n.details){const e=void 0===r.media?r.el_:r.media;e&amp;&amp;i.setPlayingSegmentByCurrentTime(e.currentTime)}}),r.on("seeking",()=&gt;{d("Player seeking."),i.abortCurrentRequest()})}M.initHlsJsPlayer=v,M.initClapprPlayer=function _(r){r.on("play",()=&gt;{const i=r.core.getCurrentPlayback();i._hls&amp;&amp;!i._hls._p2pm_linitialized&amp;&amp;(i._hls._p2pm_linitialized=!0,v(r.core.getCurrentPlayback()._hls))})},M.initFlowplayerHlsJsPlayer=function T(r){r.on("ready",()=&gt;{var i;return v(null!==(i=r.engine.hlsjs)&amp;&amp;void 0!==i?i:r.engine.hls)})},M.initVideoJsContribHlsJsPlayer=function c(r){r.ready(()=&gt;{const i=r.tech_.options_;i&amp;&amp;i.hlsjsConfig&amp;&amp;i.hlsjsConfig.loader&amp;&amp;"function"==typeof i.hlsjsConfig.loader.getEngine&amp;&amp;l(r.tech_,i.hlsjsConfig.loader.getEngine())})},M.initVideoJsHlsJsPlugin=function u(){null==videojs||null==videojs.Html5Hlsjs||videojs.Html5Hlsjs.addHook("beforeinitialize",(r,i)=&gt;{i.config&amp;&amp;i.config.loader&amp;&amp;"function"==typeof i.config.loader.getEngine&amp;&amp;l(i,i.config.loader.getEngine())})},M.initMediaElementJsPlayer=function g(r){r.addEventListener("hlsFragChanged",i=&gt;{const a=r.hlsPlayer;if(a&amp;&amp;a.config&amp;&amp;a.config.loader&amp;&amp;"function"==typeof a.config.loader.getEngine){const n=a.config.loader.getEngine();if(i.data&amp;&amp;i.data.length&gt;1){const e=i.data[1].frag;n.setPlayingSegment(e.url,2!==e.byteRange.length?void 0:{offset:e.byteRange[0],length:e.byteRange[1]-e.byteRange[0]},e.start,e.duration)}}}),r.addEventListener("hlsDestroying",w(function*(){const i=r.hlsPlayer;i&amp;&amp;i.config&amp;&amp;i.config.loader&amp;&amp;"function"==typeof i.config.loader.getEngine&amp;&amp;(yield i.config.loader.getEngine().destroy())})),r.addEventListener("hlsError",i=&gt;{const a=r.hlsPlayer;a&amp;&amp;a.config&amp;&amp;a.config.loader&amp;&amp;"function"==typeof a.config.loader.getEngine&amp;&amp;void 0!==i.data&amp;&amp;"bufferStalledError"===i.data.details&amp;&amp;a.config.loader.getEngine().setPlayingSegmentByCurrentTime(a.media.currentTime)})},M.initJwPlayer=function h(r,i){const a=setInterval(()=&gt;{r.hls&amp;&amp;r.hls.config&amp;&amp;(clearInterval(a),Object.assign(r.hls.config,i),v(r.hls))},200)}},65224:function(k,M,b){"use strict";var w=b(85752).default,C=this&amp;&amp;this.__importDefault||function(u){return u&amp;&amp;u.__esModule?u:{default:u}};Object.defineProperty(M,"__esModule",{value:!0}),M.SegmentManager=void 0;const O=C(b(30221)),P=b(98888),E=b(25076),d=b(32068),v={forwardSegmentCount:20,swarmId:void 0,assetsStorage:void 0};M.SegmentManager=class _{constructor(g,h={}){this.debug=(0,O.default)("p2pml:segment-manager"),this.masterPlaylist=null,this.variantPlaylists=new Map,this.segmentRequest=null,this.playQueue=[],this.onSegmentLoaded=l=&gt;{this.segmentRequest&amp;&amp;this.segmentRequest.segmentUrl===l.url&amp;&amp;(0,d.byteRangeToString)(this.segmentRequest.segmentByteRange)===l.range&amp;&amp;(this.segmentRequest.onSuccess(l.data.slice(0),l.downloadBandwidth),this.segmentRequest=null)},this.onSegmentError=(l,r)=&gt;{this.segmentRequest&amp;&amp;this.segmentRequest.segmentUrl===l.url&amp;&amp;(0,d.byteRangeToString)(this.segmentRequest.segmentByteRange)===l.range&amp;&amp;(this.segmentRequest.onError(r),this.segmentRequest=null)},this.onSegmentAbort=l=&gt;{this.segmentRequest&amp;&amp;this.segmentRequest.segmentUrl===l.url&amp;&amp;(0,d.byteRangeToString)(this.segmentRequest.segmentByteRange)===l.range&amp;&amp;(this.segmentRequest.onError("Loading aborted: internal abort"),this.segmentRequest=null)},this.settings=Object.assign(Object.assign({},v),h),this.loader=g,this.loader.on(P.Events.SegmentLoaded,this.onSegmentLoaded),this.loader.on(P.Events.SegmentError,this.onSegmentError),this.loader.on(P.Events.SegmentAbort,this.onSegmentAbort)}getSettings(){return this.settings}processPlaylist(g,h,l){const r=new E.Parser;r.push(h),r.end();const i=new T(g,l,r.manifest);if(i.manifest.playlists){this.masterPlaylist=i;for(const[a,n]of this.variantPlaylists){const{streamSwarmId:e,found:t,index:s}=this.getStreamSwarmId(n.requestUrl);t?(n.streamSwarmId=e,n.streamId="V"+s.toString()):this.variantPlaylists.delete(a)}}else{const{streamSwarmId:a,found:n,index:e}=this.getStreamSwarmId(g);(n||null===this.masterPlaylist)&amp;&amp;(i.streamSwarmId=a,i.streamId=null===this.masterPlaylist?void 0:"V"+e.toString(),this.variantPlaylists.set(g,i),this.updateSegments())}}loadPlaylist(g){var h=this;return w(function*(){const l=h.settings.assetsStorage;let r;if(void 0!==l){let i;i=h.getMasterSwarmId(),void 0===i&amp;&amp;(i=g.split("?")[0]);const a=yield l.getAsset(g,void 0,i);void 0!==a?r={responseURL:a.responseUri,response:a.data}:(r=yield h.loadContent(g,"text"),l.storeAsset({masterManifestUri:null!==h.masterPlaylist?h.masterPlaylist.requestUrl:g,masterSwarmId:i,requestUri:g,responseUri:r.responseURL,data:r.response}))}else r=yield h.loadContent(g,"text");return h.processPlaylist(g,r.response,r.responseURL),r})()}loadSegment(g,h){var l=this;return w(function*(){var r;const i=l.getSegmentLocation(g,h),a=(0,d.byteRangeToString)(h);if(!i){let t;const s=l.settings.assetsStorage;if(void 0!==s){let f,o=null===(r=l.masterPlaylist)||void 0===r?void 0:r.requestUrl;if(f=l.getMasterSwarmId(),void 0===f&amp;&amp;1===l.variantPlaylists.size){const I=l.variantPlaylists.values().next();I.done||(f=I.value.requestUrl.split("?")[0])}if(void 0===o&amp;&amp;1===l.variantPlaylists.size){const I=l.variantPlaylists.values().next();I.done||(o=I.value.requestUrl)}if(void 0!==f&amp;&amp;void 0!==o){const I=yield s.getAsset(g,a,f);if(void 0!==I)t=I.data;else{const R=yield l.loadContent(g,"arraybuffer",a);t=R.response,s.storeAsset({masterManifestUri:o,masterSwarmId:f,requestUri:g,requestRange:a,responseUri:R.responseURL,data:t})}}}return void 0===t&amp;&amp;(t=(yield l.loadContent(g,"arraybuffer",a)).response),{content:t,downloadBandwidth:0}}const n=(i.playlist.manifest.mediaSequence?i.playlist.manifest.mediaSequence:0)+i.segmentIndex;l.playQueue.length&gt;0&amp;&amp;l.playQueue[l.playQueue.length-1].segmentSequence!==n-1&amp;&amp;(l.playQueue=[]),l.segmentRequest&amp;&amp;l.segmentRequest.onError("Cancel segment request: simultaneous segment requests are not supported");const e=new Promise((t,s)=&gt;{l.segmentRequest=new c(g,h,n,i.playlist.requestUrl,(o,f)=&gt;t({content:o,downloadBandwidth:f}),o=&gt;s(o))});return l.playQueue.push({segmentUrl:g,segmentByteRange:h,segmentSequence:n}),l.loadSegments(i.playlist,i.segmentIndex,!0),e})()}setPlayingSegment(g,h,l,r){const i=this.playQueue.findIndex(a=&gt;a.segmentUrl===g&amp;&amp;(0,d.compareByteRanges)(a.segmentByteRange,h));this.debug("Set playing segment to index %d",i,this.playQueue),i&gt;=0&amp;&amp;(this.playQueue=this.playQueue.slice(i),this.playQueue[0].playPosition={start:l,duration:r},this.updateSegments())}setPlayingSegmentByCurrentTime(g){if(0===this.playQueue.length||!this.playQueue[0].playPosition)return;const h=this.playQueue[0].playPosition;h.start+h.duration-g&lt;.2&amp;&amp;(this.playQueue=this.playQueue.slice(1),this.updateSegments())}abortSegment(g,h){this.segmentRequest&amp;&amp;this.segmentRequest.segmentUrl===g&amp;&amp;(0,d.compareByteRanges)(this.segmentRequest.segmentByteRange,h)&amp;&amp;(this.segmentRequest.onSuccess(void 0,0),this.segmentRequest=null)}abortCurrentSegment(){this.segmentRequest&amp;&amp;(this.segmentRequest.onSuccess(void 0,0),this.segmentRequest=null)}destroy(){var g=this;return w(function*(){g.segmentRequest&amp;&amp;(g.segmentRequest.onError("Loading aborted: object destroyed"),g.segmentRequest=null),g.masterPlaylist=null,g.variantPlaylists.clear(),g.playQueue=[],void 0!==g.settings.assetsStorage&amp;&amp;(yield g.settings.assetsStorage.destroy()),yield g.loader.destroy()})()}updateSegments(){if(!this.segmentRequest)return;const g=this.getSegmentLocation(this.segmentRequest.segmentUrl,this.segmentRequest.segmentByteRange);this.debug("update segments",g),g&amp;&amp;this.loadSegments(g.playlist,g.segmentIndex,!1)}getSegmentLocation(g,h){for(const l of this.variantPlaylists.values()){const r=l.getSegmentIndex(g,h);if(r&gt;=0)return{playlist:l,segmentIndex:r}}}loadSegments(g,h,l){var r=this;return w(function*(){var i;const a=[],n=g.manifest.segments,e=null!==(i=g.manifest.mediaSequence)&amp;&amp;void 0!==i?i:0;let t=null,s=Math.max(0,r.playQueue.length-1);const o=r.getMasterSwarmId();r.debug("load segments",s,h);for(let f=h;f&lt;n.length&amp;&amp;a.length&lt;r.settings.forwardSegmentCount;++f){const I=g.manifest.segments[f],R=g.getSegmentAbsoluteUrl(I.uri),S=I.byterange,y=r.getSegmentId(g,e+f);a.push({id:y,url:R,masterSwarmId:void 0!==o?o:g.streamSwarmId,masterManifestUri:null!==r.masterPlaylist?r.masterPlaylist.requestUrl:g.requestUrl,streamId:g.streamId,sequence:(e+f).toString(),range:(0,d.byteRangeToString)(S),priority:s++}),l&amp;&amp;!t&amp;&amp;(t=y)}if(r.loader.load(a,g.streamSwarmId),t){const f=yield r.loader.getSegment(t);f&amp;&amp;r.onSegmentLoaded(f)}})()}getSegmentId(g,h){return`${g.streamSwarmId}+${h}`}getMasterSwarmId(){const g=this.settings.swarmId&amp;&amp;0!==this.settings.swarmId.length?this.settings.swarmId:void 0;return void 0!==g?g:null!==this.masterPlaylist?this.masterPlaylist.requestUrl.split("?")[0]:void 0}getStreamSwarmId(g){const h=this.getMasterSwarmId();if(this.masterPlaylist&amp;&amp;this.masterPlaylist.manifest.playlists&amp;&amp;h)for(let l=0;l&lt;this.masterPlaylist.manifest.playlists.length;++l)if(new URL(this.masterPlaylist.manifest.playlists[l].uri,this.masterPlaylist.responseUrl).toString()===g)return{streamSwarmId:`${h}+V${l}`,found:!0,index:l};return{streamSwarmId:null!=h?h:g.split("?")[0],found:!1,index:-1}}loadContent(g,h,l){var r=this;return w(function*(){return new Promise((i,a)=&gt;{const n=new XMLHttpRequest;n.open("GET",g,!0),n.responseType=h,l&amp;&amp;n.setRequestHeader("Range",l),n.addEventListener("readystatechange",()=&gt;{4===n.readyState&amp;&amp;(n.status&gt;=200&amp;&amp;n.status&lt;300?i(n):a(n.statusText))});const e=r.loader.getSettings().xhrSetup;e&amp;&amp;e(n,g),n.send()})})()}};class T{constructor(g,h,l){this.requestUrl=g,this.responseUrl=h,this.manifest=l,this.streamSwarmId=""}getSegmentIndex(g,h){for(let l=0;l&lt;this.manifest.segments.length;++l){const r=this.manifest.segments[l];if(g===this.getSegmentAbsoluteUrl(r.uri)&amp;&amp;(0,d.compareByteRanges)(r.byterange,h))return l}return-1}getSegmentAbsoluteUrl(g){return new URL(g,this.responseUrl).toString()}}class c{constructor(g,h,l,r,i,a){this.segmentUrl=g,this.segmentByteRange=h,this.segmentSequence=l,this.playlistRequestUrl=r,this.onSuccess=i,this.onError=a}}},65208:(k,M,b)=&gt;{const w=b(30221)("bittorrent-tracker:client"),C=b(91656),O=b(39980),P=b(81652),E=b(81872),d=b(6749),v=b(38144),_=b(44856),T=b(32808),c=b(11984);k.exports=(()=&gt;{class g extends C{constructor(l={}){if(super(),!l.peerId)throw new Error("Option `peerId` is required");if(!l.infoHash)throw new Error("Option `infoHash` is required");if(!l.announce)throw new Error("Option `announce` is required");if(!process.browser&amp;&amp;!l.port)throw new Error("Option `port` is required");this.peerId="string"==typeof l.peerId?l.peerId:l.peerId.toString("hex"),this._peerIdBuffer=Buffer.from(this.peerId,"hex"),this._peerIdBinary=this._peerIdBuffer.toString("binary"),this.infoHash="string"==typeof l.infoHash?l.infoHash.toLowerCase():l.infoHash.toString("hex"),this._infoHashBuffer=Buffer.from(this.infoHash,"hex"),this._infoHashBinary=this._infoHashBuffer.toString("binary"),w("new client %s",this.infoHash),this.destroyed=!1,this._port=l.port,this._getAnnounceOpts=l.getAnnounceOpts,this._rtcConfig=l.rtcConfig,this._userAgent=l.userAgent,this._proxyOpts=l.proxyOpts,this._wrtc="function"==typeof l.wrtc?l.wrtc():l.wrtc;let r="string"==typeof l.announce?[l.announce]:null==l.announce?[]:l.announce;r=r.map(n=&gt;("/"===(n=n.toString())[n.length-1]&amp;&amp;(n=n.substring(0,n.length-1)),n)),r=Array.from(new Set(r));const i=!1!==this._wrtc&amp;&amp;(!!this._wrtc||E.WEBRTC_SUPPORT),a=n=&gt;{d(()=&gt;{this.emit("warning",n)})};this._trackers=r.map(n=&gt;{let e;try{e=v.parseUrl(n)}catch{return a(new Error(`Invalid tracker URL: ${n}`)),null}const t=e.port;if(t&lt;0||t&gt;65535)return a(new Error(`Invalid tracker port: ${n}`)),null;const s=e.protocol;return"http:"!==s&amp;&amp;"https:"!==s||"function"!=typeof _?"udp:"===s&amp;&amp;"function"==typeof T?new T(this,n):"ws:"!==s&amp;&amp;"wss:"!==s||!i||"ws:"===s&amp;&amp;typeof window&lt;"u"&amp;&amp;"https:"===window.location.protocol?(a(new Error(`Unsupported tracker protocol: ${n}`)),null):new c(this,n):new _(this,n)}).filter(Boolean)}start(l){(l=this._defaultAnnounceOpts(l)).event="started",w("send `start` %o",l),this._announce(l),this._trackers.forEach(r=&gt;{r.setInterval()})}stop(l){(l=this._defaultAnnounceOpts(l)).event="stopped",w("send `stop` %o",l),this._announce(l)}complete(l){l||(l={}),(l=this._defaultAnnounceOpts(l)).event="completed",w("send `complete` %o",l),this._announce(l)}update(l){(l=this._defaultAnnounceOpts(l)).event&amp;&amp;delete l.event,w("send `update` %o",l),this._announce(l)}_announce(l){this._trackers.forEach(r=&gt;{r.announce(l)})}scrape(l){w("send `scrape`"),l||(l={}),this._trackers.forEach(r=&gt;{r.scrape(l)})}setInterval(l){w("setInterval %d",l),this._trackers.forEach(r=&gt;{r.setInterval(l)})}destroy(l){if(this.destroyed)return;this.destroyed=!0,w("destroy");const r=this._trackers.map(i=&gt;a=&gt;{i.destroy(a)});P(r,l),this._trackers=[],this._getAnnounceOpts=null}_defaultAnnounceOpts(l={}){return null==l.numwant&amp;&amp;(l.numwant=v.DEFAULT_ANNOUNCE_PEERS),null==l.uploaded&amp;&amp;(l.uploaded=0),null==l.downloaded&amp;&amp;(l.downloaded=0),this._getAnnounceOpts&amp;&amp;(l=Object.assign({},l,this._getAnnounceOpts())),l}}return g.scrape=(h,l)=&gt;{if(l=O(l),!h.infoHash)throw new Error("Option `infoHash` is required");if(!h.announce)throw new Error("Option `announce` is required");const r=Object.assign({},h,{infoHash:Array.isArray(h.infoHash)?h.infoHash[0]:h.infoHash,peerId:Buffer.from("01234567890123456789"),port:6881}),i=new g(r);i.once("error",l),i.once("warning",l);let a=Array.isArray(h.infoHash)?h.infoHash.length:1;const n={};return i.on("scrape",e=&gt;{if(a-=1,n[e.infoHash]=e,0===a){i.destroy();const t=Object.keys(n);l(null,1===t.length?n[t[0]]:n)}}),h.infoHash=Array.isArray(h.infoHash)?h.infoHash.map(e=&gt;Buffer.from(e,"hex")):Buffer.from(h.infoHash,"hex"),i.scrape({infoHash:h.infoHash}),i},g})()},48376:(k,M,b)=&gt;{const w=b(91656);k.exports=class C extends w{constructor(P,E){super(),this.client=P,this.announceUrl=E,this.interval=null,this.destroyed=!1}setInterval(P){null==P&amp;&amp;(P=this.DEFAULT_ANNOUNCE_INTERVAL),clearInterval(this.interval),P&amp;&amp;(this.interval=setInterval(()=&gt;{this.announce(this.client._defaultAnnounceOpts())},P),this.interval.unref&amp;&amp;this.interval.unref())}}},11984:(k,M,b)=&gt;{const w=b(89364),C=b(30221)("bittorrent-tracker:websocket-tracker"),O=b(81872),P=b(42368),E=b(34868),d=b(34288),v=b(38144),_=b(48376),T={};class l extends _{constructor(a,n){super(a,n),C("new websocket tracker %s",n),this.peers={},this.socket=null,this.reconnecting=!1,this.retries=0,this.reconnectTimer=null,this.expectingResponse=!1,this._openSocket()}announce(a){if(this.destroyed||this.reconnecting)return;if(!this.socket.connected)return void this.socket.once("connect",()=&gt;{this.announce(a)});const n=Object.assign({},a,{action:"announce",info_hash:this.client._infoHashBinary,peer_id:this.client._peerIdBinary});if(this._trackerId&amp;&amp;(n.trackerid=this._trackerId),"stopped"===a.event||"completed"===a.event)this._send(n);else{const e=Math.min(a.numwant,5);this._generateOffers(e,t=&gt;{n.numwant=e,n.offers=t,this._send(n)})}}scrape(a){if(this.destroyed||this.reconnecting)return;if(!this.socket.connected)return void this.socket.once("connect",()=&gt;{this.scrape(a)});const e={action:"scrape",info_hash:Array.isArray(a.infoHash)&amp;&amp;a.infoHash.length&gt;0?a.infoHash.map(t=&gt;t.toString("binary")):a.infoHash&amp;&amp;a.infoHash.toString("binary")||this.client._infoHashBinary};this._send(e)}destroy(a=r){if(this.destroyed)return a(null);this.destroyed=!0,clearInterval(this.interval),clearTimeout(this.reconnectTimer);for(const s in this.peers){const o=this.peers[s];clearTimeout(o.trackerTimeout),o.destroy()}if(this.peers=null,this.socket&amp;&amp;(this.socket.removeListener("connect",this._onSocketConnectBound),this.socket.removeListener("data",this._onSocketDataBound),this.socket.removeListener("close",this._onSocketCloseBound),this.socket.removeListener("error",this._onSocketErrorBound),this.socket=null),this._onSocketConnectBound=null,this._onSocketErrorBound=null,this._onSocketDataBound=null,this._onSocketCloseBound=null,T[this.announceUrl]&amp;&amp;(T[this.announceUrl].consumers-=1),T[this.announceUrl].consumers&gt;0)return a();let e,n=T[this.announceUrl];if(delete T[this.announceUrl],n.on("error",r),n.once("close",a),!this.expectingResponse)return t();function t(){e&amp;&amp;(clearTimeout(e),e=null),n.removeListener("data",t),n.destroy(),n=null}e=setTimeout(t,v.DESTROY_TIMEOUT),n.once("data",t)}_openSocket(){if(this.destroyed=!1,this.peers||(this.peers={}),this._onSocketConnectBound=()=&gt;{this._onSocketConnect()},this._onSocketErrorBound=a=&gt;{this._onSocketError(a)},this._onSocketDataBound=a=&gt;{this._onSocketData(a)},this._onSocketCloseBound=()=&gt;{this._onSocketClose()},this.socket=T[this.announceUrl],this.socket)T[this.announceUrl].consumers+=1,this.socket.connected&amp;&amp;this._onSocketConnectBound();else{const a=new URL(this.announceUrl);let n;this.client._proxyOpts&amp;&amp;(n="wss:"===a.protocol?this.client._proxyOpts.httpsAgent:this.client._proxyOpts.httpAgent,!n&amp;&amp;this.client._proxyOpts.socksProxy&amp;&amp;(n=new d.Agent(w(this.client._proxyOpts.socksProxy),"wss:"===a.protocol))),this.socket=T[this.announceUrl]=new E({url:this.announceUrl,agent:n}),this.socket.consumers=1,this.socket.once("connect",this._onSocketConnectBound)}this.socket.on("data",this._onSocketDataBound),this.socket.once("close",this._onSocketCloseBound),this.socket.once("error",this._onSocketErrorBound)}_onSocketConnect(){this.destroyed||this.reconnecting&amp;&amp;(this.reconnecting=!1,this.retries=0,this.announce(this.client._defaultAnnounceOpts()))}_onSocketData(a){if(!this.destroyed){this.expectingResponse=!1;try{a=JSON.parse(a)}catch{return void this.client.emit("warning",new Error("Invalid tracker response"))}"announce"===a.action?this._onAnnounceResponse(a):"scrape"===a.action?this._onScrapeResponse(a):this._onSocketError(new Error(`invalid action in WS response: ${a.action}`))}}_onAnnounceResponse(a){if(a.info_hash!==this.client._infoHashBinary)return void C("ignoring websocket data from %s for %s (looking for %s: reused socket)",this.announceUrl,v.binaryToHex(a.info_hash),this.client.infoHash);if(a.peer_id&amp;&amp;a.peer_id===this.client._peerIdBinary)return;C("received %s from %s for %s",JSON.stringify(a),this.announceUrl,this.client.infoHash);const n=a["failure reason"];if(n)return this.client.emit("warning",new Error(n));const e=a["warning message"];e&amp;&amp;this.client.emit("warning",new Error(e));const t=a.interval||a["min interval"];t&amp;&amp;this.setInterval(1e3*t);const s=a["tracker id"];if(s&amp;&amp;(this._trackerId=s),null!=a.complete){const f=Object.assign({},a,{announce:this.announceUrl,infoHash:v.binaryToHex(a.info_hash)});this.client.emit("update",f)}let o;if(a.offer&amp;&amp;a.peer_id&amp;&amp;(C("creating peer (from remote offer)"),o=this._createPeer(),o.id=v.binaryToHex(a.peer_id),o.once("signal",f=&gt;{const I={action:"announce",info_hash:this.client._infoHashBinary,peer_id:this.client._peerIdBinary,to_peer_id:a.peer_id,answer:f,offer_id:a.offer_id};this._trackerId&amp;&amp;(I.trackerid=this._trackerId),this._send(I)}),this.client.emit("peer",o),o.signal(a.offer)),a.answer&amp;&amp;a.peer_id){const f=v.binaryToHex(a.offer_id);o=this.peers[f],o?(o.id=v.binaryToHex(a.peer_id),this.client.emit("peer",o),o.signal(a.answer),clearTimeout(o.trackerTimeout),o.trackerTimeout=null,delete this.peers[f]):C(`got unexpected answer: ${JSON.stringify(a.answer)}`)}}_onScrapeResponse(a){a=a.files||{};const n=Object.keys(a);0!==n.length?n.forEach(e=&gt;{const t=Object.assign(a[e],{announce:this.announceUrl,infoHash:v.binaryToHex(e)});this.client.emit("scrape",t)}):this.client.emit("warning",new Error("invalid scrape response"))}_onSocketClose(){this.destroyed||(this.destroy(),this._startReconnectTimer())}_onSocketError(a){this.destroyed||(this.destroy(),this.client.emit("warning",a),this._startReconnectTimer())}_startReconnectTimer(){const a=Math.floor(3e5*Math.random())+Math.min(1e4*Math.pow(2,this.retries),36e5);this.reconnecting=!0,clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout(()=&gt;{this.retries++,this._openSocket()},a),this.reconnectTimer.unref&amp;&amp;this.reconnectTimer.unref(),C("reconnecting socket in %s ms",a)}_send(a){if(this.destroyed)return;this.expectingResponse=!0;const n=JSON.stringify(a);C("send %s",n),this.socket.send(n)}_generateOffers(a,n){const e=this,t=[];C("generating %s offers",a);for(let f=0;f&lt;a;++f)s();function s(){const f=P(20).toString("hex");C("creating peer (from _generateOffers)");const I=e.peers[f]=e._createPeer({initiator:!0});I.once("signal",R=&gt;{t.push({offer:R,offer_id:v.hexToBinary(f)}),o()}),I.trackerTimeout=setTimeout(()=&gt;{C("tracker timeout: destroying peer"),I.trackerTimeout=null,delete e.peers[f],I.destroy()},5e4),I.trackerTimeout.unref&amp;&amp;I.trackerTimeout.unref()}function o(){t.length===a&amp;&amp;(C("generated %s offers",a),n(t))}o()}_createPeer(a){const n=this;a=Object.assign({trickle:!1,config:n.client._rtcConfig,wrtc:n.client._wrtc},a);const e=new O(a);return e.once("error",t),e.once("connect",function s(){e.removeListener("error",t),e.removeListener("connect",s)}),e;function t(o){n.client.emit("warning",new Error(`Connection error: ${o.message}`)),e.destroy()}}}function r(){}l.prototype.DEFAULT_ANNOUNCE_INTERVAL=3e4,l._socketPool=T,k.exports=l},38144:(k,M,b)=&gt;{M.DEFAULT_ANNOUNCE_PEERS=50,M.MAX_ANNOUNCE_PEERS=82,M.binaryToHex=C=&gt;("string"!=typeof C&amp;&amp;(C=String(C)),Buffer.from(C,"binary").toString("hex")),M.hexToBinary=C=&gt;("string"!=typeof C&amp;&amp;(C=String(C)),Buffer.from(C,"hex").toString("binary")),M.parseUrl=C=&gt;{const O=new URL(C.replace(/^udp:/,"http:"));return C.match(/^udp:/)&amp;&amp;Object.defineProperties(O,{href:{value:O.href.replace(/^http/,"udp")},protocol:{value:O.protocol.replace(/^http/,"udp")},origin:{value:O.origin.replace(/^http/,"udp")}}),O};const w=b(90012);Object.assign(M,w)},89364:k=&gt;{var M=function(){"use strict";function b(c,u){return null!=u&amp;&amp;c instanceof u}var w,C,O;try{w=Map}catch{w=function(){}}try{C=Set}catch{C=function(){}}try{O=Promise}catch{O=function(){}}function P(c,u,g,h,l){"object"==typeof u&amp;&amp;(g=u.depth,h=u.prototype,l=u.includeNonEnumerable,u=u.circular);var r=[],i=[],a=typeof Buffer&lt;"u";return typeof u&gt;"u"&amp;&amp;(u=!0),typeof g&gt;"u"&amp;&amp;(g=1/0),function n(e,t){if(null===e)return null;if(0===t)return e;var s,o;if("object"!=typeof e)return e;if(b(e,w))s=new w;else if(b(e,C))s=new C;else if(b(e,O))s=new O(function(V,J){e.then(function(Q){V(n(Q,t-1))},function(Q){J(n(Q,t-1))})});else if(P.__isArray(e))s=[];else if(P.__isRegExp(e))s=new RegExp(e.source,T(e)),e.lastIndex&amp;&amp;(s.lastIndex=e.lastIndex);else if(P.__isDate(e))s=new Date(e.getTime());else{if(a&amp;&amp;Buffer.isBuffer(e))return s=Buffer.allocUnsafe?Buffer.allocUnsafe(e.length):new Buffer(e.length),e.copy(s),s;b(e,Error)?s=Object.create(e):typeof h&gt;"u"?(o=Object.getPrototypeOf(e),s=Object.create(o)):(s=Object.create(h),o=h)}if(u){var f=r.indexOf(e);if(-1!=f)return i[f];r.push(e),i.push(s)}for(var I in b(e,w)&amp;&amp;e.forEach(function(V,J){var Q=n(J,t-1),q=n(V,t-1);s.set(Q,q)}),b(e,C)&amp;&amp;e.forEach(function(V){var J=n(V,t-1);s.add(J)}),e){var R;o&amp;&amp;(R=Object.getOwnPropertyDescriptor(o,I)),(!R||null!=R.set)&amp;&amp;(s[I]=n(e[I],t-1))}if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(e);for(I=0;I&lt;S.length;I++){var y=S[I];(j=Object.getOwnPropertyDescriptor(e,y))&amp;&amp;!j.enumerable&amp;&amp;!l||(s[y]=n(e[y],t-1),j.enumerable||Object.defineProperty(s,y,{enumerable:!1}))}}if(l){var U=Object.getOwnPropertyNames(e);for(I=0;I&lt;U.length;I++){var j,K=U[I];(j=Object.getOwnPropertyDescriptor(e,K))&amp;&amp;j.enumerable||(s[K]=n(e[K],t-1),Object.defineProperty(s,K,{enumerable:!1}))}}return s}(c,g)}function E(c){return Object.prototype.toString.call(c)}function T(c){var u="";return c.global&amp;&amp;(u+="g"),c.ignoreCase&amp;&amp;(u+="i"),c.multiline&amp;&amp;(u+="m"),u}return P.clonePrototype=function(u){if(null===u)return null;var g=function(){};return g.prototype=u,new g},P.__objToStr=E,P.__isDate=function d(c){return"object"==typeof c&amp;&amp;"[object Date]"===E(c)},P.__isArray=function v(c){return"object"==typeof c&amp;&amp;"[object Array]"===E(c)},P.__isRegExp=function _(c){return"object"==typeof c&amp;&amp;"[object RegExp]"===E(c)},P.__getRegExpFlags=T,P}();k.exports&amp;&amp;(k.exports=M)},89368:k=&gt;{"use strict";function M(w,C){for(const O in C)Object.defineProperty(w,O,{value:C[O],enumerable:!0,configurable:!0});return w}k.exports=function b(w,C,O){if(!w||"string"==typeof w)throw new TypeError("Please pass an Error to err-code");O||(O={}),"object"==typeof C&amp;&amp;(O=C,C=""),C&amp;&amp;(O.code=C);try{return M(w,O)}catch{O.message=w.message,O.stack=w.stack;const E=function(){};return E.prototype=Object.create(Object.getPrototypeOf(w)),M(new E,O)}}},91656:k=&gt;{"use strict";var w,M="object"==typeof Reflect?Reflect:null,b=M&amp;&amp;"function"==typeof M.apply?M.apply:function(t,s,o){return Function.prototype.apply.call(t,s,o)};w=M&amp;&amp;"function"==typeof M.ownKeys?M.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var O=Number.isNaN||function(t){return t!=t};function P(){P.init.call(this)}k.exports=P,k.exports.once=function i(e,t){return new Promise(function(s,o){function f(R){e.removeListener(t,I),o(R)}function I(){"function"==typeof e.removeListener&amp;&amp;e.removeListener("error",f),s([].slice.call(arguments))}n(e,t,I,{once:!0}),"error"!==t&amp;&amp;function a(e,t,s){"function"==typeof e.on&amp;&amp;n(e,"error",t,s)}(e,f,{once:!0})})},P.EventEmitter=P,P.prototype._events=void 0,P.prototype._eventsCount=0,P.prototype._maxListeners=void 0;var E=10;function d(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function v(e){return void 0===e._maxListeners?P.defaultMaxListeners:e._maxListeners}function _(e,t,s,o){var f,I,R;if(d(s),void 0===(I=e._events)?(I=e._events=Object.create(null),e._eventsCount=0):(void 0!==I.newListener&amp;&amp;(e.emit("newListener",t,s.listener?s.listener:s),I=e._events),R=I[t]),void 0===R)R=I[t]=s,++e._eventsCount;else if("function"==typeof R?R=I[t]=o?[s,R]:[R,s]:o?R.unshift(s):R.push(s),(f=v(e))&gt;0&amp;&amp;R.length&gt;f&amp;&amp;!R.warned){R.warned=!0;var S=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");S.name="MaxListenersExceededWarning",S.emitter=e,S.type=t,S.count=R.length,function C(e){console&amp;&amp;console.warn&amp;&amp;console.warn(e)}(S)}return e}function T(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(e,t,s){var o={fired:!1,wrapFn:void 0,target:e,type:t,listener:s},f=T.bind(o);return f.listener=s,o.wrapFn=f,f}function u(e,t,s){var o=e._events;if(void 0===o)return[];var f=o[t];return void 0===f?[]:"function"==typeof f?s?[f.listener||f]:[f]:s?function r(e){for(var t=new Array(e.length),s=0;s&lt;t.length;++s)t[s]=e[s].listener||e[s];return t}(f):h(f,f.length)}function g(e){var t=this._events;if(void 0!==t){var s=t[e];if("function"==typeof s)return 1;if(void 0!==s)return s.length}return 0}function h(e,t){for(var s=new Array(t),o=0;o&lt;t;++o)s[o]=e[o];return s}function n(e,t,s,o){if("function"==typeof e.on)o.once?e.once(t,s):e.on(t,s);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function f(I){o.once&amp;&amp;e.removeEventListener(t,f),s(I)})}}Object.defineProperty(P,"defaultMaxListeners",{enumerable:!0,get:function(){return E},set:function(e){if("number"!=typeof e||e&lt;0||O(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");E=e}}),P.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&amp;&amp;(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},P.prototype.setMaxListeners=function(t){if("number"!=typeof t||t&lt;0||O(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},P.prototype.getMaxListeners=function(){return v(this)},P.prototype.emit=function(t){for(var s=[],o=1;o&lt;arguments.length;o++)s.push(arguments[o]);var f="error"===t,I=this._events;if(void 0!==I)f=f&amp;&amp;void 0===I.error;else if(!f)return!1;if(f){var R;if(s.length&gt;0&amp;&amp;(R=s[0]),R instanceof Error)throw R;var S=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw S.context=R,S}var y=I[t];if(void 0===y)return!1;if("function"==typeof y)b(y,this,s);else{var j=y.length,U=h(y,j);for(o=0;o&lt;j;++o)b(U[o],this,s)}return!0},P.prototype.on=P.prototype.addListener=function(t,s){return _(this,t,s,!1)},P.prototype.prependListener=function(t,s){return _(this,t,s,!0)},P.prototype.once=function(t,s){return d(s),this.on(t,c(this,t,s)),this},P.prototype.prependOnceListener=function(t,s){return d(s),this.prependListener(t,c(this,t,s)),this},P.prototype.off=P.prototype.removeListener=function(t,s){var o,f,I,R,S;if(d(s),void 0===(f=this._events))return this;if(void 0===(o=f[t]))return this;if(o===s||o.listener===s)0==--this._eventsCount?this._events=Object.create(null):(delete f[t],f.removeListener&amp;&amp;this.emit("removeListener",t,o.listener||s));else if("function"!=typeof o){for(I=-1,R=o.length-1;R&gt;=0;R--)if(o[R]===s||o[R].listener===s){S=o[R].listener,I=R;break}if(I&lt;0)return this;0===I?o.shift():function l(e,t){for(;t+1&lt;e.length;t++)e[t]=e[t+1];e.pop()}(o,I),1===o.length&amp;&amp;(f[t]=o[0]),void 0!==f.removeListener&amp;&amp;this.emit("removeListener",t,S||s)}return this},P.prototype.removeAllListeners=function(t){var s,o,f;if(void 0===(o=this._events))return this;if(void 0===o.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==o[t]&amp;&amp;(0==--this._eventsCount?this._events=Object.create(null):delete o[t]),this;if(0===arguments.length){var R,I=Object.keys(o);for(f=0;f&lt;I.length;++f)"removeListener"!==(R=I[f])&amp;&amp;this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(s=o[t]))this.removeListener(t,s);else if(void 0!==s)for(f=s.length-1;f&gt;=0;f--)this.removeListener(t,s[f]);return this},P.prototype.listeners=function(t){return u(this,t,!0)},P.prototype.rawListeners=function(t){return u(this,t,!1)},P.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},P.prototype.listenerCount=g,P.prototype.eventNames=function(){return this._eventsCount&gt;0?w(this._events):[]}},36032:k=&gt;{k.exports=function(){if(typeof globalThis&gt;"u")return null;var b={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return b.RTCPeerConnection?b:null}},25076:(k,M,b)=&gt;{"use strict";function w(t,s){return(w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,I){return f.__proto__=I,f})(t,s)}function C(t,s){t.prototype=Object.create(s.prototype),t.prototype.constructor=t,w(t,s)}b.r(M),b.d(M,{LineStream:()=&gt;c,ParseStream:()=&gt;r,Parser:()=&gt;e});var O=function(){function t(){this.listeners={}}var s=t.prototype;return s.on=function(f,I){this.listeners[f]||(this.listeners[f]=[]),this.listeners[f].push(I)},s.off=function(f,I){if(!this.listeners[f])return!1;var R=this.listeners[f].indexOf(I);return this.listeners[f]=this.listeners[f].slice(0),this.listeners[f].splice(R,1),R&gt;-1},s.trigger=function(f){var I=this.listeners[f];if(I)if(2===arguments.length)for(var R=I.length,S=0;S&lt;R;++S)I[S].call(this,arguments[1]);else for(var y=Array.prototype.slice.call(arguments,1),j=I.length,U=0;U&lt;j;++U)I[U].apply(this,y)},s.dispose=function(){this.listeners={}},s.pipe=function(f){this.on("data",function(I){f.push(I)})},t}();function P(){return P=Object.assign?Object.assign.bind():function(t){for(var s=1;s&lt;arguments.length;s++){var o=arguments[s];for(var f in o)Object.prototype.hasOwnProperty.call(o,f)&amp;&amp;(t[f]=o[f])}return t},P.apply(this,arguments)}var d=b(30012),v=b.n(d);function T(t){for(var s=function(s){return v().atob?v().atob(s):Buffer.from(s,"base64").toString("binary")}(t),o=new Uint8Array(s.length),f=0;f&lt;s.length;f++)o[f]=s.charCodeAt(f);return o}var c=function(t){function s(){var f;return(f=t.call(this)||this).buffer="",f}return C(s,t),s.prototype.push=function(I){var R;for(this.buffer+=I,R=this.buffer.indexOf("\n");R&gt;-1;R=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,R)),this.buffer=this.buffer.substring(R+1)},s}(O),g=function(s){var o=/([0-9.]*)?@?([0-9.]*)?/.exec(s||""),f={};return o[1]&amp;&amp;(f.length=parseInt(o[1],10)),o[2]&amp;&amp;(f.offset=parseInt(o[2],10)),f},l=function(s){for(var R,o=s.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),f={},I=o.length;I--;)""!==o[I]&amp;&amp;((R=/([^=]*)=(.*)/.exec(o[I]).slice(1))[0]=R[0].replace(/^\s+|\s+$/g,""),R[1]=R[1].replace(/^\s+|\s+$/g,""),R[1]=R[1].replace(/^['"](.*)['"]$/g,"$1"),f[R[0]]=R[1]);return f},r=function(t){function s(){var f;return(f=t.call(this)||this).customParsers=[],f.tagMappers=[],f}C(s,t);var o=s.prototype;return o.push=function(I){var S,y,R=this;if(0!==(I=I.trim()).length){if("#"!==I[0])return void this.trigger("data",{type:"uri",uri:I});this.tagMappers.reduce(function(U,K){var V=K(I);return V===I?U:U.concat([V])},[I]).forEach(function(U){for(var K=0;K&lt;R.customParsers.length;K++)if(R.customParsers[K].call(R,U))return;if(0===U.indexOf("#EXT"))if(U=U.replace("\r",""),S=/^#EXTM3U/.exec(U))R.trigger("data",{type:"tag",tagType:"m3u"});else{if(S=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(U))return y={type:"tag",tagType:"inf"},S[1]&amp;&amp;(y.duration=parseFloat(S[1])),S[2]&amp;&amp;(y.title=S[2]),void R.trigger("data",y);if(S=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(U))return y={type:"tag",tagType:"targetduration"},S[1]&amp;&amp;(y.duration=parseInt(S[1],10)),void R.trigger("data",y);if(S=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(U))return y={type:"tag",tagType:"version"},S[1]&amp;&amp;(y.version=parseInt(S[1],10)),void R.trigger("data",y);if(S=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(U))return y={type:"tag",tagType:"media-sequence"},S[1]&amp;&amp;(y.number=parseInt(S[1],10)),void R.trigger("data",y);if(S=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(U))return y={type:"tag",tagType:"discontinuity-sequence"},S[1]&amp;&amp;(y.number=parseInt(S[1],10)),void R.trigger("data",y);if(S=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(U))return y={type:"tag",tagType:"playlist-type"},S[1]&amp;&amp;(y.playlistType=S[1]),void R.trigger("data",y);if(S=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(U))return y=P(g(S[1]),{type:"tag",tagType:"byterange"}),void R.trigger("data",y);if(S=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(U))return y={type:"tag",tagType:"allow-cache"},S[1]&amp;&amp;(y.allowed=!/NO/.test(S[1])),void R.trigger("data",y);if(S=/^#EXT-X-MAP:?(.*)$/.exec(U)){if(y={type:"tag",tagType:"map"},S[1]){var V=l(S[1]);V.URI&amp;&amp;(y.uri=V.URI),V.BYTERANGE&amp;&amp;(y.byterange=g(V.BYTERANGE))}R.trigger("data",y)}else if(S=/^#EXT-X-STREAM-INF:?(.*)$/.exec(U)){if(y={type:"tag",tagType:"stream-inf"},S[1]){if(y.attributes=l(S[1]),y.attributes.RESOLUTION){var J=y.attributes.RESOLUTION.split("x"),Q={};J[0]&amp;&amp;(Q.width=parseInt(J[0],10)),J[1]&amp;&amp;(Q.height=parseInt(J[1],10)),y.attributes.RESOLUTION=Q}y.attributes.BANDWIDTH&amp;&amp;(y.attributes.BANDWIDTH=parseInt(y.attributes.BANDWIDTH,10)),y.attributes["FRAME-RATE"]&amp;&amp;(y.attributes["FRAME-RATE"]=parseFloat(y.attributes["FRAME-RATE"])),y.attributes["PROGRAM-ID"]&amp;&amp;(y.attributes["PROGRAM-ID"]=parseInt(y.attributes["PROGRAM-ID"],10))}R.trigger("data",y)}else{if(S=/^#EXT-X-MEDIA:?(.*)$/.exec(U))return y={type:"tag",tagType:"media"},S[1]&amp;&amp;(y.attributes=l(S[1])),void R.trigger("data",y);if(S=/^#EXT-X-ENDLIST/.exec(U))R.trigger("data",{type:"tag",tagType:"endlist"});else{if(!(S=/^#EXT-X-DISCONTINUITY/.exec(U)))return(S=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(U))?(y={type:"tag",tagType:"program-date-time"},S[1]&amp;&amp;(y.dateTimeString=S[1],y.dateTimeObject=new Date(S[1])),void R.trigger("data",y)):(S=/^#EXT-X-KEY:?(.*)$/.exec(U))?(y={type:"tag",tagType:"key"},S[1]&amp;&amp;(y.attributes=l(S[1]),y.attributes.IV&amp;&amp;("0x"===y.attributes.IV.substring(0,2).toLowerCase()&amp;&amp;(y.attributes.IV=y.attributes.IV.substring(2)),y.attributes.IV=y.attributes.IV.match(/.{8}/g),y.attributes.IV[0]=parseInt(y.attributes.IV[0],16),y.attributes.IV[1]=parseInt(y.attributes.IV[1],16),y.attributes.IV[2]=parseInt(y.attributes.IV[2],16),y.attributes.IV[3]=parseInt(y.attributes.IV[3],16),y.attributes.IV=new Uint32Array(y.attributes.IV))),void R.trigger("data",y)):(S=/^#EXT-X-START:?(.*)$/.exec(U))?(y={type:"tag",tagType:"start"},S[1]&amp;&amp;(y.attributes=l(S[1]),y.attributes["TIME-OFFSET"]=parseFloat(y.attributes["TIME-OFFSET"]),y.attributes.PRECISE=/YES/.test(y.attributes.PRECISE)),void R.trigger("data",y)):(S=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(U))?((y={type:"tag",tagType:"cue-out-cont"}).data=S[1]?S[1]:"",void R.trigger("data",y)):(S=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(U))?((y={type:"tag",tagType:"cue-out"}).data=S[1]?S[1]:"",void R.trigger("data",y)):(S=/^#EXT-X-CUE-IN:?(.*)?$/.exec(U))?((y={type:"tag",tagType:"cue-in"}).data=S[1]?S[1]:"",void R.trigger("data",y)):(S=/^#EXT-X-SKIP:(.*)$/.exec(U))&amp;&amp;S[1]?((y={type:"tag",tagType:"skip"}).attributes=l(S[1]),y.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&amp;&amp;(y.attributes["SKIPPED-SEGMENTS"]=parseInt(y.attributes["SKIPPED-SEGMENTS"],10)),y.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&amp;&amp;(y.attributes["RECENTLY-REMOVED-DATERANGES"]=y.attributes["RECENTLY-REMOVED-DATERANGES"].split("\t")),void R.trigger("data",y)):(S=/^#EXT-X-PART:(.*)$/.exec(U))&amp;&amp;S[1]?((y={type:"tag",tagType:"part"}).attributes=l(S[1]),["DURATION"].forEach(function(q){y.attributes.hasOwnProperty(q)&amp;&amp;(y.attributes[q]=parseFloat(y.attributes[q]))}),["INDEPENDENT","GAP"].forEach(function(q){y.attributes.hasOwnProperty(q)&amp;&amp;(y.attributes[q]=/YES/.test(y.attributes[q]))}),y.attributes.hasOwnProperty("BYTERANGE")&amp;&amp;(y.attributes.byterange=g(y.attributes.BYTERANGE)),void R.trigger("data",y)):(S=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(U))&amp;&amp;S[1]?((y={type:"tag",tagType:"server-control"}).attributes=l(S[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(q){y.attributes.hasOwnProperty(q)&amp;&amp;(y.attributes[q]=parseFloat(y.attributes[q]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(q){y.attributes.hasOwnProperty(q)&amp;&amp;(y.attributes[q]=/YES/.test(y.attributes[q]))}),void R.trigger("data",y)):(S=/^#EXT-X-PART-INF:(.*)$/.exec(U))&amp;&amp;S[1]?((y={type:"tag",tagType:"part-inf"}).attributes=l(S[1]),["PART-TARGET"].forEach(function(q){y.attributes.hasOwnProperty(q)&amp;&amp;(y.attributes[q]=parseFloat(y.attributes[q]))}),void R.trigger("data",y)):(S=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(U))&amp;&amp;S[1]?((y={type:"tag",tagType:"preload-hint"}).attributes=l(S[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(q){if(y.attributes.hasOwnProperty(q)){y.attributes[q]=parseInt(y.attributes[q],10);var ee="BYTERANGE-LENGTH"===q?"length":"offset";y.attributes.byterange=y.attributes.byterange||{},y.attributes.byterange[ee]=y.attributes[q],delete y.attributes[q]}}),void R.trigger("data",y)):(S=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(U))&amp;&amp;S[1]?((y={type:"tag",tagType:"rendition-report"}).attributes=l(S[1]),["LAST-MSN","LAST-PART"].forEach(function(q){y.attributes.hasOwnProperty(q)&amp;&amp;(y.attributes[q]=parseInt(y.attributes[q],10))}),void R.trigger("data",y)):void R.trigger("data",{type:"tag",data:U.slice(4)});R.trigger("data",{type:"tag",tagType:"discontinuity"})}}}else R.trigger("data",{type:"comment",text:U.slice(1)})})}},o.addParser=function(I){var R=this,S=I.expression,y=I.customType,j=I.dataParser,U=I.segment;"function"!=typeof j&amp;&amp;(j=function(V){return V}),this.customParsers.push(function(K){if(S.exec(K))return R.trigger("data",{type:"custom",data:j(K),customType:y,segment:U}),!0})},o.addTagMapper=function(I){var R=I.expression,S=I.map;this.tagMappers.push(function(U){return R.test(U)?S(U):U})},s}(O),a=function(s){var o={};return Object.keys(s).forEach(function(f){o[function(s){return s.toLowerCase().replace(/-(\w)/g,function(o){return o[1].toUpperCase()})}(f)]=s[f]}),o},n=function(s){var o=s.serverControl,f=s.targetDuration,I=s.partTargetDuration;if(o){var R="#EXT-X-SERVER-CONTROL",S="holdBack",y="partHoldBack",j=f&amp;&amp;3*f,U=I&amp;&amp;2*I;f&amp;&amp;!o.hasOwnProperty(S)&amp;&amp;(o[S]=j,this.trigger("info",{message:R+" defaulting HOLD-BACK to targetDuration * 3 ("+j+")."})),j&amp;&amp;o[S]&lt;j&amp;&amp;(this.trigger("warn",{message:R+" clamping HOLD-BACK ("+o[S]+") to targetDuration * 3 ("+j+")"}),o[S]=j),I&amp;&amp;!o.hasOwnProperty(y)&amp;&amp;(o[y]=3*I,this.trigger("info",{message:R+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+o[y]+")."})),I&amp;&amp;o[y]&lt;U&amp;&amp;(this.trigger("warn",{message:R+" clamping PART-HOLD-BACK ("+o[y]+") to partTargetDuration * 2 ("+U+")."}),o[y]=U)}},e=function(t){function s(){var f;(f=t.call(this)||this).lineStream=new c,f.parseStream=new r,f.lineStream.pipe(f.parseStream);var y,j,I=function E(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(f),R=[],S={},U=!1,K=function(){},V={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},Q=0;f.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var q=0,ee=0;return f.on("end",function(){S.uri||!S.parts&amp;&amp;!S.preloadHints||(!S.map&amp;&amp;y&amp;&amp;(S.map=y),!S.key&amp;&amp;j&amp;&amp;(S.key=j),!S.timeline&amp;&amp;"number"==typeof Q&amp;&amp;(S.timeline=Q),f.manifest.preloadSegment=S)}),f.parseStream.on("data",function(L){var ne,te;({tag:function(){({version:function(){L.version&amp;&amp;(this.manifest.version=L.version)},"allow-cache":function(){this.manifest.allowCache=L.allowed,"allowed"in L||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var X={};"length"in L&amp;&amp;(S.byterange=X,X.length=L.length,"offset"in L||(L.offset=q)),"offset"in L&amp;&amp;(S.byterange=X,X.offset=L.offset),q=X.offset+X.length},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),L.duration&gt;0&amp;&amp;(S.duration=L.duration),0===L.duration&amp;&amp;(S.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=R},key:function(){if(L.attributes)if("NONE"!==L.attributes.METHOD)if(L.attributes.URI){if("com.apple.streamingkeydelivery"===L.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:L.attributes});if("com.microsoft.playready"===L.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:L.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===L.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(L.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===L.attributes.METHOD&amp;&amp;this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==L.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):L.attributes.KEYID&amp;&amp;"0x"===L.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:L.attributes.KEYFORMAT,keyId:L.attributes.KEYID.substring(2)},pssh:T(L.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));L.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),j={method:L.attributes.METHOD||"AES-128",uri:L.attributes.URI},typeof L.attributes.IV&lt;"u"&amp;&amp;(j.iv=L.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else j=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(L.number)?this.manifest.mediaSequence=L.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+L.number})},"discontinuity-sequence":function(){isFinite(L.number)?(this.manifest.discontinuitySequence=L.number,Q=L.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+L.number})},"playlist-type":function(){/VOD|EVENT/.test(L.playlistType)?this.manifest.playlistType=L.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+L.playlist})},map:function(){y={},L.uri&amp;&amp;(y.uri=L.uri),L.byterange&amp;&amp;(y.byterange=L.byterange),j&amp;&amp;(y.key=j)},"stream-inf":function(){this.manifest.playlists=R,this.manifest.mediaGroups=this.manifest.mediaGroups||V,L.attributes?(S.attributes||(S.attributes={}),P(S.attributes,L.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||V,L.attributes&amp;&amp;L.attributes.TYPE&amp;&amp;L.attributes["GROUP-ID"]&amp;&amp;L.attributes.NAME){var X=this.manifest.mediaGroups[L.attributes.TYPE];X[L.attributes["GROUP-ID"]]=X[L.attributes["GROUP-ID"]]||{},ne=X[L.attributes["GROUP-ID"]],(te={default:/yes/i.test(L.attributes.DEFAULT)}).autoselect=!!te.default||/yes/i.test(L.attributes.AUTOSELECT),L.attributes.LANGUAGE&amp;&amp;(te.language=L.attributes.LANGUAGE),L.attributes.URI&amp;&amp;(te.uri=L.attributes.URI),L.attributes["INSTREAM-ID"]&amp;&amp;(te.instreamId=L.attributes["INSTREAM-ID"]),L.attributes.CHARACTERISTICS&amp;&amp;(te.characteristics=L.attributes.CHARACTERISTICS),L.attributes.FORCED&amp;&amp;(te.forced=/yes/i.test(L.attributes.FORCED)),ne[L.attributes.NAME]=te}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){Q+=1,S.discontinuity=!0,this.manifest.discontinuityStarts.push(R.length)},"program-date-time":function(){typeof this.manifest.dateTimeString&gt;"u"&amp;&amp;(this.manifest.dateTimeString=L.dateTimeString,this.manifest.dateTimeObject=L.dateTimeObject),S.dateTimeString=L.dateTimeString,S.dateTimeObject=L.dateTimeObject},targetduration:function(){!isFinite(L.duration)||L.duration&lt;0?this.trigger("warn",{message:"ignoring invalid target duration: "+L.duration}):(this.manifest.targetDuration=L.duration,n.call(this,this.manifest))},start:function(){L.attributes&amp;&amp;!isNaN(L.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:L.attributes["TIME-OFFSET"],precise:L.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){S.cueOut=L.data},"cue-out-cont":function(){S.cueOutCont=L.data},"cue-in":function(){S.cueIn=L.data},skip:function(){this.manifest.skip=a(L.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",L.attributes,["SKIPPED-SEGMENTS"])},part:function(){var X=this;U=!0;var z=this.manifest.segments.length,Z=a(L.attributes);S.parts=S.parts||[],S.parts.push(Z),Z.byterange&amp;&amp;(Z.byterange.hasOwnProperty("offset")||(Z.byterange.offset=ee),ee=Z.byterange.offset+Z.byterange.length),this.warnOnMissingAttributes_("#EXT-X-PART #"+(S.parts.length-1)+" for segment #"+z,L.attributes,["URI","DURATION"]),this.manifest.renditionReports&amp;&amp;this.manifest.renditionReports.forEach(function(A,x){A.hasOwnProperty("lastPart")||X.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+x+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var X=this.manifest.serverControl=a(L.attributes);X.hasOwnProperty("canBlockReload")||(X.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),n.call(this,this.manifest),X.canSkipDateranges&amp;&amp;!X.hasOwnProperty("canSkipUntil")&amp;&amp;this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var X=this.manifest.segments.length,z=a(L.attributes),Z=z.type&amp;&amp;"PART"===z.type;S.preloadHints=S.preloadHints||[],S.preloadHints.push(z),z.byterange&amp;&amp;(z.byterange.hasOwnProperty("offset")||(z.byterange.offset=Z?ee:0,Z&amp;&amp;(ee=z.byterange.offset+z.byterange.length)));var D=S.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+D+" for segment #"+X,L.attributes,["TYPE","URI"]),z.type)for(var A=0;A&lt;S.preloadHints.length-1;A++){var x=S.preloadHints[A];x.type&amp;&amp;x.type===z.type&amp;&amp;this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+D+" for segment #"+X+" has the same TYPE "+z.type+" as preload hint #"+A})}},"rendition-report":function(){var X=a(L.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(X);var z=this.manifest.renditionReports.length-1,Z=["LAST-MSN","URI"];U&amp;&amp;Z.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+z,L.attributes,Z)},"part-inf":function(){this.manifest.partInf=a(L.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",L.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&amp;&amp;(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),n.call(this,this.manifest)}}[L.tagType]||K).call(I)},uri:function(){S.uri=L.uri,R.push(S),this.manifest.targetDuration&amp;&amp;!("duration"in S)&amp;&amp;(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),S.duration=this.manifest.targetDuration),j&amp;&amp;(S.key=j),S.timeline=Q,y&amp;&amp;(S.map=y),ee=0,S={}},comment:function(){},custom:function(){L.segment?(S.custom=S.custom||{},S.custom[L.customType]=L.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[L.customType]=L.data)}})[L.type].call(I)}),f}C(s,t);var o=s.prototype;return o.warnOnMissingAttributes_=function(I,R,S){var y=[];S.forEach(function(j){R.hasOwnProperty(j)||y.push(j)}),y.length&amp;&amp;this.trigger("warn",{message:I+" lacks required attribute(s): "+y.join(", ")})},o.push=function(I){this.lineStream.push(I)},o.end=function(){this.lineStream.push("\n"),this.trigger("end")},o.addParser=function(I){this.parseStream.addParser(I)},o.addTagMapper=function(I){this.parseStream.addTagMapper(I)},s}(O)},39980:(k,M,b)=&gt;{var w=b(81048);function C(P){var E=function(){return E.called?E.value:(E.called=!0,E.value=P.apply(this,arguments))};return E.called=!1,E}function O(P){var E=function(){if(E.called)throw new Error(E.onceError);return E.called=!0,E.value=P.apply(this,arguments)};return E.onceError=(P.name||"Function wrapped with `once`")+" shouldn't be called more than once",E.called=!1,E}k.exports=w(C),k.exports.strict=w(O),C.proto=C(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return C(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return O(this)},configurable:!0})})},6749:k=&gt;{let M;k.exports="function"==typeof queueMicrotask?queueMicrotask.bind(typeof window&lt;"u"?window:global):b=&gt;(M||(M=Promise.resolve())).then(b).catch(w=&gt;setTimeout(()=&gt;{throw w},0))},42368:(k,M,b)=&gt;{"use strict";var w=65536,P=b(268).Buffer,E=global.crypto||global.msCrypto;k.exports=E&amp;&amp;E.getRandomValues?function d(v,_){if(v&gt;4294967295)throw new RangeError("requested too many random bytes");var T=P.allocUnsafe(v);if(v&gt;0)if(v&gt;w)for(var c=0;c&lt;v;c+=w)E.getRandomValues(T.slice(c,c+w));else E.getRandomValues(T);return"function"==typeof _?process.nextTick(function(){_(null,T)}):T}:function O(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},95096:k=&gt;{"use strict";var b={};function w(d,v,_){_||(_=Error);var c=function(u){function g(h,l,r){return u.call(this,function T(u,g,h){return"string"==typeof v?v:v(u,g,h)}(h,l,r))||this}return function M(d,v){d.prototype=Object.create(v.prototype),d.prototype.constructor=d,d.__proto__=v}(g,u),g}(_);c.prototype.name=_.name,c.prototype.code=d,b[d]=c}function C(d,v){if(Array.isArray(d)){var _=d.length;return d=d.map(function(T){return String(T)}),_&gt;2?"one of ".concat(v," ").concat(d.slice(0,_-1).join(", "),", or ")+d[_-1]:2===_?"one of ".concat(v," ").concat(d[0]," or ").concat(d[1]):"of ".concat(v," ").concat(d[0])}return"of ".concat(v," ").concat(String(d))}w("ERR_INVALID_OPT_VALUE",function(d,v){return'The value "'+v+'" is invalid for option "'+d+'"'},TypeError),w("ERR_INVALID_ARG_TYPE",function(d,v,_){var T,c;if("string"==typeof v&amp;&amp;function O(d,v,_){return d.substr(!_||_&lt;0?0:+_,v.length)===v}(v,"not ")?(T="must not be",v=v.replace(/^not /,"")):T="must be",function P(d,v,_){return(void 0===_||_&gt;d.length)&amp;&amp;(_=d.length),d.substring(_-v.length,_)===v}(d," argument"))c="The ".concat(d," ").concat(T," ").concat(C(v,"type"));else{var u=function E(d,v,_){return"number"!=typeof _&amp;&amp;(_=0),!(_+v.length&gt;d.length)&amp;&amp;-1!==d.indexOf(v,_)}(d,".")?"property":"argument";c='The "'.concat(d,'" ').concat(u," ").concat(T," ").concat(C(v,"type"))}return c+". Received type ".concat(typeof _)},TypeError),w("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),w("ERR_METHOD_NOT_IMPLEMENTED",function(d){return"The "+d+" method is not implemented"}),w("ERR_STREAM_PREMATURE_CLOSE","Premature close"),w("ERR_STREAM_DESTROYED",function(d){return"Cannot call "+d+" after a stream was destroyed"}),w("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),w("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),w("ERR_STREAM_WRITE_AFTER_END","write after end"),w("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),w("ERR_UNKNOWN_ENCODING",function(d){return"Unknown encoding: "+d},TypeError),w("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),k.exports.i=b},30764:(k,M,b)=&gt;{"use strict";var w=Object.keys||function(c){var u=[];for(var g in c)u.push(g);return u};k.exports=v;var C=b(89680),O=b(76848);b(71948)(v,C);for(var P=w(O.prototype),E=0;E&lt;P.length;E++){var d=P[E];v.prototype[d]||(v.prototype[d]=O.prototype[d])}function v(c){if(!(this instanceof v))return new v(c);C.call(this,c),O.call(this,c),this.allowHalfOpen=!0,c&amp;&amp;(!1===c.readable&amp;&amp;(this.readable=!1),!1===c.writable&amp;&amp;(this.writable=!1),!1===c.allowHalfOpen&amp;&amp;(this.allowHalfOpen=!1,this.once("end",_)))}function _(){this._writableState.ended||process.nextTick(T,this)}function T(c){c.end()}Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(v.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&amp;&amp;this._writableState.getBuffer()}}),Object.defineProperty(v.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(v.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&amp;&amp;void 0!==this._writableState&amp;&amp;this._readableState.destroyed&amp;&amp;this._writableState.destroyed},set:function(u){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=u,this._writableState.destroyed=u)}})},16635:(k,M,b)=&gt;{"use strict";k.exports=C;var w=b(78316);function C(O){if(!(this instanceof C))return new C(O);w.call(this,O)}b(71948)(C,w),C.prototype._transform=function(O,P,E){E(null,O)}},89680:(k,M,b)=&gt;{"use strict";var w;k.exports=y,y.ReadableState=S,b(91656);var c,O=function(m,N){return m.listeners(N).length},P=b(73187),E=b(60773).Buffer,d=(typeof global&lt;"u"?global:typeof window&lt;"u"?window:typeof self&lt;"u"?self:{}).Uint8Array||function(){},T=b(13716);c=T&amp;&amp;T.debuglog?T.debuglog("stream"):function(){};var t,s,o,u=b(61312),g=b(61412),l=b(63800).getHighWaterMark,r=b(95096).i,i=r.ERR_INVALID_ARG_TYPE,a=r.ERR_STREAM_PUSH_AFTER_EOF,n=r.ERR_METHOD_NOT_IMPLEMENTED,e=r.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;b(71948)(y,P);var f=g.errorOrDestroy,I=["error","close","destroy","pause","resume"];function S(p,m,N){w=w||b(30764),"boolean"!=typeof N&amp;&amp;(N=m instanceof w),this.objectMode=!!(p=p||{}).objectMode,N&amp;&amp;(this.objectMode=this.objectMode||!!p.readableObjectMode),this.highWaterMark=l(this,p,"readableHighWaterMark",N),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=!1!==p.emitClose,this.autoDestroy=!!p.autoDestroy,this.destroyed=!1,this.defaultEncoding=p.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,p.encoding&amp;&amp;(t||(t=b(84452).o),this.decoder=new t(p.encoding),this.encoding=p.encoding)}function y(p){if(w=w||b(30764),!(this instanceof y))return new y(p);this._readableState=new S(p,this,this instanceof w),this.readable=!0,p&amp;&amp;("function"==typeof p.read&amp;&amp;(this._read=p.read),"function"==typeof p.destroy&amp;&amp;(this._destroy=p.destroy)),P.call(this)}function j(p,m,N,B,Y){c("readableAddChunk",m);var $,F=p._readableState;if(null===m)F.reading=!1,function q(p,m){if(c("onEofChunk"),!m.ended){if(m.decoder){var N=m.decoder.end();N&amp;&amp;N.length&amp;&amp;(m.buffer.push(N),m.length+=m.objectMode?1:N.length)}m.ended=!0,m.sync?ee(p):(m.needReadable=!1,m.emittedReadable||(m.emittedReadable=!0,L(p)))}}(p,F);else if(Y||($=function K(p,m){var N;return!function _(p){return E.isBuffer(p)||p instanceof d}(m)&amp;&amp;"string"!=typeof m&amp;&amp;void 0!==m&amp;&amp;!p.objectMode&amp;&amp;(N=new i("chunk",["string","Buffer","Uint8Array"],m)),N}(F,m)),$)f(p,$);else if(F.objectMode||m&amp;&amp;m.length&gt;0)if("string"!=typeof m&amp;&amp;!F.objectMode&amp;&amp;Object.getPrototypeOf(m)!==E.prototype&amp;&amp;(m=function v(p){return E.from(p)}(m)),B)F.endEmitted?f(p,new e):U(p,F,m,!0);else if(F.ended)f(p,new a);else{if(F.destroyed)return!1;F.reading=!1,F.decoder&amp;&amp;!N?(m=F.decoder.write(m),F.objectMode||0!==m.length?U(p,F,m,!1):ne(p,F)):U(p,F,m,!1)}else B||(F.reading=!1,ne(p,F));return!F.ended&amp;&amp;(F.length&lt;F.highWaterMark||0===F.length)}function U(p,m,N,B){m.flowing&amp;&amp;0===m.length&amp;&amp;!m.sync?(m.awaitDrain=0,p.emit("data",N)):(m.length+=m.objectMode?1:N.length,B?m.buffer.unshift(N):m.buffer.push(N),m.needReadable&amp;&amp;ee(p)),ne(p,m)}Object.defineProperty(y.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&amp;&amp;this._readableState.destroyed},set:function(m){this._readableState&amp;&amp;(this._readableState.destroyed=m)}}),y.prototype.destroy=g.destroy,y.prototype._undestroy=g.undestroy,y.prototype._destroy=function(p,m){m(p)},y.prototype.push=function(p,m){var B,N=this._readableState;return N.objectMode?B=!0:"string"==typeof p&amp;&amp;((m=m||N.defaultEncoding)!==N.encoding&amp;&amp;(p=E.from(p,m),m=""),B=!0),j(this,p,m,!1,B)},y.prototype.unshift=function(p){return j(this,p,null,!0,!1)},y.prototype.isPaused=function(){return!1===this._readableState.flowing},y.prototype.setEncoding=function(p){t||(t=b(84452).o);var m=new t(p);this._readableState.decoder=m,this._readableState.encoding=this._readableState.decoder.encoding;for(var N=this._readableState.buffer.head,B="";null!==N;)B+=m.write(N.data),N=N.next;return this._readableState.buffer.clear(),""!==B&amp;&amp;this._readableState.buffer.push(B),this._readableState.length=B.length,this};var V=1073741824;function Q(p,m){return p&lt;=0||0===m.length&amp;&amp;m.ended?0:m.objectMode?1:p!=p?m.flowing&amp;&amp;m.length?m.buffer.head.data.length:m.length:(p&gt;m.highWaterMark&amp;&amp;(m.highWaterMark=function J(p){return p&gt;=V?p=V:(p--,p|=p&gt;&gt;&gt;1,p|=p&gt;&gt;&gt;2,p|=p&gt;&gt;&gt;4,p|=p&gt;&gt;&gt;8,p|=p&gt;&gt;&gt;16,p++),p}(p)),p&lt;=m.length?p:m.ended?m.length:(m.needReadable=!0,0))}function ee(p){var m=p._readableState;c("emitReadable",m.needReadable,m.emittedReadable),m.needReadable=!1,m.emittedReadable||(c("emitReadable",m.flowing),m.emittedReadable=!0,process.nextTick(L,p))}function L(p){var m=p._readableState;c("emitReadable_",m.destroyed,m.length,m.ended),!m.destroyed&amp;&amp;(m.length||m.ended)&amp;&amp;(p.emit("readable"),m.emittedReadable=!1),m.needReadable=!m.flowing&amp;&amp;!m.ended&amp;&amp;m.length&lt;=m.highWaterMark,D(p)}function ne(p,m){m.readingMore||(m.readingMore=!0,process.nextTick(te,p,m))}function te(p,m){for(;!m.reading&amp;&amp;!m.ended&amp;&amp;(m.length&lt;m.highWaterMark||m.flowing&amp;&amp;0===m.length);){var N=m.length;if(c("maybeReadMore read 0"),p.read(0),N===m.length)break}m.readingMore=!1}function G(p){var m=p._readableState;m.readableListening=p.listenerCount("readable")&gt;0,m.resumeScheduled&amp;&amp;!m.paused?m.flowing=!0:p.listenerCount("data")&gt;0&amp;&amp;p.resume()}function X(p){c("readable nexttick read 0"),p.read(0)}function Z(p,m){c("resume",m.reading),m.reading||p.read(0),m.resumeScheduled=!1,p.emit("resume"),D(p),m.flowing&amp;&amp;!m.reading&amp;&amp;p.read(0)}function D(p){var m=p._readableState;for(c("flow",m.flowing);m.flowing&amp;&amp;null!==p.read(););}function A(p,m){return 0===m.length?null:(m.objectMode?N=m.buffer.shift():!p||p&gt;=m.length?(N=m.decoder?m.buffer.join(""):1===m.buffer.length?m.buffer.first():m.buffer.concat(m.length),m.buffer.clear()):N=m.buffer.consume(p,m.decoder),N);var N}function x(p){var m=p._readableState;c("endReadable",m.endEmitted),m.endEmitted||(m.ended=!0,process.nextTick(H,m,p))}function H(p,m){if(c("endReadableNT",p.endEmitted,p.length),!p.endEmitted&amp;&amp;0===p.length&amp;&amp;(p.endEmitted=!0,m.readable=!1,m.emit("end"),p.autoDestroy)){var N=m._writableState;(!N||N.autoDestroy&amp;&amp;N.finished)&amp;&amp;m.destroy()}}function W(p,m){for(var N=0,B=p.length;N&lt;B;N++)if(p[N]===m)return N;return-1}y.prototype.read=function(p){c("read",p),p=parseInt(p,10);var m=this._readableState,N=p;if(0!==p&amp;&amp;(m.emittedReadable=!1),0===p&amp;&amp;m.needReadable&amp;&amp;((0!==m.highWaterMark?m.length&gt;=m.highWaterMark:m.length&gt;0)||m.ended))return c("read: emitReadable",m.length,m.ended),0===m.length&amp;&amp;m.ended?x(this):ee(this),null;if(0===(p=Q(p,m))&amp;&amp;m.ended)return 0===m.length&amp;&amp;x(this),null;var Y,B=m.needReadable;return c("need readable",B),(0===m.length||m.length-p&lt;m.highWaterMark)&amp;&amp;c("length less than watermark",B=!0),m.ended||m.reading?c("reading or ended",B=!1):B&amp;&amp;(c("do read"),m.reading=!0,m.sync=!0,0===m.length&amp;&amp;(m.needReadable=!0),this._read(m.highWaterMark),m.sync=!1,m.reading||(p=Q(N,m))),null===(Y=p&gt;0?A(p,m):null)?(m.needReadable=m.length&lt;=m.highWaterMark,p=0):(m.length-=p,m.awaitDrain=0),0===m.length&amp;&amp;(m.ended||(m.needReadable=!0),N!==p&amp;&amp;m.ended&amp;&amp;x(this)),null!==Y&amp;&amp;this.emit("data",Y),Y},y.prototype._read=function(p){f(this,new n("_read()"))},y.prototype.pipe=function(p,m){var N=this,B=this._readableState;switch(B.pipesCount){case 0:B.pipes=p;break;case 1:B.pipes=[B.pipes,p];break;default:B.pipes.push(p)}B.pipesCount+=1,c("pipe count=%d opts=%j",B.pipesCount,m);var F=m&amp;&amp;!1===m.end||p===process.stdout||p===process.stderr?oe:re;function re(){c("onend"),p.end()}B.endEmitted?process.nextTick(F):N.once("end",F),p.on("unpipe",function $(se,ae){c("onunpipe"),se===N&amp;&amp;ae&amp;&amp;!1===ae.hasUnpiped&amp;&amp;(ae.hasUnpiped=!0,function ge(){c("cleanup"),p.removeListener("close",le),p.removeListener("finish",fe),p.removeListener("drain",ue),p.removeListener("error",de),p.removeListener("unpipe",$),N.removeListener("end",re),N.removeListener("end",oe),N.removeListener("data",ce),he=!0,B.awaitDrain&amp;&amp;(!p._writableState||p._writableState.needDrain)&amp;&amp;ue()}())});var ue=function ie(p){return function(){var N=p._readableState;c("pipeOnDrain",N.awaitDrain),N.awaitDrain&amp;&amp;N.awaitDrain--,0===N.awaitDrain&amp;&amp;O(p,"data")&amp;&amp;(N.flowing=!0,D(p))}}(N);p.on("drain",ue);var he=!1;function ce(se){c("ondata");var ae=p.write(se);c("dest.write",ae),!1===ae&amp;&amp;((1===B.pipesCount&amp;&amp;B.pipes===p||B.pipesCount&gt;1&amp;&amp;-1!==W(B.pipes,p))&amp;&amp;!he&amp;&amp;(c("false write response, pause",B.awaitDrain),B.awaitDrain++),N.pause())}function de(se){c("onerror",se),oe(),p.removeListener("error",de),0===O(p,"error")&amp;&amp;f(p,se)}function le(){p.removeListener("finish",fe),oe()}function fe(){c("onfinish"),p.removeListener("close",le),oe()}function oe(){c("unpipe"),N.unpipe(p)}return N.on("data",ce),function R(p,m,N){if("function"==typeof p.prependListener)return p.prependListener(m,N);p._events&amp;&amp;p._events[m]?Array.isArray(p._events[m])?p._events[m].unshift(N):p._events[m]=[N,p._events[m]]:p.on(m,N)}(p,"error",de),p.once("close",le),p.once("finish",fe),p.emit("pipe",N),B.flowing||(c("pipe resume"),N.resume()),p},y.prototype.unpipe=function(p){var m=this._readableState,N={hasUnpiped:!1};if(0===m.pipesCount)return this;if(1===m.pipesCount)return p&amp;&amp;p!==m.pipes||(p||(p=m.pipes),m.pipes=null,m.pipesCount=0,m.flowing=!1,p&amp;&amp;p.emit("unpipe",this,N)),this;if(!p){var B=m.pipes,Y=m.pipesCount;m.pipes=null,m.pipesCount=0,m.flowing=!1;for(var F=0;F&lt;Y;F++)B[F].emit("unpipe",this,{hasUnpiped:!1});return this}var $=W(m.pipes,p);return-1===$||(m.pipes.splice($,1),m.pipesCount-=1,1===m.pipesCount&amp;&amp;(m.pipes=m.pipes[0]),p.emit("unpipe",this,N)),this},y.prototype.addListener=y.prototype.on=function(p,m){var N=P.prototype.on.call(this,p,m),B=this._readableState;return"data"===p?(B.readableListening=this.listenerCount("readable")&gt;0,!1!==B.flowing&amp;&amp;this.resume()):"readable"===p&amp;&amp;!B.endEmitted&amp;&amp;!B.readableListening&amp;&amp;(B.readableListening=B.needReadable=!0,B.flowing=!1,B.emittedReadable=!1,c("on readable",B.length,B.reading),B.length?ee(this):B.reading||process.nextTick(X,this)),N},y.prototype.removeListener=function(p,m){var N=P.prototype.removeListener.call(this,p,m);return"readable"===p&amp;&amp;process.nextTick(G,this),N},y.prototype.removeAllListeners=function(p){var m=P.prototype.removeAllListeners.apply(this,arguments);return("readable"===p||void 0===p)&amp;&amp;process.nextTick(G,this),m},y.prototype.resume=function(){var p=this._readableState;return p.flowing||(c("resume"),p.flowing=!p.readableListening,function z(p,m){m.resumeScheduled||(m.resumeScheduled=!0,process.nextTick(Z,p,m))}(this,p)),p.paused=!1,this},y.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&amp;&amp;(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},y.prototype.wrap=function(p){var m=this,N=this._readableState,B=!1;for(var Y in p.on("end",function(){if(c("wrapped end"),N.decoder&amp;&amp;!N.ended){var $=N.decoder.end();$&amp;&amp;$.length&amp;&amp;m.push($)}m.push(null)}),p.on("data",function($){c("wrapped data"),N.decoder&amp;&amp;($=N.decoder.write($)),N.objectMode&amp;&amp;null==$||!(N.objectMode||$&amp;&amp;$.length)||m.push($)||(B=!0,p.pause())}),p)void 0===this[Y]&amp;&amp;"function"==typeof p[Y]&amp;&amp;(this[Y]=function(re){return function(){return p[re].apply(p,arguments)}}(Y));for(var F=0;F&lt;I.length;F++)p.on(I[F],this.emit.bind(this,I[F]));return this._read=function($){c("wrapped _read",$),B&amp;&amp;(B=!1,p.resume())},this},"function"==typeof Symbol&amp;&amp;(y.prototype[Symbol.asyncIterator]=function(){return void 0===s&amp;&amp;(s=b(87840)),s(this)}),Object.defineProperty(y.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(y.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&amp;&amp;this._readableState.buffer}}),Object.defineProperty(y.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(m){this._readableState&amp;&amp;(this._readableState.flowing=m)}}),y._fromList=A,Object.defineProperty(y.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&amp;&amp;(y.from=function(p,m){return void 0===o&amp;&amp;(o=b(28360)),o(y,p,m)})},78316:(k,M,b)=&gt;{"use strict";k.exports=_;var w=b(95096).i,C=w.ERR_METHOD_NOT_IMPLEMENTED,O=w.ERR_MULTIPLE_CALLBACK,P=w.ERR_TRANSFORM_ALREADY_TRANSFORMING,E=w.ERR_TRANSFORM_WITH_LENGTH_0,d=b(30764);function v(u,g){var h=this._transformState;h.transforming=!1;var l=h.writecb;if(null===l)return this.emit("error",new O);h.writechunk=null,h.writecb=null,null!=g&amp;&amp;this.push(g),l(u);var r=this._readableState;r.reading=!1,(r.needReadable||r.length&lt;r.highWaterMark)&amp;&amp;this._read(r.highWaterMark)}function _(u){if(!(this instanceof _))return new _(u);d.call(this,u),this._transformState={afterTransform:v.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&amp;&amp;("function"==typeof u.transform&amp;&amp;(this._transform=u.transform),"function"==typeof u.flush&amp;&amp;(this._flush=u.flush)),this.on("prefinish",T)}function T(){var u=this;"function"!=typeof this._flush||this._readableState.destroyed?c(this,null,null):this._flush(function(g,h){c(u,g,h)})}function c(u,g,h){if(g)return u.emit("error",g);if(null!=h&amp;&amp;u.push(h),u._writableState.length)throw new E;if(u._transformState.transforming)throw new P;return u.push(null)}b(71948)(_,d),_.prototype.push=function(u,g){return this._transformState.needTransform=!1,d.prototype.push.call(this,u,g)},_.prototype._transform=function(u,g,h){h(new C("_transform()"))},_.prototype._write=function(u,g,h){var l=this._transformState;if(l.writecb=h,l.writechunk=u,l.writeencoding=g,!l.transforming){var r=this._readableState;(l.needTransform||r.needReadable||r.length&lt;r.highWaterMark)&amp;&amp;this._read(r.highWaterMark)}},_.prototype._read=function(u){var g=this._transformState;null===g.writechunk||g.transforming?g.needTransform=!0:(g.transforming=!0,this._transform(g.writechunk,g.writeencoding,g.afterTransform))},_.prototype._destroy=function(u,g){d.prototype._destroy.call(this,u,function(h){g(h)})}},76848:(k,M,b)=&gt;{"use strict";function C(D){var A=this;this.next=null,this.entry=null,this.finish=function(){!function Z(D,A,x){var H=D.entry;for(D.entry=null;H;){var W=H.callback;A.pendingcb--,W(x),H=H.next}A.corkedRequestsFree.next=D}(A,D)}}var O;k.exports=S,S.WritableState=I;var R,P={deprecate:b(24776)},E=b(73187),d=b(60773).Buffer,v=(typeof global&lt;"u"?global:typeof window&lt;"u"?window:typeof self&lt;"u"?self:{}).Uint8Array||function(){},c=b(61412),g=b(63800).getHighWaterMark,h=b(95096).i,l=h.ERR_INVALID_ARG_TYPE,r=h.ERR_METHOD_NOT_IMPLEMENTED,i=h.ERR_MULTIPLE_CALLBACK,a=h.ERR_STREAM_CANNOT_PIPE,n=h.ERR_STREAM_DESTROYED,e=h.ERR_STREAM_NULL_VALUES,t=h.ERR_STREAM_WRITE_AFTER_END,s=h.ERR_UNKNOWN_ENCODING,o=c.errorOrDestroy;function f(){}function I(D,A,x){O=O||b(30764),"boolean"!=typeof x&amp;&amp;(x=A instanceof O),this.objectMode=!!(D=D||{}).objectMode,x&amp;&amp;(this.objectMode=this.objectMode||!!D.writableObjectMode),this.highWaterMark=g(this,D,"writableHighWaterMark",x),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===D.decodeStrings),this.defaultEncoding=D.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(W){!function q(D,A){var x=D._writableState,H=x.sync,W=x.writecb;if("function"!=typeof W)throw new i;if(function Q(D){D.writing=!1,D.writecb=null,D.length-=D.writelen,D.writelen=0}(x),A)!function J(D,A,x,H,W){--A.pendingcb,x?(process.nextTick(W,H),process.nextTick(X,D,A),D._writableState.errorEmitted=!0,o(D,H)):(W(H),D._writableState.errorEmitted=!0,o(D,H),X(D,A))}(D,x,H,A,W);else{var p=te(x)||D.destroyed;!p&amp;&amp;!x.corked&amp;&amp;!x.bufferProcessing&amp;&amp;x.bufferedRequest&amp;&amp;ne(D,x),H?process.nextTick(ee,D,x,p,W):ee(D,x,p,W)}}(A,W)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==D.emitClose,this.autoDestroy=!!D.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new C(this)}function S(D){var A=this instanceof(O=O||b(30764));if(!A&amp;&amp;!R.call(S,this))return new S(D);this._writableState=new I(D,this,A),this.writable=!0,D&amp;&amp;("function"==typeof D.write&amp;&amp;(this._write=D.write),"function"==typeof D.writev&amp;&amp;(this._writev=D.writev),"function"==typeof D.destroy&amp;&amp;(this._destroy=D.destroy),"function"==typeof D.final&amp;&amp;(this._final=D.final)),E.call(this)}function V(D,A,x,H,W,p,m){A.writelen=H,A.writecb=m,A.writing=!0,A.sync=!0,A.destroyed?A.onwrite(new n("write")):x?D._writev(W,A.onwrite):D._write(W,p,A.onwrite),A.sync=!1}function ee(D,A,x,H){x||function L(D,A){0===A.length&amp;&amp;A.needDrain&amp;&amp;(A.needDrain=!1,D.emit("drain"))}(D,A),A.pendingcb--,H(),X(D,A)}function ne(D,A){A.bufferProcessing=!0;var x=A.bufferedRequest;if(D._writev&amp;&amp;x&amp;&amp;x.next){var W=new Array(A.bufferedRequestCount),p=A.corkedRequestsFree;p.entry=x;for(var m=0,N=!0;x;)W[m]=x,x.isBuf||(N=!1),x=x.next,m+=1;W.allBuffers=N,V(D,A,!0,A.length,W,"",p.finish),A.pendingcb++,A.lastBufferedRequest=null,p.next?(A.corkedRequestsFree=p.next,p.next=null):A.corkedRequestsFree=new C(A),A.bufferedRequestCount=0}else{for(;x;){var B=x.chunk;if(V(D,A,!1,A.objectMode?1:B.length,B,x.encoding,x.callback),x=x.next,A.bufferedRequestCount--,A.writing)break}null===x&amp;&amp;(A.lastBufferedRequest=null)}A.bufferedRequest=x,A.bufferProcessing=!1}function te(D){return D.ending&amp;&amp;0===D.length&amp;&amp;null===D.bufferedRequest&amp;&amp;!D.finished&amp;&amp;!D.writing}function ie(D,A){D._final(function(x){A.pendingcb--,x&amp;&amp;o(D,x),A.prefinished=!0,D.emit("prefinish"),X(D,A)})}function X(D,A){var x=te(A);if(x&amp;&amp;(function G(D,A){!A.prefinished&amp;&amp;!A.finalCalled&amp;&amp;("function"!=typeof D._final||A.destroyed?(A.prefinished=!0,D.emit("prefinish")):(A.pendingcb++,A.finalCalled=!0,process.nextTick(ie,D,A)))}(D,A),0===A.pendingcb&amp;&amp;(A.finished=!0,D.emit("finish"),A.autoDestroy))){var H=D._readableState;(!H||H.autoDestroy&amp;&amp;H.endEmitted)&amp;&amp;D.destroy()}return x}b(71948)(S,E),I.prototype.getBuffer=function(){for(var A=this.bufferedRequest,x=[];A;)x.push(A),A=A.next;return x},function(){try{Object.defineProperty(I.prototype,"buffer",{get:P.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),"function"==typeof Symbol&amp;&amp;Symbol.hasInstance&amp;&amp;"function"==typeof Function.prototype[Symbol.hasInstance]?(R=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(A){return!!R.call(this,A)||this===S&amp;&amp;A&amp;&amp;A._writableState instanceof I}})):R=function(A){return A instanceof this},S.prototype.pipe=function(){o(this,new a)},S.prototype.write=function(D,A,x){var H=this._writableState,W=!1,p=!H.objectMode&amp;&amp;function T(D){return d.isBuffer(D)||D instanceof v}(D);return p&amp;&amp;!d.isBuffer(D)&amp;&amp;(D=function _(D){return d.from(D)}(D)),"function"==typeof A&amp;&amp;(x=A,A=null),p?A="buffer":A||(A=H.defaultEncoding),"function"!=typeof x&amp;&amp;(x=f),H.ending?function y(D,A){var x=new t;o(D,x),process.nextTick(A,x)}(this,x):(p||function j(D,A,x,H){var W;return null===x?W=new e:"string"!=typeof x&amp;&amp;!A.objectMode&amp;&amp;(W=new l("chunk",["string","Buffer"],x)),!W||(o(D,W),process.nextTick(H,W),!1)}(this,H,D,x))&amp;&amp;(H.pendingcb++,W=function K(D,A,x,H,W,p){if(!x){var m=function U(D,A,x){return!D.objectMode&amp;&amp;!1!==D.decodeStrings&amp;&amp;"string"==typeof A&amp;&amp;(A=d.from(A,x)),A}(A,H,W);H!==m&amp;&amp;(x=!0,W="buffer",H=m)}var N=A.objectMode?1:H.length;A.length+=N;var B=A.length&lt;A.highWaterMark;if(B||(A.needDrain=!0),A.writing||A.corked){var Y=A.lastBufferedRequest;A.lastBufferedRequest={chunk:H,encoding:W,isBuf:x,callback:p,next:null},Y?Y.next=A.lastBufferedRequest:A.bufferedRequest=A.lastBufferedRequest,A.bufferedRequestCount+=1}else V(D,A,!1,N,H,W,p);return B}(this,H,p,D,A,x)),W},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var D=this._writableState;D.corked&amp;&amp;(D.corked--,!D.writing&amp;&amp;!D.corked&amp;&amp;!D.bufferProcessing&amp;&amp;D.bufferedRequest&amp;&amp;ne(this,D))},S.prototype.setDefaultEncoding=function(A){if("string"==typeof A&amp;&amp;(A=A.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((A+"").toLowerCase())&gt;-1))throw new s(A);return this._writableState.defaultEncoding=A,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&amp;&amp;this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(D,A,x){x(new r("_write()"))},S.prototype._writev=null,S.prototype.end=function(D,A,x){var H=this._writableState;return"function"==typeof D?(x=D,D=null,A=null):"function"==typeof A&amp;&amp;(x=A,A=null),null!=D&amp;&amp;this.write(D,A),H.corked&amp;&amp;(H.corked=1,this.uncork()),H.ending||function z(D,A,x){A.ending=!0,X(D,A),x&amp;&amp;(A.finished?process.nextTick(x):D.once("finish",x)),A.ended=!0,D.writable=!1}(this,H,x),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&amp;&amp;this._writableState.destroyed},set:function(A){this._writableState&amp;&amp;(this._writableState.destroyed=A)}}),S.prototype.destroy=c.destroy,S.prototype._undestroy=c.undestroy,S.prototype._destroy=function(D,A){A(D)}},87840:(k,M,b)=&gt;{"use strict";var w;function C(t,s,o){return s=function O(t){var s=function P(t,s){if("object"!=typeof t||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var f=o.call(t,s||"default");if("object"!=typeof f)return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(t)}(t,"string");return"symbol"==typeof s?s:String(s)}(s),s in t?Object.defineProperty(t,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[s]=o,t}var E=b(76527),d=Symbol("lastResolve"),v=Symbol("lastReject"),_=Symbol("error"),T=Symbol("ended"),c=Symbol("lastPromise"),u=Symbol("handlePromise"),g=Symbol("stream");function h(t,s){return{value:t,done:s}}function l(t){var s=t[d];if(null!==s){var o=t[g].read();null!==o&amp;&amp;(t[c]=null,t[d]=null,t[v]=null,s(h(o,!1)))}}function r(t){process.nextTick(l,t)}var a=Object.getPrototypeOf(function(){}),n=Object.setPrototypeOf((C(w={get stream(){return this[g]},next:function(){var s=this,o=this[_];if(null!==o)return Promise.reject(o);if(this[T])return Promise.resolve(h(void 0,!0));if(this[g].destroyed)return new Promise(function(S,y){process.nextTick(function(){s[_]?y(s[_]):S(h(void 0,!0))})});var I,f=this[c];if(f)I=new Promise(function i(t,s){return function(o,f){t.then(function(){s[T]?o(h(void 0,!0)):s[u](o,f)},f)}}(f,this));else{var R=this[g].read();if(null!==R)return Promise.resolve(h(R,!1));I=new Promise(this[u])}return this[c]=I,I}},Symbol.asyncIterator,function(){return this}),C(w,"return",function(){var s=this;return new Promise(function(o,f){s[g].destroy(null,function(I){I?f(I):o(h(void 0,!0))})})}),w),a);k.exports=function(s){var o,f=Object.create(n,(C(o={},g,{value:s,writable:!0}),C(o,d,{value:null,writable:!0}),C(o,v,{value:null,writable:!0}),C(o,_,{value:null,writable:!0}),C(o,T,{value:s._readableState.endEmitted,writable:!0}),C(o,u,{value:function(R,S){var y=f[g].read();y?(f[c]=null,f[d]=null,f[v]=null,R(h(y,!1))):(f[d]=R,f[v]=S)},writable:!0}),o));return f[c]=null,E(s,function(I){if(I&amp;&amp;"ERR_STREAM_PREMATURE_CLOSE"!==I.code){var R=f[v];return null!==R&amp;&amp;(f[c]=null,f[d]=null,f[v]=null,R(I)),void(f[_]=I)}var S=f[d];null!==S&amp;&amp;(f[c]=null,f[d]=null,f[v]=null,S(h(void 0,!0))),f[T]=!0}),s.on("readable",r.bind(null,f)),f}},61312:(k,M,b)=&gt;{"use strict";function w(r,i){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);i&amp;&amp;(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),a.push.apply(a,n)}return a}function C(r){for(var i=1;i&lt;arguments.length;i++){var a=null!=arguments[i]?arguments[i]:{};i%2?w(Object(a),!0).forEach(function(n){O(r,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):w(Object(a)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(a,n))})}return r}function O(r,i,a){return(i=v(i))in r?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a,r}function E(r,i){for(var a=0;a&lt;i.length;a++){var n=i[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&amp;&amp;(n.writable=!0),Object.defineProperty(r,v(n.key),n)}}function v(r){var i=function _(r,i){if("object"!=typeof r||null===r)return r;var a=r[Symbol.toPrimitive];if(void 0!==a){var n=a.call(r,i||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===i?String:Number)(r)}(r,"string");return"symbol"==typeof i?i:String(i)}var c=b(60773).Buffer,g=b(73236).inspect,h=g&amp;&amp;g.custom||"inspect";function l(r,i,a){c.prototype.copy.call(r,i,a)}k.exports=function(){function r(){(function P(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,r),this.head=null,this.tail=null,this.length=0}return function d(r,i,a){i&amp;&amp;E(r.prototype,i),a&amp;&amp;E(r,a),Object.defineProperty(r,"prototype",{writable:!1})}(r,[{key:"push",value:function(a){var n={data:a,next:null};this.length&gt;0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(a){var n={data:a,next:this.head};0===this.length&amp;&amp;(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(0!==this.length){var a=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,a}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(a){if(0===this.length)return"";for(var n=this.head,e=""+n.data;n=n.next;)e+=a+n.data;return e}},{key:"concat",value:function(a){if(0===this.length)return c.alloc(0);for(var n=c.allocUnsafe(a&gt;&gt;&gt;0),e=this.head,t=0;e;)l(e.data,n,t),t+=e.data.length,e=e.next;return n}},{key:"consume",value:function(a,n){var e;return a&lt;this.head.data.length?(e=this.head.data.slice(0,a),this.head.data=this.head.data.slice(a)):e=a===this.head.data.length?this.shift():n?this._getString(a):this._getBuffer(a),e}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(a){var n=this.head,e=1,t=n.data;for(a-=t.length;n=n.next;){var s=n.data,o=a&gt;s.length?s.length:a;if(t+=o===s.length?s:s.slice(0,a),0==(a-=o)){o===s.length?(++e,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=s.slice(o));break}++e}return this.length-=e,t}},{key:"_getBuffer",value:function(a){var n=c.allocUnsafe(a),e=this.head,t=1;for(e.data.copy(n),a-=e.data.length;e=e.next;){var s=e.data,o=a&gt;s.length?s.length:a;if(s.copy(n,n.length-a,0,o),0==(a-=o)){o===s.length?(++t,this.head=e.next?e.next:this.tail=null):(this.head=e,e.data=s.slice(o));break}++t}return this.length-=t,n}},{key:h,value:function(a,n){return g(this,C(C({},n),{},{depth:0,customInspect:!1}))}}]),r}()},61412:k=&gt;{"use strict";function b(E,d){O(E,d),w(E)}function w(E){E._writableState&amp;&amp;!E._writableState.emitClose||E._readableState&amp;&amp;!E._readableState.emitClose||E.emit("close")}function O(E,d){E.emit("error",d)}k.exports={destroy:function M(E,d){var v=this;return this._readableState&amp;&amp;this._readableState.destroyed||this._writableState&amp;&amp;this._writableState.destroyed?(d?d(E):E&amp;&amp;(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(O,this,E)):process.nextTick(O,this,E)),this):(this._readableState&amp;&amp;(this._readableState.destroyed=!0),this._writableState&amp;&amp;(this._writableState.destroyed=!0),this._destroy(E||null,function(c){!d&amp;&amp;c?v._writableState?v._writableState.errorEmitted?process.nextTick(w,v):(v._writableState.errorEmitted=!0,process.nextTick(b,v,c)):process.nextTick(b,v,c):d?(process.nextTick(w,v),d(c)):process.nextTick(w,v)}),this)},undestroy:function C(){this._readableState&amp;&amp;(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&amp;&amp;(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function P(E,d){var v=E._readableState,_=E._writableState;v&amp;&amp;v.autoDestroy||_&amp;&amp;_.autoDestroy?E.destroy(d):E.emit("error",d)}}},76527:(k,M,b)=&gt;{"use strict";var w=b(95096).i.ERR_STREAM_PREMATURE_CLOSE;function O(){}k.exports=function E(d,v,_){if("function"==typeof v)return E(d,null,v);v||(v={}),_=function C(d){var v=!1;return function(){if(!v){v=!0;for(var _=arguments.length,T=new Array(_),c=0;c&lt;_;c++)T[c]=arguments[c];d.apply(this,T)}}}(_||O);var T=v.readable||!1!==v.readable&amp;&amp;d.readable,c=v.writable||!1!==v.writable&amp;&amp;d.writable,u=function(){d.writable||h()},g=d._writableState&amp;&amp;d._writableState.finished,h=function(){c=!1,g=!0,T||_.call(d)},l=d._readableState&amp;&amp;d._readableState.endEmitted,r=function(){T=!1,l=!0,c||_.call(d)},i=function(t){_.call(d,t)},a=function(){var t;return T&amp;&amp;!l?((!d._readableState||!d._readableState.ended)&amp;&amp;(t=new w),_.call(d,t)):c&amp;&amp;!g?((!d._writableState||!d._writableState.ended)&amp;&amp;(t=new w),_.call(d,t)):void 0},n=function(){d.req.on("finish",h)};return function P(d){return d.setHeader&amp;&amp;"function"==typeof d.abort}(d)?(d.on("complete",h),d.on("abort",a),d.req?n():d.on("request",n)):c&amp;&amp;!d._writableState&amp;&amp;(d.on("end",u),d.on("close",u)),d.on("end",r),d.on("finish",h),!1!==v.error&amp;&amp;d.on("error",i),d.on("close",a),function(){d.removeListener("complete",h),d.removeListener("abort",a),d.removeListener("request",n),d.req&amp;&amp;d.req.removeListener("finish",h),d.removeListener("end",u),d.removeListener("close",u),d.removeListener("finish",h),d.removeListener("end",r),d.removeListener("error",i),d.removeListener("close",a)}}},28360:k=&gt;{k.exports=function(){throw new Error("Readable.from is not available in the browser")}},49984:(k,M,b)=&gt;{"use strict";var w,O=b(95096).i,P=O.ERR_MISSING_ARGS,E=O.ERR_STREAM_DESTROYED;function d(h){if(h)throw h}function T(h){h()}function c(h,l){return h.pipe(l)}k.exports=function g(){for(var h=arguments.length,l=new Array(h),r=0;r&lt;h;r++)l[r]=arguments[r];var i=function u(h){return h.length&amp;&amp;"function"==typeof h[h.length-1]?h.pop():d}(l);if(Array.isArray(l[0])&amp;&amp;(l=l[0]),l.length&lt;2)throw new P("streams");var a,n=l.map(function(e,t){var s=t&lt;l.length-1;return function _(h,l,r,i){i=function C(h){var l=!1;return function(){l||(l=!0,h.apply(void 0,arguments))}}(i);var a=!1;h.on("close",function(){a=!0}),void 0===w&amp;&amp;(w=b(76527)),w(h,{readable:l,writable:r},function(e){if(e)return i(e);a=!0,i()});var n=!1;return function(e){if(!a&amp;&amp;!n){if(n=!0,function v(h){return h.setHeader&amp;&amp;"function"==typeof h.abort}(h))return h.abort();if("function"==typeof h.destroy)return h.destroy();i(e||new E("pipe"))}}}(e,s,t&gt;0,function(f){a||(a=f),f&amp;&amp;n.forEach(T),!s&amp;&amp;(n.forEach(T),i(a))})});return l.reduce(c)}},63800:(k,M,b)=&gt;{"use strict";var w=b(95096).i.ERR_INVALID_OPT_VALUE;k.exports={getHighWaterMark:function O(P,E,d,v){var _=function C(P,E,d){return null!=P.highWaterMark?P.highWaterMark:E?P[d]:null}(E,v,d);if(null!=_){if(!isFinite(_)||Math.floor(_)!==_||_&lt;0)throw new w(v?d:"highWaterMark",_);return Math.floor(_)}return P.objectMode?16:16384}}},73187:(k,M,b)=&gt;{k.exports=b(91656).EventEmitter},1520:(k,M,b)=&gt;{(M=k.exports=b(89680)).Stream=M,M.Readable=M,M.Writable=b(76848),M.Duplex=b(30764),M.Transform=b(78316),M.PassThrough=b(16635),M.finished=b(76527),M.pipeline=b(49984)},81652:(k,M,b)=&gt;{k.exports=function C(O,P){let E,d,v,_=!0;function T(u){function g(){P&amp;&amp;P(u,E),P=null}_?w(g):g()}function c(u,g,h){E[u]=h,(0==--d||g)&amp;&amp;T(g)}Array.isArray(O)?(E=[],d=O.length):(v=Object.keys(O),E={},d=v.length),d?v?v.forEach(function(u){O[u](function(g,h){c(u,g,h)})}):O.forEach(function(u,g){u(function(h,l){c(g,h,l)})}):T(null),_=!1};const w=b(6749)},81872:(k,M,b)=&gt;{const w=b(30221)("simple-peer"),C=b(36032),O=b(42368),P=b(1520),E=b(6749),d=b(89368),{Buffer:v}=b(60773),_=65536;function u(l){return l.replace(/a=ice-options:trickle\s\n/g,"")}class h extends P.Duplex{constructor(r){if(super(r=Object.assign({allowHalfOpen:!1},r)),this._id=O(4).toString("hex").slice(0,7),this._debug("new peer %o",r),this.channelName=r.initiator?r.channelName||O(20).toString("hex"):null,this.initiator=r.initiator||!1,this.channelConfig=r.channelConfig||h.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},h.config,r.config),this.offerOptions=r.offerOptions||{},this.answerOptions=r.answerOptions||{},this.sdpTransform=r.sdpTransform||(i=&gt;i),this.streams=r.streams||(r.stream?[r.stream]:[]),this.trickle=void 0===r.trickle||r.trickle,this.allowHalfTrickle=void 0!==r.allowHalfTrickle&amp;&amp;r.allowHalfTrickle,this.iceCompleteTimeout=r.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=r.wrtc&amp;&amp;"object"==typeof r.wrtc?r.wrtc:C(),!this._wrtc)throw d(typeof window&gt;"u"?new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"):new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(i){return void this.destroy(d(i,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=&gt;{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=&gt;{this._onIceStateChange()},this._pc.onconnectionstatechange=()=&gt;{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=&gt;{this._onSignalingStateChange()},this._pc.onicecandidate=i=&gt;{this._onIceCandidate(i)},"object"==typeof this._pc.peerIdentity&amp;&amp;this._pc.peerIdentity.catch(i=&gt;{this.destroy(d(i,"ERR_PC_PEER_IDENTITY"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=i=&gt;{this._setupData(i)},this.streams&amp;&amp;this.streams.forEach(i=&gt;{this.addStream(i)}),this._pc.ontrack=i=&gt;{this._onTrack(i)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=&gt;{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&amp;&amp;this._channel.bufferedAmount||0}get connected(){return this._connected&amp;&amp;"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(r){if(!this.destroying){if(this.destroyed)throw d(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof r)try{r=JSON.parse(r)}catch{r={}}this._debug("signal()"),r.renegotiate&amp;&amp;this.initiator&amp;&amp;(this._debug("got request to renegotiate"),this._needsNegotiation()),r.transceiverRequest&amp;&amp;this.initiator&amp;&amp;(this._debug("got request for transceiver"),this.addTransceiver(r.transceiverRequest.kind,r.transceiverRequest.init)),r.candidate&amp;&amp;(this._pc.remoteDescription&amp;&amp;this._pc.remoteDescription.type?this._addIceCandidate(r.candidate):this._pendingCandidates.push(r.candidate)),r.sdp&amp;&amp;this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(r)).then(()=&gt;{this.destroyed||(this._pendingCandidates.forEach(i=&gt;{this._addIceCandidate(i)}),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&amp;&amp;this._createAnswer())}).catch(i=&gt;{this.destroy(d(i,"ERR_SET_REMOTE_DESCRIPTION"))}),!r.sdp&amp;&amp;!r.candidate&amp;&amp;!r.renegotiate&amp;&amp;!r.transceiverRequest&amp;&amp;this.destroy(d(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(r){const i=new this._wrtc.RTCIceCandidate(r);this._pc.addIceCandidate(i).catch(a=&gt;{!i.address||i.address.endsWith(".local")?function g(l){console.warn(l)}("Ignoring unsupported ICE candidate."):this.destroy(d(a,"ERR_ADD_ICE_CANDIDATE"))})}send(r){if(!this.destroying){if(this.destroyed)throw d(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(r)}}addTransceiver(r,i){if(!this.destroying){if(this.destroyed)throw d(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(r,i),this._needsNegotiation()}catch(a){this.destroy(d(a,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:r,init:i}})}}addStream(r){if(!this.destroying){if(this.destroyed)throw d(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),r.getTracks().forEach(i=&gt;{this.addTrack(i,r)})}}addTrack(r,i){if(this.destroying)return;if(this.destroyed)throw d(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const a=this._senderMap.get(r)||new Map;let n=a.get(i);if(n)throw n.removed?d(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):d(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");n=this._pc.addTrack(r,i),a.set(i,n),this._senderMap.set(r,a),this._needsNegotiation()}replaceTrack(r,i,a){if(this.destroying)return;if(this.destroyed)throw d(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const n=this._senderMap.get(r),e=n?n.get(a):null;if(!e)throw d(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");i&amp;&amp;this._senderMap.set(i,n),null!=e.replaceTrack?e.replaceTrack(i):this.destroy(d(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(r,i){if(this.destroying)return;if(this.destroyed)throw d(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const a=this._senderMap.get(r),n=a?a.get(i):null;if(!n)throw d(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{n.removed=!0,this._pc.removeTrack(n)}catch(e){"NS_ERROR_UNEXPECTED"===e.name?this._sendersAwaitingStable.push(n):this.destroy(d(e,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(r){if(!this.destroying){if(this.destroyed)throw d(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),r.getTracks().forEach(i=&gt;{this.removeTrack(i,r)})}}_needsNegotiation(){this._debug("_needsNegotiation"),!this._batchedNegotiation&amp;&amp;(this._batchedNegotiation=!0,E(()=&gt;{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw d(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout(()=&gt;{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(r){this._destroy(r,()=&gt;{})}_destroy(r,i){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",r&amp;&amp;(r.message||r)),E(()=&gt;{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",r&amp;&amp;(r.message||r)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&amp;&amp;this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch{}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch{}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,r&amp;&amp;this.emit("error",r),this.emit("close"),i()}))}_setupData(r){if(!r.channel)return this.destroy(d(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=r.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&amp;&amp;(this._channel.bufferedAmountLowThreshold=_),this.channelName=this._channel.label,this._channel.onmessage=a=&gt;{this._onChannelMessage(a)},this._channel.onbufferedamountlow=()=&gt;{this._onChannelBufferedAmountLow()},this._channel.onopen=()=&gt;{this._onChannelOpen()},this._channel.onclose=()=&gt;{this._onChannelClose()},this._channel.onerror=a=&gt;{const n=a.error instanceof Error?a.error:new Error(`Datachannel error: ${a.message} ${a.filename}:${a.lineno}:${a.colno}`);this.destroy(d(n,"ERR_DATA_CHANNEL"))};let i=!1;this._closingInterval=setInterval(()=&gt;{this._channel&amp;&amp;"closing"===this._channel.readyState?(i&amp;&amp;this._onChannelClose(),i=!0):i=!1},5e3)}_read(){}_write(r,i,a){if(this.destroyed)return a(d(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(r)}catch(n){return this.destroy(d(n,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount&gt;_?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=a):a(null)}else this._debug("write before connect"),this._chunk=r,this._cb=a}_onFinish(){if(this.destroyed)return;const r=()=&gt;{setTimeout(()=&gt;this.destroy(),1e3)};this._connected?r():this.once("connect",r)}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout(()=&gt;{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(r=&gt;{if(this.destroyed)return;!this.trickle&amp;&amp;!this.allowHalfTrickle&amp;&amp;(r.sdp=u(r.sdp)),r.sdp=this.sdpTransform(r.sdp);const i=()=&gt;{if(this.destroyed)return;const e=this._pc.localDescription||r;this._debug("signal"),this.emit("signal",{type:e.type,sdp:e.sdp})};this._pc.setLocalDescription(r).then(()=&gt;{this._debug("createOffer success"),!this.destroyed&amp;&amp;(this.trickle||this._iceComplete?i():this.once("_iceComplete",i))}).catch(e=&gt;{this.destroy(d(e,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(r=&gt;{this.destroy(d(r,"ERR_CREATE_OFFER"))})}_requestMissingTransceivers(){this._pc.getTransceivers&amp;&amp;this._pc.getTransceivers().forEach(r=&gt;{!r.mid&amp;&amp;r.sender.track&amp;&amp;!r.requested&amp;&amp;(r.requested=!0,this.addTransceiver(r.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(r=&gt;{if(this.destroyed)return;!this.trickle&amp;&amp;!this.allowHalfTrickle&amp;&amp;(r.sdp=u(r.sdp)),r.sdp=this.sdpTransform(r.sdp);const i=()=&gt;{if(this.destroyed)return;const e=this._pc.localDescription||r;this._debug("signal"),this.emit("signal",{type:e.type,sdp:e.sdp}),this.initiator||this._requestMissingTransceivers()};this._pc.setLocalDescription(r).then(()=&gt;{this.destroyed||(this.trickle||this._iceComplete?i():this.once("_iceComplete",i))}).catch(e=&gt;{this.destroy(d(e,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(r=&gt;{this.destroy(d(r,"ERR_CREATE_ANSWER"))})}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&amp;&amp;this.destroy(d(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const r=this._pc.iceConnectionState,i=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",r,i),this.emit("iceStateChange",r,i),("connected"===r||"completed"===r)&amp;&amp;(this._pcReady=!0,this._maybeReady()),"failed"===r&amp;&amp;this.destroy(d(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===r&amp;&amp;this.destroy(d(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(r){const i=a=&gt;("[object Array]"===Object.prototype.toString.call(a.values)&amp;&amp;a.values.forEach(n=&gt;{Object.assign(a,n)}),a);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then(a=&gt;{const n=[];a.forEach(e=&gt;{n.push(i(e))}),r(null,n)},a=&gt;r(a)):this._pc.getStats.length&gt;0?this._pc.getStats(a=&gt;{if(this.destroyed)return;const n=[];a.result().forEach(e=&gt;{const t={};e.names().forEach(s=&gt;{t[s]=e.stat(s)}),t.id=e.id,t.type=e.type,t.timestamp=e.timestamp,n.push(i(t))}),r(null,n)},a=&gt;r(a)):r(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const r=()=&gt;{this.destroyed||this.getStats((i,a)=&gt;{if(this.destroyed)return;i&amp;&amp;(a=[]);const n={},e={},t={};let s=!1;a.forEach(f=&gt;{("remotecandidate"===f.type||"remote-candidate"===f.type)&amp;&amp;(n[f.id]=f),("localcandidate"===f.type||"local-candidate"===f.type)&amp;&amp;(e[f.id]=f),("candidatepair"===f.type||"candidate-pair"===f.type)&amp;&amp;(t[f.id]=f)});const o=f=&gt;{s=!0;let I=e[f.localCandidateId];I&amp;&amp;(I.ip||I.address)?(this.localAddress=I.ip||I.address,this.localPort=Number(I.port)):I&amp;&amp;I.ipAddress?(this.localAddress=I.ipAddress,this.localPort=Number(I.portNumber)):"string"==typeof f.googLocalAddress&amp;&amp;(I=f.googLocalAddress.split(":"),this.localAddress=I[0],this.localPort=Number(I[1])),this.localAddress&amp;&amp;(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let R=n[f.remoteCandidateId];R&amp;&amp;(R.ip||R.address)?(this.remoteAddress=R.ip||R.address,this.remotePort=Number(R.port)):R&amp;&amp;R.ipAddress?(this.remoteAddress=R.ipAddress,this.remotePort=Number(R.portNumber)):"string"==typeof f.googRemoteAddress&amp;&amp;(R=f.googRemoteAddress.split(":"),this.remoteAddress=R[0],this.remotePort=Number(R[1])),this.remoteAddress&amp;&amp;(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(a.forEach(f=&gt;{"transport"===f.type&amp;&amp;f.selectedCandidatePairId&amp;&amp;o(t[f.selectedCandidatePairId]),("googCandidatePair"===f.type&amp;&amp;"true"===f.googActiveConnection||("candidatepair"===f.type||"candidate-pair"===f.type)&amp;&amp;f.selected)&amp;&amp;o(f)}),s||Object.keys(t).length&amp;&amp;!Object.keys(e).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(I){return this.destroy(d(I,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const f=this._cb;this._cb=null,f(null)}"number"!=typeof this._channel.bufferedAmountLowThreshold&amp;&amp;(this._interval=setInterval(()=&gt;this._onInterval(),150),this._interval.unref&amp;&amp;this._interval.unref()),this._debug("connect"),this.emit("connect")}else setTimeout(r,100)})};r()}_onInterval(){!this._cb||!this._channel||this._channel.bufferedAmount&gt;_||this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&amp;&amp;(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(r=&gt;{this._pc.removeTrack(r),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(r){this.destroyed||(r.candidate&amp;&amp;this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:r.candidate.candidate,sdpMLineIndex:r.candidate.sdpMLineIndex,sdpMid:r.candidate.sdpMid}}):!r.candidate&amp;&amp;!this._iceComplete&amp;&amp;(this._iceComplete=!0,this.emit("_iceComplete")),r.candidate&amp;&amp;this._startIceCompleteTimeout())}_onChannelMessage(r){if(this.destroyed)return;let i=r.data;i instanceof ArrayBuffer&amp;&amp;(i=v.from(i)),this.push(i)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const r=this._cb;this._cb=null,r(null)}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(r){this.destroyed||r.streams.forEach(i=&gt;{this._debug("on track"),this.emit("track",r.track,i),this._remoteTracks.push({track:r.track,stream:i}),!this._remoteStreams.some(a=&gt;a.id===i.id)&amp;&amp;(this._remoteStreams.push(i),E(()=&gt;{this._debug("on stream"),this.emit("stream",i)}))})}_debug(){const r=[].slice.call(arguments);r[0]="["+this._id+"] "+r[0],w.apply(null,r)}}h.WEBRTC_SUPPORT=!!C(),h.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},h.channelConfig={},k.exports=h},34868:(k,M,b)=&gt;{const w=b(30221)("simple-websocket"),C=b(42368),O=b(1520),P=b(6749),E=b(56832),d="function"!=typeof E?WebSocket:E;k.exports=(()=&gt;{class T extends O.Duplex{constructor(u={}){if("string"==typeof u&amp;&amp;(u={url:u}),super(u=Object.assign({allowHalfOpen:!1},u)),null==u.url&amp;&amp;null==u.socket)throw new Error("Missing required `url` or `socket` option");if(null!=u.url&amp;&amp;null!=u.socket)throw new Error("Must specify either `url` or `socket` option, not both");if(this._id=C(4).toString("hex").slice(0,7),this._debug("new websocket: %o",u),this.connected=!1,this.destroyed=!1,this._chunk=null,this._cb=null,this._interval=null,u.socket)this.url=u.socket.url,this._ws=u.socket,this.connected=u.socket.readyState===d.OPEN;else{this.url=u.url;try{this._ws="function"==typeof E?new d(u.url,null,{...u,encoding:void 0}):new d(u.url)}catch(g){return void P(()=&gt;this.destroy(g))}}this._ws.binaryType="arraybuffer",u.socket&amp;&amp;this.connected?P(()=&gt;this._handleOpen()):this._ws.onopen=()=&gt;this._handleOpen(),this._ws.onmessage=g=&gt;this._handleMessage(g),this._ws.onclose=()=&gt;this._handleClose(),this._ws.onerror=g=&gt;this._handleError(g),this._handleFinishBound=()=&gt;this._handleFinish(),this.once("finish",this._handleFinishBound)}send(u){this._ws.send(u)}destroy(u){this._destroy(u,()=&gt;{})}_destroy(u,g){if(!this.destroyed){if(this._debug("destroy (error: %s)",u&amp;&amp;(u.message||u)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this.connected=!1,this.destroyed=!0,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._handleFinishBound&amp;&amp;this.removeListener("finish",this._handleFinishBound),this._handleFinishBound=null,this._ws){const h=this._ws,l=()=&gt;{h.onclose=null};if(h.readyState===d.CLOSED)l();else try{h.onclose=l,h.close()}catch{l()}h.onopen=null,h.onmessage=null,h.onerror=()=&gt;{}}this._ws=null,u&amp;&amp;this.emit("error",u),this.emit("close"),g()}}_read(){}_write(u,g,h){if(this.destroyed)return h(new Error("cannot write after socket is destroyed"));if(this.connected){try{this.send(u)}catch(l){return this.destroy(l)}"function"!=typeof E&amp;&amp;this._ws.bufferedAmount&gt;65536?(this._debug("start backpressure: bufferedAmount %d",this._ws.bufferedAmount),this._cb=h):h(null)}else this._debug("write before connect"),this._chunk=u,this._cb=h}_handleOpen(){if(!this.connected&amp;&amp;!this.destroyed){if(this.connected=!0,this._chunk){try{this.send(this._chunk)}catch(g){return this.destroy(g)}this._chunk=null,this._debug('sent chunk from "write before connect"');const u=this._cb;this._cb=null,u(null)}"function"!=typeof E&amp;&amp;(this._interval=setInterval(()=&gt;this._onInterval(),150),this._interval.unref&amp;&amp;this._interval.unref()),this._debug("connect"),this.emit("connect")}}_handleMessage(u){if(this.destroyed)return;let g=u.data;g instanceof ArrayBuffer&amp;&amp;(g=Buffer.from(g)),this.push(g)}_handleClose(){this.destroyed||(this._debug("on close"),this.destroy())}_handleError(u){this.destroy(new Error(`Error connecting to ${this.url}`))}_handleFinish(){if(this.destroyed)return;const u=()=&gt;{setTimeout(()=&gt;this.destroy(),1e3)};this.connected?u():this.once("connect",u)}_onInterval(){if(!this._cb||!this._ws||this._ws.bufferedAmount&gt;65536)return;this._debug("ending backpressure: bufferedAmount %d",this._ws.bufferedAmount);const u=this._cb;this._cb=null,u(null)}_debug(){const u=[].slice.call(arguments);u[0]="["+this._id+"] "+u[0],w.apply(null,u)}}return T.WEBSOCKET_SUPPORT=!!d,T})()},84452:(k,M,b)=&gt;{"use strict";var w=b(268).Buffer,C=w.isEncoding||function(n){switch((n=""+n)&amp;&amp;n.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 E(n){var e;switch(this.encoding=function P(n){var e=function O(n){if(!n)return"utf8";for(var e;;)switch(n){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 n;default:if(e)return;n=(""+n).toLowerCase(),e=!0}}(n);if("string"!=typeof e&amp;&amp;(w.isEncoding===C||!C(n)))throw new Error("Unknown encoding: "+n);return e||n}(n),this.encoding){case"utf16le":this.text=g,this.end=h,e=4;break;case"utf8":this.fillLast=T,e=4;break;case"base64":this.text=l,this.end=r,e=3;break;default:return this.write=i,void(this.end=a)}this.lastNeed=0,this.lastTotal=0,this.lastChar=w.allocUnsafe(e)}function d(n){return n&lt;=127?0:n&gt;&gt;5==6?2:n&gt;&gt;4==14?3:n&gt;&gt;3==30?4:n&gt;&gt;6==2?-1:-2}function T(n){var e=this.lastTotal-this.lastNeed,t=function _(n,e,t){if(128!=(192&amp;e[0]))return n.lastNeed=0,"\ufffd";if(n.lastNeed&gt;1&amp;&amp;e.length&gt;1){if(128!=(192&amp;e[1]))return n.lastNeed=1,"\ufffd";if(n.lastNeed&gt;2&amp;&amp;e.length&gt;2&amp;&amp;128!=(192&amp;e[2]))return n.lastNeed=2,"\ufffd"}}(this,n);return void 0!==t?t:this.lastNeed&lt;=n.length?(n.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(n.copy(this.lastChar,e,0,n.length),void(this.lastNeed-=n.length))}function g(n,e){if((n.length-e)%2==0){var t=n.toString("utf16le",e);if(t){var s=t.charCodeAt(t.length-1);if(s&gt;=55296&amp;&amp;s&lt;=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",e,n.length-1)}function h(n){var e=n&amp;&amp;n.length?this.write(n):"";return this.lastNeed?e+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):e}function l(n,e){var t=(n.length-e)%3;return 0===t?n.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=n[n.length-1]:(this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1]),n.toString("base64",e,n.length-t))}function r(n){var e=n&amp;&amp;n.length?this.write(n):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function i(n){return n.toString(this.encoding)}function a(n){return n&amp;&amp;n.length?this.write(n):""}M.o=E,E.prototype.write=function(n){if(0===n.length)return"";var e,t;if(this.lastNeed){if(void 0===(e=this.fillLast(n)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t&lt;n.length?e?e+this.text(n,t):this.text(n,t):e||""},E.prototype.end=function u(n){var e=n&amp;&amp;n.length?this.write(n):"";return this.lastNeed?e+"\ufffd":e},E.prototype.text=function c(n,e){var t=function v(n,e,t){var s=e.length-1;if(s&lt;t)return 0;var o=d(e[s]);return o&gt;=0?(o&gt;0&amp;&amp;(n.lastNeed=o-1),o):--s&lt;t||-2===o?0:(o=d(e[s]))&gt;=0?(o&gt;0&amp;&amp;(n.lastNeed=o-2),o):--s&lt;t||-2===o?0:(o=d(e[s]))&gt;=0?(o&gt;0&amp;&amp;(2===o?o=0:n.lastNeed=o-3),o):0}(this,n,e);if(!this.lastNeed)return n.toString("utf8",e);this.lastTotal=t;var s=n.length-(t-this.lastNeed);return n.copy(this.lastChar,0,s),n.toString("utf8",e,s)},E.prototype.fillLast=function(n){if(this.lastNeed&lt;=n.length)return n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,n.length),this.lastNeed-=n.length}},24776:k=&gt;{function b(w){try{if(!global.localStorage)return!1}catch{return!1}var C=global.localStorage[w];return null!=C&amp;&amp;"true"===String(C).toLowerCase()}k.exports=function M(w,C){if(b("noDeprecation"))return w;var O=!1;return function P(){if(!O){if(b("throwDeprecation"))throw new Error(C);b("traceDeprecation")?console.trace(C):console.warn(C),O=!0}return w.apply(this,arguments)}}},81048:k=&gt;{k.exports=function M(b,w){if(b&amp;&amp;w)return M(b)(w);if("function"!=typeof b)throw new TypeError("need wrapper function");return Object.keys(b).forEach(function(O){C[O]=b[O]}),C;function C(){for(var O=new Array(arguments.length),P=0;P&lt;O.length;P++)O[P]=arguments[P];var E=b.apply(this,O),d=O[O.length-1];return"function"==typeof E&amp;&amp;E!==d&amp;&amp;Object.keys(d).forEach(function(v){E[v]=d[v]}),E}}},34288:()=&gt;{},90012:()=&gt;{},44856:()=&gt;{},32808:()=&gt;{},73236:()=&gt;{},13716:()=&gt;{},56832:()=&gt;{},85752:k=&gt;{function M(w,C,O,P,E,d,v){try{var _=w[d](v),T=_.value}catch(c){return void O(c)}_.done?C(T):Promise.resolve(T).then(P,E)}k.exports=function b(w){return function(){var C=this,O=arguments;return new Promise(function(P,E){var d=w.apply(C,O);function v(T){M(d,P,E,v,_,"next",T)}function _(T){M(d,P,E,v,_,"throw",T)}v(void 0)})}},k.exports.__esModule=!0,k.exports.default=k.exports}}]);
//# sourceMappingURL=6136.5a23b7bfee0c3196.js.map</pre></body></html>