n)b+=(1<>>=p;0>>8,e[g+2]=255^e[g],e[g+3]=255^e[g+1];for(var o=0;oz;++z){x=P[z];for(var ee,f=0;f>>5),C+=x[f]>>>12)}}else Q=K,D=E,j=F,H=O;for(var f=0;f>>18;q(n,C,Q[ee+257]),C+=D[ee+257],7>>23),C+=G[ee]);var te=31&t[f];q(n,C,j[te]),C+=H[te],3>>5),C+=h[te])}else q(n,C,Q[t[f]]),C+=D[t[f]];return q(n,C,Q[256]),C+D[256]},ge=new W([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oe=new V(0),de=function(t,g,c,C,I,r){var m=t.length,s=new V(C+m+5*(1+a(m/7e3))+I),o=s.subarray(C,s.length-I),A=0;if(!g||8>m)for(var u,Z=0;Z<=m;Z+=65535)u=Z+65535,uQ;++Q)B[Q]=0;for(var Q=0;30>Q;++Q)Y[Q]=0}var D=2,x=0,P=8191&b,z=32767&F-J;if(2>>13,U)-1,q=n(32767,Z),$=n(258,U);z<=q&&--P&&F!=J;){if(t[Z+D]==t[Z+D-z]){for(var ee=0;ee<$&&t[Z+ee]==t[Z+ee-z];++ee);if(ee>D){if(D=ee,x=z,ee>_)break;for(var ne=n(z,ee-2),ie=0,Q=0;Qie&&(ie=ce,J=de)}}}F=J,J=y[F],z+=32767&F-J+32768}if(x){f[E++]=268435456|R[D]<<18|T[x];var se=31&R[D],Ce=31&T[x];v+=G[se]+h[Ce],++B[257+se],++Y[Ce],O=Z+D,++N}else f[E++]=t[Z],++B[t[Z]]}}A=te(t,o,r,f,B,Y,v,E,K,Z-K,A),!r&&7&A&&(A=ae(o,A+1,oe))}return M(s,0,C+H(A)+I)},le=function(){var t=1,g=0;return{p:function(a){for(var o,d=t,c=g,s=0|a.length,l=0;l!=s;){for(o=n(l+2655,s);l>16),c=(65535&c)+15*(c>>16)}t=d,g=c},d:function(){return t%=65521,g%=65521,(255&t)<<24|t>>>8<<16|(255&g)<<8|g>>>8}}},ce=function(e,i,g,o,d){return de(e,null==i.level?6:i.level,null==i.mem?a(1.5*t(8,n(13,Math.log(e.length)))):12+i.mem,g,o,!d)},se=function(e,n,i){for(;i;++n)e[n]=i,i>>>=8},Ce=function(e,n){var i=n.level,a=0==i?0:6>i?1:9==i?3:2;e[0]=120,e[1]=a<<6|(a?32-2*a:1)},Ie=function(e){(8!=(15&e[0])||7>>4||(e[0]<<8|e[1])%31)&&j(6,"invalid zlib data"),32&e[1]&&j(6,"invalid zlib data: preset dictionaries not supported")},re="undefined"!=typeof TextDecoder&&new TextDecoder,me=0;try{re.decode(oe,{stream:!0}),me=1}catch(n){}class Ae extends Error{}class ue{constructor(e,n,i,a,t,g){this.role=n,this.channelId=i,this.metadata=a,this.signalingUrlCandidates=e,this.options=t,this.connectionTimeout=6e4,"number"==typeof this.options.timeout&&(console.warn("@deprecated timeout option will be removed in a future version. Use connectionTimeout."),this.connectionTimeout=this.options.timeout),"number"==typeof this.options.connectionTimeout&&(this.connectionTimeout=this.options.connectionTimeout),this.disconnectWaitTimeout=3e3,"number"==typeof this.options.disconnectWaitTimeout&&(this.disconnectWaitTimeout=this.options.disconnectWaitTimeout),this.signalingCandidateTimeout=3e3,"number"==typeof this.options.signalingCandidateTimeout&&(this.signalingCandidateTimeout=this.options.signalingCandidateTimeout),this.constraints=null,this.debug=g,this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.callbacks={disconnect:()=>{},push:()=>{},addstream:()=>{},track:()=>{},removestream:()=>{},removetrack:()=>{},notify:()=>{},log:()=>{},timeout:()=>{},timeline:()=>{},signaling:()=>{}},this.authMetadata=null,this.e2ee=null,this.connectionTimeoutTimerId=0,this.monitorSignalingWebSocketEventTimerId=0,this.monitorIceConnectionStateChangeTimerId=0,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.dataChannelsCompress={}}on(e,n){"addstream"===e?console.warn("@deprecated addstream callback will be removed in a future version. Use track callback."):"removestream"==e&&console.warn("@deprecated removestream callback will be removed in a future version. Use removetrack callback."),e in this.callbacks&&(this.callbacks[e]=n)}stopAudioTrack(e){for(const n of e.getAudioTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getAudioTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}stopVideoTrack(e){for(const n of e.getVideoTracks())n.enabled=!1;return new Promise(n=>{setTimeout(async()=>{for(const n of e.getVideoTracks())if(n.stop(),e.removeTrack(n),null!==this.pc){const e=this.pc.getSenders().find(e=>e.track&&e.track.id===n.id);e&&(await e.replaceTrack(null))}n()},100)})}async replaceAudioTrack(e,n){await this.stopAudioTrack(e);const i=this.getAudioTransceiver();if(null===i)throw new Error("Unable to set an audio track. Audio track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}async replaceVideoTrack(e,n){await this.stopVideoTrack(e);const i=this.getVideoTransceiver();if(null===i)throw new Error("Unable to set video track. Video track sender is undefined");e.addTrack(n),await i.sender.replaceTrack(n)}stopStream(){return new Promise(e=>(this.debug&&console.warn("@deprecated closing MediaStream in disconnect will be removed in a future version. Close every track in the MediaStream by yourself."),!this.stream)?e():(this.stream.getTracks().forEach(e=>{e.stop()}),this.stream=null,e()))}async signalingTerminate(){await this.stopStream();for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&n.close(),delete this.dataChannels[e]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection()}async abendPeerConnectionState(e){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}for(const n of Object.keys(this.dataChannels)){const e=this.dataChannels[n];e&&e.close(),delete this.dataChannels[n]}this.ws&&(this.ws.close(),this.ws=null),this.pc&&this.pc.close(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection();const n=this.soraCloseEvent("abend",e);this.callbacks.disconnect(n),this.writeSoraTimelineLog("disconnect-abend",n)}async abend(e,n){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onclose=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label)},e.onmessage=null,e.onerror=null)}if(this.dataChannels.signaling){const n={type:"disconnect",reason:e};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(i),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(n)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,n)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}for(const i of Object.keys(this.dataChannels)){const e=this.dataChannels[i];e&&(e.onerror=null,e.close()),delete this.dataChannels[i]}if(await this.disconnectWebSocket(e),await this.disconnectPeerConnection(),this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),"WEBSOCKET-ONCLOSE"===e&&n&&(1e3===n.code||1005===n.code)){const e=this.soraCloseEvent("normal","DISCONNECT",n);return this.writeSoraTimelineLog("disconnect-normal",e),void this.callbacks.disconnect(e)}const i=this.soraCloseEvent("abend",e,n);this.writeSoraTimelineLog("disconnect-abend",i),this.callbacks.disconnect(this.soraCloseEvent("abend",e,n))}initializeConnection(){this.clientId=null,this.connectionId=null,this.remoteConnectionIds=[],this.stream=null,this.ws=null,this.pc=null,this.encodings=[],this.authMetadata=null,this.e2ee=null,this.dataChannels={},this.mids={audio:"",video:""},this.signalingSwitched=!1,this.clearConnectionTimeout()}disconnectWebSocket(e){let n=0;return this.signalingSwitched?(this.ws&&(this.ws.close(),this.ws=null),Promise.resolve(null)):new Promise(i=>{if(!this.ws)return i(null);if(this.ws.onclose=e=>(this.ws&&(this.ws.close(),this.ws=null),clearTimeout(n),this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),i({code:e.code,reason:e.reason})),1===this.ws.readyState){const a={type:"disconnect",reason:e};this.ws.send(JSON.stringify(a)),this.writeWebSocketSignalingLog("send-disconnect",a),n=setTimeout(()=>{this.ws&&(this.ws.close(),this.ws=null),i(null)},this.disconnectWaitTimeout)}else return this.ws.close(),this.ws=null,i(null)})}disconnectDataChannel(){const e=()=>{for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onerror=null,n.close()),delete this.dataChannels[e]}};return new Promise((n,i)=>{if(!this.dataChannels.signaling)return e(),n({code:4999,reason:""});const a=setTimeout(()=>(e(),i()),this.disconnectWaitTimeout),t=[];for(const g of Object.keys(this.dataChannels)){const i=this.dataChannels[g];if(i){i.onerror=()=>(clearTimeout(a),e(),n({code:4999,reason:""}));t.push((()=>new Promise(e=>{let n=0;const a=setInterval(()=>{n++,"closed"===i.readyState&&(clearInterval(a),e()),this.disconnectWaitTimeout<100*n&&(e(),clearInterval(a))},100)}))())}}Promise.all(t).then(()=>{0===Object.keys(this.dataChannels).length?n(null):n({code:4999,reason:""})}).finally(()=>{e(),clearTimeout(a)});const g={type:"disconnect",reason:"NO-ERROR"};if(!0===this.dataChannelsCompress.signaling){const e=new TextEncoder().encode(JSON.stringify(g)),n=o(e,{});if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(n),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}}else if("open"===this.dataChannels.signaling.readyState)try{this.dataChannels.signaling.send(JSON.stringify(g)),this.writeDataChannelSignalingLog("send-disconnect",this.dataChannels.signaling,g)}catch(n){const e=n.message;this.writeDataChannelSignalingLog("failed-to-send-disconnect",this.dataChannels.signaling,e)}})}disconnectPeerConnection(){return new Promise(e=>(this.pc&&"closed"!==this.pc.connectionState&&this.pc.close(),e()))}async disconnect(){this.clearMonitorIceConnectionStateChange(),await this.stopStream(),this.pc&&(this.pc.ondatachannel=null,this.pc.oniceconnectionstatechange=null,this.pc.onicegatheringstatechange=null,this.pc.onconnectionstatechange=null),this.ws&&(this.ws.onclose=e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason})},this.ws.onmessage=null,this.ws.onerror=null);for(const e of Object.keys(this.dataChannels)){const n=this.dataChannels[e];n&&(n.onmessage=null)}let e=null;if(this.signalingSwitched){try{const n=await this.disconnectDataChannel();null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}catch(n){e=this.soraCloseEvent("abend","DISCONNECT-TIMEOUT")}await this.disconnectWebSocket("NO-ERROR"),await this.disconnectPeerConnection()}else{const n=await this.disconnectWebSocket("NO-ERROR");await this.disconnectPeerConnection(),null!==n&&(e=this.soraCloseEvent("normal","DISCONNECT",n))}this.e2ee&&this.e2ee.terminateWorker(),this.initializeConnection(),e&&("abend"===e.type?this.writeSoraTimelineLog("disconnect-abend",e):"normal"===e.type&&this.writeSoraTimelineLog("disconnect-normal",e),this.callbacks.disconnect(e))}setupE2EE(){!0===this.options.e2ee&&(this.e2ee=new p,this.e2ee.onWorkerDisconnect=async()=>{await this.abend("INTERNAL-ERROR",{reason:"CRASH-E2EE-WORKER"})},this.e2ee.startWorker())}startE2EE(){if(!0===this.options.e2ee&&this.e2ee){if(!this.connectionId){const e=new Error;throw e.message=`E2EE failed. Self connectionId is null`,e}this.e2ee.clearWorker();const e=this.e2ee.start(this.connectionId);this.e2ee.postSelfSecretKeyMaterial(this.connectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}async getSignalingWebSocket(e){if("string"==typeof e){return new Promise((n,i)=>{const a=new WebSocket(e);a.onclose=e=>{const n=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),i(n)},a.onopen=()=>{n(a)}})}if(Array.isArray(e)){let n=!1;const i=e=>new Promise((i,a)=>{const t=new WebSocket(e),g=setTimeout(()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"timeout",url:t.url}),t&&!n&&(t.onclose=null,t.onerror=null,t.onopen=null,t.close(),a())},this.signalingCandidateTimeout);t.onclose=e=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"close",url:t.url,message:`WebSocket closed`,code:e.code,reason:e.reason}),t&&t.close(),clearInterval(g),a()},t.onerror=()=>{this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"error",url:t.url,message:`Failed to connect WebSocket`}),t&&(t.onclose=null,t.close()),clearInterval(g),a()},t.onopen=()=>{t&&(clearInterval(g),n?(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!1}),t.onerror=null,t.onclose=null,t.onopen=null,t.close(),a()):(this.writeWebSocketSignalingLog("signaling-url-canidate",{type:"open",url:t.url,selected:!0}),t.onerror=null,t.onclose=null,t.onopen=null,n=!0,i(t)))}});try{return await Promise.any(e.map(e=>i(e)))}catch(n){throw new Ae("Signaling failed. All signaling URL candidates failed to connect")}}throw new Ae("Signaling failed. Invalid format signaling URL candidates")}async signaling(e,n=!1){const i=await this.createOffer();return this.trace("CREATE OFFER",i),new Promise((a,t)=>{this.writeWebSocketSignalingLog("new-websocket",e.url),e.binaryType="arraybuffer",e.onclose=async e=>{const n=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);n.code=e.code,n.reason=e.reason,this.writeWebSocketTimelineLog("onclose",n),await this.signalingTerminate(),t(n)},e.onmessage=async e=>{if(e.data instanceof ArrayBuffer)return this.writeWebSocketSignalingLog("onmessage-e2ee",e.data),void this.signalingOnMessageE2EE(e.data);const n=JSON.parse(e.data);if("offer"==n.type)this.writeWebSocketSignalingLog("onmessage-offer",n),this.signalingOnMessageTypeOffer(n),a(n);else if("update"==n.type)this.writeWebSocketSignalingLog("onmessage-update",n),await this.signalingOnMessageTypeUpdate(n);else if("re-offer"==n.type)this.writeWebSocketSignalingLog("onmessage-re-offer",n),await this.signalingOnMessageTypeReOffer(n);else if("ping"==n.type)await this.signalingOnMessageTypePing(n);else if("push"==n.type)this.callbacks.push(n,"websocket");else if("notify"==n.type)"connection.created"===n.event_type?this.writeWebSocketTimelineLog("notify-connection.created",n):"connection.destroyed"===n.event_type&&this.writeWebSocketTimelineLog("notify-connection.destroyed",n),this.signalingOnMessageTypeNotify(n,"websocket");else if("switched"==n.type)this.writeWebSocketSignalingLog("onmessage-switched",n),this.signalingOnMessageTypeSwitched(n);else if("redirect"==n.type){this.writeWebSocketSignalingLog("onmessage-redirect",n);const e=await this.signalingOnMessageTypeRedirect(n);a(e)}},(async()=>{let a;try{a=C(i.sdp||"",this.role,this.channelId,this.metadata,this.options,n)}catch(e){return void t(e)}if(a.e2ee&&this.e2ee){const e=await this.e2ee.init();a.signaling_notify_metadata.pre_key_bundle=e}this.trace("SIGNALING CONNECT MESSAGE",a),e&&(e.send(JSON.stringify(a)),this.writeWebSocketSignalingLog(`send-${a.type}`,a),this.ws=e)})()})}async connectPeerConnection(e){let n=Object.assign({},e.config);if(this.e2ee&&(n=Object.assign({encodedInsertableStreams:!0},n)),void 0!==window.RTCPeerConnection.generateCertificate){const e=await window.RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"});n=Object.assign({certificates:[e]},n)}return this.trace("PEER CONNECTION CONFIG",n),this.writePeerConnectionTimelineLog("new-peerconnection",n),this.pc=new window.RTCPeerConnection(n,this.constraints),this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState))},this.pc.onicegatheringstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onicegatheringstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},this.pc.onconnectionstatechange=()=>{this.pc&&this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState})},void(this.pc.ondatachannel=e=>{this.onDataChannel(e)})}async setRemoteDescription(e){if(this.pc){const n=new RTCSessionDescription({type:"offer",sdp:e.sdp});return await this.pc.setRemoteDescription(n),void this.writePeerConnectionTimelineLog("set-remote-description",n)}}async createAnswer(e){if(this.pc){for(const e of Object.values(this.mids)){const n=this.pc.getTransceivers().find(n=>n.mid===e);n&&"recvonly"===n.direction&&(n.direction="sendrecv")}if(this.options.simulcast&&("sendrecv"===this.role||"sendonly"===this.role)){const n=this.pc.getTransceivers().find(e=>{if(e.mid&&0<=e.mid.indexOf("video")&&null!==e.sender.track&&(null===e.currentDirection||"sendonly"===e.currentDirection))return e});if(n){await this.setSenderParameters(n,this.encodings),await this.setRemoteDescription(e),this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters()),await this.setSenderParameters(n,this.encodings);const i=await this.pc.createAnswer();return await this.pc.setLocalDescription(i),void this.trace("TRANSCEIVER SENDER GET_PARAMETERS",n.sender.getParameters())}}const n=await this.pc.createAnswer();return this.writePeerConnectionTimelineLog("create-answer",n),await this.pc.setLocalDescription(n),void this.writePeerConnectionTimelineLog("set-local-description",n)}}sendAnswer(){if(this.pc&&this.ws&&this.pc.localDescription){this.trace("ANSWER SDP",this.pc.localDescription.sdp);const e={type:"answer",sdp:this.pc.localDescription.sdp};this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog("send-answer",e)}}onIceCandidate(){return new Promise(e=>{this.pc&&(this.pc.oniceconnectionstatechange=()=>{this.pc&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),"connected"===this.pc.iceConnectionState&&e())},this.pc.onicecandidate=n=>{if(this.writePeerConnectionTimelineLog("onicecandidate",n.candidate),this.pc&&this.trace("ONICECANDIDATE ICEGATHERINGSTATE",this.pc.iceGatheringState),null===n.candidate)e();else{const e=n.candidate.toJSON(),i=Object.assign(e,{type:"candidate"});this.trace("ONICECANDIDATE CANDIDATE MESSAGE",i),this.sendMessage(i)}})})}waitChangeConnectionStateConnected(){return new Promise((e,n)=>{if(this.pc&&void 0===this.pc.connectionState)return void e();const i=setInterval(()=>{if(!this.pc){const e=new Error;e.message="PeerConnection connectionState did not change to 'connected'",clearInterval(i),n(e)}else this.pc&&"connected"===this.pc.connectionState&&(clearInterval(i),e())},10)})}monitorSignalingWebSocketEvent(){return new Promise((e,n)=>{this.monitorSignalingWebSocketEventTimerId=setInterval(()=>{this.ws&&(this.clearMonitorSignalingWebSocketEvent(),this.ws.onclose=async e=>{const i=new Ae(`Signaling failed. CloseEventCode:${e.code} CloseEventReason:'${e.reason}'`);i.code=e.code,i.reason=e.reason,this.writeWebSocketTimelineLog("onclose",i),await this.signalingTerminate(),n(i)},this.ws.onerror=async()=>{const e=new Ae(`Signaling failed. WebSocket onerror was called`);this.writeWebSocketSignalingLog("onerror",e),await this.signalingTerminate(),n(e)})},100)})}monitorWebSocketEvent(){this.ws&&(this.ws.onclose=async e=>{this.writeWebSocketTimelineLog("onclose",{code:e.code,reason:e.reason}),await this.abend("WEBSOCKET-ONCLOSE",{code:e.code,reason:e.reason})},this.ws.onerror=async()=>{this.writeWebSocketSignalingLog("onerror"),await this.abend("WEBSOCKET-ONERROR")})}monitorPeerConnectionState(){this.pc&&(this.pc.oniceconnectionstatechange=async()=>{this.pc&&this.pc.connectionState===void 0&&(this.writePeerConnectionTimelineLog("oniceconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),this.trace("ONICECONNECTIONSTATECHANGE ICECONNECTIONSTATE",this.pc.iceConnectionState),clearTimeout(this.monitorIceConnectionStateChangeTimerId),"failed"===this.pc.iceConnectionState?await this.abendPeerConnectionState("ICE-CONNECTION-STATE-FAILED"):"disconnected"===this.pc.iceConnectionState&&(this.monitorIceConnectionStateChangeTimerId=setTimeout(async()=>{this.pc&&"disconnected"===this.pc.iceConnectionState&&(await this.abendPeerConnectionState("ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT"))},1e4)))},this.pc.onconnectionstatechange=async()=>{this.pc&&(this.writePeerConnectionTimelineLog("onconnectionstatechange",{connectionState:this.pc.connectionState,iceConnectionState:this.pc.iceConnectionState,iceGatheringState:this.pc.iceGatheringState}),"failed"===this.pc.connectionState&&(await this.abendPeerConnectionState("CONNECTION-STATE-FAILED")))})}setConnectionTimeout(){return new Promise((e,n)=>{0{if(!this.pc||this.pc&&this.pc.connectionState!==void 0&&"connected"!==this.pc.connectionState){const e=new Error;e.message="Signaling connection timeout",this.callbacks.timeout(),this.trace("DISCONNECT","Signaling connection timeout"),this.writePeerConnectionTimelineLog("signaling-connection-timeout",{connectionTimeout:this.connectionTimeout}),await this.signalingTerminate(),n(e)}},this.connectionTimeout))})}clearConnectionTimeout(){clearTimeout(this.connectionTimeoutTimerId)}clearMonitorSignalingWebSocketEvent(){clearInterval(this.monitorSignalingWebSocketEventTimerId)}clearMonitorIceConnectionStateChange(){clearInterval(this.monitorIceConnectionStateChangeTimerId)}trace(e,n){this.callbacks.log(e,n);this.debug&&A(this.clientId,e,n)}writeWebSocketSignalingLog(e,n){this.callbacks.signaling(u(e,n,"websocket")),this.writeWebSocketTimelineLog(e,n)}writeDataChannelSignalingLog(e,n,i){this.callbacks.signaling(u(e,i,"datachannel")),this.writeDataChannelTimelineLog(e,n,i)}writeWebSocketTimelineLog(e,n){const i=b(e,n,"websocket");this.callbacks.timeline(i)}writeDataChannelTimelineLog(e,n,i){const a=b(e,i,"datachannel",n.id,n.label);this.callbacks.timeline(a)}writePeerConnectionTimelineLog(e,n){const i=b(e,n,"peerconnection");this.callbacks.timeline(i)}writeSoraTimelineLog(e,n){const i=b(e,n,"sora");this.callbacks.timeline(i)}async createOffer(){const e=new window.RTCPeerConnection({iceServers:[]});if(s()){e.addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"});const n=await e.createOffer();return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}const n=await e.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});return e.close(),this.writePeerConnectionTimelineLog("create-offer",n),n}signalingOnMessageE2EE(e){if(this.e2ee){const n=new Uint8Array(e),i=this.e2ee.receiveMessage(n);this.e2ee.postRemoteSecretKeyMaterials(i),i.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)})}}signalingOnMessageTypeOffer(e){if(this.clientId=e.client_id,this.connectionId=e.connection_id,void 0!==e.metadata&&(this.authMetadata=e.metadata),Array.isArray(e.encodings)&&(this.encodings=e.encodings),void 0!==e.mid&&void 0!==e.mid.audio&&(this.mids.audio=e.mid.audio),void 0!==e.mid&&void 0!==e.mid.video&&(this.mids.video=e.mid.video),e.data_channels)for(const n of e.data_channels)this.dataChannelsCompress[n.label]=n.compress;this.trace("SIGNALING OFFER MESSAGE",e),this.trace("OFFER SDP",e.sdp)}sendUpdateAnswer(){this.pc&&this.ws&&this.pc.localDescription&&(this.trace("ANSWER SDP",this.pc.localDescription.sdp),this.sendMessage({type:"update",sdp:this.pc.localDescription.sdp}))}sendReAnswer(){this.pc&&this.pc.localDescription&&(this.trace("RE ANSWER SDP",this.pc.localDescription.sdp),this.sendMessage({type:"re-answer",sdp:this.pc.localDescription.sdp}))}async signalingOnMessageTypeUpdate(e){this.trace("SIGNALING UPDATE MESSGE",e),this.trace("UPDATE SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendUpdateAnswer()}async signalingOnMessageTypeReOffer(e){this.trace("SIGNALING RE OFFER MESSGE",e),this.trace("RE OFFER SDP",e.sdp),await this.setRemoteDescription(e),await this.createAnswer(e),this.sendReAnswer()}async signalingOnMessageTypePing(e){const n={type:"pong"};if(e.stats){const e=await this.getStats();n.stats=e}this.ws&&this.ws.send(JSON.stringify(n))}signalingOnMessageTypeNotify(e,n){if("connection.created"===e.event_type){const n=e.connection_id;if(this.connectionId!==n){const i=I(e),a=m(i);if(a&&this.e2ee&&n){const e=this.e2ee.startSession(n,a);this.e2ee.postRemoteSecretKeyMaterials(e),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial)}}const i=r(e);i.forEach(e=>{const n=I(e),i=m(n),a=e.connection_id;a&&this.e2ee&&i&&this.e2ee.addPreKeyBundle(a,i)})}else if("connection.destroyed"===e.event_type){const n=I(e),i=m(n),a=e.connection_id;if(i&&this.e2ee&&a){const e=this.e2ee.stopSession(a);this.e2ee.postSelfSecretKeyMaterial(e.selfConnectionId,e.selfKeyId,e.selfSecretKeyMaterial,5e3),e.messages.forEach(e=>{this.sendE2EEMessage(e.buffer)}),this.e2ee.postRemoveRemoteDeriveKey(a)}}this.callbacks.notify(e,n)}signalingOnMessageTypeSwitched(e){this.signalingSwitched=!0;!this.ws||e.ignore_disconnect_websocket&&(this.ws&&(this.ws.onclose=null,this.ws.close(),this.ws=null),this.writeWebSocketSignalingLog("close"))}async signalingOnMessageTypeRedirect(e){this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null);const n=await this.getSignalingWebSocket(e.location),i=await this.signaling(n,!0);return i}async setSenderParameters(e,n){const i=e.sender.getParameters();return i.encodings=n,await e.sender.setParameters(i),this.trace("TRANSCEIVER SENDER SET_PARAMETERS",i),void this.writePeerConnectionTimelineLog("transceiver-sender-set-parameters",i)}async getStats(){const e=[];if(!this.pc)return e;const n=await this.pc.getStats();return n.forEach(n=>{e.push(n)}),e}onDataChannel(e){const n=e.channel;this.writeDataChannelTimelineLog("ondatachannel",n,Z(n)),e.channel.onbufferedamountlow=e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onbufferedamountlow",n)},e.channel.onopen=e=>{const n=e.currentTarget;n.bufferedAmountLowThreshold=65536,n.binaryType="arraybuffer",this.dataChannels[n.label]=n,this.trace("OPEN DATA CHANNEL",n.label),"signaling"===n.label&&this.ws?this.writeDataChannelSignalingLog("onopen",n):this.writeDataChannelTimelineLog("onopen",n)},e.channel.onclose=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onclose",n),this.trace("CLOSE DATA CHANNEL",n.label),await this.disconnect()},e.channel.onerror=async e=>{const n=e.currentTarget;this.writeDataChannelTimelineLog("onerror",n),this.trace("ERROR DATA CHANNEL",n.label),await this.abend("DATA-CHANNEL-ONERROR",{params:{label:n.label}})},"signaling"===e.channel.label?e.channel.onmessage=async e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.signaling){const n=d(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);this.writeDataChannelSignalingLog(`onmessage-${a.type}`,n,a),"re-offer"===a.type&&(await this.signalingOnMessageTypeReOffer(a))}:"notify"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget;let i=e.data;if(!0===this.dataChannelsCompress.notify){const n=d(new Uint8Array(e.data));i=new TextDecoder().decode(n)}const a=JSON.parse(i);"connection.created"===a.event_type?this.writeDataChannelTimelineLog("notify-connection.created",n,a):"connection.destroyed"===a.event_type&&this.writeDataChannelTimelineLog("notify-connection.destroyed",n,a),this.signalingOnMessageTypeNotify(a,"datachannel")}:"push"===e.channel.label?e.channel.onmessage=e=>{let n=e.data;if(!0===this.dataChannelsCompress.push){const i=d(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);this.callbacks.push(i,"datachannel")}:"e2ee"===e.channel.label?e.channel.onmessage=e=>{const n=e.currentTarget,i=e.data;this.signalingOnMessageE2EE(i),this.writeDataChannelSignalingLog("onmessage-e2ee",n,i)}:"stats"===e.channel.label&&(e.channel.onmessage=async e=>{let n=e.data;if(!0===this.dataChannelsCompress.stats){const i=d(new Uint8Array(e.data));n=new TextDecoder().decode(i)}const i=JSON.parse(n);if("req-stats"===i.type){const e=await this.getStats();this.sendStatsMessage(e)}})}sendMessage(e){if(this.dataChannels.signaling){if(!0===this.dataChannelsCompress.signaling){const n=new TextEncoder().encode(JSON.stringify(e)),i=o(n,{});this.dataChannels.signaling.send(i)}else this.dataChannels.signaling.send(JSON.stringify(e));this.writeDataChannelSignalingLog(`send-${e.type}`,this.dataChannels.signaling,e)}else null!==this.ws&&(this.ws.send(JSON.stringify(e)),this.writeWebSocketSignalingLog(`send-${e.type}`,e))}sendE2EEMessage(e){this.dataChannels.e2ee?(this.dataChannels.e2ee.send(e),this.writeDataChannelSignalingLog("send-e2ee",this.dataChannels.e2ee,e)):null!==this.ws&&(this.ws.send(e),this.writeWebSocketSignalingLog("send-e2ee",e))}sendStatsMessage(e){if(this.dataChannels.stats){const n={type:"stats",reports:e};if(!0===this.dataChannelsCompress.stats){const e=new TextEncoder().encode(JSON.stringify(n)),i=o(e,{});this.dataChannels.stats.send(i)}else this.dataChannels.stats.send(JSON.stringify(n))}}getAudioTransceiver(){if(this.pc&&this.mids.audio){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.audio);return e||null}return null}getVideoTransceiver(){if(this.pc&&this.mids.video){const e=this.pc.getTransceivers().find(e=>e.mid===this.mids.video);return e||null}return null}soraCloseEvent(e,n,i){const a=class extends Event{constructor(e,n,i){super(e),i&&(i.code&&(this.code=i.code),i.reason&&(this.reason=i.reason),i.params&&(this.params=i.params)),this.title=n}};return new a(e,n,i)}get e2eeSelfFingerprint(){return this.options.e2ee&&this.e2ee?this.e2ee.selfFingerprint():void 0}get e2eeRemoteFingerprints(){return this.options.e2ee&&this.e2ee?this.e2ee.remoteFingerprints():void 0}get audio(){return null!==this.getAudioTransceiver()}get video(){return null!==this.getVideoTransceiver()}get signalingUrl(){return this.signalingUrlCandidates}get connectedSignalingUrl(){return this.ws?this.ws.url:""}}class Ze extends ue{async connect(e){return this.options.multistream?await Promise.race([this.multiStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]):await Promise.race([this.singleStream(e).finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}async singleStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),await this.setRemoteDescription(i),e.getTracks().forEach(n=>{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}async multiStream(e){await this.disconnect(),this.setupE2EE();const n=await this.getSignalingWebSocket(this.signalingUrlCandidates),i=await this.signaling(n);return this.startE2EE(),await this.connectPeerConnection(i),this.pc&&(this.pc.ontrack=e=>{const n=e.streams[0];if(n){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};(this.writePeerConnectionTimelineLog("ontrack",i),"default"!==n.id)&&n.id!==this.connectionId&&(this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{this.pc&&this.pc.addTrack(n,e)}),this.stream=e,await this.createAnswer(i),this.sendAnswer(),this.pc&&this.e2ee&&this.pc.getSenders().forEach(e=>{this.e2ee&&this.e2ee.setupSenderTransform(e)}),await this.onIceCandidate(),await this.waitChangeConnectionStateConnected(),e}}class be extends ue{async connect(){if(this.options.multistream)return await Promise.race([this.multiStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]),this.monitorWebSocketEvent(),void this.monitorPeerConnectionState();else{const e=await Promise.race([this.singleStream().finally(()=>{this.clearConnectionTimeout(),this.clearMonitorSignalingWebSocketEvent()}),this.setConnectionTimeout(),this.monitorSignalingWebSocketEvent()]);return this.monitorWebSocketEvent(),this.monitorPeerConnectionState(),e}}async singleStream(){await this.disconnect(),this.setupE2EE();const e=await this.getSignalingWebSocket(this.signalingUrlCandidates),n=await this.signaling(e);return this.startE2EE(),await this.connectPeerConnection(n),this.pc&&(this.pc.ontrack=e=>{this.stream=e.streams[0];const n=this.stream.id;if("default"!==n){const i={"stream.id":n,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),this.stream.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1{const n=e.streams[0];if("default"!==n.id&&n.id!==this.connectionId){const i={"stream.id":n.id,id:e.track.id,label:e.track.label,enabled:e.track.enabled,kind:e.track.kind,muted:e.track.muted,readyState:e.track.readyState};this.writePeerConnectionTimelineLog("ontrack",i),this.e2ee&&this.e2ee.setupReceiverTransform(e.receiver),this.callbacks.track(e),n.onremovetrack=e=>{if(this.callbacks.removetrack(e),e.target){const n=this.remoteConnectionIds.indexOf(e.target.id);-1>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.1.0\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1ZmZlcikgewogICAgLy8gMzJiaXQg44G+44Gn44KS5oOz5a6aIChCaWdJbnQg44G444Gu5pu444GN5o+b44GI5pmC44Gr6KaB5L+u5q2jKQogICAgY29uc3QgbmV3QXJyYXlCdWZmZXIgPSBuZXcgQXJyYXlCdWZmZXIoVWludDMyQXJyYXkuQllURVNfUEVSX0VMRU1FTlQpOwogICAgY29uc3QgbmV3RGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcobmV3QXJyYXlCdWZmZXIpOwogICAgY29uc3QgZGF0YVZpZXcgPSBuZXcgRGF0YVZpZXcoYXJyYXlCdWZmZXIpOwogICAgY29uc3QgcGFkZGluZ0xlbmd0aCA9IFVpbnQzMkFycmF5LkJZVEVTX1BFUl9FTEVNRU5UIC0gZGF0YVZpZXcuYnl0ZUxlbmd0aDsKICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGFkZGluZ0xlbmd0aDsg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GVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIG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U3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.1.0\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport { SoraE2EE as default };\n"],"names":["Math","min","ceil","max","global","window","self","Error","require","fs","Object","keys","enosys","err","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","console","log","substr","length","write","offset","position","callback","n","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","constructor","argv","env","exit","warn","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","floor","mem","setUint32","getInt64","low","getUint32","high","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","result","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","dst","src","Uint8ClampedArray","toCopy","subarray","value","run","instance","NaN","fill","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","resume","_makeFuncWrapper","event","this","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","zlibSync","data","opts","adler","d","dopt","zlh","wbytes","unzlibSync","out","inflt","zlv","SoraE2EE","supportsInsertableStreams","RTCRtpSender","prototype","createEncodedStreams","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","operation","clearWorker","postMessage","terminateWorker","terminate","init","preKeyBundle","e2ee","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","message","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","loadWasm","wasmUrl","WasmExec","instantiateStreaming","fetch","version","wasmVersion","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","x","_b","revfd","rev","hMap","cd","mb","s","l","le","co","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","dat","st","sl","noBuf","noSt","cbuf","bl","nbuf","final","pos","bt","lm","dm","lbt","dbt","tbts","t","hLit","hcLen","tl","ldt","clt","clb","clm","c","lt","dt","lms","dms","lpos","sym","add","dsym","end","wbits","wbits16","hTree","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","lft","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","flen","ftlen","dtlen","ll","dl","llm","clct","lcts","it","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","mmd","md","ti","pti","lin","din","level","lv","td","tds","stream"],"mappings":";;;;;;iPA0qB+BA,IAAI,CAACC,MA1DED,IAAI,CAACE,OApYbF,IAAI,CAACG,ICxOpB,UAAA,EAAY,CAC1B,CAAC,IAAM,CAUN,GAAsB,WAAlB,QAAOC,CAAAA,MAAX,CAAmC,CAAnC,IAEO,IAAsB,WAAlB,QAAOC,CAAAA,MAAX,CACNA,MAAM,CAACD,MAAP,CAAgBC,MADV,KAEA,IAAoB,WAAhB,QAAOC,CAAAA,IAAX,CACNA,IAAI,CAACF,MAAL,CAAcE,IADR,KAGN,MAAM,IAAIC,CAAAA,KAAJ,CAAU,+DAAV,CAAN,CAOD,GAJKH,MAAM,CAACI,OAAR,EAAsC,WAAnB,QAAOA,CAAAA,OAI9B,GAHCJ,MAAM,CAACI,OAAP,CAAiBA,OAGlB,EAAI,CAACJ,MAAM,CAACK,EAAR,EAAcL,MAAM,CAACI,OAAzB,CAAkC,CACjC,KAAMC,CAAAA,CAAE,CAAGD,OAAO,CAAC,IAAD,CAAlB,CACwB,CAApB,GAAAE,MAAM,CAACC,IAAP,CAAYF,CAAZ,CAF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AACA,CAAC,CAAC,CAAD,CAAD,EAAQ,CAAR,CAAYA,CAAC,CAAC,CAAD,CAAd,EAAqB,EAD/C,GAEfhN,CAAG,CAAC,CAAD,CAAI,mBAAJ,CAFY,CAGR,EAAP,CAAAgN,CAAC,CAAC,CAAD,CAHc,EAIfhN,CAAG,CAAC,CAAD,CAAI,sDAAJ,CACV,EAwjBG4b,EAAE,CAAyB,WAAtB,QAAO1W,CAAAA,WAAP,EAAmD,GAAIA,CAAAA,YAE5D2W,EAAG,CAAG,EACV,GAAI,CACAD,EAAE,CAAC9a,MAAH,CAAU2V,EAAV,CAAc,CAAEqF,MAAM,GAAR,CAAd,CADA,CAEAD,EAAG,CAAG,CACT,CACD,MAAOhI,CAAP,CAAU"}
\ No newline at end of file
+{"version":3,"file":"sora.min.js","sources":["../packages/sdk/node_modules/fflate/esm/browser.js","../packages/go-wasm/src/wasm_exec.js","../packages/e2ee/dist/sora_e2ee.mjs"],"sourcesContent":["// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n if (!sl || (st && st.f && !st.l))\n return buf || new u8(0);\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [et, 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n // deopt when i > s - 3 - at end, deopt acceptable\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst && pos & 7)\n pos = wfblk(w, pos + 1, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += d[10] | (d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if (d[1] & 32)\n err(6, 'invalid zlib data: preset dictionaries not supported');\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.d = final;\n this.p(chunk, final || false);\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n var s = this.p.length > 3 ? gzs(this.p) : 4;\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n err(6, 'invalid gzip data');\n this.p = this.p.subarray(0, -8);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return [r, slc(d, i - 1)];\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), ch = _a[0], np = _a[1];\n if (final) {\n if (np.length)\n err(8);\n this.p = null;\n }\n else\n this.p = np;\n this.ondata(ch, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td)\n return td.decode(dat);\n else {\n var _a = dutf8(dat), out = _a[0], ext = _a[1];\n if (ext.length)\n err(8);\n return out;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;\n if (c != null) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, f.c, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, new u8(su)));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n err(13);\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nexport default function () {\n\t(() => {\n\t\t// Map multiple JavaScript environments to a single common API,\n\t\t// preferring web standards over Node.js API.\n\t\t//\n\t\t// Environments considered:\n\t\t// - Browsers\n\t\t// - Node.js\n\t\t// - Electron\n\t\t// - Parcel\n\t\n\t\tif (typeof global !== \"undefined\") {\n\t\t\t// global already exists\n\t\t} else if (typeof window !== \"undefined\") {\n\t\t\twindow.global = window;\n\t\t} else if (typeof self !== \"undefined\") {\n\t\t\tself.global = self;\n\t\t} else {\n\t\t\tthrow new Error(\"cannot export Go (neither global, window nor self is defined)\");\n\t\t}\n\t\n\t\tif (!global.require && typeof require !== \"undefined\") {\n\t\t\tglobal.require = require;\n\t\t}\n\t\n\t\tif (!global.fs && global.require) {\n\t\t\tconst fs = require(\"fs\");\n\t\t\tif (Object.keys(fs) !== 0) {\n\t\t\t\tglobal.fs = fs;\n\t\t\t}\n\t\t}\n\t\n\t\tconst enosys = () => {\n\t\t\tconst err = new Error(\"not implemented\");\n\t\t\terr.code = \"ENOSYS\";\n\t\t\treturn err;\n\t\t};\n\t\n\t\tif (!global.fs) {\n\t\t\tlet outputBuf = \"\";\n\t\t\tglobal.fs = {\n\t\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\t\twriteSync(fd, buf) {\n\t\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\t\tif (nl != -1) {\n\t\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.length;\n\t\t\t\t},\n\t\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\t\tcallback(enosys());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\t\tcallback(null, n);\n\t\t\t\t},\n\t\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.process) {\n\t\t\tglobal.process = {\n\t\t\t\tgetuid() { return -1; },\n\t\t\t\tgetgid() { return -1; },\n\t\t\t\tgeteuid() { return -1; },\n\t\t\t\tgetegid() { return -1; },\n\t\t\t\tgetgroups() { throw enosys(); },\n\t\t\t\tpid: -1,\n\t\t\t\tppid: -1,\n\t\t\t\tumask() { throw enosys(); },\n\t\t\t\tcwd() { throw enosys(); },\n\t\t\t\tchdir() { throw enosys(); },\n\t\t\t}\n\t\t}\n\t\n\t\tif (!global.crypto) {\n\t\t\tconst nodeCrypto = require(\"crypto\");\n\t\t\tglobal.crypto = {\n\t\t\t\tgetRandomValues(b) {\n\t\t\t\t\tnodeCrypto.randomFillSync(b);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.performance) {\n\t\t\tglobal.performance = {\n\t\t\t\tnow() {\n\t\t\t\t\tconst [sec, nsec] = process.hrtime();\n\t\t\t\t\treturn sec * 1000 + nsec / 1000000;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\n\t\tif (!global.TextEncoder) {\n\t\t\tglobal.TextEncoder = require(\"util\").TextEncoder;\n\t\t}\n\t\n\t\tif (!global.TextDecoder) {\n\t\t\tglobal.TextDecoder = require(\"util\").TextDecoder;\n\t\t}\n\t\n\t\t// End of polyfills for common API.\n\t\n\t\tconst encoder = new TextEncoder(\"utf-8\");\n\t\tconst decoder = new TextDecoder(\"utf-8\");\n\t\n\t\tglobal.Go = class {\n\t\t\tconstructor() {\n\t\t\t\tthis.argv = [\"js\"];\n\t\t\t\tthis.env = {};\n\t\t\t\tthis.exit = (code) => {\n\t\t\t\t\tif (code !== 0) {\n\t\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t\t});\n\t\t\t\tthis._pendingEvent = null;\n\t\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\t\tthis._nextCallbackTimeoutID = 1;\n\t\n\t\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t\t}\n\t\n\t\t\t\tconst getInt64 = (addr) => {\n\t\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\t\treturn low + high * 4294967296;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadValue = (addr) => {\n\t\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\t\tif (f === 0) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\t\treturn this._values[id];\n\t\t\t\t}\n\t\n\t\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\t\tconst nanHead = 0x7FF80000;\n\t\n\t\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif (v === undefined) {\n\t\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t\t}\n\t\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\t\tlet typeFlag = 0;\n\t\t\t\t\tswitch (typeof v) {\n\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSlice = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t\t}\n\t\n\t\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\tconst a = new Array(len);\n\t\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\n\t\t\t\tconst loadString = (addr) => {\n\t\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t\t}\n\t\n\t\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\t\tthis.importObject = {\n\t\t\t\t\tgo: {\n\t\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\t\n\t\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func walltime1() (sec int64, nsec int32)\n\t\t\t\t\t\t\"runtime.walltime1\": (sp) => {\n\t\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\t\tsp = this._inst.exports.getsp(); // see comment above\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t},\n\t\n\t\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\n\t\t\tasync run(instance) {\n\t\t\t\tthis._inst = instance;\n\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\t\tNaN,\n\t\t\t\t\t0,\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t\tglobal,\n\t\t\t\t\tthis,\n\t\t\t\t];\n\t\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t\t[0, 1],\n\t\t\t\t\t[null, 2],\n\t\t\t\t\t[true, 3],\n\t\t\t\t\t[false, 4],\n\t\t\t\t\t[global, 5],\n\t\t\t\t\t[this, 6],\n\t\t\t\t]);\n\t\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\t\tthis.exited = false; // whether the Go program has exited\n\t\n\t\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\t\tlet offset = 4096;\n\t\n\t\t\t\tconst strPtr = (str) => {\n\t\t\t\t\tconst ptr = offset;\n\t\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\t\toffset += bytes.length;\n\t\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t\t}\n\t\t\t\t\treturn ptr;\n\t\t\t\t};\n\t\n\t\t\t\tconst argc = this.argv.length;\n\t\n\t\t\t\tconst argvPtrs = [];\n\t\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\t\tkeys.forEach((key) => {\n\t\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t\t});\n\t\t\t\targvPtrs.push(0);\n\t\n\t\t\t\tconst argv = offset;\n\t\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\t\toffset += 8;\n\t\t\t\t});\n\t\n\t\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t\tawait this._exitPromise;\n\t\t\t}\n\t\n\t\t\t_resume() {\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t\t}\n\t\t\t\tthis._inst.exports.resume();\n\t\t\t\tif (this.exited) {\n\t\t\t\t\tthis._resolveExitPromise();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t_makeFuncWrapper(id) {\n\t\t\t\tconst go = this;\n\t\t\t\treturn function () {\n\t\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\t\tgo._pendingEvent = event;\n\t\t\t\t\tgo._resume();\n\t\t\t\t\treturn event.result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\n\t\tif (\n\t\t\tglobal.require &&\n\t\t\tglobal.require.main === module &&\n\t\t\tglobal.process &&\n\t\t\tglobal.process.versions &&\n\t\t\t!global.process.versions.electron\n\t\t) {\n\t\t\tif (process.argv.length < 3) {\n\t\t\t\tconsole.error(\"usage: go_js_wasm_exec [wasm binary] [arguments]\");\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\n\t\t\tconst go = new Go();\n\t\t\tgo.argv = process.argv.slice(2);\n\t\t\tgo.env = Object.assign({ TMPDIR: require(\"os\").tmpdir() }, process.env);\n\t\t\tgo.exit = process.exit;\n\t\t\tWebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {\n\t\t\t\tprocess.on(\"exit\", (code) => { // Node.js exits if no event handler is pending\n\t\t\t\t\tif (code === 0 && !go.exited) {\n\t\t\t\t\t\t// deadlock, make Go print error and stack traces\n\t\t\t\t\t\tgo._pendingEvent = { id: 0 };\n\t\t\t\t\t\tgo._resume();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn go.run(result.instance);\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error(err);\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t}\n\t})();\n}\n","/**\n * @sora/e2ee\n * WebRTC SFU Sora JavaScript E2EE Library\n * @version: 2021.2.0-canary.0\n * @author: Shiguredo Inc.\n * @license: Apache-2.0\n **/\n\nimport WasmExec from '@sora/go-wasm';\n\nconst WORKER_SCRIPT = \"InVzZSBzdHJpY3QiOwovKiBlc2xpbnQtZGlzYWJsZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgKi8KY29uc3QgY29ubmVjdGlvbklkTGVuZ3RoID0gMjY7CmZ1bmN0aW9uIGJ5dGVDb3VudChuKSB7CiAgICBpZiAobiA9PSAwKSB7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICAvLyBsb2cyNTYoeCkgPSBsb2coeCkgLyBsb2coMjU2KQogICAgcmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2cobikgLyBNYXRoLmxvZygyICoqIDgpICsgMSk7Cn0KZnVuY3Rpb24gYXJyYXlCdWZmZXJUb051bWJlcihhcnJheUJ1Z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gIGNvbnN0IGRlcml2ZUtleSA9IGdldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICBpZiAoIWRlcml2ZUtleSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGl2ID0gZ2VuZXJhdGVJVihjb3VudCwgY29ubmVjdGlvbklkLCBrZXlJZCk7CiAgICAgICAgaWYgKCFpdikgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGNvbnN0IGZyYW1lQWRkID0gZW5jb2RlRnJhbWVBZGQoZnJhbWVNZXRhZGF0YSwgc2ZyYW1lSGVhZGVyLCBjb25uZWN0aW9uSWQpOwogICAgICAgIGNyeXB0by5zdWJ0bGUKICAgICAgICAgICAgLmRlY3J5cHQoewogICAgICAgICAgICBuYW1lOiAiQUVTLUdDTSIsCiAgICAgICAgICAgIGl2OiBpdiwKICAgICAgICAgICAgYWRkaXRpb25hbERhdGE6IGZyYW1lQWRkLAogICAgICAgIH0sIGRlcml2ZUtleSwgbmV3IFVpbnQ4QXJyYXkoZW5jcnlwdGVkRnJhbWVCdWZmZXIpKQogICAgICAgICAgICAudGhlbigocGxhaW5UZXh0KSA9PiB7CiAgICAgICAgICAgIGNvbnN0IG5ld0RhdGEgPSBuZXcgQXJyYXlCdWZmZXIoZnJhbWVNZXRhZGF0YUJ1ZmZlci5ieXRlTGVuZ3RoICsgcGxhaW5UZXh0LmJ5dGVMZW5ndGgpOwogICAgICAgICAgICBjb25zdCBuZXdVaW50OCA9IG5ldyBVaW50OEFycmF5KG5ld0RhdGEpOwogICAgICAgICAgICBuZXdVaW50OC5zZXQobmV3IFVpbnQ4QXJyYXkoZnJhbWVNZXRhZGF0YUJ1ZmZlciwgMCwgdW5lbmNyeXB0ZWRCeXRlc1tlbmNvZGVkRnJhbWUudHlwZV0pKTsKICAgICAgICAgICAgbmV3VWludDguc2V0KG5ldyBVaW50OEFycmF5KHBsYWluVGV4dCksIH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uaW1wb3J0S2V5KCJyYXciLCBzZWxmU2VjcmV0S2V5TWF0ZXJpYWwuYnVmZmVyLCAiSEtERiIsIGZhbHNlLCBbImRlcml2ZUJpdHMiLCAiZGVyaXZlS2V5Il0pCiAgICAgICAgICAgICAgICAudGhlbigobWF0ZXJpYWwpID0+IHsKICAgICAgICAgICAgICAgIGdlbmVyYXRlRGVyaXZlS2V5KG1hdGVyaWFsKS50aGVuKChkZXJpdmVLZXkpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRTZWxmRGVyaXZlS2V5KHNlbGZDb25uZWN0aW9uSWQsIHNlbGZLZXlJZCwgZGVyaXZlS2V5KTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZ2VuZXJhdGVXcml0ZUlWKG1hdGVyaWFsKS50aGVuKCh3cml0ZUlWKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc2V0V3JpdGVJVihzZWxmQ29ubmVjdGlvbklkLCBzZWxmS2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dElkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwgd2FpdGluZ1RpbWUgfHwgMCk7CiAgICAgICAgLy8gVE9ETzogKzEwMDAg44Gn6Y2155Sf5oiQ5b6M44Gr5a6f6KGM44GV44KM44KL44KI44GG44Gr44GX44Gm44GE44KL44GM55+t44GE5aC05ZCI44Gv5Ly444Gw44GZCiAgICAgICAgY29uc3QgcmVtb3ZhbFdhaXRpbmdUaW1lID0gKHdhaXRpbmdUaW1lIHx8IDApICsgMTAwMDsKICAgICAgICBpZiAocmVtb3ZhbFRpbWVvdXRJZCkgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zmnInjgooKICAgICAgICAgICAgaWYgKHdhaXRpbmdUaW1lKSB7CiAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLmRlc3Ryb3llZAogICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlbW92YWxUaW1lb3V0SWQpOwogICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHJlbW92ZU9sZFJlbW90ZURlcml2ZUtleXMoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICAgICAgcmVtb3ZhbFRpbWVvdXRJZCA9IDA7CiAgICAgICAgICAgICAgICB9LCByZW1vdmFsV2FpdGluZ1RpbWUpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICAvLyDli5XkvZzmuIjjgb/jgr/jgqTjg57jg7zjgarjgZcKICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5jcmVhdGVkIOOBruWgtOWQiOOCguWwkeOBl+Wun+ihjOOCkumBheOCieOBm+OCiwogICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICByZW1vdmVPbGRSZW1vdGVEZXJpdmVLZXlzKCk7CiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocmVtb3ZhbFRpbWVvdXRJZCk7CiAgICAgICAgICAgICAgICByZW1vdmFsVGltZW91dElkID0gMDsKICAgICAgICAgICAgfSwgcmVtb3ZhbFdhaXRpbmdUaW1lKTsKICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAicmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIikgewogICAgICAgIGNvbnN0IHsgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxzIH0gPSBldmVudC5kYXRhOwogICAgICAgIGZvciAoY29uc3QgW2Nvbm5lY3Rpb25JZCwgcmVtb3RlU2VjcmV0S2V5TWF0ZXJpYWxdIG9mIE9iamVjdC5lbnRyaWVzKHJlbW90ZVNlY3JldEtleU1hdGVyaWFscykpIHsKICAgICAgICAgICAgY29uc3QgeyBrZXlJZCwgc2VjcmV0S2V5TWF0ZXJpYWwgfSA9IHJlbW90ZVNlY3JldEtleU1hdGVyaWFsOwogICAgICAgICAgICBjcnlwdG8uc3VidGxlCiAgICAgICAgICAgICAgICAuaW1wb3J0S2V5KCJyYXciLCBzZWNyZXRLZXlNYXRlcmlhbC5idWZmZXIsICJIS0RGIiwgZmFsc2UsIFsiZGVyaXZlQml0cyIsICJkZXJpdmVLZXkiXSkKICAgICAgICAgICAgICAgIC50aGVuKChtYXRlcmlhbCkgPT4gewogICAgICAgICAgICAgICAgZ2VuZXJhdGVEZXJpdmVLZXkobWF0ZXJpYWwpLnRoZW4oKGRlcml2ZUtleSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFJlbW90ZURlcml2ZUtleShjb25uZWN0aW9uSWQsIGtleUlkLCBkZXJpdmVLZXkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBnZW5lcmF0ZVdyaXRlSVYobWF0ZXJpYWwpLnRoZW4oKHdyaXRlSVYpID0+IHsKICAgICAgICAgICAgICAgICAgICBzZXRXcml0ZUlWKGNvbm5lY3Rpb25JZCwga2V5SWQsIHdyaXRlSVYpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBzZXRMYXRlc3RSZW1vdGVLZXlJZChjb25uZWN0aW9uSWQsIGtleUlkKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gInJlbW92ZVJlbW90ZURlcml2ZUtleSIpIHsKICAgICAgICBjb25zdCB7IGNvbm5lY3Rpb25JZCB9ID0gZXZlbnQuZGF0YTsKICAgICAgICByZW1vdmVEZXJpdmVLZXkoY29ubmVjdGlvbklkKTsKICAgIH0KICAgIGVsc2UgaWYgKHR5cGUgPT09ICJlbmNyeXB0IikgewogICAgICAgIGNvbnN0IHsgcmVhZGFibGVTdHJlYW0sIHdyaXRhYmxlU3RyZWFtIH0gPSBldmVudC5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zZm9ybVN0cmVhbSA9IG5ldyBUcmFuc2Zvcm1TdHJlYW0oewogICAgICAgICAgICB0cmFuc2Zvcm06IGVuY3J5cHRGdW5jdGlvbiwKICAgICAgICB9KTsKICAgICAgICByZWFkYWJsZVN0cmVhbS5waXBlVGhyb3VnaCh0cmFuc2Zvcm1TdHJlYW0pLnBpcGVUbyh3cml0YWJsZVN0cmVhbSk7CiAgICB9CiAgICBlbHNlIGlmICh0eXBlID09PSAiZGVjcnlwdCIpIHsKICAgICAgICBjb25zdCB7IHJlYWRhYmxlU3RyZWFtLCB3cml0YWJsZVN0cmVhbSB9ID0gZXZlbnQuZGF0YTsKICAgICAgICBjb25zdCB0cmFuc2Zvcm1TdHJlYW0gPSBuZXcgVHJhbnNmb3JtU3RyZWFtKHsKICAgICAgICAgICAgdHJhbnNmb3JtOiBkZWNyeXB0RnVuY3Rpb24sCiAgICAgICAgfSk7CiAgICAgICAgcmVhZGFibGVTdHJlYW0ucGlwZVRocm91Z2godHJhbnNmb3JtU3RyZWFtKS5waXBlVG8od3JpdGFibGVTdHJlYW0pOwogICAgfQogICAgZWxzZSBpZiAodHlwZSA9PT0gImNsZWFyIikgewogICAgICAgIGNvdW50TWFwLmNsZWFyKCk7CiAgICAgICAgd3JpdGVJVk1hcC5jbGVhcigpOwogICAgICAgIHJlbW90ZURlcml2ZUtleU1hcC5jbGVhcigpOwogICAgICAgIGxhdGVzdFJlbW90ZUtleUlkTWFwLmNsZWFyKCk7CiAgICAgICAgc2VsZkRlcml2ZUtleU1hcC5jbGVhcigpOwogICAgfQp9Owo=\";\nclass SoraE2EE {\n constructor() {\n // 対応しているかどうかの判断\n // @ts-ignore トライアル段階の API なので無視する\n const supportsInsertableStreams = !!RTCRtpSender.prototype.createEncodedStreams;\n if (!supportsInsertableStreams) {\n throw new Error(\"E2EE is not supported in this browser.\");\n }\n this.worker = null;\n this.onWorkerDisconnect = null;\n }\n // worker を起動する\n startWorker() {\n // ワーカーを起動する\n const workerScript = atob(WORKER_SCRIPT);\n this.worker = new Worker(URL.createObjectURL(new Blob([workerScript], { type: \"application/javascript\" })));\n this.worker.onmessage = (event) => {\n const { operation } = event.data;\n if (operation === \"disconnect\" && typeof this.onWorkerDisconnect === \"function\") {\n this.onWorkerDisconnect();\n }\n };\n }\n // worker の掃除をする\n clearWorker() {\n if (this.worker) {\n this.worker.postMessage({\n type: \"clear\",\n });\n }\n }\n // worker を終了する\n terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n // 初期化処理\n async init() {\n const { preKeyBundle } = await window.e2ee.init();\n return preKeyBundle;\n }\n setupSenderTransform(sender) {\n if (!sender.track) {\n return;\n }\n // @ts-ignore トライアル段階の API なので無視する\n const senderStreams = sender.createEncodedStreams();\n const readableStream = senderStreams.readableStream || senderStreams.readable;\n const writableStream = senderStreams.writableStream || senderStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"encrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n setupReceiverTransform(receiver) {\n // @ts-ignore トライアル段階の API なので無視する\n const receiverStreams = receiver.createEncodedStreams();\n const readableStream = receiverStreams.readableStream || receiverStreams.readable;\n const writableStream = receiverStreams.writableStream || receiverStreams.writable;\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n const message = {\n type: \"decrypt\",\n readableStream: readableStream,\n writableStream: writableStream,\n };\n this.worker.postMessage(message, [readableStream, writableStream]);\n }\n postRemoteSecretKeyMaterials(result) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"remoteSecretKeyMaterials\",\n remoteSecretKeyMaterials: result.remoteSecretKeyMaterials,\n });\n }\n postRemoveRemoteDeriveKey(connectionId) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"removeRemoteDeriveKey\",\n connectionId: connectionId,\n });\n }\n postSelfSecretKeyMaterial(selfConnectionId, selfKeyId, selfSecretKeyMaterial, waitingTime = 0) {\n if (!this.worker) {\n throw new Error(\"Worker is null. Call startWorker in advance.\");\n }\n this.worker.postMessage({\n type: \"selfSecretKeyMaterial\",\n selfConnectionId: selfConnectionId,\n selfKeyId: selfKeyId,\n selfSecretKeyMaterial: selfSecretKeyMaterial,\n waitingTime: waitingTime,\n });\n }\n startSession(connectionId, preKeyBundle) {\n const [result, err] = window.e2ee.startSession(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n return result;\n }\n stopSession(connectionId) {\n const [result, err] = window.e2ee.stopSession(connectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n receiveMessage(message) {\n const [result, err] = window.e2ee.receiveMessage(message);\n if (err) {\n throw err;\n }\n return result;\n }\n start(selfConnectionId) {\n const [result, err] = window.e2ee.start(selfConnectionId);\n if (err) {\n throw err;\n }\n return result;\n }\n addPreKeyBundle(connectionId, preKeyBundle) {\n const err = window.e2ee.addPreKeyBundle(connectionId, preKeyBundle.identityKey, preKeyBundle.signedPreKey, preKeyBundle.preKeySignature);\n if (err) {\n throw err;\n }\n }\n selfFingerprint() {\n return window.e2ee.selfFingerprint();\n }\n remoteFingerprints() {\n return window.e2ee.remoteFingerprints();\n }\n static async loadWasm(wasmUrl) {\n if (!window.e2ee === undefined) {\n console.warn(\"E2ee wasm is already loaded. Will not be reload.\");\n return;\n }\n WasmExec();\n if (!window.Go) {\n throw new Error(`Failed to load module Go. window.Go is ${window.Go}.`);\n }\n const go = new Go();\n const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), go.importObject);\n go.run(instance);\n if (!window.e2ee) {\n throw new Error(`Failed to load module e2ee. window.e2ee is ${window.e2ee}.`);\n }\n }\n static version() {\n return \"2021.2.0-canary.0\";\n }\n static wasmVersion() {\n return window.e2ee.version();\n }\n}\n\nexport { SoraE2EE as default };\n"],"names":["Math","min","ceil","max","global","window","self","Error","require","fs","Object","keys","enosys","err","code","outputBuf","constants","O_WRONLY","O_RDWR","O_CREAT","O_TRUNC","O_APPEND","O_EXCL","writeSync","fd","buf","decoder","decode","nl","lastIndexOf","console","log","substr","length","write","offset","position","callback","n","chmod","path","mode","chown","uid","gid","close","fchmod","fchown","fstat","fsync","ftruncate","lchown","link","lstat","mkdir","perm","open","flags","read","buffer","readdir","readlink","rename","from","to","rmdir","stat","symlink","truncate","unlink","utimes","atime","mtime","process","getuid","getgid","geteuid","getegid","getgroups","pid","ppid","umask","cwd","chdir","crypto","nodeCrypto","getRandomValues","b","randomFillSync","performance","now","sec","nsec","hrtime","TextEncoder","TextDecoder","encoder","Go","constructor","argv","env","exit","warn","_exitPromise","Promise","resolve","_resolveExitPromise","_pendingEvent","_scheduledTimeouts","Map","_nextCallbackTimeoutID","setInt64","addr","v","floor","mem","setUint32","getInt64","low","getUint32","high","getInt32","loadValue","f","getFloat64","isNaN","id","_values","storeValue","setFloat64","_ids","get","_idPool","pop","_goRefCounts","set","typeFlag","loadSlice","array","len","Uint8Array","_inst","exports","loadSliceOfValues","a","Array","i","loadString","saddr","DataView","timeOrigin","Date","importObject","go","sp","exited","p","msec","getTime","setInt32","setTimeout","_resume","has","clearTimeout","delete","push","result","Reflect","getsp","deleteProperty","m","args","apply","setUint8","construct","parseInt","str","encode","dst","src","Uint8ClampedArray","toCopy","subarray","value","run","instance","NaN","fill","strPtr","ptr","bytes","argc","argvPtrs","forEach","arg","sort","key","resume","_makeFuncWrapper","event","this","arguments","main","module","versions","electron","error","slice","assign","TMPDIR","tmpdir","WebAssembly","instantiate","readFileSync","then","on","catch","zlibSync","data","opts","adler","d","dopt","zlh","wbytes","unzlibSync","out","inflt","zlv","SoraE2EE","supportsInsertableStreams","RTCRtpSender","prototype","createEncodedStreams","worker","onWorkerDisconnect","startWorker","workerScript","atob","Worker","URL","createObjectURL","Blob","type","onmessage","operation","clearWorker","postMessage","terminateWorker","terminate","init","preKeyBundle","e2ee","setupSenderTransform","sender","track","senderStreams","readableStream","readable","writableStream","writable","setupReceiverTransform","receiver","receiverStreams","postRemoteSecretKeyMaterials","remoteSecretKeyMaterials","postRemoveRemoteDeriveKey","connectionId","postSelfSecretKeyMaterial","selfConnectionId","selfKeyId","selfSecretKeyMaterial","waitingTime","startSession","identityKey","signedPreKey","preKeySignature","stopSession","receiveMessage","message","start","addPreKeyBundle","selfFingerprint","remoteFingerprints","loadWasm","wasmUrl","WasmExec","instantiateStreaming","fetch","version","wasmVersion","u8","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","r","j","_a","fl","revfl","x","_b","revfd","rev","hMap","cd","mb","s","l","le","co","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits","o","bits16","shft","slc","e","ec","ind","msg","nt","captureStackTrace","dat","st","sl","noBuf","noSt","cbuf","bl","nbuf","final","pos","bt","lm","dm","lbt","dbt","tbts","t","hLit","hcLen","tl","ldt","clt","clb","clm","c","lt","dt","lms","dms","lpos","sym","add","dsym","end","wbits","wbits16","hTree","t2","et","i0","i1","i2","maxSym","tr","mbt","ln","lft","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","flen","ftlen","dtlen","ll","dl","llm","clct","lcts","it","deo","dflt","lvl","plvl","pre","post","lst","opt","msk_1","prev","head","bs1_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","mmd","md","ti","pti","lin","din","level","lv","td","tds","stream"],"mappings":";;;;;;iPA0qB+BA,IAAI,CAACC,MA1DED,IAAI,CAACE,OApYbF,IAAI,CAACG,ICxOpB,UAAA,EAAY,CAC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AG,CAAG,SAAUyI,CAAV,CAAalC,CAAb,CAAgB,CACtB,GAAIkI,CAAAA,CAAE,CAAGlI,CAAC,CAACiI,KAAX,CAAkBvJ,CAAE,CAAS,CAAN,EAAAwJ,CAAE,CAAQ,CAAR,CAAiB,CAAL,CAAAA,CAAE,CAAO,CAAP,CAAiB,CAAN,EAAAA,CAAE,CAAQ,CAAR,CAAY,CAAhE,CACAhG,CAAC,CAAC,CAAD,CAAD,CAAO,GAAP,CAAYA,CAAC,CAAC,CAAD,CAAD,CAAQxD,CAAE,EAAI,CAAP,EAAaA,CAAE,CAAI,GAAK,EAAIA,CAAb,CAAmB,CAAlC,CACtB,EAEG5E,EAAG,CAAG,SAAUP,CAAV,CAAa,EACA,CAAf,GAAQ,EAAP,CAAAA,CAAC,CAAC,CAAD,CAAF,GAAmC,CAAf,CAACA,CAAC,CAAC,CAAD,CAAD,GAAS,CAA9B,EAAyC,CAACA,CAAC,CAAC,CAAD,CAAD,EAAQ,CAAR,CAAYA,CAAC,CAAC,CAAD,CAAd,EAAqB,EAD/C,GAEfhN,CAAG,CAAC,CAAD,CAAI,mBAAJ,CAFY,CAGR,EAAP,CAAAgN,CAAC,CAAC,CAAD,CAHc,EAIfhN,CAAG,CAAC,CAAD,CAAI,sDAAJ,CACV,EAwjBG4b,EAAE,CAAyB,WAAtB,QAAO1W,CAAAA,WAAP,EAAmD,GAAIA,CAAAA,YAE5D2W,EAAG,CAAG,EACV,GAAI,CACAD,EAAE,CAAC9a,MAAH,CAAU2V,EAAV,CAAc,CAAEqF,MAAM,GAAR,CAAd,CADA,CAEAD,EAAG,CAAG,CACT,CACD,MAAOhI,CAAP,CAAU"}
\ No newline at end of file
diff --git a/dist/sora.mjs b/dist/sora.mjs
index 9c54ce3c..0be2391d 100644
--- a/dist/sora.mjs
+++ b/dist/sora.mjs
@@ -1,7 +1,7 @@
/**
* @sora/sdk
* undefined
- * @version: 2021.1.6
+ * @version: 2021.2.0-canary.0
* @author: Shiguredo Inc.
* @license: Apache-2.0
**/
@@ -598,7 +598,7 @@ function WasmExec () {
/**
* @sora/e2ee
* WebRTC SFU Sora JavaScript E2EE Library
- * @version: 2021.1.0
+ * @version: 2021.2.0-canary.0
* @author: Shiguredo Inc.
* @license: Apache-2.0
**/
@@ -766,7 +766,7 @@ class SoraE2EE {
}
}
static version() {
- return "2021.1.0";
+ return "2021.2.0-canary.0";
}
static wasmVersion() {
return window.e2ee.version();
@@ -1584,7 +1584,7 @@ function enabledSimulcast() {
function isSafari() {
return browser() === "safari";
}
-function createSignalingMessage(offerSDP, role, channelId, metadata, options) {
+function createSignalingMessage(offerSDP, role, channelId, metadata, options, redirect) {
if (role !== "sendrecv" && role !== "sendonly" && role !== "recvonly") {
throw new Error("Unknown role type");
}
@@ -1593,7 +1593,7 @@ function createSignalingMessage(offerSDP, role, channelId, metadata, options) {
}
const message = {
type: "connect",
- sora_client: "Sora JavaScript SDK 2021.1.6",
+ sora_client: "Sora JavaScript SDK 2021.2.0-canary.0",
environment: window.navigator.userAgent,
role: role,
channel_id: channelId,
@@ -1604,6 +1604,9 @@ function createSignalingMessage(offerSDP, role, channelId, metadata, options) {
if (metadata !== undefined) {
message.metadata = metadata;
}
+ if (redirect) {
+ message.redirect = true;
+ }
if ("signalingNotifyMetadata" in options) {
message.signaling_notify_metadata = options.signalingNotifyMetadata;
}
@@ -1878,11 +1881,11 @@ function createTimelineEvent(eventType, data, logType, dataChannelId, dataChanne
}
class ConnectionBase {
- constructor(signalingUrl, role, channelId, metadata, options, debug) {
+ constructor(signalingUrlCandidates, role, channelId, metadata, options, debug) {
this.role = role;
this.channelId = channelId;
this.metadata = metadata;
- this.signalingUrl = signalingUrl;
+ this.signalingUrlCandidates = signalingUrlCandidates;
this.options = options;
// connection timeout の初期値をセットする
this.connectionTimeout = 60000;
@@ -1898,6 +1901,11 @@ class ConnectionBase {
if (typeof this.options.disconnectWaitTimeout === "number") {
this.disconnectWaitTimeout = this.options.disconnectWaitTimeout;
}
+ // signalingUrlCandidates に設定されている URL への接続チェック timeout の初期値をセットする
+ this.signalingCandidateTimeout = 3000;
+ if (typeof this.options.signalingCandidateTimeout === "number") {
+ this.signalingCandidateTimeout = this.options.signalingCandidateTimeout;
+ }
this.constraints = null;
this.debug = debug;
this.clientId = null;
@@ -2450,15 +2458,120 @@ class ConnectionBase {
this.e2ee.postSelfSecretKeyMaterial(this.connectionId, result.selfKeyId, result.selfSecretKeyMaterial);
}
}
- signaling(offer) {
+ async getSignalingWebSocket(signalingUrlCandidates) {
+ if (typeof signalingUrlCandidates === "string") {
+ // signaling url の候補が文字列の場合
+ const signalingUrl = signalingUrlCandidates;
+ return new Promise((resolve, reject) => {
+ const ws = new WebSocket(signalingUrl);
+ ws.onclose = (event) => {
+ const error = new ConnectError(`Signaling failed. CloseEventCode:${event.code} CloseEventReason:'${event.reason}'`);
+ error.code = event.code;
+ error.reason = event.reason;
+ this.writeWebSocketTimelineLog("onclose", error);
+ reject(error);
+ };
+ ws.onopen = (_) => {
+ resolve(ws);
+ };
+ });
+ }
+ else if (Array.isArray(signalingUrlCandidates)) {
+ // signaling url の候補が Array の場合
+ // すでに候補の WebSocket が発見されているかどうかのフラグ
+ let resolved = false;
+ const testSignalingUrlCandidate = (signalingUrl) => {
+ return new Promise((resolve, reject) => {
+ const ws = new WebSocket(signalingUrl);
+ // 一定時間経過しても反応がなかった場合は処理を中断する
+ const timerId = setTimeout(() => {
+ this.writeWebSocketSignalingLog("signaling-url-canidate", {
+ type: "timeout",
+ url: ws.url,
+ });
+ if (ws && !resolved) {
+ ws.onclose = null;
+ ws.onerror = null;
+ ws.onopen = null;
+ ws.close();
+ reject();
+ }
+ }, this.signalingCandidateTimeout);
+ ws.onclose = (event) => {
+ this.writeWebSocketSignalingLog("signaling-url-canidate", {
+ type: "close",
+ url: ws.url,
+ message: `WebSocket closed`,
+ code: event.code,
+ reason: event.reason,
+ });
+ if (ws) {
+ ws.close();
+ }
+ clearInterval(timerId);
+ reject();
+ };
+ ws.onerror = (_) => {
+ this.writeWebSocketSignalingLog("signaling-url-canidate", {
+ type: "error",
+ url: ws.url,
+ message: `Failed to connect WebSocket`,
+ });
+ if (ws) {
+ ws.onclose = null;
+ ws.close();
+ }
+ clearInterval(timerId);
+ reject();
+ };
+ ws.onopen = (_) => {
+ if (ws) {
+ clearInterval(timerId);
+ if (resolved) {
+ this.writeWebSocketSignalingLog("signaling-url-canidate", {
+ type: "open",
+ url: ws.url,
+ selected: false,
+ });
+ ws.onerror = null;
+ ws.onclose = null;
+ ws.onopen = null;
+ ws.close();
+ reject();
+ }
+ else {
+ this.writeWebSocketSignalingLog("signaling-url-canidate", {
+ type: "open",
+ url: ws.url,
+ selected: true,
+ });
+ ws.onerror = null;
+ ws.onclose = null;
+ ws.onopen = null;
+ resolved = true;
+ resolve(ws);
+ }
+ }
+ };
+ });
+ };
+ try {
+ return await Promise.any(signalingUrlCandidates.map((signalingUrl) => testSignalingUrlCandidate(signalingUrl)));
+ }
+ catch (e) {
+ throw new ConnectError("Signaling failed. All signaling URL candidates failed to connect");
+ }
+ }
+ throw new ConnectError("Signaling failed. Invalid format signaling URL candidates");
+ }
+ async signaling(ws, redirect = false) {
+ const offer = await this.createOffer();
this.trace("CREATE OFFER", offer);
return new Promise((resolve, reject) => {
- if (this.ws === null) {
- this.ws = new WebSocket(this.signalingUrl);
- this.writeWebSocketSignalingLog("new-websocket", this.signalingUrl);
- }
- this.ws.binaryType = "arraybuffer";
- this.ws.onclose = async (event) => {
+ this.writeWebSocketSignalingLog("new-websocket", ws.url);
+ // websocket の各 callback を設定する
+ ws.binaryType = "arraybuffer";
+ ws.onclose = async (event) => {
const error = new ConnectError(`Signaling failed. CloseEventCode:${event.code} CloseEventReason:'${event.reason}'`);
error.code = event.code;
error.reason = event.reason;
@@ -2466,28 +2579,7 @@ class ConnectionBase {
await this.signalingTerminate();
reject(error);
};
- this.ws.onopen = async (_) => {
- this.writeWebSocketSignalingLog("onopen");
- let signalingMessage;
- try {
- signalingMessage = createSignalingMessage(offer.sdp || "", this.role, this.channelId, this.metadata, this.options);
- }
- catch (error) {
- reject(error);
- return;
- }
- if (signalingMessage.e2ee && this.e2ee) {
- const initResult = await this.e2ee.init();
- // @ts-ignore signalingMessage の e2ee が true の場合は signalingNotifyMetadata が必ず object になる
- signalingMessage["signaling_notify_metadata"]["pre_key_bundle"] = initResult;
- }
- this.trace("SIGNALING CONNECT MESSAGE", signalingMessage);
- if (this.ws) {
- this.ws.send(JSON.stringify(signalingMessage));
- this.writeWebSocketSignalingLog(`send-${signalingMessage.type}`, signalingMessage);
- }
- };
- this.ws.onmessage = async (event) => {
+ ws.onmessage = async (event) => {
// E2EE 時専用処理
if (event.data instanceof ArrayBuffer) {
this.writeWebSocketSignalingLog("onmessage-e2ee", event.data);
@@ -2527,25 +2619,36 @@ class ConnectionBase {
this.writeWebSocketSignalingLog("onmessage-switched", message);
this.signalingOnMessageTypeSwitched(message);
}
+ else if (message.type == "redirect") {
+ this.writeWebSocketSignalingLog("onmessage-redirect", message);
+ const redirectMessage = await this.signalingOnMessageTypeRedirect(message);
+ resolve(redirectMessage);
+ }
};
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
+ (async () => {
+ let signalingMessage;
+ try {
+ signalingMessage = createSignalingMessage(offer.sdp || "", this.role, this.channelId, this.metadata, this.options, redirect);
+ }
+ catch (error) {
+ reject(error);
+ return;
+ }
+ if (signalingMessage.e2ee && this.e2ee) {
+ const initResult = await this.e2ee.init();
+ // @ts-ignore signalingMessage の e2ee が true の場合は signalingNotifyMetadata が必ず object になる
+ signalingMessage["signaling_notify_metadata"]["pre_key_bundle"] = initResult;
+ }
+ this.trace("SIGNALING CONNECT MESSAGE", signalingMessage);
+ if (ws) {
+ ws.send(JSON.stringify(signalingMessage));
+ this.writeWebSocketSignalingLog(`send-${signalingMessage.type}`, signalingMessage);
+ this.ws = ws;
+ }
+ })();
});
}
- async createOffer() {
- const config = { iceServers: [] };
- const pc = new window.RTCPeerConnection(config);
- if (isSafari()) {
- pc.addTransceiver("video", { direction: "recvonly" });
- pc.addTransceiver("audio", { direction: "recvonly" });
- const offer = await pc.createOffer();
- pc.close();
- this.writePeerConnectionTimelineLog("create-offer", offer);
- return offer;
- }
- const offer = await pc.createOffer({ offerToReceiveAudio: true, offerToReceiveVideo: true });
- pc.close();
- this.writePeerConnectionTimelineLog("create-offer", offer);
- return offer;
- }
async connectPeerConnection(message) {
let config = Object.assign({}, message.config);
if (this.e2ee) {
@@ -2847,6 +2950,22 @@ class ConnectionBase {
const event = createTimelineEvent(eventType, data, "sora");
this.callbacks.timeline(event);
}
+ async createOffer() {
+ const config = { iceServers: [] };
+ const pc = new window.RTCPeerConnection(config);
+ if (isSafari()) {
+ pc.addTransceiver("video", { direction: "recvonly" });
+ pc.addTransceiver("audio", { direction: "recvonly" });
+ const offer = await pc.createOffer();
+ pc.close();
+ this.writePeerConnectionTimelineLog("create-offer", offer);
+ return offer;
+ }
+ const offer = await pc.createOffer({ offerToReceiveAudio: true, offerToReceiveVideo: true });
+ pc.close();
+ this.writePeerConnectionTimelineLog("create-offer", offer);
+ return offer;
+ }
signalingOnMessageE2EE(data) {
if (this.e2ee) {
const message = new Uint8Array(data);
@@ -2971,6 +3090,17 @@ class ConnectionBase {
this.writeWebSocketSignalingLog("close");
}
}
+ async signalingOnMessageTypeRedirect(message) {
+ if (this.ws) {
+ this.ws.onclose = null;
+ this.ws.onerror = null;
+ this.ws.close();
+ this.ws = null;
+ }
+ const ws = await this.getSignalingWebSocket(message.location);
+ const signalingMessage = await this.signaling(ws, true);
+ return signalingMessage;
+ }
async setSenderParameters(transceiver, encodings) {
const originalParameters = transceiver.sender.getParameters();
// @ts-ignore
@@ -3194,6 +3324,15 @@ class ConnectionBase {
get video() {
return this.getVideoTransceiver() !== null;
}
+ get signalingUrl() {
+ return this.signalingUrlCandidates;
+ }
+ get connectedSignalingUrl() {
+ if (!this.ws) {
+ return "";
+ }
+ return this.ws.url;
+ }
}
class ConnectionPublisher extends ConnectionBase {
@@ -3225,8 +3364,8 @@ class ConnectionPublisher extends ConnectionBase {
async singleStream(stream) {
await this.disconnect();
this.setupE2EE();
- const offer = await this.createOffer();
- const signalingMessage = await this.signaling(offer);
+ const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates);
+ const signalingMessage = await this.signaling(ws);
this.startE2EE();
await this.connectPeerConnection(signalingMessage);
await this.setRemoteDescription(signalingMessage);
@@ -3252,8 +3391,8 @@ class ConnectionPublisher extends ConnectionBase {
async multiStream(stream) {
await this.disconnect();
this.setupE2EE();
- const offer = await this.createOffer();
- const signalingMessage = await this.signaling(offer);
+ const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates);
+ const signalingMessage = await this.signaling(ws);
this.startE2EE();
await this.connectPeerConnection(signalingMessage);
if (this.pc) {
@@ -3358,8 +3497,8 @@ class ConnectionSubscriber extends ConnectionBase {
async singleStream() {
await this.disconnect();
this.setupE2EE();
- const offer = await this.createOffer();
- const signalingMessage = await this.signaling(offer);
+ const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates);
+ const signalingMessage = await this.signaling(ws);
this.startE2EE();
await this.connectPeerConnection(signalingMessage);
if (this.pc) {
@@ -3415,8 +3554,8 @@ class ConnectionSubscriber extends ConnectionBase {
async multiStream() {
await this.disconnect();
this.setupE2EE();
- const offer = await this.createOffer();
- const signalingMessage = await this.signaling(offer);
+ const ws = await this.getSignalingWebSocket(this.signalingUrlCandidates);
+ const signalingMessage = await this.signaling(ws);
this.startE2EE();
await this.connectPeerConnection(signalingMessage);
if (this.pc) {
@@ -3488,29 +3627,33 @@ async function applyMediaStreamConstraints(mediastream, constraints) {
}
class SoraConnection {
- constructor(signalingUrl, debug = false) {
- this.signalingUrl = signalingUrl;
+ constructor(signalingUrlCandidates, debug = false) {
+ this.signalingUrlCandidates = signalingUrlCandidates;
this.debug = debug;
}
sendrecv(channelId, metadata = null, options = { audio: true, video: true }) {
- return new ConnectionPublisher(this.signalingUrl, "sendrecv", channelId, metadata, options, this.debug);
+ return new ConnectionPublisher(this.signalingUrlCandidates, "sendrecv", channelId, metadata, options, this.debug);
}
sendonly(channelId, metadata = null, options = { audio: true, video: true }) {
- return new ConnectionPublisher(this.signalingUrl, "sendonly", channelId, metadata, options, this.debug);
+ return new ConnectionPublisher(this.signalingUrlCandidates, "sendonly", channelId, metadata, options, this.debug);
}
recvonly(channelId, metadata = null, options = { audio: true, video: true }) {
- return new ConnectionSubscriber(this.signalingUrl, "recvonly", channelId, metadata, options, this.debug);
+ return new ConnectionSubscriber(this.signalingUrlCandidates, "recvonly", channelId, metadata, options, this.debug);
+ }
+ // @deprecated 後方互換のため残す
+ get signalingUrl() {
+ return this.signalingUrlCandidates;
}
}
var sora = {
initE2EE: async function (wasmUrl) {
await SoraE2EE.loadWasm(wasmUrl);
},
- connection: function (signalingUrl, debug = false) {
- return new SoraConnection(signalingUrl, debug);
+ connection: function (signalingUrlCandidates, debug = false) {
+ return new SoraConnection(signalingUrlCandidates, debug);
},
version: function () {
- return "2021.1.6";
+ return "2021.2.0-canary.0";
},
helpers: {
applyMediaStreamConstraints,
diff --git a/dist/types.d.ts b/dist/types.d.ts
index 2c66429a..1f1435df 100644
--- a/dist/types.d.ts
+++ b/dist/types.d.ts
@@ -50,8 +50,9 @@ export declare type SignalingConnectMessage = {
spotlight_unfocus_rid?: SpotlightFocusRid;
data_channel_signaling?: boolean;
ignore_disconnect_websocket?: boolean;
+ redirect?: true;
};
-export declare type SignalingMessage = SignalingOfferMessage | SignalingUpdateMessage | SignalingReOfferMessage | SignalingPingMessage | SignalingPushMessage | SignalingNotifyMessage | SignalingReqStatsMessage | SignalingSwitchedMessage;
+export declare type SignalingMessage = SignalingOfferMessage | SignalingUpdateMessage | SignalingReOfferMessage | SignalingPingMessage | SignalingPushMessage | SignalingNotifyMessage | SignalingReqStatsMessage | SignalingSwitchedMessage | SignalingRedirectMessage;
export declare type SignalingOfferMessage = {
type: "offer";
sdp: string;
@@ -94,6 +95,10 @@ export declare type SignalingSwitchedMessage = {
type: "switched";
ignore_disconnect_websocket: boolean;
};
+export declare type SignalingRedirectMessage = {
+ type: "redirect";
+ location: string;
+};
export declare type SignalingNotifyMessage = SignalingNotifyConnectionCreated | SignalingNotifyConnectionUpdated | SignalingNotifyConnectionDestroyed | SignalingNotifySpotlightChanged | SignalingNotifySpotlightFocused | SignalingNotifySpotlightUnfocused | SignalingNotifyNetworkStatus;
export declare type SignalingNotifyMetadata = {
client_id?: string;
@@ -219,6 +224,7 @@ export declare type ConnectionOptions = {
dataChannelSignaling?: boolean;
ignoreDisconnectWebSocket?: boolean;
disconnectWaitTimeout?: number;
+ signalingCandidateTimeout?: number;
};
export declare type Callbacks = {
disconnect: (event: SoraCloseEvent) => void;
diff --git a/dist/utils.d.ts b/dist/utils.d.ts
index f932f528..cea8f516 100644
--- a/dist/utils.d.ts
+++ b/dist/utils.d.ts
@@ -1,7 +1,7 @@
import { ConnectionOptions, JSONType, PreKeyBundle, SignalingConnectMessage, SignalingEvent, SignalingNotifyMetadata, SignalingNotifyConnectionCreated, SignalingNotifyConnectionDestroyed, TimelineEvent, TimelineEventLogType, TransportType } from "./types";
export declare function isSafari(): boolean;
export declare function isChrome(): boolean;
-export declare function createSignalingMessage(offerSDP: string, role: string, channelId: string | null | undefined, metadata: JSONType | undefined, options: ConnectionOptions): SignalingConnectMessage;
+export declare function createSignalingMessage(offerSDP: string, role: string, channelId: string | null | undefined, metadata: JSONType | undefined, options: ConnectionOptions, redirect: boolean): SignalingConnectMessage;
export declare function getSignalingNotifyAuthnMetadata(message: SignalingNotifyConnectionCreated | SignalingNotifyConnectionDestroyed | SignalingNotifyMetadata): JSONType;
export declare function getSignalingNotifyData(message: SignalingNotifyConnectionCreated): SignalingNotifyMetadata[];
export declare function getPreKeyBundle(message: JSONType): PreKeyBundle | null;
diff --git a/lerna.json b/lerna.json
index 674e7c92..6f2a6db8 100644
--- a/lerna.json
+++ b/lerna.json
@@ -2,5 +2,5 @@
"packages": [
"packages/*"
],
- "version": "2021.1.6"
+ "version": "2021.2.0-canary.0"
}
diff --git a/package.json b/package.json
index e728f295..515b5f4a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "sora-js-sdk",
- "version": "2021.1.6",
+ "version": "2021.2.0-canary.0",
"description": "WebRTC SFU Sora JavaScript SDK",
"main": "dist/sora.min.js",
"module": "dist/sora.mjs",
diff --git a/packages/e2ee/package.json b/packages/e2ee/package.json
index 16441768..cc09a524 100644
--- a/packages/e2ee/package.json
+++ b/packages/e2ee/package.json
@@ -1,6 +1,6 @@
{
"name": "@sora/e2ee",
- "version": "2021.1.0",
+ "version": "2021.2.0-canary.0",
"description": "WebRTC SFU Sora JavaScript E2EE Library",
"author": "Shiguredo Inc.",
"license": "Apache-2.0",
@@ -28,6 +28,6 @@
"typescript": "^4.4.2"
},
"dependencies": {
- "@sora/go-wasm": "^2021.1.0"
+ "@sora/go-wasm": "^2021.2.0-canary.0"
}
}
diff --git a/packages/go-wasm/package.json b/packages/go-wasm/package.json
index b13bfde5..5462098e 100644
--- a/packages/go-wasm/package.json
+++ b/packages/go-wasm/package.json
@@ -1,6 +1,6 @@
{
"name": "@sora/go-wasm",
- "version": "2021.1.0",
+ "version": "2021.2.0-canary.0",
"main": "src/wasm_exec.js",
"module": "src/wasm_exec.js",
"types": "src/wasm_exec.d.ts",
diff --git a/packages/sdk/package.json b/packages/sdk/package.json
index 35e698c8..644eade1 100644
--- a/packages/sdk/package.json
+++ b/packages/sdk/package.json
@@ -1,6 +1,6 @@
{
"name": "@sora/sdk",
- "version": "2021.1.6",
+ "version": "2021.2.0-canary.0",
"author": "Shiguredo Inc.",
"license": "Apache-2.0",
"main": "dist/sora.min.js",
@@ -35,7 +35,7 @@
"typescript": "^4.4.2"
},
"dependencies": {
- "@sora/e2ee": "^2021.1.0",
+ "@sora/e2ee": "^2021.2.0-canary.0",
"fflate": "^0.7.1"
}
}
From 7a4f11721520130a2bef263b7371b6c2b800687e Mon Sep 17 00:00:00 2001
From: Yuki Ito
Date: Wed, 15 Sep 2021 10:52:55 +0900
Subject: [PATCH 18/87] =?UTF-8?q?messaging=20data=20channel=20=E3=82=92?=
=?UTF-8?q?=E4=BD=9C=E6=88=90=E3=81=99=E3=82=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/sdk/src/base.ts | 38 ++++++++++++++++++++++++++++----
packages/sdk/src/types.ts | 32 +++++++++++++++++++++++++++
packages/sdk/src/utils.ts | 46 +++++++++++++++++++++++++++++++++++++++
3 files changed, 112 insertions(+), 4 deletions(-)
diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts
index 6e66ee77..69ce8749 100644
--- a/packages/sdk/src/base.ts
+++ b/packages/sdk/src/base.ts
@@ -3,6 +3,7 @@ import { unzlibSync, zlibSync } from "fflate";
import {
ConnectError,
createDataChannelData,
+ createMessagingEvent,
createSignalingEvent,
createSignalingMessage,
createTimelineEvent,
@@ -130,6 +131,7 @@ export default class ConnectionBase {
timeout: (): void => {},
timeline: (): void => {},
signaling: (): void => {},
+ messaging: (): void => {},
};
this.authMetadata = null;
this.e2ee = null;
@@ -1003,7 +1005,7 @@ export default class ConnectionBase {
const candidate = event.candidate.toJSON();
const message = Object.assign(candidate, { type: "candidate" }) as { type: string; [key: string]: unknown };
this.trace("ONICECANDIDATE CANDIDATE MESSAGE", message);
- this.sendMessage(message);
+ this.sendSignalingMessage(message);
}
};
}
@@ -1245,14 +1247,14 @@ export default class ConnectionBase {
private sendUpdateAnswer(): void {
if (this.pc && this.ws && this.pc.localDescription) {
this.trace("ANSWER SDP", this.pc.localDescription.sdp);
- this.sendMessage({ type: "update", sdp: this.pc.localDescription.sdp });
+ this.sendSignalingMessage({ type: "update", sdp: this.pc.localDescription.sdp });
}
}
private sendReAnswer(): void {
if (this.pc && this.pc.localDescription) {
this.trace("RE ANSWER SDP", this.pc.localDescription.sdp);
- this.sendMessage({ type: "re-answer", sdp: this.pc.localDescription.sdp });
+ this.sendSignalingMessage({ type: "re-answer", sdp: this.pc.localDescription.sdp });
}
}
@@ -1477,10 +1479,24 @@ export default class ConnectionBase {
this.sendStatsMessage(stats);
}
};
+ } else if (/^#[a-zA-Z][a-zA-Z-]{1,30}$/.exec(dataChannelEvent.channel.label)) {
+ dataChannelEvent.channel.onmessage = (event): void => {
+ if (event.target === null) {
+ return;
+ }
+ const dataChannel = event.target as RTCDataChannel;
+ let data = event.data as string;
+ if (this.dataChannelsCompress[dataChannel.label] === true) {
+ const unzlibMessage = unzlibSync(new Uint8Array(event.data));
+ data = new TextDecoder().decode(unzlibMessage);
+ }
+ const message = JSON.parse(data) as JSONType;
+ this.callbacks.messaging(createMessagingEvent(dataChannel.label, message));
+ };
}
}
- private sendMessage(message: { type: string; [key: string]: unknown }): void {
+ private sendSignalingMessage(message: { type: string; [key: string]: unknown }): void {
if (this.dataChannels.signaling) {
if (this.dataChannelsCompress.signaling === true) {
const binaryMessage = new TextEncoder().encode(JSON.stringify(message));
@@ -1568,6 +1584,20 @@ export default class ConnectionBase {
return new soraCloseEvent(type, title, initDict);
}
+ sendMessage(label: string, message: JSONType): void {
+ const dataChannel = this.dataChannels[label];
+ if (dataChannel === undefined) {
+ throw new Error("error5");
+ }
+ if (this.dataChannelsCompress[label] === true) {
+ const binaryMessage = new TextEncoder().encode(JSON.stringify(message));
+ const zlibMessage = zlibSync(binaryMessage, {});
+ dataChannel.send(zlibMessage);
+ } else {
+ dataChannel.send(JSON.stringify(message));
+ }
+ }
+
get e2eeSelfFingerprint(): string | undefined {
if (this.options.e2ee && this.e2ee) {
return this.e2ee.selfFingerprint();
diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts
index 129b14cf..564c4737 100644
--- a/packages/sdk/src/types.ts
+++ b/packages/sdk/src/types.ts
@@ -37,6 +37,16 @@ export type SignalingVideo =
export type Role = "sendrecv" | "sendonly" | "recvonly";
+export type SignalingConnectMessagingDataChannel = {
+ label?: string;
+ direction?: MessagingDataChannelDirection;
+ compress?: boolean;
+ max_packet_life_time?: number;
+ max_retransmits?: number;
+ protocol?: string;
+ ordered?: boolean;
+};
+
export type SignalingConnectMessage = {
type: "connect";
role: Role;
@@ -60,6 +70,7 @@ export type SignalingConnectMessage = {
data_channel_signaling?: boolean;
ignore_disconnect_websocket?: boolean;
redirect?: true;
+ data_channel_messaging?: SignalingConnectMessagingDataChannel[];
};
export type SignalingMessage =
@@ -237,6 +248,20 @@ export type SignalingNotifyNetworkStatus = {
unstable_level: 0 | 1 | 2 | 3;
};
+const messagingDataChannelDirections = ["sendonly", "sendrecv", "recvonly"] as const;
+
+export type MessagingDataChannelDirection = typeof messagingDataChannelDirections[number];
+
+export type MessagingDataChannel = {
+ label: string;
+ direction: MessagingDataChannelDirection;
+ compress?: boolean;
+ maxPacketLifeTime?: number;
+ maxRetransmits?: number;
+ protocol?: string;
+ ordered?: boolean;
+};
+
export type ConnectionOptions = {
audio?: boolean;
audioCodecType?: AudioCodecType;
@@ -269,6 +294,7 @@ export type ConnectionOptions = {
ignoreDisconnectWebSocket?: boolean;
disconnectWaitTimeout?: number;
signalingCandidateTimeout?: number;
+ messagingDataChannels?: MessagingDataChannel[];
};
export type Callbacks = {
@@ -283,6 +309,7 @@ export type Callbacks = {
timeout: () => void;
timeline: (event: TimelineEvent) => void;
signaling: (event: SignalingEvent) => void;
+ messaging: (event: MessagingEvent) => void;
};
export type PreKeyBundle = {
@@ -303,6 +330,11 @@ export interface SignalingEvent extends Event {
data?: any;
}
+export interface MessagingEvent extends Event {
+ label: string;
+ data: JSONType;
+}
+
export interface TimelineEvent extends Event {
logType: TimelineEventLogType;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
diff --git a/packages/sdk/src/utils.ts b/packages/sdk/src/utils.ts
index b5e904ed..dc2a3077 100644
--- a/packages/sdk/src/utils.ts
+++ b/packages/sdk/src/utils.ts
@@ -2,8 +2,11 @@ import {
ConnectionOptions,
Browser,
JSONType,
+ MessagingDataChannel,
+ MessagingEvent,
PreKeyBundle,
SignalingConnectMessage,
+ SignalingConnectMessagingDataChannel,
SignalingEvent,
SignalingNotifyMetadata,
SignalingNotifyConnectionCreated,
@@ -51,6 +54,38 @@ function enabledSimulcast(): boolean {
return hasAllRequiredHeaderExtensions;
}
+function parseMessagingDataChannel(params: unknown): SignalingConnectMessagingDataChannel {
+ if (typeof params !== "object" || params === null) {
+ throw new Error("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'");
+ }
+ const messagingDataChannel = params as MessagingDataChannel;
+ const result: SignalingConnectMessagingDataChannel = {};
+ if (typeof messagingDataChannel.label === "string") {
+ result.label = messagingDataChannel.label;
+ }
+ if (typeof messagingDataChannel.direction === "string") {
+ result.direction = messagingDataChannel.direction;
+ }
+ if (typeof messagingDataChannel.ordered === "boolean") {
+ result.ordered = messagingDataChannel.ordered;
+ }
+ if (typeof messagingDataChannel.compress === "boolean") {
+ result.compress = messagingDataChannel.compress;
+ }
+ if (typeof messagingDataChannel.maxPacketLifeTime === "number") {
+ result.max_packet_life_time = messagingDataChannel.maxPacketLifeTime;
+ }
+ return result;
+}
+
+function parseMessagingDataChannels(messagingDataChannels: unknown[]): SignalingConnectMessagingDataChannel[] {
+ const result: SignalingConnectMessagingDataChannel[] = [];
+ for (const messagingDataChannel of messagingDataChannels) {
+ result.push(parseMessagingDataChannel(messagingDataChannel));
+ }
+ return result;
+}
+
export function isSafari(): boolean {
return browser() === "safari";
}
@@ -263,6 +298,10 @@ export function createSignalingMessage(
message.e2ee = true;
}
+ if (Array.isArray(options.messagingDataChannels) && 0 < options.messagingDataChannels.length) {
+ message.data_channel_messaging = parseMessagingDataChannels(options.messagingDataChannels);
+ }
+
return message;
}
@@ -386,3 +425,10 @@ export function createTimelineEvent(
event.dataChannelLabel = dataChannelLabel;
return event;
}
+
+export function createMessagingEvent(label: string, data: JSONType): MessagingEvent {
+ const event = new Event("messaging") as MessagingEvent;
+ event.label = label;
+ event.data = data;
+ return event;
+}
From cd9936531a25fa540b7beb3e0ec032cb0b37b2c5 Mon Sep 17 00:00:00 2001
From: Yuki Ito
Date: Fri, 17 Sep 2021 11:33:25 +0900
Subject: [PATCH 19/87] =?UTF-8?q?parser=20=E3=82=92=E4=BF=AE=E6=AD=A3?=
=?UTF-8?q?=E3=81=99=E3=82=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/sdk/src/utils.ts | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/packages/sdk/src/utils.ts b/packages/sdk/src/utils.ts
index dc2a3077..257fe5b2 100644
--- a/packages/sdk/src/utils.ts
+++ b/packages/sdk/src/utils.ts
@@ -75,6 +75,12 @@ function parseMessagingDataChannel(params: unknown): SignalingConnectMessagingDa
if (typeof messagingDataChannel.maxPacketLifeTime === "number") {
result.max_packet_life_time = messagingDataChannel.maxPacketLifeTime;
}
+ if (typeof messagingDataChannel.maxRetransmits === "number") {
+ result.max_retransmits = messagingDataChannel.maxRetransmits;
+ }
+ if (typeof messagingDataChannel.protocol === "string") {
+ result.protocol = messagingDataChannel.protocol;
+ }
return result;
}
From 8773660c3ce679133a2bc922099f89d95b2e2910 Mon Sep 17 00:00:00 2001
From: Yuki Ito
Date: Fri, 17 Sep 2021 11:33:46 +0900
Subject: [PATCH 20/87] =?UTF-8?q?direction=20=E3=81=AE=E5=9E=8B=E5=AE=9A?=
=?UTF-8?q?=E7=BE=A9=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/sdk/src/types.ts | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts
index 564c4737..4e4056bd 100644
--- a/packages/sdk/src/types.ts
+++ b/packages/sdk/src/types.ts
@@ -248,9 +248,7 @@ export type SignalingNotifyNetworkStatus = {
unstable_level: 0 | 1 | 2 | 3;
};
-const messagingDataChannelDirections = ["sendonly", "sendrecv", "recvonly"] as const;
-
-export type MessagingDataChannelDirection = typeof messagingDataChannelDirections[number];
+export type MessagingDataChannelDirection = "sendonly" | "sendrecv" | "recvonly";
export type MessagingDataChannel = {
label: string;
From f9afe4683ae8f6b971f536c0bb526f9d4f48f215 Mon Sep 17 00:00:00 2001
From: Yuki Ito
Date: Fri, 17 Sep 2021 11:33:58 +0900
Subject: [PATCH 21/87] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?=
=?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/sdk/tests/utils.test.ts | 74 +++++++++++++++++++++++++++++---
1 file changed, 69 insertions(+), 5 deletions(-)
diff --git a/packages/sdk/tests/utils.test.ts b/packages/sdk/tests/utils.test.ts
index 521c724b..eca4304f 100644
--- a/packages/sdk/tests/utils.test.ts
+++ b/packages/sdk/tests/utils.test.ts
@@ -1,5 +1,5 @@
import { createSignalingMessage } from "../src/utils";
-import { AudioCodecType, VideoCodecType } from "../src/types";
+import { AudioCodecType, MessagingDataChannelDirection, VideoCodecType } from "../src/types";
const channelId = "7N3fsMHob";
const role = "sendonly";
@@ -418,8 +418,7 @@ test("createSignalingMessage dataChannelSignaling option", () => {
const options3 = {
dataChannelSignaling: undefined,
};
- const diff3 = {
- };
+ const diff3 = {};
expect(createSignalingMessage(sdp, role, channelId, null, options3, false)).toEqual(
Object.assign({}, baseExpectedMessage, diff3)
);
@@ -447,8 +446,7 @@ test("createSignalingMessage ignoreDisconnectWebSocket option", () => {
const options3 = {
ignoreDisconnectWebSocket: undefined,
};
- const diff3 = {
- };
+ const diff3 = {};
expect(createSignalingMessage(sdp, role, channelId, null, options3, false)).toEqual(
Object.assign({}, baseExpectedMessage, diff3)
);
@@ -459,3 +457,69 @@ test("createSignalingMessage redirect", () => {
Object.assign({}, baseExpectedMessage, { redirect: true })
);
});
+
+test("createSignalingMessage messagingDataChannels option", () => {
+ // array 以外の場合は無視
+ const options1 = {
+ messagingDataChannels: "test",
+ };
+ // @ts-ignore option で指定されている型以外を引数に指定する
+ expect(createSignalingMessage(sdp, role, channelId, null, options1, false)).toEqual(baseExpectedMessage);
+
+ // array が空の場合は追加されない
+ const options2 = {
+ messagingDataChannels: [],
+ };
+ expect(createSignalingMessage(sdp, role, channelId, null, options2, false)).toEqual(baseExpectedMessage);
+
+ // messagingDataChannel に object 以外が含まれる場合は例外が発生する
+ const options3 = {
+ messagingDataChannels: [{ label: "test", direction: "sendrecv" }, "test"],
+ };
+ expect(() => {
+ // @ts-ignore option で指定されている型以外を引数に指定する
+ createSignalingMessage(sdp, role, channelId, null, options3, false);
+ }).toThrow("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'");
+
+ // messagingDataChannel に null が含まれる場合は例外が発生する
+ const options4 = {
+ messagingDataChannels: [{ label: "test", direction: "sendrecv" }, null],
+ };
+ expect(() => {
+ // @ts-ignore option で指定されている型以外を引数に指定する
+ createSignalingMessage(sdp, role, channelId, null, options4, false);
+ }).toThrow("Messaging DataChannel failed. Options messagingDataChannel must be type 'object'");
+
+ // 正常系
+ const options5 = {
+ messagingDataChannels: [
+ { label: "test", direction: "sendrecv" as MessagingDataChannelDirection },
+ {
+ label: "test2",
+ direction: "sendonly" as MessagingDataChannelDirection,
+ ordered: true,
+ maxPacketLifeTime: 100,
+ maxRetransmits: 100,
+ protocol: "protocol",
+ compress: false,
+ },
+ ],
+ };
+ const diff5 = {
+ data_channel_messaging: [
+ { label: "test", direction: "sendrecv" },
+ {
+ label: "test2",
+ direction: "sendonly",
+ ordered: true,
+ max_packet_life_time: 100,
+ max_retransmits: 100,
+ protocol: "protocol",
+ compress: false,
+ },
+ ],
+ };
+ expect(createSignalingMessage(sdp, role, channelId, null, options5, false)).toEqual(
+ Object.assign({}, baseExpectedMessage, diff5)
+ );
+});
From d46550000c24722cda01e72a7b35d1f5aef6b9d5 Mon Sep 17 00:00:00 2001
From: Yuki Ito
Date: Fri, 17 Sep 2021 12:07:32 +0900
Subject: [PATCH 22/87] =?UTF-8?q?=E6=8E=A5=E7=B6=9A=E5=89=8D=E3=81=AE=20se?=
=?UTF-8?q?ndMessage=20=E5=87=A6=E7=90=86=E3=82=92=E4=BF=AE=E6=AD=A3?=
=?UTF-8?q?=E3=81=99=E3=82=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/sdk/src/base.ts | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts
index 69ce8749..13f63176 100644
--- a/packages/sdk/src/base.ts
+++ b/packages/sdk/src/base.ts
@@ -1586,8 +1586,12 @@ export default class ConnectionBase {
sendMessage(label: string, message: JSONType): void {
const dataChannel = this.dataChannels[label];
+ // 接続していない場合は何もしない
+ if (this.pc === null) {
+ return;
+ }
if (dataChannel === undefined) {
- throw new Error("error5");
+ throw new Error("Could not find DataChannel");
}
if (this.dataChannelsCompress[label] === true) {
const binaryMessage = new TextEncoder().encode(JSON.stringify(message));
From 72397e505a56cd0dea16ae6f9a57c31b4ecf5e1b Mon Sep 17 00:00:00 2001
From: Yuki Ito
Date: Fri, 17 Sep 2021 12:08:01 +0900
Subject: [PATCH 23/87] =?UTF-8?q?example=20=E3=81=AB=20Messaging=20DataCha?=
=?UTF-8?q?nnel=20=E3=81=AE=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=92?=
=?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
example/index.html | 1 +
example/messaging_data_channel.html | 106 ++++++++++++++++++++++++++++
2 files changed, 107 insertions(+)
create mode 100644 example/messaging_data_channel.html
diff --git a/example/index.html b/example/index.html
index 940da79b..623dbaff 100644
--- a/example/index.html
+++ b/example/index.html
@@ -14,6 +14,7 @@
スポットライト配信視聴サンプル
スポットライト視聴サンプル
サイマルキャスト配信/視聴サンプル
+ メッセージングデータチャネルサンプル