uneeq-js 2.46.7 → 2.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +6 -0
- package/dist/src/lib/vad/frame-processor.d.ts +89 -0
- package/dist/src/lib/vad/messages.d.ts +6 -0
- package/dist/src/lib/vad/models.d.ts +23 -0
- package/dist/src/lib/vad/real-time-vad.d.ts +61 -0
- package/dist/src/service/speech-handler.d.ts +25 -0
- package/dist/src/types/MessageTypes.d.ts +26 -0
- package/dist/src/types/SpeechHandlerOptions.d.ts +11 -0
- package/dist/src/types/SpeechRecognitionMessageAction.d.ts +4 -0
- package/dist/src/types/SpeechRecognitionStartMessage.d.ts +9 -0
- package/dist/src/types/SpeechRecognitionStopMessage.d.ts +4 -0
- package/dist/src/types/SpeechTranscriptionResult.d.ts +6 -0
- package/dist/src/types/UneeqOptions.d.ts +9 -0
- package/dist/src/uneeq.d.ts +1 -0
- package/dist/umd/index.js +2465 -192
- package/package.json +5 -1
- package/readme.md +6 -0
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
(()=>{var e={2541:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ActivationState:()=>a,Client:()=>f,CompatClient:()=>m,FrameImpl:()=>i,Parser:()=>o,Stomp:()=>g,StompConfig:()=>h,StompHeaders:()=>d,StompSocketState:()=>s,StompSubscription:()=>p,Versions:()=>u});const n="\n";class i{constructor(e){const{command:t,headers:r,body:n,binaryBody:i,escapeHeaderValues:o,skipContentLengthHeader:s}=e;this.command=t,this.headers=Object.assign({},r||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=n||"",this.isBinaryBody=!1),this.escapeHeaderValues=o||!1,this.skipContentLengthHeader=s||!1}get body(){return!this._body&&this.isBinaryBody&&(this._body=(new TextDecoder).decode(this._binaryBody)),this._body}get binaryBody(){return this._binaryBody||this.isBinaryBody||(this._binaryBody=(new TextEncoder).encode(this._body)),this._binaryBody}static fromRawFrame(e,t){const r={},n=e=>e.replace(/^\s+|\s+$/g,"");for(const o of e.headers.reverse()){o.indexOf(":");const s=n(o[0]);let a=n(o[1]);t&&"CONNECT"!==e.command&&"CONNECTED"!==e.command&&(a=i.hdrValueUnEscape(a)),r[s]=a}return new i({command:e.command,headers:r,binaryBody:e.binaryBody,escapeHeaderValues:t})}toString(){return this.serializeCmdAndHeaders()}serialize(){const e=this.serializeCmdAndHeaders();return this.isBinaryBody?i.toUnit8Array(e,this._binaryBody).buffer:e+this._body+"\0"}serializeCmdAndHeaders(){const e=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const t of Object.keys(this.headers||{})){const r=this.headers[t];this.escapeHeaderValues&&"CONNECT"!==this.command&&"CONNECTED"!==this.command?e.push(`${t}:${i.hdrValueEscape(`${r}`)}`):e.push(`${t}:${r}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&e.push(`content-length:${this.bodyLength()}`),e.join(n)+n+n}isBodyEmpty(){return 0===this.bodyLength()}bodyLength(){const e=this.binaryBody;return e?e.length:0}static sizeOfUTF8(e){return e?(new TextEncoder).encode(e).length:0}static toUnit8Array(e,t){const r=(new TextEncoder).encode(e),n=new Uint8Array([0]),i=new Uint8Array(r.length+t.length+n.length);return i.set(r),i.set(t,r.length),i.set(n,r.length+t.length),i}static marshall(e){return new i(e).serialize()}static hdrValueEscape(e){return e.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(e){return e.replace(/\\r/g,"\r").replace(/\\n/g,"\n").replace(/\\c/g,":").replace(/\\\\/g,"\\")}}class o{constructor(e,t){this.onFrame=e,this.onIncomingPing=t,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(e,t=!1){let r;if(r=e instanceof ArrayBuffer?new Uint8Array(e):this._encoder.encode(e),t&&0!==r[r.length-1]){const e=new Uint8Array(r.length+1);e.set(r,0),e[r.length]=0,r=e}for(let e=0;e<r.length;e++){const t=r[e];this._onByte(t)}}_collectFrame(e){0!==e&&13!==e&&(10!==e?(this._onByte=this._collectCommand,this._reinjectByte(e)):this.onIncomingPing())}_collectCommand(e){if(13!==e)return 10===e?(this._results.command=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_collectHeaders(e){13!==e&&(10!==e?(this._onByte=this._collectHeaderKey,this._reinjectByte(e)):this._setupCollectBody())}_reinjectByte(e){this._onByte(e)}_collectHeaderKey(e){if(58===e)return this._headerKey=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaderValue);this._consumeByte(e)}_collectHeaderValue(e){if(13!==e)return 10===e?(this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_setupCollectBody(){const e=this._results.headers.filter((e=>"content-length"===e[0]))[0];e?(this._bodyBytesRemaining=parseInt(e[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(e){0!==e?this._consumeByte(e):this._retrievedBody()}_collectBodyFixedSize(e){0!=this._bodyBytesRemaining--?this._consumeByte(e):this._retrievedBody()}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw(),this.onFrame(this._results),this._initState()}_consumeByte(e){this._token.push(e)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const e=new Uint8Array(this._token);return this._token=[],e}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var s,a;!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(s||(s={})),function(e){e[e.ACTIVE=0]="ACTIVE",e[e.DEACTIVATING=1]="DEACTIVATING",e[e.INACTIVE=2]="INACTIVE"}(a||(a={}));class u{constructor(e){this.versions=e}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map((e=>`v${e.replace(".","")}.stomp`))}}u.V1_0="1.0",u.V1_1="1.1",u.V1_2="1.2",u.default=new u([u.V1_0,u.V1_1,u.V1_2]);class c{constructor(e,t,r={}){this._client=e,this._webSocket=t,this._serverFrameHandlers={CONNECTED:e=>{this.debug(`connected to server ${e.headers.server}`),this._connected=!0,this._connectedVersion=e.headers.version,this._connectedVersion===u.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(e.headers),this.onConnect(e)},MESSAGE:e=>{const t=e.headers.subscription,r=this._subscriptions[t]||this.onUnhandledMessage,n=e,i=this,o=this._connectedVersion===u.V1_2?n.headers.ack:n.headers["message-id"];n.ack=(e={})=>i.ack(o,t,e),n.nack=(e={})=>i.nack(o,t,e),r(n)},RECEIPT:e=>{const t=this._receiptWatchers[e.headers["receipt-id"]];t?(t(e),delete this._receiptWatchers[e.headers["receipt-id"]]):this.onUnhandledReceipt(e)},ERROR:e=>{this.onStompError(e)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.configure(r)}get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}configure(e){Object.assign(this,e)}start(){const e=new o((e=>{const t=i.fromRawFrame(e,this._escapeHeaderValues);this.logRawCommunication||this.debug(`<<< ${t}`),(this._serverFrameHandlers[t.command]||this.onUnhandledFrame)(t)}),(()=>{this.debug("<<< PONG")}));this._webSocket.onmessage=t=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const e=t.data instanceof ArrayBuffer?(new TextDecoder).decode(t.data):t.data;this.debug(`<<< ${e}`)}e.parseChunk(t.data,this.appendMissingNULLonIncoming)},this._onclose=e=>{this.debug(`Connection closed to ${this._client.brokerURL}`),this._cleanUp(),this.onWebSocketClose(e)},this._webSocket.onclose=this._onclose,this._webSocket.onerror=e=>{this.onWebSocketError(e)},this._webSocket.onopen=()=>{const e=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),e["accept-version"]=this.stompVersions.supportedVersions(),e["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:e})}}_setupHeartbeat(e){if(e.version!==u.V1_1&&e.version!==u.V1_2)return;if(!e["heart-beat"])return;const[t,r]=e["heart-beat"].split(",").map((e=>parseInt(e,10)));if(0!==this.heartbeatOutgoing&&0!==r){const e=Math.max(this.heartbeatOutgoing,r);this.debug(`send PING every ${e}ms`),this._pinger=setInterval((()=>{this._webSocket.readyState===s.OPEN&&(this._webSocket.send(n),this.debug(">>> PING"))}),e)}if(0!==this.heartbeatIncoming&&0!==t){const e=Math.max(this.heartbeatIncoming,t);this.debug(`check PONG every ${e}ms`),this._ponger=setInterval((()=>{const t=Date.now()-this._lastServerActivityTS;t>2*e&&(this.debug(`did not receive server activity for the last ${t}ms`),this._closeOrDiscardWebsocket())}),e)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this._discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState!==s.CONNECTING&&this._webSocket.readyState!==s.OPEN||this._closeOrDiscardWebsocket())}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}_discardWebsocket(){var e,t;this._webSocket.terminate||(e=this._webSocket,t=e=>this.debug(e),e.terminate=function(){const e=()=>{};this.onerror=e,this.onmessage=e,this.onopen=e;const r=new Date,n=this.onclose;this.onclose=e=>{const n=(new Date).getTime()-r.getTime();t(`Discarded socket closed after ${n}ms, with code/reason: ${e.code}/${e.reason}`)},this.close(),n.call(this,{code:4001,reason:"Heartbeat failure, discarding the socket",wasClean:!1})}),this._webSocket.terminate()}_transmit(e){const{command:t,headers:r,body:n,binaryBody:o,skipContentLengthHeader:s}=e,a=new i({command:t,headers:r,body:n,binaryBody:o,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:s});let u=a.serialize();if(this.logRawCommunication?this.debug(`>>> ${u}`):this.debug(`>>> ${a}`),this.forceBinaryWSFrames&&"string"==typeof u&&(u=(new TextEncoder).encode(u)),"string"==typeof u&&this.splitLargeFrames){let e=u;for(;e.length>0;){const t=e.substring(0,this.maxWebSocketChunkSize);e=e.substring(this.maxWebSocketChunkSize),this._webSocket.send(t),this.debug(`chunk sent = ${t.length}, remaining = ${e.length}`)}}else this._webSocket.send(u)}dispose(){if(this.connected)try{const e=Object.assign({},this.disconnectHeaders);e.receipt||(e.receipt="close-"+this._counter++),this.watchForReceipt(e.receipt,(e=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(e)})),this._transmit({command:"DISCONNECT",headers:e})}catch(e){this.debug(`Ignoring error during disconnect ${e}`)}else this._webSocket.readyState!==s.CONNECTING&&this._webSocket.readyState!==s.OPEN||this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&clearInterval(this._pinger),this._ponger&&clearInterval(this._ponger)}publish(e){const{destination:t,headers:r,body:n,binaryBody:i,skipContentLengthHeader:o}=e,s=Object.assign({destination:t},r);this._transmit({command:"SEND",headers:s,body:n,binaryBody:i,skipContentLengthHeader:o})}watchForReceipt(e,t){this._receiptWatchers[e]=t}subscribe(e,t,r={}){(r=Object.assign({},r)).id||(r.id="sub-"+this._counter++),r.destination=e,this._subscriptions[r.id]=t,this._transmit({command:"SUBSCRIBE",headers:r});const n=this;return{id:r.id,unsubscribe:e=>n.unsubscribe(r.id,e)}}unsubscribe(e,t={}){t=Object.assign({},t),delete this._subscriptions[e],t.id=e,this._transmit({command:"UNSUBSCRIBE",headers:t})}begin(e){const t=e||"tx-"+this._counter++;this._transmit({command:"BEGIN",headers:{transaction:t}});const r=this;return{id:t,commit(){r.commit(t)},abort(){r.abort(t)}}}commit(e){this._transmit({command:"COMMIT",headers:{transaction:e}})}abort(e){this._transmit({command:"ABORT",headers:{transaction:e}})}ack(e,t,r={}){r=Object.assign({},r),this._connectedVersion===u.V1_2?r.id=e:r["message-id"]=e,r.subscription=t,this._transmit({command:"ACK",headers:r})}nack(e,t,r={}){return r=Object.assign({},r),this._connectedVersion===u.V1_2?r.id=e:r["message-id"]=e,r.subscription=t,this._transmit({command:"NACK",headers:r})}}var l=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class f{constructor(e={}){this.stompVersions=u.default,this.connectionTimeout=0,this.reconnectDelay=5e3,this.heartbeatIncoming=1e4,this.heartbeatOutgoing=1e4,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8192,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.state=a.INACTIVE;const t=()=>{};this.debug=t,this.beforeConnect=t,this.onConnect=t,this.onDisconnect=t,this.onUnhandledMessage=t,this.onUnhandledReceipt=t,this.onUnhandledFrame=t,this.onStompError=t,this.onWebSocketClose=t,this.onWebSocketError=t,this.logRawCommunication=!1,this.onChangeState=t,this.connectHeaders={},this._disconnectHeaders={},this.configure(e)}get webSocket(){return this._stompHandler?this._stompHandler._webSocket:void 0}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(e){this._disconnectHeaders=e,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===a.ACTIVE}_changeState(e){this.state=e,this.onChangeState(e)}configure(e){Object.assign(this,e)}activate(){if(this.state===a.DEACTIVATING)throw this.debug("Still DEACTIVATING, please await call to deactivate before trying to re-activate"),new Error("Still DEACTIVATING, can not activate now");this.active?this.debug("Already ACTIVE, ignoring request to activate"):(this._changeState(a.ACTIVE),this._connect())}_connect(){return l(this,void 0,void 0,(function*(){if(this.connected)return void this.debug("STOMP: already connected, nothing to do");if(yield this.beforeConnect(),!this.active)return void this.debug("Client has been marked inactive, will not attempt to connect");this.connectionTimeout>0&&(this._connectionWatcher&&clearTimeout(this._connectionWatcher),this._connectionWatcher=setTimeout((()=>{this.connected||(this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect())}),this.connectionTimeout)),this.debug("Opening Web Socket...");const e=this._createWebSocket();this._stompHandler=new c(this,e,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatOutgoing:this.heartbeatOutgoing,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:e=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),!this.active)return this.debug("STOMP got connected while deactivate was issued, will disconnect now"),void this._disposeStompHandler();this.onConnect(e)},onDisconnect:e=>{this.onDisconnect(e)},onStompError:e=>{this.onStompError(e)},onWebSocketClose:e=>{this._stompHandler=void 0,this.state===a.DEACTIVATING&&(this._resolveSocketClose(),this._resolveSocketClose=void 0,this._changeState(a.INACTIVE)),this.onWebSocketClose(e),this.active&&this._schedule_reconnect()},onWebSocketError:e=>{this.onWebSocketError(e)},onUnhandledMessage:e=>{this.onUnhandledMessage(e)},onUnhandledReceipt:e=>{this.onUnhandledReceipt(e)},onUnhandledFrame:e=>{this.onUnhandledFrame(e)}}),this._stompHandler.start()}))}_createWebSocket(){let e;return e=this.webSocketFactory?this.webSocketFactory():new WebSocket(this.brokerURL,this.stompVersions.protocolVersions()),e.binaryType="arraybuffer",e}_schedule_reconnect(){this.reconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this.reconnectDelay}ms`),this._reconnector=setTimeout((()=>{this._connect()}),this.reconnectDelay))}deactivate(){return l(this,void 0,void 0,(function*(){let e;return this.state!==a.ACTIVE?(this.debug(`Already ${a[this.state]}, ignoring call to deactivate`),Promise.resolve()):(this._changeState(a.DEACTIVATING),this._reconnector&&clearTimeout(this._reconnector),this._stompHandler&&this.webSocket.readyState!==s.CLOSED?(e=new Promise(((e,t)=>{this._resolveSocketClose=e})),this._disposeStompHandler(),e):(this._changeState(a.INACTIVE),Promise.resolve()))}))}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&(this._stompHandler.dispose(),this._stompHandler=null)}publish(e){this._stompHandler.publish(e)}watchForReceipt(e,t){this._stompHandler.watchForReceipt(e,t)}subscribe(e,t,r={}){return this._stompHandler.subscribe(e,t,r)}unsubscribe(e,t={}){this._stompHandler.unsubscribe(e,t)}begin(e){return this._stompHandler.begin(e)}commit(e){this._stompHandler.commit(e)}abort(e){this._stompHandler.abort(e)}ack(e,t,r={}){this._stompHandler.ack(e,t,r)}nack(e,t,r={}){this._stompHandler.nack(e,t,r)}}class h{}class d{}class p{}class v{constructor(e){this.client=e}get outgoing(){return this.client.heartbeatOutgoing}set outgoing(e){this.client.heartbeatOutgoing=e}get incoming(){return this.client.heartbeatIncoming}set incoming(e){this.client.heartbeatIncoming=e}}class m extends f{constructor(e){super(),this.maxWebSocketFrameSize=16384,this._heartbeatInfo=new v(this),this.reconnect_delay=0,this.webSocketFactory=e,this.debug=(...e)=>{console.log(...e)}}_parseConnect(...e){let t,r,n,i={};if(e.length<2)throw new Error("Connect requires at least 2 arguments");return"function"==typeof e[1]?[i,r,n,t]=e:6===e.length?[i.login,i.passcode,r,n,t,i.host]=e:[i.login,i.passcode,r,n,t]=e,[i,r,n,t]}connect(...e){const t=this._parseConnect(...e);t[0]&&(this.connectHeaders=t[0]),t[1]&&(this.onConnect=t[1]),t[2]&&(this.onStompError=t[2]),t[3]&&(this.onWebSocketClose=t[3]),super.activate()}disconnect(e,t={}){e&&(this.onDisconnect=e),this.disconnectHeaders=t,super.deactivate()}send(e,t={},r=""){const n=!1===(t=Object.assign({},t))["content-length"];n&&delete t["content-length"],this.publish({destination:e,headers:t,body:r,skipContentLengthHeader:n})}set reconnect_delay(e){this.reconnectDelay=e}get ws(){return this.webSocket}get version(){return this.connectedVersion}get onreceive(){return this.onUnhandledMessage}set onreceive(e){this.onUnhandledMessage=e}get onreceipt(){return this.onUnhandledReceipt}set onreceipt(e){this.onUnhandledReceipt=e}get heartbeat(){return this._heartbeatInfo}set heartbeat(e){this.heartbeatIncoming=e.incoming,this.heartbeatOutgoing=e.outgoing}}class g{static client(e,t){return null==t&&(t=u.default.protocolVersions()),new m((()=>new(g.WebSocketClass||WebSocket)(e,t)))}static over(e){let t;return"function"==typeof e?t=e:(console.warn("Stomp.over did not receive a factory, auto reconnect will not work. Please see https://stomp-js.github.io/api-docs/latest/classes/Stomp.html#over"),t=()=>e),new m(t)}}g.WebSocketClass=null},6551:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>J}),console.log("BUILD/SERIOUSLY.MODULE");let n,i,o,s,a,u,c,l={},f={},h={},d={},p=[],v={},m={},g={canvas:[],image:[],video:[]},y={},b=window.WeakMap&&new WeakMap,_=0,w=function(){},S={transparent:[0,0,0,0],black:[0,0,0,1],red:[1,0,0,1],green:[0,128/255,0,1],blue:[0,0,1,1],white:[1,1,1,1],silver:[192/255,192/255,192/255,1],gray:[128/255,128/255,128/255,1],maroon:[128/255,0,0,1],purple:[128/255,0,128/255,1],fuchsia:[1,0,1,1],lime:[0,1,0,1],olive:[128/255,128/255,0,1],yellow:[1,1,0,1],navy:[0,0,128/255,1],teal:[0,128/255,128/255,1],aqua:[0,1,1,1],orange:[1,165/255,0,1]},E=/^(rgb|hsl)a?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*(\d+(\.\d*)?)\s*)?\)/i,T=/^#(([0-9a-fA-F]{3,8}))/,O=["x","y","z","w"],C=["r","g","b","a"],x={srcRGB:770,dstRGB:771,srcAlpha:1,dstAlpha:771},P=["MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS"],R=/^[\t ]*#define[\t ]+SHADER_NAME\s+([^$\n\r]+)/i,M={frustum:function(e,t,r,n,i,o,s){s||(s=M.create());var a=t-e,u=n-r,c=o-i;return s[0]=2*i/a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/u,s[6]=0,s[7]=0,s[8]=(t+e)/a,s[9]=(n+r)/u,s[10]=-(o+i)/c,s[11]=-1,s[12]=0,s[13]=0,s[14]=-o*i*2/c,s[15]=0,s},perspective:function(e,t,r,n,i){var o=r*Math.tan(e*Math.PI/360),s=o*t;return M.frustum(-s,s,-o,o,r,n,i)},multiply:function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],v=t[12],m=t[13],g=t[14],y=t[15],b=r[0],_=r[1],w=r[2],S=r[3];return e[0]=b*n+_*a+w*f+S*v,e[1]=b*i+_*u+w*h+S*m,e[2]=b*o+_*c+w*d+S*g,e[3]=b*s+_*l+w*p+S*y,b=r[4],_=r[5],w=r[6],S=r[7],e[4]=b*n+_*a+w*f+S*v,e[5]=b*i+_*u+w*h+S*m,e[6]=b*o+_*c+w*d+S*g,e[7]=b*s+_*l+w*p+S*y,b=r[8],_=r[9],w=r[10],S=r[11],e[8]=b*n+_*a+w*f+S*v,e[9]=b*i+_*u+w*h+S*m,e[10]=b*o+_*c+w*d+S*g,e[11]=b*s+_*l+w*p+S*y,b=r[12],_=r[13],w=r[14],S=r[15],e[12]=b*n+_*a+w*f+S*v,e[13]=b*i+_*u+w*h+S*m,e[14]=b*o+_*c+w*d+S*g,e[15]=b*s+_*l+w*p+S*y,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},A=(N=0,window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){var t,r,n;return t=(new Date).getTime(),r=Math.max(0,16-(t-N)),n=window.setTimeout((function(){e(t+r)}),r),N=t+r,n}),j=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(e){window.cancelTimeout(e)},k=["alias","destroy","effect","id","initialize","inputs","isDestroyed","isReady","matte","off","on","readPixels","render","title","update"],I=["alias","destroy","id","inputs","isDestroyed","isReady","off","on","source","title","update"],D=["aliases","defaults","destroy","effect","go","id","incompatible","isDestroyed","isEffect","isNode","isSource","isTarget","isTransform","removeAlias","render","source","stop","target","transform"];var N;function L(e,t){var r,n;if("string"==typeof e)r=document.querySelector(e);else if(!e)return!1;return e.tagName&&(r=e),r?(n=r.tagName.toLowerCase(),t&&t.indexOf(n)<0?e:r):e}function F(e,t){var r,n;for(r in e.prototype&&t.prototype&&e.prototype!==t.prototype&&F(e.prototype,t.prototype),t)t.hasOwnProperty(r)&&((n=Object.getOwnPropertyDescriptor(t,r)).get||n.set?Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:n.get,set:n.set}):e[r]=t[r]);return e}function U(e){var t;if(!console)return w;if("function"==typeof console[e])t=console[e];else{if("function"!=typeof console.log)return w;t=console.log}return t.bind?t.bind(console):function(){t.apply(console,arguments)}}function B(e,t){if(t||(t="HTMLElement"),e instanceof window[t])return!0;if(!e||"object"!=typeof e)return!1;for(;e;)if((e=Object.getPrototypeOf(e))&&e.constructor.name===t)return!0;return!1}function W(e,t,r,n,i){function o(e,t,r){return(r%=1)<0&&(r+=1),r<1/6?e+(t-e)*r*6:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}var s,a;return s=2*r-(a=r<.5?r*(t+1):r+t-r*t),i||(i=[]),i[0]=o(s,a,e+1/3),i[1]=o(s,a,e),i[2]=o(s,a,e-1/3),i[3]=n,i}function V(e){var t,r,n,i="#",o=e[3]<1?4:3;for(t=0;t<o;t++)n=(r=Math.min(255,Math.round(255*e[t]||0))).toString(16),r<16&&(n="0"+n),i+=n;return i}function q(e){return Array.isArray(e)||e&&e.BYTES_PER_ELEMENT&&"length"in e}function z(e){if("function"!=typeof e)throw new Error("setTimeoutZero argument is not a function");p.push(e),"file:"!==window.location.protocol?window.postMessage("seriously-timeout-message",window.location):setTimeout((function(){p.length&&p.shift()()}),0)}function H(e,t){var r;try{r=window.WebGLDebugUtils&&t&&t.debugContext?window.WebGLDebugUtils.makeDebugContext(e.getContext("webgl",t)):e.getContext("webgl",t)}catch(e){}if(!r)try{r=e.getContext("experimental-webgl",t)}catch(e){}return r}function G(){var e;return n&&n.getError()===n.CONTEXT_LOST_WEBGL&&(n=void 0),n||!window.WebGLRenderingContext||o||(e=document.createElement("canvas"),n=H(e),n?e.addEventListener("webglcontextlost",(function t(r){r.preventDefault(),n&&n.canvas===this&&(n=void 0,e.removeEventListener("webglcontextlost",t,!1))}),!1):X.logger.warn("Unable to access WebGL.")),n}function $(e){var t,r,n;function i(e,n){var i,o;q(e)?(i=e[0],o=e[1]||i):i=e,"string"==typeof i?i=i.toLowerCase():"number"==typeof i?i=String(i):i||(i=""),r[i]=o,n||(t.firstValue=i)}function o(e){return e}for(n in e.inputs)if(e.inputs.hasOwnProperty(n)){if(e.reserved.indexOf(n)>=0||Object.prototype[n])throw new Error("Reserved input name: "+n);(t=e.inputs[n]).name=n,isNaN(t.min)&&(t.min=-1/0),isNaN(t.max)&&(t.max=1/0),isNaN(t.minCount)&&(t.minCount=-1/0),isNaN(t.maxCount)&&(t.maxCount=1/0),isNaN(t.step)&&(t.step=0),isNaN(t.mod)&&(t.mod=0),"enum"===t.type&&t.options&&q(t.options)&&t.options.length&&(r={},t.options.forEach(i),t.options=r),"vector"===t.type?t.dimensions<2?t.dimensions=2:t.dimensions>4||!t.dimensions||isNaN(t.dimensions)?t.dimensions=4:t.dimensions=Math.round(t.dimensions):t.dimensions=1,t.shaderDirty=!!t.shaderDirty,"function"!=typeof t.validate&&(t.validate=X.inputValidators[t.type]||o),e.defaultImageInput||"image"!==t.type||(e.defaultImageInput=n)}}function Y(e,t,r,n){var i,o,s,a;!0===n||n&&n.useFloat,this.type=e.UNSIGNED_BYTE,i=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,i),n&&n.texture?(this.texture=n.texture,e.bindTexture(e.TEXTURE_2D,this.texture),this.ownTexture=!1):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this.ownTexture=!0);try{this.type===e.FLOAT?(s=new Float32Array(t*r*4),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.FLOAT,s)):(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,null),this.type=e.UNSIGNED_BYTE)}catch(n){this.type=e.UNSIGNED_BYTE,s=new Uint8Array(t*r*4),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,s)}if(o=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,o),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture,0),(a=e.checkFramebufferStatus(e.FRAMEBUFFER))===e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");if(a===e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");if(a===e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");if(a===e.FRAMEBUFFER_UNSUPPORTED)throw new Error("Incomplete framebuffer: FRAMEBUFFER_UNSUPPORTED");if(a!==e.FRAMEBUFFER_COMPLETE)throw new Error("Incomplete framebuffer: "+a);e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null),this.gl=e,this.frameBuffer=i,this.renderBuffer=o,this.width=t,this.height=r}function K(e,t,r){var n,i,o,s,a,u,c,l,f="";function h(t,r){var n,i;if(n=r?e.createShader(e.FRAGMENT_SHADER):e.createShader(e.VERTEX_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS)){for(t=t.split(/[\n\r]/),i=0;i<t.length;i++)t[i]=i+1+":\t"+t[i];throw t.unshift("Error compiling "+(r?"fragment":"vertex")+" shader:"),X.logger.error(t.join("\n")),new Error("Shader error: "+e.getShaderInfoLog(n))}return n}function d(t,r){if(t.type===e.SAMPLER_2D)return function(n){t.glTexture=e["TEXTURE"+n],e.uniform1i(r,n)};if(t.type===e.BOOL||t.type===e.INT)return t.size>1?function(t){e.uniform1iv(r,t)}:function(t){e.uniform1i(r,t)};if(t.type===e.FLOAT)return t.size>1?function(t){e.uniform1fv(r,t)}:function(t){e.uniform1f(r,t)};if(t.type===e.FLOAT_VEC2)return function(t){e.uniform2f(r,t[0],t[1])};if(t.type===e.FLOAT_VEC3)return function(t){e.uniform3f(r,t[0],t[1],t[2])};if(t.type===e.FLOAT_VEC4)return function(t){e.uniform4f(r,t[0],t[1],t[2],t[3])};if(t.type===e.FLOAT_MAT3)return function(t){e.uniformMatrix3fv(r,!1,t)};if(t.type===e.FLOAT_MAT4)return function(t){e.uniformMatrix4fv(r,!1,t)};throw new Error("Unknown shader uniform type: "+t.type)}function p(t){return function(){return e.getUniform(n,t)}}if(i=h(t),o=h(r,!0),n=e.createProgram(),e.attachShader(n,i),(s=e.getShaderInfoLog(i))&&(f+="Vertex shader error: "+s+"\n"),e.attachShader(n,o),(s=e.getShaderInfoLog(o))&&(f+="Fragment shader error: "+s+"\n"),e.linkProgram(n),!e.getProgramParameter(n,e.LINK_STATUS))throw f+=e.getProgramInfoLog(n),e.deleteProgram(n),e.deleteShader(i),e.deleteShader(o),(c=R.exec(t)||R.exec(r))&&(f="Shader = "+c[1]+"\n"+f),P.forEach((function(t){f+="\n"+t+": "+e.getParameter(e[t])})),new Error("Could not initialize shader:\n"+f);for(e.useProgram(n),this.uniforms={},u=e.getProgramParameter(n,e.ACTIVE_UNIFORMS),a=0;a<u;++a)(l={info:e.getActiveUniform(n,a)}).name=l.info.name.replace(/\[0\]$/,""),l.loc=e.getUniformLocation(n,l.name),l.set=d(l.info,l.loc),l.get=p(l.loc),this.uniforms[l.name]=l,this[l.name]||(this[l.name]=l);for(this.attributes={},this.location={},u=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),a=0;a<u;++a)(l={info:e.getActiveAttrib(n,a)}).name=l.info.name,l.location=e.getAttribLocation(n,l.name),this.attributes[l.name]=l,this.location[l.name]=l.location;this.gl=e,this.program=n,this.destroy=function(){var t;for(t in e&&(e.deleteProgram(n),e.deleteShader(i),e.deleteShader(o)),this)this.hasOwnProperty(t)&&delete this[t];n=null,i=null,o=null}}function X(e){if(window===this||!(this instanceof X)||void 0!==this.id)return new X(e);var t,r,n,i,o,a,p,y,S,E,T,O,C,P,k,I=++_,N=this,U=[],W={},q=0,G=[],J=[],Z=[],Q=[],ee={},te=[],re=[],ne={},ie={},oe=!1,se=!1;function ae(e,t){var r,n,i;return!!t&&(r=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,r),t.bufferData(t.ARRAY_BUFFER,e.vertices,t.STATIC_DRAW),r.size=3,n=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e.indices,t.STATIC_DRAW),i=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,i),t.bufferData(t.ARRAY_BUFFER,e.coords,t.STATIC_DRAW),i.size=2,{vertex:r,index:n,texCoord:i,length:e.indices.length,mode:e.mode||t.TRIANGLES})}function ue(e){var t={};return t.vertices=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]),t.indices=new Uint16Array([0,1,2,0,2,3]),t.coords=new Float32Array([0,0,1,0,1,1,0,1]),ae(t,e)}function ce(e){var n,s;if(!r)if(e.canvas.addEventListener("webglcontextlost",fe,!1),e.canvas.addEventListener("webglcontextrestored",le,!1),e.isContextLost())X.logger.warn("Unable to attach lost WebGL context. Will try again when context is restored.");else{for(r=e,t=e.canvas,i=ue(r),o=new K(r,"#define SHADER_NAME seriously.base\n"+u,"#define SHADER_NAME seriously.base\n"+c),n=0;n<Q.length;n++)(s=Q[n]).gl=r,s.initialize(),s.buildShader();for(n=0;n<G.length;n++)(s=G[n]).initialize();for(n=0;n<J.length;n++)(s=J[n]).model||(s.model=i,s.shader=o)}}function le(){var e,t,i,o;if(n&&!r){if(B(t=n.target,"WebGLFramebuffer"))return void X.logger.error("Unable to restore target built on WebGLFramebuffer");if(e=H(t,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:n.debugContext})){if(e.isContextLost())return void X.logger.error("Unable to restore WebGL Context");for(ce(e),n.renderToTexture?n.frameBuffer=new Y(r,n.width,n.height,!1):n.frameBuffer={frameBuffer:null},i=0;i<U.length;i++)(o=U[i]).setDirty(),o.emit("webglcontextrestored");X.logger.log("WebGL context restored")}}}function fe(e){var n,s;for(e&&(X.logger.warn("WebGL context lost"),e.preventDefault()),k&&(j(k),k=0),t&&t.removeEventListener("webglcontextlost",fe,!1),n=0;n<Q.length;n++)(s=Q[n]).gl=null,s.initialized=!1,s.baseShader=null,s.model=null,s.frameBuffer=null,s.texture=null,s.shader&&s.shader.destroy&&(s.shader.destroy(),s.effect.commonShader&&delete ie[s.hook]),s.shaderDirty=!0,s.shader=null,s.effect.lostContext&&s.effect.lostContext.call(s),e&&s.emit("webglcontextlost");for(n=0;n<G.length;n++)(s=G[n]).texture=null,s.initialized=!1,s.allowRefresh=!1,e&&s.emit("webglcontextlost");for(n=0;n<Z.length;n++)(s=Z[n]).frameBuffer=null,s.texture=null,e&&s.emit("webglcontextlost");for(n=0;n<J.length;n++)(s=J[n]).model=!1,s.frameBuffer=null,e&&s.emit("webglcontextlost");o&&o.destroy&&o.destroy(),r&&(r.deleteBuffer(i.vertex),r.deleteBuffer(i.texCoord),r.deleteBuffer(i.index)),i&&(delete i.vertex,delete i.texCoord,delete i.index),i=null,o=null,r=null,t=null}function he(e){var t,r,n=!1;if(k=0,te.length)for(n=!0,t=0;t<te.length;t++)te[t].call(N,e);if(G&&G.length)for(n=!0,t=0;t<G.length;t++)((r=G[t]).dirty||r.checkDirty&&r.checkDirty())&&(r.dirty=!1,r.setDirty());for(t=0;t<J.length;t++)(r=J[t]).auto&&r.dirty&&r.render();if(re.length)for(n=!0,t=0;t<re.length;t++)re[t].call(N);n&&!k&&(k=A(he))}function de(e,t,n,i,o,s){var a,u,c,l,f,h,d,v,m,g=0,b=o&&o.gl||r;if(b){for(a in o?(l=s&&s.width||o.width||b.canvas.width,f=s&&s.height||o.height||b.canvas.height):(l=s&&s.width||b.canvas.width,f=s&&s.height||b.canvas.height),e.use(),b.viewport(0,0,l,f),b.bindFramebuffer(b.FRAMEBUFFER,i),b.enableVertexAttribArray(e.location.position),b.enableVertexAttribArray(e.location.texCoord),t.texCoord&&(b.bindBuffer(b.ARRAY_BUFFER,t.texCoord),b.vertexAttribPointer(e.location.texCoord,t.texCoord.size,b.FLOAT,!1,0,0)),b.bindBuffer(b.ARRAY_BUFFER,t.vertex),b.vertexAttribPointer(e.location.position,t.vertex.size,b.FLOAT,!1,0,0),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,t.index),s&&s.depth?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST),s?void 0===s.blend||s.blend?(r.enable(r.BLEND),h=void 0===s.srcRGB?r.ONE:s.srcRGB,v=s.dstRGB||r.ZERO,d=void 0===s.srcAlpha?h:s.srcAlpha,m=void 0===s.dstAlpha?v:s.dstAlpha,r.blendFuncSeparate(h,v,d,m),r.blendEquation(s.blendEquation||r.FUNC_ADD)):r.disable(r.BLEND):(r.enable(r.BLEND),r.blendFunc(r.ONE,r.ZERO),r.blendEquation(r.FUNC_ADD)),n)n.hasOwnProperty(a)&&(u=n[a],(c=e.uniforms[a])&&(B(u,"WebGLTexture")?(b.activeTexture(b.TEXTURE0+g),b.bindTexture(b.TEXTURE_2D,u),c.set(g),g++):u instanceof p||u instanceof y||u instanceof S?u.texture&&(b.activeTexture(b.TEXTURE0+g),b.bindTexture(b.TEXTURE_2D,u.texture),c.set(g),g++):null!=u&&c.set(u)));s&&void 0!==s.clear&&!s.clear||(b.clearColor(0,0,0,0),b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)),b.drawElements(t.mode,t.length,b.UNSIGNED_SHORT,0),r.enable(r.DEPTH_TEST)}}function pe(e,t,r){var n,i;if(("string"!=typeof e||!t&&0!==t)&&(r&&"object"==typeof r||(r=t),t=e),"string"==typeof e&&h[e]||(e=null),t instanceof p||t instanceof y||t instanceof S)n=t;else if(t instanceof T||t instanceof O||t instanceof C){if(!(n=W[t.id]))throw new Error("Cannot connect a foreign node")}else{for("string"==typeof t&&isNaN(t)&&(t=L(t,["canvas","img","video"])),i=0;i<G.length;i++)if(n=G[i],(!e||e===n.hook)&&n.compare&&n.compare(t,r))return n;n=new p(e,t,r)}return n}function ve(e,t){var r,n,i;if(!(e instanceof y||e instanceof S))return!1;if(e===t)return!0;for(r in i=e.sources)if(i.hasOwnProperty(r)&&((n=i[r])===t||ve(n,t)))return!0;return!1}(a=function(){this.ready=!1,this.width=1,this.height=1,this.gl=r,this.uniforms={resolution:[this.width,this.height],transform:null},this.dirty=!0,this.isDestroyed=!1,this.seriously=N,this.listeners={},this.id=q,q++}).prototype.setReady=function(){var e;if(!this.ready&&(this.ready=!0,this.emit("ready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setReady()},a.prototype.setUnready=function(){var e;if(this.ready&&(this.ready=!1,this.emit("unready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setUnready()},a.prototype.setDirty=function(){var e;if(!this.dirty&&(this.emit("dirty"),this.dirty=!0,this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setDirty()},a.prototype.initFrameBuffer=function(e){r&&(this.frameBuffer=new Y(r,this.width,this.height,e))},a.prototype.readPixels=function(e,t,n,i,o){var s=this.gl||r;if(!r)throw new Error("Cannot read pixels until a canvas is connected");if(this.frameBuffer||(this.initFrameBuffer(),this.setDirty()),this.render(),void 0===o)o=new Uint8Array(n*i*4);else if(!B(o,"Uint8Array"))throw new Error("Incompatible array type");return s.bindFramebuffer(r.FRAMEBUFFER,this.frameBuffer.frameBuffer),s.readPixels(e,t,n,i,r.RGBA,r.UNSIGNED_BYTE,o),o},a.prototype.resize=function(){var e,t;this.source?(e=this.source.width,t=this.source.height):this.sources&&this.sources.source?(e=this.sources.source.width,t=this.sources.source.height):this.inputs&&this.inputs.width?(e=this.inputs.width,t=this.inputs.height||e):this.inputs&&this.inputs.height?e=t=this.inputs.height:(e=1,t=1),e=Math.floor(e),t=Math.floor(t),this.width===e&&this.height===t||(this.width=e,this.height=t,this.emit("resize"),this.setDirty()),this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=e,this.uniforms.resolution[1]=t),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(e,t)},a.prototype.on=function(e,t){var r,n=-1;e&&"function"==typeof t&&((r=this.listeners[e])?n=r.indexOf(t):r=this.listeners[e]=[],n<0&&r.push(t))},a.prototype.off=function(e,t){var r,n=-1;e&&"function"==typeof t&&(r=this.listeners[e])&&(n=r.indexOf(t))>=0&&r.splice(n,1)},a.prototype.emit=function(e){var t,r=this.listeners[e];if(r&&r.length)for(t=0;t<r.length;t++)z(r[t])},a.prototype.destroy=function(){var e,t;for(t in delete this.gl,delete this.seriously,this.listeners)this.listeners.hasOwnProperty(t)&&delete this.listeners[t];for(e in this.uniforms)this.uniforms.hasOwnProperty(e)&&delete this.uniforms[e];this.targets&&delete this.targets,this.frameBuffer&&this.frameBuffer.destroy&&(this.frameBuffer.destroy(),delete this.frameBuffer),(e=U.indexOf(this))>=0&&U.splice(e,1),delete W[this.id],this.isDestroyed=!0},T=function(e){var t,r=e;function n(e,t){var n,i,o;return o=r.effect.inputs[e],n=r.inputElements[e],"string"==typeof t&&isNaN(t)&&("enum"===o.type?o.options.hasOwnProperty(t)||(t=L(t,["select"])):"number"===o.type||"boolean"===o.type?t=L(t,["input","select"]):"image"===o.type&&(t=L(t,["canvas","img","video"]))),B(t,"HTMLInputElement")||B(t,"HTMLSelectElement")?(i=t.value,n&&n.element!==t&&(n.element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0),delete r.inputElements[e],n=null),n||(n={element:t,listener:function(e,n){return function(){var i,s;i="checkbox"===t.type?t.checked:n.value,s=r.setInput(e,i),"color"===o.type&&(s=V(s).substr(0,7)),s!==i&&(n.value=s)}}(e,t)},r.inputElements[e]=n,"range"===t.type?(t.addEventListener("input",n.listener,!0),t.addEventListener("change",n.listener,!0)):t.addEventListener("change",n.listener,!0)),n&&"checkbox"===t.type&&(i=t.checked)):(n&&(n.element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0),delete r.inputElements[e]),i=t),r.setInput(e,i),r.inputs[e]}function i(e){return function(t){var r=n(e,t);return r&&r.pub}}function o(e){return function(){var t=r.inputs[e];return t&&t.pub}}function s(e){return function(t){return n(e,t)}}function a(e){return function(){return r.inputs[e]}}for(t in r.effect.inputs)if(r.effect.inputs.hasOwnProperty(t)){if(void 0!==this[t])throw new Error("Cannot overwrite Seriously."+t);"image"===r.effect.inputs[t].type?Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:o(t),set:i(t)}):Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:a(t),set:s(t)})}Object.defineProperties(this,{effect:{enumerable:!0,configurable:!0,get:function(){return r.hook}},title:{enumerable:!0,configurable:!0,get:function(){return r.effect.title||r.hook}},width:{enumerable:!0,configurable:!0,get:function(){return r.width}},height:{enumerable:!0,configurable:!0,get:function(){return r.height}},id:{enumerable:!0,configurable:!0,get:function(){return r.id}}}),this.render=function(){return r.render(),this},this.readPixels=function(e,t,n,i,o){return r.readPixels(e,t,n,i,o)},this.on=function(e,t){r.on(e,t)},this.off=function(e,t){r.off(e,t)},this.inputs=function(e){var t,n,i,o;if(i=r.effect.inputs,e)return(n=i[e])?(t={type:n.type,defaultValue:n.defaultValue,title:n.title||e},"number"===n.type?(t.min=n.min,t.max=n.max,t.step=n.step,t.mod=n.mod):"enum"===n.type?t.options=F({},n.options):"vector"===n.type&&(t.dimensions=n.dimensions),n.description&&(t.description=n.description),t):null;for(o in t={},i)i.hasOwnProperty(o)&&(t[o]=this.inputs(o));return t},this.alias=function(e,t){return r.alias(e,t),this},this.matte=function(e){r.matte(e)},this.destroy=function(){var e,t;for(e in r.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return r.isDestroyed},this.isReady=function(){return r.ready}},y=function(e,t){var n,i,o,u,c={};for(n in a.call(this,t),this.gl=r,this.effectRef=l[e],this.sources={},this.targets=[],this.inputElements={},this.dirty=!0,this.shaderDirty=!0,this.hook=e,this.options=t,this.transform=null,this.effect=F({},this.effectRef),this.effectRef.definition&&F(this.effect,this.effectRef.definition.call(this,t)),$(this.effect),this.uniforms.transform=s,this.inputs={},u=ne[e],this.effect.inputs)this.effect.inputs.hasOwnProperty(n)&&(void 0!==(i=this.effect.inputs[n]).defaultValue&&null!==i.defaultValue||("number"===i.type?i.defaultValue=Math.min(Math.max(0,i.min),i.max):"color"===i.type?i.defaultValue=[0,0,0,0]:"boolean"===i.type?i.defaultValue=!1:"string"===i.type?i.defaultValue="":"enum"===i.type&&(i.defaultValue=i.firstValue)),o=i.validate.call(this,i.defaultValue,i),u&&void 0!==u[n]&&(o=i.validate.call(this,u[n],i,i.defaultValue,o),u[n]=o,"image"===i.type&&(c[n]=o)),this.inputs[n]=o,i.uniform&&(this.uniforms[i.uniform]=i.defaultValue));for(n in r&&(this.initialize(),this.effect.commonShader&&this.buildShader()),this.updateReady(),this.inPlace=this.effect.inPlace,this.pub=new T(this),U.push(this),W[this.id]=this,Q.push(this),v[e].push(this),c)c.hasOwnProperty(n)&&this.setInput(n,c[n])},y.prototype=Object.create(a.prototype),y.prototype.constructor=y,y.prototype.initialize=function(){if(!this.initialized){var e=this;this.baseShader=o,this.shape?this.model=ae(this.shape,this.gl):this.model=i,"function"==typeof this.effect.initialize?this.effect.initialize.call(this,(function(){e.initFrameBuffer(!0)}),r):this.initFrameBuffer(!0),this.frameBuffer&&(this.texture=this.frameBuffer.texture),this.initialized=!0}},y.prototype.resize=function(){var e;for(a.prototype.resize.call(this),this.effect.resize&&this.effect.resize.call(this),e=0;e<this.targets.length;e++)this.targets[e].resize()},y.prototype.updateReady=function(){var e,t,r,n,i=!0;for(t in(r=this.effect).inputs)if(r.inputs.hasOwnProperty(t)&&"image"===this.effect.inputs[t].type&&(!this.sources[t]||!this.sources[t].ready)&&(!r.requires||r.requires.call(this,t,this.inputs))){i=!1;break}if(this.ready!==i&&(this.ready=i,this.emit(i?"ready":"unready"),n=i?"setReady":"setUnready",this.targets))for(e=0;e<this.targets.length;e++)this.targets[e][n]()},y.prototype.setReady=y.prototype.updateReady,y.prototype.setUnready=y.prototype.updateReady,y.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},y.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1)},y.prototype.removeSource=function(e){var t,r=e&&e.pub;for(t in this.inputs)!this.inputs.hasOwnProperty(t)||this.inputs[t]!==e&&this.inputs[t]!==r||(this.inputs[t]=null);for(t in this.sources)!this.sources.hasOwnProperty(t)||this.sources[t]!==e&&this.sources[t]!==r||(this.sources[t]=null)},y.prototype.buildShader=function(){var e,t=this.effect,n=this;function i(e){return R.test(e)?e:"#define SHADER_NAME seriously."+n.hook+"\n"+e}this.shaderDirty&&(t.commonShader&&ie[this.hook]?(this.shader||ie[this.hook].count++,this.shader=ie[this.hook].shader):t.shader?(this.shader&&!t.commonShader&&this.shader.destroy(),(e=t.shader.call(this,this.inputs,{vertex:u,fragment:c},X.util))instanceof K?this.shader=e:e&&e.vertex&&e.fragment?this.shader=new K(r,i(e.vertex),i(e.fragment)):this.shader=o,t.commonShader&&(ie[this.hook]={count:1,shader:this.shader})):this.shader=o,this.shaderDirty=!1)},y.prototype.render=function(){var e,t,n,i=this.effect,o=this;if(r){if(this.initialized||this.initialize(),this.shaderDirty&&this.buildShader(),this.dirty&&this.ready){for(e in this.sources)!this.sources.hasOwnProperty(e)||i.requires&&!i.requires.call(this,e,this.inputs)||(n="function"==typeof this.inPlace?this.inPlace(e):this.inPlace,this.sources[e].render(!n));this.frameBuffer&&(t=this.frameBuffer.frameBuffer),"function"==typeof i.draw?(i.draw.call(this,this.shader,this.model,this.uniforms,t,(function(e,t,r,n,i,s){de(e,t,r,n,i||o,s)})),this.emit("render")):t&&(de(this.shader,this.model,this.uniforms,t,this),this.emit("render")),this.dirty=!1}return this.texture}},y.prototype.setInput=function(e,t){var r,n,i,o,a,u=this;if(this.effect.inputs.hasOwnProperty(e)){if("image"===(r=this.effect.inputs[e]).type){if(t){if((t=pe(t))!==this.sources[e]){if(function(){var t,r=u.sources[e];if(r){for(t in u.sources)if(t!==e&&u.sources.hasOwnProperty(t)&&u.sources[t]===r)return;r.removeTarget(u)}}(),ve(t,this))throw new Error("Attempt to make cyclical connection.");this.sources[e]=t,t.addTarget(this)}}else delete this.sources[e],t=!1;n=this.sources[e],i=Object.keys(this.sources),!0===this.inPlace&&1===i.length?(o=this.sources[i[0]],this.uniforms.transform=o&&o.cumulativeMatrix||s):this.uniforms.transform=s}else a=ne[this.hook]&&void 0!==ne[this.hook][e]?ne[this.hook][e]:r.defaultValue,n=t=r.validate.call(this,t,r,a,this.inputs[e]);return this.inputs[e]===t&&"color"!==r.type&&"vector"!==r.type||(this.inputs[e]=t,r.uniform&&(this.uniforms[r.uniform]=n),"image"===r.type?(this.resize(),this.updateReady()):r.updateSources&&this.updateReady(),r.shaderDirty&&(this.shaderDirty=!0),this.setDirty(),r.update&&r.update.call(this,t)),t}},y.prototype.alias=function(e,t){var r=this;if(D.indexOf(t)>=0)throw new Error("'"+t+"' is a reserved name and cannot be used as an alias.");return this.effect.inputs.hasOwnProperty(e)&&(t||(t=e),N.removeAlias(t),ee[t]={node:this,input:e},Object.defineProperty(N,t,{configurable:!0,enumerable:!0,get:function(){return r.inputs[e]},set:function(t){return r.setInput(e,t)}})),this},y.prototype.matte=function(e){var t,r,n,i,o,s,a,u=[],c=[],l={};function f(e){var t,r,n,i,o,s,a,l,f,h,d,p=[];if(!e.simple){for(t=0;t<e.edges.length;t++)for(n=e.edges[t],r=t+1;r<e.edges.length;r++)i=e.edges[r],v=n[0],m=n[1],g=i[0],void 0,void 0,void 0,S=void 0,E=void 0,b=((y=i[1]).x-g.x)*(v.y-g.y)-(y.y-g.y)*(v.x-g.x),_=(m.x-v.x)*(v.y-g.y)-(m.y-v.y)*(v.x-g.x),(o=!!((w=(y.y-g.y)*(m.x-v.x)-(y.x-g.x)*(m.y-v.y))&&(E=_/w,(S=b/w)>0&&S<=1&&E>0&&E<=1))&&{x:v.x+S*(m.x-v.x),y:v.y+S*(m.y-v.y)})&&(o.edge1=n,o.edge2=i,p.push(o));var v,m,g,y,b,_,w,S,E;if(p.length){for(f=[],t=0;t<p.length;t++)n=(o=p[t]).edge1,i=o.edge2,h={x:o.x,y:o.y,prev:n[0],next:i[1],id:c.length},e.vertices.push(h),c.push(h),d={x:o.x,y:o.y,prev:i[0],next:n[1],id:c.length},e.vertices.push(d),c.push(h),h.prev.next=h,h.next.prev=h,d.prev.next=d,d.next.prev=d;do{s={edges:[],vertices:[],simple:!0},f.push(s),a=l=e.vertices[0];do{t=e.vertices.indexOf(l),e.vertices.splice(t,1),s.edges.push([l,l.next]),s.vertices.push(l),l=l.next}while(l!==a)}while(e.vertices.length);for(t=u.indexOf(e),u.splice(t,1),t=0;t<f.length;t++)u.push(f[t])}else e.simple=!0}}function h(e){var t,r,n,i,o=e.vertices.length,s=0;for(t=o-1,r=0;r<o;t=r,r++)n=e.vertices[t],i=e.vertices[r],s+=n.x*i.y-i.x*n.y;return s>0}function d(e){var t,n,i,o,s,a,u,c,l,f,h,d=e.vertices,p=[],v=[];function m(e,t,r,n){var i,o,s,a,u,c,l,f,h,d,p,v;return i=r.x-t.x,o=r.y-t.y,s=e.x-r.x,a=e.y-r.y,u=t.x-e.x,c=t.y-e.y,l=n.x-e.x,f=n.y-e.y,h=n.x-t.x,d=n.y-t.y,p=n.x-r.x,v=n.y-r.y,i*d-o*h>=0&&s*v-a*p>=0&&u*f-c*l>=0}function g(e,t,r,n,i){var o,s,a,u;if(s=d[i[e]],a=d[i[t]],u=d[i[r]],0>(a.x-s.x)*(u.y-s.y)-(a.y-s.y)*(u.x-s.x))return!1;for(o=0;o<n;o++)if(o!==e&&o!==t&&o!==r&&m(s,a,u,d[i[o]]))return!1;return!0}if(n=d.length,e.clockWise)for(t=0;t<n;t++)p[t]=t;else for(t=0;t<n;t++)p[t]=n-1-t;for(o=2*(i=n),t=i-1;i>2;){if(o--<=0)return v;if(i<=(s=t)&&(s=0),i<=(t=s+1)&&(t=0),i<(a=t+1)&&(a=0),g(s,t,a,i,p)){for(u=p[s],c=p[t],l=p[a],e.clockWise?(v.push(d[u]),v.push(d[c]),v.push(d[l])):(v.push(d[l]),v.push(d[c]),v.push(d[u])),f=t,h=t+1;h<i;f++,h++)p[f]=p[h];o=2*--i}}r.indices=v}for(t=function(e){return e&&e.length&&Array.isArray(e)?Array.isArray(e[0])?Array.isArray(e[0])&&!isNaN(e[0][0])?[e]:e:[e]:[]}(e),n=0;n<t.length;n++){for(e=t[n],a=null,r={vertices:[],edges:[]},i=0;i<e.length;i++)"object"!=typeof(o=e[i])||isNaN(o.x)||isNaN(o.y)?o.length>=2&&!isNaN(o[0])&&!isNaN(o[1])&&(s={x:o[0],y:o[1],id:c.length}):s={x:o.x,y:o.y,id:c.length},s&&(a?(a.next=s,s.prev=a,s.next=r.vertices[0],r.vertices[0].prev=s):(r.head=s,s.next=s,s.prev=s),c.push(s),r.vertices.push(s),a=s);if(r.vertices.length>2)for(3===r.vertices.length&&(r.simple=!0),u.push(r),i=0;i<r.vertices.length;i++)s=r.vertices[i],r.edges.push([s,s.next])}for(n=u.length-1;n>=0;n--)f(r=u[n]);for(n=0;n<u.length;n++)(r=u[n]).clockWise=h(r),d(r);for(l.vertices=[],l.coords=[],n=0;n<c.length;n++)o=c[n],l.vertices.push(2*o.x-1),l.vertices.push(-2*o.y+1),l.vertices.push(-1),l.coords.push(o.x),l.coords.push(-1*o.y+1);for(l.vertices=new Float32Array(l.vertices),l.coords=new Float32Array(l.coords),l.indices=[],n=0;n<u.length;n++)for(r=u[n],i=0;i<r.indices.length;i++)o=r.indices[i],l.indices.push(o.id);l.indices=new Uint16Array(l.indices),this.shape=l,this.gl&&ae(l,this.gl)},y.prototype.destroy=function(){var e,t,r,n=this.hook;for(t in this.effect.destroy&&"function"==typeof this.effect.destroy&&this.effect.destroy.call(this),delete this.effect,ie[n]&&(ie[n].count--,ie[n].count||delete ie[n]),this.shader&&this.shader.destroy&&this.shader!==o&&!ie[n]&&this.shader.destroy(),delete this.shader,this.inputElements)this.inputElements.hasOwnProperty(t)&&((r=this.inputElements[t]).element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0));for(t in this.sources)this.sources.hasOwnProperty(t)&&((r=this.sources[t])&&r.removeTarget&&r.removeTarget(this),delete this.sources[t]);for(;this.targets.length;)(r=this.targets.pop())&&r.removeSource&&r.removeSource(this);for(t in this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];for(t in ee)ee.hasOwnProperty(t)&&(r=ee[t]).node===this&&N.removeAlias(t);(e=Q.indexOf(this))>=0&&Q.splice(e,1),(e=v[n].indexOf(this))>=0&&v[n].splice(e,1),a.prototype.destroy.call(this)},O=function(e){var t=e;Object.defineProperties(this,{original:{enumerable:!0,configurable:!0,get:function(){return t.source}},id:{enumerable:!0,configurable:!0,get:function(){return t.id}},width:{enumerable:!0,configurable:!0,get:function(){return t.width}},height:{enumerable:!0,configurable:!0,get:function(){return t.height}}}),this.render=function(){t.render()},this.update=function(){t.setDirty()},this.readPixels=function(e,r,n,i,o){return t.readPixels(e,r,n,i,o)},this.on=function(e,r){t.on(e,r)},this.off=function(e,r){t.off(e,r)},this.destroy=function(){var e,r;for(e in t.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((r=Object.getOwnPropertyDescriptor(this,e)).get||r.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return t.isDestroyed},this.isReady=function(){return t.ready}},p=function(e,t,n){var i,o,s=n||{},u=void 0===s.flip||s.flip,c=s.width,l=s.height,f=!1,d=this,p=!1;function v(e,t,r,n){var i=h[e];if(i.definition){if(!(i=i.definition.call(d,t,r,n)))return null;i=F(F({},h[e]),i)}return i}function m(e){return d.source===e}if(a.call(this),(e&&"string"!=typeof e||!t&&0!==t)&&(n&&"object"==typeof n||(n=t),t=e),"string"==typeof t&&isNaN(t)&&(t=L(t,["canvas","img","video"])),"string"==typeof e&&h[e]&&(o=v(e,t,n,!0))&&(this.hook=e,p=!0,f=o.deferTexture,this.plugin=o,this.compare=o.compare,this.checkDirty=o.checkDirty,o.source&&(t=o.source)),!o&&B(t))"CANVAS"===t.tagName?(this.width=t.width,this.height=t.height,this.render=this.renderImageCanvas,p=!0,this.hook="canvas",this.compare=m):"IMG"===t.tagName&&(this.width=t.naturalWidth||1,this.height=t.naturalHeight||1,t.complete&&t.naturalWidth||(f=!0),t.addEventListener("load",(function(){d.isDestroyed||(d.width===t.naturalWidth&&d.height===t.naturalHeight||(d.width=t.naturalWidth,d.height=t.naturalHeight,d.resize()),d.setDirty(),d.setReady())}),!0),this.render=this.renderImageCanvas,p=!0,this.hook="image",this.compare=m);else if(!o&&B(t,"WebGLTexture")){if(r&&!r.isTexture(t))throw new Error("Not a valid WebGL texture.");isNaN(c)?isNaN(l)||(c=l):isNaN(l)&&(l=c),this.width=c,this.height=l,void 0===s.flip&&(u=!1),p=!0,this.texture=t,this.initialized=!0,this.hook="texture",this.compare=m,this.render=function(){}}if(!p&&!o)for(i in h)if(h.hasOwnProperty(i)&&h[i]&&(o=v(i,t,n,!1))){this.hook=i,p=!0,f=o.deferTexture,this.plugin=o,this.compare=o.compare,this.checkDirty=o.checkDirty,o.source&&(t=o.source);break}if(!p)throw new Error("Unknown source type");this.source=t,void 0===this.flip&&(this.flip=u),this.targets=[],f||d.setReady(),this.pub=new O(this),U.push(this),W[this.id]=this,G.push(this),g[this.hook].push(this),G.length&&!k&&he()},p.prototype=Object.create(a.prototype),p.prototype.constructor=p,p.prototype.initialize=function(){var e;r&&!this.texture&&this.ready&&(e=r.createTexture(),r.bindTexture(r.TEXTURE_2D,e),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.bindTexture(r.TEXTURE_2D,null),this.texture=e,this.initialized=!0,this.allowRefresh=!0,this.setDirty())},p.prototype.initFrameBuffer=function(e){r&&(this.frameBuffer=new Y(r,this.width,this.height,{texture:this.texture,useFloat:e}))},p.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},p.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1)},p.prototype.resize=function(){var e,t;if(this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.framebuffer&&this.framebuffer.resize(this.width,this.height),this.emit("resize"),this.setDirty(),this.targets)for(e=0;e<this.targets.length;e++)(t=this.targets[e]).resize(),t.setTransformDirty&&t.setTransformDirty()},p.prototype.setReady=function(){var e;if(!this.ready&&(this.ready=!0,this.resize(),this.initialize(),this.emit("ready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setReady()},p.prototype.render=function(){var e=this.source;r&&(e||0===e)&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.plugin&&this.plugin.render&&(this.dirty||this.checkDirty&&this.checkDirty())&&this.plugin.render.call(this,r,de,i,o)&&(this.dirty=!1,this.emit("render")))},p.prototype.renderImageCanvas=function(){var e=this.source;if(r&&e&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.dirty)){r.bindTexture(r.TEXTURE_2D,this.texture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,this.flip),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{return r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),this.dirty=!1,this.emit("render"),!0}catch(e){e.code===window.DOMException.SECURITY_ERR&&(this.allowRefresh=!1,X.logger.error("Unable to access cross-domain image"))}return!1}},p.prototype.destroy=function(){var e,t,n;for(this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),r&&this.texture&&r.deleteTexture(this.texture);this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(t in(e=G.indexOf(this))>=0&&G.splice(e,1),(e=g[this.hook].indexOf(this))>=0&&g[this.hook].splice(e,1),this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];a.prototype.destroy.call(this)},P=function(e){var t=e;Object.defineProperties(this,{source:{enumerable:!0,configurable:!0,get:function(){if(t.source)return t.source.pub},set:function(e){t.setSource(e)}},original:{enumerable:!0,configurable:!0,get:function(){return t.target}},width:{enumerable:!0,configurable:!0,get:function(){return t.width},set:function(e){!isNaN(e)&&e>0&&t.width!==e&&(t.width=e,t.resize(),t.setTransformDirty())}},height:{enumerable:!0,configurable:!0,get:function(){return t.height},set:function(e){!isNaN(e)&&e>0&&t.height!==e&&(t.height=e,t.resize(),t.setTransformDirty())}},id:{enumerable:!0,configurable:!0,get:function(){return t.id}}}),this.render=function(){t.render()},this.readPixels=function(e,r,n,i,o){return t.readPixels(e,r,n,i,o)},this.on=function(e,r){t.on(e,r)},this.off=function(e,r){t.off(e,r)},this.go=function(e){t.go(e)},this.stop=function(){t.stop()},this.getTexture=function(){return t.frameBuffer.texture},this.destroy=function(){var e,r;for(e in t.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((r=Object.getOwnPropertyDescriptor(this,e)).get||r.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.inputs=function(e){return{source:{type:"image"}}},this.isDestroyed=function(){return t.isDestroyed},this.isReady=function(){return t.ready}},E=function(e,t,s){var l,f,h,p,v,m,g,y,_,S=this,E=!1;function T(e,t,n,s){var a=d[e];if(a.definition){if(!(a=a.definition.call(S,t,n,s)))return null;a=F(F({},d[e]),a),S.hook=_,E=!0,S.plugin=a,S.compare=a.compare,a.target&&(t=a.target),a.gl&&!S.gl&&(S.gl=a.gl,r||ce(a.gl)),S.gl===r&&(S.model=i,S.shader=o)}return a}if(a.call(this),(e&&"string"!=typeof e||!t&&0!==t)&&(s&&"object"==typeof s||(s=t),t=e),f=void 0===(l=s||{}).flip||l.flip,h=parseInt(l.width,10),p=parseInt(l.height,10),m=l.debugContext,"string"==typeof e&&d[e]&&T(e,t,l,!0),this.renderToTexture=l.renderToTexture,B(t,"WebGLFramebuffer"))if(g=t,B(l,"HTMLCanvasElement"))t=l;else if(B(l,"WebGLRenderingContext"))t=l.canvas;else if(B(l.canvas,"HTMLCanvasElement"))t=l.canvas;else{if(!B(l.context,"WebGLRenderingContext"))throw new Error("Must provide a canvas with WebGLFramebuffer target");t=l.context.canvas}if(B(t,"HTMLCanvasElement")){if(h=t.width,p=t.height,(!r||r.canvas!==t&&l.allowSecondaryWebGL)&&(v=H(t,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:m})),v)r&&r!==v?(this.gl=v,this.frameBuffer={frameBuffer:g||null},this.shader=new K(this.gl,u,c),this.model=ue.call(this,this.gl),this.pixels=null,this.texture=this.gl.createTexture(),this.gl.bindTexture(r.TEXTURE_2D,this.texture),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),this.gl.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),this.render=this.renderSecondaryWebGL):(n||(n=this),r||ce(v),this.render=this.renderWebGL,l.renderToTexture?r&&(this.frameBuffer=new Y(r,h,p,!1)):this.frameBuffer={frameBuffer:g||null});else{if(!l.allowSecondaryWebGL&&r&&r.canvas!==t)throw new Error("Only one WebGL target canvas allowed. Set allowSecondaryWebGL option to create secondary context.");this.render=w,X.logger.log("Unable to create WebGL context.")}E=!0}if(!E)for(_ in d)if(d.hasOwnProperty(_)&&d[_]&&T(_,t,l,!1))break;if(!E)throw new Error("Unknown target type");b&&((y=b.get(t))?X.logger.warn("Target already in use by another instance",t,Object.keys(y).map((function(e){return y[e]}))):(y={},b.set(t,y)),y[N.id]=N),this.target=t,this.transform=null,this.transformDirty=!0,this.flip=f,h&&(this.width=h),p&&(this.height=p),this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,void 0!==l.auto?this.auto=l.auto:this.auto=oe,this.frames=0,this.pub=new P(this),U.push(this),W[this.id]=this,J.push(this)},(E.prototype=Object.create(a.prototype)).constructor=E,E.prototype.setSource=function(e){var t;(t=pe(e))!==this.source&&(this.source&&this.source.removeTarget(this),this.source=t,t.addTarget(this),t&&(this.resize(),t.ready?this.setReady():this.setUnready()),this.setDirty())},E.prototype.setDirty=function(){this.dirty=!0,this.auto&&!k&&(k=A(he))},E.prototype.resize=function(){B(this.target,"HTMLCanvasElement")?this.width===this.target.width&&this.height===this.target.height||(this.target.width=this.width,this.target.height=this.height,this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.emit("resize"),this.setTransformDirty()):this.plugin&&this.plugin.resize&&this.plugin.resize.call(this),!this.source||this.source.width===this.width&&this.source.height===this.height||this.transform||(this.transform=new Float32Array(16))},E.prototype.setTransformDirty=function(){this.transformDirty=!0,this.setDirty()},E.prototype.go=function(){this.auto=!0,this.setDirty()},E.prototype.stop=function(){this.auto=!1},E.prototype.render=function(){r&&this.plugin&&this.plugin.render&&this.plugin.render.call(this,de,o,i)},E.prototype.renderWebGL=function(){var e,t,n;if(this.resize(),r&&this.dirty&&this.ready){if(!this.source)return;this.source.render(),this.uniforms.source=this.source.texture,this.source.width===this.width&&this.source.height===this.height?this.uniforms.transform=this.source.cumulativeMatrix||s:this.transformDirty&&(e=this.transform,M.copy(e,this.source.cumulativeMatrix||s),t=this.source.width/this.width,n=this.source.height/this.height,e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t,e[4]*=n,e[5]*=n,e[6]*=n,e[7]*=n,this.uniforms.transform=e,this.transformDirty=!1),de(o,i,this.uniforms,this.frameBuffer.frameBuffer,this,x),this.emit("render"),this.dirty=!1}},E.prototype.renderSecondaryWebGL=function(){var e,t,r,n,i;this.dirty&&this.ready&&this.source&&(this.emit("render"),this.source.render(!0),e=this.source.width,t=this.source.height,this.pixels&&this.pixels.length===e*t*4||(this.pixels=new Uint8Array(e*t*4)),this.source.readPixels(0,0,e,t,this.pixels),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,e,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.pixels),e===this.width&&t===this.height?this.uniforms.transform=s:this.transformDirty&&(r=this.transform,M.copy(r,s),n=this.source.width/this.width,i=this.source.height/this.height,r[0]*=n,r[1]*=n,r[2]*=n,r[3]*=n,r[4]*=i,r[5]*=i,r[6]*=i,r[7]*=i,this.uniforms.transform=r,this.transformDirty=!1),this.uniforms.source=this.texture,de(this.shader,this.model,this.uniforms,null,this,x),this.dirty=!1)},E.prototype.removeSource=function(e){this.source!==e&&this.source!==e.pub||(this.source=null)},E.prototype.destroy=function(){var e,r;this.source&&this.source.removeTarget&&this.source.removeTarget(this),b&&(delete(r=b.get(this.target))[N.id],Object.keys(r).length||b.delete(this.target)),this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),delete this.source,delete this.target,delete this.pub,delete this.uniforms,delete this.pixels,delete this.auto,(e=J.indexOf(this))>=0&&J.splice(e,1),a.prototype.destroy.call(this),this===n&&(t.removeEventListener("webglcontextrestored",le,!1),fe(),n=null)},C=function(e){var t,r=e,n=this;function i(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){return t.get.call(r)},set:function(n){!function(e,t,n){var i,o,s;i=r.inputElements[e],"string"==typeof n&&isNaN(n)&&("enum"===t.type?t.options.hasOwnProperty(n)||(n=L(n,["select"])):"number"===t.type||"boolean"===t.type?n=L(n,["input","select"]):"image"===t.type&&(n=L(n,["canvas","img","video"]))),B(n,"HTMLInputElement")||B(n,"HTMLSelectElement")?(o=n.value,i&&i.element!==n&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete r.inputElements[e],i=null),i||(i={element:n,listener:(s=n,function(){var t,i;t="checkbox"===n.type?n.checked:s.value,i=r.setInput(e,t),"color"===n.type&&(i=V(i)),i!==t&&(s.value=i)})},r.inputElements[e]=i,"range"===n.type?(n.addEventListener("input",i.listener,!0),n.addEventListener("change",i.listener,!0)):n.addEventListener("change",i.listener,!0)),i&&"checkbox"===n.type&&(o=n.checked)):(i&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete r.inputElements[e]),o=n),r.setInput(e,o)}(e,t,n)}})}function o(e){return function(){e.apply(r,arguments)&&r.setTransformDirty()}}for(t in Object.defineProperties(this,{transform:{enumerable:!0,configurable:!0,get:function(){return r.hook}},title:{enumerable:!0,configurable:!0,get:function(){return r.plugin.title||r.hook}},width:{enumerable:!0,configurable:!0,get:function(){return r.width}},height:{enumerable:!0,configurable:!0,get:function(){return r.height}},id:{enumerable:!0,configurable:!0,get:function(){return r.id}},source:{enumerable:!0,configurable:!0,get:function(){return r.source&&r.source.pub},set:function(e){r.setSource(e)}}}),r.methods)r.methods.hasOwnProperty(t)&&(this[t]=o(r.methods[t]));for(t in r.inputs)r.inputs.hasOwnProperty(t)&&i(t,r.inputs[t]);this.update=function(){r.setDirty()},this.inputs=function(e){var t,n,i,o;if(i=r.plugin.inputs,e)return!(n=i[e])||n.method?null:(t={type:n.type,defaultValue:n.defaultValue,title:n.title||e},"number"===n.type?(t.min=n.min,t.max=n.max,t.step=n.step,t.mod=n.mod):"enum"===n.type?t.options=F({},n.options):"vector"===n.type&&(t.dimensions=n.dimensions),n.description&&(t.description=n.description),t);for(o in t={},i)i.hasOwnProperty(o)&&!i[o].method&&(t[o]=this.inputs(o));return t},this.alias=function(e,t){return r.alias(e,t),this},this.on=function(e,t){r.on(e,t)},this.off=function(e,t){r.off(e,t)},this.destroy=function(){var e,t;for(e in r.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return r.isDestroyed},this.isReady=function(){return r.ready}},S=function(e,t){var r,n,i,o,s;for(r in this.matrix=new Float32Array(16),this.cumulativeMatrix=new Float32Array(16),this.ready=!1,this.width=1,this.height=1,this.seriously=N,this.transformRef=f[e],this.hook=e,this.id=q,q++,this.options=t,this.sources=null,this.targets=[],this.inputElements={},this.inputs={},this.methods={},this.listeners={},this.texture=null,this.frameBuffer=null,this.uniforms=null,this.dirty=!0,this.transformDirty=!0,this.renderDirty=!1,this.isDestroyed=!1,this.transformed=!1,this.plugin=F({},this.transformRef),this.transformRef.definition&&F(this.plugin,this.transformRef.definition.call(this,t)),this.plugin.inputs)this.plugin.inputs.hasOwnProperty(r)&&((n=this.plugin.inputs[r]).method&&"function"==typeof n.method?this.methods[r]=n.method:"function"==typeof n.set&&"function"==typeof n.get&&(this.inputs[r]=n));for(r in $(this.plugin),s=ne[e],this.plugin.inputs)this.plugin.inputs.hasOwnProperty(r)&&"function"==typeof(n=this.plugin.inputs[r]).set&&"function"==typeof n.get&&"function"!=typeof n.method&&(i=n.get.call(this),o=void 0===n.defaultValue?i:n.defaultValue,o=n.validate.call(this,o,n,i),s&&void 0!==s[r]&&(o=n.validate.call(this,s[r],n,n.defaultValue,o),s[r]=o),o!==i&&n.set.call(this,o));U.push(this),W[this.id]=this,this.pub=new C(this),Z.push(this),m[e].push(this)},S.prototype=Object.create(a.prototype),S.prototype.constructor=S,S.prototype.setDirty=function(){this.renderDirty=!0,a.prototype.setDirty.call(this)},S.prototype.setTransformDirty=function(){var e,t;for(this.transformDirty=!0,this.dirty=!0,this.renderDirty=!0,e=0;e<this.targets.length;e++)(t=this.targets[e]).setTransformDirty?t.setTransformDirty():t.setDirty()},S.prototype.resize=function(){var e;for(a.prototype.resize.call(this),this.plugin.resize&&this.plugin.resize.call(this),e=0;e<this.targets.length;e++)this.targets[e].resize();this.setTransformDirty()},S.prototype.setSource=function(e){var t;if((t=pe(e))!==this.source){if(ve(t,this))throw new Error("Attempt to make cyclical connection.");this.source&&this.source.removeTarget(this),this.source=t,t.addTarget(this),t&&t.ready?this.setReady():this.setUnready(),this.resize()}},S.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},S.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1),this.targets&&this.targets.length&&this.resize()},S.prototype.setInput=function(e,t){var r,n,i;if(this.plugin.inputs.hasOwnProperty(e))return r=this.plugin.inputs[e],n=ne[this.hook]&&void 0!==ne[this.hook][e]?ne[this.hook][e]:r.defaultValue,i=r.get.call(this),void 0===n&&(n=i),t=r.validate.call(this,t,r,n,i),r.set.call(this,t)&&this.setTransformDirty(),r.get.call(this)},S.prototype.alias=function(e,t){var r,n,i=this;if(D.indexOf(t)>=0)throw new Error("'"+t+"' is a reserved name and cannot be used as an alias.");return this.plugin.inputs.hasOwnProperty(e)&&(t||(t=e),N.removeAlias(t),(r=this.inputs[e])?(n=i.inputs[e],Object.defineProperty(N,t,{configurable:!0,enumerable:!0,get:function(){return n.get.call(i)},set:function(e){n.set.call(i,e)&&i.setTransformDirty()}})):(r=this.methods[e])&&(n=r,N[t]=function(){n.apply(i,arguments)&&i.setTransformDirty()}),r&&(ee[t]={node:this,input:e})),this},S.prototype.render=function(e){return this.source?(this.source.render(),this.transformDirty&&(this.transformed?this.source.cumulativeMatrix?M.multiply(this.cumulativeMatrix,this.matrix,this.source.cumulativeMatrix):M.copy(this.cumulativeMatrix,this.matrix):M.copy(this.cumulativeMatrix,this.source.cumulativeMatrix||s),this.transformDirty=!1),e&&r?(this.renderDirty&&(this.frameBuffer||(this.uniforms={resolution:[this.width,this.height]},this.frameBuffer=new Y(r,this.width,this.height)),this.uniforms.source=this.source.texture,this.uniforms.transform=this.cumulativeMatrix||s,de(o,i,this.uniforms,this.frameBuffer.frameBuffer,this),this.renderDirty=!1),this.texture=this.frameBuffer.texture):this.source?this.texture=this.source.texture:this.texture=null,this.dirty=!1,this.texture):(this.transformDirty&&(M.copy(this.cumulativeMatrix,this.matrix),this.transformDirty=!1),this.texture=null,void(this.dirty=!1))},S.prototype.readPixels=function(e,t,n,i,o){var s=this.gl||r;if(!r)throw new Error("Cannot read pixels until a canvas is connected");if(this.render(!0),void 0===o)o=new Uint8Array(n*i*4);else if(!B(o,"Uint8Array"))throw new Error("Incompatible array type");return s.bindFramebuffer(r.FRAMEBUFFER,this.frameBuffer.frameBuffer),s.readPixels(e,t,n,i,r.RGBA,r.UNSIGNED_BYTE,o),o},S.prototype.destroy=function(){var e,t,r,n=this.hook;for(e in this.plugin.destroy&&"function"==typeof this.plugin.destroy&&this.plugin.destroy.call(this),delete this.effect,this.frameBuffer&&(this.frameBuffer.destroy(),delete this.frameBuffer,delete this.texture),this.inputElements)this.inputElements.hasOwnProperty(e)&&((r=this.inputElements[e]).element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0));for(this.source&&this.source.removeTarget(this);this.targets.length;)(r=this.targets.pop())&&r.removeSource&&r.removeSource(this);for(t in this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];for(t in ee)ee.hasOwnProperty(t)&&(r=ee[t]).node===this&&N.removeAlias(t);(e=Z.indexOf(this))>=0&&Z.splice(e,1),(e=m[n].indexOf(this))>=0&&m[n].splice(e,1),a.prototype.destroy.call(this)},S.prototype.setReady=a.prototype.setReady,S.prototype.setUnready=a.prototype.setUnready,S.prototype.on=a.prototype.on,S.prototype.off=a.prototype.off,S.prototype.emit=a.prototype.emit,(e=B(e,"HTMLCanvasElement")?{canvas:e}:e||{}).canvas,this.effect=function(e,t){if(!l[e])throw new Error("Unknown effect: "+e);return new y(e,t).pub},this.source=function(e,t,r){return pe(e,t,r).pub},this.transform=function(t,r){if("string"!=typeof t&&(r=t,t=!1),t){if(!f[t])throw new Error("Unknown transform: "+t)}else if(t=e&&e.defaultTransform||"2d",!f[t])throw new Error("No transform specified");return new S(t,r).pub},this.target=function(e,t,r){var n,i,o;for(e&&"string"==typeof e&&!d[e]&&(i=document.querySelector(e)),("string"!=typeof e||!t&&0!==t||i)&&(r&&"object"==typeof r||(r=t),t=i||e,e=null),"string"==typeof t&&isNaN(t)&&(t=document.querySelector(t)),o=0;o<J.length;o++)if(n=J[o],(!e||e===n.hook)&&(n.target===t||n.compare&&n.compare(t,r)))return n.pub;return(n=new E(e,t,r)).pub},this.aliases=function(){return Object.keys(ee)},this.removeAlias=function(e){ee[e]&&(delete this[e],delete ee[e])},this.defaults=function(e,t){var r;if(e)if("object"!=typeof e)null===t?delete ne[e]:"object"==typeof t&&(ne[e]=F({},t));else for(r in e)e.hasOwnProperty(r)&&this.defaults(r,e[r]);else if(null===e)for(r in ne)ne.hasOwnProperty(r)&&delete ne[r]},this.go=function(e,t){var r;for("function"==typeof e&&te.indexOf(e)<0&&te.push(e),"function"==typeof t&&re.indexOf(t)<0&&re.push(t),oe=!0,r=0;r<J.length;r++)J[r].go();k||!te.length&&!re.length||he()},this.stop=function(){te.length=0,re.length=0,j(k),k=0},this.render=function(){var t;for(t=0;t<J.length;t++)J[t].render(e)},this.destroy=function(){for(var e,t;U.length;)U[0].pub.destroy();for(e in this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w);N=null,G=[],J=[],Q=[],U=[],te.length=0,re.length=0,j(k),k=0,se=!0},this.isDestroyed=function(){return se},this.incompatible=function(e){var t,r,n;if(n=X.incompatible(e))return n;if(!e){for(t in v)if(v.hasOwnProperty(t)&&v[t].length&&(r=l[t])&&"function"==typeof r.compatible&&!r.compatible.call(this))return"plugin-"+t;for(t in g)if(g.hasOwnProperty(t)&&g[t].length&&(r=h[t])&&"function"==typeof r.compatible&&!r.compatible.call(this))return"source-"+t}return!1},this.isNode=function(e){var t;return!(!e||!(t=W[e.id])||t.isDestroyed)},this.isSource=function(e){return this.isNode(e)&&e instanceof O},this.isEffect=function(e){return this.isNode(e)&&e instanceof T},this.isTransform=function(e){return this.isNode(e)&&e instanceof C},this.isTarget=function(e){return this.isNode(e)&&e instanceof P},Object.defineProperties(this,{id:{enumerable:!0,configurable:!0,get:function(){return I}}}),this.defaults(e.defaults)}window.addEventListener("message",(function(e){e.source===window&&"seriously-timeout-message"===e.data&&(e.stopPropagation(),p.length>0&&p.shift()())}),!0),Y.prototype.resize=function(e,t){var r=this.gl;this.width===e&&this.height===t||(this.width=e,this.height=t,r&&(r.bindTexture(r.TEXTURE_2D,this.texture),r.bindFramebuffer(r.FRAMEBUFFER,this.frameBuffer),r.bindRenderbuffer(r.RENDERBUFFER,this.renderBuffer),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e,t,0,r.RGBA,r.UNSIGNED_BYTE,null),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,e,t),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,this.texture,0),r.bindTexture(r.TEXTURE_2D,null),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindFramebuffer(r.FRAMEBUFFER,null)))},Y.prototype.destroy=function(){var e=this.gl;e&&(e.deleteFramebuffer(this.frameBuffer),e.deleteRenderbuffer(this.renderBuffer),this.ownTexture&&e.deleteTexture(this.texture)),delete this.frameBuffer,delete this.renderBuffer,delete this.texture,delete this.gl},K.prototype.use=function(){this.gl.useProgram(this.program)},X.incompatible=function(e){var t,r,n;if(void 0===o&&((t=document.createElement("canvas"))&&t.getContext?window.WebGLRenderingContext?(r=G())||(o="context"):o="webgl":o="canvas"),o)return o;if(e){if((n=l[e])&&"function"==typeof n.compatible&&!n.compatible(r))return"plugin-"+e;if((n=h[e])&&"function"==typeof n.compatible&&!n.compatible(r))return"source-"+e}return!1},X.plugin=function(e,t,r){var n;if(l[e])X.logger.warn("Effect ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r)return n=F({},r),"function"==typeof t&&(n.definition=t),n.reserved=k,n.inputs&&$(n),n.title||(n.title=e),l[e]=n,v[e]=[],n},X.removePlugin=function(e){var t;if(!e)return this;if(!l[e])return this;if(t=v[e]){for(;t.length;)t.shift().destroy();delete v[e]}return delete l[e],this},X.source=function(e,t,r){var n;if(h[e])X.logger.warn("Source ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r||t)return n=F({},r),"function"==typeof t&&(n.definition=t),n.title||(n.title=e),h[e]=n,g[e]=[],n},X.removeSource=function(e){var t;if(!e)return this;if(!h[e])return this;if(t=g[e]){for(;t.length;)t.shift().destroy();delete g[e]}return delete h[e],this},X.transform=function(e,t,r){var n;if(f[e])X.logger.warn("Transform ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r||t)return n=F({},r),"function"==typeof t&&(n.definition=t),n.reserved=I,n.inputs&&$(n),n.title||(n.title=e),f[e]=n,m[e]=[],n},X.removeTransform=function(e){var t;if(!e)return this;if(!f[e])return this;if(t=m[e]){for(;t.length;)t.shift().destroy();delete m[e]}return delete f[e],this},X.target=function(e,t,r){var n;if(d[e])X.logger.warn("Target ["+e+"] already loaded");else if(void 0===r&&"object"==typeof t&&(r=t),r||t)return n=F({},r),"function"==typeof t&&(n.definition=t),n.title||(n.title=e),d[e]=n,y[e]=[],n},X.removeTarget=function(e){var t;if(!e)return this;if(!d[e])return this;if(t=y[e]){for(;t.length;)t.shift().destroy();delete y[e]}return delete d[e],this},X.inputValidators={color:function(e,t,r,n){var o,s,a,u;if(s=n||[],"string"==typeof e){if((a=E.exec(e))&&a.length){if(a.length<3)return s[0]=s[1]=s[2]=s[3]=0,s;for(s[3]=1,u=0;u<3;u++)s[u]=parseFloat(a[u+2])/255;return isNaN(a[6])||(s[3]=parseFloat(a[6])),"hsl"===a[1].toLowerCase()?W(s[0],s[1],s[2],s[3],s):s}if((a=T.exec(e))&&a.length)return 3===(o=a[1]).length?(s[0]=parseInt(o[0],16)/15,s[1]=parseInt(o[1],16)/15,s[2]=parseInt(o[2],16)/15,s[3]=1):4===o.length?(s[0]=parseInt(o[0],16)/15,s[1]=parseInt(o[1],16)/15,s[2]=parseInt(o[2],16)/15,s[3]=parseInt(o[3],16)/15):6===o.length?(s[0]=parseInt(o.substr(0,2),16)/255,s[1]=parseInt(o.substr(2,2),16)/255,s[2]=parseInt(o.substr(4,2),16)/255,s[3]=1):8===o.length?(s[0]=parseInt(o.substr(0,2),16)/255,s[1]=parseInt(o.substr(2,2),16)/255,s[2]=parseInt(o.substr(4,2),16)/255,s[3]=parseInt(o.substr(6,2),16)/255):s[0]=s[1]=s[2]=s[3]=0,s;if(a=S[e.toLowerCase()]){for(u=0;u<4;u++)s[u]=a[u];return s}return i||(i=document.createElement("canvas").getContext("2d")),i.fillStyle=e,(o=i.fillStyle)&&"#000000"!==o?X.inputValidators.color(o,t,r,n):(s[0]=s[1]=s[2]=s[3]=0,s)}if(q(e)){if((s=e).length<3)return s[0]=s[1]=s[2]=s[3]=0,s;for(u=0;u<3;u++)if(isNaN(s[u]))return s[0]=s[1]=s[2]=s[3]=0,s;return s.length<4&&s.push(1),s}if("number"==typeof e)return s[0]=s[1]=s[2]=e,s[3]=1,s;if("object"==typeof e){for(u=0;u<4;u++)null===e[o=C[u]]||isNaN(e[o])?s[u]=3===u?1:0:s[u]=e[o];return s}return s[0]=s[1]=s[2]=s[3]=0,s},number:function(e,t,r){return e=parseFloat(e),isNaN(e)?r||0:(t.mod&&(e-=t.mod*Math.floor(e/t.mod)),e<t.min?t.min:e>t.max?t.max:t.step?Math.round(e/t.step)*t.step:e)},enum:function(e,t,r){var n=t.options||[];return"string"==typeof e?e=e.toLowerCase():"number"==typeof e?e=e.toString():e||(e=""),n.hasOwnProperty(e)?e:r||""},vector:function(e,t,r,n){var i,o,s,a=t.dimensions||4;if(i=n||[],q(e)){for(o=0;o<a;o++)i[o]=e[o]||0;return i}if("object"==typeof e){for(o=0;o<a;o++)void 0===e[s=O[o]]&&(s=C[o]),i[o]=e[s]||0;return i}for(e=parseFloat(e)||0,o=0;o<a;o++)i[o]=e;return i},boolean:function(e){return!(!e||e&&e.toLowerCase&&"false"===e.toLowerCase())},string:function(e){return"string"==typeof e?e:0===e||e?e.toString?e.toString():String(e):""}},X.prototype.effects=X.effects=function(){var e,t,r,n,i,o={};for(e in l)if(l.hasOwnProperty(e)){for(i in r={title:(t=l[e]).title||e,description:t.description||"",inputs:{}},t.inputs)t.inputs.hasOwnProperty(i)&&(n=t.inputs[i],r.inputs[i]={type:n.type,defaultValue:n.defaultValue,step:n.step,min:n.min,max:n.max,mod:n.mod,minCount:n.minCount,maxCount:n.maxCount,dimensions:n.dimensions,title:n.title||i,description:n.description||"",options:n.options||[]});o[e]=r}return o},window.Float32Array&&(s=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),window.Seriously&&"object"==typeof window.Seriously&&function(){var e;for(e in window.Seriously)window.Seriously.hasOwnProperty(e)&&"plugin"!==e&&"object"==typeof window.Seriously[e]&&X.plugin(e,window.Seriously[e])}(),X.logger={log:U("log"),info:U("info"),warn:U("warn"),error:U("error")},X.util={mat4:M,checkSource:function(e){var t,r,n,i;if(!(t=L(e,["img","canvas","video"])))return!1;if(!(r=document.createElement("canvas")))return X.logger.warn("Browser does not support canvas or Seriously.js"),!1;if(0===t.naturalWidth&&"IMG"===t.tagName)return X.logger.warn("Image not loaded"),!1;if(0===t.readyState&&0===t.videoWidth&&"VIDEO"===t.tagName)return X.logger.warn("Video not loaded"),!1;if(n=G()){(i=n.createTexture())||X.logger.error("Test WebGL context has been lost"),n.bindTexture(n.TEXTURE_2D,i);try{n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t)}catch(e){return e.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error storing image to texture: "+e.message),n.deleteTexture(i),!1}n.deleteTexture(i)}else{n=r.getContext("2d");try{n.drawImage(t,0,0),n.getImageData(0,0,1,1)}catch(e){return e.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error drawing image to canvas: "+e.message),!1}}return!0},hslToRgb:W,colors:S,setTimeoutZero:z,ShaderProgram:K,FrameBuffer:Y,requestAnimationFrame:A,shader:{makeNoise:"float makeNoise(float u, float v, float timer) {\n\tfloat x = u * v * mod(timer * 1000.0, 100.0);\n\tx = mod(x, 13.0) * mod(x, 127.0);\n\tfloat dx = mod(x, 0.01);\n\treturn clamp(0.1 + dx * 100.0, 0.0, 1.0);\n}\n",random:"#ifndef RANDOM\n#define RANDOM\nfloat random(vec2 n) {\n\treturn 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);\n}\n#endif\n"}},X.source("video",(function(e,t,r){var n,i,o=this,s=!1,u=!1,c=!1,l=0;function f(){e.removeEventListener("loadedmetadata",f,!0),s||(e.videoWidth?(o.width===e.videoWidth&&o.height===e.videoHeight||(o.width=e.videoWidth,o.height=e.videoHeight,o.resize()),u&&o.setReady()):(u=!0,setTimeout(f,50)))}function h(){c=!0}function d(){c=!1,o.setDirty()}if(B(e,"HTMLVideoElement"))return e.readyState?f():(u=!0,e.addEventListener("loadedmetadata",f,!0)),e.addEventListener("seeking",h,!1),e.addEventListener("seeked",d,!1),{deferTexture:u,source:e,render:function t(r){var s;if(l=e.currentTime,!e.videoHeight||!e.videoWidth)return!1;a?(i||(i=document.createElement("canvas").getContext("2d"),(n=i.canvas).width=o.width,n.height=o.height),s=n,i.drawImage(e,0,0,o.width,o.height)):s=e,r.bindTexture(r.TEXTURE_2D,o.texture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,o.flip),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,s),void 0===a){if(r.getError()===r.INVALID_VALUE)return a=!0,t(r);a=!1}return!0}catch(e){e.code===window.DOMException.SECURITY_ERR?(o.allowRefresh=!1,X.logger.error("Unable to access cross-domain image")):X.logger.error("Error rendering video source",e)}return!1},checkDirty:function(){return!c&&e.currentTime!==l},compare:function(e){return o.source===e},destroy:function(){s=!0,e.removeEventListener("seeking",h,!1),e.removeEventListener("seeked",d,!1),e.removeEventListener("loadedmetadata",f,!0)}}}),{title:"Video"}),X.transform("2d",(function(e){var t=this,r=!(e&&e.radians),n=0,i=0,o=1,s=1,a=0,u=0,c=0,l=0,f=0;function h(){var e,h,d,p,v,m,g,y,b,_,w,S=t.matrix;function E(e,t){S[12]=S[0]*e+S[4]*t+S[12],S[13]=S[1]*e+S[5]*t+S[13],S[14]=S[2]*e+S[6]*t+S[14],S[15]=S[3]*e+S[7]*t+S[15]}a||u||c||l||f||1!==o||1!==s?(M.identity(S),E(a+n,u+i),l&&(S[4]=l/t.width),f&&(S[1]=f/t.height),c&&(p=S[0],v=S[1],m=S[2],g=S[3],y=S[4],b=S[5],_=S[6],w=S[7],e=-(r?c*Math.PI/180:c),h=Math.sin(e),d=Math.cos(e),S[0]=p*d+y*h,S[1]=v*d+b*h,S[2]=m*d+_*h,S[3]=g*d+w*h,S[4]=y*d-p*h,S[5]=b*d-v*h,S[6]=_*d-m*h,S[7]=w*d-g*h),1!==o&&(S[0]*=o,S[1]*=o,S[2]*=o,S[3]*=o),1!==s&&(S[4]*=s,S[5]*=s,S[6]*=s,S[7]*=s),E(-n,-i),t.transformed=!0):t.transformed=!1}return{inputs:{reset:{method:function(){return n=0,i=0,o=1,s=1,a=0,u=0,c=0,l=0,f=0,!!t.transformed&&(t.transformed=!1,!0)}},translate:{method:function(e,t){return isNaN(e)&&(e=a),isNaN(t)&&(t=u),(e!==a||t!==u)&&(a=e,u=t,h(),!0)},type:["number","number"]},translateX:{get:function(){return a},set:function(e){return e!==a&&(a=e,h(),!0)},type:"number"},translateY:{get:function(){return u},set:function(e){return e!==u&&(u=e,h(),!0)},type:"number"},rotation:{get:function(){return c},set:function(e){return e!==c&&(c=parseFloat(e),h(),!0)},type:"number"},center:{method:function(e,t){return isNaN(e)&&(e=n),isNaN(t)&&(t=i),(e!==n||t!==i)&&(n=e,i=t,h(),!0)},type:["number","number"]},centerX:{get:function(){return n},set:function(e){return e!==n&&(n=e,h(),!0)},type:"number"},centerY:{get:function(){return i},set:function(e){return e!==i&&(i=e,h(),!0)},type:"number"},skew:{method:function(e,t){return isNaN(e)&&(e=l),isNaN(t)&&(t=f),(e!==l||t!==f)&&(l=e,f=t,h(),!0)},type:["number","number"]},skewX:{get:function(){return l},set:function(e){return e!==l&&(l=e,h(),!0)},type:"number"},skewY:{get:function(){return f},set:function(e){return e!==f&&(f=e,h(),!0)},type:"number"},scale:{method:function(e,t){var r,n;if(r=isNaN(e)?o:e,isNaN(t)){if(isNaN(e))return!1;n=r}else n=t;return(r!==o||n!==s)&&(o=r,s=n,h(),!0)},type:["number","number"]},scaleX:{get:function(){return o},set:function(e){return e!==o&&(o=e,h(),!0)},type:"number"},scaleY:{get:function(){return s},set:function(e){return e!==s&&(s=e,h(),!0)},type:"number"}}}}),{title:"2D Transform",description:"Translate, Rotate, Scale, Skew"}),X.transform("flip",(function(){var e=this,t=!0;function r(){var r=e.matrix;t?(r[0]=-1,r[5]=1):(r[0]=1,r[5]=-1)}return M.identity(e.matrix),r(),e.transformDirty=!0,e.transformed=!0,{inputs:{direction:{get:function(){return t?"horizontal":"vertical"},set:function(e){var n;return(n="vertical"!==e)!==t&&(t=n,r(),!0)},type:"string"}}}}),{title:"Flip",description:"Flip Horizontal/Vertical"}),X.transform("reformat",(function(){var e,t,r=this,n="contain";function i(){var i,o,s,a,u=r.matrix,c=e||r.width,l=t||r.height,f=r.source,h=f&&f.width||1,d=f&&f.height||1;"distort"===n||c===h&&l===d?r.transformed=!1:(s=h/d,a=c/l,"none"===n?(i=h/c,o=d/l):"width"===n||"contain"===n&&a<=s?(i=1,o=a/s):"height"===n||"contain"===n&&a>s?(i=s/a,o=1):a>s?(i=1,o=a/s):(i=s/a,o=1),1!==i||1!==o?(M.identity(u),1!==i&&(u[0]*=i,u[1]*=i,u[2]*=i,u[3]*=i),1!==o&&(u[4]*=o,u[5]*=o,u[6]*=o,u[7]*=o),r.transformed=!0):r.transformed=!1)}function o(){return e||r.source&&r.source.width||1}function s(){return t||r.source&&r.source.height||1}return this.resize=function(){var e,t=o(),r=s();if(this.width!==t||this.height!==r)for(this.width=t,this.height=r,this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=t,this.uniforms.resolution[1]=r),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(t,r),e=0;e<this.targets.length;e++)this.targets[e].resize();this.setTransformDirty(),i()},{inputs:{width:{get:o,set:function(t){return(t=Math.floor(t))===e||(e=t,this.resize()),!1},type:"number"},height:{get:s,set:function(e){return(e=Math.floor(e))===t||(t=e,this.resize()),!1},type:"number"},mode:{get:function(){return n},set:function(e){return e!==n&&(n=e,i(),!0)},type:"enum",options:["cover","contain","distort","width","height","none"]}}}}),{title:"Reformat",description:"Change output dimensions"}),u=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","void main(void) {","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tgl_Position.w = screenPosition.w;","\tvTexCoord = texCoord;","}\n"].join("\n"),c=["precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","void main(void) {","\t\tgl_FragColor = texture2D(source, vTexCoord);","}"].join("\n"),X.util.shader.noiseHelpers="#ifndef NOISE_HELPERS\n#define NOISE_HELPERS\nvec2 mod289(vec2 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 mod289(vec3 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 permute(vec3 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 permute(vec4 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat taylorInvSqrt(float r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n",X.util.shader.snoise2d="#ifndef NOISE2D\n#define NOISE2D\nfloat snoise(vec2 v) {\n\tconst vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n\t\t0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n\t\t-0.577350269189626, // -1.0 + 2.0 * C.x\n\t\t0.024390243902439); // 1.0 / 41.0\n\tvec2 i = floor(v + dot(v, C.yy));\n\tvec2 x0 = v - i + dot(i, C.xx);\n\tvec2 i1;\n\t//i1.x = step(x0.y, x0.x); // x0.x > x0.y ? 1.0 : 0.0\n\t//i1.y = 1.0 - i1.x;\n\ti1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n\t// x0 = x0 - 0.0 + 0.0 * C.xx ;\n\t// x1 = x0 - i1 + 1.0 * C.xx ;\n\t// x2 = x0 - 1.0 + 2.0 * C.xx ;\n\tvec4 x12 = x0.xyxy + C.xxzz;\n\tx12.xy -= i1;\n\ti = mod289(i); // Avoid truncation effects in permutation\n\tvec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0)) + i.x + vec3(0.0, i1.x, 1.0));\n\tvec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.0);\n\tm = m*m ;\n\tm = m*m ;\n\tvec3 x = 2.0 * fract(p * C.www) - 1.0;\n\tvec3 h = abs(x) - 0.5;\n\tvec3 ox = floor(x + 0.5);\n\tvec3 a0 = x - ox;\n\tm *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n\tvec3 g;\n\tg.x = a0.x * x0.x + h.x * x0.y;\n\tg.yz = a0.yz * x12.xz + h.yz * x12.yw;\n\treturn 130.0 * dot(m, g);\n}\n#endif\n",X.util.shader.snoise3d="#ifndef NOISE3D\n#define NOISE3D\nfloat snoise(vec3 v) {\n\tconst vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n\tconst vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\tvec3 i = floor(v + dot(v, C.yyy));\n\tvec3 x0 = v - i + dot(i, C.xxx) ;\n\tvec3 g = step(x0.yzx, x0.xyz);\n\tvec3 l = 1.0 - g;\n\tvec3 i1 = min(g.xyz, l.zxy);\n\tvec3 i2 = max(g.xyz, l.zxy);\n\t// x0 = x0 - 0.0 + 0.0 * C.xxx;\n\t// x1 = x0 - i1 + 1.0 * C.xxx;\n\t// x2 = x0 - i2 + 2.0 * C.xxx;\n\t// x3 = x0 - 1.0 + 3.0 * C.xxx;\n\tvec3 x1 = x0 - i1 + C.xxx;\n\tvec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n\tvec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\ti = mod289(i);\n\tvec4 p = permute(permute(permute(\n\t\t\t\t\t\ti.z + vec4(0.0, i1.z, i2.z, 1.0))\n\t\t\t\t\t\t+ i.y + vec4(0.0, i1.y, i2.y, 1.0))\n\t\t\t\t\t\t+ i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\tfloat n_ = 0.142857142857; // 1.0/7.0\n\tvec3 ns = n_ * D.wyz - D.xzx;\n\tvec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p, 7 * 7)\n\tvec4 x_ = floor(j * ns.z);\n\tvec4 y_ = floor(j - 7.0 * x_); // mod(j, N)\n\tvec4 x = x_ * ns.x + ns.yyyy;\n\tvec4 y = y_ * ns.x + ns.yyyy;\n\tvec4 h = 1.0 - abs(x) - abs(y);\n\tvec4 b0 = vec4(x.xy, y.xy);\n\tvec4 b1 = vec4(x.zw, y.zw);\n\t//vec4 s0 = vec4(lessThan(b0, 0.0)) * 2.0 - 1.0;\n\t//vec4 s1 = vec4(lessThan(b1, 0.0)) * 2.0 - 1.0;\n\tvec4 s0 = floor(b0) * 2.0 + 1.0;\n\tvec4 s1 = floor(b1) * 2.0 + 1.0;\n\tvec4 sh = -step(h, vec4(0.0));\n\tvec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy ;\n\tvec4 a1 = b1.xzyw + s1.xzyw * sh.zzww ;\n\tvec3 p0 = vec3(a0.xy, h.x);\n\tvec3 p1 = vec3(a0.zw, h.y);\n\tvec3 p2 = vec3(a1.xy, h.z);\n\tvec3 p3 = vec3(a1.zw, h.w);\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tvec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n\tm = m * m;\n\treturn 42.0 * dot(m*m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n#endif\n",X.util.shader.snoise4d="#ifndef NOISE4D\n#define NOISE4D\nvec4 grad4(float j, vec4 ip)\n\t{\n\tconst vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n\tvec4 p, s;\n\n\tp.xyz = floor(fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n\tp.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n\ts = vec4(lessThan(p, vec4(0.0)));\n\tp.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n\treturn p;\n\t}\n\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n\t{\n\tconst vec4 C = vec4(0.138196601125011, // (5 - sqrt(5))/20 G4\n\t\t\t\t\t\t0.276393202250021, // 2 * G4\n\t\t\t\t\t\t0.414589803375032, // 3 * G4\n\t\t\t\t\t\t-0.447213595499958); // -1 + 4 * G4\n\n\tvec4 i = floor(v + dot(v, vec4(F4)));\n\tvec4 x0 = v - i + dot(i, C.xxxx);\n\n\n\tvec4 i0;\n\tvec3 isX = step(x0.yzw, x0.xxx);\n\tvec3 isYZ = step(x0.zww, x0.yyz);\n\ti0.x = isX.x + isX.y + isX.z;\n\ti0.yzw = 1.0 - isX;\n\ti0.y += isYZ.x + isYZ.y;\n\ti0.zw += 1.0 - isYZ.xy;\n\ti0.z += isYZ.z;\n\ti0.w += 1.0 - isYZ.z;\n\n\tvec4 i3 = clamp(i0, 0.0, 1.0);\n\tvec4 i2 = clamp(i0 - 1.0, 0.0, 1.0);\n\tvec4 i1 = clamp(i0 - 2.0, 0.0, 1.0);\n\n\tvec4 x1 = x0 - i1 + C.xxxx;\n\tvec4 x2 = x0 - i2 + C.yyyy;\n\tvec4 x3 = x0 - i3 + C.zzzz;\n\tvec4 x4 = x0 + C.wwww;\n\n\ti = mod289(i);\n\tfloat j0 = permute(permute(permute(permute(i.w) + i.z) + i.y) + i.x);\n\tvec4 j1 = permute(permute(permute(permute (\n\t\t\t\t\ti.w + vec4(i1.w, i2.w, i3.w, 1.0))\n\t\t\t\t\t+ i.z + vec4(i1.z, i2.z, i3.z, 1.0))\n\t\t\t\t\t+ i.y + vec4(i1.y, i2.y, i3.y, 1.0))\n\t\t\t\t\t+ i.x + vec4(i1.x, i2.x, i3.x, 1.0));\n\n\tvec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n\tvec4 p0 = grad4(j0, ip);\n\tvec4 p1 = grad4(j1.x, ip);\n\tvec4 p2 = grad4(j1.y, ip);\n\tvec4 p3 = grad4(j1.z, ip);\n\tvec4 p4 = grad4(j1.w, ip);\n\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tp4 *= taylorInvSqrt(dot(p4, p4));\n\n\tvec3 m0 = max(0.6 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2)), 0.0);\n\tvec2 m1 = max(0.6 - vec2(dot(x3, x3), dot(x4, x4)), 0.0);\n\tm0 = m0 * m0;\n\tm1 = m1 * m1;\n\treturn 49.0 * (dot(m0*m0, vec3(dot(p0, x0), dot(p1, x1), dot(p2, x2)))\n\t\t\t\t\t\t\t+ dot(m1*m1, vec2(dot(p3, x3), dot(p4, x4)))) ;\n}\n#endif\n";const J=X},6303:(e,t,r)=>{"use strict";r.r(t),r(6551).default.plugin("chroma",{shader:function(e,t){return t.vertex=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","uniform vec4 screen;","uniform float balance;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat fmin = min(min(screen.r, screen.g), screen.b);","\tfloat fmax = max(max(screen.r, screen.g), screen.b);","\tfloat secondaryComponents;","\tscreenPrimary = step(fmax, screen.rgb);","\tsecondaryComponents = dot(1.0 - screenPrimary, screen.rgb);","\tscreenSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position = screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tvTexCoord = texCoord;","}"].join("\n"),t.fragment=[this.inputs.mask?"#define MASK":"","precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","uniform vec4 screen;","uniform float screenWeight;","uniform float balance;","uniform float clipBlack;","uniform float clipWhite;","uniform bool mask;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat pixelSat, secondaryComponents;","\tvec4 sourcePixel = texture2D(source, vTexCoord);","\tfloat fmin = min(min(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tfloat fmax = max(max(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tvec3 pixelPrimary = step(fmax, sourcePixel.rgb);","\tsecondaryComponents = dot(1.0 - pixelPrimary, sourcePixel.rgb);","\tpixelSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tfloat diffPrimary = dot(abs(pixelPrimary - screenPrimary), vec3(1.0));","\tfloat solid = step(1.0, step(pixelSat, 0.1) + step(fmax, 0.1) + diffPrimary);","\tfloat alpha = max(0.0, 1.0 - pixelSat / screenSat);","\talpha = smoothstep(clipBlack, clipWhite, alpha);","\tvec4 semiTransparentPixel = vec4((sourcePixel.rgb - (1.0 - alpha) * screen.rgb * screenWeight) / max(0.00001, alpha), alpha);","\tvec4 pixel = mix(semiTransparentPixel, sourcePixel, solid);","#ifdef MASK","\tgl_FragColor = vec4(vec3(pixel.a), 1.0);","#else","\tgl_FragColor = pixel;","#endif","}"].join("\n"),t},inPlace:!0,inputs:{source:{type:"image",uniform:"source"},screen:{type:"color",uniform:"screen",defaultValue:[66/255,195/255,31/255,1]},weight:{type:"number",uniform:"screenWeight",defaultValue:1,min:0},balance:{type:"number",uniform:"balance",defaultValue:1,min:0,max:1},clipBlack:{type:"number",uniform:"clipBlack",defaultValue:0,min:0,max:1},clipWhite:{type:"number",uniform:"clipWhite",defaultValue:1,min:0,max:1},mask:{type:"boolean",defaultValue:!1,uniform:"mask",shaderDirty:!0}},title:"Chroma Key",description:""})},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],u=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),l=0,f=u>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(u(e,a,a+s>c?c:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|v(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||X(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),a(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function v(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function _(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(X(n))return s;e[r+s]=n}return s}function w(e,t,r,n){return Y(G(t,e.length-r),e,r,n)}function S(e,t,r,n){return Y(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return Y($(t),e,r,n)}function T(e,t,r,n){return Y(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=x));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=v,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==l[e]){o=c[e],s=l[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function M(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=J[e[n]];return i}function A(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function j(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function I(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function D(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||j(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||j(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Z((function(e,t=0){return I(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Z((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Z((function(e,t=0){return I(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Z((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const U={};function B(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function W(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function V(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){q(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||z(t,e.length-(r+1))}(n,i,o)}function q(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,r){if(Math.floor(e)!==e)throw q(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=W(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=W(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function $(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},1227:(e,t,r)=>{var n=r(4155);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(2447)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(7824),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},2114:e=>{"use strict";function t(e,t){for(const r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0});return e}e.exports=function(e,r,n){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"==typeof r&&(n=r,r=""),r&&(n.code=r);try{return t(e,n)}catch(r){n.message=e.message,n.stack=e.stack;const i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(e)),t(new i,n)}}},7187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,s,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function v(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,l=p(u,c);for(r=0;r<c;++r)n(l[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},8806:function(e,t,r){!function(e){function t(){}function r(e,t){if(e=void 0===e?"utf-8":e,t=void 0===t?{fatal:!1}:t,-1===i.indexOf(e.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}function n(e){for(var t=0,r=Math.min(65536,e.length+1),n=new Uint16Array(r),i=[],o=0;;){var s=t<e.length;if(!s||o>=r-1){if(i.push(String.fromCharCode.apply(null,n.subarray(0,o))),!s)return i.join("");e=e.subarray(t),o=t=0}if(0==(128&(s=e[t++])))n[o++]=s;else if(192==(224&s)){var a=63&e[t++];n[o++]=(31&s)<<6|a}else if(224==(240&s)){a=63&e[t++];var u=63&e[t++];n[o++]=(31&s)<<12|a<<6|u}else 240==(248&s)&&(65535<(s=(7&s)<<18|(a=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++])&&(s-=65536,n[o++]=s>>>10&1023|55296,s=56320|1023&s),n[o++]=s)}}if(e.TextEncoder&&e.TextDecoder)return!1;var i=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var r=e.length,n=0,i=Math.max(32,r+(r>>>1)+7),o=new Uint8Array(i>>>3<<3);t<r;){var s=e.charCodeAt(t++);if(55296<=s&&56319>=s){if(t<r){var a=e.charCodeAt(t);56320==(64512&a)&&(++t,s=((1023&s)<<10)+(1023&a)+65536)}if(55296<=s&&56319>=s)continue}if(n+4>o.length&&(i+=8,i=(i*=1+t/e.length*2)>>>3<<3,(a=new Uint8Array(i)).set(o),o=a),0==(4294967168&s))o[n++]=s;else{if(0==(4294965248&s))o[n++]=s>>>6&31|192;else if(0==(4294901760&s))o[n++]=s>>>12&15|224,o[n++]=s>>>6&63|128;else{if(0!=(4292870144&s))continue;o[n++]=s>>>18&7|240,o[n++]=s>>>12&63|128,o[n++]=s>>>6&63|128}o[n++]=63&s|128}}return o.slice?o.slice(0,n):o.subarray(0,n)},Object.defineProperty(r.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(r.prototype,"fatal",{value:!1}),Object.defineProperty(r.prototype,"ignoreBOM",{value:!1});var o=n;"function"==typeof Buffer&&Buffer.from?o=function(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf-8")}:"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&(o=function(e){try{var t=URL.createObjectURL(new Blob([e],{type:"text/plain;charset=UTF-8"})),r=new XMLHttpRequest;return r.open("GET",t,!1),r.send(),r.responseText}catch(t){return n(e)}finally{t&&URL.revokeObjectURL(t)}}),r.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");return e=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),o(e)},e.TextEncoder=t,e.TextDecoder=r}("undefined"!=typeof window?window:void 0!==r.g?r.g:this)},5177:e=>{e.exports=function(){if("undefined"==typeof globalThis)return null;var e={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},645:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*v}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6486:function(e,t,r){var n;e=r.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",u=32,c=128,l=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],v="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",b="[object Error]",_="[object Function]",w="[object GeneratorFunction]",S="[object Map]",E="[object Number]",T="[object Object]",O="[object Promise]",C="[object RegExp]",x="[object Set]",P="[object String]",R="[object Symbol]",M="[object WeakMap]",A="[object ArrayBuffer]",j="[object DataView]",k="[object Float32Array]",I="[object Float64Array]",D="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",B="[object Uint16Array]",W="[object Uint32Array]",V=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,H=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,$=RegExp(H.source),Y=RegExp(G.source),K=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Te="a-z\\xdf-\\xf6\\xf8-\\xff",Oe="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\ufe0e\\ufe0f",xe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pe="["+we+"]",Re="["+xe+"]",Me="["+Se+"]",Ae="\\d+",je="["+Ee+"]",ke="["+Te+"]",Ie="[^"+we+xe+Ae+Ee+Te+Oe+"]",De="\\ud83c[\\udffb-\\udfff]",Ne="[^"+we+"]",Le="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Oe+"]",Be="\\u200d",We="(?:"+ke+"|"+Ie+")",Ve="(?:"+Ue+"|"+Ie+")",qe="(?:['’](?:d|ll|m|re|s|t|ve))?",ze="(?:['’](?:D|LL|M|RE|S|T|VE))?",He="(?:"+Me+"|"+De+")?",Ge="["+Ce+"]?",$e=Ge+He+"(?:"+Be+"(?:"+[Ne,Le,Fe].join("|")+")"+Ge+He+")*",Ye="(?:"+[je,Le,Fe].join("|")+")"+$e,Ke="(?:"+[Ne+Me+"?",Me,Le,Fe,Pe].join("|")+")",Xe=RegExp("['’]","g"),Je=RegExp(Me,"g"),Ze=RegExp(De+"(?="+De+")|"+Ke+$e,"g"),Qe=RegExp([Ue+"?"+ke+"+"+qe+"(?="+[Re,Ue,"$"].join("|")+")",Ve+"+"+ze+"(?="+[Re,Ue+We,"$"].join("|")+")",Ue+"?"+We+"+"+qe,Ue+"+"+ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,Ye].join("|"),"g"),et=RegExp("["+Be+we+Se+Ce+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,it={};it[k]=it[I]=it[D]=it[N]=it[L]=it[F]=it[U]=it[B]=it[W]=!0,it[v]=it[m]=it[A]=it[g]=it[j]=it[y]=it[b]=it[_]=it[S]=it[E]=it[T]=it[C]=it[x]=it[P]=it[M]=!1;var ot={};ot[v]=ot[m]=ot[A]=ot[j]=ot[g]=ot[y]=ot[k]=ot[I]=ot[D]=ot[N]=ot[L]=ot[S]=ot[E]=ot[T]=ot[C]=ot[x]=ot[P]=ot[R]=ot[F]=ot[U]=ot[B]=ot[W]=!0,ot[b]=ot[_]=ot[M]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,ut=parseInt,ct="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,lt="object"==typeof self&&self&&self.Object===Object&&self,ft=ct||lt||Function("return this")(),ht=t&&!t.nodeType&&t,dt=ht&&e&&!e.nodeType&&e,pt=dt&&dt.exports===ht,vt=pt&&ct.process,mt=function(){try{return dt&&dt.require&&dt.require("util").types||vt&&vt.binding&&vt.binding("util")}catch(e){}}(),gt=mt&&mt.isArrayBuffer,yt=mt&&mt.isDate,bt=mt&&mt.isMap,_t=mt&&mt.isRegExp,wt=mt&&mt.isSet,St=mt&&mt.isTypedArray;function Et(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Tt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(n,s,r(s),e)}return n}function Ot(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function Ct(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function xt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Pt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Rt(e,t){return!(null==e||!e.length)&&Ut(e,t,0)>-1}function Mt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function At(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function jt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function kt(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function It(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Dt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Nt=qt("length");function Lt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Ft(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ut(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Ft(e,Wt,r)}function Bt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Wt(e){return e!=e}function Vt(e,t){var r=null==e?0:e.length;return r?Gt(e,t)/r:h}function qt(e){return function(t){return null==t?i:t[e]}}function zt(e){return function(t){return null==e?i:e[t]}}function Ht(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Gt(e,t){for(var r,n=-1,o=e.length;++n<o;){var s=t(e[n]);s!==i&&(r=r===i?s:r+s)}return r}function $t(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Yt(e){return e?e.slice(0,fr(e)+1).replace(ne,""):e}function Kt(e){return function(t){return e(t)}}function Xt(e,t){return At(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function Zt(e,t){for(var r=-1,n=e.length;++r<n&&Ut(t,e[r],0)>-1;);return r}function Qt(e,t){for(var r=e.length;r--&&Ut(t,e[r],0)>-1;);return r}var er=zt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tr=zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rr(e){return"\\"+st[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function or(e,t){return function(r){return e(t(r))}}function sr(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r];s!==t&&s!==a||(e[r]=a,o[i++]=r)}return o}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function ur(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function cr(e){return nr(e)?function(e){for(var t=Ze.lastIndex=0;Ze.test(e);)++t;return t}(e):Nt(e)}function lr(e){return nr(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.split("")}(e)}function fr(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var hr=zt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),dr=function e(t){var r,n=(t=null==t?ft:dr.defaults(ft.Object(),t,dr.pick(ft,rt))).Array,ie=t.Date,we=t.Error,Se=t.Function,Ee=t.Math,Te=t.Object,Oe=t.RegExp,Ce=t.String,xe=t.TypeError,Pe=n.prototype,Re=Se.prototype,Me=Te.prototype,Ae=t["__core-js_shared__"],je=Re.toString,ke=Me.hasOwnProperty,Ie=0,De=(r=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Ne=Me.toString,Le=je.call(Te),Fe=ft._,Ue=Oe("^"+je.call(ke).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=pt?t.Buffer:i,We=t.Symbol,Ve=t.Uint8Array,qe=Be?Be.allocUnsafe:i,ze=or(Te.getPrototypeOf,Te),He=Te.create,Ge=Me.propertyIsEnumerable,$e=Pe.splice,Ye=We?We.isConcatSpreadable:i,Ke=We?We.iterator:i,Ze=We?We.toStringTag:i,et=function(){try{var e=uo(Te,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==ft.Date.now&&ie.now,lt=t.setTimeout!==ft.setTimeout&&t.setTimeout,ht=Ee.ceil,dt=Ee.floor,vt=Te.getOwnPropertySymbols,mt=Be?Be.isBuffer:i,Nt=t.isFinite,zt=Pe.join,pr=or(Te.keys,Te),vr=Ee.max,mr=Ee.min,gr=ie.now,yr=t.parseInt,br=Ee.random,_r=Pe.reverse,wr=uo(t,"DataView"),Sr=uo(t,"Map"),Er=uo(t,"Promise"),Tr=uo(t,"Set"),Or=uo(t,"WeakMap"),Cr=uo(Te,"create"),xr=Or&&new Or,Pr={},Rr=Lo(wr),Mr=Lo(Sr),Ar=Lo(Er),jr=Lo(Tr),kr=Lo(Or),Ir=We?We.prototype:i,Dr=Ir?Ir.valueOf:i,Nr=Ir?Ir.toString:i;function Lr(e){if(ea(e)&&!qs(e)&&!(e instanceof Wr)){if(e instanceof Br)return e;if(ke.call(e,"__wrapped__"))return Fo(e)}return new Br(e)}var Fr=function(){function e(){}return function(t){if(!Qs(t))return{};if(He)return He(t);e.prototype=t;var r=new e;return e.prototype=i,r}}();function Ur(){}function Br(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Wr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Vr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function qr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Hr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new zr;++t<r;)this.add(e[t])}function Gr(e){var t=this.__data__=new qr(e);this.size=t.size}function $r(e,t){var r=qs(e),n=!r&&Vs(e),i=!r&&!n&&$s(e),o=!r&&!n&&!i&&ua(e),s=r||n||i||o,a=s?$t(e.length,Ce):[],u=a.length;for(var c in e)!t&&!ke.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mo(c,u))||a.push(c);return a}function Yr(e){var t=e.length;return t?e[Hn(0,t-1)]:i}function Kr(e,t){return jo(Ci(e),on(t,0,e.length))}function Xr(e){return jo(Ci(e))}function Jr(e,t,r){(r!==i&&!Us(e[t],r)||r===i&&!(t in e))&&rn(e,t,r)}function Zr(e,t,r){var n=e[t];ke.call(e,t)&&Us(n,r)&&(r!==i||t in e)||rn(e,t,r)}function Qr(e,t){for(var r=e.length;r--;)if(Us(e[r][0],t))return r;return-1}function en(e,t,r,n){return ln(e,(function(e,i,o){t(n,e,r(e),o)})),n}function tn(e,t){return e&&xi(t,Ma(t),e)}function rn(e,t,r){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function nn(e,t){for(var r=-1,o=t.length,s=n(o),a=null==e;++r<o;)s[r]=a?i:Oa(e,t[r]);return s}function on(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function sn(e,t,r,n,o,s){var a,u=1&t,c=2&t,l=4&t;if(r&&(a=o?r(e,n,o,s):r(e)),a!==i)return a;if(!Qs(e))return e;var f=qs(e);if(f){if(a=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&ke.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!u)return Ci(e,a)}else{var h=fo(e),d=h==_||h==w;if($s(e))return _i(e,u);if(h==T||h==v||d&&!o){if(a=c||d?{}:po(e),!u)return c?function(e,t){return xi(e,lo(e),t)}(e,function(e,t){return e&&xi(t,Aa(t),e)}(a,e)):function(e,t){return xi(e,co(e),t)}(e,tn(a,e))}else{if(!ot[h])return o?e:{};a=function(e,t,r){var n,i=e.constructor;switch(t){case A:return wi(e);case g:case y:return new i(+e);case j:return function(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case k:case I:case D:case N:case L:case F:case U:case B:case W:return Si(e,r);case S:return new i;case E:case P:return new i(e);case C:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case x:return new i;case R:return n=e,Dr?Te(Dr.call(n)):{}}}(e,h,u)}}s||(s=new Gr);var p=s.get(e);if(p)return p;s.set(e,a),oa(e)?e.forEach((function(n){a.add(sn(n,t,r,n,e,s))})):ta(e)&&e.forEach((function(n,i){a.set(i,sn(n,t,r,i,e,s))}));var m=f?i:(l?c?to:eo:c?Aa:Ma)(e);return Ot(m||e,(function(n,i){m&&(n=e[i=n]),Zr(a,i,sn(n,t,r,i,e,s))})),a}function an(e,t,r){var n=r.length;if(null==e)return!n;for(e=Te(e);n--;){var o=r[n],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function un(e,t,r){if("function"!=typeof e)throw new xe(o);return Po((function(){e.apply(i,r)}),t)}function cn(e,t,r,n){var i=-1,o=Rt,s=!0,a=e.length,u=[],c=t.length;if(!a)return u;r&&(t=At(t,Kt(r))),n?(o=Mt,s=!1):t.length>=200&&(o=Jt,s=!1,t=new Hr(t));e:for(;++i<a;){var l=e[i],f=null==r?l:r(l);if(l=n||0!==l?l:0,s&&f==f){for(var h=c;h--;)if(t[h]===f)continue e;u.push(l)}else o(t,f,n)||u.push(l)}return u}Lr.templateSettings={escape:K,evaluate:X,interpolate:J,variable:"",imports:{_:Lr}},Lr.prototype=Ur.prototype,Lr.prototype.constructor=Lr,Br.prototype=Fr(Ur.prototype),Br.prototype.constructor=Br,Wr.prototype=Fr(Ur.prototype),Wr.prototype.constructor=Wr,Vr.prototype.clear=function(){this.__data__=Cr?Cr(null):{},this.size=0},Vr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Vr.prototype.get=function(e){var t=this.__data__;if(Cr){var r=t[e];return r===s?i:r}return ke.call(t,e)?t[e]:i},Vr.prototype.has=function(e){var t=this.__data__;return Cr?t[e]!==i:ke.call(t,e)},Vr.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Cr&&t===i?s:t,this},qr.prototype.clear=function(){this.__data__=[],this.size=0},qr.prototype.delete=function(e){var t=this.__data__,r=Qr(t,e);return!(r<0||(r==t.length-1?t.pop():$e.call(t,r,1),--this.size,0))},qr.prototype.get=function(e){var t=this.__data__,r=Qr(t,e);return r<0?i:t[r][1]},qr.prototype.has=function(e){return Qr(this.__data__,e)>-1},qr.prototype.set=function(e,t){var r=this.__data__,n=Qr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},zr.prototype.clear=function(){this.size=0,this.__data__={hash:new Vr,map:new(Sr||qr),string:new Vr}},zr.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},zr.prototype.get=function(e){return so(this,e).get(e)},zr.prototype.has=function(e){return so(this,e).has(e)},zr.prototype.set=function(e,t){var r=so(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Hr.prototype.add=Hr.prototype.push=function(e){return this.__data__.set(e,s),this},Hr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.clear=function(){this.__data__=new qr,this.size=0},Gr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Gr.prototype.get=function(e){return this.__data__.get(e)},Gr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof qr){var n=r.__data__;if(!Sr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new zr(n)}return r.set(e,t),this.size=r.size,this};var ln=Mi(yn),fn=Mi(bn,!0);function hn(e,t){var r=!0;return ln(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function dn(e,t,r){for(var n=-1,o=e.length;++n<o;){var s=e[n],a=t(s);if(null!=a&&(u===i?a==a&&!aa(a):r(a,u)))var u=a,c=s}return c}function pn(e,t){var r=[];return ln(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function vn(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=vo),i||(i=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?vn(a,t-1,r,n,i):jt(i,a):n||(i[i.length]=a)}return i}var mn=Ai(),gn=Ai(!0);function yn(e,t){return e&&mn(e,t,Ma)}function bn(e,t){return e&&gn(e,t,Ma)}function _n(e,t){return Pt(t,(function(t){return Xs(e[t])}))}function wn(e,t){for(var r=0,n=(t=mi(t,e)).length;null!=e&&r<n;)e=e[No(t[r++])];return r&&r==n?e:i}function Sn(e,t,r){var n=t(e);return qs(e)?n:jt(n,r(e))}function En(e){return null==e?e===i?"[object Undefined]":"[object Null]":Ze&&Ze in Te(e)?function(e){var t=ke.call(e,Ze),r=e[Ze];try{e[Ze]=i;var n=!0}catch(e){}var o=Ne.call(e);return n&&(t?e[Ze]=r:delete e[Ze]),o}(e):function(e){return Ne.call(e)}(e)}function Tn(e,t){return e>t}function On(e,t){return null!=e&&ke.call(e,t)}function Cn(e,t){return null!=e&&t in Te(e)}function xn(e,t,r){for(var o=r?Mt:Rt,s=e[0].length,a=e.length,u=a,c=n(a),l=1/0,f=[];u--;){var h=e[u];u&&t&&(h=At(h,Kt(t))),l=mr(h.length,l),c[u]=!r&&(t||s>=120&&h.length>=120)?new Hr(u&&h):i}h=e[0];var d=-1,p=c[0];e:for(;++d<s&&f.length<l;){var v=h[d],m=t?t(v):v;if(v=r||0!==v?v:0,!(p?Jt(p,m):o(f,m,r))){for(u=a;--u;){var g=c[u];if(!(g?Jt(g,m):o(e[u],m,r)))continue e}p&&p.push(m),f.push(v)}}return f}function Pn(e,t,r){var n=null==(e=Oo(e,t=mi(t,e)))?e:e[No(Ko(t))];return null==n?i:Et(n,e,r)}function Rn(e){return ea(e)&&En(e)==v}function Mn(e,t,r,n,o){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,r,n,o,s){var a=qs(e),u=qs(t),c=a?m:fo(e),l=u?m:fo(t),f=(c=c==v?T:c)==T,h=(l=l==v?T:l)==T,d=c==l;if(d&&$s(e)){if(!$s(t))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new Gr),a||ua(e)?Zi(e,t,r,n,o,s):function(e,t,r,n,i,o,s){switch(r){case j:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case g:case y:case E:return Us(+e,+t);case b:return e.name==t.name&&e.message==t.message;case C:case P:return e==t+"";case S:var a=ir;case x:var u=1&n;if(a||(a=ar),e.size!=t.size&&!u)return!1;var c=s.get(e);if(c)return c==t;n|=2,s.set(e,t);var l=Zi(a(e),a(t),n,i,o,s);return s.delete(e),l;case R:if(Dr)return Dr.call(e)==Dr.call(t)}return!1}(e,t,c,r,n,o,s);if(!(1&r)){var p=f&&ke.call(e,"__wrapped__"),_=h&&ke.call(t,"__wrapped__");if(p||_){var w=p?e.value():e,O=_?t.value():t;return s||(s=new Gr),o(w,O,r,n,s)}}return!!d&&(s||(s=new Gr),function(e,t,r,n,o,s){var a=1&r,u=eo(e),c=u.length;if(c!=eo(t).length&&!a)return!1;for(var l=c;l--;){var f=u[l];if(!(a?f in t:ke.call(t,f)))return!1}var h=s.get(e),d=s.get(t);if(h&&d)return h==t&&d==e;var p=!0;s.set(e,t),s.set(t,e);for(var v=a;++l<c;){var m=e[f=u[l]],g=t[f];if(n)var y=a?n(g,m,f,t,e,s):n(m,g,f,e,t,s);if(!(y===i?m===g||o(m,g,r,n,s):y)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=e.constructor,_=t.constructor;b==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,r,n,o,s))}(e,t,r,n,Mn,o))}function An(e,t,r,n){var o=r.length,s=o,a=!n;if(null==e)return!s;for(e=Te(e);o--;){var u=r[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<s;){var c=(u=r[o])[0],l=e[c],f=u[1];if(a&&u[2]){if(l===i&&!(c in e))return!1}else{var h=new Gr;if(n)var d=n(l,f,c,e,t,h);if(!(d===i?Mn(f,l,3,n,h):d))return!1}}return!0}function jn(e){return!(!Qs(e)||(t=e,De&&De in t))&&(Xs(e)?Ue:ve).test(Lo(e));var t}function kn(e){return"function"==typeof e?e:null==e?ru:"object"==typeof e?qs(e)?Fn(e[0],e[1]):Ln(e):fu(e)}function In(e){if(!wo(e))return pr(e);var t=[];for(var r in Te(e))ke.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Dn(e,t){return e<t}function Nn(e,t){var r=-1,i=Hs(e)?n(e.length):[];return ln(e,(function(e,n,o){i[++r]=t(e,n,o)})),i}function Ln(e){var t=ao(e);return 1==t.length&&t[0][2]?Eo(t[0][0],t[0][1]):function(r){return r===e||An(r,e,t)}}function Fn(e,t){return yo(e)&&So(t)?Eo(No(e),t):function(r){var n=Oa(r,e);return n===i&&n===t?Ca(r,e):Mn(t,n,3)}}function Un(e,t,r,n,o){e!==t&&mn(t,(function(s,a){if(o||(o=new Gr),Qs(s))!function(e,t,r,n,o,s,a){var u=Co(e,r),c=Co(t,r),l=a.get(c);if(l)Jr(e,r,l);else{var f=s?s(u,c,r+"",e,t,a):i,h=f===i;if(h){var d=qs(c),p=!d&&$s(c),v=!d&&!p&&ua(c);f=c,d||p||v?qs(u)?f=u:Gs(u)?f=Ci(u):p?(h=!1,f=_i(c,!0)):v?(h=!1,f=Si(c,!0)):f=[]:na(c)||Vs(c)?(f=u,Vs(u)?f=ma(u):Qs(u)&&!Xs(u)||(f=po(c))):h=!1}h&&(a.set(c,f),o(f,c,n,s,a),a.delete(c)),Jr(e,r,f)}}(e,t,a,r,Un,n,o);else{var u=n?n(Co(e,a),s,a+"",e,t,o):i;u===i&&(u=s),Jr(e,a,u)}}),Aa)}function Bn(e,t){var r=e.length;if(r)return mo(t+=t<0?r:0,r)?e[t]:i}function Wn(e,t,r){t=t.length?At(t,(function(e){return qs(e)?function(t){return wn(t,1===e.length?e[0]:e)}:e})):[ru];var n=-1;t=At(t,Kt(oo()));var i=Nn(e,(function(e,r,i){var o=At(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var n=e.length;for(e.sort((function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,s=i.length,a=r.length;++n<s;){var u=Ei(i[n],o[n]);if(u)return n>=a?u:u*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(i)}function Vn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var s=t[n],a=wn(e,s);r(a,s)&&Xn(o,mi(s,e),a)}return o}function qn(e,t,r,n){var i=n?Bt:Ut,o=-1,s=t.length,a=e;for(e===t&&(t=Ci(t)),r&&(a=At(e,Kt(r)));++o<s;)for(var u=0,c=t[o],l=r?r(c):c;(u=i(a,l,u,n))>-1;)a!==e&&$e.call(a,u,1),$e.call(e,u,1);return e}function zn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;mo(i)?$e.call(e,i,1):ui(e,i)}}return e}function Hn(e,t){return e+dt(br()*(t-e+1))}function Gn(e,t){var r="";if(!e||t<1||t>f)return r;do{t%2&&(r+=e),(t=dt(t/2))&&(e+=e)}while(t);return r}function $n(e,t){return Ro(To(e,t,ru),e+"")}function Yn(e){return Yr(Ua(e))}function Kn(e,t){var r=Ua(e);return jo(r,on(t,0,r.length))}function Xn(e,t,r,n){if(!Qs(e))return e;for(var o=-1,s=(t=mi(t,e)).length,a=s-1,u=e;null!=u&&++o<s;){var c=No(t[o]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var f=u[c];(l=n?n(f,c,u):i)===i&&(l=Qs(f)?f:mo(t[o+1])?[]:{})}Zr(u,c,l),u=u[c]}return e}var Jn=xr?function(e,t){return xr.set(e,t),e}:ru,Zn=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Qa(t),writable:!0})}:ru;function Qn(e){return jo(Ua(e))}function ei(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=n(o);++i<o;)s[i]=e[i+t];return s}function ti(e,t){var r;return ln(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ri(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,s=e[o];null!==s&&!aa(s)&&(r?s<=t:s<t)?n=o+1:i=o}return i}return ni(e,t,ru,r)}function ni(e,t,r,n){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=r(t))!=t,u=null===t,c=aa(t),l=t===i;o<s;){var f=dt((o+s)/2),h=r(e[f]),d=h!==i,p=null===h,v=h==h,m=aa(h);if(a)var g=n||v;else g=l?v&&(n||d):u?v&&d&&(n||!p):c?v&&d&&!p&&(n||!m):!p&&!m&&(n?h<=t:h<t);g?o=f+1:s=f}return mr(s,4294967294)}function ii(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r],a=t?t(s):s;if(!r||!Us(a,u)){var u=a;o[i++]=0===s?0:s}}return o}function oi(e){return"number"==typeof e?e:aa(e)?h:+e}function si(e){if("string"==typeof e)return e;if(qs(e))return At(e,si)+"";if(aa(e))return Nr?Nr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,r){var n=-1,i=Rt,o=e.length,s=!0,a=[],u=a;if(r)s=!1,i=Mt;else if(o>=200){var c=t?null:Gi(e);if(c)return ar(c);s=!1,i=Jt,u=new Hr}else u=t?[]:a;e:for(;++n<o;){var l=e[n],f=t?t(l):l;if(l=r||0!==l?l:0,s&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue e;t&&u.push(f),a.push(l)}else i(u,f,r)||(u!==a&&u.push(f),a.push(l))}return a}function ui(e,t){return null==(e=Oo(e,t=mi(t,e)))||delete e[No(Ko(t))]}function ci(e,t,r,n){return Xn(e,t,r(wn(e,t)),n)}function li(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ei(e,n?0:o,n?o+1:i):ei(e,n?o+1:0,n?i:o)}function fi(e,t){var r=e;return r instanceof Wr&&(r=r.value()),kt(t,(function(e,t){return t.func.apply(t.thisArg,jt([e],t.args))}),r)}function hi(e,t,r){var i=e.length;if(i<2)return i?ai(e[0]):[];for(var o=-1,s=n(i);++o<i;)for(var a=e[o],u=-1;++u<i;)u!=o&&(s[o]=cn(s[o]||a,e[u],t,r));return ai(vn(s,1),t,r)}function di(e,t,r){for(var n=-1,o=e.length,s=t.length,a={};++n<o;){var u=n<s?t[n]:i;r(a,e[n],u)}return a}function pi(e){return Gs(e)?e:[]}function vi(e){return"function"==typeof e?e:ru}function mi(e,t){return qs(e)?e:yo(e,t)?[e]:Do(ga(e))}var gi=$n;function yi(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:ei(e,t,r)}var bi=st||function(e){return ft.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var r=e.length,n=qe?qe(r):new e.constructor(r);return e.copy(n),n}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function Si(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ei(e,t){if(e!==t){var r=e!==i,n=null===e,o=e==e,s=aa(e),a=t!==i,u=null===t,c=t==t,l=aa(t);if(!u&&!l&&!s&&e>t||s&&a&&c&&!u&&!l||n&&a&&c||!r&&c||!o)return 1;if(!n&&!s&&!l&&e<t||l&&r&&o&&!n&&!s||u&&r&&o||!a&&o||!c)return-1}return 0}function Ti(e,t,r,i){for(var o=-1,s=e.length,a=r.length,u=-1,c=t.length,l=vr(s-a,0),f=n(c+l),h=!i;++u<c;)f[u]=t[u];for(;++o<a;)(h||o<s)&&(f[r[o]]=e[o]);for(;l--;)f[u++]=e[o++];return f}function Oi(e,t,r,i){for(var o=-1,s=e.length,a=-1,u=r.length,c=-1,l=t.length,f=vr(s-u,0),h=n(f+l),d=!i;++o<f;)h[o]=e[o];for(var p=o;++c<l;)h[p+c]=t[c];for(;++a<u;)(d||o<s)&&(h[p+r[a]]=e[o++]);return h}function Ci(e,t){var r=-1,i=e.length;for(t||(t=n(i));++r<i;)t[r]=e[r];return t}function xi(e,t,r,n){var o=!r;r||(r={});for(var s=-1,a=t.length;++s<a;){var u=t[s],c=n?n(r[u],e[u],u,r,e):i;c===i&&(c=e[u]),o?rn(r,u,c):Zr(r,u,c)}return r}function Pi(e,t){return function(r,n){var i=qs(r)?Tt:en,o=t?t():{};return i(r,e,oo(n,2),o)}}function Ri(e){return $n((function(t,r){var n=-1,o=r.length,s=o>1?r[o-1]:i,a=o>2?r[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&go(r[0],r[1],a)&&(s=o<3?i:s,o=1),t=Te(t);++n<o;){var u=r[n];u&&e(t,u,n,s)}return t}))}function Mi(e,t){return function(r,n){if(null==r)return r;if(!Hs(r))return e(r,n);for(var i=r.length,o=t?i:-1,s=Te(r);(t?o--:++o<i)&&!1!==n(s[o],o,s););return r}}function Ai(e){return function(t,r,n){for(var i=-1,o=Te(t),s=n(t),a=s.length;a--;){var u=s[e?a:++i];if(!1===r(o[u],u,o))break}return t}}function ji(e){return function(t){var r=nr(t=ga(t))?lr(t):i,n=r?r[0]:t.charAt(0),o=r?yi(r,1).join(""):t.slice(1);return n[e]()+o}}function ki(e){return function(t){return kt(Xa(Va(t).replace(Xe,"")),e,"")}}function Ii(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Fr(e.prototype),n=e.apply(r,t);return Qs(n)?n:r}}function Di(e){return function(t,r,n){var o=Te(t);if(!Hs(t)){var s=oo(r,3);t=Ma(t),r=function(e){return s(o[e],e,o)}}var a=e(t,r,n);return a>-1?o[s?t[a]:a]:i}}function Ni(e){return Qi((function(t){var r=t.length,n=r,s=Br.prototype.thru;for(e&&t.reverse();n--;){var a=t[n];if("function"!=typeof a)throw new xe(o);if(s&&!u&&"wrapper"==no(a))var u=new Br([],!0)}for(n=u?n:r;++n<r;){var c=no(a=t[n]),l="wrapper"==c?ro(a):i;u=l&&bo(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[no(l[0])].apply(u,l[3]):1==a.length&&bo(a)?u[c]():u.thru(a)}return function(){var e=arguments,n=e[0];if(u&&1==e.length&&qs(n))return u.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}}))}function Li(e,t,r,o,s,a,u,l,f,h){var d=t&c,p=1&t,v=2&t,m=24&t,g=512&t,y=v?i:Ii(e);return function c(){for(var b=arguments.length,_=n(b),w=b;w--;)_[w]=arguments[w];if(m)var S=io(c),E=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(_,S);if(o&&(_=Ti(_,o,s,m)),a&&(_=Oi(_,a,u,m)),b-=E,m&&b<h){var T=sr(_,S);return zi(e,t,Li,c.placeholder,r,_,T,l,f,h-b)}var O=p?r:this,C=v?O[e]:e;return b=_.length,l?_=function(e,t){for(var r=e.length,n=mr(t.length,r),o=Ci(e);n--;){var s=t[n];e[n]=mo(s,r)?o[s]:i}return e}(_,l):g&&b>1&&_.reverse(),d&&f<b&&(_.length=f),this&&this!==ft&&this instanceof c&&(C=y||Ii(C)),C.apply(O,_)}}function Fi(e,t){return function(r,n){return function(e,t,r,n){return yn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function Ui(e,t){return function(r,n){var o;if(r===i&&n===i)return t;if(r!==i&&(o=r),n!==i){if(o===i)return n;"string"==typeof r||"string"==typeof n?(r=si(r),n=si(n)):(r=oi(r),n=oi(n)),o=e(r,n)}return o}}function Bi(e){return Qi((function(t){return t=At(t,Kt(oo())),$n((function(r){var n=this;return e(t,(function(e){return Et(e,n,r)}))}))}))}function Wi(e,t){var r=(t=t===i?" ":si(t)).length;if(r<2)return r?Gn(t,e):t;var n=Gn(t,ht(e/cr(t)));return nr(t)?yi(lr(n),0,e).join(""):n.slice(0,e)}function Vi(e){return function(t,r,o){return o&&"number"!=typeof o&&go(t,r,o)&&(r=o=i),t=ha(t),r===i?(r=t,t=0):r=ha(r),function(e,t,r,i){for(var o=-1,s=vr(ht((t-e)/(r||1)),0),a=n(s);s--;)a[i?s:++o]=e,e+=r;return a}(t,r,o=o===i?t<r?1:-1:ha(o),e)}}function qi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=va(t),r=va(r)),e(t,r)}}function zi(e,t,r,n,o,s,a,c,l,f){var h=8&t;t|=h?u:64,4&(t&=~(h?64:u))||(t&=-4);var d=[e,t,o,h?s:i,h?a:i,h?i:s,h?i:a,c,l,f],p=r.apply(i,d);return bo(e)&&xo(p,d),p.placeholder=n,Mo(p,e,t)}function Hi(e){var t=Ee[e];return function(e,r){if(e=va(e),(r=null==r?0:mr(da(r),292))&&Nt(e)){var n=(ga(e)+"e").split("e");return+((n=(ga(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Gi=Tr&&1/ar(new Tr([,-0]))[1]==l?function(e){return new Tr(e)}:au;function $i(e){return function(t){var r=fo(t);return r==S?ir(t):r==x?ur(t):function(e,t){return At(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Yi(e,t,r,s,l,f,h,d){var p=2&t;if(!p&&"function"!=typeof e)throw new xe(o);var v=s?s.length:0;if(v||(t&=-97,s=l=i),h=h===i?h:vr(da(h),0),d=d===i?d:da(d),v-=l?l.length:0,64&t){var m=s,g=l;s=l=i}var y=p?i:ro(e),b=[e,t,r,s,l,m,g,f,h,d];if(y&&function(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,s=n==c&&8==r||n==c&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!s)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var u=t[3];if(u){var l=e[3];e[3]=l?Ti(l,u,t[4]):u,e[4]=l?sr(e[3],a):t[4]}(u=t[5])&&(l=e[5],e[5]=l?Oi(l,u,t[6]):u,e[6]=l?sr(e[5],a):t[6]),(u=t[7])&&(e[7]=u),n&c&&(e[8]=null==e[8]?t[8]:mr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(b,y),e=b[0],t=b[1],r=b[2],s=b[3],l=b[4],!(d=b[9]=b[9]===i?p?0:e.length:vr(b[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(e,t,r){var o=Ii(e);return function s(){for(var a=arguments.length,u=n(a),c=a,l=io(s);c--;)u[c]=arguments[c];var f=a<3&&u[0]!==l&&u[a-1]!==l?[]:sr(u,l);return(a-=f.length)<r?zi(e,t,Li,s.placeholder,i,u,f,i,i,r-a):Et(this&&this!==ft&&this instanceof s?o:e,this,u)}}(e,t,d):t!=u&&33!=t||l.length?Li.apply(i,b):function(e,t,r,i){var o=1&t,s=Ii(e);return function t(){for(var a=-1,u=arguments.length,c=-1,l=i.length,f=n(l+u),h=this&&this!==ft&&this instanceof t?s:e;++c<l;)f[c]=i[c];for(;u--;)f[c++]=arguments[++a];return Et(h,o?r:this,f)}}(e,t,r,s);else var _=function(e,t,r){var n=1&t,i=Ii(e);return function t(){return(this&&this!==ft&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return Mo((y?Jn:xo)(_,b),e,t)}function Ki(e,t,r,n){return e===i||Us(e,Me[r])&&!ke.call(n,r)?t:e}function Xi(e,t,r,n,o,s){return Qs(e)&&Qs(t)&&(s.set(t,e),Un(e,t,i,Xi,s),s.delete(t)),e}function Ji(e){return na(e)?i:e}function Zi(e,t,r,n,o,s){var a=1&r,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var l=s.get(e),f=s.get(t);if(l&&f)return l==t&&f==e;var h=-1,d=!0,p=2&r?new Hr:i;for(s.set(e,t),s.set(t,e);++h<u;){var v=e[h],m=t[h];if(n)var g=a?n(m,v,h,t,e,s):n(v,m,h,e,t,s);if(g!==i){if(g)continue;d=!1;break}if(p){if(!Dt(t,(function(e,t){if(!Jt(p,t)&&(v===e||o(v,e,r,n,s)))return p.push(t)}))){d=!1;break}}else if(v!==m&&!o(v,m,r,n,s)){d=!1;break}}return s.delete(e),s.delete(t),d}function Qi(e){return Ro(To(e,i,zo),e+"")}function eo(e){return Sn(e,Ma,co)}function to(e){return Sn(e,Aa,lo)}var ro=xr?function(e){return xr.get(e)}:au;function no(e){for(var t=e.name+"",r=Pr[t],n=ke.call(Pr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(ke.call(Lr,"placeholder")?Lr:e).placeholder}function oo(){var e=Lr.iteratee||nu;return e=e===nu?kn:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Ma(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,So(i)]}return t}function uo(e,t){var r=function(e,t){return null==e?i:e[t]}(e,t);return jn(r)?r:i}var co=vt?function(e){return null==e?[]:(e=Te(e),Pt(vt(e),(function(t){return Ge.call(e,t)})))}:pu,lo=vt?function(e){for(var t=[];e;)jt(t,co(e)),e=ze(e);return t}:pu,fo=En;function ho(e,t,r){for(var n=-1,i=(t=mi(t,e)).length,o=!1;++n<i;){var s=No(t[n]);if(!(o=null!=e&&r(e,s)))break;e=e[s]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Zs(i)&&mo(s,i)&&(qs(e)||Vs(e))}function po(e){return"function"!=typeof e.constructor||wo(e)?{}:Fr(ze(e))}function vo(e){return qs(e)||Vs(e)||!!(Ye&&e&&e[Ye])}function mo(e,t){var r=typeof e;return!!(t=null==t?f:t)&&("number"==r||"symbol"!=r&&ge.test(e))&&e>-1&&e%1==0&&e<t}function go(e,t,r){if(!Qs(r))return!1;var n=typeof t;return!!("number"==n?Hs(r)&&mo(t,r.length):"string"==n&&t in r)&&Us(r[t],e)}function yo(e,t){if(qs(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!aa(e))||Q.test(e)||!Z.test(e)||null!=t&&e in Te(t)}function bo(e){var t=no(e),r=Lr[t];if("function"!=typeof r||!(t in Wr.prototype))return!1;if(e===r)return!0;var n=ro(r);return!!n&&e===n[0]}(wr&&fo(new wr(new ArrayBuffer(1)))!=j||Sr&&fo(new Sr)!=S||Er&&fo(Er.resolve())!=O||Tr&&fo(new Tr)!=x||Or&&fo(new Or)!=M)&&(fo=function(e){var t=En(e),r=t==T?e.constructor:i,n=r?Lo(r):"";if(n)switch(n){case Rr:return j;case Mr:return S;case Ar:return O;case jr:return x;case kr:return M}return t});var _o=Ae?Xs:vu;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Me)}function So(e){return e==e&&!Qs(e)}function Eo(e,t){return function(r){return null!=r&&r[e]===t&&(t!==i||e in Te(r))}}function To(e,t,r){return t=vr(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=vr(i.length-t,0),a=n(s);++o<s;)a[o]=i[t+o];o=-1;for(var u=n(t+1);++o<t;)u[o]=i[o];return u[t]=r(a),Et(e,this,u)}}function Oo(e,t){return t.length<2?e:wn(e,ei(t,0,-1))}function Co(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var xo=Ao(Jn),Po=lt||function(e,t){return ft.setTimeout(e,t)},Ro=Ao(Zn);function Mo(e,t,r){var n=t+"";return Ro(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Ot(p,(function(r){var n="_."+r[0];t&r[1]&&!Rt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(n),r)))}function Ao(e){var t=0,r=0;return function(){var n=gr(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function jo(e,t){var r=-1,n=e.length,o=n-1;for(t=t===i?n:t;++r<t;){var s=Hn(r,o),a=e[s];e[s]=e[r],e[r]=a}return e.length=t,e}var ko,Io,Do=(ko=ks((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,r,n,i){t.push(n?i.replace(le,"$1"):r||e)})),t}),(function(e){return 500===Io.size&&Io.clear(),e})),Io=ko.cache,ko);function No(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Lo(e){if(null!=e){try{return je.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Fo(e){if(e instanceof Wr)return e.clone();var t=new Br(e.__wrapped__,e.__chain__);return t.__actions__=Ci(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Uo=$n((function(e,t){return Gs(e)?cn(e,vn(t,1,Gs,!0)):[]})),Bo=$n((function(e,t){var r=Ko(t);return Gs(r)&&(r=i),Gs(e)?cn(e,vn(t,1,Gs,!0),oo(r,2)):[]})),Wo=$n((function(e,t){var r=Ko(t);return Gs(r)&&(r=i),Gs(e)?cn(e,vn(t,1,Gs,!0),i,r):[]}));function Vo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:da(r);return i<0&&(i=vr(n+i,0)),Ft(e,oo(t,3),i)}function qo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return r!==i&&(o=da(r),o=r<0?vr(n+o,0):mr(o,n-1)),Ft(e,oo(t,3),o,!0)}function zo(e){return null!=e&&e.length?vn(e,1):[]}function Ho(e){return e&&e.length?e[0]:i}var Go=$n((function(e){var t=At(e,pi);return t.length&&t[0]===e[0]?xn(t):[]})),$o=$n((function(e){var t=Ko(e),r=At(e,pi);return t===Ko(r)?t=i:r.pop(),r.length&&r[0]===e[0]?xn(r,oo(t,2)):[]})),Yo=$n((function(e){var t=Ko(e),r=At(e,pi);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?xn(r,i,t):[]}));function Ko(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Xo=$n(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?qn(e,t):e}var Zo=Qi((function(e,t){var r=null==e?0:e.length,n=nn(e,t);return zn(e,At(t,(function(e){return mo(e,r)?+e:e})).sort(Ei)),n}));function Qo(e){return null==e?e:_r.call(e)}var es=$n((function(e){return ai(vn(e,1,Gs,!0))})),ts=$n((function(e){var t=Ko(e);return Gs(t)&&(t=i),ai(vn(e,1,Gs,!0),oo(t,2))})),rs=$n((function(e){var t=Ko(e);return t="function"==typeof t?t:i,ai(vn(e,1,Gs,!0),i,t)}));function ns(e){if(!e||!e.length)return[];var t=0;return e=Pt(e,(function(e){if(Gs(e))return t=vr(e.length,t),!0})),$t(t,(function(t){return At(e,qt(t))}))}function is(e,t){if(!e||!e.length)return[];var r=ns(e);return null==t?r:At(r,(function(e){return Et(t,i,e)}))}var os=$n((function(e,t){return Gs(e)?cn(e,t):[]})),ss=$n((function(e){return hi(Pt(e,Gs))})),as=$n((function(e){var t=Ko(e);return Gs(t)&&(t=i),hi(Pt(e,Gs),oo(t,2))})),us=$n((function(e){var t=Ko(e);return t="function"==typeof t?t:i,hi(Pt(e,Gs),i,t)})),cs=$n(ns),ls=$n((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,is(e,r)}));function fs(e){var t=Lr(e);return t.__chain__=!0,t}function hs(e,t){return t(e)}var ds=Qi((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,o=function(t){return nn(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Wr&&mo(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:hs,args:[o],thisArg:i}),new Br(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ps=Pi((function(e,t,r){ke.call(e,r)?++e[r]:rn(e,r,1)})),vs=Di(Vo),ms=Di(qo);function gs(e,t){return(qs(e)?Ot:ln)(e,oo(t,3))}function ys(e,t){return(qs(e)?Ct:fn)(e,oo(t,3))}var bs=Pi((function(e,t,r){ke.call(e,r)?e[r].push(t):rn(e,r,[t])})),_s=$n((function(e,t,r){var i=-1,o="function"==typeof t,s=Hs(e)?n(e.length):[];return ln(e,(function(e){s[++i]=o?Et(t,e,r):Pn(e,t,r)})),s})),ws=Pi((function(e,t,r){rn(e,r,t)}));function Ss(e,t){return(qs(e)?At:Nn)(e,oo(t,3))}var Es=Pi((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Ts=$n((function(e,t){if(null==e)return[];var r=t.length;return r>1&&go(e,t[0],t[1])?t=[]:r>2&&go(t[0],t[1],t[2])&&(t=[t[0]]),Wn(e,vn(t,1),[])})),Os=ct||function(){return ft.Date.now()};function Cs(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,Yi(e,c,i,i,i,i,t)}function xs(e,t){var r;if("function"!=typeof t)throw new xe(o);return e=da(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var Ps=$n((function(e,t,r){var n=1;if(r.length){var i=sr(r,io(Ps));n|=u}return Yi(e,n,t,r,i)})),Rs=$n((function(e,t,r){var n=3;if(r.length){var i=sr(r,io(Rs));n|=u}return Yi(t,n,e,r,i)}));function Ms(e,t,r){var n,s,a,u,c,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof e)throw new xe(o);function v(t){var r=n,o=s;return n=s=i,f=t,u=e.apply(o,r)}function m(e){var r=e-l;return l===i||r>=t||r<0||d&&e-f>=a}function g(){var e=Os();if(m(e))return y(e);c=Po(g,function(e){var r=t-(e-l);return d?mr(r,a-(e-f)):r}(e))}function y(e){return c=i,p&&n?v(e):(n=s=i,u)}function b(){var e=Os(),r=m(e);if(n=arguments,s=this,l=e,r){if(c===i)return function(e){return f=e,c=Po(g,t),h?v(e):u}(l);if(d)return bi(c),c=Po(g,t),v(l)}return c===i&&(c=Po(g,t)),u}return t=va(t)||0,Qs(r)&&(h=!!r.leading,a=(d="maxWait"in r)?vr(va(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),b.cancel=function(){c!==i&&bi(c),f=0,n=l=s=c=i},b.flush=function(){return c===i?u:y(Os())},b}var As=$n((function(e,t){return un(e,1,t)})),js=$n((function(e,t,r){return un(e,va(t)||0,r)}));function ks(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new xe(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(ks.Cache||zr),r}function Is(e){if("function"!=typeof e)throw new xe(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ks.Cache=zr;var Ds=gi((function(e,t){var r=(t=1==t.length&&qs(t[0])?At(t[0],Kt(oo())):At(vn(t,1),Kt(oo()))).length;return $n((function(n){for(var i=-1,o=mr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return Et(e,this,n)}))})),Ns=$n((function(e,t){var r=sr(t,io(Ns));return Yi(e,u,i,t,r)})),Ls=$n((function(e,t){var r=sr(t,io(Ls));return Yi(e,64,i,t,r)})),Fs=Qi((function(e,t){return Yi(e,256,i,i,i,t)}));function Us(e,t){return e===t||e!=e&&t!=t}var Bs=qi(Tn),Ws=qi((function(e,t){return e>=t})),Vs=Rn(function(){return arguments}())?Rn:function(e){return ea(e)&&ke.call(e,"callee")&&!Ge.call(e,"callee")},qs=n.isArray,zs=gt?Kt(gt):function(e){return ea(e)&&En(e)==A};function Hs(e){return null!=e&&Zs(e.length)&&!Xs(e)}function Gs(e){return ea(e)&&Hs(e)}var $s=mt||vu,Ys=yt?Kt(yt):function(e){return ea(e)&&En(e)==y};function Ks(e){if(!ea(e))return!1;var t=En(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!na(e)}function Xs(e){if(!Qs(e))return!1;var t=En(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==da(e)}function Zs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function Qs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=bt?Kt(bt):function(e){return ea(e)&&fo(e)==S};function ra(e){return"number"==typeof e||ea(e)&&En(e)==E}function na(e){if(!ea(e)||En(e)!=T)return!1;var t=ze(e);if(null===t)return!0;var r=ke.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&je.call(r)==Le}var ia=_t?Kt(_t):function(e){return ea(e)&&En(e)==C},oa=wt?Kt(wt):function(e){return ea(e)&&fo(e)==x};function sa(e){return"string"==typeof e||!qs(e)&&ea(e)&&En(e)==P}function aa(e){return"symbol"==typeof e||ea(e)&&En(e)==R}var ua=St?Kt(St):function(e){return ea(e)&&Zs(e.length)&&!!it[En(e)]},ca=qi(Dn),la=qi((function(e,t){return e<=t}));function fa(e){if(!e)return[];if(Hs(e))return sa(e)?lr(e):Ci(e);if(Ke&&e[Ke])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ke]());var t=fo(e);return(t==S?ir:t==x?ar:Ua)(e)}function ha(e){return e?(e=va(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function da(e){var t=ha(e),r=t%1;return t==t?r?t-r:t:0}function pa(e){return e?on(da(e),0,d):0}function va(e){if("number"==typeof e)return e;if(aa(e))return h;if(Qs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var r=pe.test(e);return r||me.test(e)?ut(e.slice(2),r?2:8):de.test(e)?h:+e}function ma(e){return xi(e,Aa(e))}function ga(e){return null==e?"":si(e)}var ya=Ri((function(e,t){if(wo(t)||Hs(t))xi(t,Ma(t),e);else for(var r in t)ke.call(t,r)&&Zr(e,r,t[r])})),ba=Ri((function(e,t){xi(t,Aa(t),e)})),_a=Ri((function(e,t,r,n){xi(t,Aa(t),e,n)})),wa=Ri((function(e,t,r,n){xi(t,Ma(t),e,n)})),Sa=Qi(nn),Ea=$n((function(e,t){e=Te(e);var r=-1,n=t.length,o=n>2?t[2]:i;for(o&&go(t[0],t[1],o)&&(n=1);++r<n;)for(var s=t[r],a=Aa(s),u=-1,c=a.length;++u<c;){var l=a[u],f=e[l];(f===i||Us(f,Me[l])&&!ke.call(e,l))&&(e[l]=s[l])}return e})),Ta=$n((function(e){return e.push(i,Xi),Et(ka,i,e)}));function Oa(e,t,r){var n=null==e?i:wn(e,t);return n===i?r:n}function Ca(e,t){return null!=e&&ho(e,t,Cn)}var xa=Fi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=r}),Qa(ru)),Pa=Fi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),ke.call(e,t)?e[t].push(r):e[t]=[r]}),oo),Ra=$n(Pn);function Ma(e){return Hs(e)?$r(e):In(e)}function Aa(e){return Hs(e)?$r(e,!0):function(e){if(!Qs(e))return function(e){var t=[];if(null!=e)for(var r in Te(e))t.push(r);return t}(e);var t=wo(e),r=[];for(var n in e)("constructor"!=n||!t&&ke.call(e,n))&&r.push(n);return r}(e)}var ja=Ri((function(e,t,r){Un(e,t,r)})),ka=Ri((function(e,t,r,n){Un(e,t,r,n)})),Ia=Qi((function(e,t){var r={};if(null==e)return r;var n=!1;t=At(t,(function(t){return t=mi(t,e),n||(n=t.length>1),t})),xi(e,to(e),r),n&&(r=sn(r,7,Ji));for(var i=t.length;i--;)ui(r,t[i]);return r})),Da=Qi((function(e,t){return null==e?{}:function(e,t){return Vn(e,t,(function(t,r){return Ca(e,r)}))}(e,t)}));function Na(e,t){if(null==e)return{};var r=At(to(e),(function(e){return[e]}));return t=oo(t),Vn(e,r,(function(e,r){return t(e,r[0])}))}var La=$i(Ma),Fa=$i(Aa);function Ua(e){return null==e?[]:Xt(e,Ma(e))}var Ba=ki((function(e,t,r){return t=t.toLowerCase(),e+(r?Wa(t):t)}));function Wa(e){return Ka(ga(e).toLowerCase())}function Va(e){return(e=ga(e))&&e.replace(ye,er).replace(Je,"")}var qa=ki((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),za=ki((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ha=ji("toLowerCase"),Ga=ki((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),$a=ki((function(e,t,r){return e+(r?" ":"")+Ka(t)})),Ya=ki((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ka=ji("toUpperCase");function Xa(e,t,r){return e=ga(e),(t=r?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var Ja=$n((function(e,t){try{return Et(e,i,t)}catch(e){return Ks(e)?e:new we(e)}})),Za=Qi((function(e,t){return Ot(t,(function(t){t=No(t),rn(e,t,Ps(e[t],e))})),e}));function Qa(e){return function(){return e}}var eu=Ni(),tu=Ni(!0);function ru(e){return e}function nu(e){return kn("function"==typeof e?e:sn(e,1))}var iu=$n((function(e,t){return function(r){return Pn(r,e,t)}})),ou=$n((function(e,t){return function(r){return Pn(e,r,t)}}));function su(e,t,r){var n=Ma(t),i=_n(t,n);null!=r||Qs(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=_n(t,Ma(t)));var o=!(Qs(r)&&"chain"in r&&!r.chain),s=Xs(e);return Ot(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ci(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,jt([this.value()],arguments))})})),e}function au(){}var uu=Bi(At),cu=Bi(xt),lu=Bi(Dt);function fu(e){return yo(e)?qt(No(e)):function(e){return function(t){return wn(t,e)}}(e)}var hu=Vi(),du=Vi(!0);function pu(){return[]}function vu(){return!1}var mu,gu=Ui((function(e,t){return e+t}),0),yu=Hi("ceil"),bu=Ui((function(e,t){return e/t}),1),_u=Hi("floor"),wu=Ui((function(e,t){return e*t}),1),Su=Hi("round"),Eu=Ui((function(e,t){return e-t}),0);return Lr.after=function(e,t){if("function"!=typeof t)throw new xe(o);return e=da(e),function(){if(--e<1)return t.apply(this,arguments)}},Lr.ary=Cs,Lr.assign=ya,Lr.assignIn=ba,Lr.assignInWith=_a,Lr.assignWith=wa,Lr.at=Sa,Lr.before=xs,Lr.bind=Ps,Lr.bindAll=Za,Lr.bindKey=Rs,Lr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qs(e)?e:[e]},Lr.chain=fs,Lr.chunk=function(e,t,r){t=(r?go(e,t,r):t===i)?1:vr(da(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,u=n(ht(o/t));s<o;)u[a++]=ei(e,s,s+=t);return u},Lr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Lr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=n(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return jt(qs(r)?Ci(r):[r],vn(t,1))},Lr.cond=function(e){var t=null==e?0:e.length,r=oo();return e=t?At(e,(function(e){if("function"!=typeof e[1])throw new xe(o);return[r(e[0]),e[1]]})):[],$n((function(r){for(var n=-1;++n<t;){var i=e[n];if(Et(i[0],this,r))return Et(i[1],this,r)}}))},Lr.conforms=function(e){return function(e){var t=Ma(e);return function(r){return an(r,e,t)}}(sn(e,1))},Lr.constant=Qa,Lr.countBy=ps,Lr.create=function(e,t){var r=Fr(e);return null==t?r:tn(r,t)},Lr.curry=function e(t,r,n){var o=Yi(t,8,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Lr.curryRight=function e(t,r,n){var o=Yi(t,16,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Lr.debounce=Ms,Lr.defaults=Ea,Lr.defaultsDeep=Ta,Lr.defer=As,Lr.delay=js,Lr.difference=Uo,Lr.differenceBy=Bo,Lr.differenceWith=Wo,Lr.drop=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=r||t===i?1:da(t))<0?0:t,n):[]},Lr.dropRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,0,(t=n-(t=r||t===i?1:da(t)))<0?0:t):[]},Lr.dropRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0,!0):[]},Lr.dropWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0):[]},Lr.fill=function(e,t,r,n){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&go(e,t,r)&&(r=0,n=o),function(e,t,r,n){var o=e.length;for((r=da(r))<0&&(r=-r>o?0:o+r),(n=n===i||n>o?o:da(n))<0&&(n+=o),n=r>n?0:pa(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},Lr.filter=function(e,t){return(qs(e)?Pt:pn)(e,oo(t,3))},Lr.flatMap=function(e,t){return vn(Ss(e,t),1)},Lr.flatMapDeep=function(e,t){return vn(Ss(e,t),l)},Lr.flatMapDepth=function(e,t,r){return r=r===i?1:da(r),vn(Ss(e,t),r)},Lr.flatten=zo,Lr.flattenDeep=function(e){return null!=e&&e.length?vn(e,l):[]},Lr.flattenDepth=function(e,t){return null!=e&&e.length?vn(e,t=t===i?1:da(t)):[]},Lr.flip=function(e){return Yi(e,512)},Lr.flow=eu,Lr.flowRight=tu,Lr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Lr.functions=function(e){return null==e?[]:_n(e,Ma(e))},Lr.functionsIn=function(e){return null==e?[]:_n(e,Aa(e))},Lr.groupBy=bs,Lr.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Lr.intersection=Go,Lr.intersectionBy=$o,Lr.intersectionWith=Yo,Lr.invert=xa,Lr.invertBy=Pa,Lr.invokeMap=_s,Lr.iteratee=nu,Lr.keyBy=ws,Lr.keys=Ma,Lr.keysIn=Aa,Lr.map=Ss,Lr.mapKeys=function(e,t){var r={};return t=oo(t,3),yn(e,(function(e,n,i){rn(r,t(e,n,i),e)})),r},Lr.mapValues=function(e,t){var r={};return t=oo(t,3),yn(e,(function(e,n,i){rn(r,n,t(e,n,i))})),r},Lr.matches=function(e){return Ln(sn(e,1))},Lr.matchesProperty=function(e,t){return Fn(e,sn(t,1))},Lr.memoize=ks,Lr.merge=ja,Lr.mergeWith=ka,Lr.method=iu,Lr.methodOf=ou,Lr.mixin=su,Lr.negate=Is,Lr.nthArg=function(e){return e=da(e),$n((function(t){return Bn(t,e)}))},Lr.omit=Ia,Lr.omitBy=function(e,t){return Na(e,Is(oo(t)))},Lr.once=function(e){return xs(2,e)},Lr.orderBy=function(e,t,r,n){return null==e?[]:(qs(t)||(t=null==t?[]:[t]),qs(r=n?i:r)||(r=null==r?[]:[r]),Wn(e,t,r))},Lr.over=uu,Lr.overArgs=Ds,Lr.overEvery=cu,Lr.overSome=lu,Lr.partial=Ns,Lr.partialRight=Ls,Lr.partition=Es,Lr.pick=Da,Lr.pickBy=Na,Lr.property=fu,Lr.propertyOf=function(e){return function(t){return null==e?i:wn(e,t)}},Lr.pull=Xo,Lr.pullAll=Jo,Lr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?qn(e,t,oo(r,2)):e},Lr.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?qn(e,t,i,r):e},Lr.pullAt=Zo,Lr.range=hu,Lr.rangeRight=du,Lr.rearg=Fs,Lr.reject=function(e,t){return(qs(e)?Pt:pn)(e,Is(oo(t,3)))},Lr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=oo(t,3);++n<o;){var s=e[n];t(s,n,e)&&(r.push(s),i.push(n))}return zn(e,i),r},Lr.rest=function(e,t){if("function"!=typeof e)throw new xe(o);return $n(e,t=t===i?t:da(t))},Lr.reverse=Qo,Lr.sampleSize=function(e,t,r){return t=(r?go(e,t,r):t===i)?1:da(t),(qs(e)?Kr:Kn)(e,t)},Lr.set=function(e,t,r){return null==e?e:Xn(e,t,r)},Lr.setWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:Xn(e,t,r,n)},Lr.shuffle=function(e){return(qs(e)?Xr:Qn)(e)},Lr.slice=function(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&go(e,t,r)?(t=0,r=n):(t=null==t?0:da(t),r=r===i?n:da(r)),ei(e,t,r)):[]},Lr.sortBy=Ts,Lr.sortedUniq=function(e){return e&&e.length?ii(e):[]},Lr.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Lr.split=function(e,t,r){return r&&"number"!=typeof r&&go(e,t,r)&&(t=r=i),(r=r===i?d:r>>>0)?(e=ga(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&nr(e)?yi(lr(e),0,r):e.split(t,r):[]},Lr.spread=function(e,t){if("function"!=typeof e)throw new xe(o);return t=null==t?0:vr(da(t),0),$n((function(r){var n=r[t],i=yi(r,0,t);return n&&jt(i,n),Et(e,this,i)}))},Lr.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Lr.take=function(e,t,r){return e&&e.length?ei(e,0,(t=r||t===i?1:da(t))<0?0:t):[]},Lr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=n-(t=r||t===i?1:da(t)))<0?0:t,n):[]},Lr.takeRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!1,!0):[]},Lr.takeWhile=function(e,t){return e&&e.length?li(e,oo(t,3)):[]},Lr.tap=function(e,t){return t(e),e},Lr.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new xe(o);return Qs(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Ms(e,t,{leading:n,maxWait:t,trailing:i})},Lr.thru=hs,Lr.toArray=fa,Lr.toPairs=La,Lr.toPairsIn=Fa,Lr.toPath=function(e){return qs(e)?At(e,No):aa(e)?[e]:Ci(Do(ga(e)))},Lr.toPlainObject=ma,Lr.transform=function(e,t,r){var n=qs(e),i=n||$s(e)||ua(e);if(t=oo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Qs(e)&&Xs(o)?Fr(ze(e)):{}}return(i?Ot:yn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Lr.unary=function(e){return Cs(e,1)},Lr.union=es,Lr.unionBy=ts,Lr.unionWith=rs,Lr.uniq=function(e){return e&&e.length?ai(e):[]},Lr.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Lr.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Lr.unset=function(e,t){return null==e||ui(e,t)},Lr.unzip=ns,Lr.unzipWith=is,Lr.update=function(e,t,r){return null==e?e:ci(e,t,vi(r))},Lr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:ci(e,t,vi(r),n)},Lr.values=Ua,Lr.valuesIn=function(e){return null==e?[]:Xt(e,Aa(e))},Lr.without=os,Lr.words=Xa,Lr.wrap=function(e,t){return Ns(vi(t),e)},Lr.xor=ss,Lr.xorBy=as,Lr.xorWith=us,Lr.zip=cs,Lr.zipObject=function(e,t){return di(e||[],t||[],Zr)},Lr.zipObjectDeep=function(e,t){return di(e||[],t||[],Xn)},Lr.zipWith=ls,Lr.entries=La,Lr.entriesIn=Fa,Lr.extend=ba,Lr.extendWith=_a,su(Lr,Lr),Lr.add=gu,Lr.attempt=Ja,Lr.camelCase=Ba,Lr.capitalize=Wa,Lr.ceil=yu,Lr.clamp=function(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=va(r))==r?r:0),t!==i&&(t=(t=va(t))==t?t:0),on(va(e),t,r)},Lr.clone=function(e){return sn(e,4)},Lr.cloneDeep=function(e){return sn(e,5)},Lr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:i)},Lr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:i)},Lr.conformsTo=function(e,t){return null==t||an(e,t,Ma(t))},Lr.deburr=Va,Lr.defaultTo=function(e,t){return null==e||e!=e?t:e},Lr.divide=bu,Lr.endsWith=function(e,t,r){e=ga(e),t=si(t);var n=e.length,o=r=r===i?n:on(da(r),0,n);return(r-=t.length)>=0&&e.slice(r,o)==t},Lr.eq=Us,Lr.escape=function(e){return(e=ga(e))&&Y.test(e)?e.replace(G,tr):e},Lr.escapeRegExp=function(e){return(e=ga(e))&&re.test(e)?e.replace(te,"\\$&"):e},Lr.every=function(e,t,r){var n=qs(e)?xt:hn;return r&&go(e,t,r)&&(t=i),n(e,oo(t,3))},Lr.find=vs,Lr.findIndex=Vo,Lr.findKey=function(e,t){return Lt(e,oo(t,3),yn)},Lr.findLast=ms,Lr.findLastIndex=qo,Lr.findLastKey=function(e,t){return Lt(e,oo(t,3),bn)},Lr.floor=_u,Lr.forEach=gs,Lr.forEachRight=ys,Lr.forIn=function(e,t){return null==e?e:mn(e,oo(t,3),Aa)},Lr.forInRight=function(e,t){return null==e?e:gn(e,oo(t,3),Aa)},Lr.forOwn=function(e,t){return e&&yn(e,oo(t,3))},Lr.forOwnRight=function(e,t){return e&&bn(e,oo(t,3))},Lr.get=Oa,Lr.gt=Bs,Lr.gte=Ws,Lr.has=function(e,t){return null!=e&&ho(e,t,On)},Lr.hasIn=Ca,Lr.head=Ho,Lr.identity=ru,Lr.includes=function(e,t,r,n){e=Hs(e)?e:Ua(e),r=r&&!n?da(r):0;var i=e.length;return r<0&&(r=vr(i+r,0)),sa(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Ut(e,t,r)>-1},Lr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:da(r);return i<0&&(i=vr(n+i,0)),Ut(e,t,i)},Lr.inRange=function(e,t,r){return t=ha(t),r===i?(r=t,t=0):r=ha(r),function(e,t,r){return e>=mr(t,r)&&e<vr(t,r)}(e=va(e),t,r)},Lr.invoke=Ra,Lr.isArguments=Vs,Lr.isArray=qs,Lr.isArrayBuffer=zs,Lr.isArrayLike=Hs,Lr.isArrayLikeObject=Gs,Lr.isBoolean=function(e){return!0===e||!1===e||ea(e)&&En(e)==g},Lr.isBuffer=$s,Lr.isDate=Ys,Lr.isElement=function(e){return ea(e)&&1===e.nodeType&&!na(e)},Lr.isEmpty=function(e){if(null==e)return!0;if(Hs(e)&&(qs(e)||"string"==typeof e||"function"==typeof e.splice||$s(e)||ua(e)||Vs(e)))return!e.length;var t=fo(e);if(t==S||t==x)return!e.size;if(wo(e))return!In(e).length;for(var r in e)if(ke.call(e,r))return!1;return!0},Lr.isEqual=function(e,t){return Mn(e,t)},Lr.isEqualWith=function(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?Mn(e,t,i,r):!!n},Lr.isError=Ks,Lr.isFinite=function(e){return"number"==typeof e&&Nt(e)},Lr.isFunction=Xs,Lr.isInteger=Js,Lr.isLength=Zs,Lr.isMap=ta,Lr.isMatch=function(e,t){return e===t||An(e,t,ao(t))},Lr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:i,An(e,t,ao(t),r)},Lr.isNaN=function(e){return ra(e)&&e!=+e},Lr.isNative=function(e){if(_o(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return jn(e)},Lr.isNil=function(e){return null==e},Lr.isNull=function(e){return null===e},Lr.isNumber=ra,Lr.isObject=Qs,Lr.isObjectLike=ea,Lr.isPlainObject=na,Lr.isRegExp=ia,Lr.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=f},Lr.isSet=oa,Lr.isString=sa,Lr.isSymbol=aa,Lr.isTypedArray=ua,Lr.isUndefined=function(e){return e===i},Lr.isWeakMap=function(e){return ea(e)&&fo(e)==M},Lr.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==En(e)},Lr.join=function(e,t){return null==e?"":zt.call(e,t)},Lr.kebabCase=qa,Lr.last=Ko,Lr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n;return r!==i&&(o=(o=da(r))<0?vr(n+o,0):mr(o,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Ft(e,Wt,o,!0)},Lr.lowerCase=za,Lr.lowerFirst=Ha,Lr.lt=ca,Lr.lte=la,Lr.max=function(e){return e&&e.length?dn(e,ru,Tn):i},Lr.maxBy=function(e,t){return e&&e.length?dn(e,oo(t,2),Tn):i},Lr.mean=function(e){return Vt(e,ru)},Lr.meanBy=function(e,t){return Vt(e,oo(t,2))},Lr.min=function(e){return e&&e.length?dn(e,ru,Dn):i},Lr.minBy=function(e,t){return e&&e.length?dn(e,oo(t,2),Dn):i},Lr.stubArray=pu,Lr.stubFalse=vu,Lr.stubObject=function(){return{}},Lr.stubString=function(){return""},Lr.stubTrue=function(){return!0},Lr.multiply=wu,Lr.nth=function(e,t){return e&&e.length?Bn(e,da(t)):i},Lr.noConflict=function(){return ft._===this&&(ft._=Fe),this},Lr.noop=au,Lr.now=Os,Lr.pad=function(e,t,r){e=ga(e);var n=(t=da(t))?cr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Wi(dt(i),r)+e+Wi(ht(i),r)},Lr.padEnd=function(e,t,r){e=ga(e);var n=(t=da(t))?cr(e):0;return t&&n<t?e+Wi(t-n,r):e},Lr.padStart=function(e,t,r){e=ga(e);var n=(t=da(t))?cr(e):0;return t&&n<t?Wi(t-n,r)+e:e},Lr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),yr(ga(e).replace(ne,""),t||0)},Lr.random=function(e,t,r){if(r&&"boolean"!=typeof r&&go(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=ha(e),t===i?(t=e,e=0):t=ha(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var o=br();return mr(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Hn(e,t)},Lr.reduce=function(e,t,r){var n=qs(e)?kt:Ht,i=arguments.length<3;return n(e,oo(t,4),r,i,ln)},Lr.reduceRight=function(e,t,r){var n=qs(e)?It:Ht,i=arguments.length<3;return n(e,oo(t,4),r,i,fn)},Lr.repeat=function(e,t,r){return t=(r?go(e,t,r):t===i)?1:da(t),Gn(ga(e),t)},Lr.replace=function(){var e=arguments,t=ga(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Lr.result=function(e,t,r){var n=-1,o=(t=mi(t,e)).length;for(o||(o=1,e=i);++n<o;){var s=null==e?i:e[No(t[n])];s===i&&(n=o,s=r),e=Xs(s)?s.call(e):s}return e},Lr.round=Su,Lr.runInContext=e,Lr.sample=function(e){return(qs(e)?Yr:Yn)(e)},Lr.size=function(e){if(null==e)return 0;if(Hs(e))return sa(e)?cr(e):e.length;var t=fo(e);return t==S||t==x?e.size:In(e).length},Lr.snakeCase=Ga,Lr.some=function(e,t,r){var n=qs(e)?Dt:ti;return r&&go(e,t,r)&&(t=i),n(e,oo(t,3))},Lr.sortedIndex=function(e,t){return ri(e,t)},Lr.sortedIndexBy=function(e,t,r){return ni(e,t,oo(r,2))},Lr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ri(e,t);if(n<r&&Us(e[n],t))return n}return-1},Lr.sortedLastIndex=function(e,t){return ri(e,t,!0)},Lr.sortedLastIndexBy=function(e,t,r){return ni(e,t,oo(r,2),!0)},Lr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ri(e,t,!0)-1;if(Us(e[r],t))return r}return-1},Lr.startCase=$a,Lr.startsWith=function(e,t,r){return e=ga(e),r=null==r?0:on(da(r),0,e.length),t=si(t),e.slice(r,r+t.length)==t},Lr.subtract=Eu,Lr.sum=function(e){return e&&e.length?Gt(e,ru):0},Lr.sumBy=function(e,t){return e&&e.length?Gt(e,oo(t,2)):0},Lr.template=function(e,t,r){var n=Lr.templateSettings;r&&go(e,t,r)&&(t=i),e=ga(e),t=_a({},t,n,Ki);var o,s,a=_a({},t.imports,n.imports,Ki),u=Ma(a),c=Xt(a,u),l=0,f=t.interpolate||be,h="__p += '",d=Oe((t.escape||be).source+"|"+f.source+"|"+(f===J?fe:be).source+"|"+(t.evaluate||be).source+"|$","g"),p="//# sourceURL="+(ke.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(d,(function(t,r,n,i,a,u){return n||(n=i),h+=e.slice(l,u).replace(_e,rr),r&&(o=!0,h+="' +\n__e("+r+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=u+t.length,t})),h+="';\n";var v=ke.call(t,"variable")&&t.variable;if(v){if(ce.test(v))throw new we("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(V,""):h).replace(q,"$1").replace(z,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Ja((function(){return Se(u,p+"return "+h).apply(i,c)}));if(m.source=h,Ks(m))throw m;return m},Lr.times=function(e,t){if((e=da(e))<1||e>f)return[];var r=d,n=mr(e,d);t=oo(t),e-=d;for(var i=$t(n,t);++r<e;)t(r);return i},Lr.toFinite=ha,Lr.toInteger=da,Lr.toLength=pa,Lr.toLower=function(e){return ga(e).toLowerCase()},Lr.toNumber=va,Lr.toSafeInteger=function(e){return e?on(da(e),-9007199254740991,f):0===e?e:0},Lr.toString=ga,Lr.toUpper=function(e){return ga(e).toUpperCase()},Lr.trim=function(e,t,r){if((e=ga(e))&&(r||t===i))return Yt(e);if(!e||!(t=si(t)))return e;var n=lr(e),o=lr(t);return yi(n,Zt(n,o),Qt(n,o)+1).join("")},Lr.trimEnd=function(e,t,r){if((e=ga(e))&&(r||t===i))return e.slice(0,fr(e)+1);if(!e||!(t=si(t)))return e;var n=lr(e);return yi(n,0,Qt(n,lr(t))+1).join("")},Lr.trimStart=function(e,t,r){if((e=ga(e))&&(r||t===i))return e.replace(ne,"");if(!e||!(t=si(t)))return e;var n=lr(e);return yi(n,Zt(n,lr(t))).join("")},Lr.truncate=function(e,t){var r=30,n="...";if(Qs(t)){var o="separator"in t?t.separator:o;r="length"in t?da(t.length):r,n="omission"in t?si(t.omission):n}var s=(e=ga(e)).length;if(nr(e)){var a=lr(e);s=a.length}if(r>=s)return e;var u=r-cr(n);if(u<1)return n;var c=a?yi(a,0,u).join(""):e.slice(0,u);if(o===i)return c+n;if(a&&(u+=c.length-u),ia(o)){if(e.slice(u).search(o)){var l,f=c;for(o.global||(o=Oe(o.source,ga(he.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;c=c.slice(0,h===i?u:h)}}else if(e.indexOf(si(o),u)!=u){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+n},Lr.unescape=function(e){return(e=ga(e))&&$.test(e)?e.replace(H,hr):e},Lr.uniqueId=function(e){var t=++Ie;return ga(e)+t},Lr.upperCase=Ya,Lr.upperFirst=Ka,Lr.each=gs,Lr.eachRight=ys,Lr.first=Ho,su(Lr,(mu={},yn(Lr,(function(e,t){ke.call(Lr.prototype,t)||(mu[t]=e)})),mu),{chain:!1}),Lr.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Lr[e].placeholder=Lr})),Ot(["drop","take"],(function(e,t){Wr.prototype[e]=function(r){r=r===i?1:vr(da(r),0);var n=this.__filtered__&&!t?new Wr(this):this.clone();return n.__filtered__?n.__takeCount__=mr(r,n.__takeCount__):n.__views__.push({size:mr(r,d),type:e+(n.__dir__<0?"Right":"")}),n},Wr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Wr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Ot(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Wr.prototype[e]=function(){return this[r](1).value()[0]}})),Ot(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Wr.prototype[e]=function(){return this.__filtered__?new Wr(this):this[r](1)}})),Wr.prototype.compact=function(){return this.filter(ru)},Wr.prototype.find=function(e){return this.filter(e).head()},Wr.prototype.findLast=function(e){return this.reverse().find(e)},Wr.prototype.invokeMap=$n((function(e,t){return"function"==typeof e?new Wr(this):this.map((function(r){return Pn(r,e,t)}))})),Wr.prototype.reject=function(e){return this.filter(Is(oo(e)))},Wr.prototype.slice=function(e,t){e=da(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Wr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=da(t))<0?r.dropRight(-t):r.take(t-e)),r)},Wr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Wr.prototype.toArray=function(){return this.take(d)},yn(Wr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=Lr[n?"take"+("last"==t?"Right":""):t],s=n||/^find/.test(t);o&&(Lr.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,u=t instanceof Wr,c=a[0],l=u||qs(t),f=function(e){var t=o.apply(Lr,jt([e],a));return n&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,v=u&&!d;if(!s&&l){t=v?t:new Wr(this);var m=e.apply(t,a);return m.__actions__.push({func:hs,args:[f],thisArg:i}),new Br(m,h)}return p&&v?e.apply(this,a):(m=this.thru(f),p?n?m.value()[0]:m.value():m)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Lr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(qs(i)?i:[],e)}return this[r]((function(r){return t.apply(qs(r)?r:[],e)}))}})),yn(Wr.prototype,(function(e,t){var r=Lr[t];if(r){var n=r.name+"";ke.call(Pr,n)||(Pr[n]=[]),Pr[n].push({name:t,func:r})}})),Pr[Li(i,2).name]=[{name:"wrapper",func:i}],Wr.prototype.clone=function(){var e=new Wr(this.__wrapped__);return e.__actions__=Ci(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ci(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ci(this.__views__),e},Wr.prototype.reverse=function(){if(this.__filtered__){var e=new Wr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Wr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=qs(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=mr(t,e+s);break;case"takeRight":e=vr(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,u=a-s,c=n?a:s-1,l=this.__iteratees__,f=l.length,h=0,d=mr(u,this.__takeCount__);if(!r||!n&&i==u&&d==u)return fi(e,this.__actions__);var p=[];e:for(;u--&&h<d;){for(var v=-1,m=e[c+=t];++v<f;){var g=l[v],y=g.iteratee,b=g.type,_=y(m);if(2==b)m=_;else if(!_){if(1==b)continue e;break e}}p[h++]=m}return p},Lr.prototype.at=ds,Lr.prototype.chain=function(){return fs(this)},Lr.prototype.commit=function(){return new Br(this.value(),this.__chain__)},Lr.prototype.next=function(){this.__values__===i&&(this.__values__=fa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Lr.prototype.plant=function(e){for(var t,r=this;r instanceof Ur;){var n=Fo(r);n.__index__=0,n.__values__=i,t?o.__wrapped__=n:t=n;var o=n;r=r.__wrapped__}return o.__wrapped__=e,t},Lr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wr){var t=e;return this.__actions__.length&&(t=new Wr(this)),(t=t.reverse()).__actions__.push({func:hs,args:[Qo],thisArg:i}),new Br(t,this.__chain__)}return this.thru(Qo)},Lr.prototype.toJSON=Lr.prototype.valueOf=Lr.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Lr.prototype.first=Lr.prototype.head,Ke&&(Lr.prototype[Ke]=function(){return this}),Lr}();ft._=dr,(n=function(){return dr}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},7824:e=>{var t=1e3,r=60*t,n=60*r,i=24*n;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var a,u,c=typeof e;if("string"===c&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===c&&isFinite(e))return s.long?(a=e,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=n?o(a,u,n,"hour"):u>=r?o(a,u,r,"minute"):u>=t?o(a,u,t,"second"):a+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},4155:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,u=[],c=!1,l=-1;function f(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&h())}function h(){if(!c){var e=s(f);c=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||c||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},3399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Collector=void 0;var n=r(6486),i=r(3701);function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){function e(){var t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=void 0,(t="data")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.data=[]}var t,r;return t=e,(r=[{key:"get",value:function(e){return(0,i.findExistingMetric)(e,this.data)}},{key:"set",value:function(e,t){var r=(0,i.findExistingMetric)(t,this.data);return r?r.value=e:this.data.push({labels:t,value:e}),this}},{key:"collect",value:function(e){return(0,n.filter)(this.data,(function(t){return(0,n.matches)(e)(t.labels)}))}},{key:"resetAll",value:function(){var e=this;return(0,n.each)(this.data,(function(t){e.reset(t.labels)})),this}}])&&o(t.prototype,r),e}();t.Collector=s},4486:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Counter=void 0;var a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(t).apply(this,arguments))}var r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),r=t,(a=[{key:"inc",value:function(e){return this.add(1,e),this}},{key:"add",value:function(e,t){if(e<0)throw new Error("Expected increment amount to be greater than -1. Received: ".concat(e));var r=this.get(t);return this.set(r?r.value+e:e,t),this}},{key:"reset",value:function(e){this.set(0,e)}}])&&i(r.prototype,a),t}(r(3399).Collector);t.Counter=a},1993:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Gauge=void 0;var a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(t).apply(this,arguments))}var r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),r=t,(a=[{key:"dec",value:function(e){var t=this.get(e);return this.set(t?t.value-1:0,e),this}},{key:"sub",value:function(e,t){var r=this.get(t);return this.set(r?r.value-e:0,t),this}}])&&i(r.prototype,a),t}(r(4486).Counter);t.Gauge=a},8215:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Histogram=void 0;var n=r(6486);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function c(e){return{entries:(0,n.reduce)(e,(function(e,t){return e[t.toString()]=0,e}),{"+Inf":0}),sum:0,count:0,raw:[]}}var l=function(e){function t(){var e,r,n,o,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?a(e):t}(this,s(t).call(this)),o=void 0,(n="buckets")in(r=a(e))?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,e.buckets=u.sort((function(e,t){return e>t?1:-1})),e.set(c(e.buckets)),e.observe=e.observe.bind(a(e)),e}var r,l;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,e),r=t,l=[{key:"observe",value:function(e,t){var r=this.get(t);null==r&&(r=this.set(c(this.buckets),t).get(t)),r.value.raw.push(e),r.value.entries["+Inf"]+=1;var i=function(e,t){if(t<e[e.length-1])for(var r=0;r<e.length;r+=1)if(t<=e[r])return r}(this.buckets,e);if(null!=i)for(var o=i;o<this.buckets.length;o+=1){var s=r.value.entries[this.buckets[o].toString()];r.value.entries[this.buckets[o].toString()]=s+1}return r.value.sum=(0,n.sum)(r.value.raw),r.value.count+=1,this}},{key:"reset",value:function(e){this.set(c(this.buckets),e)}}],l&&o(r.prototype,l),t}(r(3399).Collector);t.Histogram=l},4427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={};t.default=void 0;var i=r(4961),o=r(5262);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=function(){return new i.Registry}},4961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Registry=void 0;var n=r(6486),i=r(4486),o=r(1993),s=r(8215),a=r(3701);function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var c=function(){function e(){var t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=void 0,(t="data")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.data={counter:{},gauge:{},histogram:{}}}var t,r;return t=e,r=[{key:"validateInput",value:function(e,t,r,i){if(""===String(t))throw new Error("Metric name cannot be empty");if(-1===["counter","gauge","histogram"].indexOf(e))throw new Error("Unknown metric type ".concat(e));if("string"!=typeof r&&null!=r)throw new Error("help must be string or undefined/null");if((0,n.has)(this.data,"".concat(e,".").concat(t)))throw new Error("A metric with the name '".concat(t,"' already exists for type '").concat(e,"'"));if(!Array.isArray(i)&&null!=i)throw new Error("buckets must be array or undefined/null")}},{key:"create",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return this.validateInput(e,t,n,a),"counter"===e?(r=new i.Counter,this.data.counter[t]={help:n,instance:r,type:e}):"gauge"===e?(r=new o.Gauge,this.data.gauge[t]={help:n,instance:r,type:e}):(r=new s.Histogram(a),this.data.histogram[t]={help:n,instance:r,type:e}),r}},{key:"metrics",value:function(){return(0,n.reduce)(this.data,(function(e,t,r){return e+(0,n.reduce)(t,(function(e,t,i){var o=t.instance.collect(),s=e;return t.help.length>0&&(s+="# HELP ".concat(i," ").concat(t.help,"\n")),(s+="# TYPE ".concat(i," ").concat(r,"\n"))+(0,n.reduce)(o,(function(e,t){return e+("histogram"===r?(0,a.formatHistogramOrSummary)(i,t):(0,a.formatCounterOrGauge)(i,t))}),"")}),"")}),"")}},{key:"reset",value:function(){return(0,n.each)(this.data,(function(e){(0,n.each)(e,(function(e){e.instance.resetAll()}))})),this}},{key:"clear",value:function(){return this.data={counter:{},gauge:{},histogram:{}},this}},{key:"get",value:function(e,t){var r=(null!=e?[this.data[e]]:(0,n.valuesIn)(this.data)).find((function(e){return(0,n.has)(e,t)}));return null!=r?r[t].instance:void 0}}],r&&u(t.prototype,r),e}();t.Registry=c},5262:()=>{},3701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatHistogramOrSummary=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"le",i="",o=function(e){var t=(0,n.map)(e.labels,(function(e,t){return"".concat(t,'="').concat(e,'"')}));return 0===t.length?"":"".concat(t.join(","))}(t);return o.length>0?(i+="".concat(e,"_count{").concat(o,"} ").concat(t.value.count,"\n"),i+="".concat(e,"_sum{").concat(o,"} ").concat(t.value.sum,"\n")):(i+="".concat(e,"_count ").concat(t.value.count,"\n"),i+="".concat(e,"_sum ").concat(t.value.sum,"\n")),(0,n.reduce)(t.value.entries,(function(t,n,s){return o.length>0?i+="".concat(e,"_bucket{").concat(r,'="').concat(s,'",').concat(o,"} ").concat(n,"\n"):i+="".concat(e,"_bucket{").concat(r,'="').concat(s,'"} ').concat(n,"\n"),i}),i)},t.findExistingMetric=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e?(0,n.find)(t,(function(t){return(0,n.isEqual)(t.labels,e)})):t[0]},t.formatCounterOrGauge=function(e,t){var r=" ".concat(t.value.toString());if(null==t.labels||0===Object.keys(t.labels).length)return"".concat(e).concat(r,"\n");var i=(0,n.map)(t.labels,(function(e,t){return"".concat(t,'="').concat(e,'"')}));return"".concat(e,"{").concat(i.join(","),"}").concat(r,"\n")};var n=r(6486)},4375:(e,t,r)=>{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},1798:(e,t,r)=>{"use strict";var n=r(4155),i=65536,o=r(9509).Buffer,s=r.g.crypto||r.g.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(e);if(e>0)if(e>i)for(var a=0;a<e;a+=i)s.getRandomValues(r.slice(a,a+i));else s.getRandomValues(r);return"function"==typeof t?n.nextTick((function(){t(null,r)})):r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},4281:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,s,a,u;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var c=("number"!=typeof u&&(u=0),u+1>(a=e).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6753:(e,t,r)=>{"use strict";var n=r(4155),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r(9481),s=r(4229);r(5717)(l,o);for(var a=i(s.prototype),u=0;u<a.length;u++){var c=a[u];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},2725:(e,t,r)=>{"use strict";e.exports=i;var n=r(4605);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(5717)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},9481:(e,t,r)=>{"use strict";var n,i=r(4155);e.exports=O,O.ReadableState=T,r(7187).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=r(2503),u=r(8764).Buffer,c=r.g.Uint8Array||function(){},l=r(4616);o=l&&l.debuglog?l.debuglog("stream"):function(){};var f,h,d,p=r(7327),v=r(1195),m=r(2457).getHighWaterMark,g=r(4281).q,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,_=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(O,a);var S=v.errorOrDestroy,E=["error","close","destroy","pause","resume"];function T(e,t,i){n=n||r(6753),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(2553).s),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function O(e){if(n=n||r(6753),!(this instanceof O))return new O(e);var t=this instanceof n;this._readableState=new T(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function C(e,t,r,n,i){o("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?M(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,A(e)))}}(e,a);else if(i||(s=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),s)S(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)a.endEmitted?S(e,new w):x(e,a,t,!0);else if(a.ended)S(e,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?x(e,a,t,!1):j(e,a)):x(e,a,t,!1)}else n||(a.reading=!1,j(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function x(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&M(e)),j(e,t)}Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),O.prototype.destroy=v.destroy,O.prototype._undestroy=v.undestroy,O.prototype._destroy=function(e,t){t(e)},O.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),C(this,e,t,!1,r)},O.prototype.unshift=function(e){return C(this,e,null,!0,!1)},O.prototype.isPaused=function(){return!1===this._readableState.flowing},O.prototype.setEncoding=function(e){f||(f=r(2553).s);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var P=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function M(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(A,e))}function A(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function j(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(k,e,t))}function k(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){o("readable nexttick read 0"),e.read(0)}function N(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(B,t,e))}function B(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function W(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}O.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):M(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(n=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},O.prototype._read=function(e){S(this,new _("_read()"))},O.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?v:u;function u(){o("onend"),e.end()}n.endEmitted?i.nextTick(a):r.once("end",a),e.on("unpipe",(function t(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",v),r.removeListener("data",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}));var c=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",c);var l=!1;function f(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==W(n.pipes,e))&&!l&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){o("onerror",t),v(),e.removeListener("error",h),0===s(e,"error")&&S(e,t)}function d(){e.removeListener("finish",p),v()}function p(){o("onfinish"),e.removeListener("close",d),v()}function v(){o("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},O.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=W(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},O.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?M(this):n.reading||i.nextTick(D,this))),r},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(I,this),r},O.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(I,this),t},O.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(N,e,t))}(this,e)),e.paused=!1,this},O.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},O.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(O.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(5850)),h(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),O._fromList=F,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(O.from=function(e,t){return void 0===d&&(d=r(5167)),d(O,e,t)})},4605:(e,t,r)=>{"use strict";e.exports=l;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(5717)(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},4229:(e,t,r)=>{"use strict";var n,i=r(4155);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=O,O.WritableState=T;var s,a={deprecate:r(4927)},u=r(2503),c=r(8764).Buffer,l=r.g.Uint8Array||function(){},f=r(1195),h=r(2457).getHighWaterMark,d=r(4281).q,p=d.ERR_INVALID_ARG_TYPE,v=d.ERR_METHOD_NOT_IMPLEMENTED,m=d.ERR_MULTIPLE_CALLBACK,g=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,b=d.ERR_STREAM_NULL_VALUES,_=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,S=f.errorOrDestroy;function E(){}function T(e,t,s){n=n||r(6753),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(A,e,t),e._writableState.errorEmitted=!0,S(e,n)):(o(n),e._writableState.errorEmitted=!0,S(e,n),A(e,t))}(e,r,n,t,o);else{var s=R(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||P(e,r),n?i.nextTick(x,e,r,s,o):x(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function O(e){var t=this instanceof(n=n||r(6753));if(!t&&!s.call(O,this))return new O(e);this._writableState=new T(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function C(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function x(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function P(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,C(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(C(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function M(e,t){e._final((function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var r=R(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(M,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(5717)(O,u),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(O,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===O&&e&&e._writableState instanceof T}})):s=function(e){return e instanceof this},O.prototype.pipe=function(){S(this,new g)},O.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,c.isBuffer(n)||n instanceof l);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(e,t){var r=new _;S(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new b:"string"==typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(S(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,a,n,i,o);return u}(this,o,a,e,t,r)),s},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||P(this,e))},O.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(e,t,r){r(new v("_write()"))},O.prototype._writev=null,O.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),O.prototype.destroy=f.destroy,O.prototype._undestroy=f.undestroy,O.prototype._destroy=function(e,t){t(e)}},5850:(e,t,r)=>{"use strict";var n,i=r(4155);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function v(e){var t=e[a];if(null!==t){var r=e[d].read();null!==r&&(e[f]=null,e[a]=null,e[u]=null,t(p(r,!1)))}}function m(e){i.nextTick(v,e)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[c]?r(e[c]):t(p(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[l]?r(p(void 0,!0)):t[h](r,n)}),n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),g);e.exports=function(e){var t,r=Object.create(y,(o(t={},d,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,l,{value:e._readableState.endEmitted,writable:!0}),o(t,h,{value:function(e,t){var n=r[d].read();n?(r[f]=null,r[a]=null,r[u]=null,e(p(n,!1))):(r[a]=e,r[u]=t)},writable:!0}),t));return r[f]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[f]=null,r[a]=null,r[u]=null,t(e)),void(r[c]=e)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[u]=null,n(p(void 0,!0))),r[l]=!0})),e.on("readable",m.bind(null,r)),r}},7327:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=r(8764).Buffer,a=r(2361).inspect,u=a&&a.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,s.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return a(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],r&&o(t.prototype,r),e}()},1195:(e,t,r)=>{"use strict";var n=r(4155);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},8610:(e,t,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||l()},c=t._writableState&&t._writableState.finished,l=function(){a=!1,c=!0,s||o.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,f=!0,a||o.call(t)},d=function(e){o.call(t,e)},p=function(){var e;return s&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},v=function(){t.req.on("finish",l)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",l),t.on("abort",p),t.req?v():t.on("request",v)):a&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",h),t.on("finish",l),!1!==r.error&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",v),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",h),t.removeListener("error",d),t.removeListener("close",p)}}},5167:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(e,t,r)=>{"use strict";var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var l,f=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var h=t.map((function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);a=!0,o()}));var u=!1;return function(t){if(!a&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,(function(e){l||(l=e),e&&h.forEach(u),o||(h.forEach(u),f(l))}))}));return t.reduce(c)}},2457:(e,t,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},2503:(e,t,r)=>{e.exports=r(7187).EventEmitter},8473:(e,t,r)=>{(t=e.exports=r(9481)).Stream=t,t.Readable=t,t.Writable=r(4229),t.Duplex=r(6753),t.Transform=r(4605),t.PassThrough=r(2725),t.finished=r(8610),t.pipeline=r(9946)},2872:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.interval=t.iif=t.generate=t.fromEventPattern=t.fromEvent=t.from=t.forkJoin=t.empty=t.defer=t.connectable=t.concat=t.combineLatest=t.bindNodeCallback=t.bindCallback=t.UnsubscriptionError=t.TimeoutError=t.SequenceError=t.ObjectUnsubscribedError=t.NotFoundError=t.EmptyError=t.ArgumentOutOfRangeError=t.firstValueFrom=t.lastValueFrom=t.isObservable=t.identity=t.noop=t.pipe=t.NotificationKind=t.Notification=t.Subscriber=t.Subscription=t.Scheduler=t.VirtualAction=t.VirtualTimeScheduler=t.animationFrameScheduler=t.animationFrame=t.queueScheduler=t.queue=t.asyncScheduler=t.async=t.asapScheduler=t.asap=t.AsyncSubject=t.ReplaySubject=t.BehaviorSubject=t.Subject=t.animationFrames=t.observable=t.ConnectableObservable=t.Observable=void 0,t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.combineLatestWith=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=t.config=t.NEVER=t.EMPTY=t.scheduled=t.zip=t.using=t.timer=t.throwError=t.range=t.race=t.partition=t.pairs=t.onErrorResumeNext=t.of=t.never=t.merge=void 0,t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.pairwise=t.onErrorResumeNextWith=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=t.mergeAll=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=void 0,t.zipWith=t.zipAll=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=void 0;var o=r(2419);Object.defineProperty(t,"Observable",{enumerable:!0,get:function(){return o.Observable}});var s=r(9518);Object.defineProperty(t,"ConnectableObservable",{enumerable:!0,get:function(){return s.ConnectableObservable}});var a=r(2801);Object.defineProperty(t,"observable",{enumerable:!0,get:function(){return a.observable}});var u=r(9106);Object.defineProperty(t,"animationFrames",{enumerable:!0,get:function(){return u.animationFrames}});var c=r(3032);Object.defineProperty(t,"Subject",{enumerable:!0,get:function(){return c.Subject}});var l=r(5240);Object.defineProperty(t,"BehaviorSubject",{enumerable:!0,get:function(){return l.BehaviorSubject}});var f=r(3274);Object.defineProperty(t,"ReplaySubject",{enumerable:!0,get:function(){return f.ReplaySubject}});var h=r(280);Object.defineProperty(t,"AsyncSubject",{enumerable:!0,get:function(){return h.AsyncSubject}});var d=r(580);Object.defineProperty(t,"asap",{enumerable:!0,get:function(){return d.asap}}),Object.defineProperty(t,"asapScheduler",{enumerable:!0,get:function(){return d.asapScheduler}});var p=r(2445);Object.defineProperty(t,"async",{enumerable:!0,get:function(){return p.async}}),Object.defineProperty(t,"asyncScheduler",{enumerable:!0,get:function(){return p.asyncScheduler}});var v=r(8615);Object.defineProperty(t,"queue",{enumerable:!0,get:function(){return v.queue}}),Object.defineProperty(t,"queueScheduler",{enumerable:!0,get:function(){return v.queueScheduler}});var m=r(3660);Object.defineProperty(t,"animationFrame",{enumerable:!0,get:function(){return m.animationFrame}}),Object.defineProperty(t,"animationFrameScheduler",{enumerable:!0,get:function(){return m.animationFrameScheduler}});var g=r(4123);Object.defineProperty(t,"VirtualTimeScheduler",{enumerable:!0,get:function(){return g.VirtualTimeScheduler}}),Object.defineProperty(t,"VirtualAction",{enumerable:!0,get:function(){return g.VirtualAction}});var y=r(218);Object.defineProperty(t,"Scheduler",{enumerable:!0,get:function(){return y.Scheduler}});var b=r(3865);Object.defineProperty(t,"Subscription",{enumerable:!0,get:function(){return b.Subscription}});var _=r(5125);Object.defineProperty(t,"Subscriber",{enumerable:!0,get:function(){return _.Subscriber}});var w=r(3104);Object.defineProperty(t,"Notification",{enumerable:!0,get:function(){return w.Notification}}),Object.defineProperty(t,"NotificationKind",{enumerable:!0,get:function(){return w.NotificationKind}});var S=r(9985);Object.defineProperty(t,"pipe",{enumerable:!0,get:function(){return S.pipe}});var E=r(2576);Object.defineProperty(t,"noop",{enumerable:!0,get:function(){return E.noop}});var T=r(4781);Object.defineProperty(t,"identity",{enumerable:!0,get:function(){return T.identity}});var O=r(8386);Object.defineProperty(t,"isObservable",{enumerable:!0,get:function(){return O.isObservable}});var C=r(9309);Object.defineProperty(t,"lastValueFrom",{enumerable:!0,get:function(){return C.lastValueFrom}});var x=r(8182);Object.defineProperty(t,"firstValueFrom",{enumerable:!0,get:function(){return x.firstValueFrom}});var P=r(2351);Object.defineProperty(t,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return P.ArgumentOutOfRangeError}});var R=r(9474);Object.defineProperty(t,"EmptyError",{enumerable:!0,get:function(){return R.EmptyError}});var M=r(8598);Object.defineProperty(t,"NotFoundError",{enumerable:!0,get:function(){return M.NotFoundError}});var A=r(2642);Object.defineProperty(t,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return A.ObjectUnsubscribedError}});var j=r(6156);Object.defineProperty(t,"SequenceError",{enumerable:!0,get:function(){return j.SequenceError}});var k=r(4173);Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return k.TimeoutError}});var I=r(4805);Object.defineProperty(t,"UnsubscriptionError",{enumerable:!0,get:function(){return I.UnsubscriptionError}});var D=r(3050);Object.defineProperty(t,"bindCallback",{enumerable:!0,get:function(){return D.bindCallback}});var N=r(8130);Object.defineProperty(t,"bindNodeCallback",{enumerable:!0,get:function(){return N.bindNodeCallback}});var L=r(9258);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return L.combineLatest}});var F=r(2239);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return F.concat}});var U=r(2873);Object.defineProperty(t,"connectable",{enumerable:!0,get:function(){return U.connectable}});var B=r(7885);Object.defineProperty(t,"defer",{enumerable:!0,get:function(){return B.defer}});var W=r(6332);Object.defineProperty(t,"empty",{enumerable:!0,get:function(){return W.empty}});var V=r(7245);Object.defineProperty(t,"forkJoin",{enumerable:!0,get:function(){return V.forkJoin}});var q=r(5432);Object.defineProperty(t,"from",{enumerable:!0,get:function(){return q.from}});var z=r(3267);Object.defineProperty(t,"fromEvent",{enumerable:!0,get:function(){return z.fromEvent}});var H=r(470);Object.defineProperty(t,"fromEventPattern",{enumerable:!0,get:function(){return H.fromEventPattern}});var G=r(4303);Object.defineProperty(t,"generate",{enumerable:!0,get:function(){return G.generate}});var $=r(1757);Object.defineProperty(t,"iif",{enumerable:!0,get:function(){return $.iif}});var Y=r(8990);Object.defineProperty(t,"interval",{enumerable:!0,get:function(){return Y.interval}});var K=r(1846);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return K.merge}});var X=r(1339);Object.defineProperty(t,"never",{enumerable:!0,get:function(){return X.never}});var J=r(5726);Object.defineProperty(t,"of",{enumerable:!0,get:function(){return J.of}});var Z=r(724);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return Z.onErrorResumeNext}});var Q=r(4380);Object.defineProperty(t,"pairs",{enumerable:!0,get:function(){return Q.pairs}});var ee=r(7273);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ee.partition}});var te=r(5182);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return te.race}});var re=r(322);Object.defineProperty(t,"range",{enumerable:!0,get:function(){return re.range}});var ne=r(2098);Object.defineProperty(t,"throwError",{enumerable:!0,get:function(){return ne.throwError}});var ie=r(7513);Object.defineProperty(t,"timer",{enumerable:!0,get:function(){return ie.timer}});var oe=r(2962);Object.defineProperty(t,"using",{enumerable:!0,get:function(){return oe.using}});var se=r(7654);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return se.zip}});var ae=r(5207);Object.defineProperty(t,"scheduled",{enumerable:!0,get:function(){return ae.scheduled}});var ue=r(6332);Object.defineProperty(t,"EMPTY",{enumerable:!0,get:function(){return ue.EMPTY}});var ce=r(1339);Object.defineProperty(t,"NEVER",{enumerable:!0,get:function(){return ce.NEVER}}),i(r(8433),t);var le=r(3280);Object.defineProperty(t,"config",{enumerable:!0,get:function(){return le.config}});var fe=r(6474);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return fe.audit}});var he=r(5382);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return he.auditTime}});var de=r(9715);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return de.buffer}});var pe=r(3814);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return pe.bufferCount}});var ve=r(7211);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return ve.bufferTime}});var me=r(4943);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return me.bufferToggle}});var ge=r(1240);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return ge.bufferWhen}});var ye=r(9548);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return ye.catchError}});var be=r(2128);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return be.combineAll}});var _e=r(3240);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return _e.combineLatestAll}});var we=r(5024);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return we.combineLatestWith}});var Se=r(4413);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return Se.concatAll}});var Ee=r(7498);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return Ee.concatMap}});var Te=r(6109);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return Te.concatMapTo}});var Oe=r(9664);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return Oe.concatWith}});var Ce=r(1995);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return Ce.connect}});var xe=r(993);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return xe.count}});var Pe=r(496);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return Pe.debounce}});var Re=r(1385);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return Re.debounceTime}});var Me=r(1658);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return Me.defaultIfEmpty}});var Ae=r(5841);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return Ae.delay}});var je=r(8798);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return je.delayWhen}});var ke=r(1080);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return ke.dematerialize}});var Ie=r(3054);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return Ie.distinct}});var De=r(8737);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return De.distinctUntilChanged}});var Ne=r(7957);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Ne.distinctUntilKeyChanged}});var Le=r(8633);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return Le.elementAt}});var Fe=r(911);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return Fe.endWith}});var Ue=r(2096);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return Ue.every}});var Be=r(67);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return Be.exhaust}});var We=r(5337);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return We.exhaustAll}});var Ve=r(5635);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return Ve.exhaustMap}});var qe=r(9745);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return qe.expand}});var ze=r(9154);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return ze.filter}});var He=r(9283);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return He.finalize}});var Ge=r(7119);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return Ge.find}});var $e=r(4706);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return $e.findIndex}});var Ye=r(9219);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return Ye.first}});var Ke=r(9749);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return Ke.groupBy}});var Xe=r(9438);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return Xe.ignoreElements}});var Je=r(8515);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return Je.isEmpty}});var Ze=r(2435);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return Ze.last}});var Qe=r(7291);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return Qe.map}});var et=r(8313);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return et.mapTo}});var tt=r(3209);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return tt.materialize}});var rt=r(2620);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return rt.max}});var nt=r(3783);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return nt.mergeAll}});var it=r(1788);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return it.flatMap}});var ot=r(9475);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ot.mergeMap}});var st=r(1211);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return st.mergeMapTo}});var at=r(7267);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return at.mergeScan}});var ut=r(9303);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ut.mergeWith}});var ct=r(9714);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ct.min}});var lt=r(3848);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return lt.multicast}});var ft=r(1184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return ft.observeOn}});var ht=r(7582);Object.defineProperty(t,"onErrorResumeNextWith",{enumerable:!0,get:function(){return ht.onErrorResumeNextWith}});var dt=r(2731);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return dt.pairwise}});var pt=r(4691);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return pt.pluck}});var vt=r(4474);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return vt.publish}});var mt=r(52);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return mt.publishBehavior}});var gt=r(2110);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return gt.publishLast}});var yt=r(9864);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return yt.publishReplay}});var bt=r(179);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return bt.raceWith}});var _t=r(122);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return _t.reduce}});var wt=r(5313);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return wt.repeat}});var St=r(4068);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return St.repeatWhen}});var Et=r(64);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return Et.retry}});var Tt=r(1188);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return Tt.retryWhen}});var Ot=r(8739);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return Ot.refCount}});var Ct=r(4193);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Ct.sample}});var xt=r(6170);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return xt.sampleTime}});var Pt=r(5876);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Pt.scan}});var Rt=r(1791);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Rt.sequenceEqual}});var Mt=r(5137);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return Mt.share}});var At=r(1348);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return At.shareReplay}});var jt=r(8242);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return jt.single}});var kt=r(3169);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return kt.skip}});var It=r(2454);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return It.skipLast}});var Dt=r(6931);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return Dt.skipUntil}});var Nt=r(7913);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return Nt.skipWhile}});var Lt=r(9234);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Lt.startWith}});var Ft=r(276);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return Ft.subscribeOn}});var Ut=r(9253);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return Ut.switchAll}});var Bt=r(8518);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Bt.switchMap}});var Wt=r(1173);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Wt.switchMapTo}});var Vt=r(3855);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Vt.switchScan}});var qt=r(4783);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return qt.take}});var zt=r(1980);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return zt.takeLast}});var Ht=r(9845);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Ht.takeUntil}});var Gt=r(6060);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return Gt.takeWhile}});var $t=r(1138);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return $t.tap}});var Yt=r(7306);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return Yt.throttle}});var Kt=r(8968);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return Kt.throttleTime}});var Xt=r(1779);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return Xt.throwIfEmpty}});var Jt=r(8005);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Jt.timeInterval}});var Zt=r(4173);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Zt.timeout}});var Qt=r(7223);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Qt.timeoutWith}});var er=r(8975);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return er.timestamp}});var tr=r(2);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return tr.toArray}});var rr=r(2826);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return rr.window}});var nr=r(7526);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return nr.windowCount}});var ir=r(8294);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return ir.windowTime}});var or=r(1883);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return or.windowToggle}});var sr=r(4309);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return sr.windowWhen}});var ar=r(3041);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return ar.withLatestFrom}});var ur=r(8593);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return ur.zipAll}});var cr=r(8096);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return cr.zipWith}})},280:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncSubject=void 0;var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return i(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))},t}(r(3032).Subject);t.AsyncSubject=o},5240:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BehaviorSubject=void 0;var o=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(r(3032).Subject);t.BehaviorSubject=o},3104:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeNotification=t.Notification=t.NotificationKind=void 0;var n,i=r(6332),o=r(5726),s=r(2098),a=r(3005);(n=t.NotificationKind||(t.NotificationKind={})).NEXT="N",n.ERROR="E",n.COMPLETE="C";var u=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){return c(this,e)},e.prototype.do=function(e,t,r){var n=this,i=n.kind,o=n.value,s=n.error;return"N"===i?null==e?void 0:e(o):"E"===i?null==t?void 0:t(s):null==r?void 0:r()},e.prototype.accept=function(e,t,r){var n;return a.isFunction(null===(n=e)||void 0===n?void 0:n.next)?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,n=e.error,a="N"===t?o.of(r):"E"===t?s.throwError((function(){return n})):"C"===t?i.EMPTY:0;if(!a)throw new TypeError("Unexpected notification kind "+t);return a},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();function c(e,t){var r,n,i,o=e,s=o.kind,a=o.value,u=o.error;if("string"!=typeof s)throw new TypeError('Invalid notification, missing "kind"');"N"===s?null===(r=t.next)||void 0===r||r.call(t,a):"E"===s?null===(n=t.error)||void 0===n||n.call(t,u):null===(i=t.complete)||void 0===i||i.call(t)}t.Notification=u,t.observeNotification=c},7286:(e,t)=>{"use strict";function r(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.createNotification=t.nextNotification=t.errorNotification=t.COMPLETE_NOTIFICATION=void 0,t.COMPLETE_NOTIFICATION=r("C",void 0,void 0),t.errorNotification=function(e){return r("E",void 0,e)},t.nextNotification=function(e){return r("N",e,void 0)},t.createNotification=r},2419:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var n=r(5125),i=r(3865),o=r(2801),s=r(9985),a=r(3280),u=r(3005),c=r(6110),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var o,s=this,a=(o=e)&&o instanceof n.Subscriber||function(e){return e&&u.isFunction(e.next)&&u.isFunction(e.error)&&u.isFunction(e.complete)}(o)&&i.isSubscription(o)?e:new n.SafeSubscriber(e,t,r);return c.errorContext((function(){var e=s,t=e.operator,r=e.source;a.add(t?t.call(a,r):r?s._subscribe(a):s._trySubscribe(a))})),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=f(t))((function(t,i){var o=new n.SafeSubscriber({next:function(t){try{e(t)}catch(e){i(e),o.unsubscribe()}},error:i,complete:t});r.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:a.config.Promise)&&void 0!==t?t:Promise}t.Observable=l},3274:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ReplaySubject=void 0;var o=r(3032),s=r(7950),a=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=s.dateTimestampProvider);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return i(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,u=1;u<n.length&&n[u]<=s;u+=2)a=u;a&&n.splice(0,a+1)}},t}(o.Subject);t.ReplaySubject=a},218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=void 0;var n=r(7950),i=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=n.dateTimestampProvider.now,e}();t.Scheduler=i},3032:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousSubject=t.Subject=void 0;var s=r(2419),a=r(3865),u=r(2642),c=r(6967),l=r(6110),f=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype.lift=function(e){var t=new h(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new u.ObjectUnsubscribedError},t.prototype.next=function(e){var t=this;l.errorContext((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=o(t.currentObservers),s=i.next();!s.done;s=i.next())s.value.next(e)}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;l.errorContext((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;l.errorContext((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?a.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new a.Subscription((function(){t.currentObservers=null,c.arrRemove(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new s.Observable;return e.source=this,e},t.create=function(e,t){return new h(e,t)},t}(s.Observable);t.Subject=f;var h=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return i(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:a.EMPTY_SUBSCRIPTION},t}(f);t.AnonymousSubject=h},5125:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_OBSERVER=t.SafeSubscriber=t.Subscriber=void 0;var o=r(3005),s=r(3865),a=r(3280),u=r(7968),c=r(2576),l=r(7286),f=r(4590),h=r(6110),d=function(e){function r(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,s.isSubscription(r)&&r.add(n)):n.destination=t.EMPTY_OBSERVER,n}return i(r,e),r.create=function(e,t,r){return new g(e,t,r)},r.prototype.next=function(e){this.isStopped?b(l.nextNotification(e),this):this._next(e)},r.prototype.error=function(e){this.isStopped?b(l.errorNotification(e),this):(this.isStopped=!0,this._error(e))},r.prototype.complete=function(){this.isStopped?b(l.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(e){this.destination.next(e)},r.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(s.Subscription);t.Subscriber=d;var p=Function.prototype.bind;function v(e,t){return p.call(e,t)}var m=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){y(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){y(e)}else y(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){y(e)}},e}(),g=function(e){function t(t,r,n){var i,s,u=e.call(this)||this;return o.isFunction(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:u&&a.config.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},i={next:t.next&&v(t.next,s),error:t.error&&v(t.error,s),complete:t.complete&&v(t.complete,s)}):i=t,u.destination=new m(i),u}return i(t,e),t}(d);function y(e){a.config.useDeprecatedSynchronousErrorHandling?h.captureError(e):u.reportUnhandledError(e)}function b(e,t){var r=a.config.onStoppedNotification;r&&f.timeoutProvider.setTimeout((function(){return r(e,t)}))}t.SafeSubscriber=g,t.EMPTY_OBSERVER={closed:!0,next:c.noop,error:function(e){throw e},complete:c.noop}},3865:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.isSubscription=t.EMPTY_SUBSCRIPTION=t.Subscription=void 0;var s=r(3005),a=r(4805),u=r(6967),c=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,u,c;if(!this.closed){this.closed=!0;var f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var h=n(f),d=h.next();!d.done;d=h.next())d.value.remove(this)}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}else f.remove(this);var p=this.initialTeardown;if(s.isFunction(p))try{p()}catch(e){c=e instanceof a.UnsubscriptionError?e.errors:[e]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var m=n(v),g=m.next();!g.done;g=m.next()){var y=g.value;try{l(y)}catch(e){c=null!=c?c:[],e instanceof a.UnsubscriptionError?c=o(o([],i(c)),i(e.errors)):c.push(e)}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(u=m.return)&&u.call(m)}finally{if(r)throw r.error}}}if(c)throw new a.UnsubscriptionError(c)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&u.arrRemove(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&u.arrRemove(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function l(e){s.isFunction(e)?e():e.unsubscribe()}t.Subscription=c,t.EMPTY_SUBSCRIPTION=c.EMPTY,t.isSubscription=function(e){return e instanceof c||e&&"closed"in e&&s.isFunction(e.remove)&&s.isFunction(e.add)&&s.isFunction(e.unsubscribe)}},3280:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=void 0,t.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},8182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.firstValueFrom=void 0;var n=r(9474),i=r(5125);t.firstValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(o,s){var a=new i.SafeSubscriber({next:function(e){o(e),a.unsubscribe()},error:s,complete:function(){r?o(t.defaultValue):s(new n.EmptyError)}});e.subscribe(a)}))}},9309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastValueFrom=void 0;var n=r(9474);t.lastValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(i,o){var s,a=!1;e.subscribe({next:function(e){s=e,a=!0},error:o,complete:function(){a?i(s):r?i(t.defaultValue):o(new n.EmptyError)}})}))}},9518:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectableObservable=void 0;var o=r(2419),s=r(3865),a=r(8739),u=r(4990),c=r(4935),l=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,c.hasLift(t)&&(n.lift=t.lift),n}return i(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new s.Subscription;var r=this.getSubject();t.add(this.source.subscribe(u.createOperatorSubscriber(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=s.Subscription.EMPTY)}return t},t.prototype.refCount=function(){return a.refCount()(this)},t}(o.Observable);t.ConnectableObservable=l},3050:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallback=void 0;var n=r(9592);t.bindCallback=function(e,t,r){return n.bindCallbackInternals(!1,e,t,r)}},9592:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallbackInternals=void 0;var o=r(9016),s=r(2419),a=r(276),u=r(1914),c=r(1184),l=r(280);t.bindCallbackInternals=function e(t,r,f,h){if(f){if(!o.isScheduler(f))return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r,h).apply(this,n).pipe(u.mapOneOrManyArgs(f))};h=f}return h?function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r).apply(this,n).pipe(a.subscribeOn(h),c.observeOn(h))}:function(){for(var e=this,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var u=new l.AsyncSubject,c=!0;return new s.Observable((function(s){var a=u.subscribe(s);if(c){c=!1;var l=!1,f=!1;r.apply(e,i(i([],n(o)),[function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(t){var n=e.shift();if(null!=n)return void u.error(n)}u.next(1<e.length?e:e[0]),f=!0,l&&u.complete()}])),f&&u.complete(),l=!0}return a}))}}},8130:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindNodeCallback=void 0;var n=r(9592);t.bindNodeCallback=function(e,t,r){return n.bindCallbackInternals(!0,e,t,r)}},9258:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestInit=t.combineLatest=void 0;var n=r(2419),i=r(1203),o=r(5432),s=r(4781),a=r(1914),u=r(2433),c=r(641),l=r(4990),f=r(7738);function h(e,t,r){return void 0===r&&(r=s.identity),function(n){d(t,(function(){for(var i=e.length,s=new Array(i),a=i,u=i,c=function(i){d(t,(function(){var c=o.from(e[i],t),f=!1;c.subscribe(l.createOperatorSubscriber(n,(function(e){s[i]=e,f||(f=!0,u--),u||n.next(r(s.slice()))}),(function(){--a||n.complete()})))}),n)},f=0;f<i;f++)c(f)}),n)}}function d(e,t,r){e?f.executeSchedule(r,e,t):t()}t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=u.popScheduler(e),l=u.popResultSelector(e),f=i.argsArgArrayOrObject(e),d=f.args,p=f.keys;if(0===d.length)return o.from([],r);var v=new n.Observable(h(d,r,p?function(e){return c.createObject(p,e)}:s.identity));return l?v.pipe(a.mapOneOrManyArgs(l)):v},t.combineLatestInit=h},2239:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var n=r(4413),i=r(2433),o=r(5432);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.concatAll()(o.from(e,i.popScheduler(e)))}},2873:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connectable=void 0;var n=r(3032),i=r(2419),o=r(7885),s={connector:function(){return new n.Subject},resetOnDisconnect:!0};t.connectable=function(e,t){void 0===t&&(t=s);var r=null,n=t.connector,a=t.resetOnDisconnect,u=void 0===a||a,c=n(),l=new i.Observable((function(e){return c.subscribe(e)}));return l.connect=function(){return r&&!r.closed||(r=o.defer((function(){return e})).subscribe(c),u&&r.add((function(){return c=n()}))),r},l}},7885:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defer=void 0;var n=r(2419),i=r(7103);t.defer=function(e){return new n.Observable((function(t){i.innerFrom(e()).subscribe(t)}))}},9106:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrames=void 0;var n=r(2419),i=r(6813),o=r(505);function s(e){return new n.Observable((function(t){var r=e||i.performanceTimestampProvider,n=r.now(),s=0,a=function(){t.closed||(s=o.animationFrameProvider.requestAnimationFrame((function(i){s=0;var o=r.now();t.next({timestamp:e?o:i,elapsed:o-n}),a()})))};return a(),function(){s&&o.animationFrameProvider.cancelAnimationFrame(s)}}))}t.animationFrames=function(e){return e?s(e):a};var a=s()},6332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.empty=t.EMPTY=void 0;var n=r(2419);t.EMPTY=new n.Observable((function(e){return e.complete()})),t.empty=function(e){return e?function(e){return new n.Observable((function(t){return e.schedule((function(){return t.complete()}))}))}(e):t.EMPTY}},7245:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forkJoin=void 0;var n=r(2419),i=r(1203),o=r(7103),s=r(2433),a=r(4990),u=r(1914),c=r(641);t.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popResultSelector(e),l=i.argsArgArrayOrObject(e),f=l.args,h=l.keys,d=new n.Observable((function(e){var t=f.length;if(t)for(var r=new Array(t),n=t,i=t,s=function(t){var s=!1;o.innerFrom(f[t]).subscribe(a.createOperatorSubscriber(e,(function(e){s||(s=!0,i--),r[t]=e}),(function(){return n--}),void 0,(function(){n&&s||(i||e.next(h?c.createObject(h,r):r),e.complete())})))},u=0;u<t;u++)s(u);else e.complete()}));return r?d.pipe(u.mapOneOrManyArgs(r)):d}},5432:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.from=void 0;var n=r(5207),i=r(7103);t.from=function(e,t){return t?n.scheduled(e,t):i.innerFrom(e)}},3267:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0}),t.fromEvent=void 0;var i=r(7103),o=r(2419),s=r(9475),a=r(3909),u=r(3005),c=r(1914),l=["addListener","removeListener"],f=["addEventListener","removeEventListener"],h=["on","off"];function d(e,t){return function(r){return function(n){return e[r](t,n)}}}t.fromEvent=function e(t,r,p,v){if(u.isFunction(p)&&(v=p,p=void 0),v)return e(t,r,p).pipe(c.mapOneOrManyArgs(v));var m=n(function(e){return u.isFunction(e.addEventListener)&&u.isFunction(e.removeEventListener)}(t)?f.map((function(e){return function(n){return t[e](r,n,p)}})):function(e){return u.isFunction(e.addListener)&&u.isFunction(e.removeListener)}(t)?l.map(d(t,r)):function(e){return u.isFunction(e.on)&&u.isFunction(e.off)}(t)?h.map(d(t,r)):[],2),g=m[0],y=m[1];if(!g&&a.isArrayLike(t))return s.mergeMap((function(t){return e(t,r,p)}))(i.innerFrom(t));if(!g)throw new TypeError("Invalid event target");return new o.Observable((function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}},470:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromEventPattern=void 0;var n=r(2419),i=r(3005),o=r(1914);t.fromEventPattern=function e(t,r,s){return s?e(t,r).pipe(o.mapOneOrManyArgs(s)):new n.Observable((function(e){var n=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1===t.length?t[0]:t)},o=t(n);return i.isFunction(r)?function(){return r(n,o)}:void 0}))}},851:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromSubscribable=void 0;var n=r(2419);t.fromSubscribable=function(e){return new n.Observable((function(t){return e.subscribe(t)}))}},4303:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.generate=void 0;var i=r(4781),o=r(9016),s=r(7885),a=r(1297);t.generate=function(e,t,r,u,c){var l,f,h,d;function p(){var e;return n(this,(function(n){switch(n.label){case 0:e=d,n.label=1;case 1:return t&&!t(e)?[3,4]:[4,h(e)];case 2:n.sent(),n.label=3;case 3:return e=r(e),[3,1];case 4:return[2]}}))}return 1===arguments.length?(d=(l=e).initialState,t=l.condition,r=l.iterate,f=l.resultSelector,h=void 0===f?i.identity:f,c=l.scheduler):(d=e,!u||o.isScheduler(u)?(h=i.identity,c=u):h=u),s.defer(c?function(){return a.scheduleIterable(p(),c)}:p)}},1757:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iif=void 0;var n=r(7885);t.iif=function(e,t,r){return n.defer((function(){return e()?t:r}))}},7103:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof s?s(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.fromReadableStreamLike=t.fromAsyncIterable=t.fromIterable=t.fromPromise=t.fromArrayLike=t.fromInteropObservable=t.innerFrom=void 0;var a=r(3909),u=r(6018),c=r(2419),l=r(9500),f=r(9595),h=r(9906),d=r(2743),p=r(7823),v=r(3005),m=r(7968),g=r(2801);function y(e){return new c.Observable((function(t){var r=e[g.observable]();if(v.isFunction(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}function b(e){return new c.Observable((function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()}))}function _(e){return new c.Observable((function(t){e.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,m.reportUnhandledError)}))}function w(e){return new c.Observable((function(t){var r,n;try{for(var i=s(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()}))}function S(e){return new c.Observable((function(t){(function(e,t){var r,s,a,u;return n(this,void 0,void 0,(function(){var n,c;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,6,11]),r=o(e),i.label=1;case 1:return[4,r.next()];case 2:if((s=i.sent()).done)return[3,4];if(n=s.value,t.next(n),t.closed)return[2];i.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=i.sent(),a={error:c},[3,11];case 6:return i.trys.push([6,,9,10]),s&&!s.done&&(u=r.return)?[4,u.call(r)]:[3,8];case 7:i.sent(),i.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function E(e){return S(p.readableStreamLikeToAsyncGenerator(e))}t.innerFrom=function(e){if(e instanceof c.Observable)return e;if(null!=e){if(l.isInteropObservable(e))return y(e);if(a.isArrayLike(e))return b(e);if(u.isPromise(e))return _(e);if(f.isAsyncIterable(e))return S(e);if(d.isIterable(e))return w(e);if(p.isReadableStreamLike(e))return E(e)}throw h.createInvalidObservableTypeError(e)},t.fromInteropObservable=y,t.fromArrayLike=b,t.fromPromise=_,t.fromIterable=w,t.fromAsyncIterable=S,t.fromReadableStreamLike=E},8990:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.interval=void 0;var n=r(2445),i=r(7513);t.interval=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=n.asyncScheduler),e<0&&(e=0),i.timer(e,e,t)}},1846:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var n=r(3783),i=r(7103),o=r(6332),s=r(2433),a=r(5432);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popScheduler(e),u=s.popNumber(e,1/0),c=e;return c.length?1===c.length?i.innerFrom(c[0]):n.mergeAll(u)(a.from(c,r)):o.EMPTY}},1339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.never=t.NEVER=void 0;var n=r(2419),i=r(2576);t.NEVER=new n.Observable(i.noop),t.never=function(){return t.NEVER}},5726:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.of=void 0;var n=r(2433),i=r(5432);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=n.popScheduler(e);return i.from(e,r)}},724:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=void 0;var n=r(2419),i=r(5498),o=r(4990),s=r(2576),a=r(7103);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.argsOrArgArray(e);return new n.Observable((function(e){var t=0,n=function(){if(t<r.length){var i=void 0;try{i=a.innerFrom(r[t++])}catch(e){return void n()}var u=new o.OperatorSubscriber(e,void 0,s.noop,s.noop);i.subscribe(u),u.add(n)}else e.complete()};n()}))}},4380:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairs=void 0;var n=r(5432);t.pairs=function(e,t){return n.from(Object.entries(e),t)}},7273:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(8634),i=r(9154),o=r(7103);t.partition=function(e,t,r){return[i.filter(t,r)(o.innerFrom(e)),i.filter(n.not(t,r))(o.innerFrom(e))]}},5182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.raceInit=t.race=void 0;var n=r(2419),i=r(7103),o=r(5498),s=r(4990);function a(e){return function(t){for(var r=[],n=function(n){r.push(i.innerFrom(e[n]).subscribe(s.createOperatorSubscriber(t,(function(e){if(r){for(var i=0;i<r.length;i++)i!==n&&r[i].unsubscribe();r=null}t.next(e)}))))},o=0;r&&!t.closed&&o<e.length;o++)n(o)}}t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=o.argsOrArgArray(e)).length?i.innerFrom(e[0]):new n.Observable(a(e))},t.raceInit=a},322:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.range=void 0;var n=r(2419),i=r(6332);t.range=function(e,t,r){if(null==t&&(t=e,e=0),t<=0)return i.EMPTY;var o=t+e;return new n.Observable(r?function(t){var n=e;return r.schedule((function(){n<o?(t.next(n++),this.schedule()):t.complete()}))}:function(t){for(var r=e;r<o&&!t.closed;)t.next(r++);t.complete()})}},2098:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwError=void 0;var n=r(2419),i=r(3005);t.throwError=function(e,t){var r=i.isFunction(e)?e:function(){return e},o=function(e){return e.error(r())};return new n.Observable(t?function(e){return t.schedule(o,0,e)}:o)}},7513:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timer=void 0;var n=r(2419),i=r(2445),o=r(9016),s=r(1677);t.timer=function(e,t,r){void 0===e&&(e=0),void 0===r&&(r=i.async);var a=-1;return null!=t&&(o.isScheduler(t)?r=t:a=t),new n.Observable((function(t){var n=s.isValidDate(e)?+e-r.now():e;n<0&&(n=0);var i=0;return r.schedule((function(){t.closed||(t.next(i++),0<=a?this.schedule(void 0,a):t.complete())}),n)}))}},2962:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.using=void 0;var n=r(2419),i=r(7103),o=r(6332);t.using=function(e,t){return new n.Observable((function(r){var n=e(),s=t(n);return(s?i.innerFrom(s):o.EMPTY).subscribe(r),function(){n&&n.unsubscribe()}}))}},7654:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(2419),s=r(7103),a=r(5498),u=r(6332),c=r(4990),l=r(2433);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e),f=a.argsOrArgArray(e);return f.length?new o.Observable((function(e){var t=f.map((function(){return[]})),o=f.map((function(){return!1}));e.add((function(){t=o=null}));for(var a=function(a){s.innerFrom(f[a]).subscribe(c.createOperatorSubscriber(e,(function(s){if(t[a].push(s),t.every((function(e){return e.length}))){var u=t.map((function(e){return e.shift()}));e.next(r?r.apply(void 0,i([],n(u))):u),t.some((function(e,t){return!e.length&&o[t]}))&&e.complete()}}),(function(){o[a]=!0,!t[a].length&&e.complete()})))},u=0;!e.closed&&u<f.length;u++)a(u);return function(){t=o=null}})):u.EMPTY}},4990:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OperatorSubscriber=t.createOperatorSubscriber=void 0;var o=r(5125);t.createOperatorSubscriber=function(e,t,r,n,i){return new s(e,t,r,n,i)};var s=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return i(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(o.Subscriber);t.OperatorSubscriber=s},6474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.audit=void 0;var n=r(4935),i=r(7103),o=r(4990);t.audit=function(e){return n.operate((function(t,r){var n=!1,s=null,a=null,u=!1,c=function(){if(null==a||a.unsubscribe(),a=null,n){n=!1;var e=s;s=null,r.next(e)}u&&r.complete()},l=function(){a=null,u&&r.complete()};t.subscribe(o.createOperatorSubscriber(r,(function(t){n=!0,s=t,a||i.innerFrom(e(t)).subscribe(a=o.createOperatorSubscriber(r,c,l))}),(function(){u=!0,(!n||!a||a.closed)&&r.complete()})))}))}},5382:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.auditTime=void 0;var n=r(2445),i=r(6474),o=r(7513);t.auditTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.audit((function(){return o.timer(e,t)}))}},9715:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buffer=void 0;var n=r(4935),i=r(2576),o=r(4990),s=r(7103);t.buffer=function(e){return n.operate((function(t,r){var n=[];return t.subscribe(o.createOperatorSubscriber(r,(function(e){return n.push(e)}),(function(){r.next(n),r.complete()}))),s.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){var e=n;n=[],r.next(e)}),i.noop)),function(){n=null}}))}},3814:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferCount=void 0;var i=r(4935),o=r(4990),s=r(6967);t.bufferCount=function(e,t){return void 0===t&&(t=null),t=null!=t?t:e,i.operate((function(r,i){var a=[],u=0;r.subscribe(o.createOperatorSubscriber(i,(function(r){var o,c,l,f,h=null;u++%t==0&&a.push([]);try{for(var d=n(a),p=d.next();!p.done;p=d.next())(g=p.value).push(r),e<=g.length&&(h=null!=h?h:[]).push(g)}catch(e){o={error:e}}finally{try{p&&!p.done&&(c=d.return)&&c.call(d)}finally{if(o)throw o.error}}if(h)try{for(var v=n(h),m=v.next();!m.done;m=v.next()){var g=m.value;s.arrRemove(a,g),i.next(g)}}catch(e){l={error:e}}finally{try{m&&!m.done&&(f=v.return)&&f.call(v)}finally{if(l)throw l.error}}}),(function(){var e,t;try{for(var r=n(a),o=r.next();!o.done;o=r.next()){var s=o.value;i.next(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.complete()}),void 0,(function(){a=null})))}))}},7211:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferTime=void 0;var i=r(3865),o=r(4935),s=r(4990),a=r(6967),u=r(2445),c=r(2433),l=r(7738);t.bufferTime=function(e){for(var t,r,f=[],h=1;h<arguments.length;h++)f[h-1]=arguments[h];var d=null!==(t=c.popScheduler(f))&&void 0!==t?t:u.asyncScheduler,p=null!==(r=f[0])&&void 0!==r?r:null,v=f[1]||1/0;return o.operate((function(t,r){var o=[],u=!1,c=function(e){var t=e.buffer;e.subs.unsubscribe(),a.arrRemove(o,e),r.next(t),u&&f()},f=function(){if(o){var t=new i.Subscription;r.add(t);var n={buffer:[],subs:t};o.push(n),l.executeSchedule(t,d,(function(){return c(n)}),e)}};null!==p&&p>=0?l.executeSchedule(r,d,f,p,!0):u=!0,f();var h=s.createOperatorSubscriber(r,(function(e){var t,r,i=o.slice();try{for(var s=n(i),a=s.next();!a.done;a=s.next()){var u=a.value,l=u.buffer;l.push(e),v<=l.length&&c(u)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}),(function(){for(;null==o?void 0:o.length;)r.next(o.shift().buffer);null==h||h.unsubscribe(),r.complete(),r.unsubscribe()}),void 0,(function(){return o=null}));t.subscribe(h)}))}},4943:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferToggle=void 0;var i=r(3865),o=r(4935),s=r(7103),a=r(4990),u=r(2576),c=r(6967);t.bufferToggle=function(e,t){return o.operate((function(r,o){var l=[];s.innerFrom(e).subscribe(a.createOperatorSubscriber(o,(function(e){var r=[];l.push(r);var n=new i.Subscription;n.add(s.innerFrom(t(e)).subscribe(a.createOperatorSubscriber(o,(function(){c.arrRemove(l,r),o.next(r),n.unsubscribe()}),u.noop)))}),u.noop)),r.subscribe(a.createOperatorSubscriber(o,(function(e){var t,r;try{for(var i=n(l),o=i.next();!o.done;o=i.next())o.value.push(e)}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}),(function(){for(;l.length>0;)o.next(l.shift());o.complete()})))}))}},1240:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bufferWhen=void 0;var n=r(4935),i=r(2576),o=r(4990),s=r(7103);t.bufferWhen=function(e){return n.operate((function(t,r){var n=null,a=null,u=function(){null==a||a.unsubscribe();var t=n;n=[],t&&r.next(t),s.innerFrom(e()).subscribe(a=o.createOperatorSubscriber(r,u,i.noop))};u(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==n?void 0:n.push(e)}),(function(){n&&r.next(n),r.complete()}),void 0,(function(){return n=a=null})))}))}},9548:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catchError=void 0;var n=r(7103),i=r(4990),o=r(4935);t.catchError=function e(t){return o.operate((function(r,o){var s,a=null,u=!1;a=r.subscribe(i.createOperatorSubscriber(o,void 0,void 0,(function(i){s=n.innerFrom(t(i,e(t)(r))),a?(a.unsubscribe(),a=null,s.subscribe(o)):u=!0}))),u&&(a.unsubscribe(),a=null,s.subscribe(o))}))}},2128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineAll=void 0;var n=r(3240);t.combineAll=n.combineLatestAll},6318:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatest=void 0;var o=r(9258),s=r(4935),a=r(5498),u=r(1914),c=r(9985),l=r(2433);t.combineLatest=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var f=l.popResultSelector(t);return f?c.pipe(e.apply(void 0,i([],n(t))),u.mapOneOrManyArgs(f)):s.operate((function(e,r){o.combineLatestInit(i([e],n(a.argsOrArgArray(t))))(r)}))}},3240:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestAll=void 0;var n=r(9258),i=r(2069);t.combineLatestAll=function(e){return i.joinAllInternals(n.combineLatest,e)}},5024:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestWith=void 0;var o=r(6318);t.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.combineLatest.apply(void 0,i([],n(e)))}},4919:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var o=r(4935),s=r(4413),a=r(2433),u=r(5432);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=a.popScheduler(e);return o.operate((function(t,o){s.concatAll()(u.from(i([t],n(e)),r)).subscribe(o)}))}},4413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatAll=void 0;var n=r(3783);t.concatAll=function(){return n.mergeAll(1)}},7498:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMap=void 0;var n=r(9475),i=r(3005);t.concatMap=function(e,t){return i.isFunction(t)?n.mergeMap(e,t,1):n.mergeMap(e,1)}},6109:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMapTo=void 0;var n=r(7498),i=r(3005);t.concatMapTo=function(e,t){return i.isFunction(t)?n.concatMap((function(){return e}),t):n.concatMap((function(){return e}))}},9664:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concatWith=void 0;var o=r(4919);t.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.concat.apply(void 0,i([],n(e)))}},1995:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;var n=r(3032),i=r(7103),o=r(4935),s=r(851),a={connector:function(){return new n.Subject}};t.connect=function(e,t){void 0===t&&(t=a);var r=t.connector;return o.operate((function(t,n){var o=r();i.innerFrom(e(s.fromSubscribable(o))).subscribe(n),n.add(t.subscribe(o))}))}},993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.count=void 0;var n=r(122);t.count=function(e){return n.reduce((function(t,r,n){return!e||e(r,n)?t+1:t}),0)}},496:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0;var n=r(4935),i=r(2576),o=r(4990),s=r(7103);t.debounce=function(e){return n.operate((function(t,r){var n=!1,a=null,u=null,c=function(){if(null==u||u.unsubscribe(),u=null,n){n=!1;var e=a;a=null,r.next(e)}};t.subscribe(o.createOperatorSubscriber(r,(function(t){null==u||u.unsubscribe(),n=!0,a=t,u=o.createOperatorSubscriber(r,c,i.noop),s.innerFrom(e(t)).subscribe(u)}),(function(){c(),r.complete()}),void 0,(function(){a=u=null})))}))}},1385:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounceTime=void 0;var n=r(2445),i=r(4935),o=r(4990);t.debounceTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.operate((function(r,n){var i=null,s=null,a=null,u=function(){if(i){i.unsubscribe(),i=null;var e=s;s=null,n.next(e)}};function c(){var r=a+e,o=t.now();if(o<r)return i=this.schedule(void 0,r-o),void n.add(i);u()}r.subscribe(o.createOperatorSubscriber(n,(function(r){s=r,a=t.now(),i||(i=t.schedule(c,e),n.add(i))}),(function(){u(),n.complete()}),void 0,(function(){s=i=null})))}))}},1658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultIfEmpty=void 0;var n=r(4935),i=r(4990);t.defaultIfEmpty=function(e){return n.operate((function(t,r){var n=!1;t.subscribe(i.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){n||r.next(e),r.complete()})))}))}},5841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0;var n=r(2445),i=r(8798),o=r(7513);t.delay=function(e,t){void 0===t&&(t=n.asyncScheduler);var r=o.timer(e,t);return i.delayWhen((function(){return r}))}},8798:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delayWhen=void 0;var n=r(2239),i=r(4783),o=r(9438),s=r(8313),a=r(9475),u=r(7103);t.delayWhen=function e(t,r){return r?function(s){return n.concat(r.pipe(i.take(1),o.ignoreElements()),s.pipe(e(t)))}:a.mergeMap((function(e,r){return u.innerFrom(t(e,r)).pipe(i.take(1),s.mapTo(e))}))}},1080:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dematerialize=void 0;var n=r(3104),i=r(4935),o=r(4990);t.dematerialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){return n.observeNotification(e,t)})))}))}},3054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinct=void 0;var n=r(4935),i=r(4990),o=r(2576),s=r(7103);t.distinct=function(e,t){return n.operate((function(r,n){var a=new Set;r.subscribe(i.createOperatorSubscriber(n,(function(t){var r=e?e(t):t;a.has(r)||(a.add(r),n.next(t))}))),t&&s.innerFrom(t).subscribe(i.createOperatorSubscriber(n,(function(){return a.clear()}),o.noop))}))}},8737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilChanged=void 0;var n=r(4781),i=r(4935),o=r(4990);function s(e,t){return e===t}t.distinctUntilChanged=function(e,t){return void 0===t&&(t=n.identity),e=null!=e?e:s,i.operate((function(r,n){var i,s=!0;r.subscribe(o.createOperatorSubscriber(n,(function(r){var o=t(r);!s&&e(i,o)||(s=!1,i=o,n.next(r))})))}))}},7957:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilKeyChanged=void 0;var n=r(8737);t.distinctUntilKeyChanged=function(e,t){return n.distinctUntilChanged((function(r,n){return t?t(r[e],n[e]):r[e]===n[e]}))}},8633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementAt=void 0;var n=r(2351),i=r(9154),o=r(1779),s=r(1658),a=r(4783);t.elementAt=function(e,t){if(e<0)throw new n.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(u){return u.pipe(i.filter((function(t,r){return r===e})),a.take(1),r?s.defaultIfEmpty(t):o.throwIfEmpty((function(){return new n.ArgumentOutOfRangeError})))}}},911:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.endWith=void 0;var o=r(2239),s=r(5726);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return o.concat(t,s.of.apply(void 0,i([],n(e))))}}},2096:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.every=void 0;var n=r(4935),i=r(4990);t.every=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(i){e.call(t,i,o++,r)||(n.next(!1),n.complete())}),(function(){n.next(!0),n.complete()})))}))}},67:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaust=void 0;var n=r(5337);t.exhaust=n.exhaustAll},5337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustAll=void 0;var n=r(5635),i=r(4781);t.exhaustAll=function(){return n.exhaustMap(i.identity)}},5635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustMap=void 0;var n=r(7291),i=r(7103),o=r(4935),s=r(4990);t.exhaustMap=function e(t,r){return r?function(o){return o.pipe(e((function(e,o){return i.innerFrom(t(e,o)).pipe(n.map((function(t,n){return r(e,t,o,n)})))})))}:o.operate((function(e,r){var n=0,o=null,a=!1;e.subscribe(s.createOperatorSubscriber(r,(function(e){o||(o=s.createOperatorSubscriber(r,void 0,(function(){o=null,a&&r.complete()})),i.innerFrom(t(e,n++)).subscribe(o))}),(function(){a=!0,!o&&r.complete()})))}))}},9745:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expand=void 0;var n=r(4935),i=r(7788);t.expand=function(e,t,r){return void 0===t&&(t=1/0),t=(t||0)<1?1/0:t,n.operate((function(n,o){return i.mergeInternals(n,o,e,t,void 0,!0,r)}))}},9154:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filter=void 0;var n=r(4935),i=r(4990);t.filter=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){return e.call(t,r,o++)&&n.next(r)})))}))}},9283:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.finalize=void 0;var n=r(4935);t.finalize=function(e){return n.operate((function(t,r){try{t.subscribe(r)}finally{r.add(e)}}))}},7119:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFind=t.find=void 0;var n=r(4935),i=r(4990);function o(e,t,r){var n="index"===r;return function(r,o){var s=0;r.subscribe(i.createOperatorSubscriber(o,(function(i){var a=s++;e.call(t,i,a,r)&&(o.next(n?a:i),o.complete())}),(function(){o.next(n?-1:void 0),o.complete()})))}}t.find=function(e,t){return n.operate(o(e,t,"value"))},t.createFind=o},4706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findIndex=void 0;var n=r(4935),i=r(7119);t.findIndex=function(e,t){return n.operate(i.createFind(e,t,"index"))}},9219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.first=void 0;var n=r(9474),i=r(9154),o=r(4783),s=r(1658),a=r(1779),u=r(4781);t.first=function(e,t){var r=arguments.length>=2;return function(c){return c.pipe(e?i.filter((function(t,r){return e(t,r,c)})):u.identity,o.take(1),r?s.defaultIfEmpty(t):a.throwIfEmpty((function(){return new n.EmptyError})))}}},1788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flatMap=void 0;var n=r(9475);t.flatMap=n.mergeMap},9749:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupBy=void 0;var n=r(2419),i=r(7103),o=r(3032),s=r(4935),a=r(4990);t.groupBy=function(e,t,r,u){return s.operate((function(s,c){var l;t&&"function"!=typeof t?(r=t.duration,l=t.element,u=t.connector):l=t;var f=new Map,h=function(e){f.forEach(e),e(c)},d=function(e){return h((function(t){return t.error(e)}))},p=0,v=!1,m=new a.OperatorSubscriber(c,(function(t){try{var s=e(t),h=f.get(s);if(!h){f.set(s,h=u?u():new o.Subject);var g=(b=s,_=h,(w=new n.Observable((function(e){p++;var t=_.subscribe(e);return function(){t.unsubscribe(),0==--p&&v&&m.unsubscribe()}}))).key=b,w);if(c.next(g),r){var y=a.createOperatorSubscriber(h,(function(){h.complete(),null==y||y.unsubscribe()}),void 0,void 0,(function(){return f.delete(s)}));m.add(i.innerFrom(r(g)).subscribe(y))}}h.next(l?l(t):t)}catch(e){d(e)}var b,_,w}),(function(){return h((function(e){return e.complete()}))}),d,(function(){return f.clear()}),(function(){return v=!0,0===p}));s.subscribe(m)}))}},9438:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ignoreElements=void 0;var n=r(4935),i=r(4990),o=r(2576);t.ignoreElements=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,o.noop))}))}},8515:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=void 0;var n=r(4935),i=r(4990);t.isEmpty=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,(function(){t.next(!1),t.complete()}),(function(){t.next(!0),t.complete()})))}))}},2069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.joinAllInternals=void 0;var n=r(4781),i=r(1914),o=r(9985),s=r(9475),a=r(2);t.joinAllInternals=function(e,t){return o.pipe(a.toArray(),s.mergeMap((function(t){return e(t)})),t?i.mapOneOrManyArgs(t):n.identity)}},2435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.last=void 0;var n=r(9474),i=r(9154),o=r(1980),s=r(1779),a=r(1658),u=r(4781);t.last=function(e,t){var r=arguments.length>=2;return function(c){return c.pipe(e?i.filter((function(t,r){return e(t,r,c)})):u.identity,o.takeLast(1),r?a.defaultIfEmpty(t):s.throwIfEmpty((function(){return new n.EmptyError})))}}},7291:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.map=void 0;var n=r(4935),i=r(4990);t.map=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){n.next(e.call(t,r,o++))})))}))}},8313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapTo=void 0;var n=r(7291);t.mapTo=function(e){return n.map((function(){return e}))}},3209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.materialize=void 0;var n=r(3104),i=r(4935),o=r(4990);t.materialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){t.next(n.Notification.createNext(e))}),(function(){t.next(n.Notification.createComplete()),t.complete()}),(function(e){t.next(n.Notification.createError(e)),t.complete()})))}))}},2620:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.max=void 0;var n=r(122),i=r(3005);t.max=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})}},9821:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var o=r(4935),s=r(5498),a=r(3783),u=r(2433),c=r(5432);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=u.popScheduler(e),l=u.popNumber(e,1/0);return e=s.argsOrArgArray(e),o.operate((function(t,o){a.mergeAll(l)(c.from(i([t],n(e)),r)).subscribe(o)}))}},3783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=void 0;var n=r(9475),i=r(4781);t.mergeAll=function(e){return void 0===e&&(e=1/0),n.mergeMap(i.identity,e)}},7788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeInternals=void 0;var n=r(7103),i=r(7738),o=r(4990);t.mergeInternals=function(e,t,r,s,a,u,c,l){var f=[],h=0,d=0,p=!1,v=function(){!p||f.length||h||t.complete()},m=function(e){return h<s?g(e):f.push(e)},g=function(e){u&&t.next(e),h++;var l=!1;n.innerFrom(r(e,d++)).subscribe(o.createOperatorSubscriber(t,(function(e){null==a||a(e),u?m(e):t.next(e)}),(function(){l=!0}),void 0,(function(){if(l)try{h--;for(var e=function(){var e=f.shift();c?i.executeSchedule(t,c,(function(){return g(e)})):g(e)};f.length&&h<s;)e();v()}catch(e){t.error(e)}})))};return e.subscribe(o.createOperatorSubscriber(t,m,(function(){p=!0,v()}))),function(){null==l||l()}}},9475:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMap=void 0;var n=r(7291),i=r(7103),o=r(4935),s=r(7788),a=r(3005);t.mergeMap=function e(t,r,u){return void 0===u&&(u=1/0),a.isFunction(r)?e((function(e,o){return n.map((function(t,n){return r(e,t,o,n)}))(i.innerFrom(t(e,o)))}),u):("number"==typeof r&&(u=r),o.operate((function(e,r){return s.mergeInternals(e,r,t,u)})))}},1211:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMapTo=void 0;var n=r(9475),i=r(3005);t.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),i.isFunction(t)?n.mergeMap((function(){return e}),t,r):("number"==typeof t&&(r=t),n.mergeMap((function(){return e}),r))}},7267:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeScan=void 0;var n=r(4935),i=r(7788);t.mergeScan=function(e,t,r){return void 0===r&&(r=1/0),n.operate((function(n,o){var s=t;return i.mergeInternals(n,o,(function(t,r){return e(s,t,r)}),r,(function(e){s=e}),!1,void 0,(function(){return s=null}))}))}},9303:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mergeWith=void 0;var o=r(9821);t.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.merge.apply(void 0,i([],n(e)))}},9714:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.min=void 0;var n=r(122),i=r(3005);t.min=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)<0?t:r}:function(e,t){return e<t?e:t})}},3848:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multicast=void 0;var n=r(9518),i=r(3005),o=r(1995);t.multicast=function(e,t){var r=i.isFunction(e)?e:function(){return e};return i.isFunction(t)?o.connect(t,{connector:r}):function(e){return new n.ConnectableObservable(e,r)}}},1184:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeOn=void 0;var n=r(7738),i=r(4935),o=r(4990);t.observeOn=function(e,t){return void 0===t&&(t=0),i.operate((function(r,i){r.subscribe(o.createOperatorSubscriber(i,(function(r){return n.executeSchedule(i,e,(function(){return i.next(r)}),t)}),(function(){return n.executeSchedule(i,e,(function(){return i.complete()}),t)}),(function(r){return n.executeSchedule(i,e,(function(){return i.error(r)}),t)})))}))}},7582:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=t.onErrorResumeNextWith=void 0;var o=r(5498),s=r(724);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=o.argsOrArgArray(e);return function(e){return s.onErrorResumeNext.apply(void 0,i([e],n(r)))}}t.onErrorResumeNextWith=a,t.onErrorResumeNext=a},2731:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairwise=void 0;var n=r(4935),i=r(4990);t.pairwise=function(){return n.operate((function(e,t){var r,n=!1;e.subscribe(i.createOperatorSubscriber(t,(function(e){var i=r;r=e,n&&t.next([i,e]),n=!0})))}))}},5649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(8634),i=r(9154);t.partition=function(e,t){return function(r){return[i.filter(e,t)(r),i.filter(n.not(e,t))(r)]}}},4691:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pluck=void 0;var n=r(7291);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw new Error("list of properties cannot be empty.");return n.map((function(t){for(var n=t,i=0;i<r;i++){var o=null==n?void 0:n[e[i]];if(void 0===o)return;n=o}return n}))}},4474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publish=void 0;var n=r(3032),i=r(3848),o=r(1995);t.publish=function(e){return e?function(t){return o.connect(e)(t)}:function(e){return i.multicast(new n.Subject)(e)}}},52:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishBehavior=void 0;var n=r(5240),i=r(9518);t.publishBehavior=function(e){return function(t){var r=new n.BehaviorSubject(e);return new i.ConnectableObservable(t,(function(){return r}))}}},2110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishLast=void 0;var n=r(280),i=r(9518);t.publishLast=function(){return function(e){var t=new n.AsyncSubject;return new i.ConnectableObservable(e,(function(){return t}))}}},9864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishReplay=void 0;var n=r(3274),i=r(3848),o=r(3005);t.publishReplay=function(e,t,r,s){r&&!o.isFunction(r)&&(s=r);var a=o.isFunction(r)?r:void 0;return function(r){return i.multicast(new n.ReplaySubject(e,t,s),a)(r)}}},9764:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.race=void 0;var o=r(5498),s=r(179);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.raceWith.apply(void 0,i([],n(o.argsOrArgArray(e))))}},179:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.raceWith=void 0;var o=r(5182),s=r(4935),a=r(4781);t.raceWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length?s.operate((function(t,r){o.raceInit(i([t],n(e)))(r)})):a.identity}},122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduce=void 0;var n=r(8345),i=r(4935);t.reduce=function(e,t){return i.operate(n.scanInternals(e,t,arguments.length>=2,!1,!0))}},8739:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refCount=void 0;var n=r(4935),i=r(4990);t.refCount=function(){return n.operate((function(e,t){var r=null;e._refCount++;var n=i.createOperatorSubscriber(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))}},5313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeat=void 0;var n=r(6332),i=r(4935),o=r(4990),s=r(7103),a=r(7513);t.repeat=function(e){var t,r,u=1/0;return null!=e&&("object"==typeof e?(t=e.count,u=void 0===t?1/0:t,r=e.delay):u=e),u<=0?function(){return n.EMPTY}:i.operate((function(e,t){var n,i=0,c=function(){if(null==n||n.unsubscribe(),n=null,null!=r){var e="number"==typeof r?a.timer(r):s.innerFrom(r(i)),u=o.createOperatorSubscriber(t,(function(){u.unsubscribe(),l()}));e.subscribe(u)}else l()},l=function(){var r=!1;n=e.subscribe(o.createOperatorSubscriber(t,void 0,(function(){++i<u?n?c():r=!0:t.complete()}))),r&&c()};l()}))}},4068:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeatWhen=void 0;var n=r(7103),i=r(3032),o=r(4935),s=r(4990);t.repeatWhen=function(e){return o.operate((function(t,r){var o,a,u=!1,c=!1,l=!1,f=function(){return l&&c&&(r.complete(),!0)},h=function(){l=!1,o=t.subscribe(s.createOperatorSubscriber(r,void 0,(function(){l=!0,!f()&&(a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){o?h():u=!0}),(function(){c=!0,f()})))),a).next()}))),u&&(o.unsubscribe(),o=null,u=!1,h())};h()}))}},64:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retry=void 0;var n=r(4935),i=r(4990),o=r(4781),s=r(7513),a=r(7103);t.retry=function(e){var t;void 0===e&&(e=1/0);var r=(t=e&&"object"==typeof e?e:{count:e}).count,u=void 0===r?1/0:r,c=t.delay,l=t.resetOnSuccess,f=void 0!==l&&l;return u<=0?o.identity:n.operate((function(e,t){var r,n=0,o=function(){var l=!1;r=e.subscribe(i.createOperatorSubscriber(t,(function(e){f&&(n=0),t.next(e)}),void 0,(function(e){if(n++<u){var f=function(){r?(r.unsubscribe(),r=null,o()):l=!0};if(null!=c){var h="number"==typeof c?s.timer(c):a.innerFrom(c(e,n)),d=i.createOperatorSubscriber(t,(function(){d.unsubscribe(),f()}),(function(){t.complete()}));h.subscribe(d)}else f()}else t.error(e)}))),l&&(r.unsubscribe(),r=null,o())};o()}))}},1188:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retryWhen=void 0;var n=r(7103),i=r(3032),o=r(4935),s=r(4990);t.retryWhen=function(e){return o.operate((function(t,r){var o,a,u=!1,c=function(){o=t.subscribe(s.createOperatorSubscriber(r,void 0,void 0,(function(t){a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){return o?c():u=!0})))),a&&a.next(t)}))),u&&(o.unsubscribe(),o=null,u=!1,c())};c()}))}},4193:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sample=void 0;var n=r(7103),i=r(4935),o=r(2576),s=r(4990);t.sample=function(e){return i.operate((function(t,r){var i=!1,a=null;t.subscribe(s.createOperatorSubscriber(r,(function(e){i=!0,a=e}))),n.innerFrom(e).subscribe(s.createOperatorSubscriber(r,(function(){if(i){i=!1;var e=a;a=null,r.next(e)}}),o.noop))}))}},6170:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleTime=void 0;var n=r(2445),i=r(4193),o=r(8990);t.sampleTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.sample(o.interval(e,t))}},5876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scan=void 0;var n=r(4935),i=r(8345);t.scan=function(e,t){return n.operate(i.scanInternals(e,t,arguments.length>=2,!0))}},8345:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scanInternals=void 0;var n=r(4990);t.scanInternals=function(e,t,r,i,o){return function(s,a){var u=r,c=t,l=0;s.subscribe(n.createOperatorSubscriber(a,(function(t){var r=l++;c=u?e(c,t,r):(u=!0,t),i&&a.next(c)}),o&&function(){u&&a.next(c),a.complete()}))}}},1791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sequenceEqual=void 0;var n=r(4935),i=r(4990),o=r(7103);t.sequenceEqual=function(e,t){return void 0===t&&(t=function(e,t){return e===t}),n.operate((function(r,n){var s={buffer:[],complete:!1},a={buffer:[],complete:!1},u=function(e){n.next(e),n.complete()},c=function(e,r){var o=i.createOperatorSubscriber(n,(function(n){var i=r.buffer,o=r.complete;0===i.length?o?u(!1):e.buffer.push(n):!t(n,i.shift())&&u(!1)}),(function(){e.complete=!0;var t=r.complete,n=r.buffer;t&&u(0===n.length),null==o||o.unsubscribe()}));return o};r.subscribe(c(s,a)),o.innerFrom(e).subscribe(c(a,s))}))}},5137:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.share=void 0;var o=r(7103),s=r(3032),a=r(5125),u=r(4935);function c(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(!0!==t){if(!1!==t){var u=new a.SafeSubscriber({next:function(){u.unsubscribe(),e()}});return o.innerFrom(t.apply(void 0,i([],n(r)))).subscribe(u)}}else e()}t.share=function(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new s.Subject}:t,n=e.resetOnError,i=void 0===n||n,l=e.resetOnComplete,f=void 0===l||l,h=e.resetOnRefCountZero,d=void 0===h||h;return function(e){var t,n,s,l=0,h=!1,p=!1,v=function(){null==n||n.unsubscribe(),n=void 0},m=function(){v(),t=s=void 0,h=p=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return u.operate((function(e,u){l++,p||h||v();var y=s=null!=s?s:r();u.add((function(){0!=--l||p||h||(n=c(g,d))})),y.subscribe(u),!t&&l>0&&(t=new a.SafeSubscriber({next:function(e){return y.next(e)},error:function(e){p=!0,v(),n=c(m,i,e),y.error(e)},complete:function(){h=!0,v(),n=c(m,f),y.complete()}}),o.innerFrom(e).subscribe(t))}))(e)}}},1348:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shareReplay=void 0;var n=r(3274),i=r(5137);t.shareReplay=function(e,t,r){var o,s,a,u,c=!1;return e&&"object"==typeof e?(o=e.bufferSize,u=void 0===o?1/0:o,s=e.windowTime,t=void 0===s?1/0:s,c=void 0!==(a=e.refCount)&&a,r=e.scheduler):u=null!=e?e:1/0,i.share({connector:function(){return new n.ReplaySubject(u,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:c})}},8242:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.single=void 0;var n=r(9474),i=r(6156),o=r(8598),s=r(4935),a=r(4990);t.single=function(e){return s.operate((function(t,r){var s,u=!1,c=!1,l=0;t.subscribe(a.createOperatorSubscriber(r,(function(n){c=!0,e&&!e(n,l++,t)||(u&&r.error(new i.SequenceError("Too many matching values")),u=!0,s=n)}),(function(){u?(r.next(s),r.complete()):r.error(c?new o.NotFoundError("No matching values"):new n.EmptyError)})))}))}},3169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skip=void 0;var n=r(9154);t.skip=function(e){return n.filter((function(t,r){return e<=r}))}},2454:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipLast=void 0;var n=r(4781),i=r(4935),o=r(4990);t.skipLast=function(e){return e<=0?n.identity:i.operate((function(t,r){var n=new Array(e),i=0;return t.subscribe(o.createOperatorSubscriber(r,(function(t){var o=i++;if(o<e)n[o]=t;else{var s=o%e,a=n[s];n[s]=t,r.next(a)}}))),function(){n=null}}))}},6931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipUntil=void 0;var n=r(4935),i=r(4990),o=r(7103),s=r(2576);t.skipUntil=function(e){return n.operate((function(t,r){var n=!1,a=i.createOperatorSubscriber(r,(function(){null==a||a.unsubscribe(),n=!0}),s.noop);o.innerFrom(e).subscribe(a),t.subscribe(i.createOperatorSubscriber(r,(function(e){return n&&r.next(e)})))}))}},7913:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipWhile=void 0;var n=r(4935),i=r(4990);t.skipWhile=function(e){return n.operate((function(t,r){var n=!1,o=0;t.subscribe(i.createOperatorSubscriber(r,(function(t){return(n||(n=!e(t,o++)))&&r.next(t)})))}))}},9234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startWith=void 0;var n=r(2239),i=r(2433),o=r(4935);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.popScheduler(e);return o.operate((function(t,i){(r?n.concat(e,t,r):n.concat(e,t)).subscribe(i)}))}},276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeOn=void 0;var n=r(4935);t.subscribeOn=function(e,t){return void 0===t&&(t=0),n.operate((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}},9253:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchAll=void 0;var n=r(8518),i=r(4781);t.switchAll=function(){return n.switchMap(i.identity)}},8518:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMap=void 0;var n=r(7103),i=r(4935),o=r(4990);t.switchMap=function(e,t){return i.operate((function(r,i){var s=null,a=0,u=!1,c=function(){return u&&!s&&i.complete()};r.subscribe(o.createOperatorSubscriber(i,(function(r){null==s||s.unsubscribe();var u=0,l=a++;n.innerFrom(e(r,l)).subscribe(s=o.createOperatorSubscriber(i,(function(e){return i.next(t?t(r,e,l,u++):e)}),(function(){s=null,c()})))}),(function(){u=!0,c()})))}))}},1173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMapTo=void 0;var n=r(8518),i=r(3005);t.switchMapTo=function(e,t){return i.isFunction(t)?n.switchMap((function(){return e}),t):n.switchMap((function(){return e}))}},3855:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchScan=void 0;var n=r(8518),i=r(4935);t.switchScan=function(e,t){return i.operate((function(r,i){var o=t;return n.switchMap((function(t,r){return e(o,t,r)}),(function(e,t){return o=t,t}))(r).subscribe(i),function(){o=null}}))}},4783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.take=void 0;var n=r(6332),i=r(4935),o=r(4990);t.take=function(e){return e<=0?function(){return n.EMPTY}:i.operate((function(t,r){var n=0;t.subscribe(o.createOperatorSubscriber(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}},1980:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.takeLast=void 0;var i=r(6332),o=r(4935),s=r(4990);t.takeLast=function(e){return e<=0?function(){return i.EMPTY}:o.operate((function(t,r){var i=[];t.subscribe(s.createOperatorSubscriber(r,(function(t){i.push(t),e<i.length&&i.shift()}),(function(){var e,t;try{for(var o=n(i),s=o.next();!s.done;s=o.next()){var a=s.value;r.next(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}r.complete()}),void 0,(function(){i=null})))}))}},9845:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeUntil=void 0;var n=r(4935),i=r(4990),o=r(7103),s=r(2576);t.takeUntil=function(e){return n.operate((function(t,r){o.innerFrom(e).subscribe(i.createOperatorSubscriber(r,(function(){return r.complete()}),s.noop)),!r.closed&&t.subscribe(r)}))}},6060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeWhile=void 0;var n=r(4935),i=r(4990);t.takeWhile=function(e,t){return void 0===t&&(t=!1),n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){var i=e(r,o++);(i||t)&&n.next(r),!i&&n.complete()})))}))}},1138:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tap=void 0;var n=r(3005),i=r(4935),o=r(4990),s=r(4781);t.tap=function(e,t,r){var a=n.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return a?i.operate((function(e,t){var r;null===(r=a.subscribe)||void 0===r||r.call(a);var n=!0;e.subscribe(o.createOperatorSubscriber(t,(function(e){var r;null===(r=a.next)||void 0===r||r.call(a,e),t.next(e)}),(function(){var e;n=!1,null===(e=a.complete)||void 0===e||e.call(a),t.complete()}),(function(e){var r;n=!1,null===(r=a.error)||void 0===r||r.call(a,e),t.error(e)}),(function(){var e,t;n&&(null===(e=a.unsubscribe)||void 0===e||e.call(a)),null===(t=a.finalize)||void 0===t||t.call(a)})))})):s.identity}},7306:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=void 0;var n=r(4935),i=r(4990),o=r(7103);t.throttle=function(e,t){return n.operate((function(r,n){var s=null!=t?t:{},a=s.leading,u=void 0===a||a,c=s.trailing,l=void 0!==c&&c,f=!1,h=null,d=null,p=!1,v=function(){null==d||d.unsubscribe(),d=null,l&&(y(),p&&n.complete())},m=function(){d=null,p&&n.complete()},g=function(t){return d=o.innerFrom(e(t)).subscribe(i.createOperatorSubscriber(n,v,m))},y=function(){if(f){f=!1;var e=h;h=null,n.next(e),!p&&g(e)}};r.subscribe(i.createOperatorSubscriber(n,(function(e){f=!0,h=e,(!d||d.closed)&&(u?y():g(e))}),(function(){p=!0,(!(l&&f&&d)||d.closed)&&n.complete()})))}))}},8968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttleTime=void 0;var n=r(2445),i=r(7306),o=r(7513);t.throttleTime=function(e,t,r){void 0===t&&(t=n.asyncScheduler);var s=o.timer(e,t);return i.throttle((function(){return s}),r)}},1779:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfEmpty=void 0;var n=r(9474),i=r(4935),o=r(4990);function s(){return new n.EmptyError}t.throwIfEmpty=function(e){return void 0===e&&(e=s),i.operate((function(t,r){var n=!1;t.subscribe(o.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){return n?r.complete():r.error(e())})))}))}},8005:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeInterval=t.timeInterval=void 0;var n=r(2445),i=r(4935),o=r(4990);t.timeInterval=function(e){return void 0===e&&(e=n.asyncScheduler),i.operate((function(t,r){var n=e.now();t.subscribe(o.createOperatorSubscriber(r,(function(t){var i=e.now(),o=i-n;n=i,r.next(new s(t,o))})))}))};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},4173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeout=t.TimeoutError=void 0;var n=r(2445),i=r(1677),o=r(4935),s=r(7103),a=r(7029),u=r(4990),c=r(7738);function l(e){throw new t.TimeoutError(e)}t.TimeoutError=a.createErrorClass((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}})),t.timeout=function(e,t){var r=i.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e,a=r.first,f=r.each,h=r.with,d=void 0===h?l:h,p=r.scheduler,v=void 0===p?null!=t?t:n.asyncScheduler:p,m=r.meta,g=void 0===m?null:m;if(null==a&&null==f)throw new TypeError("No timeout provided.");return o.operate((function(e,t){var r,n,i=null,o=0,l=function(e){n=c.executeSchedule(t,v,(function(){try{r.unsubscribe(),s.innerFrom(d({meta:g,lastValue:i,seen:o})).subscribe(t)}catch(e){t.error(e)}}),e)};r=e.subscribe(u.createOperatorSubscriber(t,(function(e){null==n||n.unsubscribe(),o++,t.next(i=e),f>0&&l(f)}),void 0,void 0,(function(){(null==n?void 0:n.closed)||null==n||n.unsubscribe(),i=null}))),!o&&l(null!=a?"number"==typeof a?a:+a-v.now():f)}))}},7223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutWith=void 0;var n=r(2445),i=r(1677),o=r(4173);t.timeoutWith=function(e,t,r){var s,a,u;if(r=null!=r?r:n.async,i.isValidDate(e)?s=e:"number"==typeof e&&(a=e),!t)throw new TypeError("No observable provided to switch to");if(u=function(){return t},null==s&&null==a)throw new TypeError("No timeout provided.");return o.timeout({first:s,each:a,scheduler:r,with:u})}},8975:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timestamp=void 0;var n=r(7950),i=r(7291);t.timestamp=function(e){return void 0===e&&(e=n.dateTimestampProvider),i.map((function(t){return{value:t,timestamp:e.now()}}))}},2:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=void 0;var n=r(122),i=r(4935),o=function(e,t){return e.push(t),e};t.toArray=function(){return i.operate((function(e,t){n.reduce(o,[])(e).subscribe(t)}))}},2826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.window=void 0;var n=r(3032),i=r(4935),o=r(4990),s=r(2576),a=r(7103);t.window=function(e){return i.operate((function(t,r){var i=new n.Subject;r.next(i.asObservable());var u=function(e){i.error(e),r.error(e)};return t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==i?void 0:i.next(e)}),(function(){i.complete(),r.complete()}),u)),a.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){i.complete(),r.next(i=new n.Subject)}),s.noop,u)),function(){null==i||i.unsubscribe(),i=null}}))}},7526:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowCount=void 0;var i=r(3032),o=r(4935),s=r(4990);t.windowCount=function(e,t){void 0===t&&(t=0);var r=t>0?t:e;return o.operate((function(t,o){var a=[new i.Subject],u=0;o.next(a[0].asObservable()),t.subscribe(s.createOperatorSubscriber(o,(function(t){var s,c;try{for(var l=n(a),f=l.next();!f.done;f=l.next())f.value.next(t)}catch(e){s={error:e}}finally{try{f&&!f.done&&(c=l.return)&&c.call(l)}finally{if(s)throw s.error}}var h=u-e+1;if(h>=0&&h%r==0&&a.shift().complete(),++u%r==0){var d=new i.Subject;a.push(d),o.next(d.asObservable())}}),(function(){for(;a.length>0;)a.shift().complete();o.complete()}),(function(e){for(;a.length>0;)a.shift().error(e);o.error(e)}),(function(){a=null})))}))}},8294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowTime=void 0;var n=r(3032),i=r(2445),o=r(3865),s=r(4935),a=r(4990),u=r(6967),c=r(2433),l=r(7738);t.windowTime=function(e){for(var t,r,f=[],h=1;h<arguments.length;h++)f[h-1]=arguments[h];var d=null!==(t=c.popScheduler(f))&&void 0!==t?t:i.asyncScheduler,p=null!==(r=f[0])&&void 0!==r?r:null,v=f[1]||1/0;return s.operate((function(t,r){var i=[],s=!1,c=function(e){var t=e.window,r=e.subs;t.complete(),r.unsubscribe(),u.arrRemove(i,e),s&&f()},f=function(){if(i){var t=new o.Subscription;r.add(t);var s=new n.Subject,a={window:s,subs:t,seen:0};i.push(a),r.next(s.asObservable()),l.executeSchedule(t,d,(function(){return c(a)}),e)}};null!==p&&p>=0?l.executeSchedule(r,d,f,p,!0):s=!0,f();var h=function(e){return i.slice().forEach(e)},m=function(e){h((function(t){var r=t.window;return e(r)})),e(r),r.unsubscribe()};return t.subscribe(a.createOperatorSubscriber(r,(function(e){h((function(t){t.window.next(e),v<=++t.seen&&c(t)}))}),(function(){return m((function(e){return e.complete()}))}),(function(e){return m((function(t){return t.error(e)}))}))),function(){i=null}}))}},1883:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowToggle=void 0;var i=r(3032),o=r(3865),s=r(4935),a=r(7103),u=r(4990),c=r(2576),l=r(6967);t.windowToggle=function(e,t){return s.operate((function(r,s){var f=[],h=function(e){for(;0<f.length;)f.shift().error(e);s.error(e)};a.innerFrom(e).subscribe(u.createOperatorSubscriber(s,(function(e){var r=new i.Subject;f.push(r);var n,d=new o.Subscription;try{n=a.innerFrom(t(e))}catch(e){return void h(e)}s.next(r.asObservable()),d.add(n.subscribe(u.createOperatorSubscriber(s,(function(){l.arrRemove(f,r),r.complete(),d.unsubscribe()}),c.noop,h)))}),c.noop)),r.subscribe(u.createOperatorSubscriber(s,(function(e){var t,r,i=f.slice();try{for(var o=n(i),s=o.next();!s.done;s=o.next())s.value.next(e)}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}),(function(){for(;0<f.length;)f.shift().complete();s.complete()}),h,(function(){for(;0<f.length;)f.shift().unsubscribe()})))}))}},4309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowWhen=void 0;var n=r(3032),i=r(4935),o=r(4990),s=r(7103);t.windowWhen=function(e){return i.operate((function(t,r){var i,a,u=function(e){i.error(e),r.error(e)},c=function(){var t;null==a||a.unsubscribe(),null==i||i.complete(),i=new n.Subject,r.next(i.asObservable());try{t=s.innerFrom(e())}catch(e){return void u(e)}t.subscribe(a=o.createOperatorSubscriber(r,c,c,u))};c(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return i.next(e)}),(function(){i.complete(),r.complete()}),u,(function(){null==a||a.unsubscribe(),i=null})))}))}},3041:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.withLatestFrom=void 0;var o=r(4935),s=r(4990),a=r(7103),u=r(4781),c=r(2576),l=r(2433);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e);return o.operate((function(t,o){for(var l=e.length,f=new Array(l),h=e.map((function(){return!1})),d=!1,p=function(t){a.innerFrom(e[t]).subscribe(s.createOperatorSubscriber(o,(function(e){f[t]=e,d||h[t]||(h[t]=!0,(d=h.every(u.identity))&&(h=null))}),c.noop))},v=0;v<l;v++)p(v);t.subscribe(s.createOperatorSubscriber(o,(function(e){if(d){var t=i([e],n(f));o.next(r?r.apply(void 0,i([],n(t))):t)}})))}))}},4400:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(7654),s=r(4935);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.operate((function(t,r){o.zip.apply(void 0,i([t],n(e))).subscribe(r)}))}},8593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zipAll=void 0;var n=r(7654),i=r(2069);t.zipAll=function(e){return i.joinAllInternals(n.zip,e)}},8096:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zipWith=void 0;var o=r(4400);t.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.zip.apply(void 0,i([],n(e)))}},7631:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleArray=void 0;var n=r(2419);t.scheduleArray=function(e,t){return new n.Observable((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}},8489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleAsyncIterable=void 0;var n=r(2419),i=r(7738);t.scheduleAsyncIterable=function(e,t){if(!e)throw new Error("Iterable cannot be null");return new n.Observable((function(r){i.executeSchedule(r,t,(function(){var n=e[Symbol.asyncIterator]();i.executeSchedule(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}},1297:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleIterable=void 0;var n=r(2419),i=r(3725),o=r(3005),s=r(7738);t.scheduleIterable=function(e,t){return new n.Observable((function(r){var n;return s.executeSchedule(r,t,(function(){n=e[i.iterator](),s.executeSchedule(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){return void r.error(e)}i?r.complete():r.next(t)}),0,!0)})),function(){return o.isFunction(null==n?void 0:n.return)&&n.return()}}))}},4001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleObservable=void 0;var n=r(7103),i=r(1184),o=r(276);t.scheduleObservable=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},5143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.schedulePromise=void 0;var n=r(7103),i=r(1184),o=r(276);t.schedulePromise=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},3676:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleReadableStreamLike=void 0;var n=r(8489),i=r(7823);t.scheduleReadableStreamLike=function(e,t){return n.scheduleAsyncIterable(i.readableStreamLikeToAsyncGenerator(e),t)}},5207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduled=void 0;var n=r(4001),i=r(5143),o=r(7631),s=r(1297),a=r(8489),u=r(9500),c=r(6018),l=r(3909),f=r(2743),h=r(9595),d=r(9906),p=r(7823),v=r(3676);t.scheduled=function(e,t){if(null!=e){if(u.isInteropObservable(e))return n.scheduleObservable(e,t);if(l.isArrayLike(e))return o.scheduleArray(e,t);if(c.isPromise(e))return i.schedulePromise(e,t);if(h.isAsyncIterable(e))return a.scheduleAsyncIterable(e,t);if(f.isIterable(e))return s.scheduleIterable(e,t);if(p.isReadableStreamLike(e))return v.scheduleReadableStreamLike(e,t)}throw d.createInvalidObservableTypeError(e)}},1986:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=void 0;var o=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(3865).Subscription);t.Action=o},7574:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameAction=void 0;var o=r(9702),s=r(505),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.animationFrameProvider.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.animationFrameProvider.cancelAnimationFrame(r),t._scheduled=void 0)},t}(o.AsyncAction);t.AnimationFrameAction=a},2934:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(3643).AsyncScheduler);t.AnimationFrameScheduler=o},2189:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapAction=void 0;var o=r(9702),s=r(8908),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.immediateProvider.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.immediateProvider.clearImmediate(r),t._scheduled===r&&(t._scheduled=void 0))},t}(o.AsyncAction);t.AsapAction=a},5523:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(3643).AsyncScheduler);t.AsapScheduler=o},9702:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=void 0;var o=r(1986),s=r(8203),a=r(6967),u=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return i(t,e),t.prototype.schedule=function(e,t){var r;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),s.intervalProvider.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&s.intervalProvider.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,a.arrRemove(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(o.Action);t.AsyncAction=u},3643:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncScheduler=void 0;var o=r(218),s=function(e){function t(t,r){void 0===r&&(r=o.Scheduler.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return i(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(o.Scheduler);t.AsyncScheduler=s},6201:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=void 0;var o=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.flush(this),0)},t}(r(9702).AsyncAction);t.QueueAction=o},5860:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(3643).AsyncScheduler);t.QueueScheduler=o},4123:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualAction=t.VirtualTimeScheduler=void 0;var o=r(9702),s=r(3865),a=function(e){function t(t,r){void 0===t&&(t=u),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return i(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(r(3643).AsyncScheduler);t.VirtualTimeScheduler=a;var u=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return i(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return s.Subscription.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(o.AsyncAction);t.VirtualAction=u},3660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrame=t.animationFrameScheduler=void 0;var n=r(7574),i=r(2934);t.animationFrameScheduler=new i.AnimationFrameScheduler(n.AnimationFrameAction),t.animationFrame=t.animationFrameScheduler},505:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrameProvider=void 0;var o=r(3865);t.animationFrameProvider={schedule:function(e){var r=requestAnimationFrame,n=cancelAnimationFrame,i=t.animationFrameProvider.delegate;i&&(r=i.requestAnimationFrame,n=i.cancelAnimationFrame);var s=r((function(t){n=void 0,e(t)}));return new o.Subscription((function(){return null==n?void 0:n(s)}))},requestAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.requestAnimationFrame)||requestAnimationFrame).apply(void 0,i([],n(e)))},cancelAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,i([],n(e)))},delegate:void 0}},580:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asap=t.asapScheduler=void 0;var n=r(2189),i=r(5523);t.asapScheduler=new i.AsapScheduler(n.AsapAction),t.asap=t.asapScheduler},2445:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.async=t.asyncScheduler=void 0;var n=r(9702),i=r(3643);t.asyncScheduler=new i.AsyncScheduler(n.AsyncAction),t.async=t.asyncScheduler},7950:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateTimestampProvider=void 0,t.dateTimestampProvider={now:function(){return(t.dateTimestampProvider.delegate||Date).now()},delegate:void 0}},8908:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.immediateProvider=void 0;var o=r(7629),s=o.Immediate.setImmediate,a=o.Immediate.clearImmediate;t.immediateProvider={setImmediate:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.immediateProvider.delegate;return((null==o?void 0:o.setImmediate)||s).apply(void 0,i([],n(e)))},clearImmediate:function(e){var r=t.immediateProvider.delegate;return((null==r?void 0:r.clearImmediate)||a)(e)},delegate:void 0}},8203:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.intervalProvider=void 0,t.intervalProvider={setInterval:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.intervalProvider.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,n([e,i],r(o))):setInterval.apply(void 0,n([e,i],r(o)))},clearInterval:function(e){var r=t.intervalProvider.delegate;return((null==r?void 0:r.clearInterval)||clearInterval)(e)},delegate:void 0}},6813:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.performanceTimestampProvider=void 0,t.performanceTimestampProvider={now:function(){return(t.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}},8615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queue=t.queueScheduler=void 0;var n=r(6201),i=r(5860);t.queueScheduler=new i.QueueScheduler(n.QueueAction),t.queue=t.queueScheduler},4590:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutProvider=void 0,t.timeoutProvider={setTimeout:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.timeoutProvider.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,n([e,i],r(o))):setTimeout.apply(void 0,n([e,i],r(o)))},clearTimeout:function(e){var r=t.timeoutProvider.delegate;return((null==r?void 0:r.clearTimeout)||clearTimeout)(e)},delegate:void 0}},3725:(e,t)=>{"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.iterator=t.getSymbolIterator=void 0,t.getSymbolIterator=r,t.iterator=r()},2801:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable=void 0,t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},8433:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2351:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=void 0;var n=r(7029);t.ArgumentOutOfRangeError=n.createErrorClass((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}))},9474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=void 0;var n=r(7029);t.EmptyError=n.createErrorClass((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}))},7629:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTools=t.Immediate=void 0;var r,n=1,i={};function o(e){return e in i&&(delete i[e],!0)}t.Immediate={setImmediate:function(e){var t=n++;return i[t]=!0,r||(r=Promise.resolve()),r.then((function(){return o(t)&&e()})),t},clearImmediate:function(e){o(e)}},t.TestTools={pending:function(){return Object.keys(i).length}}},8598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotFoundError=void 0;var n=r(7029);t.NotFoundError=n.createErrorClass((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}}))},2642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=void 0;var n=r(7029);t.ObjectUnsubscribedError=n.createErrorClass((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}))},6156:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceError=void 0;var n=r(7029);t.SequenceError=n.createErrorClass((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}))},4805:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=void 0;var n=r(7029);t.UnsubscriptionError=n.createErrorClass((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}))},2433:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.popNumber=t.popScheduler=t.popResultSelector=void 0;var n=r(3005),i=r(9016);function o(e){return e[e.length-1]}t.popResultSelector=function(e){return n.isFunction(o(e))?e.pop():void 0},t.popScheduler=function(e){return i.isScheduler(o(e))?e.pop():void 0},t.popNumber=function(e,t){return"number"==typeof o(e)?e.pop():t}},1203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsArgArrayOrObject=void 0;var r=Array.isArray,n=Object.getPrototypeOf,i=Object.prototype,o=Object.keys;t.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(r(t))return{args:t,keys:null};if((a=t)&&"object"==typeof a&&n(a)===i){var s=o(t);return{args:s.map((function(e){return t[e]})),keys:s}}}var a;return{args:e,keys:null}}},5498:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsOrArgArray=void 0;var r=Array.isArray;t.argsOrArgArray=function(e){return 1===e.length&&r(e[0])?e[0]:e}},6967:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrRemove=void 0,t.arrRemove=function(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}},7029:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createErrorClass=void 0,t.createErrorClass=function(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}},641:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObject=void 0,t.createObject=function(e,t){return e.reduce((function(e,r,n){return e[r]=t[n],e}),{})}},6110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.captureError=t.errorContext=void 0;var n=r(3280),i=null;t.errorContext=function(e){if(n.config.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,o=r.errorThrown,s=r.error;if(i=null,o)throw s}}else e()},t.captureError=function(e){n.config.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7738:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.executeSchedule=void 0,t.executeSchedule=function(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}},4781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=void 0,t.identity=function(e){return e}},3909:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=void 0,t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},9595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=void 0;var n=r(3005);t.isAsyncIterable=function(e){return Symbol.asyncIterator&&n.isFunction(null==e?void 0:e[Symbol.asyncIterator])}},1677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidDate=void 0,t.isValidDate=function(e){return e instanceof Date&&!isNaN(e)}},3005:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e}},9500:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInteropObservable=void 0;var n=r(2801),i=r(3005);t.isInteropObservable=function(e){return i.isFunction(e[n.observable])}},2743:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIterable=void 0;var n=r(3725),i=r(3005);t.isIterable=function(e){return i.isFunction(null==e?void 0:e[n.iterator])}},8386:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObservable=void 0;var n=r(2419),i=r(3005);t.isObservable=function(e){return!!e&&(e instanceof n.Observable||i.isFunction(e.lift)&&i.isFunction(e.subscribe))}},6018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=void 0;var n=r(3005);t.isPromise=function(e){return n.isFunction(null==e?void 0:e.then)}},7823:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},i=this&&this.__await||function(e){return this instanceof i?(this.v=e,this):new i(e)},o=this&&this.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){s.push([e,t,r,n])>1||u(e,t)}))})}function u(e,t){try{(r=o[e](t)).value instanceof i?Promise.resolve(r.value.v).then(c,l):f(s[0][2],r)}catch(e){f(s[0][3],e)}var r}function c(e){u("next",e)}function l(e){u("throw",e)}function f(e,t){e(t),s.shift(),s.length&&u(s[0][0],s[0][1])}};Object.defineProperty(t,"__esModule",{value:!0}),t.isReadableStreamLike=t.readableStreamLikeToAsyncGenerator=void 0;var s=r(3005);t.readableStreamLikeToAsyncGenerator=function(e){return o(this,arguments,(function(){var t,r,o;return n(this,(function(n){switch(n.label){case 0:t=e.getReader(),n.label=1;case 1:n.trys.push([1,,9,10]),n.label=2;case 2:return[4,i(t.read())];case 3:return r=n.sent(),o=r.value,r.done?[4,i(void 0)]:[3,5];case 4:return[2,n.sent()];case 5:return[4,i(o)];case 6:return[4,n.sent()];case 7:return n.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))},t.isReadableStreamLike=function(e){return s.isFunction(null==e?void 0:e.getReader)}},9016:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=void 0;var n=r(3005);t.isScheduler=function(e){return e&&n.isFunction(e.schedule)}},4935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.operate=t.hasLift=void 0;var n=r(3005);function i(e){return n.isFunction(null==e?void 0:e.lift)}t.hasLift=i,t.operate=function(e){return function(t){if(i(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},1914:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mapOneOrManyArgs=void 0;var o=r(7291),s=Array.isArray;t.mapOneOrManyArgs=function(e){return o.map((function(t){return function(e,t){return s(t)?e.apply(void 0,i([],n(t))):e(t)}(e,t)}))}},2576:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=void 0,t.noop=function(){}},8634:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=void 0,t.not=function(e,t){return function(r,n){return!e.call(t,r,n)}}},9985:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pipeFromArray=t.pipe=void 0;var n=r(4781);function i(e){return 0===e.length?n.identity:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)},t.pipeFromArray=i},7968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportUnhandledError=void 0;var n=r(3280),i=r(4590);t.reportUnhandledError=function(e){i.timeoutProvider.setTimeout((function(){var t=n.config.onUnhandledError;if(!t)throw e;t(e)}))}},9906:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInvalidObservableTypeError=void 0,t.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},4857:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=t.merge=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.concat=t.combineLatestWith=t.combineLatest=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=void 0,t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.race=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.partition=t.pairwise=t.onErrorResumeNext=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=void 0,t.zipWith=t.zipAll=t.zip=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=void 0;var n=r(6474);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return n.audit}});var i=r(5382);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return i.auditTime}});var o=r(9715);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return o.buffer}});var s=r(3814);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return s.bufferCount}});var a=r(7211);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return a.bufferTime}});var u=r(4943);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return u.bufferToggle}});var c=r(1240);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return c.bufferWhen}});var l=r(9548);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return l.catchError}});var f=r(2128);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return f.combineAll}});var h=r(3240);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return h.combineLatestAll}});var d=r(6318);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return d.combineLatest}});var p=r(5024);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return p.combineLatestWith}});var v=r(4919);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return v.concat}});var m=r(4413);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return m.concatAll}});var g=r(7498);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return g.concatMap}});var y=r(6109);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return y.concatMapTo}});var b=r(9664);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return b.concatWith}});var _=r(1995);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return _.connect}});var w=r(993);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return w.count}});var S=r(496);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return S.debounce}});var E=r(1385);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return E.debounceTime}});var T=r(1658);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return T.defaultIfEmpty}});var O=r(5841);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return O.delay}});var C=r(8798);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return C.delayWhen}});var x=r(1080);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return x.dematerialize}});var P=r(3054);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return P.distinct}});var R=r(8737);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return R.distinctUntilChanged}});var M=r(7957);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return M.distinctUntilKeyChanged}});var A=r(8633);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return A.elementAt}});var j=r(911);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return j.endWith}});var k=r(2096);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return k.every}});var I=r(67);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return I.exhaust}});var D=r(5337);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return D.exhaustAll}});var N=r(5635);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return N.exhaustMap}});var L=r(9745);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return L.expand}});var F=r(9154);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return F.filter}});var U=r(9283);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return U.finalize}});var B=r(7119);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return B.find}});var W=r(4706);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return W.findIndex}});var V=r(9219);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return V.first}});var q=r(9749);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return q.groupBy}});var z=r(9438);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return z.ignoreElements}});var H=r(8515);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return H.isEmpty}});var G=r(2435);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return G.last}});var $=r(7291);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return $.map}});var Y=r(8313);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return Y.mapTo}});var K=r(3209);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return K.materialize}});var X=r(2620);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return X.max}});var J=r(9821);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return J.merge}});var Z=r(3783);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return Z.mergeAll}});var Q=r(1788);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return Q.flatMap}});var ee=r(9475);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ee.mergeMap}});var te=r(1211);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return te.mergeMapTo}});var re=r(7267);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return re.mergeScan}});var ne=r(9303);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ne.mergeWith}});var ie=r(9714);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ie.min}});var oe=r(3848);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return oe.multicast}});var se=r(1184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return se.observeOn}});var ae=r(7582);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return ae.onErrorResumeNext}});var ue=r(2731);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ue.pairwise}});var ce=r(5649);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ce.partition}});var le=r(4691);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return le.pluck}});var fe=r(4474);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return fe.publish}});var he=r(52);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return he.publishBehavior}});var de=r(2110);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return de.publishLast}});var pe=r(9864);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return pe.publishReplay}});var ve=r(9764);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return ve.race}});var me=r(179);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return me.raceWith}});var ge=r(122);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return ge.reduce}});var ye=r(5313);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return ye.repeat}});var be=r(4068);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return be.repeatWhen}});var _e=r(64);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return _e.retry}});var we=r(1188);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return we.retryWhen}});var Se=r(8739);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return Se.refCount}});var Ee=r(4193);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Ee.sample}});var Te=r(6170);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Te.sampleTime}});var Oe=r(5876);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Oe.scan}});var Ce=r(1791);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Ce.sequenceEqual}});var xe=r(5137);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return xe.share}});var Pe=r(1348);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Pe.shareReplay}});var Re=r(8242);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return Re.single}});var Me=r(3169);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return Me.skip}});var Ae=r(2454);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Ae.skipLast}});var je=r(6931);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return je.skipUntil}});var ke=r(7913);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return ke.skipWhile}});var Ie=r(9234);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Ie.startWith}});var De=r(276);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return De.subscribeOn}});var Ne=r(9253);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return Ne.switchAll}});var Le=r(8518);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Le.switchMap}});var Fe=r(1173);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Fe.switchMapTo}});var Ue=r(3855);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Ue.switchScan}});var Be=r(4783);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return Be.take}});var We=r(1980);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return We.takeLast}});var Ve=r(9845);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Ve.takeUntil}});var qe=r(6060);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return qe.takeWhile}});var ze=r(1138);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return ze.tap}});var He=r(7306);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return He.throttle}});var Ge=r(8968);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return Ge.throttleTime}});var $e=r(1779);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return $e.throwIfEmpty}});var Ye=r(8005);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Ye.timeInterval}});var Ke=r(4173);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Ke.timeout}});var Xe=r(7223);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Xe.timeoutWith}});var Je=r(8975);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return Je.timestamp}});var Ze=r(2);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return Ze.toArray}});var Qe=r(2826);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return Qe.window}});var et=r(7526);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return et.windowCount}});var tt=r(8294);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return tt.windowTime}});var rt=r(1883);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return rt.windowToggle}});var nt=r(4309);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return nt.windowWhen}});var it=r(3041);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return it.withLatestFrom}});var ot=r(4400);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return ot.zip}});var st=r(8593);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return st.zipAll}});var at=r(8096);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return at.zipWith}})},9509:(e,t,r)=>{var n=r(8764),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},7539:e=>{"use strict";const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const r=t.splitSections(e);return r&&r[0]},t.getMediaSections=function(e){const r=t.splitSections(e);return r.shift(),r},t.matchPrefix=function(e,r){return t.splitLines(e).filter((e=>0===e.indexOf(r)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const r={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":r.relatedAddress=t[e+1];break;case"rport":r.relatedPort=parseInt(t[e+1],10);break;case"tcptype":r.tcpType=t[e+1];break;case"ufrag":r.ufrag=t[e+1],r.usernameFragment=t[e+1];break;default:void 0===r[t[e]]&&(r[t[e]]=t[e+1])}return r},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const r=e.component;"rtp"===r?t.push(1):"rtcp"===r?t.push(2):t.push(r),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let r;const n=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e<n.length;e++)r=n[e].trim().split("="),t[r[0].trim()]=r[1];return t},t.writeFmtp=function(e){let t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const n=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),r={ssrc:parseInt(e.substring(7,t),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substring(t+1,n),r.value=e.substring(n+1)):r.attribute=e.substring(t+1),r},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const r=t.matchPrefix(e,"a=mid:")[0];if(r)return r.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,r){return{role:"auto",fingerprints:t.matchPrefix(e+r,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,r){return t.matchPrefix(e+r,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,r){const n=t.matchPrefix(e+r,"a=ice-ufrag:")[0],i=t.matchPrefix(e+r,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substring(12),password:i.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" ");r.profile=n[2];for(let i=3;i<n.length;i++){const o=n[i],s=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){const n=t.parseRtpMap(s),i=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(n.parameters=i.length?t.parseFmtp(i[0]):{},n.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),r.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(n.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach((e=>{r.headerExtensions.push(t.parseExtmap(e))}));const i=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return r.codecs.forEach((e=>{i.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),r},t.writeRtpDescription=function(e,r){let n="";n+="m="+e+" ",n+=r.codecs.length>0?"9":"0",n+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=r.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",r.codecs.forEach((e=>{n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));let i=0;return r.codecs.forEach((e=>{e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),r.headerExtensions&&r.headerExtensions.forEach((e=>{n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){const r=[],n=t.parseRtpParameters(e),i=-1!==n.fecMechanisms.indexOf("RED"),o=-1!==n.fecMechanisms.indexOf("ULPFEC"),s=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),a=s.length>0&&s[0].ssrc;let u;const c=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));c.length>0&&c[0].length>1&&c[0][0]===a&&(u=c[0][1]),n.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:a,codecPayloadType:parseInt(e.parameters.apt,10)};a&&u&&(t.rtx={ssrc:u}),r.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:a,mechanism:o?"red+ulpfec":"red"},r.push(t))}})),0===r.length&&a&&r.push({ssrc:a});let l=t.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substring(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substring(5),10)*.95-16e3:void 0,r.forEach((e=>{e.maxBitrate=l}))),r},t.parseRtcpParameters=function(e){const r={},n=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];n&&(r.cname=n.value,r.ssrc=n.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");r.reducedSize=i.length>0,r.compound=0===i.length;const o=t.matchPrefix(e,"a=rtcp-mux");return r.mux=o.length>0,r},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let r;const n=t.matchPrefix(e,"a=msid:");if(1===n.length)return r=n[0].substring(7).split(" "),{stream:r[0],track:r[1]};const i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return i.length>0?(r=i[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},t.parseSctpDescription=function(e){const r=t.parseMLine(e),n=t.matchPrefix(e,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substring(19),10)),isNaN(i)&&(i=65536);const o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substring(12),10),protocol:r.fmt,maxMessageSize:i};const s=t.matchPrefix(e,"a=sctpmap:");if(s.length>0){const e=s[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let r=[];return r="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,r,n){let i;const o=void 0!==r?r:2;return i=e||t.generateSessionId(),"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,r){const n=t.splitLines(e);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substring(2)}return r?t.getDirection(r):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const r=t.splitLines(e)[0].substring(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},t.parseOLine=function(e){const r=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const r=t.splitLines(e);for(let e=0;e<r.length;e++)if(r[e].length<2||"="!==r[e].charAt(1))return!1;return!0},e.exports=t},8853:(e,t,r)=>{const n=r(1227)("simple-peer"),i=r(5177),o=r(1798),s=r(8473),a=r(4375),u=r(2114),{Buffer:c}=r(8764),l=65536;function f(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}class h extends s.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=o(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||o(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||h.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},h.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:i(),!this._wrtc)throw"undefined"==typeof window?u(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):u(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(u(e,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((e=>{this.destroy(u(e,"ERR_PC_PEER_IDENTITY"))})),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach((e=>{this.addStream(e)})),this._pc.ontrack=e=>{this._onTrack(e)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((e=>{this._addIceCandidate(e)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((e=>{this.destroy(u(e,"ERR_SET_REMOTE_DESCRIPTION"))})),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(u(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{!t.address||t.address.endsWith(".local")?("Ignoring unsupported ICE candidate.",console.warn("Ignoring unsupported ICE candidate.")):this.destroy(u(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(u(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),e.getTracks().forEach((t=>{this.addTrack(t,e)}))}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const r=this._senderMap.get(e)||new Map;let n=r.get(t);if(n)throw n.removed?u(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):u(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");n=this._pc.addTrack(e,t),r.set(t,n),this._senderMap.set(e,r),this._needsNegotiation()}replaceTrack(e,t,r){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const n=this._senderMap.get(e),i=n?n.get(r):null;if(!i)throw u(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");t&&this._senderMap.set(t,n),null!=i.replaceTrack?i.replaceTrack(t):this.destroy(u(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const r=this._senderMap.get(e),n=r?r.get(t):null;if(!n)throw u(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{n.removed=!0,this._pc.removeTrack(n)}catch(e){"NS_ERROR_UNEXPECTED"===e.name?this._sendersAwaitingStable.push(n):this.destroy(u(e,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),e.getTracks().forEach((t=>{this.removeTrack(t,e)}))}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,a((()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1})))}negotiate(){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout((()=>{this._createOffer()}),0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",e&&(e.message||e)),a((()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit("error",e),this.emit("close"),t()})))}_setupData(e){if(!e.channel)return this.destroy(u(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=l),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(u(t,"ERR_DATA_CHANNEL"))};let t=!1;this._closingInterval=setInterval((()=>{this._channel&&"closing"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1}),5e3)}_read(){}_write(e,t,r){if(this.destroyed)return r(u(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(u(e,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>l?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=r):r(null)}else this._debug("write before connect"),this._chunk=e,this._cb=r}_onFinish(){if(this.destroyed)return;const e=()=>{setTimeout((()=>this.destroy()),1e3)};this._connected?e():this.once("connect",e)}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout((()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))}),this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=f(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp})};this._pc.setLocalDescription(e).then((()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(u(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(u(e,"ERR_CREATE_OFFER"))}))}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach((e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))}))}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=f(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()};this._pc.setLocalDescription(e).then((()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(u(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(u(e,"ERR_CREATE_ANSWER"))}))}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&&this.destroy(u(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e,t),this.emit("iceStateChange",e,t),"connected"!==e&&"completed"!==e||(this._pcReady=!0,this._maybeReady()),"failed"===e&&this.destroy(u(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===e&&this.destroy(u(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(e){const t=e=>("[object Array]"===Object.prototype.toString.call(e.values)&&e.values.forEach((t=>{Object.assign(e,t)})),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then((r=>{const n=[];r.forEach((e=>{n.push(t(e))})),e(null,n)}),(t=>e(t))):this._pc.getStats.length>0?this._pc.getStats((r=>{if(this.destroyed)return;const n=[];r.result().forEach((e=>{const r={};e.names().forEach((t=>{r[t]=e.stat(t)})),r.id=e.id,r.type=e.type,r.timestamp=e.timestamp,n.push(t(r))})),e(null,n)}),(t=>e(t))):e(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const e=()=>{this.destroyed||this.getStats(((t,r)=>{if(this.destroyed)return;t&&(r=[]);const n={},i={},o={};let s=!1;r.forEach((e=>{"remotecandidate"!==e.type&&"remote-candidate"!==e.type||(n[e.id]=e),"localcandidate"!==e.type&&"local-candidate"!==e.type||(i[e.id]=e),"candidatepair"!==e.type&&"candidate-pair"!==e.type||(o[e.id]=e)}));const a=e=>{s=!0;let t=i[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=Number(t.port)):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=Number(t.portNumber)):"string"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(":"),this.localAddress=t[0],this.localPort=Number(t[1])),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let r=n[e.remoteCandidateId];r&&(r.ip||r.address)?(this.remoteAddress=r.ip||r.address,this.remotePort=Number(r.port)):r&&r.ipAddress?(this.remoteAddress=r.ipAddress,this.remotePort=Number(r.portNumber)):"string"==typeof e.googRemoteAddress&&(r=e.googRemoteAddress.split(":"),this.remoteAddress=r[0],this.remotePort=Number(r[1])),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(r.forEach((e=>{"transport"===e.type&&e.selectedCandidatePairId&&a(o[e.selectedCandidatePairId]),("googCandidatePair"===e.type&&"true"===e.googActiveConnection||("candidatepair"===e.type||"candidate-pair"===e.type)&&e.selected)&&a(e)})),s||Object.keys(o).length&&!Object.keys(i).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(t){return this.destroy(u(t,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"number"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}else setTimeout(e,100)}))};e()}_onInterval(){!this._cb||!this._channel||this._channel.bufferedAmount>l||this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach((e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0})),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(e){this.destroyed||(e.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):e.candidate||this._iceComplete||(this._iceComplete=!0,this.emit("_iceComplete")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=c.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(null)}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach((t=>{this._debug("on track"),this.emit("track",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some((e=>e.id===t.id))||(this._remoteStreams.push(t),a((()=>{this._debug("on stream"),this.emit("stream",t)})))}))}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],n.apply(null,e)}}h.WEBRTC_SUPPORT=!!i(),h.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},h.channelConfig={},e.exports=h},2553:(e,t,r)=>{"use strict";var n=r(9509).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.s=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},3607:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Uneeq=void 0,r(8806);const a=o(r(835)),u=r(6123);s(r(8512),t);var c=r(6123);Object.defineProperty(t,"Uneeq",{enumerable:!0,get:function(){return c.Uneeq}}),s(r(835),t),window.AdapterJS=a,window.Uneeq=u.Uneeq},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SoundMeter=void 0;const n=r(2872),i=r(7501);t.SoundMeter=class{constructor(e){this.instant$=new n.BehaviorSubject(0),this.context=e,this.instant=0,this.slow=0,this.clip=0,this.script=e.createScriptProcessor(2048,1,1);const t=this;this.script.onaudioprocess=e=>{const r=e.inputBuffer.getChannelData(0);let n,i=0,o=0;for(n=0;n<r.length;++n)i+=r[n]*r[n],Math.abs(r[n])>.99&&(o+=1);t.instant=Math.sqrt(i/r.length),t.slow=.95*t.slow+.05*t.instant,t.clip=o/r.length,t.instant$.next(parseFloat(t.instant.toFixed(2)))}}connectToSource(e,t){i.logger.log("SoundMeter connecting");try{this.mic=this.context.createMediaStreamSource(e),this.mic.connect(this.script),this.script.connect(this.context.destination),void 0!==t&&t(null)}catch(e){console.error(e),void 0!==t&&t(e)}}stop(){this.mic.disconnect(),this.script.disconnect()}}},4518:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoEditor=void 0;const s=o(r(6551));t.VideoEditor=class{constructor(){}applyChromaKeyEffect(e,t){try{r(6303);const n=s.default();let i,o,a;i=n.transform("reformat"),i.source=t,i.width=e.width,i.height=e.height,a=n.target(e),o=n.effect("chroma"),o.source=i,a.source=o,n.go()}catch(e){console.error(e)}}}},1181:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.API=void 0,t.API=class{set callId(e){this._callId=e}get authToken(){return this.xAuthToken}constructor(e,t="",r=(()=>{})){this.xAuthToken="",this.apiUrl=e,this.apiKey=t,this.loggedOutHandler=r}startSession(e){return this.postRequest("/api/v1/customers/",e,{},{"faceme-api-key":this.apiKey})}endCall(){return this.postRequest("/api/v1/calls/"+this._callId+"/endCall")}avatarStart(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/start",e)}avatarWelcome(){return this.postRequest("/api/v1/avatar/"+this._callId+"/welcome")}avatarAsk(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/ask",{text:e})}avatarStartRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/start")}avatarStopRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/stop")}avatarStopSpeaking(){return this.postRequest("/api/v1/avatar/"+this._callId+"/stopSpeaking")}getAvailableAvatarCount(){return this.getRequest("/api/v1/avatar/"+this._callId+"/available")}startSessionWithToken(e){return this.postRequest("/api/v2/clients/start-session",e,{},{"x-timezone-name":this.getTimeZone()})}setAvatarDebug(e){return this.putRequest("/api/v1/avatar/"+this._callId+"/debug",{enabled:e})}sendMediaUnavailable(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/media/unavailable-update",e)}getEdgeNodeId(e){let t=e.replace("turn:","http://");t=t.replace("turns:","https://");const r=new Request(t,{method:"GET"});return this.makeRequest(r)}getTimeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}makeRequest(e){return r(this,void 0,void 0,(function*(){const t=yield fetch(e);if(!t.ok){401===t.status&&this.loggedOutHandler();const e=yield t.json();throw{status:t.status,body:e}}return 204===t.status?Promise.resolve():(this.xAuthToken=t.headers.get("x-auth-token")||this.xAuthToken,yield t.json())}))}getRequest(e){const t=new Request(this.apiUrl+e,{method:"GET",credentials:"omit",headers:{"x-auth-token":this.xAuthToken}});return this.makeRequest(t)}postRequest(e,t={},r={},n={}){const i={method:"POST",credentials:"omit",headers:Object.assign({"Content-Type":"application/json","x-auth-token":this.xAuthToken},n),body:JSON.stringify(t)},o=new Request(this.apiUrl+e,Object.assign(i,r));return this.makeRequest(o)}putRequest(e,t={},r={}){const n={method:"PUT",credentials:"omit",headers:{"Content-Type":"application/json","x-auth-token":this.xAuthToken},body:JSON.stringify(t)},i=new Request(this.apiUrl+e,Object.assign(n,r));return this.makeRequest(i)}}},2958:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasService=void 0,t.CanvasService=class{constructor(e){this.canvasHeight=720,this.canvasWidth=1280,this.uneeqOptions=e}createCanvas(){const e=document.createElement("canvas");return this.uneeqOptions.avatarVideoContainerElement.appendChild(e),e.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),e.height=this.canvasHeight,e.width=this.canvasWidth,e}}},1546:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceManager=void 0;const i=r(3607),o=r(1929);t.DeviceManager=class{set edgeNodeId(e){this.mediaHandler.setEdgeNodeId(e),this.getDevices(!0)}constructor(e,t){this.options=e,this.api=t,this.speakerConstraints={},this.publishStream=new MediaStream,this.devices={audioInput:[],audioOutput:[],videoInput:[]},this.previousMediaOptions={},this.mediaHandler=new o.MediaHandler(this.options,(()=>this.remoteVideoReady())),this.initMediaConstraints(),this.getDevices(!1)}enableLocalDevices(e,t){const r=this.options.uneeqOptions.sendLocalVideo!==e,n=this.options.uneeqOptions.sendLocalAudio!==t;(r||n)&&(this.previousMediaOptions={sendLocalVideo:this.options.uneeqOptions.sendLocalVideo,sendLocalAudio:this.options.uneeqOptions.sendLocalAudio},this.options.uneeqOptions.sendLocalVideo=e,this.options.uneeqOptions.sendLocalAudio=t,r&&!1===e&&this.publishStream.getVideoTracks().forEach((e=>e.stop())),n&&!1===t&&this.publishStream.getAudioTracks().forEach((e=>e.stop())),this.mediaHandler.publishingStream=!1,this.initMediaConstraints(),this.getDevices(!0))}getDevices(e=!0){if(!this.options.uneeqOptions.sendLocalVideo&&!this.options.uneeqOptions.sendLocalAudio)return void this.initStreamWithoutDevices();const t=this;this.publishStream=new MediaStream,this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),navigator.mediaDevices.getUserMedia(this.userMediaConstraints).then((t=>n(this,void 0,void 0,(function*(){if(this.initDeviceList(),this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),e){if(this.options.uneeqOptions.sendLocalVideo){const e=t.getVideoTracks();e.length>0&&(this.publishStream.getVideoTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream.addTrack(e[0]))}if(this.options.uneeqOptions.sendLocalAudio){const e=t.getAudioTracks();e.length>0&&(this.publishStream.getAudioTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream.addTrack(e[0]))}this.mediaHandler.localStream$.next(this.publishStream)}})))).catch((e=>{t.options.userMessages.next(new i.DeviceErrorMessage(e)),console.error("device error: ",e),this.sendMediaUnavailableInfo("NotAllowedError"===e.name),this.revertMediaOptions()}))}setMicDevice(e,t=!0){const r=this.devices.audioInput.filter((t=>t.deviceId===e));if(r&&r.length>0)this.options.uneeqOptions.preferredMicrophoneId=e,this.audioConstraints.deviceId=e,t&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetMicSuccessMessage(e));else{const t="Uneeq setMic: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}setCamDevice(e,t=!0){const r=this.devices.videoInput.filter((t=>t.deviceId===e));if(r&&r.length>0)this.options.uneeqOptions.preferredCameraId=e,this.videoConstraints.deviceId=e,t&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetCameraSuccessMessage(e));else{const t="Uneeq setCamera: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}setAvatarSpeakerDevice(e){if(this.mediaHandler.avatarVideoElement){const t=this.devices.audioOutput.filter((t=>t.deviceId===e));if(t&&t.length>0)this.options.uneeqOptions.preferredSpeakerId=e,this.mediaHandler.avatarVideoElement.setSinkId(e).then((()=>{this.speakerConstraints.deviceId=e,this.options.userMessages.next(new i.SetSpeakerSuccessMessage(e))})).catch((t=>{const r="Uneeq setSpeaker: Error setting device. "+t.message;this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(r,e))}));else{const t="Uneeq setSpeaker: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}}revertMediaOptions(){this.previousMediaOptions&&(this.options.uneeqOptions.sendLocalAudio=this.previousMediaOptions.sendLocalAudio,this.options.uneeqOptions.sendLocalVideo=this.previousMediaOptions.sendLocalVideo)}initMediaConstraints(){this.audioConstraints={},this.videoConstraints={facingMode:"user",width:640,height:480},this.userMediaConstraints={audio:!!this.options.uneeqOptions.sendLocalAudio&&this.audioConstraints,video:!!this.options.uneeqOptions.sendLocalVideo&&this.videoConstraints}}initStreamWithoutDevices(){this.publishStream.getTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream=new MediaStream,this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),this.mediaHandler.localStream$.next(this.publishStream)}remoteVideoReady(){this.options.uneeqOptions.preferredSpeakerId&&this.setAvatarSpeakerDevice(this.options.uneeqOptions.preferredSpeakerId)}sendMediaUnavailableInfo(e){return n(this,void 0,void 0,(function*(){const t=yield this.getMediaDevices(),r={audioInputs:t.audioInput.length,videoInputs:t.videoInput.length,hasUserDeniedPermission:e};return this.api.sendMediaUnavailable(r)}))}getMediaDevices(){return n(this,void 0,void 0,(function*(){const e=yield navigator.mediaDevices.enumerateDevices(),t={audioInput:[],audioOutput:[],videoInput:[]};return t.audioInput=e.filter((e=>"audioinput"===e.kind)),t.audioOutput=e.filter((e=>"audiooutput"===e.kind)),t.videoInput=e.filter((e=>"videoinput"===e.kind)),t}))}initDeviceList(){return n(this,void 0,void 0,(function*(){navigator.mediaDevices.ondevicechange=e=>{this.initDeviceList()};const e=yield this.getMediaDevices();JSON.stringify(e)!==JSON.stringify(this.devices)&&(this.devices=e,this.options.uneeqOptions.preferredCameraId&&this.setCamDevice(this.options.uneeqOptions.preferredCameraId,!1),this.options.uneeqOptions.preferredMicrophoneId&&this.setMicDevice(this.options.uneeqOptions.preferredMicrophoneId,!1),this.options.userMessages.next(new i.DeviceListUpdatedMessage(this.devices)))}))}}},6886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DigitalHumanVideoPlayManager=void 0;const n=r(8512),i=r(7501);t.DigitalHumanVideoPlayManager=class{constructor(e,t){this.messages=e,this.publicUnmuteDigitalHumanMethod=t,this.remoteVideoPlayCount=0}play(e){this.video=e,this.playRemoteVideo()}unmuteVideo(){this.video&&this.video.muted&&(this.video.muted=!1,this.messages.next(new n.DigitalHumanUnmuted))}playRemoteVideo(){this.video&&(this.video.onerror=e=>{this.messages.next(new n.DigitalHumanVideoError(e))},this.video.play().then((()=>{this.messages.next(new n.DigitalHumanUnmuted)})).catch((()=>{this.digitalHumanFailedToPlayUnmuted()})))}digitalHumanFailedToPlayUnmuted(){this.messages.next(new n.DigitalHumanFailedToPlay),this.video.muted=!0,this.video.play().then((()=>{i.logger.log("Muting the digital human and playing it succeeded."),this.messages.next(new n.DigitalHumanPlayedInMutedModeSuccess),this.video.addEventListener("click",(()=>{this.publicUnmuteDigitalHumanMethod()}),{once:!0})})).catch((e=>{i.logger.log("Could not play digital human video even as muted, starting exponential backoff.",e),this.playRemoteVideoWithExponentialBackoff()}))}playRemoteVideoWithExponentialBackoff(){this.video&&(this.video.autoplay=!0,this.video.play().then((()=>{this.messages.next(new n.DigitalHumanUnmuted)})),this.remoteVideoPlayCount++,setTimeout((()=>{this.remoteVideoPlayCount<10&&this.playRemoteVideoWithExponentialBackoff()}),100*(this.remoteVideoPlayCount-1)))}}},7789:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocaleDetector=void 0;class r{static validateOrDetectSpeechLocales(e){let t=e.speechToTextLocales;t&&t.length>0&&(t.split(":").forEach((e=>{this.sttSupportedLocales[e]||(console.error(`UneeQ: Speech to text not supported for: ${e}. Defaulting to en-US`),t=this.defaultLocale)})),"undefined"!==t&&"null"!==t||(t=this.defaultLocale));const r=(window.navigator.languages||[window.navigator.language]).map((e=>((e.length<5||"zh-CN"===e)&&(e=this.localeMappings[e]||null),e&&!this.sttSupportedLocales[e]&&(console.warn(`UneeQ: Speech to text not supported for one of the detected languages: ${e}. Replacing with en-US.`),e=this.defaultLocale),e))).slice(0,4).filter(n).filter(((e,t,r)=>r.indexOf(e)===t));let i=r.join(":").replace(/:\s*$/,"");return i&&0!==i.length||(i=this.defaultLocale),t&&t.length>0?console.debug(`UneeQ: Configured speech to text languages: ${t}`):console.warn(`UneeQ: Detected speechToText languages from browser: ${i}`),t||i}}function n(e){return null!=e}t.LocaleDetector=r,r.defaultLocale="en-US",r.localeMappings={en:"en-US",es:"es-ES",fr:"fr-FR",ja:"ja-JP",de:"de-DE",ko:"ko-KR",zh:"cmn-Hans-CN",it:"it-IT",pt:"pt-PT",nl:"nl-NL",sv:"sv-SE",da:"da-DK",no:"no-NO",fi:"fi-FI",ru:"ru-RU",pl:"pl-PL",tr:"tr-TR",ar:"ar-SA",th:"th-TH",id:"id-ID",cs:"cs-CZ",hu:"hu-HU",ro:"ro-RO",he:"he-IL",vi:"vi-VN",uk:"uk-UA",hi:"hi-IN","zh-CN":"cmn-Hans-CN"},r.sttSupportedLocales={"af-ZA":!0,"sq-AL":!0,"am-ET":!0,"ar-DZ":!0,"ar-BH":!0,"ar-EG":!0,"ar-IQ":!0,"ar-IL":!0,"ar-JO":!0,"ar-KW":!0,"ar-LB":!0,"ar-MR":!0,"ar-MA":!0,"ar-OM":!0,"ar-QA":!0,"ar-SA":!0,"ar-PS":!0,"ar-TN":!0,"ar-AE":!0,"ar-YE":!0,"hy-AM":!0,"az-AZ":!0,"eu-ES":!0,"bn-BD":!0,"bn-IN":!0,"bs-BA":!0,"bg-BG":!0,"my-MM":!0,"ca-ES":!0,"yue-Hant-HK":!0,"cmn-Hans-CN":!0,"cmn-Hant-TW":!0,"hr-HR":!0,"cs-CZ":!0,"da-DK":!0,"nl-BE":!0,"nl-NL":!0,"en-AU":!0,"en-CA":!0,"en-GH":!0,"en-HK":!0,"en-IN":!0,"en-IE":!0,"en-KE":!0,"en-NZ":!0,"en-NG":!0,"en-PK":!0,"en-PH":!0,"en-SG":!0,"en-ZA":!0,"en-TZ":!0,"en-GB":!0,"en-US":!0,"et-EE":!0,"fil-PH":!0,"fi-FI":!0,"fr-BE":!0,"fr-CA":!0,"fr-FR":!0,"fr-CH":!0,"gl-ES":!0,"ka-GE":!0,"de-AT":!0,"de-DE":!0,"de-CH":!0,"el-GR":!0,"gu-IN":!0,"iw-IL":!0,"hi-IN":!0,"hu-HU":!0,"is-IS":!0,"id-ID":!0,"it-IT":!0,"it-CH":!0,"ja-JP":!0,"jv-ID":!0,"kn-IN":!0,"kk-KZ":!0,"km-KH":!0,"ko-KR":!0,"lo-LA":!0,"lv-LV":!0,"lt-LT":!0,"mk-MK":!0,"ms-MY":!0,"ml-IN":!0,"mr-IN":!0,"mn-MN":!0,"ne-NP":!0,"no-NO":!0,"fa-IR":!0,"pl-PL":!0,"pt-BR":!0,"pt-PT":!0,"pa-Guru-IN":!0,"ro-RO":!0,"ru-RU":!0,"rw-RW":!0,"sr-RS":!0,"si-LK":!0,"sk-SK":!0,"sl-SI":!0,"ss-latn-za":!0,"st-ZA":!0,"es-AR":!0,"es-BO":!0,"es-CL":!0,"es-CO":!0,"es-CR":!0,"es-DO":!0,"es-EC":!0,"es-SV":!0,"es-GT":!0,"es-HN":!0,"es-MX":!0,"es-NI":!0,"es-PA":!0,"es-PY":!0,"es-PE":!0,"es-PR":!0,"es-ES":!0,"es-US":!0,"es-UY":!0,"es-VE":!0,"su-ID":!0,"sw-KE":!0,"sw-TZ":!0,"sv-SE":!0,"ta-IN":!0,"ta-MY":!0,"ta-SG":!0,"ta-LK":!0,"te-IN":!0,"th-TH":!0,"tn-latn-za":!0,"tr-TR":!0,"ts-ZA":!0,"uk-UA":!0,"ur-IN":!0,"ur-PK":!0,"uz-UZ":!0,"ve-ZA":!0,"vi-VN":!0,"xh-ZA":!0,"zu-ZA":!0}},7501:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.Logger=t.LogType=void 0,function(e){e.debug="debug",e.log="log",e.warn="warn",e.error="error"}(r||(t.LogType=r={}));class n{constructor(){this.enabled=!1}log(e,...t){this.emitLogMessage(r.log,e,t)}warn(e,...t){this.emitLogMessage(r.warn,e,t)}error(e,...t){this.emitLogMessage(r.error,e,t)}debug(e,...t){this.emitLogMessage(r.debug,e,t)}emitLogMessage(e,t,n){(this.enabled||e===r.error)&&(n.length>0?console[e](t,n):console[e](t))}}t.Logger=n,t.logger=new n},1929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaHandler=void 0;const n=r(2872),i=r(4857),o=r(3607),s=r(4518),a=r(7563),u=r(2958),c=r(7501),l=r(8477);t.MediaHandler=class{constructor(e,t){this.options=e,this.remoteVideoReady=t,this.remoteStream$=new n.BehaviorSubject(null),this.localStream$=new n.BehaviorSubject(null),this.publishState$=new n.BehaviorSubject(a.PublishSubscribeState.DISCONNECTED),this.publishingStream=!1,this.remoteStream$.pipe((0,i.filter)((e=>null!==e))).subscribe((r=>{this.avatarVideoElement=this.options.digitalHumanVideoElement,this.avatarVideoElement.srcObject=r,e.uneeqOptions.avatarVideoContainerElement.style.overflow="hidden",e.uneeqOptions.avatarVideoContainerElement.innerHTML="",e.uneeqOptions.avatarVideoContainerElement.appendChild(this.avatarVideoElement),this.options.uneeqOptions.enableTransparentBackground&&this.initTransparentBackground(this.avatarVideoElement),t()})),this.localStream$.pipe((0,i.filter)((e=>null!==e))).subscribe((t=>{const r=document.createElement("video");this.localVideoElement=r,r.srcObject=t,r.autoplay=!0,r.muted=!0,r.setAttribute("playsinline","true"),r.setAttribute("style","width: 100%; height: 100%;"),e.uneeqOptions.localVideoContainerElement.innerHTML="",e.uneeqOptions.localVideoContainerElement.appendChild(r),this.options.voiceInputManager&&this.options.voiceInputManager.initMicActivity(t),this.options.session.edgeNodeId&&!this.publishingStream&&this.publishVideo()})),this.options.internalMessages$.pipe((0,i.filter)((e=>"AnswerMessage"===e.faceMeMessageType))).subscribe((e=>{void 0!==this.webRTC&&this.webRTC.handleAnswerMessage(e)})),this.options.internalMessages$.pipe((0,i.filter)((e=>"IceCandidateMessage"===e.faceMeMessageType))).subscribe((e=>{void 0!==this.webRTC&&this.webRTC.handleIceCandidate(e)}))}setEdgeNodeId(e){this.options.session.edgeNodeId=e,this.options.session.edgeNodeId&&!this.publishingStream&&this.localStream$.getValue()&&this.publishVideo()}unpublishVideo(){c.logger.log("UserSession | unpublishVideo"),void 0!==this.webRTC&&(this.webRTC.close(),this.webRTC=void 0),this.publishState$.next(a.PublishSubscribeState.DISCONNECTED)}pause(){const e=this.remoteStream$.getValue(),t=this.localStream$.getValue();this.avatarVideoElement.pause(),this.localVideoElement.pause(),t&&t.getTracks().forEach((e=>e.enabled=!1)),e&&e.getTracks().forEach((e=>e.enabled=!1))}resume(){const e=this.remoteStream$.getValue(),t=this.localStream$.getValue();t&&t.getTracks().forEach((e=>e.enabled=!0)),e&&e.getTracks().forEach((e=>e.enabled=!0)),this.avatarVideoElement.play(),this.localVideoElement.play()}stopAllLocalStreams(){const e=this.localStream$.getValue();e&&e.getTracks().forEach((e=>e.stop())),this.publishingStream=!1}endSession(){this.stopAllLocalStreams(),this.options.uneeqOptions.localVideoContainerElement&&this.options.uneeqOptions.localVideoContainerElement&&(this.options.uneeqOptions.localVideoContainerElement.innerHTML=""),this.unpublishVideo(),this.options.uneeqOptions.avatarVideoContainerElement&&this.options.uneeqOptions.avatarVideoContainerElement&&(this.options.uneeqOptions.avatarVideoContainerElement.innerHTML="");const e=this.remoteStream$.getValue();e&&e.getTracks().forEach((e=>e.stop())),this.options.voiceInputManager&&this.options.voiceInputManager.handleSessionEnd()}sendDataMessage(e){this.webRTC&&this.webRTC.sendDataMessage(e)}gatherWebRTCStats(e){var t;null===(t=this.webRTC)||void 0===t||t.getStats(e)}publishVideo(){const e=this.options.session.streamId,t=this.options.session.avatarStreamId,r=this.options.session.turnServerAddresses,n=this.options.session.turnUsername,i=this.options.session.turnPassword,s=this.options.session.forceTurnServerUse,u=this.publishState$,f=this.remoteStream$,h=this.localStream$.getValue();if(!h||!this.options.session.edgeNodeId)return void console.error("Not ready to publish");let d=0;c.logger.log("UserSession | publishVideo - stream:",h,"publishStreamName:",e),c.logger.log("PublishVideo with edge node id: ",this.options.session.edgeNodeId),this.publishingStream=!0,null==this.webRTC?(this.webRTC=new l.UneeqWebRTC({messaging:this.options.messaging,userMessages:this.options.userMessages,publishStreamName:e,subscribeStreamName:t,edgeNodeId:this.options.session.edgeNodeId||"id",diagnostics:this.options.uneeqOptions.diagnostics,onAddStream:e=>{c.logger.log("WEBRTC: onAddStream "+e.stream),f.next(e.stream)},forceTurnServerUse:s,iceServers:[{urls:r,username:n,credential:i}],onConnect:()=>{c.logger.log("UserSession | publishVideo | webRtcInstance | onStateChange - connected"),u.getValue()===a.PublishSubscribeState.CONNECTING&&u.next(a.PublishSubscribeState.CONNECTED)},onError:e=>{c.logger.log("UserSession | publishVideo | webRtcInstance | onConnectionFailed - ",d),d<3?(d++,this.performWebRTCConnection(h),this.options.userMessages.next(new o.ConnectionLostMessage(a.PublishSubscribeState.DISCONNECTED))):(c.logger.log("UserSession | publishVideo | webRtcInstance | Publish failures > 3, so giving up"),u.next(a.PublishSubscribeState.FAILED),this.options.userMessages.next(new o.ConnectionLostMessage(a.PublishSubscribeState.FAILED)))}}),this.performWebRTCConnection(h)):this.webRTC.updateStreamTracks(h)}performWebRTCConnection(e){this.webRTC&&(this.publishState$.next(a.PublishSubscribeState.CONNECTING),this.webRTC.connect(e))}initTransparentBackground(e){const t=new u.CanvasService(this.options.uneeqOptions).createCanvas();(new s.VideoEditor).applyChromaKeyEffect(t,e),this.avatarVideoElement.style.display="none"}}},4887:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;const n=r(4857),i=r(3607),o=r(4050);t.MessageHandler=class{constructor(e,t){this.internalMessages$=e,this.messages=t,this.deviceManager={getDevices:(e,t)=>{}},this.getMessagesOfType("AvatarQuestionText").subscribe((e=>{const t={type:o.PromMessageType.QuestionMessageReceived,value:{id:e.id,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new i.AvatarQuestionMessage(e.question,e.id))})),this.getMessagesOfType("AvatarAnswerText").subscribe((e=>{const t={type:o.PromMessageType.AnswerMessageReceived,value:{id:e.questionId,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new i.AvatarAnswerMessage(e.answer,e.answerAvatar,e.answerSpeech,e.questionId))})),this.getMessagesOfType("AvatarAnswerHTML").subscribe((e=>{this.messages.next(new i.AvatarAnswerContentMessage(e.html,e.messageId,e.hasDisplayHtml)),this.messages.next(new i.InstructionsMessage(e.instructions))})),this.getMessagesOfType("AvatarTextInputStarted").subscribe((e=>this.messages.next(new i.StartedSpeakingMessage))),this.getMessagesOfType("AvatarTextInputFinished").subscribe((e=>{this.messages.next(new i.FinishedSpeakingMessage),this.messages.next(new i.AvatarTextInputFinishedMessage)})),this.getMessagesOfType("AvatarStarting").subscribe((e=>{this.deviceManager.edgeNodeId=e.edgeNodeId})),this.getMessagesOfType("ClientMediaStreamUpdate").subscribe((e=>{this.messages.next(new i.ClientMediaStreamUpdateMessage(e.clientStreamingAudio,e.clientStreamingVideo,e.serverStreamingAudio,e.serverStreamingVideo)),e.clientStreamingAudio&&e.clientStreamingVideo&&e.serverStreamingAudio&&e.serverStreamingVideo&&(this.internalMessages$.next({faceMeMessageType:"sessionLive"}),this.internalMessages$.next({faceMeMessageType:"remoteVideoReadyToPlay"}))})),this.getMessagesOfType("SessionErrorMessage").subscribe((e=>{console.error(e.error),this.messages.next(new i.SessionErrorMessage(e.error))})),this.getMessagesOfType("SessionInfoMessage").subscribe((e=>{this.messages.next(new i.SessionInfoMessage(e.info))})),this.getMessagesOfType("SessionEndedMessage").subscribe((()=>{const e={type:o.PromMessageType.SessionEnded,value:{receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.internalMessages$.next({faceMeMessageType:"sessionEnd"})})),this.getMessagesOfType("AvatarRequestCompleted").subscribe((e=>{this.messages.next(new i.AvatarRequestCompleted(e.reason))})),this.getMessagesOfType("AvatarRequestIgnored").subscribe((e=>{this.messages.next(new i.AvatarRequestIgnored(e.reason))}))}setDeviceManager(e){this.deviceManager=e}getMessagesOfType(e){return this.internalMessages$.pipe((0,n.filter)((t=>t.faceMeMessageType===e)))}}},8957:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingState=t.MessagingService=void 0;const n=r(8637);Object.defineProperty(t,"MessagingService",{enumerable:!0,get:function(){return n.MessagingService}});const i=r(7229);Object.defineProperty(t,"MessagingState",{enumerable:!0,get:function(){return i.MessagingState}})},8637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingService=void 0;const n=r(2541),i=r(2872),o=r(7501),s=r(7229);t.MessagingService=class{constructor(e,t){this.options={autoReconnect:!0,reconnectTime:5e3,maxReconnectAttempts:3,connectionHeaders:{},maxReconnectLimitReached:()=>{},onReconnect:()=>{}},this.url=e,this.options=Object.assign(this.options,t),this.subscriptions={},this.connectionAttempts=0,this.state$=new i.BehaviorSubject(s.MessagingState.DISCONNECTED),this.messages$=new i.Subject,console.log("connect headers messaging: ",this.options.connectionHeaders);const r={connectHeaders:this.options.connectionHeaders,reconnectDelay:0,connectionTimeout:5e3,discardWebsocketOnCommFailure:!0,brokerURL:this.url.replace("https://","wss://").replace("http://","ws://")};this.stompClient=new n.Client(r),this.stompClient.onConnect=e=>this.onStompConnected(e),this.stompClient.onDisconnect=e=>{o.logger.log("Stomp client disconnected",e)},this.stompClient.onStompError=e=>{o.logger.log("Stomp client error",e),this.onStompClientConnectionClosed(e)},this.stompClient.onWebSocketError=e=>{o.logger.log("Stomp client web socket error",e),this.onStompClientConnectionClosed(e)},this.stompClient.onWebSocketClose=e=>{o.logger.log("Stomp client web socket closed",e),this.onStompClientConnectionClosed(e)}}connect(){this.disconnect(),o.logger.log("MessagingService | connecting..."),this.state$.next(s.MessagingState.CONNECTING),this.connectionAttempts++,this.stompClient.activate()}disconnect(){const e=this.state$.getValue();if(e===s.MessagingState.CONNECTED||e===s.MessagingState.CONNECTING){o.logger.log("Disconnecting stomp client");try{this.subscriptions={},this.options.autoReconnect=!1,this.stompClient.deactivate(),this.stompClient.forceDisconnect(),this.state$.next(s.MessagingState.DISCONNECTED)}catch(e){console.error("MessagingService | disconnect: error",e),this.state$.next(s.MessagingState.DISCONNECTED)}}}send(e,t){o.logger.log("MessagingService | send:",e,t);const r={"content-type":"application/json","x-auth-token":this.options.connectionHeaders["x-auth-token"]},n=JSON.stringify(t);this.stompClient.publish({destination:e,body:n,headers:r})}getTopic(e){o.logger.log("MessagingService | subscribeToTopic: "+e);const t=this.subscriptions[e];if(t)return o.logger.log("existing subscription... not re-subscribing to topic"),t;const r=new i.Subject;return this.stompClient.subscribe(e,(e=>{r.next(e),this.messages$.next(e)})),this.subscriptions[e]=r,r}onStompConnected(e){o.logger.log("MessagingService | connected"),this.state$.next(s.MessagingState.CONNECTED),this.initMessagingSubscription(),this.connectionAttempts=0}onStompClientConnectionClosed(e){this.options.autoReconnect?this.options.maxReconnectAttempts&&this.connectionAttempts<this.options.maxReconnectAttempts?setTimeout((()=>{this.connect()}),this.options.reconnectTime):this.options.maxReconnectLimitReached&&(this.options.maxReconnectLimitReached(),this.disconnect()):this.disconnect()}initMessagingSubscription(){o.logger.log("MessagingService | initMessagingSubscription"),this.stompClient.subscribe("/",(e=>{this.messages$.next(e)}))}}},7229:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingState=void 0,function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(r||(t.MessagingState=r={}))},2694:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsService=void 0;const n=r(3607),i=r(9824),o=r(4050);t.MetricsService=class{constructor(e,t,r){this.uneeqOptions=e,this.internalMessages=t,this.messages=r,this.clientPerformanceStats={},this.options=e,this.internalMessages$=t,this.messages$=r}parseAndLogWebRtcStats(e){try{e.forEach((e=>{var t,r;if("inbound-rtp"===e.type&&"video"===e.kind){this.clientPerformanceStats.frameHeight=new i.ClientPerformanceStat("Frame height",e.frameHeight),this.clientPerformanceStats.frameWidth=new i.ClientPerformanceStat("Frame width",e.frameWidth);const n=e.framesDropped,o=n?n-(null===(t=this.clientPerformanceStats.totalFramesDropped)||void 0===t?void 0:t.value):0;this.clientPerformanceStats.newFramesDropped=o?new i.ClientPerformanceStat("New Frames Dropped",o):new i.ClientPerformanceStat,this.clientPerformanceStats.totalFramesDropped=n?new i.ClientPerformanceStat("Total Frames Dropped",n):new i.ClientPerformanceStat;const s=e.packetsLost,a=s?s-(null===(r=this.clientPerformanceStats.inboundTotalPacketsLost)||void 0===r?void 0:r.value):0;this.clientPerformanceStats.inboundNewPacketsLost=a?new i.ClientPerformanceStat("New packets lost",a):new i.ClientPerformanceStat,this.clientPerformanceStats.inboundTotalPacketsLost=s?new i.ClientPerformanceStat("Total packets lost",s):new i.ClientPerformanceStat;const u=e.framesPerSecond;this.clientPerformanceStats.framesPerSec=u?new i.ClientPerformanceStat("Frames per second",u):new i.ClientPerformanceStat}else if("remote-inbound-rtp"===e.type&&"video"===e.kind){const t=e.roundTripTime;this.clientPerformanceStats.inboundRoundTripTime=t?new i.ClientPerformanceStat("Round Trip Time",t):new i.ClientPerformanceStat}else if("outbound-rtp"===e.type&&"video"===e.kind){const t=e.qualityLimitationReason;this.clientPerformanceStats.outboundQualityLimitationReason=new i.ClientPerformanceStat("Quality Limitation Reason",t)}})),this.options.enableClientPerformanceMessage&&this.messages$.next(new n.ClientPerformanceMessage(this.clientPerformanceStats));const t={type:o.PromMessageType.WebRtcPerformance,value:this.clientPerformanceStats};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t})}catch(e){console.warn("Unable to parseAndLogWebRTCStats",e)}}}},6400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OnlineStatusService=void 0;const n=r(3607);t.OnlineStatusService=class{constructor(e,t){this.messages=e,this.offlineTimeoutLimitHandler=t,this.online=!0,this.offlineDisconnectTimeLimitMS=1e4,window.addEventListener("offline",(()=>this.handleOffline())),window.addEventListener("online",(()=>this.handleOnline()))}handleOffline(){this.online=!1,this.disconnectTimer=setTimeout((()=>{this.offlineTimeoutLimitHandler()}),this.offlineDisconnectTimeLimitMS),this.sendStatusUpdate()}handleOnline(){this.online=!0,window.clearTimeout(this.disconnectTimer),this.sendStatusUpdate()}sendStatusUpdate(){this.messages.next(new n.OnlineStatusUpdateMessage(this.online))}}},4050:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Prom=t.PromMessageType=void 0;const i=n(r(4427));var o;!function(e){e[e.SessionStart=0]="SessionStart",e[e.WebRtcPerformance=1]="WebRtcPerformance",e[e.AvailabilityCheck=2]="AvailabilityCheck",e[e.QuestionMessageReceived=3]="QuestionMessageReceived",e[e.AnswerMessageReceived=4]="AnswerMessageReceived",e[e.SessionEnded=5]="SessionEnded"}(o||(t.PromMessageType=o={})),t.Prom=class{constructor(e){this.apiUrl=e,this.prom_prefix="client_sdk_",this.registry=(0,i.default)(),this.messageTimings=[],this.metricsPushedCounter=this.registry.create("counter",this.prom_prefix+"metrics_pushed_total","A counter for showcase metrics pushed."),this.sessionStartTime=this.registry.create("histogram",this.prom_prefix+"session_start_duration_seconds","A histogram of session start times.",[1,2.5,4,5,6,7.5,8.5,10,15,30,60]),this.availabilityCheckTime=this.registry.create("histogram",this.prom_prefix+"availability_chk_duration_seconds","A histogram of availability check response times.",[.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.webRtcInboundRTT=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_rtt_duration_seconds","A histogram of client inbound round trip time.",[.001,.002,.005,.01,.02,.05,.1,.5,2,5]),this.webRtcInboundFramesPerSec=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_per_second","A histogram of client inbound frames per second.",[1,2,5,10,15,20,25,35,50]),this.webRtcInboundPacketsLost=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_packets_lost","A histogram of client packets lost.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFramesDropped=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_dropped","A histogram of frames dropped.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFrameHeight=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_height_px","A histogram of frame height in pixels",[60,180,240,360,540,720,1280]),this.webRtcFrameWidth=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_width_px","A histogram of frame width in pixels",[60,180,240,360,540,720,1280,1500,1920]),this.conversationRoundTripTime=this.registry.create("histogram",this.prom_prefix+"conversation_rtt_duration_seconds","A histogram of round trip time of a conversation",[.001,.005,.01,.03,.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.metricsIntervalId=setInterval((()=>{this.sendMetrics()}),1e4)}handleMessage(e){var t,r,n,i,s,a,u;const c=Object.assign(e.labels||{},{platform:"js"});switch(e.type){case o.SessionStart:this.sessionStartTime.observe(e.value,c);break;case o.QuestionMessageReceived:this.messageTimings.push(e.value);break;case o.AnswerMessageReceived:const l=this.calculateConversationRtt(e);l>0&&this.conversationRoundTripTime.observe(l,c);break;case o.WebRtcPerformance:const f=e.value;f.outboundQualityLimitationReason?c.qualityLimitationReason=null===(t=f.outboundQualityLimitationReason)||void 0===t?void 0:t.value:c.qualityLimitationReason="unknown",f.newFramesDropped&&this.webRtcFramesDropped.observe(null===(r=f.newFramesDropped)||void 0===r?void 0:r.value,c),f.framesPerSec&&this.webRtcInboundFramesPerSec.observe(null===(n=f.framesPerSec)||void 0===n?void 0:n.value,c),f.inboundNewPacketsLost&&this.webRtcInboundPacketsLost.observe(null===(i=f.inboundNewPacketsLost)||void 0===i?void 0:i.value,c),f.inboundRoundTripTime&&this.webRtcInboundRTT.observe(null===(s=f.inboundRoundTripTime)||void 0===s?void 0:s.value,c),f.frameHeight&&this.webRtcFrameHeight.observe(null===(a=f.frameHeight)||void 0===a?void 0:a.value,c),f.frameWidth&&this.webRtcFrameWidth.observe(null===(u=f.frameWidth)||void 0===u?void 0:u.value,c);break;case o.AvailabilityCheck:this.availabilityCheckTime.observe(e.value,c);break;case o.SessionEnded:this.stopSendingMetrics()}}calculateConversationRtt(e){if(e.value&&this.messageTimings){const t=this.messageTimings.find((t=>t.id===e.value.id));if(t){const r=t.receivedOn;if(r){const n=(e.value.receivedOn-r)/1e3;return this.messageTimings.splice(this.messageTimings.indexOf(t),1),n}}}return 0}sendMetrics(){this.metricsPushedCounter.inc({platform:"js"});const e=new Request(this.apiUrl+"/client-metrics",{method:"POST",body:this.registry.metrics(),mode:"no-cors"});fetch(e),this.registry.reset()}stopSendingMetrics(){this.metricsIntervalId&&clearInterval(this.metricsIntervalId)}}},8591:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResumeSessionCheck=void 0;const n=r(7501),i=r(39);class o{static validate(e){const t=new i.UneeqLocalStorage;let r=void 0!==e.resumeSession&&e.resumeSession;t.getItemSafely("uneeqResumeSessionPersonaId")===e.conversationId||(n.logger.log("UneeQ: Persona Id's do not match, unable to resume session."),r=!1);const s=o.browserTabIsActive();if(r&&!s&&(n.logger.log("UneeQ: Browser tab is not active so unable to resume"),r=!1),r){const e=t.getItemSafely("uneeqResumeSessionId");if(null!==e)return{resumeSession:!0,resumeSessionId:e}}return{resumeSession:!1}}static browserTabIsActive(){return!document.hidden}}t.ResumeSessionCheck=o},1116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamManager=void 0,t.StreamManager=class{constructor(){window.AudioContext=window.AudioContext||window.webkitAudioContext,this.silentAudioTrack=this.generateSilentAudioTrack(),this.canvasVideoTrack=this.generateCanvasVideoTrack()}addCanvasVideoTrackToStream(e){return e.getVideoTracks().forEach((t=>e.removeTrack(t))),e.addTrack(this.canvasVideoTrack),e}addSilentAudioTrackToStream(e){return e.getAudioTracks().forEach((t=>e.removeTrack(t))),e.addTrack(this.silentAudioTrack),e}resumeAudioContext(){this.audioContextInstance&&this.audioContextInstance.resume()}generateCanvasVideoTrack(){const e=document.createElement("canvas");return e.width=40,e.height=30,e.getContext("2d"),e.captureStream(1).getVideoTracks()[0]}generateSilentAudioTrack(){if(!this.audioSourceNode||!this.audioSourceDestination){const e=new window.AudioContext;this.audioContextInstance=e,this.audioSourceDestination=e.createMediaStreamDestination()}return this.audioSourceDestination.stream.getAudioTracks()[0]}}},39:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UneeqLocalStorage=void 0;const n=r(7501);t.UneeqLocalStorage=class{constructor(){}get available(){return void 0===this.localStorageAvailable&&(this.localStorageAvailable=this.checkIfLocalStorageAvailable()),this.localStorageAvailable}setItemSafely(e,t){this.available?localStorage.setItem(e,t):n.logger.log("UneeQ: unable to access localStorage because it is not available.")}getItemSafely(e){return this.available?localStorage.getItem(e):void n.logger.log("UneeQ: unable to access localStorage because it is not available.")}removeItemSafely(e){this.available?localStorage.removeItem(e):n.logger.log("UneeQ: unable to access localStorage because it is not available.")}checkIfLocalStorageAvailable(){const e="UneeqLocalStoreCheck";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}}},8477:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.UneeqWebRTC=void 0;const i=n(r(8853)),o=n(r(835)),s=r(3607),a=r(7501);t.UneeqWebRTC=class{constructor(e){this.fakeDataChannel={},this.MESSAGING_ENDPOINT="/app/v2/webRTC",this.onStats=(e,t)=>{this.options.userMessages.next(new s.WebRtcStatsMessage(t)),this.statTimer=window.setTimeout((()=>{this.client&&this.client.getStats&&this.client.getStats(this.onStats)}),2e3)},this.options=Object.assign({forceTurnServerUse:!1,iceServers:[]},e),this.log("Options",this.options),this.uniqueId=Math.random().toString(36).substring(2,12),RTCPeerConnection.prototype.createDataChannel||(this.warn("Implementing a fake createDataChannel"),RTCPeerConnection.prototype.createDataChannel=()=>this.fakeDataChannel)}connect(e){this.close(),this.client=new i.default({initiator:!0,config:{iceServers:this.options.iceServers},stream:e,channelName:"UneeqChannel"}),this.options.diagnostics&&this.enableDiagnostics(),this.fakeDataChannel.onopen&&(this.warn("Calling channel open on fake data channel"),this.fakeDataChannel.onopen()),this.client.on("error",(e=>{this.log("error",e),void 0!==this.options.onError&&this.options.onError(e)})),this.client.on("signal",(e=>{const t={payload:"",publishStreamName:this.options.publishStreamName,subscribeStreamName:this.options.subscribeStreamName,uniqueId:this.uniqueId,userAgent:navigator.userAgent,edgeNodeId:this.options.edgeNodeId};if("type"in e&&"offer"===e.type)t.payload=JSON.stringify({type:"offer",sdp:e.sdp}),t.type="OfferMessage",this.log("Offer payload ",t),this.options.messaging.send(this.MESSAGING_ENDPOINT,t);else if("candidate"in e){const r=JSON.stringify(e.candidate);this.options.forceTurnServerUse&&!r.match(/typ relay/)||r.match(/::/)||(t.payload=r,t.type="IceCandidate",this.log("IC payload ",t),this.options.messaging.send(this.MESSAGING_ENDPOINT,t))}else this.warn("WARNING Unhandled signal: ",JSON.stringify(e))})),this.client.on("connect",(()=>{this.log("CONNECT"),void 0!==this.options.onConnect&&this.options.onConnect()})),this.client.on("data",(e=>{this.log("data: "+e),void 0!==this.options.onData&&this.options.onData(e),this.options.userMessages.next(new s.WebRtcDataMessage(e))})),this.client.on("close",(()=>{this.log("WebRTC session closed: "+this.uniqueId),this.client=null,void 0!==this.options.onClose&&this.options.onClose()})),this.client.on("stream",(e=>{void 0!==this.options.onAddStream&&this.options.onAddStream({stream:e})}))}close(){this.client&&(this.client.destroy(),this.client=null),this.statTimer&&clearTimeout(this.statTimer)}handleAnswerMessage(e){if(this.isMessageForUs(e)&&this.client){const t=JSON.parse(e.payload);return this.log("got answer: ",t),this.client.signal(t),!0}return this.log("ignoring answer: ",e),!1}handleIceCandidate(e){if(this.isMessageForUs(e)&&this.client){const t=JSON.parse(e.payload);if("candidate"in t&&""===t.candidate){if("edge"===o.default.browserDetails.browser){const e=this.client._pc;e.remoteDescription&&e.remoteDescription.type&&e.addIceCandidate(null)}}else this.client.signal({candidate:t});return!0}return!1}sendDataMessage(e){this.client.send(e)}getStats(e){return this.client&&this.client.getStats(e)}updateStreamTracks(e){e.getTracks().forEach((e=>{this.client._pc.getSenders().find((t=>e.kind===t.track.kind)).replaceTrack(e).then((()=>{a.logger.log("Updated publish media stream track for "+e.kind)})).catch((t=>{a.logger.error("Error: updating publish media stream track failed for "+e.kind,t)}))}))}enableDiagnostics(){this.client._pc&&0!==this.client._pc.getStats.length&&(this.client._pc.getStats=""),this.client&&this.client.getStats&&this.client.getStats(this.onStats)}isMessageForUs(e){return e.requestUniqueId===this.uniqueId}log(e,...t){a.logger.log("UneeqWebRTC: "+e,t)}warn(e,...t){a.logger.warn("UneeqWebRTC: "+e,t)}}},4333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInputManager=void 0;const n=r(4857),i=r(881),o=r(8512),s=r(608),a=r(7501);t.VoiceInputManager=class{constructor(e,t,r,n){this.options=e,this.api=t,this.messages=r,this.enableMicrophone=n,this.microphoneEngageVolume=.02,this.microphoneDisengageVolume=.02,this.voiceActivityNotSpeakingTimeoutMS=1e3,this.voiceActivityAllowInterruptions=!1,this.digitalHumanSpeaking=!1,this.recording=!1,this.setVoiceInputMode(e.voiceInputMode);try{window.AudioContext=window.AudioContext||window.webkitAudioContext,this.audioContext=new AudioContext}catch(e){this.audioContextNotSupported()}this.handleAppMessages()}setVoiceInputMode(e){e===s.VoiceInputMode.PUSH_TO_TALK?this.options.voiceInputMode=s.VoiceInputMode.PUSH_TO_TALK:e===s.VoiceInputMode.VOICE_ACTIVITY?this.options.voiceInputMode=s.VoiceInputMode.VOICE_ACTIVITY:this.messages.next(new o.WarningMessage("Invalid voice input mode selected: "+e))}startRecording(){this.options.voiceInputMode===s.VoiceInputMode.PUSH_TO_TALK?this.apiStartRecording():this.requestNotSupportedInVoiceActivityMode("startRecording")}stopRecording(){this.options.voiceInputMode===s.VoiceInputMode.PUSH_TO_TALK?this.apiStopRecording():this.requestNotSupportedInVoiceActivityMode("stopRecording")}handleSessionEnd(){this.soundMeter&&this.soundMeter.stop()}resumeAudioContext(){a.logger.log("UneeQ: resuming publish stream audio context and initializing mic activity."),this.audioContext&&(this.audioContext.resume(),this.stream&&this.initMicActivity(this.stream))}initMicActivity(e){this.stream=e,this.soundMeter=new i.SoundMeter(this.audioContext),this.soundMeter.connectToSource(e,(e=>this.micActivityConnected(e)))}audioContextNotSupported(){this.options.micActivityMessages&&this.messages.next(new o.MicActivityNotSupportedMessage),this.messages.next(new o.VoiceActivityInputModeNotSupportedMessage),this.setVoiceInputMode(s.VoiceInputMode.PUSH_TO_TALK)}handleAppMessages(){this.messages.subscribe((e=>{switch(e.uneeqMessageType){case o.UneeqMessageType.StartedSpeaking:console.log("StartSpeaking message"),this.digitalHumanSpeaking=!0;break;case o.UneeqMessageType.FinishedSpeaking:this.digitalHumanSpeaking=!1}}))}requestNotSupportedInVoiceActivityMode(e){this.messages.next(new o.WarningMessage("Request not supported in voice activity mode: "+e))}apiStartRecording(){this.recording=!0,this.messages.next(new o.RecordingStartedMessage),this.api.avatarStartRecording().catch((()=>{this.recording=!1,this.messages.next(new o.RecordingStoppedMessage)}))}apiStopRecording(){this.recording=!1,this.api.avatarStopRecording(),this.messages.next(new o.RecordingStoppedMessage)}micActivityConnected(e){e?this.messages.next(new o.MicActivityErrorMessage(e)):this.soundMeter&&this.soundMeter.instant$.pipe((0,n.distinctUntilChanged)()).subscribe((e=>{this.handleVoiceActivity(e)}))}handleVoiceActivity(e){this.options.micActivityMessages&&this.messages.next(new o.MicActivityMessage(e)),this.options.voiceInputMode!==s.VoiceInputMode.VOICE_ACTIVITY||this.digitalHumanSpeaking&&!this.voiceActivityAllowInterruptions||(e>this.microphoneEngageVolume?(this.recording||this.apiStartRecording(),this.clearSilenceTimeout()):e<this.microphoneDisengageVolume&&this.recording&&(this.clearSilenceTimeout(),this.silenceTimeout=setTimeout((()=>{this.recording&&this.apiStopRecording()}),this.voiceActivityNotSpeakingTimeoutMS)))}clearSilenceTimeout(){this.silenceTimeout&&clearTimeout(this.silenceTimeout)}}},9824:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientPerformanceStat=void 0,t.ClientPerformanceStat=class{constructor(e="",t=0){this.label=e,this.value=t}}},8512:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DigitalHumanUnmuted=t.DigitalHumanPlayedInMutedModeSuccess=t.DigitalHumanFailedToPlay=t.DigitalHumanVideoError=t.ClientPerformanceMessage=t.ClientMediaStreamUpdateMessage=t.OnlineStatusUpdateMessage=t.SessionInfoMessage=t.AvatarRequestIgnored=t.AvatarRequestCompleted=t.SessionErrorMessage=t.WebRtcStatsMessage=t.WebRtcDataMessage=t.SessionLiveMessage=t.WarningMessage=t.RecordingStoppedMessage=t.RecordingStartedMessage=t.DevicePermissionAllowedMessage=t.AvatarTextInputFinishedMessage=t.FinishedSpeakingMessage=t.StartedSpeakingMessage=t.AvatarQuestionMessage=t.InstructionsMessage=t.AvatarAnswerContentMessage=t.AvatarAnswerMessage=t.ResumeSessionUnavailable=t.ConnectionLostMessage=t.VoiceActivityInputModeNotSupportedMessage=t.MicActivityNotSupportedMessage=t.MicActivityMessage=t.MicActivityErrorMessage=t.ServiceUnavailableMessage=t.AvatarUnavailableMessage=t.AvatarAvailableMessage=t.SessionEndedMessage=t.SessionResumedMessage=t.SessionPausedMessage=t.DeviceListUpdatedMessage=t.DeviceErrorMessage=t.SetSpeakerSuccessMessage=t.SetMicSuccessMessage=t.SetCameraSuccessMessage=t.DeviceNotFoundErrorMessage=t.ReadyMessage=t.UneeqMessageType=void 0,function(e){e.Ready="Ready",e.DeviceNotFoundError="DeviceNotFoundError",e.SetCameraSuccess="SetCameraSuccess",e.SetMicSuccess="SetMicSuccess",e.SetSpeakerSuccess="SetSpeakerSuccess",e.SessionPaused="SessionPaused",e.SessionResumed="SessionResumed",e.SessionEnded="SessionEnded",e.AvatarAvailable="AvatarAvailable",e.AvatarUnavailable="AvatarUnavailable",e.ConnectionLost="ConnectionLost",e.ResumeSessionUnavailable="ResumeSessionUnavailable",e.ServiceUnavailable="ServiceUnavailable",e.OnlineStatusUpdate="OnlineStatusUpdate",e.MicActivityNotSupported="MicActivityNotSupported",e.VoiceActivityInputModeNotSupported="VoiceActivityInputModeNotSupported",e.MicActivityError="MicActivityError",e.MicActivity="MicActivity",e.DeviceError="DeviceError",e.DeviceListUpdated="DeviceListUpdated",e.AvatarAnswer="AvatarAnswer",e.AvatarAnswerContent="AvatarAnswerContent",e.Instructions="Instructions",e.StartedSpeaking="StartedSpeaking",e.FinishedSpeaking="FinishedSpeaking",e.AvatarTextInputFinished="AvatarTextInputFinished",e.AvatarQuestionText="AvatarQuestionText",e.DevicePermissionAllowed="DevicePermissionAllowed",e.RecordingStarted="RecordingStarted",e.RecordingStopped="RecordingStopped",e.Warning="Warning",e.SessionLive="SessionLive",e.WebRtcData="WebRtcData",e.WebRtcStats="WebRtcStats",e.SessionError="SessionError",e.SessionInfo="SessionInfo",e.AvatarRequestCompleted="AvatarRequestCompleted",e.AvatarRequestIgnored="AvatarRequestIgnored",e.ClientMediaStreamUpdate="ClientMediaStreamUpdate",e.ClientPerformanceMessage="ClientPerformanceMessage",e.DigitalHumanVideoError="DigitalHumanVideoError",e.DigitalHumanFailedToPlay="DigitalHumanFailedToPlay",e.DigitalHumanPlayedInMutedModeSuccess="DigitalHumanPlayedInMutedModeSuccess",e.DigitalHumanUnmuted="DigitalHumanUnmuted"}(r||(t.UneeqMessageType=r={})),t.ReadyMessage=class{constructor(){this.uneeqMessageType=r.Ready}},t.DeviceNotFoundErrorMessage=class{constructor(e,t){this.msg=e,this.deviceId=t,this.uneeqMessageType=r.DeviceNotFoundError}},t.SetCameraSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetCameraSuccess}},t.SetMicSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetMicSuccess}},t.SetSpeakerSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=r.SetSpeakerSuccess}},t.DeviceErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.DeviceError}},t.DeviceListUpdatedMessage=class{constructor(e){this.devices=e,this.uneeqMessageType=r.DeviceListUpdated}},t.SessionPausedMessage=class{constructor(){this.uneeqMessageType=r.SessionPaused}},t.SessionResumedMessage=class{constructor(){this.uneeqMessageType=r.SessionResumed}},t.SessionEndedMessage=class{constructor(){this.uneeqMessageType=r.SessionEnded}},t.AvatarAvailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarAvailable}},t.AvatarUnavailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarUnavailable}},t.ServiceUnavailableMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.ServiceUnavailable}},t.MicActivityErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.MicActivityError}},t.MicActivityMessage=class{constructor(e){this.level=e,this.uneeqMessageType=r.MicActivity}},t.MicActivityNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.MicActivityNotSupported}},t.VoiceActivityInputModeNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.VoiceActivityInputModeNotSupported}},t.ConnectionLostMessage=class{constructor(e){this.connectionState=e,this.uneeqMessageType=r.ConnectionLost}},t.ResumeSessionUnavailable=class{constructor(){this.uneeqMessageType=r.ResumeSessionUnavailable}},t.AvatarAnswerMessage=class{constructor(e,t,n,i){this.answer=e,this.answerAvatar=t,this.answerSpeech=n,this.transcriptId=i,this.uneeqMessageType=r.AvatarAnswer}},t.AvatarAnswerContentMessage=class{constructor(e,t,n=!1){this.content=e,this.transcriptId=t,this.hasDisplayHtml=n,this.uneeqMessageType=r.AvatarAnswerContent}},t.InstructionsMessage=class{constructor(e){this.instructions=e,this.uneeqMessageType=r.Instructions}},t.AvatarQuestionMessage=class{constructor(e,t){this.question=e,this.transcriptId=t,this.uneeqMessageType=r.AvatarQuestionText}},t.StartedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.StartedSpeaking}},t.FinishedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.FinishedSpeaking}},t.AvatarTextInputFinishedMessage=class{constructor(){this.uneeqMessageType=r.AvatarTextInputFinished}},t.DevicePermissionAllowedMessage=class{constructor(){this.uneeqMessageType=r.DevicePermissionAllowed}},t.RecordingStartedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStarted}},t.RecordingStoppedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStopped}},t.WarningMessage=class{constructor(e){this.msg=e,this.uneeqMessageType=r.Warning}},t.SessionLiveMessage=class{constructor(e,t){this.showLogo=e,this.sessionResumed=t,this.uneeqMessageType=r.SessionLive}},t.WebRtcDataMessage=class{constructor(e){this.data=e,this.uneeqMessageType=r.WebRtcData}},t.WebRtcStatsMessage=class{constructor(e){this.stats=e,this.uneeqMessageType=r.WebRtcStats}},t.SessionErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=r.SessionError}},t.AvatarRequestCompleted=class{constructor(e){this.reason=e,this.uneeqMessageType=r.AvatarRequestCompleted}},t.AvatarRequestIgnored=class{constructor(e){this.reason=e,this.uneeqMessageType=r.AvatarRequestIgnored}},t.SessionInfoMessage=class{constructor(e){this.info=e,this.uneeqMessageType=r.SessionInfo}},t.OnlineStatusUpdateMessage=class{constructor(e){this.online=e,this.uneeqMessageType=r.OnlineStatusUpdate}},t.ClientMediaStreamUpdateMessage=class{constructor(e,t,n,i){this.clientStreamingAudio=e,this.clientStreamingVideo=t,this.serverStreamingAudio=n,this.serverStreamingVideo=i,this.uneeqMessageType=r.ClientMediaStreamUpdate}},t.ClientPerformanceMessage=class{constructor(e){this.clientPerformance=e,this.uneeqMessageType=r.ClientPerformanceMessage}},t.DigitalHumanVideoError=class{constructor(e){this.error=e,this.uneeqMessageType=r.DigitalHumanVideoError}},t.DigitalHumanFailedToPlay=class{constructor(){this.uneeqMessageType=r.DigitalHumanFailedToPlay,this.msg="Digital Human failed to play with sound. This most likely occurred because the user has not yet interacted with the page and was blocked due to the browser's autoplay policy. Video will automatically be muted and attempted to be played again."}},t.DigitalHumanPlayedInMutedModeSuccess=class{constructor(){this.uneeqMessageType=r.DigitalHumanPlayedInMutedModeSuccess,this.msg="Digital Human was successfully played in muted mode. After the user interacts with the page you will need to call unmuteDigitalHuman() to unmute the video."}},t.DigitalHumanUnmuted=class{constructor(){this.uneeqMessageType=r.DigitalHumanUnmuted}}},7636:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SessionType=void 0,function(e){e[e.WEB=0]="WEB"}(r||(t.SessionType=r={}))},7563:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PublishSubscribeState=void 0,function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.FAILED="FAILED"}(r||(t.PublishSubscribeState=r={}))},9794:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SourceApp=void 0,function(e){e.HOSTED_EXPERIENCE="HOSTED_EXPERIENCE",e.SHOWCASE="SHOWCASE",e.SPLIT_SCREEN="SPLIT_SCREEN",e.INTERACTIONS="INTERACTIONS",e.UNKNOWN="UNKNOWN"}(r||(t.SourceApp=r={}))},608:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInputMode=void 0,function(e){e.PUSH_TO_TALK="PUSH_TO_TALK",e.VOICE_ACTIVITY="VOICE_ACTIVITY",e.SPEECH_RECOGNITION="SPEECH_RECOGNITION"}(r||(t.VoiceInputMode=r={}))},6123:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Uneeq=void 0;const o=r(2872),s=r(4857),a=i(r(4147)),u=r(1181),c=r(1546),l=r(6886),f=r(7789),h=r(7501),d=r(4887),p=r(8957),v=r(2694),m=r(6400),g=r(4050),y=r(8591),b=r(1116),_=r(39),w=r(4333),S=r(8512),E=r(7636),T=r(7563),O=r(9794),C=r(608);t.Uneeq=class{get sessionId(){return this.session?this.session.id:null}constructor(e){this.ready=new o.BehaviorSubject(!1),this.version=a.default.version,this.messages=new o.Subject,this.internalMessages$=new o.Subject,this.sessionPaused=!1,this.sessionStarted=!1,this.unavailableAvatarMsgSent=!1,this.sessionWasResumed=!1,this.uneeqLocalStorage=new _.UneeqLocalStorage,h.logger.enabled=e.logging||!1,this.options=e,this.options.diagnostics=e.diagnostics||!1,this.options.micActivityMessages=e.micActivityMessages||!1,this.options.sendLocalVideo=void 0===e.sendLocalVideo||e.sendLocalVideo,this.options.sendLocalAudio=void 0===e.sendLocalAudio||e.sendLocalAudio,this.options.enableClientPerformanceMessage=e.enableClientPerformanceMessage||!1,this.options.enableTransparentBackground=e.enableTransparentBackground||!1,this.options.backgroundImageUrl=e.backgroundImageUrl||"",this.options.nameTagImageUrl=e.nameTagImageUrl||"",this.options.speechToTextLocales=f.LocaleDetector.validateOrDetectSpeechLocales(e),this.checkIfResumeSessionIsAvailable(),this.options.voiceInputMode=e.voiceInputMode||C.VoiceInputMode.PUSH_TO_TALK,this.api=new u.API(this.options.url,this.options.apiKey),this.messageCallback=this.options.messageHandler||(()=>{}),this.checkWebRTCSupport(),this.startSessionData={workspaceName:this.options.conversationId,sessionType:E.SessionType.WEB,sdkVersion:this.version,clientWidth:window.screen.availWidth,clientHeight:window.screen.availHeight},this.options.customData&&(this.startSessionData.customData=this.options.customData),h.logger.log(`Uneeq Created (version ${this.version})`),this.streamManager=new b.StreamManager,this.initDigitalHumanVideoElement(),this.metricsService=new v.MetricsService(this.options,this.internalMessages$,this.messages),this.dhVideoPlayManager=new l.DigitalHumanVideoPlayManager(this.messages,(()=>{this.unmuteDigitalHuman()}))}setLoggerEnabled(e){h.logger.enabled=e}init(){this.startSessionTime=Date.now(),this.api.startSession(this.startSessionData).then((e=>{this.session=e,this.initialize()})).catch((e=>{this.sendServiceUnavailableMessage(e)}))}initWithToken(e){return n(this,void 0,void 0,(function*(){this.startSessionTime=Date.now();try{const t=y.ResumeSessionCheck.validate(this.options);!0===t.resumeSession&&(this.startSessionData.resumeSessionId=t.resumeSessionId),this.startSessionData.tokenId=e,this.session=yield this.api.startSessionWithToken(this.startSessionData),console.log("UneeQ Session ID: "+this.session.id),this.session.id===this.startSessionData.resumeSessionId?(h.logger.log("UneeQ: Session was resumed."),this.sessionWasResumed=!0):h.logger.log("UneeQ: Session was not resumed."),this.uneeqLocalStorage.setItemSafely("uneeqResumeSessionId",this.session.id),this.uneeqLocalStorage.setItemSafely("uneeqResumeSessionPersonaId",this.options.conversationId),this.session.sourceApp=O.SourceApp[this.session.sourceApp?this.session.sourceApp:""]?this.session.sourceApp:O.SourceApp.UNKNOWN,this.initialize()}catch(e){this.sendServiceUnavailableMessage(e)}}))}setCamera(e){this.serviceReadyCheck("setCamera")&&this.deviceManager.setCamDevice(e)}setMic(e){this.serviceReadyCheck("setMic")&&this.deviceManager.setMicDevice(e)}setSpeaker(e){this.serviceReadyCheck("setSpeaker")&&this.deviceManager.setAvatarSpeakerDevice(e)}setVoiceInputMode(e){this.serviceReadyCheck("setVoiceInputMode")&&this.voiceInputManager.setVoiceInputMode(e)}enableMicrophone(e=!0){this.deviceManager&&this.deviceManager.enableLocalDevices(this.options.sendLocalVideo,e)}enableCamera(e=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(e,this.options.sendLocalAudio)}enableMicrophoneAndCamera(e=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(e,e)}sendTranscript(e){this.serviceReadyCheck("sendTranscript")&&(this.sessionPaused?this.messages.next(new S.WarningMessage("Call to sendTranscript() will be ignored. Session is paused.")):this.api.avatarAsk(e))}getServerStats(){this.deviceManager&&this.deviceManager.mediaHandler&&this.deviceManager.mediaHandler.sendDataMessage("stats")}startRecording(){this.serviceReadyCheck("startRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new S.WarningMessage("Call to startRecording() will be ignored. Session is paused.")):this.voiceInputManager.startRecording())}stopRecording(){this.serviceReadyCheck("stopRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new S.WarningMessage("Call to stopRecording() will be ignored. Session is paused.")):this.voiceInputManager.stopRecording())}stopSpeaking(){return this.api.avatarStopSpeaking()}pauseSession(){return!!this.serviceReadyCheck("pauseSession")&&(this.sessionPaused?(this.messages.next(new S.WarningMessage("Call to pauseSession() will be ignored. Session is paused.")),!1):(this.sessionPaused=!0,this.deviceManager.mediaHandler.pause(),this.messages.next(new S.SessionPausedMessage),!0))}resumeSession(){return!!this.serviceReadyCheck("resumeSession")&&(this.sessionPaused?(this.sessionPaused=!1,this.deviceManager.mediaHandler.resume(),this.messages.next(new S.SessionResumedMessage),!0):(this.messages.next(new S.WarningMessage("Call to resumeSession() will be ignored. Session is unpaused.")),!1))}endSession(){this.serviceReadyCheck("endSession")&&(this.api.endCall(),this.internalMessages$.next({faceMeMessageType:"sessionEnd"}))}setAvatarDebug(e){return this.api.setAvatarDebug(e)}playWelcomeMessage(){return this.api.avatarWelcome()}unmuteDigitalHuman(){this.voiceInputManager.resumeAudioContext(),this.dhVideoPlayManager.unmuteVideo()}initDigitalHumanVideoElement(){const e=document.createElement("video");this.digitalHumanVideoElement=e,e.volume=1,e.controls=!1,e.autoplay=!1,e.setAttribute("playsinline","true"),e.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),e.play().catch((e=>{h.logger.log("UneeQ: Failed to play digital human video. Play() will be re-attempted when stream is ready.",e)}))}gatherWebRtcMetrics(){var e;null===(e=this.deviceManager)||void 0===e||e.mediaHandler.gatherWebRTCStats(((e,t)=>{this.metricsService.parseAndLogWebRtcStats(t)})),setTimeout((()=>{this.gatherWebRtcMetrics()}),5e3)}initMessaging(){this.messages.subscribe((e=>this.messageCallback(e))),this.messaging.state$.pipe((0,s.filter)((e=>e===p.MessagingState.CONNECTED))).subscribe((()=>{this.messaging.getTopic("/topic/avatar/"+this.session.streamId),this.ready.next(!0),this.messages.next(new S.ReadyMessage),this.gatherWebRtcMetrics()})),this.messaging.messages$.subscribe((e=>this.internalMessages$.next(JSON.parse(e.body)))),this.messageHandler=new d.MessageHandler(this.internalMessages$,this.messages),this.messaging.connect(),this.messaging.messages$.subscribe((e=>{h.logger.log("-- Msg -- ",e)}))}initDeviceManager(){this.voiceInputManager=new w.VoiceInputManager(this.options,this.api,this.messages,(e=>{this.enableMicrophone(e)})),this.deviceManager=new c.DeviceManager({userMessages:this.messages,session:this.session,messages:this.messages,internalMessages$:this.internalMessages$,messaging:this.messaging,uneeqOptions:this.options,streamManager:this.streamManager,voiceInputManager:this.voiceInputManager,digitalHumanVideoElement:this.digitalHumanVideoElement},this.api),this.messageHandler.setDeviceManager(this.deviceManager)}sessionLiveHandler(){if(!this.sessionStarted){this.messages.next(new S.SessionLiveMessage(this.session.showUneeqLogo||!1,this.sessionWasResumed)),this.options.playWelcome&&this.api.avatarWelcome();const e={type:g.PromMessageType.SessionStart,value:(Date.now()-this.startSessionTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.sessionStarted=!0}}initAvatar(){this.ready.pipe((0,s.filter)(Boolean),(0,s.take)(1)).subscribe((()=>{this.internalMessages$.pipe((0,s.filter)((e=>"DevicePermissionAllowedInternal"===e.faceMeMessageType)),(0,s.take)(1)).subscribe((e=>{this.messages.next(new S.DevicePermissionAllowedMessage),this.startAvatarWhenAvailable()})),this.initDeviceManager()})),this.internalMessages$.pipe((0,s.filter)((e=>"sessionLive"===e.faceMeMessageType)),(0,s.take)(1)).subscribe((e=>this.sessionLiveHandler())),this.internalMessages$.pipe((0,s.filter)((e=>"sessionEnd"===e.faceMeMessageType))).subscribe((()=>{this.deviceManager.mediaHandler.endSession(),this.messages.next(new S.SessionEndedMessage),this.messaging.disconnect()})),this.internalMessages$.pipe((0,s.filter)((e=>"remoteVideoReadyToPlay"===e.faceMeMessageType))).subscribe((e=>{this.dhVideoPlayManager.play(this.deviceManager.mediaHandler.avatarVideoElement)}))}startAvatarWhenAvailable(){this.availableResponseTime=Date.now(),this.api.getAvailableAvatarCount().then((e=>{if(e.available>0){const e={type:g.PromMessageType.AvailabilityCheck,value:(Date.now()-this.availableResponseTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new S.AvatarAvailableMessage),this.api.avatarStart({enableTransparentBackground:this.options.enableTransparentBackground,resumeSession:this.sessionWasResumed,backgroundImageUrl:this.options.backgroundImageUrl,nameTagImageUrl:this.options.nameTagImageUrl,speechToTextLocales:this.options.speechToTextLocales}).catch((e=>{console.error("UneeQ: Digital human could not be started. Clearing resumeSession token and ending process.",e),this.uneeqLocalStorage.removeItemSafely("uneeqResumeSessionId")}))}else this.unavailableAvatarMsgSent||(this.unavailableAvatarMsgSent=!0,this.messages.next(new S.AvatarUnavailableMessage)),setTimeout((()=>{this.startAvatarWhenAvailable()}),1e3)}))}initialize(){if(this.session){this.initPromMetricsListener(),this.api.callId=this.session.id,this.initAvatar();const e={maxReconnectAttempts:3,reconnectTime:3e3,maxReconnectLimitReached:()=>{this.messages.next(new S.ConnectionLostMessage(T.PublishSubscribeState.DISCONNECTED)),this.endSession()},connectionHeaders:{"x-auth-token":this.api.authToken}};this.messaging=new p.MessagingService(this.options.url+"/api/messaging",e),this.initMessaging(),this.initOnlineStatusUpdateMessages()}}sendServiceUnavailableMessage(e){const t=new S.ServiceUnavailableMessage(e);this.messages.next(t),this.messageCallback(t)}serviceReadyCheck(e){return!!this.ready.value||(this.messages.next(new S.WarningMessage("Call to "+e+" ignored. Service Not Ready")),!1)}checkWebRTCSupport(){navigator.mediaDevices.getUserMedia||this.sendServiceUnavailableMessage("Error: WEBRTC NOT SUPPORTED")}initOnlineStatusUpdateMessages(){new m.OnlineStatusService(this.messages,(()=>{this.messages.next(new S.ConnectionLostMessage(T.PublishSubscribeState.DISCONNECTED)),this.endSession()}))}initPromMetricsListener(){const e=new g.Prom(this.options.url);this.internalMessages$.pipe((0,s.filter)((e=>"prom"===e.faceMeMessageType))).subscribe((t=>{e.handleMessage(t.promMsg)}))}checkIfResumeSessionIsAvailable(){!0!==this.options.resumeSession||this.uneeqLocalStorage.available||(console.warn("UneeQ: Resuming session is unavailable in this browser because localStorage is not allowed."),this.messages.next(new S.ResumeSessionUnavailable),this.options.resumeSession=!1)}}},4927:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},835:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ce});var n={};r.r(n),r.d(n,{fixNegotiationNeeded:()=>M,shimAddTrackRemoveTrack:()=>P,shimAddTrackRemoveTrackWithNative:()=>x,shimGetDisplayMedia:()=>w,shimGetSendersWithDtmf:()=>T,shimGetStats:()=>O,shimGetUserMedia:()=>_,shimMediaStream:()=>S,shimOnTrack:()=>E,shimPeerConnection:()=>R,shimSenderReceiverGetStats:()=>C});var i={};r.r(i),r.d(i,{shimAddTransceiver:()=>U,shimCreateAnswer:()=>V,shimCreateOffer:()=>W,shimGetDisplayMedia:()=>j,shimGetParameters:()=>B,shimGetUserMedia:()=>A,shimOnTrack:()=>k,shimPeerConnection:()=>I,shimRTCDataChannel:()=>F,shimReceiverGetStats:()=>N,shimRemoveStream:()=>L,shimSenderGetStats:()=>D});var o={};r.r(o),r.d(o,{shimAudioContext:()=>J,shimCallbacksAPI:()=>H,shimConstraints:()=>$,shimCreateOfferLegacy:()=>X,shimGetUserMedia:()=>G,shimLocalStreamsAPI:()=>q,shimRTCIceServerUrls:()=>Y,shimRemoteStreamsAPI:()=>z,shimTrackEventTransceiver:()=>K});var s={};r.r(s),r.d(s,{removeExtmapAllowMixed:()=>oe,shimAddIceCandidateNullOrEmpty:()=>se,shimConnectionState:()=>ie,shimMaxMessageSize:()=>re,shimParameterlessSetLocalDescription:()=>ae,shimRTCIceCandidate:()=>ee,shimRTCIceCandidateRelayProtocol:()=>te,shimSendThrowTypeError:()=>ne});let a=!0,u=!0;function c(e,t,r){const n=e.match(t);return n&&n.length>=r&&parseInt(n[r],10)}function l(e,t,r){if(!e.RTCPeerConnection)return;const n=e.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=r(e);t&&(n.handleEvent?n.handleEvent(t):n(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(n,o),i.apply(this,[e,o])};const o=n.removeEventListener;n.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(r))return o.apply(this,arguments);const n=this._eventMap[t].get(r);return this._eventMap[t].delete(r),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function f(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(a=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function h(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(u=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function d(){if("object"==typeof window){if(a)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function p(e,t){u&&console.warn(e+" is deprecated, please use "+t+" instead.")}function v(e){return"[object Object]"===Object.prototype.toString.call(e)}function m(e){return v(e)?Object.keys(e).reduce((function(t,r){const n=v(e[r]),i=n?m(e[r]):e[r],o=n&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[r]:i})}),{}):e}function g(e,t,r){t&&!r.has(t.id)&&(r.set(t.id,t),Object.keys(t).forEach((n=>{n.endsWith("Id")?g(e,e.get(t[n]),r):n.endsWith("Ids")&&t[n].forEach((t=>{g(e,e.get(t),r)}))})))}function y(e,t,r){const n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((t=>{e.forEach((r=>{r.type===n&&r.trackId===t.id&&g(e,r,i)}))})),i}const b=d;function _(e,t){const r=e&&e.navigator;if(!r.mediaDevices)return;const n=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((r=>{if("require"===r||"advanced"===r||"mediaSource"===r)return;const n="object"==typeof e[r]?e[r]:{ideal:e[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];let e={};"number"==typeof n.ideal?(e[i("min",r)]=n.ideal,t.optional.push(e),e={},e[i("max",r)]=n.ideal,t.optional.push(e)):(e[i("",r)]=n.ideal,t.optional.push(e))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",r)]=n.exact):["min","max"].forEach((e=>{void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,r)]=n[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=n(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const s=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||s)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return r.mediaDevices.enumerateDevices().then((r=>{let s=(r=r.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!s&&r.length&&t.includes("back")&&(s=r[r.length-1]),s&&(e.video.deviceId=o.exact?{exact:s.deviceId}:{ideal:s.deviceId}),e.video=n(e.video),b("chrome: "+JSON.stringify(e)),i(e)}))}e.video=n(e.video)}return b("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(r.getUserMedia=function(e,t,n){i(e,(e=>{r.webkitGetUserMedia(e,t,(e=>{n&&n(o(e))}))}))}.bind(r),r.mediaDevices.getUserMedia){const e=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(t){return i(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(o(e))))))}}}function w(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(r){return t(r).then((t=>{const n=r.video&&r.video.width,i=r.video&&r.video.height,o=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},n&&(r.video.mandatory.maxWidth=n),i&&(r.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(r)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function S(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function E(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.track.id)):{track:r.track};const i=new Event("track");i.track=r.track,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)})),t.stream.getTracks().forEach((r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.id)):{track:r};const i=new Event("track");i.track=r,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else l(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function T(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){let i=r.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){n.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function O(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,r,n]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const i=function(e){const t={};return e.result().forEach((e=>{const r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{r[t]=e.stat(t)})),t[r.id]=r})),t},o=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const n=function(e){r(o(i(e)))};return t.apply(this,[n,e])}return new Promise(((e,r)=>{t.apply(this,[function(t){e(o(i(t)))},r])})).then(r,n)}}function C(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>y(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),l(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>y(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,r,n;return this.getSenders().forEach((r=>{r.track===e&&(t?n=!0:t=r)})),this.getReceivers().forEach((t=>(t.track===e&&(r?n=!0:r=t),t.track===e))),n||t&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function x(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();r.apply(this,arguments);const n=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(n)};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const r=this._shimmedLocalStreams[t].indexOf(e);-1!==r&&this._shimmedLocalStreams[t].splice(r,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),i.apply(this,arguments)}}function P(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return x(e);const r=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=r.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const r=new e.MediaStream(t.getTracks());this._streams[t.id]=r,this._reverseStreams[r.id]=t,t=r}n.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:r})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,r){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((e=>e.track===t)))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[r.id];if(i)i.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new e.MediaStream([t]);this._streams[r.id]=n,this._reverseStreams[n.id]=r,this.addStream(n)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[t=>{const r=o(this,t);e[0].apply(null,[r])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):r.apply(this,arguments).then((e=>o(this,e)))}};e.RTCPeerConnection.prototype[t]=n[t]}));const s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:r})}(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const a=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=a.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((r=>{this._streams[r].getTracks().find((t=>e.track===t))&&(t=this._streams[r])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function R(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}))}function M(e,t){l(e,"negotiationneeded",(e=>{const r=e.target;if(!(t.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return e}))}function A(e,t){const r=e&&e.navigator,n=e&&e.MediaStreamTrack;if(r.getUserMedia=function(e,t,n){p("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(t,n)},!(t.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){const e=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},t=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(r){return"object"==typeof r&&"object"==typeof r.audio&&(r=JSON.parse(JSON.stringify(r)),e(r.audio,"autoGainControl","mozAutoGainControl"),e(r.audio,"noiseSuppression","mozNoiseSuppression")),t(r)},n&&n.prototype.getSettings){const t=n.prototype.getSettings;n.prototype.getSettings=function(){const r=t.apply(this,arguments);return e(r,"mozAutoGainControl","autoGainControl"),e(r,"mozNoiseSuppression","noiseSuppression"),r}}if(n&&n.prototype.applyConstraints){const t=n.prototype.applyConstraints;n.prototype.applyConstraints=function(r){return"audio"===this.kind&&"object"==typeof r&&(r=JSON.parse(JSON.stringify(r)),e(r,"autoGainControl","mozAutoGainControl"),e(r,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[r])}}}}function j(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===r.video?r.video={mediaSource:t}:r.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(r)})}function k(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function I(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}));const r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,o]=arguments;return n.apply(this,[e||null]).then((e=>{if(t.version<53&&!i)try{e.forEach((e=>{e.type=r[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,n)=>{e.set(n,Object.assign({},t,{type:r[t.type]||t.type}))}))}return e})).then(i,o)}}function D(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function N(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),l(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function L(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){p("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function F(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function U(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const r=e.length>0;r&&e.forEach((e=>{if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const n=t.apply(this,arguments);if(r){const{sender:t}=n,r=t.getParameters();(!("encodings"in r)||1===r.encodings.length&&0===Object.keys(r.encodings[0]).length)&&(r.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(r).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return n})}function B(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function W(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function V(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function q(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((r=>t.call(this,r,e))),e.getVideoTracks().forEach((r=>t.call(this,r,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...r){return r&&r.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const r=e.getTracks();this.getSenders().forEach((e=>{r.includes(e.track)&&this.removeTrack(e)}))})}}function z(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const r=new Event("addstream");r.stream=t,e.dispatchEvent(r)}))}),t.apply(e,arguments)}}}function H(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,r=t.createOffer,n=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i};let a=function(e,t,r){const n=i.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=a,a=function(e,t,r){const n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=a,a=function(e,t,r){const n=s.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=a}function G(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,r=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>r($(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t))}function $(e){return e&&void 0!==e.video?Object.assign({},e,{video:m(e.video)}):e}function Y(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){const t=[];for(let r=0;r<e.iceServers.length;r++){let n=e.iceServers[r];void 0===n.urls&&n.url?(p("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,t.push(n)):t.push(e.iceServers[r])}e.iceServers=t}return new t(e,r)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function K(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function X(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const r=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveVideo||r||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function J(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Z=r(7539),Q=r.n(Z);function ee(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substring(2)),e.candidate&&e.candidate.length){const r=new t(e),n=Q().parseCandidate(e.candidate);for(const e in n)e in r||Object.defineProperty(r,e,{value:n[e]});return r.toJSON=function(){return{candidate:r.candidate,sdpMid:r.sdpMid,sdpMLineIndex:r.sdpMLineIndex,usernameFragment:r.usernameFragment}},r}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,l(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function te(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||l(e,"icecandidate",(e=>{if(e.candidate){const t=Q().parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function re(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(function(e){if(!e||!e.sdp)return!1;const t=Q().splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Q().parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))}(arguments[0])){const e=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const r=parseInt(t[1],10);return r!=r?-1:r}(arguments[0]),r=function(e){let r=65536;return"firefox"===t.browser&&(r=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),r}(e),n=function(e,r){let n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);const i=Q().matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?n=parseInt(i[0].substring(19),10):"firefox"===t.browser&&-1!==r&&(n=2147483637),n}(arguments[0],e);let i;i=0===r&&0===n?Number.POSITIVE_INFINITY:0===r||0===n?Math.max(r,n):Math.min(r,n);const o={};Object.defineProperty(o,"maxMessageSize",{get:()=>i}),this._sctp=o}return r.apply(this,arguments)}}function ne(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const r=e.send;e.send=function(){const n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}const r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=r.apply(this,arguments);return t(e,this),e},l(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function ie(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const r=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const r=new Event("connectionstatechange",e);t.dispatchEvent(r)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}function oe(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const r=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:r}):t.sdp=r}return r.apply(this,arguments)}}function se(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.addIceCandidate;r&&0!==r.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ae(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.setLocalDescription;r&&0!==r.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return r.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}return e.sdp||"offer"!==e.type&&"answer"!==e.type?r.apply(this,[e]):("offer"===e.type?this.createOffer:this.createAnswer).apply(this).then((e=>r.apply(this,[e])))})}const ue=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=d,a=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator||!e.navigator.userAgent)return t.browser="Not a browser.",t;const{navigator:r}=e;if(r.mozGetUserMedia)t.browser="firefox",t.version=c(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=c(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!r.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=c(r.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),u={browserDetails:a,commonShim:s,extractVersion:c,disableLog:f,disableWarnings:h,sdp:Z};switch(a.browser){case"chrome":if(!n||!R||!t.shimChrome)return r("Chrome shim is not included in this adapter release."),u;if(null===a.version)return r("Chrome shim can not determine version, not shimming."),u;r("adapter.js shimming chrome."),u.browserShim=n,se(e,a),ae(e),_(e,a),S(e),R(e,a),E(e),P(e,a),T(e),O(e),C(e),M(e,a),ee(e),te(e),ie(e),re(e,a),ne(e),oe(e,a);break;case"firefox":if(!i||!I||!t.shimFirefox)return r("Firefox shim is not included in this adapter release."),u;r("adapter.js shimming firefox."),u.browserShim=i,se(e,a),ae(e),A(e,a),I(e,a),k(e),L(e),D(e),N(e),F(e),U(e),B(e),W(e),V(e),ee(e),ie(e),re(e,a),ne(e);break;case"safari":if(!o||!t.shimSafari)return r("Safari shim is not included in this adapter release."),u;r("adapter.js shimming safari."),u.browserShim=o,se(e,a),ae(e),Y(e),X(e),H(e),q(e),z(e),K(e),G(e),J(e),ee(e),te(e),re(e,a),ne(e),oe(e,a);break;default:r("Unsupported browser!")}return u}({window:"undefined"==typeof window?void 0:window}),ce=ue},2361:()=>{},4616:()=>{},4147:e=>{"use strict";e.exports=JSON.parse('{"name":"uneeq-js","version":"2.46.7","description":"","main":"dist/index.js","types":"dist/src/index.d.ts","scripts":{"start":"npx webpack -w","test-local":"npx karma start karma.conf.js -logLevel=DEBUG","test":"npx karma start --browsers ChromeHeadless --single-run","test:windows":"karma start karma.conf.js","build":"webpack --config webpack.config.prod.js && webpack --config webpack.config.umd.js","lint":"npx tslint -p tsconfig.json --fix","docs":"npx typedoc --options"},"files":["dist","!dist/test"],"author":"","license":"ISC","dependencies":{"@stomp/stompjs":"^6.0.0","@uehreka/seriously":"^1.0.1","fast-text-encoding":"^1.0.0","intrinsic-scale":"^3.0.4","promjs":"^0.4.1","rxjs":"^7.8.1","rxjs-compat":"^6.6.7","simple-peer":"^9.11.1","webrtc-adapter":"^8.2.3"},"devDependencies":{"@types/dom-mediacapture-record":"^1.0.16","@types/jasmine":"^2.8.8","@types/node":"^10.9.4","fetch-mock":"7.7.3","ignore-styles":"^5.0.1","jasmine":"^5.1.0","jasmine-core":"^5.1.0","karma":"^6.4.2","karma-chrome-launcher":"^3.2.0","karma-firefox-launcher":"^2.1.2","karma-jasmine":"^5.1.0","karma-jasmine-html-reporter":"^2.1.0","karma-requirejs":"^1.1.0","karma-typescript":"^5.5.4","karma-typescript-es6-transform":"^5.5.4","nock":"^9.6.1","requirejs":"^2.3.6","ts-loader":"^9.4.4","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-no-focused-test":"^0.5.0","typedoc":"^0.18.0","typescript":"^5.1.6","webpack":"^5.88.2","webpack-cli":"^5.1.4"}}')}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n=r(3607),i=exports;for(var o in n)i[o]=n[o];n.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
|
|
2
|
+
(()=>{var __webpack_modules__={2541:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ActivationState:()=>a,Client:()=>d,CompatClient:()=>m,FrameImpl:()=>i,Parser:()=>o,Stomp:()=>b,StompConfig:()=>f,StompHeaders:()=>h,StompSocketState:()=>s,StompSubscription:()=>p,Versions:()=>u});const r="\n";class i{constructor(e){const{command:t,headers:n,body:r,binaryBody:i,escapeHeaderValues:o,skipContentLengthHeader:s}=e;this.command=t,this.headers=Object.assign({},n||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=r||"",this.isBinaryBody=!1),this.escapeHeaderValues=o||!1,this.skipContentLengthHeader=s||!1}get body(){return!this._body&&this.isBinaryBody&&(this._body=(new TextDecoder).decode(this._binaryBody)),this._body}get binaryBody(){return this._binaryBody||this.isBinaryBody||(this._binaryBody=(new TextEncoder).encode(this._body)),this._binaryBody}static fromRawFrame(e,t){const n={},r=e=>e.replace(/^\s+|\s+$/g,"");for(const o of e.headers.reverse()){o.indexOf(":");const s=r(o[0]);let a=r(o[1]);t&&"CONNECT"!==e.command&&"CONNECTED"!==e.command&&(a=i.hdrValueUnEscape(a)),n[s]=a}return new i({command:e.command,headers:n,binaryBody:e.binaryBody,escapeHeaderValues:t})}toString(){return this.serializeCmdAndHeaders()}serialize(){const e=this.serializeCmdAndHeaders();return this.isBinaryBody?i.toUnit8Array(e,this._binaryBody).buffer:e+this._body+"\0"}serializeCmdAndHeaders(){const e=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const t of Object.keys(this.headers||{})){const n=this.headers[t];this.escapeHeaderValues&&"CONNECT"!==this.command&&"CONNECTED"!==this.command?e.push(`${t}:${i.hdrValueEscape(`${n}`)}`):e.push(`${t}:${n}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&e.push(`content-length:${this.bodyLength()}`),e.join(r)+r+r}isBodyEmpty(){return 0===this.bodyLength()}bodyLength(){const e=this.binaryBody;return e?e.length:0}static sizeOfUTF8(e){return e?(new TextEncoder).encode(e).length:0}static toUnit8Array(e,t){const n=(new TextEncoder).encode(e),r=new Uint8Array([0]),i=new Uint8Array(n.length+t.length+r.length);return i.set(n),i.set(t,n.length),i.set(r,n.length+t.length),i}static marshall(e){return new i(e).serialize()}static hdrValueEscape(e){return e.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(e){return e.replace(/\\r/g,"\r").replace(/\\n/g,"\n").replace(/\\c/g,":").replace(/\\\\/g,"\\")}}class o{constructor(e,t){this.onFrame=e,this.onIncomingPing=t,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(e,t=!1){let n;if(n=e instanceof ArrayBuffer?new Uint8Array(e):this._encoder.encode(e),t&&0!==n[n.length-1]){const e=new Uint8Array(n.length+1);e.set(n,0),e[n.length]=0,n=e}for(let e=0;e<n.length;e++){const t=n[e];this._onByte(t)}}_collectFrame(e){0!==e&&13!==e&&(10!==e?(this._onByte=this._collectCommand,this._reinjectByte(e)):this.onIncomingPing())}_collectCommand(e){if(13!==e)return 10===e?(this._results.command=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_collectHeaders(e){13!==e&&(10!==e?(this._onByte=this._collectHeaderKey,this._reinjectByte(e)):this._setupCollectBody())}_reinjectByte(e){this._onByte(e)}_collectHeaderKey(e){if(58===e)return this._headerKey=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaderValue);this._consumeByte(e)}_collectHeaderValue(e){if(13!==e)return 10===e?(this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_setupCollectBody(){const e=this._results.headers.filter((e=>"content-length"===e[0]))[0];e?(this._bodyBytesRemaining=parseInt(e[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(e){0!==e?this._consumeByte(e):this._retrievedBody()}_collectBodyFixedSize(e){0!=this._bodyBytesRemaining--?this._consumeByte(e):this._retrievedBody()}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw(),this.onFrame(this._results),this._initState()}_consumeByte(e){this._token.push(e)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const e=new Uint8Array(this._token);return this._token=[],e}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var s,a;!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(s||(s={})),function(e){e[e.ACTIVE=0]="ACTIVE",e[e.DEACTIVATING=1]="DEACTIVATING",e[e.INACTIVE=2]="INACTIVE"}(a||(a={}));class u{constructor(e){this.versions=e}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map((e=>`v${e.replace(".","")}.stomp`))}}u.V1_0="1.0",u.V1_1="1.1",u.V1_2="1.2",u.default=new u([u.V1_0,u.V1_1,u.V1_2]);class c{constructor(e,t,n={}){this._client=e,this._webSocket=t,this._serverFrameHandlers={CONNECTED:e=>{this.debug(`connected to server ${e.headers.server}`),this._connected=!0,this._connectedVersion=e.headers.version,this._connectedVersion===u.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(e.headers),this.onConnect(e)},MESSAGE:e=>{const t=e.headers.subscription,n=this._subscriptions[t]||this.onUnhandledMessage,r=e,i=this,o=this._connectedVersion===u.V1_2?r.headers.ack:r.headers["message-id"];r.ack=(e={})=>i.ack(o,t,e),r.nack=(e={})=>i.nack(o,t,e),n(r)},RECEIPT:e=>{const t=this._receiptWatchers[e.headers["receipt-id"]];t?(t(e),delete this._receiptWatchers[e.headers["receipt-id"]]):this.onUnhandledReceipt(e)},ERROR:e=>{this.onStompError(e)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.configure(n)}get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}configure(e){Object.assign(this,e)}start(){const e=new o((e=>{const t=i.fromRawFrame(e,this._escapeHeaderValues);this.logRawCommunication||this.debug(`<<< ${t}`),(this._serverFrameHandlers[t.command]||this.onUnhandledFrame)(t)}),(()=>{this.debug("<<< PONG")}));this._webSocket.onmessage=t=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const e=t.data instanceof ArrayBuffer?(new TextDecoder).decode(t.data):t.data;this.debug(`<<< ${e}`)}e.parseChunk(t.data,this.appendMissingNULLonIncoming)},this._onclose=e=>{this.debug(`Connection closed to ${this._client.brokerURL}`),this._cleanUp(),this.onWebSocketClose(e)},this._webSocket.onclose=this._onclose,this._webSocket.onerror=e=>{this.onWebSocketError(e)},this._webSocket.onopen=()=>{const e=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),e["accept-version"]=this.stompVersions.supportedVersions(),e["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:e})}}_setupHeartbeat(e){if(e.version!==u.V1_1&&e.version!==u.V1_2)return;if(!e["heart-beat"])return;const[t,n]=e["heart-beat"].split(",").map((e=>parseInt(e,10)));if(0!==this.heartbeatOutgoing&&0!==n){const e=Math.max(this.heartbeatOutgoing,n);this.debug(`send PING every ${e}ms`),this._pinger=setInterval((()=>{this._webSocket.readyState===s.OPEN&&(this._webSocket.send(r),this.debug(">>> PING"))}),e)}if(0!==this.heartbeatIncoming&&0!==t){const e=Math.max(this.heartbeatIncoming,t);this.debug(`check PONG every ${e}ms`),this._ponger=setInterval((()=>{const t=Date.now()-this._lastServerActivityTS;t>2*e&&(this.debug(`did not receive server activity for the last ${t}ms`),this._closeOrDiscardWebsocket())}),e)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this._discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState!==s.CONNECTING&&this._webSocket.readyState!==s.OPEN||this._closeOrDiscardWebsocket())}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}_discardWebsocket(){var e,t;this._webSocket.terminate||(e=this._webSocket,t=e=>this.debug(e),e.terminate=function(){const e=()=>{};this.onerror=e,this.onmessage=e,this.onopen=e;const n=new Date,r=this.onclose;this.onclose=e=>{const r=(new Date).getTime()-n.getTime();t(`Discarded socket closed after ${r}ms, with code/reason: ${e.code}/${e.reason}`)},this.close(),r.call(this,{code:4001,reason:"Heartbeat failure, discarding the socket",wasClean:!1})}),this._webSocket.terminate()}_transmit(e){const{command:t,headers:n,body:r,binaryBody:o,skipContentLengthHeader:s}=e,a=new i({command:t,headers:n,body:r,binaryBody:o,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:s});let u=a.serialize();if(this.logRawCommunication?this.debug(`>>> ${u}`):this.debug(`>>> ${a}`),this.forceBinaryWSFrames&&"string"==typeof u&&(u=(new TextEncoder).encode(u)),"string"==typeof u&&this.splitLargeFrames){let e=u;for(;e.length>0;){const t=e.substring(0,this.maxWebSocketChunkSize);e=e.substring(this.maxWebSocketChunkSize),this._webSocket.send(t),this.debug(`chunk sent = ${t.length}, remaining = ${e.length}`)}}else this._webSocket.send(u)}dispose(){if(this.connected)try{const e=Object.assign({},this.disconnectHeaders);e.receipt||(e.receipt="close-"+this._counter++),this.watchForReceipt(e.receipt,(e=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(e)})),this._transmit({command:"DISCONNECT",headers:e})}catch(e){this.debug(`Ignoring error during disconnect ${e}`)}else this._webSocket.readyState!==s.CONNECTING&&this._webSocket.readyState!==s.OPEN||this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&clearInterval(this._pinger),this._ponger&&clearInterval(this._ponger)}publish(e){const{destination:t,headers:n,body:r,binaryBody:i,skipContentLengthHeader:o}=e,s=Object.assign({destination:t},n);this._transmit({command:"SEND",headers:s,body:r,binaryBody:i,skipContentLengthHeader:o})}watchForReceipt(e,t){this._receiptWatchers[e]=t}subscribe(e,t,n={}){(n=Object.assign({},n)).id||(n.id="sub-"+this._counter++),n.destination=e,this._subscriptions[n.id]=t,this._transmit({command:"SUBSCRIBE",headers:n});const r=this;return{id:n.id,unsubscribe:e=>r.unsubscribe(n.id,e)}}unsubscribe(e,t={}){t=Object.assign({},t),delete this._subscriptions[e],t.id=e,this._transmit({command:"UNSUBSCRIBE",headers:t})}begin(e){const t=e||"tx-"+this._counter++;this._transmit({command:"BEGIN",headers:{transaction:t}});const n=this;return{id:t,commit(){n.commit(t)},abort(){n.abort(t)}}}commit(e){this._transmit({command:"COMMIT",headers:{transaction:e}})}abort(e){this._transmit({command:"ABORT",headers:{transaction:e}})}ack(e,t,n={}){n=Object.assign({},n),this._connectedVersion===u.V1_2?n.id=e:n["message-id"]=e,n.subscription=t,this._transmit({command:"ACK",headers:n})}nack(e,t,n={}){return n=Object.assign({},n),this._connectedVersion===u.V1_2?n.id=e:n["message-id"]=e,n.subscription=t,this._transmit({command:"NACK",headers:n})}}var l=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};class d{constructor(e={}){this.stompVersions=u.default,this.connectionTimeout=0,this.reconnectDelay=5e3,this.heartbeatIncoming=1e4,this.heartbeatOutgoing=1e4,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8192,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.state=a.INACTIVE;const t=()=>{};this.debug=t,this.beforeConnect=t,this.onConnect=t,this.onDisconnect=t,this.onUnhandledMessage=t,this.onUnhandledReceipt=t,this.onUnhandledFrame=t,this.onStompError=t,this.onWebSocketClose=t,this.onWebSocketError=t,this.logRawCommunication=!1,this.onChangeState=t,this.connectHeaders={},this._disconnectHeaders={},this.configure(e)}get webSocket(){return this._stompHandler?this._stompHandler._webSocket:void 0}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(e){this._disconnectHeaders=e,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===a.ACTIVE}_changeState(e){this.state=e,this.onChangeState(e)}configure(e){Object.assign(this,e)}activate(){if(this.state===a.DEACTIVATING)throw this.debug("Still DEACTIVATING, please await call to deactivate before trying to re-activate"),new Error("Still DEACTIVATING, can not activate now");this.active?this.debug("Already ACTIVE, ignoring request to activate"):(this._changeState(a.ACTIVE),this._connect())}_connect(){return l(this,void 0,void 0,(function*(){if(this.connected)return void this.debug("STOMP: already connected, nothing to do");if(yield this.beforeConnect(),!this.active)return void this.debug("Client has been marked inactive, will not attempt to connect");this.connectionTimeout>0&&(this._connectionWatcher&&clearTimeout(this._connectionWatcher),this._connectionWatcher=setTimeout((()=>{this.connected||(this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect())}),this.connectionTimeout)),this.debug("Opening Web Socket...");const e=this._createWebSocket();this._stompHandler=new c(this,e,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatOutgoing:this.heartbeatOutgoing,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:e=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),!this.active)return this.debug("STOMP got connected while deactivate was issued, will disconnect now"),void this._disposeStompHandler();this.onConnect(e)},onDisconnect:e=>{this.onDisconnect(e)},onStompError:e=>{this.onStompError(e)},onWebSocketClose:e=>{this._stompHandler=void 0,this.state===a.DEACTIVATING&&(this._resolveSocketClose(),this._resolveSocketClose=void 0,this._changeState(a.INACTIVE)),this.onWebSocketClose(e),this.active&&this._schedule_reconnect()},onWebSocketError:e=>{this.onWebSocketError(e)},onUnhandledMessage:e=>{this.onUnhandledMessage(e)},onUnhandledReceipt:e=>{this.onUnhandledReceipt(e)},onUnhandledFrame:e=>{this.onUnhandledFrame(e)}}),this._stompHandler.start()}))}_createWebSocket(){let e;return e=this.webSocketFactory?this.webSocketFactory():new WebSocket(this.brokerURL,this.stompVersions.protocolVersions()),e.binaryType="arraybuffer",e}_schedule_reconnect(){this.reconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this.reconnectDelay}ms`),this._reconnector=setTimeout((()=>{this._connect()}),this.reconnectDelay))}deactivate(){return l(this,void 0,void 0,(function*(){let e;return this.state!==a.ACTIVE?(this.debug(`Already ${a[this.state]}, ignoring call to deactivate`),Promise.resolve()):(this._changeState(a.DEACTIVATING),this._reconnector&&clearTimeout(this._reconnector),this._stompHandler&&this.webSocket.readyState!==s.CLOSED?(e=new Promise(((e,t)=>{this._resolveSocketClose=e})),this._disposeStompHandler(),e):(this._changeState(a.INACTIVE),Promise.resolve()))}))}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&(this._stompHandler.dispose(),this._stompHandler=null)}publish(e){this._stompHandler.publish(e)}watchForReceipt(e,t){this._stompHandler.watchForReceipt(e,t)}subscribe(e,t,n={}){return this._stompHandler.subscribe(e,t,n)}unsubscribe(e,t={}){this._stompHandler.unsubscribe(e,t)}begin(e){return this._stompHandler.begin(e)}commit(e){this._stompHandler.commit(e)}abort(e){this._stompHandler.abort(e)}ack(e,t,n={}){this._stompHandler.ack(e,t,n)}nack(e,t,n={}){this._stompHandler.nack(e,t,n)}}class f{}class h{}class p{}class g{constructor(e){this.client=e}get outgoing(){return this.client.heartbeatOutgoing}set outgoing(e){this.client.heartbeatOutgoing=e}get incoming(){return this.client.heartbeatIncoming}set incoming(e){this.client.heartbeatIncoming=e}}class m extends d{constructor(e){super(),this.maxWebSocketFrameSize=16384,this._heartbeatInfo=new g(this),this.reconnect_delay=0,this.webSocketFactory=e,this.debug=(...e)=>{console.log(...e)}}_parseConnect(...e){let t,n,r,i={};if(e.length<2)throw new Error("Connect requires at least 2 arguments");return"function"==typeof e[1]?[i,n,r,t]=e:6===e.length?[i.login,i.passcode,n,r,t,i.host]=e:[i.login,i.passcode,n,r,t]=e,[i,n,r,t]}connect(...e){const t=this._parseConnect(...e);t[0]&&(this.connectHeaders=t[0]),t[1]&&(this.onConnect=t[1]),t[2]&&(this.onStompError=t[2]),t[3]&&(this.onWebSocketClose=t[3]),super.activate()}disconnect(e,t={}){e&&(this.onDisconnect=e),this.disconnectHeaders=t,super.deactivate()}send(e,t={},n=""){const r=!1===(t=Object.assign({},t))["content-length"];r&&delete t["content-length"],this.publish({destination:e,headers:t,body:n,skipContentLengthHeader:r})}set reconnect_delay(e){this.reconnectDelay=e}get ws(){return this.webSocket}get version(){return this.connectedVersion}get onreceive(){return this.onUnhandledMessage}set onreceive(e){this.onUnhandledMessage=e}get onreceipt(){return this.onUnhandledReceipt}set onreceipt(e){this.onUnhandledReceipt=e}get heartbeat(){return this._heartbeatInfo}set heartbeat(e){this.heartbeatIncoming=e.incoming,this.heartbeatOutgoing=e.outgoing}}class b{static client(e,t){return null==t&&(t=u.default.protocolVersions()),new m((()=>new(b.WebSocketClass||WebSocket)(e,t)))}static over(e){let t;return"function"==typeof e?t=e:(console.warn("Stomp.over did not receive a factory, auto reconnect will not work. Please see https://stomp-js.github.io/api-docs/latest/classes/Stomp.html#over"),t=()=>e),new m(t)}}b.WebSocketClass=null},6551:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>J}),console.log("BUILD/SERIOUSLY.MODULE");let r,i,o,s,a,u,c,l={},d={},f={},h={},p=[],g={},m={},b={canvas:[],image:[],video:[]},y={},v=window.WeakMap&&new WeakMap,_=0,w=function(){},x={transparent:[0,0,0,0],black:[0,0,0,1],red:[1,0,0,1],green:[0,128/255,0,1],blue:[0,0,1,1],white:[1,1,1,1],silver:[192/255,192/255,192/255,1],gray:[128/255,128/255,128/255,1],maroon:[128/255,0,0,1],purple:[128/255,0,128/255,1],fuchsia:[1,0,1,1],lime:[0,1,0,1],olive:[128/255,128/255,0,1],yellow:[1,1,0,1],navy:[0,0,128/255,1],teal:[0,128/255,128/255,1],aqua:[0,1,1,1],orange:[1,165/255,0,1]},T=/^(rgb|hsl)a?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*(\d+(\.\d*)?)\s*)?\)/i,S=/^#(([0-9a-fA-F]{3,8}))/,O=["x","y","z","w"],E=["r","g","b","a"],P={srcRGB:770,dstRGB:771,srcAlpha:1,dstAlpha:771},A=["MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS"],C=/^[\t ]*#define[\t ]+SHADER_NAME\s+([^$\n\r]+)/i,I={frustum:function(e,t,n,r,i,o,s){s||(s=I.create());var a=t-e,u=r-n,c=o-i;return s[0]=2*i/a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/u,s[6]=0,s[7]=0,s[8]=(t+e)/a,s[9]=(r+n)/u,s[10]=-(o+i)/c,s[11]=-1,s[12]=0,s[13]=0,s[14]=-o*i*2/c,s[15]=0,s},perspective:function(e,t,n,r,i){var o=n*Math.tan(e*Math.PI/360),s=o*t;return I.frustum(-s,s,-o,o,n,r,i)},multiply:function(e,t,n){var r=t[0],i=t[1],o=t[2],s=t[3],a=t[4],u=t[5],c=t[6],l=t[7],d=t[8],f=t[9],h=t[10],p=t[11],g=t[12],m=t[13],b=t[14],y=t[15],v=n[0],_=n[1],w=n[2],x=n[3];return e[0]=v*r+_*a+w*d+x*g,e[1]=v*i+_*u+w*f+x*m,e[2]=v*o+_*c+w*h+x*b,e[3]=v*s+_*l+w*p+x*y,v=n[4],_=n[5],w=n[6],x=n[7],e[4]=v*r+_*a+w*d+x*g,e[5]=v*i+_*u+w*f+x*m,e[6]=v*o+_*c+w*h+x*b,e[7]=v*s+_*l+w*p+x*y,v=n[8],_=n[9],w=n[10],x=n[11],e[8]=v*r+_*a+w*d+x*g,e[9]=v*i+_*u+w*f+x*m,e[10]=v*o+_*c+w*h+x*b,e[11]=v*s+_*l+w*p+x*y,v=n[12],_=n[13],w=n[14],x=n[15],e[12]=v*r+_*a+w*d+x*g,e[13]=v*i+_*u+w*f+x*m,e[14]=v*o+_*c+w*h+x*b,e[15]=v*s+_*l+w*p+x*y,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},R=($=0,window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){var t,n,r;return t=(new Date).getTime(),n=Math.max(0,16-(t-$)),r=window.setTimeout((function(){e(t+n)}),n),$=t+n,r}),M=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(e){window.cancelTimeout(e)},k=["alias","destroy","effect","id","initialize","inputs","isDestroyed","isReady","matte","off","on","readPixels","render","title","update"],D=["alias","destroy","id","inputs","isDestroyed","isReady","off","on","source","title","update"],j=["aliases","defaults","destroy","effect","go","id","incompatible","isDestroyed","isEffect","isNode","isSource","isTarget","isTransform","removeAlias","render","source","stop","target","transform"];var $;function N(e,t){var n,r;if("string"==typeof e)n=document.querySelector(e);else if(!e)return!1;return e.tagName&&(n=e),n?(r=n.tagName.toLowerCase(),t&&t.indexOf(r)<0?e:n):e}function L(e,t){var n,r;for(n in e.prototype&&t.prototype&&e.prototype!==t.prototype&&L(e.prototype,t.prototype),t)t.hasOwnProperty(n)&&((r=Object.getOwnPropertyDescriptor(t,n)).get||r.set?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:r.get,set:r.set}):e[n]=t[n]);return e}function F(e){var t;if(!console)return w;if("function"==typeof console[e])t=console[e];else{if("function"!=typeof console.log)return w;t=console.log}return t.bind?t.bind(console):function(){t.apply(console,arguments)}}function U(e,t){if(t||(t="HTMLElement"),e instanceof window[t])return!0;if(!e||"object"!=typeof e)return!1;for(;e;)if((e=Object.getPrototypeOf(e))&&e.constructor.name===t)return!0;return!1}function B(e,t,n,r,i){function o(e,t,n){return(n%=1)<0&&(n+=1),n<1/6?e+(t-e)*n*6:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var s,a;return s=2*n-(a=n<.5?n*(t+1):n+t-n*t),i||(i=[]),i[0]=o(s,a,e+1/3),i[1]=o(s,a,e),i[2]=o(s,a,e-1/3),i[3]=r,i}function V(e){var t,n,r,i="#",o=e[3]<1?4:3;for(t=0;t<o;t++)r=(n=Math.min(255,Math.round(255*e[t]||0))).toString(16),n<16&&(r="0"+r),i+=r;return i}function z(e){return Array.isArray(e)||e&&e.BYTES_PER_ELEMENT&&"length"in e}function W(e){if("function"!=typeof e)throw new Error("setTimeoutZero argument is not a function");p.push(e),"file:"!==window.location.protocol?window.postMessage("seriously-timeout-message",window.location):setTimeout((function(){p.length&&p.shift()()}),0)}function G(e,t){var n;try{n=window.WebGLDebugUtils&&t&&t.debugContext?window.WebGLDebugUtils.makeDebugContext(e.getContext("webgl",t)):e.getContext("webgl",t)}catch(e){}if(!n)try{n=e.getContext("experimental-webgl",t)}catch(e){}return n}function H(){var e;return r&&r.getError()===r.CONTEXT_LOST_WEBGL&&(r=void 0),r||!window.WebGLRenderingContext||o||(e=document.createElement("canvas"),r=G(e),r?e.addEventListener("webglcontextlost",(function t(n){n.preventDefault(),r&&r.canvas===this&&(r=void 0,e.removeEventListener("webglcontextlost",t,!1))}),!1):X.logger.warn("Unable to access WebGL.")),r}function q(e){var t,n,r;function i(e,r){var i,o;z(e)?(i=e[0],o=e[1]||i):i=e,"string"==typeof i?i=i.toLowerCase():"number"==typeof i?i=String(i):i||(i=""),n[i]=o,r||(t.firstValue=i)}function o(e){return e}for(r in e.inputs)if(e.inputs.hasOwnProperty(r)){if(e.reserved.indexOf(r)>=0||Object.prototype[r])throw new Error("Reserved input name: "+r);(t=e.inputs[r]).name=r,isNaN(t.min)&&(t.min=-1/0),isNaN(t.max)&&(t.max=1/0),isNaN(t.minCount)&&(t.minCount=-1/0),isNaN(t.maxCount)&&(t.maxCount=1/0),isNaN(t.step)&&(t.step=0),isNaN(t.mod)&&(t.mod=0),"enum"===t.type&&t.options&&z(t.options)&&t.options.length&&(n={},t.options.forEach(i),t.options=n),"vector"===t.type?t.dimensions<2?t.dimensions=2:t.dimensions>4||!t.dimensions||isNaN(t.dimensions)?t.dimensions=4:t.dimensions=Math.round(t.dimensions):t.dimensions=1,t.shaderDirty=!!t.shaderDirty,"function"!=typeof t.validate&&(t.validate=X.inputValidators[t.type]||o),e.defaultImageInput||"image"!==t.type||(e.defaultImageInput=r)}}function K(e,t,n,r){var i,o,s,a;!0===r||r&&r.useFloat,this.type=e.UNSIGNED_BYTE,i=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,i),r&&r.texture?(this.texture=r.texture,e.bindTexture(e.TEXTURE_2D,this.texture),this.ownTexture=!1):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this.ownTexture=!0);try{this.type===e.FLOAT?(s=new Float32Array(t*n*4),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.FLOAT,s)):(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,null),this.type=e.UNSIGNED_BYTE)}catch(r){this.type=e.UNSIGNED_BYTE,s=new Uint8Array(t*n*4),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,s)}if(o=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,o),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t,n),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture,0),(a=e.checkFramebufferStatus(e.FRAMEBUFFER))===e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");if(a===e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");if(a===e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");if(a===e.FRAMEBUFFER_UNSUPPORTED)throw new Error("Incomplete framebuffer: FRAMEBUFFER_UNSUPPORTED");if(a!==e.FRAMEBUFFER_COMPLETE)throw new Error("Incomplete framebuffer: "+a);e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null),this.gl=e,this.frameBuffer=i,this.renderBuffer=o,this.width=t,this.height=n}function Y(e,t,n){var r,i,o,s,a,u,c,l,d="";function f(t,n){var r,i;if(r=n?e.createShader(e.FRAGMENT_SHADER):e.createShader(e.VERTEX_SHADER),e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){for(t=t.split(/[\n\r]/),i=0;i<t.length;i++)t[i]=i+1+":\t"+t[i];throw t.unshift("Error compiling "+(n?"fragment":"vertex")+" shader:"),X.logger.error(t.join("\n")),new Error("Shader error: "+e.getShaderInfoLog(r))}return r}function h(t,n){if(t.type===e.SAMPLER_2D)return function(r){t.glTexture=e["TEXTURE"+r],e.uniform1i(n,r)};if(t.type===e.BOOL||t.type===e.INT)return t.size>1?function(t){e.uniform1iv(n,t)}:function(t){e.uniform1i(n,t)};if(t.type===e.FLOAT)return t.size>1?function(t){e.uniform1fv(n,t)}:function(t){e.uniform1f(n,t)};if(t.type===e.FLOAT_VEC2)return function(t){e.uniform2f(n,t[0],t[1])};if(t.type===e.FLOAT_VEC3)return function(t){e.uniform3f(n,t[0],t[1],t[2])};if(t.type===e.FLOAT_VEC4)return function(t){e.uniform4f(n,t[0],t[1],t[2],t[3])};if(t.type===e.FLOAT_MAT3)return function(t){e.uniformMatrix3fv(n,!1,t)};if(t.type===e.FLOAT_MAT4)return function(t){e.uniformMatrix4fv(n,!1,t)};throw new Error("Unknown shader uniform type: "+t.type)}function p(t){return function(){return e.getUniform(r,t)}}if(i=f(t),o=f(n,!0),r=e.createProgram(),e.attachShader(r,i),(s=e.getShaderInfoLog(i))&&(d+="Vertex shader error: "+s+"\n"),e.attachShader(r,o),(s=e.getShaderInfoLog(o))&&(d+="Fragment shader error: "+s+"\n"),e.linkProgram(r),!e.getProgramParameter(r,e.LINK_STATUS))throw d+=e.getProgramInfoLog(r),e.deleteProgram(r),e.deleteShader(i),e.deleteShader(o),(c=C.exec(t)||C.exec(n))&&(d="Shader = "+c[1]+"\n"+d),A.forEach((function(t){d+="\n"+t+": "+e.getParameter(e[t])})),new Error("Could not initialize shader:\n"+d);for(e.useProgram(r),this.uniforms={},u=e.getProgramParameter(r,e.ACTIVE_UNIFORMS),a=0;a<u;++a)(l={info:e.getActiveUniform(r,a)}).name=l.info.name.replace(/\[0\]$/,""),l.loc=e.getUniformLocation(r,l.name),l.set=h(l.info,l.loc),l.get=p(l.loc),this.uniforms[l.name]=l,this[l.name]||(this[l.name]=l);for(this.attributes={},this.location={},u=e.getProgramParameter(r,e.ACTIVE_ATTRIBUTES),a=0;a<u;++a)(l={info:e.getActiveAttrib(r,a)}).name=l.info.name,l.location=e.getAttribLocation(r,l.name),this.attributes[l.name]=l,this.location[l.name]=l.location;this.gl=e,this.program=r,this.destroy=function(){var t;for(t in e&&(e.deleteProgram(r),e.deleteShader(i),e.deleteShader(o)),this)this.hasOwnProperty(t)&&delete this[t];r=null,i=null,o=null}}function X(e){if(window===this||!(this instanceof X)||void 0!==this.id)return new X(e);var t,n,r,i,o,a,p,y,x,T,S,O,E,A,k,D=++_,$=this,F=[],B={},z=0,H=[],J=[],Z=[],Q=[],ee={},te=[],ne=[],re={},ie={},oe=!1,se=!1;function ae(e,t){var n,r,i;return!!t&&(n=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,e.vertices,t.STATIC_DRAW),n.size=3,r=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,r),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e.indices,t.STATIC_DRAW),i=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,i),t.bufferData(t.ARRAY_BUFFER,e.coords,t.STATIC_DRAW),i.size=2,{vertex:n,index:r,texCoord:i,length:e.indices.length,mode:e.mode||t.TRIANGLES})}function ue(e){var t={};return t.vertices=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]),t.indices=new Uint16Array([0,1,2,0,2,3]),t.coords=new Float32Array([0,0,1,0,1,1,0,1]),ae(t,e)}function ce(e){var r,s;if(!n)if(e.canvas.addEventListener("webglcontextlost",de,!1),e.canvas.addEventListener("webglcontextrestored",le,!1),e.isContextLost())X.logger.warn("Unable to attach lost WebGL context. Will try again when context is restored.");else{for(n=e,t=e.canvas,i=ue(n),o=new Y(n,"#define SHADER_NAME seriously.base\n"+u,"#define SHADER_NAME seriously.base\n"+c),r=0;r<Q.length;r++)(s=Q[r]).gl=n,s.initialize(),s.buildShader();for(r=0;r<H.length;r++)(s=H[r]).initialize();for(r=0;r<J.length;r++)(s=J[r]).model||(s.model=i,s.shader=o)}}function le(){var e,t,i,o;if(r&&!n){if(U(t=r.target,"WebGLFramebuffer"))return void X.logger.error("Unable to restore target built on WebGLFramebuffer");if(e=G(t,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:r.debugContext})){if(e.isContextLost())return void X.logger.error("Unable to restore WebGL Context");for(ce(e),r.renderToTexture?r.frameBuffer=new K(n,r.width,r.height,!1):r.frameBuffer={frameBuffer:null},i=0;i<F.length;i++)(o=F[i]).setDirty(),o.emit("webglcontextrestored");X.logger.log("WebGL context restored")}}}function de(e){var r,s;for(e&&(X.logger.warn("WebGL context lost"),e.preventDefault()),k&&(M(k),k=0),t&&t.removeEventListener("webglcontextlost",de,!1),r=0;r<Q.length;r++)(s=Q[r]).gl=null,s.initialized=!1,s.baseShader=null,s.model=null,s.frameBuffer=null,s.texture=null,s.shader&&s.shader.destroy&&(s.shader.destroy(),s.effect.commonShader&&delete ie[s.hook]),s.shaderDirty=!0,s.shader=null,s.effect.lostContext&&s.effect.lostContext.call(s),e&&s.emit("webglcontextlost");for(r=0;r<H.length;r++)(s=H[r]).texture=null,s.initialized=!1,s.allowRefresh=!1,e&&s.emit("webglcontextlost");for(r=0;r<Z.length;r++)(s=Z[r]).frameBuffer=null,s.texture=null,e&&s.emit("webglcontextlost");for(r=0;r<J.length;r++)(s=J[r]).model=!1,s.frameBuffer=null,e&&s.emit("webglcontextlost");o&&o.destroy&&o.destroy(),n&&(n.deleteBuffer(i.vertex),n.deleteBuffer(i.texCoord),n.deleteBuffer(i.index)),i&&(delete i.vertex,delete i.texCoord,delete i.index),i=null,o=null,n=null,t=null}function fe(e){var t,n,r=!1;if(k=0,te.length)for(r=!0,t=0;t<te.length;t++)te[t].call($,e);if(H&&H.length)for(r=!0,t=0;t<H.length;t++)((n=H[t]).dirty||n.checkDirty&&n.checkDirty())&&(n.dirty=!1,n.setDirty());for(t=0;t<J.length;t++)(n=J[t]).auto&&n.dirty&&n.render();if(ne.length)for(r=!0,t=0;t<ne.length;t++)ne[t].call($);r&&!k&&(k=R(fe))}function he(e,t,r,i,o,s){var a,u,c,l,d,f,h,g,m,b=0,v=o&&o.gl||n;if(v){for(a in o?(l=s&&s.width||o.width||v.canvas.width,d=s&&s.height||o.height||v.canvas.height):(l=s&&s.width||v.canvas.width,d=s&&s.height||v.canvas.height),e.use(),v.viewport(0,0,l,d),v.bindFramebuffer(v.FRAMEBUFFER,i),v.enableVertexAttribArray(e.location.position),v.enableVertexAttribArray(e.location.texCoord),t.texCoord&&(v.bindBuffer(v.ARRAY_BUFFER,t.texCoord),v.vertexAttribPointer(e.location.texCoord,t.texCoord.size,v.FLOAT,!1,0,0)),v.bindBuffer(v.ARRAY_BUFFER,t.vertex),v.vertexAttribPointer(e.location.position,t.vertex.size,v.FLOAT,!1,0,0),v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,t.index),s&&s.depth?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),s?void 0===s.blend||s.blend?(n.enable(n.BLEND),f=void 0===s.srcRGB?n.ONE:s.srcRGB,g=s.dstRGB||n.ZERO,h=void 0===s.srcAlpha?f:s.srcAlpha,m=void 0===s.dstAlpha?g:s.dstAlpha,n.blendFuncSeparate(f,g,h,m),n.blendEquation(s.blendEquation||n.FUNC_ADD)):n.disable(n.BLEND):(n.enable(n.BLEND),n.blendFunc(n.ONE,n.ZERO),n.blendEquation(n.FUNC_ADD)),r)r.hasOwnProperty(a)&&(u=r[a],(c=e.uniforms[a])&&(U(u,"WebGLTexture")?(v.activeTexture(v.TEXTURE0+b),v.bindTexture(v.TEXTURE_2D,u),c.set(b),b++):u instanceof p||u instanceof y||u instanceof x?u.texture&&(v.activeTexture(v.TEXTURE0+b),v.bindTexture(v.TEXTURE_2D,u.texture),c.set(b),b++):null!=u&&c.set(u)));s&&void 0!==s.clear&&!s.clear||(v.clearColor(0,0,0,0),v.clear(v.COLOR_BUFFER_BIT|v.DEPTH_BUFFER_BIT)),v.drawElements(t.mode,t.length,v.UNSIGNED_SHORT,0),n.enable(n.DEPTH_TEST)}}function pe(e,t,n){var r,i;if(("string"!=typeof e||!t&&0!==t)&&(n&&"object"==typeof n||(n=t),t=e),"string"==typeof e&&f[e]||(e=null),t instanceof p||t instanceof y||t instanceof x)r=t;else if(t instanceof S||t instanceof O||t instanceof E){if(!(r=B[t.id]))throw new Error("Cannot connect a foreign node")}else{for("string"==typeof t&&isNaN(t)&&(t=N(t,["canvas","img","video"])),i=0;i<H.length;i++)if(r=H[i],(!e||e===r.hook)&&r.compare&&r.compare(t,n))return r;r=new p(e,t,n)}return r}function ge(e,t){var n,r,i;if(!(e instanceof y||e instanceof x))return!1;if(e===t)return!0;for(n in i=e.sources)if(i.hasOwnProperty(n)&&((r=i[n])===t||ge(r,t)))return!0;return!1}(a=function(){this.ready=!1,this.width=1,this.height=1,this.gl=n,this.uniforms={resolution:[this.width,this.height],transform:null},this.dirty=!0,this.isDestroyed=!1,this.seriously=$,this.listeners={},this.id=z,z++}).prototype.setReady=function(){var e;if(!this.ready&&(this.ready=!0,this.emit("ready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setReady()},a.prototype.setUnready=function(){var e;if(this.ready&&(this.ready=!1,this.emit("unready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setUnready()},a.prototype.setDirty=function(){var e;if(!this.dirty&&(this.emit("dirty"),this.dirty=!0,this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setDirty()},a.prototype.initFrameBuffer=function(e){n&&(this.frameBuffer=new K(n,this.width,this.height,e))},a.prototype.readPixels=function(e,t,r,i,o){var s=this.gl||n;if(!n)throw new Error("Cannot read pixels until a canvas is connected");if(this.frameBuffer||(this.initFrameBuffer(),this.setDirty()),this.render(),void 0===o)o=new Uint8Array(r*i*4);else if(!U(o,"Uint8Array"))throw new Error("Incompatible array type");return s.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer.frameBuffer),s.readPixels(e,t,r,i,n.RGBA,n.UNSIGNED_BYTE,o),o},a.prototype.resize=function(){var e,t;this.source?(e=this.source.width,t=this.source.height):this.sources&&this.sources.source?(e=this.sources.source.width,t=this.sources.source.height):this.inputs&&this.inputs.width?(e=this.inputs.width,t=this.inputs.height||e):this.inputs&&this.inputs.height?e=t=this.inputs.height:(e=1,t=1),e=Math.floor(e),t=Math.floor(t),this.width===e&&this.height===t||(this.width=e,this.height=t,this.emit("resize"),this.setDirty()),this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=e,this.uniforms.resolution[1]=t),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(e,t)},a.prototype.on=function(e,t){var n,r=-1;e&&"function"==typeof t&&((n=this.listeners[e])?r=n.indexOf(t):n=this.listeners[e]=[],r<0&&n.push(t))},a.prototype.off=function(e,t){var n,r=-1;e&&"function"==typeof t&&(n=this.listeners[e])&&(r=n.indexOf(t))>=0&&n.splice(r,1)},a.prototype.emit=function(e){var t,n=this.listeners[e];if(n&&n.length)for(t=0;t<n.length;t++)W(n[t])},a.prototype.destroy=function(){var e,t;for(t in delete this.gl,delete this.seriously,this.listeners)this.listeners.hasOwnProperty(t)&&delete this.listeners[t];for(e in this.uniforms)this.uniforms.hasOwnProperty(e)&&delete this.uniforms[e];this.targets&&delete this.targets,this.frameBuffer&&this.frameBuffer.destroy&&(this.frameBuffer.destroy(),delete this.frameBuffer),(e=F.indexOf(this))>=0&&F.splice(e,1),delete B[this.id],this.isDestroyed=!0},S=function(e){var t,n=e;function r(e,t){var r,i,o;return o=n.effect.inputs[e],r=n.inputElements[e],"string"==typeof t&&isNaN(t)&&("enum"===o.type?o.options.hasOwnProperty(t)||(t=N(t,["select"])):"number"===o.type||"boolean"===o.type?t=N(t,["input","select"]):"image"===o.type&&(t=N(t,["canvas","img","video"]))),U(t,"HTMLInputElement")||U(t,"HTMLSelectElement")?(i=t.value,r&&r.element!==t&&(r.element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0),delete n.inputElements[e],r=null),r||(r={element:t,listener:function(e,r){return function(){var i,s;i="checkbox"===t.type?t.checked:r.value,s=n.setInput(e,i),"color"===o.type&&(s=V(s).substr(0,7)),s!==i&&(r.value=s)}}(e,t)},n.inputElements[e]=r,"range"===t.type?(t.addEventListener("input",r.listener,!0),t.addEventListener("change",r.listener,!0)):t.addEventListener("change",r.listener,!0)),r&&"checkbox"===t.type&&(i=t.checked)):(r&&(r.element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0),delete n.inputElements[e]),i=t),n.setInput(e,i),n.inputs[e]}function i(e){return function(t){var n=r(e,t);return n&&n.pub}}function o(e){return function(){var t=n.inputs[e];return t&&t.pub}}function s(e){return function(t){return r(e,t)}}function a(e){return function(){return n.inputs[e]}}for(t in n.effect.inputs)if(n.effect.inputs.hasOwnProperty(t)){if(void 0!==this[t])throw new Error("Cannot overwrite Seriously."+t);"image"===n.effect.inputs[t].type?Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:o(t),set:i(t)}):Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:a(t),set:s(t)})}Object.defineProperties(this,{effect:{enumerable:!0,configurable:!0,get:function(){return n.hook}},title:{enumerable:!0,configurable:!0,get:function(){return n.effect.title||n.hook}},width:{enumerable:!0,configurable:!0,get:function(){return n.width}},height:{enumerable:!0,configurable:!0,get:function(){return n.height}},id:{enumerable:!0,configurable:!0,get:function(){return n.id}}}),this.render=function(){return n.render(),this},this.readPixels=function(e,t,r,i,o){return n.readPixels(e,t,r,i,o)},this.on=function(e,t){n.on(e,t)},this.off=function(e,t){n.off(e,t)},this.inputs=function(e){var t,r,i,o;if(i=n.effect.inputs,e)return(r=i[e])?(t={type:r.type,defaultValue:r.defaultValue,title:r.title||e},"number"===r.type?(t.min=r.min,t.max=r.max,t.step=r.step,t.mod=r.mod):"enum"===r.type?t.options=L({},r.options):"vector"===r.type&&(t.dimensions=r.dimensions),r.description&&(t.description=r.description),t):null;for(o in t={},i)i.hasOwnProperty(o)&&(t[o]=this.inputs(o));return t},this.alias=function(e,t){return n.alias(e,t),this},this.matte=function(e){n.matte(e)},this.destroy=function(){var e,t;for(e in n.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return n.isDestroyed},this.isReady=function(){return n.ready}},y=function(e,t){var r,i,o,u,c={};for(r in a.call(this,t),this.gl=n,this.effectRef=l[e],this.sources={},this.targets=[],this.inputElements={},this.dirty=!0,this.shaderDirty=!0,this.hook=e,this.options=t,this.transform=null,this.effect=L({},this.effectRef),this.effectRef.definition&&L(this.effect,this.effectRef.definition.call(this,t)),q(this.effect),this.uniforms.transform=s,this.inputs={},u=re[e],this.effect.inputs)this.effect.inputs.hasOwnProperty(r)&&(void 0!==(i=this.effect.inputs[r]).defaultValue&&null!==i.defaultValue||("number"===i.type?i.defaultValue=Math.min(Math.max(0,i.min),i.max):"color"===i.type?i.defaultValue=[0,0,0,0]:"boolean"===i.type?i.defaultValue=!1:"string"===i.type?i.defaultValue="":"enum"===i.type&&(i.defaultValue=i.firstValue)),o=i.validate.call(this,i.defaultValue,i),u&&void 0!==u[r]&&(o=i.validate.call(this,u[r],i,i.defaultValue,o),u[r]=o,"image"===i.type&&(c[r]=o)),this.inputs[r]=o,i.uniform&&(this.uniforms[i.uniform]=i.defaultValue));for(r in n&&(this.initialize(),this.effect.commonShader&&this.buildShader()),this.updateReady(),this.inPlace=this.effect.inPlace,this.pub=new S(this),F.push(this),B[this.id]=this,Q.push(this),g[e].push(this),c)c.hasOwnProperty(r)&&this.setInput(r,c[r])},y.prototype=Object.create(a.prototype),y.prototype.constructor=y,y.prototype.initialize=function(){if(!this.initialized){var e=this;this.baseShader=o,this.shape?this.model=ae(this.shape,this.gl):this.model=i,"function"==typeof this.effect.initialize?this.effect.initialize.call(this,(function(){e.initFrameBuffer(!0)}),n):this.initFrameBuffer(!0),this.frameBuffer&&(this.texture=this.frameBuffer.texture),this.initialized=!0}},y.prototype.resize=function(){var e;for(a.prototype.resize.call(this),this.effect.resize&&this.effect.resize.call(this),e=0;e<this.targets.length;e++)this.targets[e].resize()},y.prototype.updateReady=function(){var e,t,n,r,i=!0;for(t in(n=this.effect).inputs)if(n.inputs.hasOwnProperty(t)&&"image"===this.effect.inputs[t].type&&(!this.sources[t]||!this.sources[t].ready)&&(!n.requires||n.requires.call(this,t,this.inputs))){i=!1;break}if(this.ready!==i&&(this.ready=i,this.emit(i?"ready":"unready"),r=i?"setReady":"setUnready",this.targets))for(e=0;e<this.targets.length;e++)this.targets[e][r]()},y.prototype.setReady=y.prototype.updateReady,y.prototype.setUnready=y.prototype.updateReady,y.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},y.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1)},y.prototype.removeSource=function(e){var t,n=e&&e.pub;for(t in this.inputs)!this.inputs.hasOwnProperty(t)||this.inputs[t]!==e&&this.inputs[t]!==n||(this.inputs[t]=null);for(t in this.sources)!this.sources.hasOwnProperty(t)||this.sources[t]!==e&&this.sources[t]!==n||(this.sources[t]=null)},y.prototype.buildShader=function(){var e,t=this.effect,r=this;function i(e){return C.test(e)?e:"#define SHADER_NAME seriously."+r.hook+"\n"+e}this.shaderDirty&&(t.commonShader&&ie[this.hook]?(this.shader||ie[this.hook].count++,this.shader=ie[this.hook].shader):t.shader?(this.shader&&!t.commonShader&&this.shader.destroy(),(e=t.shader.call(this,this.inputs,{vertex:u,fragment:c},X.util))instanceof Y?this.shader=e:e&&e.vertex&&e.fragment?this.shader=new Y(n,i(e.vertex),i(e.fragment)):this.shader=o,t.commonShader&&(ie[this.hook]={count:1,shader:this.shader})):this.shader=o,this.shaderDirty=!1)},y.prototype.render=function(){var e,t,r,i=this.effect,o=this;if(n){if(this.initialized||this.initialize(),this.shaderDirty&&this.buildShader(),this.dirty&&this.ready){for(e in this.sources)!this.sources.hasOwnProperty(e)||i.requires&&!i.requires.call(this,e,this.inputs)||(r="function"==typeof this.inPlace?this.inPlace(e):this.inPlace,this.sources[e].render(!r));this.frameBuffer&&(t=this.frameBuffer.frameBuffer),"function"==typeof i.draw?(i.draw.call(this,this.shader,this.model,this.uniforms,t,(function(e,t,n,r,i,s){he(e,t,n,r,i||o,s)})),this.emit("render")):t&&(he(this.shader,this.model,this.uniforms,t,this),this.emit("render")),this.dirty=!1}return this.texture}},y.prototype.setInput=function(e,t){var n,r,i,o,a,u=this;if(this.effect.inputs.hasOwnProperty(e)){if("image"===(n=this.effect.inputs[e]).type){if(t){if((t=pe(t))!==this.sources[e]){if(function(){var t,n=u.sources[e];if(n){for(t in u.sources)if(t!==e&&u.sources.hasOwnProperty(t)&&u.sources[t]===n)return;n.removeTarget(u)}}(),ge(t,this))throw new Error("Attempt to make cyclical connection.");this.sources[e]=t,t.addTarget(this)}}else delete this.sources[e],t=!1;r=this.sources[e],i=Object.keys(this.sources),!0===this.inPlace&&1===i.length?(o=this.sources[i[0]],this.uniforms.transform=o&&o.cumulativeMatrix||s):this.uniforms.transform=s}else a=re[this.hook]&&void 0!==re[this.hook][e]?re[this.hook][e]:n.defaultValue,r=t=n.validate.call(this,t,n,a,this.inputs[e]);return this.inputs[e]===t&&"color"!==n.type&&"vector"!==n.type||(this.inputs[e]=t,n.uniform&&(this.uniforms[n.uniform]=r),"image"===n.type?(this.resize(),this.updateReady()):n.updateSources&&this.updateReady(),n.shaderDirty&&(this.shaderDirty=!0),this.setDirty(),n.update&&n.update.call(this,t)),t}},y.prototype.alias=function(e,t){var n=this;if(j.indexOf(t)>=0)throw new Error("'"+t+"' is a reserved name and cannot be used as an alias.");return this.effect.inputs.hasOwnProperty(e)&&(t||(t=e),$.removeAlias(t),ee[t]={node:this,input:e},Object.defineProperty($,t,{configurable:!0,enumerable:!0,get:function(){return n.inputs[e]},set:function(t){return n.setInput(e,t)}})),this},y.prototype.matte=function(e){var t,n,r,i,o,s,a,u=[],c=[],l={};function d(e){var t,n,r,i,o,s,a,l,d,f,h,p=[];if(!e.simple){for(t=0;t<e.edges.length;t++)for(r=e.edges[t],n=t+1;n<e.edges.length;n++)i=e.edges[n],g=r[0],m=r[1],b=i[0],void 0,void 0,void 0,x=void 0,T=void 0,v=((y=i[1]).x-b.x)*(g.y-b.y)-(y.y-b.y)*(g.x-b.x),_=(m.x-g.x)*(g.y-b.y)-(m.y-g.y)*(g.x-b.x),(o=!!((w=(y.y-b.y)*(m.x-g.x)-(y.x-b.x)*(m.y-g.y))&&(T=_/w,(x=v/w)>0&&x<=1&&T>0&&T<=1))&&{x:g.x+x*(m.x-g.x),y:g.y+x*(m.y-g.y)})&&(o.edge1=r,o.edge2=i,p.push(o));var g,m,b,y,v,_,w,x,T;if(p.length){for(d=[],t=0;t<p.length;t++)r=(o=p[t]).edge1,i=o.edge2,f={x:o.x,y:o.y,prev:r[0],next:i[1],id:c.length},e.vertices.push(f),c.push(f),h={x:o.x,y:o.y,prev:i[0],next:r[1],id:c.length},e.vertices.push(h),c.push(f),f.prev.next=f,f.next.prev=f,h.prev.next=h,h.next.prev=h;do{s={edges:[],vertices:[],simple:!0},d.push(s),a=l=e.vertices[0];do{t=e.vertices.indexOf(l),e.vertices.splice(t,1),s.edges.push([l,l.next]),s.vertices.push(l),l=l.next}while(l!==a)}while(e.vertices.length);for(t=u.indexOf(e),u.splice(t,1),t=0;t<d.length;t++)u.push(d[t])}else e.simple=!0}}function f(e){var t,n,r,i,o=e.vertices.length,s=0;for(t=o-1,n=0;n<o;t=n,n++)r=e.vertices[t],i=e.vertices[n],s+=r.x*i.y-i.x*r.y;return s>0}function h(e){var t,r,i,o,s,a,u,c,l,d,f,h=e.vertices,p=[],g=[];function m(e,t,n,r){var i,o,s,a,u,c,l,d,f,h,p,g;return i=n.x-t.x,o=n.y-t.y,s=e.x-n.x,a=e.y-n.y,u=t.x-e.x,c=t.y-e.y,l=r.x-e.x,d=r.y-e.y,f=r.x-t.x,h=r.y-t.y,p=r.x-n.x,g=r.y-n.y,i*h-o*f>=0&&s*g-a*p>=0&&u*d-c*l>=0}function b(e,t,n,r,i){var o,s,a,u;if(s=h[i[e]],a=h[i[t]],u=h[i[n]],0>(a.x-s.x)*(u.y-s.y)-(a.y-s.y)*(u.x-s.x))return!1;for(o=0;o<r;o++)if(o!==e&&o!==t&&o!==n&&m(s,a,u,h[i[o]]))return!1;return!0}if(r=h.length,e.clockWise)for(t=0;t<r;t++)p[t]=t;else for(t=0;t<r;t++)p[t]=r-1-t;for(o=2*(i=r),t=i-1;i>2;){if(o--<=0)return g;if(i<=(s=t)&&(s=0),i<=(t=s+1)&&(t=0),i<(a=t+1)&&(a=0),b(s,t,a,i,p)){for(u=p[s],c=p[t],l=p[a],e.clockWise?(g.push(h[u]),g.push(h[c]),g.push(h[l])):(g.push(h[l]),g.push(h[c]),g.push(h[u])),d=t,f=t+1;f<i;d++,f++)p[d]=p[f];o=2*--i}}n.indices=g}for(t=function(e){return e&&e.length&&Array.isArray(e)?Array.isArray(e[0])?Array.isArray(e[0])&&!isNaN(e[0][0])?[e]:e:[e]:[]}(e),r=0;r<t.length;r++){for(e=t[r],a=null,n={vertices:[],edges:[]},i=0;i<e.length;i++)"object"!=typeof(o=e[i])||isNaN(o.x)||isNaN(o.y)?o.length>=2&&!isNaN(o[0])&&!isNaN(o[1])&&(s={x:o[0],y:o[1],id:c.length}):s={x:o.x,y:o.y,id:c.length},s&&(a?(a.next=s,s.prev=a,s.next=n.vertices[0],n.vertices[0].prev=s):(n.head=s,s.next=s,s.prev=s),c.push(s),n.vertices.push(s),a=s);if(n.vertices.length>2)for(3===n.vertices.length&&(n.simple=!0),u.push(n),i=0;i<n.vertices.length;i++)s=n.vertices[i],n.edges.push([s,s.next])}for(r=u.length-1;r>=0;r--)d(n=u[r]);for(r=0;r<u.length;r++)(n=u[r]).clockWise=f(n),h(n);for(l.vertices=[],l.coords=[],r=0;r<c.length;r++)o=c[r],l.vertices.push(2*o.x-1),l.vertices.push(-2*o.y+1),l.vertices.push(-1),l.coords.push(o.x),l.coords.push(-1*o.y+1);for(l.vertices=new Float32Array(l.vertices),l.coords=new Float32Array(l.coords),l.indices=[],r=0;r<u.length;r++)for(n=u[r],i=0;i<n.indices.length;i++)o=n.indices[i],l.indices.push(o.id);l.indices=new Uint16Array(l.indices),this.shape=l,this.gl&&ae(l,this.gl)},y.prototype.destroy=function(){var e,t,n,r=this.hook;for(t in this.effect.destroy&&"function"==typeof this.effect.destroy&&this.effect.destroy.call(this),delete this.effect,ie[r]&&(ie[r].count--,ie[r].count||delete ie[r]),this.shader&&this.shader.destroy&&this.shader!==o&&!ie[r]&&this.shader.destroy(),delete this.shader,this.inputElements)this.inputElements.hasOwnProperty(t)&&((n=this.inputElements[t]).element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0));for(t in this.sources)this.sources.hasOwnProperty(t)&&((n=this.sources[t])&&n.removeTarget&&n.removeTarget(this),delete this.sources[t]);for(;this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(t in this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];for(t in ee)ee.hasOwnProperty(t)&&(n=ee[t]).node===this&&$.removeAlias(t);(e=Q.indexOf(this))>=0&&Q.splice(e,1),(e=g[r].indexOf(this))>=0&&g[r].splice(e,1),a.prototype.destroy.call(this)},O=function(e){var t=e;Object.defineProperties(this,{original:{enumerable:!0,configurable:!0,get:function(){return t.source}},id:{enumerable:!0,configurable:!0,get:function(){return t.id}},width:{enumerable:!0,configurable:!0,get:function(){return t.width}},height:{enumerable:!0,configurable:!0,get:function(){return t.height}}}),this.render=function(){t.render()},this.update=function(){t.setDirty()},this.readPixels=function(e,n,r,i,o){return t.readPixels(e,n,r,i,o)},this.on=function(e,n){t.on(e,n)},this.off=function(e,n){t.off(e,n)},this.destroy=function(){var e,n;for(e in t.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((n=Object.getOwnPropertyDescriptor(this,e)).get||n.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return t.isDestroyed},this.isReady=function(){return t.ready}},p=function(e,t,r){var i,o,s=r||{},u=void 0===s.flip||s.flip,c=s.width,l=s.height,d=!1,h=this,p=!1;function g(e,t,n,r){var i=f[e];if(i.definition){if(!(i=i.definition.call(h,t,n,r)))return null;i=L(L({},f[e]),i)}return i}function m(e){return h.source===e}if(a.call(this),(e&&"string"!=typeof e||!t&&0!==t)&&(r&&"object"==typeof r||(r=t),t=e),"string"==typeof t&&isNaN(t)&&(t=N(t,["canvas","img","video"])),"string"==typeof e&&f[e]&&(o=g(e,t,r,!0))&&(this.hook=e,p=!0,d=o.deferTexture,this.plugin=o,this.compare=o.compare,this.checkDirty=o.checkDirty,o.source&&(t=o.source)),!o&&U(t))"CANVAS"===t.tagName?(this.width=t.width,this.height=t.height,this.render=this.renderImageCanvas,p=!0,this.hook="canvas",this.compare=m):"IMG"===t.tagName&&(this.width=t.naturalWidth||1,this.height=t.naturalHeight||1,t.complete&&t.naturalWidth||(d=!0),t.addEventListener("load",(function(){h.isDestroyed||(h.width===t.naturalWidth&&h.height===t.naturalHeight||(h.width=t.naturalWidth,h.height=t.naturalHeight,h.resize()),h.setDirty(),h.setReady())}),!0),this.render=this.renderImageCanvas,p=!0,this.hook="image",this.compare=m);else if(!o&&U(t,"WebGLTexture")){if(n&&!n.isTexture(t))throw new Error("Not a valid WebGL texture.");isNaN(c)?isNaN(l)||(c=l):isNaN(l)&&(l=c),this.width=c,this.height=l,void 0===s.flip&&(u=!1),p=!0,this.texture=t,this.initialized=!0,this.hook="texture",this.compare=m,this.render=function(){}}if(!p&&!o)for(i in f)if(f.hasOwnProperty(i)&&f[i]&&(o=g(i,t,r,!1))){this.hook=i,p=!0,d=o.deferTexture,this.plugin=o,this.compare=o.compare,this.checkDirty=o.checkDirty,o.source&&(t=o.source);break}if(!p)throw new Error("Unknown source type");this.source=t,void 0===this.flip&&(this.flip=u),this.targets=[],d||h.setReady(),this.pub=new O(this),F.push(this),B[this.id]=this,H.push(this),b[this.hook].push(this),H.length&&!k&&fe()},p.prototype=Object.create(a.prototype),p.prototype.constructor=p,p.prototype.initialize=function(){var e;n&&!this.texture&&this.ready&&(e=n.createTexture(),n.bindTexture(n.TEXTURE_2D,e),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.bindTexture(n.TEXTURE_2D,null),this.texture=e,this.initialized=!0,this.allowRefresh=!0,this.setDirty())},p.prototype.initFrameBuffer=function(e){n&&(this.frameBuffer=new K(n,this.width,this.height,{texture:this.texture,useFloat:e}))},p.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},p.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1)},p.prototype.resize=function(){var e,t;if(this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.framebuffer&&this.framebuffer.resize(this.width,this.height),this.emit("resize"),this.setDirty(),this.targets)for(e=0;e<this.targets.length;e++)(t=this.targets[e]).resize(),t.setTransformDirty&&t.setTransformDirty()},p.prototype.setReady=function(){var e;if(!this.ready&&(this.ready=!0,this.resize(),this.initialize(),this.emit("ready"),this.targets))for(e=0;e<this.targets.length;e++)this.targets[e].setReady()},p.prototype.render=function(){var e=this.source;n&&(e||0===e)&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.plugin&&this.plugin.render&&(this.dirty||this.checkDirty&&this.checkDirty())&&this.plugin.render.call(this,n,he,i,o)&&(this.dirty=!1,this.emit("render")))},p.prototype.renderImageCanvas=function(){var e=this.source;if(n&&e&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.dirty)){n.bindTexture(n.TEXTURE_2D,this.texture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this.flip),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{return n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),this.dirty=!1,this.emit("render"),!0}catch(e){e.code===window.DOMException.SECURITY_ERR&&(this.allowRefresh=!1,X.logger.error("Unable to access cross-domain image"))}return!1}},p.prototype.destroy=function(){var e,t,r;for(this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),n&&this.texture&&n.deleteTexture(this.texture);this.targets.length;)(r=this.targets.pop())&&r.removeSource&&r.removeSource(this);for(t in(e=H.indexOf(this))>=0&&H.splice(e,1),(e=b[this.hook].indexOf(this))>=0&&b[this.hook].splice(e,1),this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];a.prototype.destroy.call(this)},A=function(e){var t=e;Object.defineProperties(this,{source:{enumerable:!0,configurable:!0,get:function(){if(t.source)return t.source.pub},set:function(e){t.setSource(e)}},original:{enumerable:!0,configurable:!0,get:function(){return t.target}},width:{enumerable:!0,configurable:!0,get:function(){return t.width},set:function(e){!isNaN(e)&&e>0&&t.width!==e&&(t.width=e,t.resize(),t.setTransformDirty())}},height:{enumerable:!0,configurable:!0,get:function(){return t.height},set:function(e){!isNaN(e)&&e>0&&t.height!==e&&(t.height=e,t.resize(),t.setTransformDirty())}},id:{enumerable:!0,configurable:!0,get:function(){return t.id}}}),this.render=function(){t.render()},this.readPixels=function(e,n,r,i,o){return t.readPixels(e,n,r,i,o)},this.on=function(e,n){t.on(e,n)},this.off=function(e,n){t.off(e,n)},this.go=function(e){t.go(e)},this.stop=function(){t.stop()},this.getTexture=function(){return t.frameBuffer.texture},this.destroy=function(){var e,n;for(e in t.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((n=Object.getOwnPropertyDescriptor(this,e)).get||n.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.inputs=function(e){return{source:{type:"image"}}},this.isDestroyed=function(){return t.isDestroyed},this.isReady=function(){return t.ready}},T=function(e,t,s){var l,d,f,p,g,m,b,y,_,x=this,T=!1;function S(e,t,r,s){var a=h[e];if(a.definition){if(!(a=a.definition.call(x,t,r,s)))return null;a=L(L({},h[e]),a),x.hook=_,T=!0,x.plugin=a,x.compare=a.compare,a.target&&(t=a.target),a.gl&&!x.gl&&(x.gl=a.gl,n||ce(a.gl)),x.gl===n&&(x.model=i,x.shader=o)}return a}if(a.call(this),(e&&"string"!=typeof e||!t&&0!==t)&&(s&&"object"==typeof s||(s=t),t=e),d=void 0===(l=s||{}).flip||l.flip,f=parseInt(l.width,10),p=parseInt(l.height,10),m=l.debugContext,"string"==typeof e&&h[e]&&S(e,t,l,!0),this.renderToTexture=l.renderToTexture,U(t,"WebGLFramebuffer"))if(b=t,U(l,"HTMLCanvasElement"))t=l;else if(U(l,"WebGLRenderingContext"))t=l.canvas;else if(U(l.canvas,"HTMLCanvasElement"))t=l.canvas;else{if(!U(l.context,"WebGLRenderingContext"))throw new Error("Must provide a canvas with WebGLFramebuffer target");t=l.context.canvas}if(U(t,"HTMLCanvasElement")){if(f=t.width,p=t.height,(!n||n.canvas!==t&&l.allowSecondaryWebGL)&&(g=G(t,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:m})),g)n&&n!==g?(this.gl=g,this.frameBuffer={frameBuffer:b||null},this.shader=new Y(this.gl,u,c),this.model=ue.call(this,this.gl),this.pixels=null,this.texture=this.gl.createTexture(),this.gl.bindTexture(n.TEXTURE_2D,this.texture),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),this.render=this.renderSecondaryWebGL):(r||(r=this),n||ce(g),this.render=this.renderWebGL,l.renderToTexture?n&&(this.frameBuffer=new K(n,f,p,!1)):this.frameBuffer={frameBuffer:b||null});else{if(!l.allowSecondaryWebGL&&n&&n.canvas!==t)throw new Error("Only one WebGL target canvas allowed. Set allowSecondaryWebGL option to create secondary context.");this.render=w,X.logger.log("Unable to create WebGL context.")}T=!0}if(!T)for(_ in h)if(h.hasOwnProperty(_)&&h[_]&&S(_,t,l,!1))break;if(!T)throw new Error("Unknown target type");v&&((y=v.get(t))?X.logger.warn("Target already in use by another instance",t,Object.keys(y).map((function(e){return y[e]}))):(y={},v.set(t,y)),y[$.id]=$),this.target=t,this.transform=null,this.transformDirty=!0,this.flip=d,f&&(this.width=f),p&&(this.height=p),this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,void 0!==l.auto?this.auto=l.auto:this.auto=oe,this.frames=0,this.pub=new A(this),F.push(this),B[this.id]=this,J.push(this)},(T.prototype=Object.create(a.prototype)).constructor=T,T.prototype.setSource=function(e){var t;(t=pe(e))!==this.source&&(this.source&&this.source.removeTarget(this),this.source=t,t.addTarget(this),t&&(this.resize(),t.ready?this.setReady():this.setUnready()),this.setDirty())},T.prototype.setDirty=function(){this.dirty=!0,this.auto&&!k&&(k=R(fe))},T.prototype.resize=function(){U(this.target,"HTMLCanvasElement")?this.width===this.target.width&&this.height===this.target.height||(this.target.width=this.width,this.target.height=this.height,this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.emit("resize"),this.setTransformDirty()):this.plugin&&this.plugin.resize&&this.plugin.resize.call(this),!this.source||this.source.width===this.width&&this.source.height===this.height||this.transform||(this.transform=new Float32Array(16))},T.prototype.setTransformDirty=function(){this.transformDirty=!0,this.setDirty()},T.prototype.go=function(){this.auto=!0,this.setDirty()},T.prototype.stop=function(){this.auto=!1},T.prototype.render=function(){n&&this.plugin&&this.plugin.render&&this.plugin.render.call(this,he,o,i)},T.prototype.renderWebGL=function(){var e,t,r;if(this.resize(),n&&this.dirty&&this.ready){if(!this.source)return;this.source.render(),this.uniforms.source=this.source.texture,this.source.width===this.width&&this.source.height===this.height?this.uniforms.transform=this.source.cumulativeMatrix||s:this.transformDirty&&(e=this.transform,I.copy(e,this.source.cumulativeMatrix||s),t=this.source.width/this.width,r=this.source.height/this.height,e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t,e[4]*=r,e[5]*=r,e[6]*=r,e[7]*=r,this.uniforms.transform=e,this.transformDirty=!1),he(o,i,this.uniforms,this.frameBuffer.frameBuffer,this,P),this.emit("render"),this.dirty=!1}},T.prototype.renderSecondaryWebGL=function(){var e,t,n,r,i;this.dirty&&this.ready&&this.source&&(this.emit("render"),this.source.render(!0),e=this.source.width,t=this.source.height,this.pixels&&this.pixels.length===e*t*4||(this.pixels=new Uint8Array(e*t*4)),this.source.readPixels(0,0,e,t,this.pixels),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,e,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.pixels),e===this.width&&t===this.height?this.uniforms.transform=s:this.transformDirty&&(n=this.transform,I.copy(n,s),r=this.source.width/this.width,i=this.source.height/this.height,n[0]*=r,n[1]*=r,n[2]*=r,n[3]*=r,n[4]*=i,n[5]*=i,n[6]*=i,n[7]*=i,this.uniforms.transform=n,this.transformDirty=!1),this.uniforms.source=this.texture,he(this.shader,this.model,this.uniforms,null,this,P),this.dirty=!1)},T.prototype.removeSource=function(e){this.source!==e&&this.source!==e.pub||(this.source=null)},T.prototype.destroy=function(){var e,n;this.source&&this.source.removeTarget&&this.source.removeTarget(this),v&&(delete(n=v.get(this.target))[$.id],Object.keys(n).length||v.delete(this.target)),this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),delete this.source,delete this.target,delete this.pub,delete this.uniforms,delete this.pixels,delete this.auto,(e=J.indexOf(this))>=0&&J.splice(e,1),a.prototype.destroy.call(this),this===r&&(t.removeEventListener("webglcontextrestored",le,!1),de(),r=null)},E=function(e){var t,n=e,r=this;function i(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){return t.get.call(n)},set:function(r){!function(e,t,r){var i,o,s;i=n.inputElements[e],"string"==typeof r&&isNaN(r)&&("enum"===t.type?t.options.hasOwnProperty(r)||(r=N(r,["select"])):"number"===t.type||"boolean"===t.type?r=N(r,["input","select"]):"image"===t.type&&(r=N(r,["canvas","img","video"]))),U(r,"HTMLInputElement")||U(r,"HTMLSelectElement")?(o=r.value,i&&i.element!==r&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete n.inputElements[e],i=null),i||(i={element:r,listener:(s=r,function(){var t,i;t="checkbox"===r.type?r.checked:s.value,i=n.setInput(e,t),"color"===r.type&&(i=V(i)),i!==t&&(s.value=i)})},n.inputElements[e]=i,"range"===r.type?(r.addEventListener("input",i.listener,!0),r.addEventListener("change",i.listener,!0)):r.addEventListener("change",i.listener,!0)),i&&"checkbox"===r.type&&(o=r.checked)):(i&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete n.inputElements[e]),o=r),n.setInput(e,o)}(e,t,r)}})}function o(e){return function(){e.apply(n,arguments)&&n.setTransformDirty()}}for(t in Object.defineProperties(this,{transform:{enumerable:!0,configurable:!0,get:function(){return n.hook}},title:{enumerable:!0,configurable:!0,get:function(){return n.plugin.title||n.hook}},width:{enumerable:!0,configurable:!0,get:function(){return n.width}},height:{enumerable:!0,configurable:!0,get:function(){return n.height}},id:{enumerable:!0,configurable:!0,get:function(){return n.id}},source:{enumerable:!0,configurable:!0,get:function(){return n.source&&n.source.pub},set:function(e){n.setSource(e)}}}),n.methods)n.methods.hasOwnProperty(t)&&(this[t]=o(n.methods[t]));for(t in n.inputs)n.inputs.hasOwnProperty(t)&&i(t,n.inputs[t]);this.update=function(){n.setDirty()},this.inputs=function(e){var t,r,i,o;if(i=n.plugin.inputs,e)return!(r=i[e])||r.method?null:(t={type:r.type,defaultValue:r.defaultValue,title:r.title||e},"number"===r.type?(t.min=r.min,t.max=r.max,t.step=r.step,t.mod=r.mod):"enum"===r.type?t.options=L({},r.options):"vector"===r.type&&(t.dimensions=r.dimensions),r.description&&(t.description=r.description),t);for(o in t={},i)i.hasOwnProperty(o)&&!i[o].method&&(t[o]=this.inputs(o));return t},this.alias=function(e,t){return n.alias(e,t),this},this.on=function(e,t){n.on(e,t)},this.off=function(e,t){n.off(e,t)},this.destroy=function(){var e,t;for(e in n.destroy(),this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w)},this.isDestroyed=function(){return n.isDestroyed},this.isReady=function(){return n.ready}},x=function(e,t){var n,r,i,o,s;for(n in this.matrix=new Float32Array(16),this.cumulativeMatrix=new Float32Array(16),this.ready=!1,this.width=1,this.height=1,this.seriously=$,this.transformRef=d[e],this.hook=e,this.id=z,z++,this.options=t,this.sources=null,this.targets=[],this.inputElements={},this.inputs={},this.methods={},this.listeners={},this.texture=null,this.frameBuffer=null,this.uniforms=null,this.dirty=!0,this.transformDirty=!0,this.renderDirty=!1,this.isDestroyed=!1,this.transformed=!1,this.plugin=L({},this.transformRef),this.transformRef.definition&&L(this.plugin,this.transformRef.definition.call(this,t)),this.plugin.inputs)this.plugin.inputs.hasOwnProperty(n)&&((r=this.plugin.inputs[n]).method&&"function"==typeof r.method?this.methods[n]=r.method:"function"==typeof r.set&&"function"==typeof r.get&&(this.inputs[n]=r));for(n in q(this.plugin),s=re[e],this.plugin.inputs)this.plugin.inputs.hasOwnProperty(n)&&"function"==typeof(r=this.plugin.inputs[n]).set&&"function"==typeof r.get&&"function"!=typeof r.method&&(i=r.get.call(this),o=void 0===r.defaultValue?i:r.defaultValue,o=r.validate.call(this,o,r,i),s&&void 0!==s[n]&&(o=r.validate.call(this,s[n],r,r.defaultValue,o),s[n]=o),o!==i&&r.set.call(this,o));F.push(this),B[this.id]=this,this.pub=new E(this),Z.push(this),m[e].push(this)},x.prototype=Object.create(a.prototype),x.prototype.constructor=x,x.prototype.setDirty=function(){this.renderDirty=!0,a.prototype.setDirty.call(this)},x.prototype.setTransformDirty=function(){var e,t;for(this.transformDirty=!0,this.dirty=!0,this.renderDirty=!0,e=0;e<this.targets.length;e++)(t=this.targets[e]).setTransformDirty?t.setTransformDirty():t.setDirty()},x.prototype.resize=function(){var e;for(a.prototype.resize.call(this),this.plugin.resize&&this.plugin.resize.call(this),e=0;e<this.targets.length;e++)this.targets[e].resize();this.setTransformDirty()},x.prototype.setSource=function(e){var t;if((t=pe(e))!==this.source){if(ge(t,this))throw new Error("Attempt to make cyclical connection.");this.source&&this.source.removeTarget(this),this.source=t,t.addTarget(this),t&&t.ready?this.setReady():this.setUnready(),this.resize()}},x.prototype.addTarget=function(e){var t;for(t=0;t<this.targets.length;t++)if(this.targets[t]===e)return;this.targets.push(e)},x.prototype.removeTarget=function(e){var t=this.targets&&this.targets.indexOf(e);t>=0&&this.targets.splice(t,1),this.targets&&this.targets.length&&this.resize()},x.prototype.setInput=function(e,t){var n,r,i;if(this.plugin.inputs.hasOwnProperty(e))return n=this.plugin.inputs[e],r=re[this.hook]&&void 0!==re[this.hook][e]?re[this.hook][e]:n.defaultValue,i=n.get.call(this),void 0===r&&(r=i),t=n.validate.call(this,t,n,r,i),n.set.call(this,t)&&this.setTransformDirty(),n.get.call(this)},x.prototype.alias=function(e,t){var n,r,i=this;if(j.indexOf(t)>=0)throw new Error("'"+t+"' is a reserved name and cannot be used as an alias.");return this.plugin.inputs.hasOwnProperty(e)&&(t||(t=e),$.removeAlias(t),(n=this.inputs[e])?(r=i.inputs[e],Object.defineProperty($,t,{configurable:!0,enumerable:!0,get:function(){return r.get.call(i)},set:function(e){r.set.call(i,e)&&i.setTransformDirty()}})):(n=this.methods[e])&&(r=n,$[t]=function(){r.apply(i,arguments)&&i.setTransformDirty()}),n&&(ee[t]={node:this,input:e})),this},x.prototype.render=function(e){return this.source?(this.source.render(),this.transformDirty&&(this.transformed?this.source.cumulativeMatrix?I.multiply(this.cumulativeMatrix,this.matrix,this.source.cumulativeMatrix):I.copy(this.cumulativeMatrix,this.matrix):I.copy(this.cumulativeMatrix,this.source.cumulativeMatrix||s),this.transformDirty=!1),e&&n?(this.renderDirty&&(this.frameBuffer||(this.uniforms={resolution:[this.width,this.height]},this.frameBuffer=new K(n,this.width,this.height)),this.uniforms.source=this.source.texture,this.uniforms.transform=this.cumulativeMatrix||s,he(o,i,this.uniforms,this.frameBuffer.frameBuffer,this),this.renderDirty=!1),this.texture=this.frameBuffer.texture):this.source?this.texture=this.source.texture:this.texture=null,this.dirty=!1,this.texture):(this.transformDirty&&(I.copy(this.cumulativeMatrix,this.matrix),this.transformDirty=!1),this.texture=null,void(this.dirty=!1))},x.prototype.readPixels=function(e,t,r,i,o){var s=this.gl||n;if(!n)throw new Error("Cannot read pixels until a canvas is connected");if(this.render(!0),void 0===o)o=new Uint8Array(r*i*4);else if(!U(o,"Uint8Array"))throw new Error("Incompatible array type");return s.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer.frameBuffer),s.readPixels(e,t,r,i,n.RGBA,n.UNSIGNED_BYTE,o),o},x.prototype.destroy=function(){var e,t,n,r=this.hook;for(e in this.plugin.destroy&&"function"==typeof this.plugin.destroy&&this.plugin.destroy.call(this),delete this.effect,this.frameBuffer&&(this.frameBuffer.destroy(),delete this.frameBuffer,delete this.texture),this.inputElements)this.inputElements.hasOwnProperty(e)&&((n=this.inputElements[e]).element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0));for(this.source&&this.source.removeTarget(this);this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(t in this)this.hasOwnProperty(t)&&"id"!==t&&delete this[t];for(t in ee)ee.hasOwnProperty(t)&&(n=ee[t]).node===this&&$.removeAlias(t);(e=Z.indexOf(this))>=0&&Z.splice(e,1),(e=m[r].indexOf(this))>=0&&m[r].splice(e,1),a.prototype.destroy.call(this)},x.prototype.setReady=a.prototype.setReady,x.prototype.setUnready=a.prototype.setUnready,x.prototype.on=a.prototype.on,x.prototype.off=a.prototype.off,x.prototype.emit=a.prototype.emit,(e=U(e,"HTMLCanvasElement")?{canvas:e}:e||{}).canvas,this.effect=function(e,t){if(!l[e])throw new Error("Unknown effect: "+e);return new y(e,t).pub},this.source=function(e,t,n){return pe(e,t,n).pub},this.transform=function(t,n){if("string"!=typeof t&&(n=t,t=!1),t){if(!d[t])throw new Error("Unknown transform: "+t)}else if(t=e&&e.defaultTransform||"2d",!d[t])throw new Error("No transform specified");return new x(t,n).pub},this.target=function(e,t,n){var r,i,o;for(e&&"string"==typeof e&&!h[e]&&(i=document.querySelector(e)),("string"!=typeof e||!t&&0!==t||i)&&(n&&"object"==typeof n||(n=t),t=i||e,e=null),"string"==typeof t&&isNaN(t)&&(t=document.querySelector(t)),o=0;o<J.length;o++)if(r=J[o],(!e||e===r.hook)&&(r.target===t||r.compare&&r.compare(t,n)))return r.pub;return(r=new T(e,t,n)).pub},this.aliases=function(){return Object.keys(ee)},this.removeAlias=function(e){ee[e]&&(delete this[e],delete ee[e])},this.defaults=function(e,t){var n;if(e)if("object"!=typeof e)null===t?delete re[e]:"object"==typeof t&&(re[e]=L({},t));else for(n in e)e.hasOwnProperty(n)&&this.defaults(n,e[n]);else if(null===e)for(n in re)re.hasOwnProperty(n)&&delete re[n]},this.go=function(e,t){var n;for("function"==typeof e&&te.indexOf(e)<0&&te.push(e),"function"==typeof t&&ne.indexOf(t)<0&&ne.push(t),oe=!0,n=0;n<J.length;n++)J[n].go();k||!te.length&&!ne.length||fe()},this.stop=function(){te.length=0,ne.length=0,M(k),k=0},this.render=function(){var t;for(t=0;t<J.length;t++)J[t].render(e)},this.destroy=function(){for(var e,t;F.length;)F[0].pub.destroy();for(e in this)this.hasOwnProperty(e)&&"isDestroyed"!==e&&"id"!==e&&((t=Object.getOwnPropertyDescriptor(this,e)).get||t.set||"function"!=typeof this[e]?delete this[e]:this[e]=w);$=null,H=[],J=[],Q=[],F=[],te.length=0,ne.length=0,M(k),k=0,se=!0},this.isDestroyed=function(){return se},this.incompatible=function(e){var t,n,r;if(r=X.incompatible(e))return r;if(!e){for(t in g)if(g.hasOwnProperty(t)&&g[t].length&&(n=l[t])&&"function"==typeof n.compatible&&!n.compatible.call(this))return"plugin-"+t;for(t in b)if(b.hasOwnProperty(t)&&b[t].length&&(n=f[t])&&"function"==typeof n.compatible&&!n.compatible.call(this))return"source-"+t}return!1},this.isNode=function(e){var t;return!(!e||!(t=B[e.id])||t.isDestroyed)},this.isSource=function(e){return this.isNode(e)&&e instanceof O},this.isEffect=function(e){return this.isNode(e)&&e instanceof S},this.isTransform=function(e){return this.isNode(e)&&e instanceof E},this.isTarget=function(e){return this.isNode(e)&&e instanceof A},Object.defineProperties(this,{id:{enumerable:!0,configurable:!0,get:function(){return D}}}),this.defaults(e.defaults)}window.addEventListener("message",(function(e){e.source===window&&"seriously-timeout-message"===e.data&&(e.stopPropagation(),p.length>0&&p.shift()())}),!0),K.prototype.resize=function(e,t){var n=this.gl;this.width===e&&this.height===t||(this.width=e,this.height=t,n&&(n.bindTexture(n.TEXTURE_2D,this.texture),n.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer),n.bindRenderbuffer(n.RENDERBUFFER,this.renderBuffer),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,e,t,0,n.RGBA,n.UNSIGNED_BYTE,null),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,e,t),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,this.texture,0),n.bindTexture(n.TEXTURE_2D,null),n.bindRenderbuffer(n.RENDERBUFFER,null),n.bindFramebuffer(n.FRAMEBUFFER,null)))},K.prototype.destroy=function(){var e=this.gl;e&&(e.deleteFramebuffer(this.frameBuffer),e.deleteRenderbuffer(this.renderBuffer),this.ownTexture&&e.deleteTexture(this.texture)),delete this.frameBuffer,delete this.renderBuffer,delete this.texture,delete this.gl},Y.prototype.use=function(){this.gl.useProgram(this.program)},X.incompatible=function(e){var t,n,r;if(void 0===o&&((t=document.createElement("canvas"))&&t.getContext?window.WebGLRenderingContext?(n=H())||(o="context"):o="webgl":o="canvas"),o)return o;if(e){if((r=l[e])&&"function"==typeof r.compatible&&!r.compatible(n))return"plugin-"+e;if((r=f[e])&&"function"==typeof r.compatible&&!r.compatible(n))return"source-"+e}return!1},X.plugin=function(e,t,n){var r;if(l[e])X.logger.warn("Effect ["+e+"] already loaded");else if(void 0===n&&"object"==typeof t&&(n=t),n)return r=L({},n),"function"==typeof t&&(r.definition=t),r.reserved=k,r.inputs&&q(r),r.title||(r.title=e),l[e]=r,g[e]=[],r},X.removePlugin=function(e){var t;if(!e)return this;if(!l[e])return this;if(t=g[e]){for(;t.length;)t.shift().destroy();delete g[e]}return delete l[e],this},X.source=function(e,t,n){var r;if(f[e])X.logger.warn("Source ["+e+"] already loaded");else if(void 0===n&&"object"==typeof t&&(n=t),n||t)return r=L({},n),"function"==typeof t&&(r.definition=t),r.title||(r.title=e),f[e]=r,b[e]=[],r},X.removeSource=function(e){var t;if(!e)return this;if(!f[e])return this;if(t=b[e]){for(;t.length;)t.shift().destroy();delete b[e]}return delete f[e],this},X.transform=function(e,t,n){var r;if(d[e])X.logger.warn("Transform ["+e+"] already loaded");else if(void 0===n&&"object"==typeof t&&(n=t),n||t)return r=L({},n),"function"==typeof t&&(r.definition=t),r.reserved=D,r.inputs&&q(r),r.title||(r.title=e),d[e]=r,m[e]=[],r},X.removeTransform=function(e){var t;if(!e)return this;if(!d[e])return this;if(t=m[e]){for(;t.length;)t.shift().destroy();delete m[e]}return delete d[e],this},X.target=function(e,t,n){var r;if(h[e])X.logger.warn("Target ["+e+"] already loaded");else if(void 0===n&&"object"==typeof t&&(n=t),n||t)return r=L({},n),"function"==typeof t&&(r.definition=t),r.title||(r.title=e),h[e]=r,y[e]=[],r},X.removeTarget=function(e){var t;if(!e)return this;if(!h[e])return this;if(t=y[e]){for(;t.length;)t.shift().destroy();delete y[e]}return delete h[e],this},X.inputValidators={color:function(e,t,n,r){var o,s,a,u;if(s=r||[],"string"==typeof e){if((a=T.exec(e))&&a.length){if(a.length<3)return s[0]=s[1]=s[2]=s[3]=0,s;for(s[3]=1,u=0;u<3;u++)s[u]=parseFloat(a[u+2])/255;return isNaN(a[6])||(s[3]=parseFloat(a[6])),"hsl"===a[1].toLowerCase()?B(s[0],s[1],s[2],s[3],s):s}if((a=S.exec(e))&&a.length)return 3===(o=a[1]).length?(s[0]=parseInt(o[0],16)/15,s[1]=parseInt(o[1],16)/15,s[2]=parseInt(o[2],16)/15,s[3]=1):4===o.length?(s[0]=parseInt(o[0],16)/15,s[1]=parseInt(o[1],16)/15,s[2]=parseInt(o[2],16)/15,s[3]=parseInt(o[3],16)/15):6===o.length?(s[0]=parseInt(o.substr(0,2),16)/255,s[1]=parseInt(o.substr(2,2),16)/255,s[2]=parseInt(o.substr(4,2),16)/255,s[3]=1):8===o.length?(s[0]=parseInt(o.substr(0,2),16)/255,s[1]=parseInt(o.substr(2,2),16)/255,s[2]=parseInt(o.substr(4,2),16)/255,s[3]=parseInt(o.substr(6,2),16)/255):s[0]=s[1]=s[2]=s[3]=0,s;if(a=x[e.toLowerCase()]){for(u=0;u<4;u++)s[u]=a[u];return s}return i||(i=document.createElement("canvas").getContext("2d")),i.fillStyle=e,(o=i.fillStyle)&&"#000000"!==o?X.inputValidators.color(o,t,n,r):(s[0]=s[1]=s[2]=s[3]=0,s)}if(z(e)){if((s=e).length<3)return s[0]=s[1]=s[2]=s[3]=0,s;for(u=0;u<3;u++)if(isNaN(s[u]))return s[0]=s[1]=s[2]=s[3]=0,s;return s.length<4&&s.push(1),s}if("number"==typeof e)return s[0]=s[1]=s[2]=e,s[3]=1,s;if("object"==typeof e){for(u=0;u<4;u++)null===e[o=E[u]]||isNaN(e[o])?s[u]=3===u?1:0:s[u]=e[o];return s}return s[0]=s[1]=s[2]=s[3]=0,s},number:function(e,t,n){return e=parseFloat(e),isNaN(e)?n||0:(t.mod&&(e-=t.mod*Math.floor(e/t.mod)),e<t.min?t.min:e>t.max?t.max:t.step?Math.round(e/t.step)*t.step:e)},enum:function(e,t,n){var r=t.options||[];return"string"==typeof e?e=e.toLowerCase():"number"==typeof e?e=e.toString():e||(e=""),r.hasOwnProperty(e)?e:n||""},vector:function(e,t,n,r){var i,o,s,a=t.dimensions||4;if(i=r||[],z(e)){for(o=0;o<a;o++)i[o]=e[o]||0;return i}if("object"==typeof e){for(o=0;o<a;o++)void 0===e[s=O[o]]&&(s=E[o]),i[o]=e[s]||0;return i}for(e=parseFloat(e)||0,o=0;o<a;o++)i[o]=e;return i},boolean:function(e){return!(!e||e&&e.toLowerCase&&"false"===e.toLowerCase())},string:function(e){return"string"==typeof e?e:0===e||e?e.toString?e.toString():String(e):""}},X.prototype.effects=X.effects=function(){var e,t,n,r,i,o={};for(e in l)if(l.hasOwnProperty(e)){for(i in n={title:(t=l[e]).title||e,description:t.description||"",inputs:{}},t.inputs)t.inputs.hasOwnProperty(i)&&(r=t.inputs[i],n.inputs[i]={type:r.type,defaultValue:r.defaultValue,step:r.step,min:r.min,max:r.max,mod:r.mod,minCount:r.minCount,maxCount:r.maxCount,dimensions:r.dimensions,title:r.title||i,description:r.description||"",options:r.options||[]});o[e]=n}return o},window.Float32Array&&(s=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),window.Seriously&&"object"==typeof window.Seriously&&function(){var e;for(e in window.Seriously)window.Seriously.hasOwnProperty(e)&&"plugin"!==e&&"object"==typeof window.Seriously[e]&&X.plugin(e,window.Seriously[e])}(),X.logger={log:F("log"),info:F("info"),warn:F("warn"),error:F("error")},X.util={mat4:I,checkSource:function(e){var t,n,r,i;if(!(t=N(e,["img","canvas","video"])))return!1;if(!(n=document.createElement("canvas")))return X.logger.warn("Browser does not support canvas or Seriously.js"),!1;if(0===t.naturalWidth&&"IMG"===t.tagName)return X.logger.warn("Image not loaded"),!1;if(0===t.readyState&&0===t.videoWidth&&"VIDEO"===t.tagName)return X.logger.warn("Video not loaded"),!1;if(r=H()){(i=r.createTexture())||X.logger.error("Test WebGL context has been lost"),r.bindTexture(r.TEXTURE_2D,i);try{r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t)}catch(e){return e.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error storing image to texture: "+e.message),r.deleteTexture(i),!1}r.deleteTexture(i)}else{r=n.getContext("2d");try{r.drawImage(t,0,0),r.getImageData(0,0,1,1)}catch(e){return e.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error drawing image to canvas: "+e.message),!1}}return!0},hslToRgb:B,colors:x,setTimeoutZero:W,ShaderProgram:Y,FrameBuffer:K,requestAnimationFrame:R,shader:{makeNoise:"float makeNoise(float u, float v, float timer) {\n\tfloat x = u * v * mod(timer * 1000.0, 100.0);\n\tx = mod(x, 13.0) * mod(x, 127.0);\n\tfloat dx = mod(x, 0.01);\n\treturn clamp(0.1 + dx * 100.0, 0.0, 1.0);\n}\n",random:"#ifndef RANDOM\n#define RANDOM\nfloat random(vec2 n) {\n\treturn 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);\n}\n#endif\n"}},X.source("video",(function(e,t,n){var r,i,o=this,s=!1,u=!1,c=!1,l=0;function d(){e.removeEventListener("loadedmetadata",d,!0),s||(e.videoWidth?(o.width===e.videoWidth&&o.height===e.videoHeight||(o.width=e.videoWidth,o.height=e.videoHeight,o.resize()),u&&o.setReady()):(u=!0,setTimeout(d,50)))}function f(){c=!0}function h(){c=!1,o.setDirty()}if(U(e,"HTMLVideoElement"))return e.readyState?d():(u=!0,e.addEventListener("loadedmetadata",d,!0)),e.addEventListener("seeking",f,!1),e.addEventListener("seeked",h,!1),{deferTexture:u,source:e,render:function t(n){var s;if(l=e.currentTime,!e.videoHeight||!e.videoWidth)return!1;a?(i||(i=document.createElement("canvas").getContext("2d"),(r=i.canvas).width=o.width,r.height=o.height),s=r,i.drawImage(e,0,0,o.width,o.height)):s=e,n.bindTexture(n.TEXTURE_2D,o.texture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,o.flip),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{if(n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,s),void 0===a){if(n.getError()===n.INVALID_VALUE)return a=!0,t(n);a=!1}return!0}catch(e){e.code===window.DOMException.SECURITY_ERR?(o.allowRefresh=!1,X.logger.error("Unable to access cross-domain image")):X.logger.error("Error rendering video source",e)}return!1},checkDirty:function(){return!c&&e.currentTime!==l},compare:function(e){return o.source===e},destroy:function(){s=!0,e.removeEventListener("seeking",f,!1),e.removeEventListener("seeked",h,!1),e.removeEventListener("loadedmetadata",d,!0)}}}),{title:"Video"}),X.transform("2d",(function(e){var t=this,n=!(e&&e.radians),r=0,i=0,o=1,s=1,a=0,u=0,c=0,l=0,d=0;function f(){var e,f,h,p,g,m,b,y,v,_,w,x=t.matrix;function T(e,t){x[12]=x[0]*e+x[4]*t+x[12],x[13]=x[1]*e+x[5]*t+x[13],x[14]=x[2]*e+x[6]*t+x[14],x[15]=x[3]*e+x[7]*t+x[15]}a||u||c||l||d||1!==o||1!==s?(I.identity(x),T(a+r,u+i),l&&(x[4]=l/t.width),d&&(x[1]=d/t.height),c&&(p=x[0],g=x[1],m=x[2],b=x[3],y=x[4],v=x[5],_=x[6],w=x[7],e=-(n?c*Math.PI/180:c),f=Math.sin(e),h=Math.cos(e),x[0]=p*h+y*f,x[1]=g*h+v*f,x[2]=m*h+_*f,x[3]=b*h+w*f,x[4]=y*h-p*f,x[5]=v*h-g*f,x[6]=_*h-m*f,x[7]=w*h-b*f),1!==o&&(x[0]*=o,x[1]*=o,x[2]*=o,x[3]*=o),1!==s&&(x[4]*=s,x[5]*=s,x[6]*=s,x[7]*=s),T(-r,-i),t.transformed=!0):t.transformed=!1}return{inputs:{reset:{method:function(){return r=0,i=0,o=1,s=1,a=0,u=0,c=0,l=0,d=0,!!t.transformed&&(t.transformed=!1,!0)}},translate:{method:function(e,t){return isNaN(e)&&(e=a),isNaN(t)&&(t=u),(e!==a||t!==u)&&(a=e,u=t,f(),!0)},type:["number","number"]},translateX:{get:function(){return a},set:function(e){return e!==a&&(a=e,f(),!0)},type:"number"},translateY:{get:function(){return u},set:function(e){return e!==u&&(u=e,f(),!0)},type:"number"},rotation:{get:function(){return c},set:function(e){return e!==c&&(c=parseFloat(e),f(),!0)},type:"number"},center:{method:function(e,t){return isNaN(e)&&(e=r),isNaN(t)&&(t=i),(e!==r||t!==i)&&(r=e,i=t,f(),!0)},type:["number","number"]},centerX:{get:function(){return r},set:function(e){return e!==r&&(r=e,f(),!0)},type:"number"},centerY:{get:function(){return i},set:function(e){return e!==i&&(i=e,f(),!0)},type:"number"},skew:{method:function(e,t){return isNaN(e)&&(e=l),isNaN(t)&&(t=d),(e!==l||t!==d)&&(l=e,d=t,f(),!0)},type:["number","number"]},skewX:{get:function(){return l},set:function(e){return e!==l&&(l=e,f(),!0)},type:"number"},skewY:{get:function(){return d},set:function(e){return e!==d&&(d=e,f(),!0)},type:"number"},scale:{method:function(e,t){var n,r;if(n=isNaN(e)?o:e,isNaN(t)){if(isNaN(e))return!1;r=n}else r=t;return(n!==o||r!==s)&&(o=n,s=r,f(),!0)},type:["number","number"]},scaleX:{get:function(){return o},set:function(e){return e!==o&&(o=e,f(),!0)},type:"number"},scaleY:{get:function(){return s},set:function(e){return e!==s&&(s=e,f(),!0)},type:"number"}}}}),{title:"2D Transform",description:"Translate, Rotate, Scale, Skew"}),X.transform("flip",(function(){var e=this,t=!0;function n(){var n=e.matrix;t?(n[0]=-1,n[5]=1):(n[0]=1,n[5]=-1)}return I.identity(e.matrix),n(),e.transformDirty=!0,e.transformed=!0,{inputs:{direction:{get:function(){return t?"horizontal":"vertical"},set:function(e){var r;return(r="vertical"!==e)!==t&&(t=r,n(),!0)},type:"string"}}}}),{title:"Flip",description:"Flip Horizontal/Vertical"}),X.transform("reformat",(function(){var e,t,n=this,r="contain";function i(){var i,o,s,a,u=n.matrix,c=e||n.width,l=t||n.height,d=n.source,f=d&&d.width||1,h=d&&d.height||1;"distort"===r||c===f&&l===h?n.transformed=!1:(s=f/h,a=c/l,"none"===r?(i=f/c,o=h/l):"width"===r||"contain"===r&&a<=s?(i=1,o=a/s):"height"===r||"contain"===r&&a>s?(i=s/a,o=1):a>s?(i=1,o=a/s):(i=s/a,o=1),1!==i||1!==o?(I.identity(u),1!==i&&(u[0]*=i,u[1]*=i,u[2]*=i,u[3]*=i),1!==o&&(u[4]*=o,u[5]*=o,u[6]*=o,u[7]*=o),n.transformed=!0):n.transformed=!1)}function o(){return e||n.source&&n.source.width||1}function s(){return t||n.source&&n.source.height||1}return this.resize=function(){var e,t=o(),n=s();if(this.width!==t||this.height!==n)for(this.width=t,this.height=n,this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=t,this.uniforms.resolution[1]=n),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(t,n),e=0;e<this.targets.length;e++)this.targets[e].resize();this.setTransformDirty(),i()},{inputs:{width:{get:o,set:function(t){return(t=Math.floor(t))===e||(e=t,this.resize()),!1},type:"number"},height:{get:s,set:function(e){return(e=Math.floor(e))===t||(t=e,this.resize()),!1},type:"number"},mode:{get:function(){return r},set:function(e){return e!==r&&(r=e,i(),!0)},type:"enum",options:["cover","contain","distort","width","height","none"]}}}}),{title:"Reformat",description:"Change output dimensions"}),u=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","void main(void) {","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tgl_Position.w = screenPosition.w;","\tvTexCoord = texCoord;","}\n"].join("\n"),c=["precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","void main(void) {","\t\tgl_FragColor = texture2D(source, vTexCoord);","}"].join("\n"),X.util.shader.noiseHelpers="#ifndef NOISE_HELPERS\n#define NOISE_HELPERS\nvec2 mod289(vec2 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 mod289(vec3 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 permute(vec3 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 permute(vec4 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat taylorInvSqrt(float r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n",X.util.shader.snoise2d="#ifndef NOISE2D\n#define NOISE2D\nfloat snoise(vec2 v) {\n\tconst vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n\t\t0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n\t\t-0.577350269189626, // -1.0 + 2.0 * C.x\n\t\t0.024390243902439); // 1.0 / 41.0\n\tvec2 i = floor(v + dot(v, C.yy));\n\tvec2 x0 = v - i + dot(i, C.xx);\n\tvec2 i1;\n\t//i1.x = step(x0.y, x0.x); // x0.x > x0.y ? 1.0 : 0.0\n\t//i1.y = 1.0 - i1.x;\n\ti1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n\t// x0 = x0 - 0.0 + 0.0 * C.xx ;\n\t// x1 = x0 - i1 + 1.0 * C.xx ;\n\t// x2 = x0 - 1.0 + 2.0 * C.xx ;\n\tvec4 x12 = x0.xyxy + C.xxzz;\n\tx12.xy -= i1;\n\ti = mod289(i); // Avoid truncation effects in permutation\n\tvec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0)) + i.x + vec3(0.0, i1.x, 1.0));\n\tvec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.0);\n\tm = m*m ;\n\tm = m*m ;\n\tvec3 x = 2.0 * fract(p * C.www) - 1.0;\n\tvec3 h = abs(x) - 0.5;\n\tvec3 ox = floor(x + 0.5);\n\tvec3 a0 = x - ox;\n\tm *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n\tvec3 g;\n\tg.x = a0.x * x0.x + h.x * x0.y;\n\tg.yz = a0.yz * x12.xz + h.yz * x12.yw;\n\treturn 130.0 * dot(m, g);\n}\n#endif\n",X.util.shader.snoise3d="#ifndef NOISE3D\n#define NOISE3D\nfloat snoise(vec3 v) {\n\tconst vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n\tconst vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\tvec3 i = floor(v + dot(v, C.yyy));\n\tvec3 x0 = v - i + dot(i, C.xxx) ;\n\tvec3 g = step(x0.yzx, x0.xyz);\n\tvec3 l = 1.0 - g;\n\tvec3 i1 = min(g.xyz, l.zxy);\n\tvec3 i2 = max(g.xyz, l.zxy);\n\t// x0 = x0 - 0.0 + 0.0 * C.xxx;\n\t// x1 = x0 - i1 + 1.0 * C.xxx;\n\t// x2 = x0 - i2 + 2.0 * C.xxx;\n\t// x3 = x0 - 1.0 + 3.0 * C.xxx;\n\tvec3 x1 = x0 - i1 + C.xxx;\n\tvec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n\tvec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\ti = mod289(i);\n\tvec4 p = permute(permute(permute(\n\t\t\t\t\t\ti.z + vec4(0.0, i1.z, i2.z, 1.0))\n\t\t\t\t\t\t+ i.y + vec4(0.0, i1.y, i2.y, 1.0))\n\t\t\t\t\t\t+ i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\tfloat n_ = 0.142857142857; // 1.0/7.0\n\tvec3 ns = n_ * D.wyz - D.xzx;\n\tvec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p, 7 * 7)\n\tvec4 x_ = floor(j * ns.z);\n\tvec4 y_ = floor(j - 7.0 * x_); // mod(j, N)\n\tvec4 x = x_ * ns.x + ns.yyyy;\n\tvec4 y = y_ * ns.x + ns.yyyy;\n\tvec4 h = 1.0 - abs(x) - abs(y);\n\tvec4 b0 = vec4(x.xy, y.xy);\n\tvec4 b1 = vec4(x.zw, y.zw);\n\t//vec4 s0 = vec4(lessThan(b0, 0.0)) * 2.0 - 1.0;\n\t//vec4 s1 = vec4(lessThan(b1, 0.0)) * 2.0 - 1.0;\n\tvec4 s0 = floor(b0) * 2.0 + 1.0;\n\tvec4 s1 = floor(b1) * 2.0 + 1.0;\n\tvec4 sh = -step(h, vec4(0.0));\n\tvec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy ;\n\tvec4 a1 = b1.xzyw + s1.xzyw * sh.zzww ;\n\tvec3 p0 = vec3(a0.xy, h.x);\n\tvec3 p1 = vec3(a0.zw, h.y);\n\tvec3 p2 = vec3(a1.xy, h.z);\n\tvec3 p3 = vec3(a1.zw, h.w);\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tvec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n\tm = m * m;\n\treturn 42.0 * dot(m*m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n#endif\n",X.util.shader.snoise4d="#ifndef NOISE4D\n#define NOISE4D\nvec4 grad4(float j, vec4 ip)\n\t{\n\tconst vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n\tvec4 p, s;\n\n\tp.xyz = floor(fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n\tp.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n\ts = vec4(lessThan(p, vec4(0.0)));\n\tp.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n\treturn p;\n\t}\n\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n\t{\n\tconst vec4 C = vec4(0.138196601125011, // (5 - sqrt(5))/20 G4\n\t\t\t\t\t\t0.276393202250021, // 2 * G4\n\t\t\t\t\t\t0.414589803375032, // 3 * G4\n\t\t\t\t\t\t-0.447213595499958); // -1 + 4 * G4\n\n\tvec4 i = floor(v + dot(v, vec4(F4)));\n\tvec4 x0 = v - i + dot(i, C.xxxx);\n\n\n\tvec4 i0;\n\tvec3 isX = step(x0.yzw, x0.xxx);\n\tvec3 isYZ = step(x0.zww, x0.yyz);\n\ti0.x = isX.x + isX.y + isX.z;\n\ti0.yzw = 1.0 - isX;\n\ti0.y += isYZ.x + isYZ.y;\n\ti0.zw += 1.0 - isYZ.xy;\n\ti0.z += isYZ.z;\n\ti0.w += 1.0 - isYZ.z;\n\n\tvec4 i3 = clamp(i0, 0.0, 1.0);\n\tvec4 i2 = clamp(i0 - 1.0, 0.0, 1.0);\n\tvec4 i1 = clamp(i0 - 2.0, 0.0, 1.0);\n\n\tvec4 x1 = x0 - i1 + C.xxxx;\n\tvec4 x2 = x0 - i2 + C.yyyy;\n\tvec4 x3 = x0 - i3 + C.zzzz;\n\tvec4 x4 = x0 + C.wwww;\n\n\ti = mod289(i);\n\tfloat j0 = permute(permute(permute(permute(i.w) + i.z) + i.y) + i.x);\n\tvec4 j1 = permute(permute(permute(permute (\n\t\t\t\t\ti.w + vec4(i1.w, i2.w, i3.w, 1.0))\n\t\t\t\t\t+ i.z + vec4(i1.z, i2.z, i3.z, 1.0))\n\t\t\t\t\t+ i.y + vec4(i1.y, i2.y, i3.y, 1.0))\n\t\t\t\t\t+ i.x + vec4(i1.x, i2.x, i3.x, 1.0));\n\n\tvec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n\tvec4 p0 = grad4(j0, ip);\n\tvec4 p1 = grad4(j1.x, ip);\n\tvec4 p2 = grad4(j1.y, ip);\n\tvec4 p3 = grad4(j1.z, ip);\n\tvec4 p4 = grad4(j1.w, ip);\n\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tp4 *= taylorInvSqrt(dot(p4, p4));\n\n\tvec3 m0 = max(0.6 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2)), 0.0);\n\tvec2 m1 = max(0.6 - vec2(dot(x3, x3), dot(x4, x4)), 0.0);\n\tm0 = m0 * m0;\n\tm1 = m1 * m1;\n\treturn 49.0 * (dot(m0*m0, vec3(dot(p0, x0), dot(p1, x1), dot(p2, x2)))\n\t\t\t\t\t\t\t+ dot(m1*m1, vec2(dot(p3, x3), dot(p4, x4)))) ;\n}\n#endif\n";const J=X},6303:(e,t,n)=>{"use strict";n.r(t),n(6551).default.plugin("chroma",{shader:function(e,t){return t.vertex=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","uniform vec4 screen;","uniform float balance;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat fmin = min(min(screen.r, screen.g), screen.b);","\tfloat fmax = max(max(screen.r, screen.g), screen.b);","\tfloat secondaryComponents;","\tscreenPrimary = step(fmax, screen.rgb);","\tsecondaryComponents = dot(1.0 - screenPrimary, screen.rgb);","\tscreenSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position = screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tvTexCoord = texCoord;","}"].join("\n"),t.fragment=[this.inputs.mask?"#define MASK":"","precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","uniform vec4 screen;","uniform float screenWeight;","uniform float balance;","uniform float clipBlack;","uniform float clipWhite;","uniform bool mask;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat pixelSat, secondaryComponents;","\tvec4 sourcePixel = texture2D(source, vTexCoord);","\tfloat fmin = min(min(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tfloat fmax = max(max(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tvec3 pixelPrimary = step(fmax, sourcePixel.rgb);","\tsecondaryComponents = dot(1.0 - pixelPrimary, sourcePixel.rgb);","\tpixelSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tfloat diffPrimary = dot(abs(pixelPrimary - screenPrimary), vec3(1.0));","\tfloat solid = step(1.0, step(pixelSat, 0.1) + step(fmax, 0.1) + diffPrimary);","\tfloat alpha = max(0.0, 1.0 - pixelSat / screenSat);","\talpha = smoothstep(clipBlack, clipWhite, alpha);","\tvec4 semiTransparentPixel = vec4((sourcePixel.rgb - (1.0 - alpha) * screen.rgb * screenWeight) / max(0.00001, alpha), alpha);","\tvec4 pixel = mix(semiTransparentPixel, sourcePixel, solid);","#ifdef MASK","\tgl_FragColor = vec4(vec3(pixel.a), 1.0);","#else","\tgl_FragColor = pixel;","#endif","}"].join("\n"),t},inPlace:!0,inputs:{source:{type:"image",uniform:"source"},screen:{type:"color",uniform:"screen",defaultValue:[66/255,195/255,31/255,1]},weight:{type:"number",uniform:"screenWeight",defaultValue:1,min:0},balance:{type:"number",uniform:"balance",defaultValue:1,min:0,max:1},clipBlack:{type:"number",uniform:"clipBlack",defaultValue:0,min:0,max:1},clipWhite:{type:"number",uniform:"clipWhite",defaultValue:1,min:0,max:1},mask:{type:"boolean",defaultValue:!1,uniform:"mask",shaderDirty:!0}},title:"Chroma Key",description:""})},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=a(e),s=o[0],u=o[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,s,u)),l=0,d=u>0?s-4:s;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[l++]=255&t),1===u&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=16383,a=0,c=r-i;a<c;a+=s)o.push(u(e,a,a+s>c?c:a+s));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=o[s],r[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,r){for(var i,o,s=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},8764:(e,t,n)=>{"use strict";const r=n(9742),i=n(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=a(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||X(e.length)?a(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),a(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),n=a(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,u.prototype),r}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(i)return r?-1:H(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return O(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function b(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),X(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){let o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let r=-1;for(o=n;o<a;o++)if(c(e,o)===c(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===u)return r*s}else-1!==r&&(o-=o-r),r=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){let n=!0;for(let r=0;r<u;r++)if(c(e,o+r)!==c(t,r)){n=!1;break}if(n)return o}return-1}function _(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=t.length;let s;for(r>o/2&&(r=o/2),s=0;s<r;++s){const r=parseInt(t.substr(2*s,2),16);if(X(r))return s;e[n+s]=r}return s}function w(e,t,n,r){return K(H(t,e.length-n),e,n,r)}function x(e,t,n,r){return K(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function T(e,t,n,r){return K(q(t),e,n,r)}function S(e,t,n,r){return K(function(e,t){let n,r,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function O(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=n){let n,r,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128==(192&n)&&(u=(31&t)<<6|63&n,u>127&&(o=u));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(u=(15&t)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:n=e[i+1],r=e[i+2],a=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(u=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return function(e){const t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=P));return n}(r)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,n){return function(e,t,n){return l(e),e<=0?a(e):void 0!==t?"string"==typeof n?a(e).fill(t,n):a(e).fill(t):a(e)}(e,t,n)},u.allocUnsafe=function(e){return d(e)},u.allocUnsafeSlow=function(e){return d(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(Y(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),Y(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=u.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if(Y(t,Uint8Array))i+t.length>r.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if(Y(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(r,i),l=e.slice(t,n);for(let e=0;e<a;++e)if(c[e]!==l[e]){o=c[e],s=l[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":case"latin1":case"binary":return x(this,e,t,n);case"base64":return T(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const P=4096;function A(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function C(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function I(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=J[e[r]];return i}function R(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function M(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function D(e,t,n,r,i){V(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,n}function j(e,t,n,r,i){V(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s>>=8,e[n+2]=s,s>>=8,e[n+1]=s,s>>=8,e[n]=s,n+8}function $(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,o){return t=+t,n>>>=0,o||$(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return t=+t,n>>>=0,o||$(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,u.prototype),r},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Z((function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=Z((function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||M(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||M(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Z((function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=Z((function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||M(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||M(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||M(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||M(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||k(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||k(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Z((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Z((function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);k(this,e,t,n,r-1,-r)}let i=0,o=1,s=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);k(this,e,t,n,r-1,-r)}let i=n-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Z((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Z((function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,r),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=o[i%s]}return this};const F={};function U(e,t,n){F[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function B(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function V(e,t,n,r,i,o){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new F.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||W(t,e.length-(n+1))}(r,i,o)}function z(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,n){if(Math.floor(e)!==e)throw z(e,n),new F.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=B(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=B(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function H(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let s=0;s<r;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},759:e=>{const t="application/javascript";e.exports=(e,n={})=>{const r={skipSameOrigin:!0,useBlob:!0,...n};return!e.includes("://")||e.includes(window.location.origin)?Promise.resolve(e):new Promise(((n,i)=>fetch(e).then((e=>e.text())).then((i=>{let o=new URL(e).href.split("/");o.pop();const s=`const _importScripts = importScripts;\nconst _fixImports = (url) => new URL(url, '${o.join("/")+"/"}').href;\nimportScripts = (...urls) => _importScripts(...urls.map(_fixImports));`;let a=`data:${t},`+encodeURIComponent(s+i);r.useBlob&&(a=URL.createObjectURL(new Blob([`importScripts("${a}")`],{type:t}))),n(a)})).catch(i)))}},1227:(e,t,n)=>{var r=n(4155);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(2447)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,t,n)=>{e.exports=function(e){function t(e){let n,i,o,s=null;function a(...e){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];n=o.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(7824),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},2701:function(e,t,n){"use strict";var r=n(4155),i=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t,n){this.name=e,this.version=t,this.os=n};t.BrowserInfo=o;var s=function(e){this.version=e,this.name="node",this.os=r.platform};t.NodeInfo=s;var a=function(){this.bot=!0,this.name="bot",this.version=null,this.os=null};t.BotInfo=a;var u=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["vivaldi",/Vivaldi\/([0-9\.]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/Edg\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],c=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/],["Search Bot",/(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves\/Teoma)|(ia_archiver)/]];function l(e){var t=""!==e&&u.reduce((function(t,n){var r=n[0],i=n[1];if(t)return t;var o=i.exec(e);return!!o&&[r,o]}),!1);if(!t)return null;var n=t[0],r=t[1];if("searchbot"===n)return new a;var s=r[1]&&r[1].split(/[._]/).slice(0,3);return s?s.length<3&&(s=i(s,function(e){for(var t=[],n=0;n<e;n++)t.push("0");return t}(3-s.length))):s=[],new o(n,s.join("."),d(e))}function d(e){for(var t=0,n=c.length;t<n;t++){var r=c[t],i=r[0];if(r[1].test(e))return i}return null}function f(){return void 0!==r&&r.version?new s(r.version.slice(1)):null}t.detect=function(e){return e?l(e):"undefined"!=typeof navigator?l(navigator.userAgent):f()},t.parseUserAgent=l,t.detectOS=d,t.getNodeVersion=f},2114:e=>{"use strict";function t(e,t){for(const n in t)Object.defineProperty(e,n,{value:t[n],enumerable:!0,configurable:!0});return e}e.exports=function(e,n,r){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");r||(r={}),"object"==typeof n&&(r=n,n=""),n&&(r.code=n);try{return t(e,r)}catch(n){r.message=e.message,r.stack=e.stack;const i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(e)),t(new i,r)}}},7185:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=new WeakMap,r=new WeakMap;function i(e){const t=n.get(e);return console.assert(null!=t,"'this' is expected an Event object, but got",e),t}function o(e,t){n.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const r=Object.keys(t);for(let e=0;e<r.length;++e){const t=r[e];t in this||Object.defineProperty(this,t,s(t))}}function s(e){return{get(){return i(this).event[e]},set(t){i(this).event[e]=t},configurable:!0,enumerable:!0}}function a(e){return{value(){const t=i(this).event;return t[e].apply(t,arguments)},configurable:!0,enumerable:!0}}function u(e){if(null==e||e===Object.prototype)return o;let t=r.get(e);return null==t&&(t=function(e,t){const n=Object.keys(t);if(0===n.length)return e;function r(t,n){e.call(this,t,n)}r.prototype=Object.create(e.prototype,{constructor:{value:r,configurable:!0,writable:!0}});for(let i=0;i<n.length;++i){const o=n[i];if(!(o in e.prototype)){const e="function"==typeof Object.getOwnPropertyDescriptor(t,o).value;Object.defineProperty(r.prototype,o,e?a(o):s(o))}}return r}(u(Object.getPrototypeOf(e)),e),r.set(e,t)),t}function c(e){return i(e).stopped}function l(e,t){i(e).passiveListener=t}o.prototype={get type(){return i(this).event.type},get target(){return i(this).eventTarget},get currentTarget(){return i(this).currentTarget},composedPath(){const e=i(this).currentTarget;return null==e?[]:[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return i(this).eventPhase},stopPropagation(){const e=i(this);"function"==typeof e.event.stopPropagation&&e.event.stopPropagation()},stopImmediatePropagation(){const e=i(this);e.stopped=!0,"function"==typeof e.event.stopImmediatePropagation&&e.event.stopImmediatePropagation()},get bubbles(){return Boolean(i(this).event.bubbles)},get cancelable(){return Boolean(i(this).event.cancelable)},preventDefault(){const e=i(this);null==e.passiveListener?e.event.cancelable&&(e.canceled=!0,"function"==typeof e.event.preventDefault&&e.event.preventDefault()):console.warn("Event#preventDefault() was called from a passive listener:",e.passiveListener)},get defaultPrevented(){return i(this).canceled},get composed(){return Boolean(i(this).event.composed)},get timeStamp(){return i(this).timeStamp}},Object.defineProperty(o.prototype,"constructor",{value:o,configurable:!0,writable:!0}),"undefined"!=typeof window&&void 0!==window.Event&&(Object.setPrototypeOf(o.prototype,window.Event.prototype),r.set(window.Event.prototype,o));const d=new WeakMap,f=3;function h(e){return null!==e&&"object"==typeof e}function p(e){const t=d.get(e);if(null==t)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return t}function g(e,t){Object.defineProperty(e,`on${t}`,function(e){return{get(){let t=p(this).get(e);for(;null!=t;){if(t.listenerType===f)return t.listener;t=t.next}return null},set(t){"function"==typeof t||h(t)||(t=null);const n=p(this);let r=null,i=n.get(e);for(;null!=i;)i.listenerType===f?null!==r?r.next=i.next:null!==i.next?n.set(e,i.next):n.delete(e):r=i,i=i.next;if(null!==t){const i={listener:t,listenerType:f,passive:!1,once:!1,next:null};null===r?n.set(e,i):r.next=i}},configurable:!0,enumerable:!0}}(t))}function m(e){function t(){b.call(this)}t.prototype=Object.create(b.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let n=0;n<e.length;++n)g(t.prototype,e[n]);return t}function b(){if(!(this instanceof b)){if(1===arguments.length&&Array.isArray(arguments[0]))return m(arguments[0]);if(arguments.length>0){const e=new Array(arguments.length);for(let t=0;t<arguments.length;++t)e[t]=arguments[t];return m(e)}throw new TypeError("Cannot call a class as a function")}d.set(this,new Map)}b.prototype={addEventListener(e,t,n){if(null==t)return!1;if("function"!=typeof t&&!h(t))throw new TypeError("'listener' should be a function or an object.");const r=p(this),i=h(n),o=(i?Boolean(n.capture):Boolean(n))?1:2,s={listener:t,listenerType:o,passive:i&&Boolean(n.passive),once:i&&Boolean(n.once),next:null};let a=r.get(e);if(void 0===a)return r.set(e,s),!0;let u=null;for(;null!=a;){if(a.listener===t&&a.listenerType===o)return!1;u=a,a=a.next}return u.next=s,!0},removeEventListener(e,t,n){if(null==t)return!1;const r=p(this),i=(h(n)?Boolean(n.capture):Boolean(n))?1:2;let o=null,s=r.get(e);for(;null!=s;){if(s.listener===t&&s.listenerType===i)return null!==o?o.next=s.next:null!==s.next?r.set(e,s.next):r.delete(e),!0;o=s,s=s.next}return!1},dispatchEvent(e){if(null==e||"string"!=typeof e.type)throw new TypeError('"event.type" should be a string.');const t=p(this),n=e.type;let r=t.get(n);if(null==r)return!0;const o=function(e,t){return new(u(Object.getPrototypeOf(t)))(e,t)}(this,e);let s=null;for(;null!=r;){if(r.once?null!==s?s.next=r.next:null!==r.next?t.set(n,r.next):t.delete(n):s=r,l(o,r.passive?r.listener:null),"function"==typeof r.listener)try{r.listener.call(this,o)}catch(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e)}else r.listenerType!==f&&"function"==typeof r.listener.handleEvent&&r.listener.handleEvent(o);if(c(o))break;r=r.next}return l(o,null),function(e,t){i(e).eventPhase=0}(o),function(e,t){i(e).currentTarget=null}(o),!o.defaultPrevented}},Object.defineProperty(b.prototype,"constructor",{value:b,configurable:!0,writable:!0}),"undefined"!=typeof window&&void 0!==window.EventTarget&&Object.setPrototypeOf(b.prototype,window.EventTarget.prototype),t.defineEventAttribute=g,t.EventTarget=b,t.default=b,e.exports=b,e.exports.EventTarget=e.exports.default=b,e.exports.defineEventAttribute=g},7187:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,o,s,c;if(a(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var c=u.length,l=p(u,c);for(n=0;n<c;++n)r(l[n],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,o,s;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},o.prototype.listenerCount=h,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},8806:function(e,t,n){!function(e){function t(){}function n(e,t){if(e=void 0===e?"utf-8":e,t=void 0===t?{fatal:!1}:t,-1===i.indexOf(e.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}function r(e){for(var t=0,n=Math.min(65536,e.length+1),r=new Uint16Array(n),i=[],o=0;;){var s=t<e.length;if(!s||o>=n-1){if(i.push(String.fromCharCode.apply(null,r.subarray(0,o))),!s)return i.join("");e=e.subarray(t),o=t=0}if(0==(128&(s=e[t++])))r[o++]=s;else if(192==(224&s)){var a=63&e[t++];r[o++]=(31&s)<<6|a}else if(224==(240&s)){a=63&e[t++];var u=63&e[t++];r[o++]=(31&s)<<12|a<<6|u}else 240==(248&s)&&(65535<(s=(7&s)<<18|(a=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++])&&(s-=65536,r[o++]=s>>>10&1023|55296,s=56320|1023&s),r[o++]=s)}}if(e.TextEncoder&&e.TextDecoder)return!1;var i=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var n=e.length,r=0,i=Math.max(32,n+(n>>>1)+7),o=new Uint8Array(i>>>3<<3);t<n;){var s=e.charCodeAt(t++);if(55296<=s&&56319>=s){if(t<n){var a=e.charCodeAt(t);56320==(64512&a)&&(++t,s=((1023&s)<<10)+(1023&a)+65536)}if(55296<=s&&56319>=s)continue}if(r+4>o.length&&(i+=8,i=(i*=1+t/e.length*2)>>>3<<3,(a=new Uint8Array(i)).set(o),o=a),0==(4294967168&s))o[r++]=s;else{if(0==(4294965248&s))o[r++]=s>>>6&31|192;else if(0==(4294901760&s))o[r++]=s>>>12&15|224,o[r++]=s>>>6&63|128;else{if(0!=(4292870144&s))continue;o[r++]=s>>>18&7|240,o[r++]=s>>>12&63|128,o[r++]=s>>>6&63|128}o[r++]=63&s|128}}return o.slice?o.slice(0,r):o.subarray(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1});var o=r;"function"==typeof Buffer&&Buffer.from?o=function(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf-8")}:"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&(o=function(e){try{var t=URL.createObjectURL(new Blob([e],{type:"text/plain;charset=UTF-8"})),n=new XMLHttpRequest;return n.open("GET",t,!1),n.send(),n.responseText}catch(t){return r(e)}finally{t&&URL.revokeObjectURL(t)}}),n.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");return e=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),o(e)},e.TextEncoder=t,e.TextDecoder=n}("undefined"!=typeof window?window:void 0!==n.g?n.g:this)},5177:e=>{e.exports=function(){if("undefined"==typeof globalThis)return null;var e={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},645:(e,t)=>{t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,l=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+d],d+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+d],d+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),o-=c}return(h?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,d=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*u-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[n+h]=255&a,h+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+h]=255&s,h+=p,s/=256,c-=8);e[n+h-p]|=128*g}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},6486:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",u=32,c=128,l=1/0,d=9007199254740991,f=NaN,h=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],g="[object Arguments]",m="[object Array]",b="[object Boolean]",y="[object Date]",v="[object Error]",_="[object Function]",w="[object GeneratorFunction]",x="[object Map]",T="[object Number]",S="[object Object]",O="[object Promise]",E="[object RegExp]",P="[object Set]",A="[object String]",C="[object Symbol]",I="[object WeakMap]",R="[object ArrayBuffer]",M="[object DataView]",k="[object Float32Array]",D="[object Float64Array]",j="[object Int8Array]",$="[object Int16Array]",N="[object Int32Array]",L="[object Uint8Array]",F="[object Uint8ClampedArray]",U="[object Uint16Array]",B="[object Uint32Array]",V=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,q=RegExp(G.source),K=RegExp(H.source),Y=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Te="\\u2700-\\u27bf",Se="a-z\\xdf-\\xf6\\xf8-\\xff",Oe="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Pe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="["+we+"]",Ce="["+Pe+"]",Ie="["+xe+"]",Re="\\d+",Me="["+Te+"]",ke="["+Se+"]",De="[^"+we+Pe+Re+Te+Se+Oe+"]",je="\\ud83c[\\udffb-\\udfff]",$e="[^"+we+"]",Ne="(?:\\ud83c[\\udde6-\\uddff]){2}",Le="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+Oe+"]",Ue="\\u200d",Be="(?:"+ke+"|"+De+")",Ve="(?:"+Fe+"|"+De+")",ze="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Ie+"|"+je+")?",He="["+Ee+"]?",qe=He+Ge+"(?:"+Ue+"(?:"+[$e,Ne,Le].join("|")+")"+He+Ge+")*",Ke="(?:"+[Me,Ne,Le].join("|")+")"+qe,Ye="(?:"+[$e+Ie+"?",Ie,Ne,Le,Ae].join("|")+")",Xe=RegExp("['’]","g"),Je=RegExp(Ie,"g"),Ze=RegExp(je+"(?="+je+")|"+Ye+qe,"g"),Qe=RegExp([Fe+"?"+ke+"+"+ze+"(?="+[Ce,Fe,"$"].join("|")+")",Ve+"+"+We+"(?="+[Ce,Fe+Be,"$"].join("|")+")",Fe+"?"+Be+"+"+ze,Fe+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,Ke].join("|"),"g"),et=RegExp("["+Ue+we+xe+Ee+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[k]=it[D]=it[j]=it[$]=it[N]=it[L]=it[F]=it[U]=it[B]=!0,it[g]=it[m]=it[R]=it[b]=it[M]=it[y]=it[v]=it[_]=it[x]=it[T]=it[S]=it[E]=it[P]=it[A]=it[I]=!1;var ot={};ot[g]=ot[m]=ot[R]=ot[M]=ot[b]=ot[y]=ot[k]=ot[D]=ot[j]=ot[$]=ot[N]=ot[x]=ot[T]=ot[S]=ot[E]=ot[P]=ot[A]=ot[C]=ot[L]=ot[F]=ot[U]=ot[B]=!0,ot[v]=ot[_]=ot[I]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,ut=parseInt,ct="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,lt="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||lt||Function("return this")(),ft=t&&!t.nodeType&&t,ht=ft&&e&&!e.nodeType&&e,pt=ht&&ht.exports===ft,gt=pt&&ct.process,mt=function(){try{return ht&&ht.require&&ht.require("util").types||gt&>.binding&>.binding("util")}catch(e){}}(),bt=mt&&mt.isArrayBuffer,yt=mt&&mt.isDate,vt=mt&&mt.isMap,_t=mt&&mt.isRegExp,wt=mt&&mt.isSet,xt=mt&&mt.isTypedArray;function Tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function St(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function Ot(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Et(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Pt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function At(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function Ct(e,t){return!(null==e||!e.length)&&Ft(e,t,0)>-1}function It(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Rt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Mt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function kt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Dt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function jt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var $t=zt("length");function Nt(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Lt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ft(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Lt(e,Bt,n)}function Ut(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Bt(e){return e!=e}function Vt(e,t){var n=null==e?0:e.length;return n?Ht(e,t)/n:f}function zt(e){return function(t){return null==t?i:t[e]}}function Wt(e){return function(t){return null==e?i:e[t]}}function Gt(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Ht(e,t){for(var n,r=-1,o=e.length;++r<o;){var s=t(e[r]);s!==i&&(n=n===i?s:n+s)}return n}function qt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Kt(e){return e?e.slice(0,fn(e)+1).replace(re,""):e}function Yt(e){return function(t){return e(t)}}function Xt(e,t){return Rt(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function Zt(e,t){for(var n=-1,r=e.length;++n<r&&Ft(t,e[n],0)>-1;);return n}function Qt(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}var en=Wt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(e){return"\\"+st[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];s!==t&&s!==a||(e[n]=a,o[i++]=n)}return o}function un(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function ln(e){return rn(e)?function(e){for(var t=Ze.lastIndex=0;Ze.test(e);)++t;return t}(e):$t(e)}function dn(e){return rn(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.split("")}(e)}function fn(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var hn=Wt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pn=function e(t){var n,r=(t=null==t?dt:pn.defaults(dt.Object(),t,pn.pick(dt,nt))).Array,ie=t.Date,we=t.Error,xe=t.Function,Te=t.Math,Se=t.Object,Oe=t.RegExp,Ee=t.String,Pe=t.TypeError,Ae=r.prototype,Ce=xe.prototype,Ie=Se.prototype,Re=t["__core-js_shared__"],Me=Ce.toString,ke=Ie.hasOwnProperty,De=0,je=(n=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",$e=Ie.toString,Ne=Me.call(Se),Le=dt._,Fe=Oe("^"+Me.call(ke).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=pt?t.Buffer:i,Be=t.Symbol,Ve=t.Uint8Array,ze=Ue?Ue.allocUnsafe:i,We=sn(Se.getPrototypeOf,Se),Ge=Se.create,He=Ie.propertyIsEnumerable,qe=Ae.splice,Ke=Be?Be.isConcatSpreadable:i,Ye=Be?Be.iterator:i,Ze=Be?Be.toStringTag:i,et=function(){try{var e=uo(Se,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==dt.Date.now&&ie.now,lt=t.setTimeout!==dt.setTimeout&&t.setTimeout,ft=Te.ceil,ht=Te.floor,gt=Se.getOwnPropertySymbols,mt=Ue?Ue.isBuffer:i,$t=t.isFinite,Wt=Ae.join,gn=sn(Se.keys,Se),mn=Te.max,bn=Te.min,yn=ie.now,vn=t.parseInt,_n=Te.random,wn=Ae.reverse,xn=uo(t,"DataView"),Tn=uo(t,"Map"),Sn=uo(t,"Promise"),On=uo(t,"Set"),En=uo(t,"WeakMap"),Pn=uo(Se,"create"),An=En&&new En,Cn={},In=No(xn),Rn=No(Tn),Mn=No(Sn),kn=No(On),Dn=No(En),jn=Be?Be.prototype:i,$n=jn?jn.valueOf:i,Nn=jn?jn.toString:i;function Ln(e){if(ea(e)&&!zs(e)&&!(e instanceof Vn)){if(e instanceof Bn)return e;if(ke.call(e,"__wrapped__"))return Lo(e)}return new Bn(e)}var Fn=function(){function e(){}return function(t){if(!Qs(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Un(){}function Bn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Vn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Gn;++t<n;)this.add(e[t])}function qn(e){var t=this.__data__=new Wn(e);this.size=t.size}function Kn(e,t){var n=zs(e),r=!n&&Vs(e),i=!n&&!r&&qs(e),o=!n&&!r&&!i&&ua(e),s=n||r||i||o,a=s?qt(e.length,Ee):[],u=a.length;for(var c in e)!t&&!ke.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mo(c,u))||a.push(c);return a}function Yn(e){var t=e.length;return t?e[Gr(0,t-1)]:i}function Xn(e,t){return Mo(Ei(e),or(t,0,e.length))}function Jn(e){return Mo(Ei(e))}function Zn(e,t,n){(n!==i&&!Fs(e[t],n)||n===i&&!(t in e))&&rr(e,t,n)}function Qn(e,t,n){var r=e[t];ke.call(e,t)&&Fs(r,n)&&(n!==i||t in e)||rr(e,t,n)}function er(e,t){for(var n=e.length;n--;)if(Fs(e[n][0],t))return n;return-1}function tr(e,t,n,r){return lr(e,(function(e,i,o){t(r,e,n(e),o)})),r}function nr(e,t){return e&&Pi(t,Ia(t),e)}function rr(e,t,n){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ir(e,t){for(var n=-1,o=t.length,s=r(o),a=null==e;++n<o;)s[n]=a?i:Oa(e,t[n]);return s}function or(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function sr(e,t,n,r,o,s){var a,u=1&t,c=2&t,l=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!Qs(e))return e;var d=zs(e);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ke.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!u)return Ei(e,a)}else{var f=fo(e),h=f==_||f==w;if(qs(e))return _i(e,u);if(f==S||f==g||h&&!o){if(a=c||h?{}:po(e),!u)return c?function(e,t){return Pi(e,lo(e),t)}(e,function(e,t){return e&&Pi(t,Ra(t),e)}(a,e)):function(e,t){return Pi(e,co(e),t)}(e,nr(a,e))}else{if(!ot[f])return o?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case R:return wi(e);case b:case y:return new i(+e);case M:return function(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case k:case D:case j:case $:case N:case L:case F:case U:case B:return xi(e,n);case x:return new i;case T:case A:return new i(e);case E:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case P:return new i;case C:return r=e,$n?Se($n.call(r)):{}}}(e,f,u)}}s||(s=new qn);var p=s.get(e);if(p)return p;s.set(e,a),oa(e)?e.forEach((function(r){a.add(sr(r,t,n,r,e,s))})):ta(e)&&e.forEach((function(r,i){a.set(i,sr(r,t,n,i,e,s))}));var m=d?i:(l?c?to:eo:c?Ra:Ia)(e);return Ot(m||e,(function(r,i){m&&(r=e[i=r]),Qn(a,i,sr(r,t,n,i,e,s))})),a}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=Se(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function ur(e,t,n){if("function"!=typeof e)throw new Pe(o);return Ao((function(){e.apply(i,n)}),t)}function cr(e,t,n,r){var i=-1,o=Ct,s=!0,a=e.length,u=[],c=t.length;if(!a)return u;n&&(t=Rt(t,Yt(n))),r?(o=It,s=!1):t.length>=200&&(o=Jt,s=!1,t=new Hn(t));e:for(;++i<a;){var l=e[i],d=null==n?l:n(l);if(l=r||0!==l?l:0,s&&d==d){for(var f=c;f--;)if(t[f]===d)continue e;u.push(l)}else o(t,d,r)||u.push(l)}return u}Ln.templateSettings={escape:Y,evaluate:X,interpolate:J,variable:"",imports:{_:Ln}},Ln.prototype=Un.prototype,Ln.prototype.constructor=Ln,Bn.prototype=Fn(Un.prototype),Bn.prototype.constructor=Bn,Vn.prototype=Fn(Un.prototype),Vn.prototype.constructor=Vn,zn.prototype.clear=function(){this.__data__=Pn?Pn(null):{},this.size=0},zn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},zn.prototype.get=function(e){var t=this.__data__;if(Pn){var n=t[e];return n===s?i:n}return ke.call(t,e)?t[e]:i},zn.prototype.has=function(e){var t=this.__data__;return Pn?t[e]!==i:ke.call(t,e)},zn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Pn&&t===i?s:t,this},Wn.prototype.clear=function(){this.__data__=[],this.size=0},Wn.prototype.delete=function(e){var t=this.__data__,n=er(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},Wn.prototype.get=function(e){var t=this.__data__,n=er(t,e);return n<0?i:t[n][1]},Wn.prototype.has=function(e){return er(this.__data__,e)>-1},Wn.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new zn,map:new(Tn||Wn),string:new zn}},Gn.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return so(this,e).get(e)},Gn.prototype.has=function(e){return so(this,e).has(e)},Gn.prototype.set=function(e,t){var n=so(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Hn.prototype.add=Hn.prototype.push=function(e){return this.__data__.set(e,s),this},Hn.prototype.has=function(e){return this.__data__.has(e)},qn.prototype.clear=function(){this.__data__=new Wn,this.size=0},qn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},qn.prototype.get=function(e){return this.__data__.get(e)},qn.prototype.has=function(e){return this.__data__.has(e)},qn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!Tn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var lr=Ii(yr),dr=Ii(vr,!0);function fr(e,t){var n=!0;return lr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function hr(e,t,n){for(var r=-1,o=e.length;++r<o;){var s=e[r],a=t(s);if(null!=a&&(u===i?a==a&&!aa(a):n(a,u)))var u=a,c=s}return c}function pr(e,t){var n=[];return lr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function gr(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=go),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?gr(a,t-1,n,r,i):Mt(i,a):r||(i[i.length]=a)}return i}var mr=Ri(),br=Ri(!0);function yr(e,t){return e&&mr(e,t,Ia)}function vr(e,t){return e&&br(e,t,Ia)}function _r(e,t){return At(t,(function(t){return Xs(e[t])}))}function wr(e,t){for(var n=0,r=(t=mi(t,e)).length;null!=e&&n<r;)e=e[$o(t[n++])];return n&&n==r?e:i}function xr(e,t,n){var r=t(e);return zs(e)?r:Mt(r,n(e))}function Tr(e){return null==e?e===i?"[object Undefined]":"[object Null]":Ze&&Ze in Se(e)?function(e){var t=ke.call(e,Ze),n=e[Ze];try{e[Ze]=i;var r=!0}catch(e){}var o=$e.call(e);return r&&(t?e[Ze]=n:delete e[Ze]),o}(e):function(e){return $e.call(e)}(e)}function Sr(e,t){return e>t}function Or(e,t){return null!=e&&ke.call(e,t)}function Er(e,t){return null!=e&&t in Se(e)}function Pr(e,t,n){for(var o=n?It:Ct,s=e[0].length,a=e.length,u=a,c=r(a),l=1/0,d=[];u--;){var f=e[u];u&&t&&(f=Rt(f,Yt(t))),l=bn(f.length,l),c[u]=!n&&(t||s>=120&&f.length>=120)?new Hn(u&&f):i}f=e[0];var h=-1,p=c[0];e:for(;++h<s&&d.length<l;){var g=f[h],m=t?t(g):g;if(g=n||0!==g?g:0,!(p?Jt(p,m):o(d,m,n))){for(u=a;--u;){var b=c[u];if(!(b?Jt(b,m):o(e[u],m,n)))continue e}p&&p.push(m),d.push(g)}}return d}function Ar(e,t,n){var r=null==(e=Oo(e,t=mi(t,e)))?e:e[$o(Yo(t))];return null==r?i:Tt(r,e,n)}function Cr(e){return ea(e)&&Tr(e)==g}function Ir(e,t,n,r,o){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,n,r,o,s){var a=zs(e),u=zs(t),c=a?m:fo(e),l=u?m:fo(t),d=(c=c==g?S:c)==S,f=(l=l==g?S:l)==S,h=c==l;if(h&&qs(e)){if(!qs(t))return!1;a=!0,d=!1}if(h&&!d)return s||(s=new qn),a||ua(e)?Zi(e,t,n,r,o,s):function(e,t,n,r,i,o,s){switch(n){case M:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case R:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case b:case y:case T:return Fs(+e,+t);case v:return e.name==t.name&&e.message==t.message;case E:case A:return e==t+"";case x:var a=on;case P:var u=1&r;if(a||(a=un),e.size!=t.size&&!u)return!1;var c=s.get(e);if(c)return c==t;r|=2,s.set(e,t);var l=Zi(a(e),a(t),r,i,o,s);return s.delete(e),l;case C:if($n)return $n.call(e)==$n.call(t)}return!1}(e,t,c,n,r,o,s);if(!(1&n)){var p=d&&ke.call(e,"__wrapped__"),_=f&&ke.call(t,"__wrapped__");if(p||_){var w=p?e.value():e,O=_?t.value():t;return s||(s=new qn),o(w,O,n,r,s)}}return!!h&&(s||(s=new qn),function(e,t,n,r,o,s){var a=1&n,u=eo(e),c=u.length;if(c!=eo(t).length&&!a)return!1;for(var l=c;l--;){var d=u[l];if(!(a?d in t:ke.call(t,d)))return!1}var f=s.get(e),h=s.get(t);if(f&&h)return f==t&&h==e;var p=!0;s.set(e,t),s.set(t,e);for(var g=a;++l<c;){var m=e[d=u[l]],b=t[d];if(r)var y=a?r(b,m,d,t,e,s):r(m,b,d,e,t,s);if(!(y===i?m===b||o(m,b,n,r,s):y)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var v=e.constructor,_=t.constructor;v==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof _&&_ instanceof _||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,n,r,o,s))}(e,t,n,r,Ir,o))}function Rr(e,t,n,r){var o=n.length,s=o,a=!r;if(null==e)return!s;for(e=Se(e);o--;){var u=n[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<s;){var c=(u=n[o])[0],l=e[c],d=u[1];if(a&&u[2]){if(l===i&&!(c in e))return!1}else{var f=new qn;if(r)var h=r(l,d,c,e,t,f);if(!(h===i?Ir(d,l,3,r,f):h))return!1}}return!0}function Mr(e){return!(!Qs(e)||(t=e,je&&je in t))&&(Xs(e)?Fe:ge).test(No(e));var t}function kr(e){return"function"==typeof e?e:null==e?nu:"object"==typeof e?zs(e)?Lr(e[0],e[1]):Nr(e):du(e)}function Dr(e){if(!wo(e))return gn(e);var t=[];for(var n in Se(e))ke.call(e,n)&&"constructor"!=n&&t.push(n);return t}function jr(e,t){return e<t}function $r(e,t){var n=-1,i=Gs(e)?r(e.length):[];return lr(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Nr(e){var t=ao(e);return 1==t.length&&t[0][2]?To(t[0][0],t[0][1]):function(n){return n===e||Rr(n,e,t)}}function Lr(e,t){return yo(e)&&xo(t)?To($o(e),t):function(n){var r=Oa(n,e);return r===i&&r===t?Ea(n,e):Ir(t,r,3)}}function Fr(e,t,n,r,o){e!==t&&mr(t,(function(s,a){if(o||(o=new qn),Qs(s))!function(e,t,n,r,o,s,a){var u=Eo(e,n),c=Eo(t,n),l=a.get(c);if(l)Zn(e,n,l);else{var d=s?s(u,c,n+"",e,t,a):i,f=d===i;if(f){var h=zs(c),p=!h&&qs(c),g=!h&&!p&&ua(c);d=c,h||p||g?zs(u)?d=u:Hs(u)?d=Ei(u):p?(f=!1,d=_i(c,!0)):g?(f=!1,d=xi(c,!0)):d=[]:ra(c)||Vs(c)?(d=u,Vs(u)?d=ma(u):Qs(u)&&!Xs(u)||(d=po(c))):f=!1}f&&(a.set(c,d),o(d,c,r,s,a),a.delete(c)),Zn(e,n,d)}}(e,t,a,n,Fr,r,o);else{var u=r?r(Eo(e,a),s,a+"",e,t,o):i;u===i&&(u=s),Zn(e,a,u)}}),Ra)}function Ur(e,t){var n=e.length;if(n)return mo(t+=t<0?n:0,n)?e[t]:i}function Br(e,t,n){t=t.length?Rt(t,(function(e){return zs(e)?function(t){return wr(t,1===e.length?e[0]:e)}:e})):[nu];var r=-1;t=Rt(t,Yt(oo()));var i=$r(e,(function(e,n,i){var o=Rt(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return function(e,t){var r=e.length;for(e.sort((function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var u=Ti(i[r],o[r]);if(u)return r>=a?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}));r--;)e[r]=e[r].value;return e}(i)}function Vr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=wr(e,s);n(a,s)&&Xr(o,mi(s,e),a)}return o}function zr(e,t,n,r){var i=r?Ut:Ft,o=-1,s=t.length,a=e;for(e===t&&(t=Ei(t)),n&&(a=Rt(e,Yt(n)));++o<s;)for(var u=0,c=t[o],l=n?n(c):c;(u=i(a,l,u,r))>-1;)a!==e&&qe.call(a,u,1),qe.call(e,u,1);return e}function Wr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;mo(i)?qe.call(e,i,1):ui(e,i)}}return e}function Gr(e,t){return e+ht(_n()*(t-e+1))}function Hr(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=ht(t/2))&&(e+=e)}while(t);return n}function qr(e,t){return Co(So(e,t,nu),e+"")}function Kr(e){return Yn(Fa(e))}function Yr(e,t){var n=Fa(e);return Mo(n,or(t,0,n.length))}function Xr(e,t,n,r){if(!Qs(e))return e;for(var o=-1,s=(t=mi(t,e)).length,a=s-1,u=e;null!=u&&++o<s;){var c=$o(t[o]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var d=u[c];(l=r?r(d,c,u):i)===i&&(l=Qs(d)?d:mo(t[o+1])?[]:{})}Qn(u,c,l),u=u[c]}return e}var Jr=An?function(e,t){return An.set(e,t),e}:nu,Zr=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Qa(t),writable:!0})}:nu;function Qr(e){return Mo(Fa(e))}function ei(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=r(o);++i<o;)s[i]=e[i+t];return s}function ti(e,t){var n;return lr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function ni(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!aa(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return ri(e,t,nu,n)}function ri(e,t,n,r){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=n(t))!=t,u=null===t,c=aa(t),l=t===i;o<s;){var d=ht((o+s)/2),f=n(e[d]),h=f!==i,p=null===f,g=f==f,m=aa(f);if(a)var b=r||g;else b=l?g&&(r||h):u?g&&h&&(r||!p):c?g&&h&&!p&&(r||!m):!p&&!m&&(r?f<=t:f<t);b?o=d+1:s=d}return bn(s,4294967294)}function ii(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!Fs(a,u)){var u=a;o[i++]=0===s?0:s}}return o}function oi(e){return"number"==typeof e?e:aa(e)?f:+e}function si(e){if("string"==typeof e)return e;if(zs(e))return Rt(e,si)+"";if(aa(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,n){var r=-1,i=Ct,o=e.length,s=!0,a=[],u=a;if(n)s=!1,i=It;else if(o>=200){var c=t?null:Hi(e);if(c)return un(c);s=!1,i=Jt,u=new Hn}else u=t?[]:a;e:for(;++r<o;){var l=e[r],d=t?t(l):l;if(l=n||0!==l?l:0,s&&d==d){for(var f=u.length;f--;)if(u[f]===d)continue e;t&&u.push(d),a.push(l)}else i(u,d,n)||(u!==a&&u.push(d),a.push(l))}return a}function ui(e,t){return null==(e=Oo(e,t=mi(t,e)))||delete e[$o(Yo(t))]}function ci(e,t,n,r){return Xr(e,t,n(wr(e,t)),r)}function li(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?ei(e,r?0:o,r?o+1:i):ei(e,r?o+1:0,r?i:o)}function di(e,t){var n=e;return n instanceof Vn&&(n=n.value()),kt(t,(function(e,t){return t.func.apply(t.thisArg,Mt([e],t.args))}),n)}function fi(e,t,n){var i=e.length;if(i<2)return i?ai(e[0]):[];for(var o=-1,s=r(i);++o<i;)for(var a=e[o],u=-1;++u<i;)u!=o&&(s[o]=cr(s[o]||a,e[u],t,n));return ai(gr(s,1),t,n)}function hi(e,t,n){for(var r=-1,o=e.length,s=t.length,a={};++r<o;){var u=r<s?t[r]:i;n(a,e[r],u)}return a}function pi(e){return Hs(e)?e:[]}function gi(e){return"function"==typeof e?e:nu}function mi(e,t){return zs(e)?e:yo(e,t)?[e]:jo(ba(e))}var bi=qr;function yi(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:ei(e,t,n)}var vi=st||function(e){return dt.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var n=e.length,r=ze?ze(n):new e.constructor(n);return e.copy(r),r}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function xi(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ti(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,s=aa(e),a=t!==i,u=null===t,c=t==t,l=aa(t);if(!u&&!l&&!s&&e>t||s&&a&&c&&!u&&!l||r&&a&&c||!n&&c||!o)return 1;if(!r&&!s&&!l&&e<t||l&&n&&o&&!r&&!s||u&&n&&o||!a&&o||!c)return-1}return 0}function Si(e,t,n,i){for(var o=-1,s=e.length,a=n.length,u=-1,c=t.length,l=mn(s-a,0),d=r(c+l),f=!i;++u<c;)d[u]=t[u];for(;++o<a;)(f||o<s)&&(d[n[o]]=e[o]);for(;l--;)d[u++]=e[o++];return d}function Oi(e,t,n,i){for(var o=-1,s=e.length,a=-1,u=n.length,c=-1,l=t.length,d=mn(s-u,0),f=r(d+l),h=!i;++o<d;)f[o]=e[o];for(var p=o;++c<l;)f[p+c]=t[c];for(;++a<u;)(h||o<s)&&(f[p+n[a]]=e[o++]);return f}function Ei(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function Pi(e,t,n,r){var o=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var u=t[s],c=r?r(n[u],e[u],u,n,e):i;c===i&&(c=e[u]),o?rr(n,u,c):Qn(n,u,c)}return n}function Ai(e,t){return function(n,r){var i=zs(n)?St:tr,o=t?t():{};return i(n,e,oo(r,2),o)}}function Ci(e){return qr((function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&bo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Se(t);++r<o;){var u=n[r];u&&e(t,u,r,s)}return t}))}function Ii(e,t){return function(n,r){if(null==n)return n;if(!Gs(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Se(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function Ri(e){return function(t,n,r){for(var i=-1,o=Se(t),s=r(t),a=s.length;a--;){var u=s[e?a:++i];if(!1===n(o[u],u,o))break}return t}}function Mi(e){return function(t){var n=rn(t=ba(t))?dn(t):i,r=n?n[0]:t.charAt(0),o=n?yi(n,1).join(""):t.slice(1);return r[e]()+o}}function ki(e){return function(t){return kt(Xa(Va(t).replace(Xe,"")),e,"")}}function Di(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Fn(e.prototype),r=e.apply(n,t);return Qs(r)?r:n}}function ji(e){return function(t,n,r){var o=Se(t);if(!Gs(t)){var s=oo(n,3);t=Ia(t),n=function(e){return s(o[e],e,o)}}var a=e(t,n,r);return a>-1?o[s?t[a]:a]:i}}function $i(e){return Qi((function(t){var n=t.length,r=n,s=Bn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new Pe(o);if(s&&!u&&"wrapper"==ro(a))var u=new Bn([],!0)}for(r=u?r:n;++r<n;){var c=ro(a=t[r]),l="wrapper"==c?no(a):i;u=l&&vo(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[ro(l[0])].apply(u,l[3]):1==a.length&&vo(a)?u[c]():u.thru(a)}return function(){var e=arguments,r=e[0];if(u&&1==e.length&&zs(r))return u.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Ni(e,t,n,o,s,a,u,l,d,f){var h=t&c,p=1&t,g=2&t,m=24&t,b=512&t,y=g?i:Di(e);return function c(){for(var v=arguments.length,_=r(v),w=v;w--;)_[w]=arguments[w];if(m)var x=io(c),T=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(_,x);if(o&&(_=Si(_,o,s,m)),a&&(_=Oi(_,a,u,m)),v-=T,m&&v<f){var S=an(_,x);return Wi(e,t,Ni,c.placeholder,n,_,S,l,d,f-v)}var O=p?n:this,E=g?O[e]:e;return v=_.length,l?_=function(e,t){for(var n=e.length,r=bn(t.length,n),o=Ei(e);r--;){var s=t[r];e[r]=mo(s,n)?o[s]:i}return e}(_,l):b&&v>1&&_.reverse(),h&&d<v&&(_.length=d),this&&this!==dt&&this instanceof c&&(E=y||Di(E)),E.apply(O,_)}}function Li(e,t){return function(n,r){return function(e,t,n,r){return yr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Fi(e,t){return function(n,r){var o;if(n===i&&r===i)return t;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=si(n),r=si(r)):(n=oi(n),r=oi(r)),o=e(n,r)}return o}}function Ui(e){return Qi((function(t){return t=Rt(t,Yt(oo())),qr((function(n){var r=this;return e(t,(function(e){return Tt(e,r,n)}))}))}))}function Bi(e,t){var n=(t=t===i?" ":si(t)).length;if(n<2)return n?Hr(t,e):t;var r=Hr(t,ft(e/ln(t)));return rn(t)?yi(dn(r),0,e).join(""):r.slice(0,e)}function Vi(e){return function(t,n,o){return o&&"number"!=typeof o&&bo(t,n,o)&&(n=o=i),t=fa(t),n===i?(n=t,t=0):n=fa(n),function(e,t,n,i){for(var o=-1,s=mn(ft((t-e)/(n||1)),0),a=r(s);s--;)a[i?s:++o]=e,e+=n;return a}(t,n,o=o===i?t<n?1:-1:fa(o),e)}}function zi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ga(t),n=ga(n)),e(t,n)}}function Wi(e,t,n,r,o,s,a,c,l,d){var f=8&t;t|=f?u:64,4&(t&=~(f?64:u))||(t&=-4);var h=[e,t,o,f?s:i,f?a:i,f?i:s,f?i:a,c,l,d],p=n.apply(i,h);return vo(e)&&Po(p,h),p.placeholder=r,Io(p,e,t)}function Gi(e){var t=Te[e];return function(e,n){if(e=ga(e),(n=null==n?0:bn(ha(n),292))&&$t(e)){var r=(ba(e)+"e").split("e");return+((r=(ba(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Hi=On&&1/un(new On([,-0]))[1]==l?function(e){return new On(e)}:au;function qi(e){return function(t){var n=fo(t);return n==x?on(t):n==P?cn(t):function(e,t){return Rt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Ki(e,t,n,s,l,d,f,h){var p=2&t;if(!p&&"function"!=typeof e)throw new Pe(o);var g=s?s.length:0;if(g||(t&=-97,s=l=i),f=f===i?f:mn(ha(f),0),h=h===i?h:ha(h),g-=l?l.length:0,64&t){var m=s,b=l;s=l=i}var y=p?i:no(e),v=[e,t,n,s,l,m,b,d,f,h];if(y&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,s=r==c&&8==n||r==c&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!s)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var u=t[3];if(u){var l=e[3];e[3]=l?Si(l,u,t[4]):u,e[4]=l?an(e[3],a):t[4]}(u=t[5])&&(l=e[5],e[5]=l?Oi(l,u,t[6]):u,e[6]=l?an(e[5],a):t[6]),(u=t[7])&&(e[7]=u),r&c&&(e[8]=null==e[8]?t[8]:bn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(v,y),e=v[0],t=v[1],n=v[2],s=v[3],l=v[4],!(h=v[9]=v[9]===i?p?0:e.length:mn(v[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(e,t,n){var o=Di(e);return function s(){for(var a=arguments.length,u=r(a),c=a,l=io(s);c--;)u[c]=arguments[c];var d=a<3&&u[0]!==l&&u[a-1]!==l?[]:an(u,l);return(a-=d.length)<n?Wi(e,t,Ni,s.placeholder,i,u,d,i,i,n-a):Tt(this&&this!==dt&&this instanceof s?o:e,this,u)}}(e,t,h):t!=u&&33!=t||l.length?Ni.apply(i,v):function(e,t,n,i){var o=1&t,s=Di(e);return function t(){for(var a=-1,u=arguments.length,c=-1,l=i.length,d=r(l+u),f=this&&this!==dt&&this instanceof t?s:e;++c<l;)d[c]=i[c];for(;u--;)d[c++]=arguments[++a];return Tt(f,o?n:this,d)}}(e,t,n,s);else var _=function(e,t,n){var r=1&t,i=Di(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return Io((y?Jr:Po)(_,v),e,t)}function Yi(e,t,n,r){return e===i||Fs(e,Ie[n])&&!ke.call(r,n)?t:e}function Xi(e,t,n,r,o,s){return Qs(e)&&Qs(t)&&(s.set(t,e),Fr(e,t,i,Xi,s),s.delete(t)),e}function Ji(e){return ra(e)?i:e}function Zi(e,t,n,r,o,s){var a=1&n,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var l=s.get(e),d=s.get(t);if(l&&d)return l==t&&d==e;var f=-1,h=!0,p=2&n?new Hn:i;for(s.set(e,t),s.set(t,e);++f<u;){var g=e[f],m=t[f];if(r)var b=a?r(m,g,f,t,e,s):r(g,m,f,e,t,s);if(b!==i){if(b)continue;h=!1;break}if(p){if(!jt(t,(function(e,t){if(!Jt(p,t)&&(g===e||o(g,e,n,r,s)))return p.push(t)}))){h=!1;break}}else if(g!==m&&!o(g,m,n,r,s)){h=!1;break}}return s.delete(e),s.delete(t),h}function Qi(e){return Co(So(e,i,Wo),e+"")}function eo(e){return xr(e,Ia,co)}function to(e){return xr(e,Ra,lo)}var no=An?function(e){return An.get(e)}:au;function ro(e){for(var t=e.name+"",n=Cn[t],r=ke.call(Cn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(ke.call(Ln,"placeholder")?Ln:e).placeholder}function oo(){var e=Ln.iteratee||ru;return e=e===ru?kr:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Ia(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,xo(i)]}return t}function uo(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return Mr(n)?n:i}var co=gt?function(e){return null==e?[]:(e=Se(e),At(gt(e),(function(t){return He.call(e,t)})))}:pu,lo=gt?function(e){for(var t=[];e;)Mt(t,co(e)),e=We(e);return t}:pu,fo=Tr;function ho(e,t,n){for(var r=-1,i=(t=mi(t,e)).length,o=!1;++r<i;){var s=$o(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Zs(i)&&mo(s,i)&&(zs(e)||Vs(e))}function po(e){return"function"!=typeof e.constructor||wo(e)?{}:Fn(We(e))}function go(e){return zs(e)||Vs(e)||!!(Ke&&e&&e[Ke])}function mo(e,t){var n=typeof e;return!!(t=null==t?d:t)&&("number"==n||"symbol"!=n&&be.test(e))&&e>-1&&e%1==0&&e<t}function bo(e,t,n){if(!Qs(n))return!1;var r=typeof t;return!!("number"==r?Gs(n)&&mo(t,n.length):"string"==r&&t in n)&&Fs(n[t],e)}function yo(e,t){if(zs(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!aa(e))||Q.test(e)||!Z.test(e)||null!=t&&e in Se(t)}function vo(e){var t=ro(e),n=Ln[t];if("function"!=typeof n||!(t in Vn.prototype))return!1;if(e===n)return!0;var r=no(n);return!!r&&e===r[0]}(xn&&fo(new xn(new ArrayBuffer(1)))!=M||Tn&&fo(new Tn)!=x||Sn&&fo(Sn.resolve())!=O||On&&fo(new On)!=P||En&&fo(new En)!=I)&&(fo=function(e){var t=Tr(e),n=t==S?e.constructor:i,r=n?No(n):"";if(r)switch(r){case In:return M;case Rn:return x;case Mn:return O;case kn:return P;case Dn:return I}return t});var _o=Re?Xs:gu;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ie)}function xo(e){return e==e&&!Qs(e)}function To(e,t){return function(n){return null!=n&&n[e]===t&&(t!==i||e in Se(n))}}function So(e,t,n){return t=mn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=mn(i.length-t,0),a=r(s);++o<s;)a[o]=i[t+o];o=-1;for(var u=r(t+1);++o<t;)u[o]=i[o];return u[t]=n(a),Tt(e,this,u)}}function Oo(e,t){return t.length<2?e:wr(e,ei(t,0,-1))}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Po=Ro(Jr),Ao=lt||function(e,t){return dt.setTimeout(e,t)},Co=Ro(Zr);function Io(e,t,n){var r=t+"";return Co(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Ot(p,(function(n){var r="_."+n[0];t&n[1]&&!Ct(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(r),n)))}function Ro(e){var t=0,n=0;return function(){var r=yn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Mo(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n<t;){var s=Gr(n,o),a=e[s];e[s]=e[n],e[n]=a}return e.length=t,e}var ko,Do,jo=(ko=ks((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,n,r,i){t.push(r?i.replace(le,"$1"):n||e)})),t}),(function(e){return 500===Do.size&&Do.clear(),e})),Do=ko.cache,ko);function $o(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function No(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Lo(e){if(e instanceof Vn)return e.clone();var t=new Bn(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Fo=qr((function(e,t){return Hs(e)?cr(e,gr(t,1,Hs,!0)):[]})),Uo=qr((function(e,t){var n=Yo(t);return Hs(n)&&(n=i),Hs(e)?cr(e,gr(t,1,Hs,!0),oo(n,2)):[]})),Bo=qr((function(e,t){var n=Yo(t);return Hs(n)&&(n=i),Hs(e)?cr(e,gr(t,1,Hs,!0),i,n):[]}));function Vo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ha(n);return i<0&&(i=mn(r+i,0)),Lt(e,oo(t,3),i)}function zo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return n!==i&&(o=ha(n),o=n<0?mn(r+o,0):bn(o,r-1)),Lt(e,oo(t,3),o,!0)}function Wo(e){return null!=e&&e.length?gr(e,1):[]}function Go(e){return e&&e.length?e[0]:i}var Ho=qr((function(e){var t=Rt(e,pi);return t.length&&t[0]===e[0]?Pr(t):[]})),qo=qr((function(e){var t=Yo(e),n=Rt(e,pi);return t===Yo(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Pr(n,oo(t,2)):[]})),Ko=qr((function(e){var t=Yo(e),n=Rt(e,pi);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?Pr(n,i,t):[]}));function Yo(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Xo=qr(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?zr(e,t):e}var Zo=Qi((function(e,t){var n=null==e?0:e.length,r=ir(e,t);return Wr(e,Rt(t,(function(e){return mo(e,n)?+e:e})).sort(Ti)),r}));function Qo(e){return null==e?e:wn.call(e)}var es=qr((function(e){return ai(gr(e,1,Hs,!0))})),ts=qr((function(e){var t=Yo(e);return Hs(t)&&(t=i),ai(gr(e,1,Hs,!0),oo(t,2))})),ns=qr((function(e){var t=Yo(e);return t="function"==typeof t?t:i,ai(gr(e,1,Hs,!0),i,t)}));function rs(e){if(!e||!e.length)return[];var t=0;return e=At(e,(function(e){if(Hs(e))return t=mn(e.length,t),!0})),qt(t,(function(t){return Rt(e,zt(t))}))}function is(e,t){if(!e||!e.length)return[];var n=rs(e);return null==t?n:Rt(n,(function(e){return Tt(t,i,e)}))}var os=qr((function(e,t){return Hs(e)?cr(e,t):[]})),ss=qr((function(e){return fi(At(e,Hs))})),as=qr((function(e){var t=Yo(e);return Hs(t)&&(t=i),fi(At(e,Hs),oo(t,2))})),us=qr((function(e){var t=Yo(e);return t="function"==typeof t?t:i,fi(At(e,Hs),i,t)})),cs=qr(rs),ls=qr((function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,is(e,n)}));function ds(e){var t=Ln(e);return t.__chain__=!0,t}function fs(e,t){return t(e)}var hs=Qi((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ir(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Vn&&mo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fs,args:[o],thisArg:i}),new Bn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ps=Ai((function(e,t,n){ke.call(e,n)?++e[n]:rr(e,n,1)})),gs=ji(Vo),ms=ji(zo);function bs(e,t){return(zs(e)?Ot:lr)(e,oo(t,3))}function ys(e,t){return(zs(e)?Et:dr)(e,oo(t,3))}var vs=Ai((function(e,t,n){ke.call(e,n)?e[n].push(t):rr(e,n,[t])})),_s=qr((function(e,t,n){var i=-1,o="function"==typeof t,s=Gs(e)?r(e.length):[];return lr(e,(function(e){s[++i]=o?Tt(t,e,n):Ar(e,t,n)})),s})),ws=Ai((function(e,t,n){rr(e,n,t)}));function xs(e,t){return(zs(e)?Rt:$r)(e,oo(t,3))}var Ts=Ai((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),Ss=qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&bo(e,t[0],t[1])?t=[]:n>2&&bo(t[0],t[1],t[2])&&(t=[t[0]]),Br(e,gr(t,1),[])})),Os=ct||function(){return dt.Date.now()};function Es(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Ki(e,c,i,i,i,i,t)}function Ps(e,t){var n;if("function"!=typeof t)throw new Pe(o);return e=ha(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var As=qr((function(e,t,n){var r=1;if(n.length){var i=an(n,io(As));r|=u}return Ki(e,r,t,n,i)})),Cs=qr((function(e,t,n){var r=3;if(n.length){var i=an(n,io(Cs));r|=u}return Ki(t,r,e,n,i)}));function Is(e,t,n){var r,s,a,u,c,l,d=0,f=!1,h=!1,p=!0;if("function"!=typeof e)throw new Pe(o);function g(t){var n=r,o=s;return r=s=i,d=t,u=e.apply(o,n)}function m(e){var n=e-l;return l===i||n>=t||n<0||h&&e-d>=a}function b(){var e=Os();if(m(e))return y(e);c=Ao(b,function(e){var n=t-(e-l);return h?bn(n,a-(e-d)):n}(e))}function y(e){return c=i,p&&r?g(e):(r=s=i,u)}function v(){var e=Os(),n=m(e);if(r=arguments,s=this,l=e,n){if(c===i)return function(e){return d=e,c=Ao(b,t),f?g(e):u}(l);if(h)return vi(c),c=Ao(b,t),g(l)}return c===i&&(c=Ao(b,t)),u}return t=ga(t)||0,Qs(n)&&(f=!!n.leading,a=(h="maxWait"in n)?mn(ga(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),v.cancel=function(){c!==i&&vi(c),d=0,r=l=s=c=i},v.flush=function(){return c===i?u:y(Os())},v}var Rs=qr((function(e,t){return ur(e,1,t)})),Ms=qr((function(e,t,n){return ur(e,ga(t)||0,n)}));function ks(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Pe(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(ks.Cache||Gn),n}function Ds(e){if("function"!=typeof e)throw new Pe(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ks.Cache=Gn;var js=bi((function(e,t){var n=(t=1==t.length&&zs(t[0])?Rt(t[0],Yt(oo())):Rt(gr(t,1),Yt(oo()))).length;return qr((function(r){for(var i=-1,o=bn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Tt(e,this,r)}))})),$s=qr((function(e,t){var n=an(t,io($s));return Ki(e,u,i,t,n)})),Ns=qr((function(e,t){var n=an(t,io(Ns));return Ki(e,64,i,t,n)})),Ls=Qi((function(e,t){return Ki(e,256,i,i,i,t)}));function Fs(e,t){return e===t||e!=e&&t!=t}var Us=zi(Sr),Bs=zi((function(e,t){return e>=t})),Vs=Cr(function(){return arguments}())?Cr:function(e){return ea(e)&&ke.call(e,"callee")&&!He.call(e,"callee")},zs=r.isArray,Ws=bt?Yt(bt):function(e){return ea(e)&&Tr(e)==R};function Gs(e){return null!=e&&Zs(e.length)&&!Xs(e)}function Hs(e){return ea(e)&&Gs(e)}var qs=mt||gu,Ks=yt?Yt(yt):function(e){return ea(e)&&Tr(e)==y};function Ys(e){if(!ea(e))return!1;var t=Tr(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function Xs(e){if(!Qs(e))return!1;var t=Tr(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==ha(e)}function Zs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function Qs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=vt?Yt(vt):function(e){return ea(e)&&fo(e)==x};function na(e){return"number"==typeof e||ea(e)&&Tr(e)==T}function ra(e){if(!ea(e)||Tr(e)!=S)return!1;var t=We(e);if(null===t)return!0;var n=ke.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Me.call(n)==Ne}var ia=_t?Yt(_t):function(e){return ea(e)&&Tr(e)==E},oa=wt?Yt(wt):function(e){return ea(e)&&fo(e)==P};function sa(e){return"string"==typeof e||!zs(e)&&ea(e)&&Tr(e)==A}function aa(e){return"symbol"==typeof e||ea(e)&&Tr(e)==C}var ua=xt?Yt(xt):function(e){return ea(e)&&Zs(e.length)&&!!it[Tr(e)]},ca=zi(jr),la=zi((function(e,t){return e<=t}));function da(e){if(!e)return[];if(Gs(e))return sa(e)?dn(e):Ei(e);if(Ye&&e[Ye])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ye]());var t=fo(e);return(t==x?on:t==P?un:Fa)(e)}function fa(e){return e?(e=ga(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ha(e){var t=fa(e),n=t%1;return t==t?n?t-n:t:0}function pa(e){return e?or(ha(e),0,h):0}function ga(e){if("number"==typeof e)return e;if(aa(e))return f;if(Qs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var n=pe.test(e);return n||me.test(e)?ut(e.slice(2),n?2:8):he.test(e)?f:+e}function ma(e){return Pi(e,Ra(e))}function ba(e){return null==e?"":si(e)}var ya=Ci((function(e,t){if(wo(t)||Gs(t))Pi(t,Ia(t),e);else for(var n in t)ke.call(t,n)&&Qn(e,n,t[n])})),va=Ci((function(e,t){Pi(t,Ra(t),e)})),_a=Ci((function(e,t,n,r){Pi(t,Ra(t),e,r)})),wa=Ci((function(e,t,n,r){Pi(t,Ia(t),e,r)})),xa=Qi(ir),Ta=qr((function(e,t){e=Se(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&bo(t[0],t[1],o)&&(r=1);++n<r;)for(var s=t[n],a=Ra(s),u=-1,c=a.length;++u<c;){var l=a[u],d=e[l];(d===i||Fs(d,Ie[l])&&!ke.call(e,l))&&(e[l]=s[l])}return e})),Sa=qr((function(e){return e.push(i,Xi),Tt(ka,i,e)}));function Oa(e,t,n){var r=null==e?i:wr(e,t);return r===i?n:r}function Ea(e,t){return null!=e&&ho(e,t,Er)}var Pa=Li((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=$e.call(t)),e[t]=n}),Qa(nu)),Aa=Li((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=$e.call(t)),ke.call(e,t)?e[t].push(n):e[t]=[n]}),oo),Ca=qr(Ar);function Ia(e){return Gs(e)?Kn(e):Dr(e)}function Ra(e){return Gs(e)?Kn(e,!0):function(e){if(!Qs(e))return function(e){var t=[];if(null!=e)for(var n in Se(e))t.push(n);return t}(e);var t=wo(e),n=[];for(var r in e)("constructor"!=r||!t&&ke.call(e,r))&&n.push(r);return n}(e)}var Ma=Ci((function(e,t,n){Fr(e,t,n)})),ka=Ci((function(e,t,n,r){Fr(e,t,n,r)})),Da=Qi((function(e,t){var n={};if(null==e)return n;var r=!1;t=Rt(t,(function(t){return t=mi(t,e),r||(r=t.length>1),t})),Pi(e,to(e),n),r&&(n=sr(n,7,Ji));for(var i=t.length;i--;)ui(n,t[i]);return n})),ja=Qi((function(e,t){return null==e?{}:function(e,t){return Vr(e,t,(function(t,n){return Ea(e,n)}))}(e,t)}));function $a(e,t){if(null==e)return{};var n=Rt(to(e),(function(e){return[e]}));return t=oo(t),Vr(e,n,(function(e,n){return t(e,n[0])}))}var Na=qi(Ia),La=qi(Ra);function Fa(e){return null==e?[]:Xt(e,Ia(e))}var Ua=ki((function(e,t,n){return t=t.toLowerCase(),e+(n?Ba(t):t)}));function Ba(e){return Ya(ba(e).toLowerCase())}function Va(e){return(e=ba(e))&&e.replace(ye,en).replace(Je,"")}var za=ki((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Wa=ki((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ga=Mi("toLowerCase"),Ha=ki((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),qa=ki((function(e,t,n){return e+(n?" ":"")+Ya(t)})),Ka=ki((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ya=Mi("toUpperCase");function Xa(e,t,n){return e=ba(e),(t=n?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var Ja=qr((function(e,t){try{return Tt(e,i,t)}catch(e){return Ys(e)?e:new we(e)}})),Za=Qi((function(e,t){return Ot(t,(function(t){t=$o(t),rr(e,t,As(e[t],e))})),e}));function Qa(e){return function(){return e}}var eu=$i(),tu=$i(!0);function nu(e){return e}function ru(e){return kr("function"==typeof e?e:sr(e,1))}var iu=qr((function(e,t){return function(n){return Ar(n,e,t)}})),ou=qr((function(e,t){return function(n){return Ar(e,n,t)}}));function su(e,t,n){var r=Ia(t),i=_r(t,r);null!=n||Qs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=_r(t,Ia(t)));var o=!(Qs(n)&&"chain"in n&&!n.chain),s=Xs(e);return Ot(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Ei(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Mt([this.value()],arguments))})})),e}function au(){}var uu=Ui(Rt),cu=Ui(Pt),lu=Ui(jt);function du(e){return yo(e)?zt($o(e)):function(e){return function(t){return wr(t,e)}}(e)}var fu=Vi(),hu=Vi(!0);function pu(){return[]}function gu(){return!1}var mu,bu=Fi((function(e,t){return e+t}),0),yu=Gi("ceil"),vu=Fi((function(e,t){return e/t}),1),_u=Gi("floor"),wu=Fi((function(e,t){return e*t}),1),xu=Gi("round"),Tu=Fi((function(e,t){return e-t}),0);return Ln.after=function(e,t){if("function"!=typeof t)throw new Pe(o);return e=ha(e),function(){if(--e<1)return t.apply(this,arguments)}},Ln.ary=Es,Ln.assign=ya,Ln.assignIn=va,Ln.assignInWith=_a,Ln.assignWith=wa,Ln.at=xa,Ln.before=Ps,Ln.bind=As,Ln.bindAll=Za,Ln.bindKey=Cs,Ln.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return zs(e)?e:[e]},Ln.chain=ds,Ln.chunk=function(e,t,n){t=(n?bo(e,t,n):t===i)?1:mn(ha(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,u=r(ft(o/t));s<o;)u[a++]=ei(e,s,s+=t);return u},Ln.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Ln.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Mt(zs(n)?Ei(n):[n],gr(t,1))},Ln.cond=function(e){var t=null==e?0:e.length,n=oo();return e=t?Rt(e,(function(e){if("function"!=typeof e[1])throw new Pe(o);return[n(e[0]),e[1]]})):[],qr((function(n){for(var r=-1;++r<t;){var i=e[r];if(Tt(i[0],this,n))return Tt(i[1],this,n)}}))},Ln.conforms=function(e){return function(e){var t=Ia(e);return function(n){return ar(n,e,t)}}(sr(e,1))},Ln.constant=Qa,Ln.countBy=ps,Ln.create=function(e,t){var n=Fn(e);return null==t?n:nr(n,t)},Ln.curry=function e(t,n,r){var o=Ki(t,8,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Ln.curryRight=function e(t,n,r){var o=Ki(t,16,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Ln.debounce=Is,Ln.defaults=Ta,Ln.defaultsDeep=Sa,Ln.defer=Rs,Ln.delay=Ms,Ln.difference=Fo,Ln.differenceBy=Uo,Ln.differenceWith=Bo,Ln.drop=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=n||t===i?1:ha(t))<0?0:t,r):[]},Ln.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,0,(t=r-(t=n||t===i?1:ha(t)))<0?0:t):[]},Ln.dropRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0,!0):[]},Ln.dropWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!0):[]},Ln.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&bo(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=ha(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:ha(r))<0&&(r+=o),r=n>r?0:pa(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Ln.filter=function(e,t){return(zs(e)?At:pr)(e,oo(t,3))},Ln.flatMap=function(e,t){return gr(xs(e,t),1)},Ln.flatMapDeep=function(e,t){return gr(xs(e,t),l)},Ln.flatMapDepth=function(e,t,n){return n=n===i?1:ha(n),gr(xs(e,t),n)},Ln.flatten=Wo,Ln.flattenDeep=function(e){return null!=e&&e.length?gr(e,l):[]},Ln.flattenDepth=function(e,t){return null!=e&&e.length?gr(e,t=t===i?1:ha(t)):[]},Ln.flip=function(e){return Ki(e,512)},Ln.flow=eu,Ln.flowRight=tu,Ln.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Ln.functions=function(e){return null==e?[]:_r(e,Ia(e))},Ln.functionsIn=function(e){return null==e?[]:_r(e,Ra(e))},Ln.groupBy=vs,Ln.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Ln.intersection=Ho,Ln.intersectionBy=qo,Ln.intersectionWith=Ko,Ln.invert=Pa,Ln.invertBy=Aa,Ln.invokeMap=_s,Ln.iteratee=ru,Ln.keyBy=ws,Ln.keys=Ia,Ln.keysIn=Ra,Ln.map=xs,Ln.mapKeys=function(e,t){var n={};return t=oo(t,3),yr(e,(function(e,r,i){rr(n,t(e,r,i),e)})),n},Ln.mapValues=function(e,t){var n={};return t=oo(t,3),yr(e,(function(e,r,i){rr(n,r,t(e,r,i))})),n},Ln.matches=function(e){return Nr(sr(e,1))},Ln.matchesProperty=function(e,t){return Lr(e,sr(t,1))},Ln.memoize=ks,Ln.merge=Ma,Ln.mergeWith=ka,Ln.method=iu,Ln.methodOf=ou,Ln.mixin=su,Ln.negate=Ds,Ln.nthArg=function(e){return e=ha(e),qr((function(t){return Ur(t,e)}))},Ln.omit=Da,Ln.omitBy=function(e,t){return $a(e,Ds(oo(t)))},Ln.once=function(e){return Ps(2,e)},Ln.orderBy=function(e,t,n,r){return null==e?[]:(zs(t)||(t=null==t?[]:[t]),zs(n=r?i:n)||(n=null==n?[]:[n]),Br(e,t,n))},Ln.over=uu,Ln.overArgs=js,Ln.overEvery=cu,Ln.overSome=lu,Ln.partial=$s,Ln.partialRight=Ns,Ln.partition=Ts,Ln.pick=ja,Ln.pickBy=$a,Ln.property=du,Ln.propertyOf=function(e){return function(t){return null==e?i:wr(e,t)}},Ln.pull=Xo,Ln.pullAll=Jo,Ln.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?zr(e,t,oo(n,2)):e},Ln.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?zr(e,t,i,n):e},Ln.pullAt=Zo,Ln.range=fu,Ln.rangeRight=hu,Ln.rearg=Ls,Ln.reject=function(e,t){return(zs(e)?At:pr)(e,Ds(oo(t,3)))},Ln.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=oo(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return Wr(e,i),n},Ln.rest=function(e,t){if("function"!=typeof e)throw new Pe(o);return qr(e,t=t===i?t:ha(t))},Ln.reverse=Qo,Ln.sampleSize=function(e,t,n){return t=(n?bo(e,t,n):t===i)?1:ha(t),(zs(e)?Xn:Yr)(e,t)},Ln.set=function(e,t,n){return null==e?e:Xr(e,t,n)},Ln.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:Xr(e,t,n,r)},Ln.shuffle=function(e){return(zs(e)?Jn:Qr)(e)},Ln.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&bo(e,t,n)?(t=0,n=r):(t=null==t?0:ha(t),n=n===i?r:ha(n)),ei(e,t,n)):[]},Ln.sortBy=Ss,Ln.sortedUniq=function(e){return e&&e.length?ii(e):[]},Ln.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Ln.split=function(e,t,n){return n&&"number"!=typeof n&&bo(e,t,n)&&(t=n=i),(n=n===i?h:n>>>0)?(e=ba(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&rn(e)?yi(dn(e),0,n):e.split(t,n):[]},Ln.spread=function(e,t){if("function"!=typeof e)throw new Pe(o);return t=null==t?0:mn(ha(t),0),qr((function(n){var r=n[t],i=yi(n,0,t);return r&&Mt(i,r),Tt(e,this,i)}))},Ln.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Ln.take=function(e,t,n){return e&&e.length?ei(e,0,(t=n||t===i?1:ha(t))<0?0:t):[]},Ln.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=r-(t=n||t===i?1:ha(t)))<0?0:t,r):[]},Ln.takeRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!1,!0):[]},Ln.takeWhile=function(e,t){return e&&e.length?li(e,oo(t,3)):[]},Ln.tap=function(e,t){return t(e),e},Ln.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Pe(o);return Qs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Is(e,t,{leading:r,maxWait:t,trailing:i})},Ln.thru=fs,Ln.toArray=da,Ln.toPairs=Na,Ln.toPairsIn=La,Ln.toPath=function(e){return zs(e)?Rt(e,$o):aa(e)?[e]:Ei(jo(ba(e)))},Ln.toPlainObject=ma,Ln.transform=function(e,t,n){var r=zs(e),i=r||qs(e)||ua(e);if(t=oo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Qs(e)&&Xs(o)?Fn(We(e)):{}}return(i?Ot:yr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Ln.unary=function(e){return Es(e,1)},Ln.union=es,Ln.unionBy=ts,Ln.unionWith=ns,Ln.uniq=function(e){return e&&e.length?ai(e):[]},Ln.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Ln.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Ln.unset=function(e,t){return null==e||ui(e,t)},Ln.unzip=rs,Ln.unzipWith=is,Ln.update=function(e,t,n){return null==e?e:ci(e,t,gi(n))},Ln.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ci(e,t,gi(n),r)},Ln.values=Fa,Ln.valuesIn=function(e){return null==e?[]:Xt(e,Ra(e))},Ln.without=os,Ln.words=Xa,Ln.wrap=function(e,t){return $s(gi(t),e)},Ln.xor=ss,Ln.xorBy=as,Ln.xorWith=us,Ln.zip=cs,Ln.zipObject=function(e,t){return hi(e||[],t||[],Qn)},Ln.zipObjectDeep=function(e,t){return hi(e||[],t||[],Xr)},Ln.zipWith=ls,Ln.entries=Na,Ln.entriesIn=La,Ln.extend=va,Ln.extendWith=_a,su(Ln,Ln),Ln.add=bu,Ln.attempt=Ja,Ln.camelCase=Ua,Ln.capitalize=Ba,Ln.ceil=yu,Ln.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ga(n))==n?n:0),t!==i&&(t=(t=ga(t))==t?t:0),or(ga(e),t,n)},Ln.clone=function(e){return sr(e,4)},Ln.cloneDeep=function(e){return sr(e,5)},Ln.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:i)},Ln.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:i)},Ln.conformsTo=function(e,t){return null==t||ar(e,t,Ia(t))},Ln.deburr=Va,Ln.defaultTo=function(e,t){return null==e||e!=e?t:e},Ln.divide=vu,Ln.endsWith=function(e,t,n){e=ba(e),t=si(t);var r=e.length,o=n=n===i?r:or(ha(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Ln.eq=Fs,Ln.escape=function(e){return(e=ba(e))&&K.test(e)?e.replace(H,tn):e},Ln.escapeRegExp=function(e){return(e=ba(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Ln.every=function(e,t,n){var r=zs(e)?Pt:fr;return n&&bo(e,t,n)&&(t=i),r(e,oo(t,3))},Ln.find=gs,Ln.findIndex=Vo,Ln.findKey=function(e,t){return Nt(e,oo(t,3),yr)},Ln.findLast=ms,Ln.findLastIndex=zo,Ln.findLastKey=function(e,t){return Nt(e,oo(t,3),vr)},Ln.floor=_u,Ln.forEach=bs,Ln.forEachRight=ys,Ln.forIn=function(e,t){return null==e?e:mr(e,oo(t,3),Ra)},Ln.forInRight=function(e,t){return null==e?e:br(e,oo(t,3),Ra)},Ln.forOwn=function(e,t){return e&&yr(e,oo(t,3))},Ln.forOwnRight=function(e,t){return e&&vr(e,oo(t,3))},Ln.get=Oa,Ln.gt=Us,Ln.gte=Bs,Ln.has=function(e,t){return null!=e&&ho(e,t,Or)},Ln.hasIn=Ea,Ln.head=Go,Ln.identity=nu,Ln.includes=function(e,t,n,r){e=Gs(e)?e:Fa(e),n=n&&!r?ha(n):0;var i=e.length;return n<0&&(n=mn(i+n,0)),sa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},Ln.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ha(n);return i<0&&(i=mn(r+i,0)),Ft(e,t,i)},Ln.inRange=function(e,t,n){return t=fa(t),n===i?(n=t,t=0):n=fa(n),function(e,t,n){return e>=bn(t,n)&&e<mn(t,n)}(e=ga(e),t,n)},Ln.invoke=Ca,Ln.isArguments=Vs,Ln.isArray=zs,Ln.isArrayBuffer=Ws,Ln.isArrayLike=Gs,Ln.isArrayLikeObject=Hs,Ln.isBoolean=function(e){return!0===e||!1===e||ea(e)&&Tr(e)==b},Ln.isBuffer=qs,Ln.isDate=Ks,Ln.isElement=function(e){return ea(e)&&1===e.nodeType&&!ra(e)},Ln.isEmpty=function(e){if(null==e)return!0;if(Gs(e)&&(zs(e)||"string"==typeof e||"function"==typeof e.splice||qs(e)||ua(e)||Vs(e)))return!e.length;var t=fo(e);if(t==x||t==P)return!e.size;if(wo(e))return!Dr(e).length;for(var n in e)if(ke.call(e,n))return!1;return!0},Ln.isEqual=function(e,t){return Ir(e,t)},Ln.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?Ir(e,t,i,n):!!r},Ln.isError=Ys,Ln.isFinite=function(e){return"number"==typeof e&&$t(e)},Ln.isFunction=Xs,Ln.isInteger=Js,Ln.isLength=Zs,Ln.isMap=ta,Ln.isMatch=function(e,t){return e===t||Rr(e,t,ao(t))},Ln.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,Rr(e,t,ao(t),n)},Ln.isNaN=function(e){return na(e)&&e!=+e},Ln.isNative=function(e){if(_o(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mr(e)},Ln.isNil=function(e){return null==e},Ln.isNull=function(e){return null===e},Ln.isNumber=na,Ln.isObject=Qs,Ln.isObjectLike=ea,Ln.isPlainObject=ra,Ln.isRegExp=ia,Ln.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=d},Ln.isSet=oa,Ln.isString=sa,Ln.isSymbol=aa,Ln.isTypedArray=ua,Ln.isUndefined=function(e){return e===i},Ln.isWeakMap=function(e){return ea(e)&&fo(e)==I},Ln.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==Tr(e)},Ln.join=function(e,t){return null==e?"":Wt.call(e,t)},Ln.kebabCase=za,Ln.last=Yo,Ln.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=ha(n))<0?mn(r+o,0):bn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Lt(e,Bt,o,!0)},Ln.lowerCase=Wa,Ln.lowerFirst=Ga,Ln.lt=ca,Ln.lte=la,Ln.max=function(e){return e&&e.length?hr(e,nu,Sr):i},Ln.maxBy=function(e,t){return e&&e.length?hr(e,oo(t,2),Sr):i},Ln.mean=function(e){return Vt(e,nu)},Ln.meanBy=function(e,t){return Vt(e,oo(t,2))},Ln.min=function(e){return e&&e.length?hr(e,nu,jr):i},Ln.minBy=function(e,t){return e&&e.length?hr(e,oo(t,2),jr):i},Ln.stubArray=pu,Ln.stubFalse=gu,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=wu,Ln.nth=function(e,t){return e&&e.length?Ur(e,ha(t)):i},Ln.noConflict=function(){return dt._===this&&(dt._=Le),this},Ln.noop=au,Ln.now=Os,Ln.pad=function(e,t,n){e=ba(e);var r=(t=ha(t))?ln(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Bi(ht(i),n)+e+Bi(ft(i),n)},Ln.padEnd=function(e,t,n){e=ba(e);var r=(t=ha(t))?ln(e):0;return t&&r<t?e+Bi(t-r,n):e},Ln.padStart=function(e,t,n){e=ba(e);var r=(t=ha(t))?ln(e):0;return t&&r<t?Bi(t-r,n)+e:e},Ln.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),vn(ba(e).replace(re,""),t||0)},Ln.random=function(e,t,n){if(n&&"boolean"!=typeof n&&bo(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=fa(e),t===i?(t=e,e=0):t=fa(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=_n();return bn(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Gr(e,t)},Ln.reduce=function(e,t,n){var r=zs(e)?kt:Gt,i=arguments.length<3;return r(e,oo(t,4),n,i,lr)},Ln.reduceRight=function(e,t,n){var r=zs(e)?Dt:Gt,i=arguments.length<3;return r(e,oo(t,4),n,i,dr)},Ln.repeat=function(e,t,n){return t=(n?bo(e,t,n):t===i)?1:ha(t),Hr(ba(e),t)},Ln.replace=function(){var e=arguments,t=ba(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ln.result=function(e,t,n){var r=-1,o=(t=mi(t,e)).length;for(o||(o=1,e=i);++r<o;){var s=null==e?i:e[$o(t[r])];s===i&&(r=o,s=n),e=Xs(s)?s.call(e):s}return e},Ln.round=xu,Ln.runInContext=e,Ln.sample=function(e){return(zs(e)?Yn:Kr)(e)},Ln.size=function(e){if(null==e)return 0;if(Gs(e))return sa(e)?ln(e):e.length;var t=fo(e);return t==x||t==P?e.size:Dr(e).length},Ln.snakeCase=Ha,Ln.some=function(e,t,n){var r=zs(e)?jt:ti;return n&&bo(e,t,n)&&(t=i),r(e,oo(t,3))},Ln.sortedIndex=function(e,t){return ni(e,t)},Ln.sortedIndexBy=function(e,t,n){return ri(e,t,oo(n,2))},Ln.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ni(e,t);if(r<n&&Fs(e[r],t))return r}return-1},Ln.sortedLastIndex=function(e,t){return ni(e,t,!0)},Ln.sortedLastIndexBy=function(e,t,n){return ri(e,t,oo(n,2),!0)},Ln.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ni(e,t,!0)-1;if(Fs(e[n],t))return n}return-1},Ln.startCase=qa,Ln.startsWith=function(e,t,n){return e=ba(e),n=null==n?0:or(ha(n),0,e.length),t=si(t),e.slice(n,n+t.length)==t},Ln.subtract=Tu,Ln.sum=function(e){return e&&e.length?Ht(e,nu):0},Ln.sumBy=function(e,t){return e&&e.length?Ht(e,oo(t,2)):0},Ln.template=function(e,t,n){var r=Ln.templateSettings;n&&bo(e,t,n)&&(t=i),e=ba(e),t=_a({},t,r,Yi);var o,s,a=_a({},t.imports,r.imports,Yi),u=Ia(a),c=Xt(a,u),l=0,d=t.interpolate||ve,f="__p += '",h=Oe((t.escape||ve).source+"|"+d.source+"|"+(d===J?de:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),p="//# sourceURL="+(ke.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(h,(function(t,n,r,i,a,u){return r||(r=i),f+=e.slice(l,u).replace(_e,nn),n&&(o=!0,f+="' +\n__e("+n+") +\n'"),a&&(s=!0,f+="';\n"+a+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+t.length,t})),f+="';\n";var g=ke.call(t,"variable")&&t.variable;if(g){if(ce.test(g))throw new we("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(s?f.replace(V,""):f).replace(z,"$1").replace(W,"$1;"),f="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var m=Ja((function(){return xe(u,p+"return "+f).apply(i,c)}));if(m.source=f,Ys(m))throw m;return m},Ln.times=function(e,t){if((e=ha(e))<1||e>d)return[];var n=h,r=bn(e,h);t=oo(t),e-=h;for(var i=qt(r,t);++n<e;)t(n);return i},Ln.toFinite=fa,Ln.toInteger=ha,Ln.toLength=pa,Ln.toLower=function(e){return ba(e).toLowerCase()},Ln.toNumber=ga,Ln.toSafeInteger=function(e){return e?or(ha(e),-9007199254740991,d):0===e?e:0},Ln.toString=ba,Ln.toUpper=function(e){return ba(e).toUpperCase()},Ln.trim=function(e,t,n){if((e=ba(e))&&(n||t===i))return Kt(e);if(!e||!(t=si(t)))return e;var r=dn(e),o=dn(t);return yi(r,Zt(r,o),Qt(r,o)+1).join("")},Ln.trimEnd=function(e,t,n){if((e=ba(e))&&(n||t===i))return e.slice(0,fn(e)+1);if(!e||!(t=si(t)))return e;var r=dn(e);return yi(r,0,Qt(r,dn(t))+1).join("")},Ln.trimStart=function(e,t,n){if((e=ba(e))&&(n||t===i))return e.replace(re,"");if(!e||!(t=si(t)))return e;var r=dn(e);return yi(r,Zt(r,dn(t))).join("")},Ln.truncate=function(e,t){var n=30,r="...";if(Qs(t)){var o="separator"in t?t.separator:o;n="length"in t?ha(t.length):n,r="omission"in t?si(t.omission):r}var s=(e=ba(e)).length;if(rn(e)){var a=dn(e);s=a.length}if(n>=s)return e;var u=n-ln(r);if(u<1)return r;var c=a?yi(a,0,u).join(""):e.slice(0,u);if(o===i)return c+r;if(a&&(u+=c.length-u),ia(o)){if(e.slice(u).search(o)){var l,d=c;for(o.global||(o=Oe(o.source,ba(fe.exec(o))+"g")),o.lastIndex=0;l=o.exec(d);)var f=l.index;c=c.slice(0,f===i?u:f)}}else if(e.indexOf(si(o),u)!=u){var h=c.lastIndexOf(o);h>-1&&(c=c.slice(0,h))}return c+r},Ln.unescape=function(e){return(e=ba(e))&&q.test(e)?e.replace(G,hn):e},Ln.uniqueId=function(e){var t=++De;return ba(e)+t},Ln.upperCase=Ka,Ln.upperFirst=Ya,Ln.each=bs,Ln.eachRight=ys,Ln.first=Go,su(Ln,(mu={},yr(Ln,(function(e,t){ke.call(Ln.prototype,t)||(mu[t]=e)})),mu),{chain:!1}),Ln.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Ln[e].placeholder=Ln})),Ot(["drop","take"],(function(e,t){Vn.prototype[e]=function(n){n=n===i?1:mn(ha(n),0);var r=this.__filtered__&&!t?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=bn(n,r.__takeCount__):r.__views__.push({size:bn(n,h),type:e+(r.__dir__<0?"Right":"")}),r},Vn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Vn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Ot(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Vn.prototype[e]=function(){return this[n](1).value()[0]}})),Ot(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Vn.prototype[e]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(nu)},Vn.prototype.find=function(e){return this.filter(e).head()},Vn.prototype.findLast=function(e){return this.reverse().find(e)},Vn.prototype.invokeMap=qr((function(e,t){return"function"==typeof e?new Vn(this):this.map((function(n){return Ar(n,e,t)}))})),Vn.prototype.reject=function(e){return this.filter(Ds(oo(e)))},Vn.prototype.slice=function(e,t){e=ha(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=ha(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vn.prototype.toArray=function(){return this.take(h)},yr(Vn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Ln[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(Ln.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,u=t instanceof Vn,c=a[0],l=u||zs(t),d=function(e){var t=o.apply(Ln,Mt([e],a));return r&&f?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var f=this.__chain__,h=!!this.__actions__.length,p=s&&!f,g=u&&!h;if(!s&&l){t=g?t:new Vn(this);var m=e.apply(t,a);return m.__actions__.push({func:fs,args:[d],thisArg:i}),new Bn(m,f)}return p&&g?e.apply(this,a):(m=this.thru(d),p?r?m.value()[0]:m.value():m)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ae[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Ln.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(zs(i)?i:[],e)}return this[n]((function(n){return t.apply(zs(n)?n:[],e)}))}})),yr(Vn.prototype,(function(e,t){var n=Ln[t];if(n){var r=n.name+"";ke.call(Cn,r)||(Cn[r]=[]),Cn[r].push({name:t,func:n})}})),Cn[Ni(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var e=new Vn(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Vn.prototype.reverse=function(){if(this.__filtered__){var e=new Vn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=zs(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=bn(t,e+s);break;case"takeRight":e=mn(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,u=a-s,c=r?a:s-1,l=this.__iteratees__,d=l.length,f=0,h=bn(u,this.__takeCount__);if(!n||!r&&i==u&&h==u)return di(e,this.__actions__);var p=[];e:for(;u--&&f<h;){for(var g=-1,m=e[c+=t];++g<d;){var b=l[g],y=b.iteratee,v=b.type,_=y(m);if(2==v)m=_;else if(!_){if(1==v)continue e;break e}}p[f++]=m}return p},Ln.prototype.at=hs,Ln.prototype.chain=function(){return ds(this)},Ln.prototype.commit=function(){return new Bn(this.value(),this.__chain__)},Ln.prototype.next=function(){this.__values__===i&&(this.__values__=da(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Ln.prototype.plant=function(e){for(var t,n=this;n instanceof Un;){var r=Lo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Ln.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vn){var t=e;return this.__actions__.length&&(t=new Vn(this)),(t=t.reverse()).__actions__.push({func:fs,args:[Qo],thisArg:i}),new Bn(t,this.__chain__)}return this.thru(Qo)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return di(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,Ye&&(Ln.prototype[Ye]=function(){return this}),Ln}();dt._=pn,(r=function(){return pn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},7824:e=>{var t=1e3,n=60*t,r=60*n,i=24*r;function o(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,s){s=s||{};var a,u,c=typeof e;if("string"===c&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===c&&isFinite(e))return s.long?(a=e,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=r?o(a,u,r,"hour"):u>=n?o(a,u,n,"minute"):u>=t?o(a,u,t,"second"):a+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=r?Math.round(e/r)+"h":o>=n?Math.round(e/n)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},9793:(module,__unused_webpack_exports,__webpack_require__)=>{var process=__webpack_require__(4155),t;self,t=()=>(()=>{var __webpack_modules__={8453:(e,t,n)=>{"use strict";n.r(t),n.d(t,{InferenceSession:()=>h,Tensor:()=>d,env:()=>s,registerBackend:()=>o});const r={},i=[],o=(e,t,n)=>{if(!t||"function"!=typeof t.init||"function"!=typeof t.createSessionHandler)throw new TypeError("not a valid backend");{const o=r[e];if(void 0===o)r[e]={backend:t,priority:n};else{if(o.priority>n)return;if(o.priority===n&&o.backend!==t)throw new Error(`cannot register backend "${e}" using priority ${n}`)}if(n>=0){const t=i.indexOf(e);-1!==t&&i.splice(t,1);for(let t=0;t<i.length;t++)if(r[i[t]].priority<=n)return void i.splice(t,0,e);i.push(e)}}},s=new class{constructor(){this.wasm={},this.webgl={},this.webgpu={},this.logLevelInternal="warning"}set logLevel(e){if(void 0!==e){if("string"!=typeof e||-1===["verbose","info","warning","error","fatal"].indexOf(e))throw new Error(`Unsupported logging level: ${e}`);this.logLevelInternal=e}}get logLevel(){return this.logLevelInternal}},a=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),u=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);let c=!1;class l{constructor(e,t,n){let r,i,o;if((()=>{if(!c){c=!0;const e="undefined"!=typeof BigInt64Array&&"function"==typeof BigInt64Array.from,t="undefined"!=typeof BigUint64Array&&"function"==typeof BigUint64Array.from;e&&(a.set("int64",BigInt64Array),u.set(BigInt64Array,"int64")),t&&(a.set("uint64",BigUint64Array),u.set(BigUint64Array,"uint64"))}})(),"string"==typeof e)if(r=e,o=n,"string"===e){if(!Array.isArray(t))throw new TypeError("A string tensor's data must be a string array.");i=t}else{const n=a.get(e);if(void 0===n)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t))i=n.from(t);else{if(!(t instanceof n))throw new TypeError(`A ${r} tensor's data must be type of ${n}`);i=t}}else if(o=t,Array.isArray(e)){if(0===e.length)throw new TypeError("Tensor type cannot be inferred from an empty array.");const t=typeof e[0];if("string"===t)r="string",i=e;else{if("boolean"!==t)throw new TypeError(`Invalid element type of data array: ${t}.`);r="bool",i=Uint8Array.from(e)}}else{const t=u.get(e.constructor);if(void 0===t)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,i=e}if(void 0===o)o=[i.length];else if(!Array.isArray(o))throw new TypeError("A tensor's dims must be a number array");const s=(e=>{let t=1;for(let n=0;n<e.length;n++){const r=e[n];if("number"!=typeof r||!Number.isSafeInteger(r))throw new TypeError(`dims[${n}] must be an integer, got: ${r}`);if(r<0)throw new RangeError(`dims[${n}] must be a non-negative integer, got: ${r}`);t*=r}return t})(o);if(s!==i.length)throw new Error(`Tensor's size(${s}) does not match data length(${i.length}).`);this.dims=o,this.type=r,this.data=i,this.size=s}static bufferToTensor(e,t){if(void 0===e)throw new Error("Image buffer must be defined");if(void 0===t.height||void 0===t.width)throw new Error("Image height and width must be defined");if("NHWC"===t.tensorLayout)throw new Error("NHWC Tensor layout is not supported yet");const{height:n,width:r}=t,i=t.norm??{mean:255,bias:0};let o,s;o="number"==typeof i.mean?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],s="number"==typeof i.bias?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];const a=void 0!==t.bitmapFormat?t.bitmapFormat:"RGBA",u=void 0!==t.tensorFormat&&void 0!==t.tensorFormat?t.tensorFormat:"RGB",c=n*r,d="RGBA"===u?new Float32Array(4*c):new Float32Array(3*c);let f=4,h=0,p=1,g=2,m=3,b=0,y=c,v=2*c,_=-1;"RGB"===a&&(f=3,h=0,p=1,g=2,m=-1),"RGBA"===u?_=3*c:"RBG"===u?(b=0,v=c,y=2*c):"BGR"===u&&(v=0,y=c,b=2*c);for(let t=0;t<c;t++,h+=f,g+=f,p+=f,m+=f)d[b++]=(e[h]+s[0])/o[0],d[y++]=(e[p]+s[1])/o[1],d[v++]=(e[g]+s[2])/o[2],-1!==_&&-1!==m&&(d[_++]=(e[m]+s[3])/o[3]);return new l("float32",d,"RGBA"===u?[1,4,n,r]:[1,3,n,r])}static async fromImage(e,t){const n="undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement,r="undefined"!=typeof ImageData&&e instanceof ImageData,i="undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap,o="string"==typeof e;let s,a=t??{};if(n){const n=document.createElement("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");if(null==r)throw new Error("Can not access image data");{let n=e.height,i=e.width;if(void 0!==t&&void 0!==t.resizedHeight&&void 0!==t.resizedWidth&&(n=t.resizedHeight,i=t.resizedWidth),void 0!==t){if(a=t,void 0!==t.tensorFormat)throw new Error("Image input config format must be RGBA for HTMLImageElement");if(a.tensorFormat="RGBA",void 0!==t.height&&t.height!==n)throw new Error("Image input config height doesn't match HTMLImageElement height");if(a.height=n,void 0!==t.width&&t.width!==i)throw new Error("Image input config width doesn't match HTMLImageElement width");a.width=i}else a.tensorFormat="RGBA",a.height=n,a.width=i;r.drawImage(e,0,0),s=r.getImageData(0,0,i,n).data}}else{if(!r){if(i){if(void 0===t)throw new Error("Please provide image config with format for Imagebitmap");if(void 0!==t.bitmapFormat)throw new Error("Image input config format must be defined for ImageBitmap");const n=document.createElement("canvas").getContext("2d");if(null!=n){const r=e.height,i=e.width;if(n.drawImage(e,0,0,i,r),s=n.getImageData(0,0,i,r).data,void 0!==t){if(void 0!==t.height&&t.height!==r)throw new Error("Image input config height doesn't match ImageBitmap height");if(a.height=r,void 0!==t.width&&t.width!==i)throw new Error("Image input config width doesn't match ImageBitmap width");a.width=i}else a.height=r,a.width=i;return l.bufferToTensor(s,a)}throw new Error("Can not access image data")}if(o)return new Promise(((n,r)=>{const i=document.createElement("canvas"),o=i.getContext("2d");if(!e||!o)return r();const s=new Image;s.crossOrigin="Anonymous",s.src=e,s.onload=()=>{i.width=s.width,i.height=s.height,o.drawImage(s,0,0,i.width,i.height);const e=o.getImageData(0,0,i.width,i.height);if(void 0!==t){if(void 0!==t.height&&t.height!==i.height)throw new Error("Image input config height doesn't match height");if(a.height=i.height,void 0!==t.width&&t.width!==i.width)throw new Error("Image input config width doesn't match width");a.width=i.width}else a.height=i.height,a.width=i.width;n(l.bufferToTensor(e.data,a))}}));throw new Error("Input data provided is not supported - aborted tensor creation")}{const n="RGBA";let r,i;if(void 0!==t&&void 0!==t.resizedWidth&&void 0!==t.resizedHeight?(r=t.resizedHeight,i=t.resizedWidth):(r=e.height,i=e.width),void 0!==t){if(a=t,void 0!==t.bitmapFormat&&t.bitmapFormat!==n)throw new Error("Image input config format must be RGBA for ImageData");a.bitmapFormat="RGBA"}else a.bitmapFormat="RGBA";if(a.height=r,a.width=i,void 0!==t){const t=document.createElement("canvas");t.width=i,t.height=r;const n=t.getContext("2d");if(null==n)throw new Error("Can not access image data");n.putImageData(e,0,0),s=n.getImageData(0,0,i,r).data}else s=e.data}}if(void 0!==s)return l.bufferToTensor(s,a);throw new Error("Input data provided is not supported - aborted tensor creation")}toDataURL(e){const t=document.createElement("canvas");t.width=this.dims[3],t.height=this.dims[2];const n=t.getContext("2d");if(null!=n){let r,i;void 0!==e?.tensorLayout&&"NHWC"===e.tensorLayout?(r=this.dims[2],i=this.dims[3]):(r=this.dims[3],i=this.dims[2]);const o=void 0!==e?.format?e.format:"RGB",s=e?.norm;let a,u;void 0===s||void 0===s.mean?a=[255,255,255,255]:"number"==typeof s.mean?a=[s.mean,s.mean,s.mean,s.mean]:(a=[s.mean[0],s.mean[1],s.mean[2],0],void 0!==s.mean[3]&&(a[3]=s.mean[3])),void 0===s||void 0===s.bias?u=[0,0,0,0]:"number"==typeof s.bias?u=[s.bias,s.bias,s.bias,s.bias]:(u=[s.bias[0],s.bias[1],s.bias[2],0],void 0!==s.bias[3]&&(u[3]=s.bias[3]));const c=i*r;let l=0,d=c,f=2*c,h=-1;"RGBA"===o?(l=0,d=c,f=2*c,h=3*c):"RGB"===o?(l=0,d=c,f=2*c):"RBG"===o&&(l=0,f=c,d=2*c);for(let e=0;e<i;e++)for(let t=0;t<r;t++){const r=(this.data[l++]-u[0])*a[0],i=(this.data[d++]-u[1])*a[1],o=(this.data[f++]-u[2])*a[2],s=-1===h?255:(this.data[h++]-u[3])*a[3];n.fillStyle="rgba("+r+","+i+","+o+","+s+")",n.fillRect(t,e,1,1)}return t.toDataURL()}throw new Error("Can not access image data")}toImageData(e){const t=document.createElement("canvas").getContext("2d");let n;if(null==t)throw new Error("Can not access image data");{let r,i,o;void 0!==e?.tensorLayout&&"NHWC"===e.tensorLayout?(r=this.dims[2],i=this.dims[1],o=this.dims[3]):(r=this.dims[3],i=this.dims[2],o=this.dims[1]);const s=void 0!==e&&void 0!==e.format?e.format:"RGB",a=e?.norm;let u,c;void 0===a||void 0===a.mean?u=[255,255,255,255]:"number"==typeof a.mean?u=[a.mean,a.mean,a.mean,a.mean]:(u=[a.mean[0],a.mean[1],a.mean[2],255],void 0!==a.mean[3]&&(u[3]=a.mean[3])),void 0===a||void 0===a.bias?c=[0,0,0,0]:"number"==typeof a.bias?c=[a.bias,a.bias,a.bias,a.bias]:(c=[a.bias[0],a.bias[1],a.bias[2],0],void 0!==a.bias[3]&&(c[3]=a.bias[3]));const l=i*r;if(void 0!==e){if(void 0!==e.height&&e.height!==i)throw new Error("Image output config height doesn't match tensor height");if(void 0!==e.width&&e.width!==r)throw new Error("Image output config width doesn't match tensor width");if(void 0!==e.format&&4===o&&"RGBA"!==e.format||3===o&&"RGB"!==e.format&&"BGR"!==e.format)throw new Error("Tensor format doesn't match input tensor dims")}const d=4;let f=0,h=1,p=2,g=3,m=0,b=l,y=2*l,v=-1;"RGBA"===s?(m=0,b=l,y=2*l,v=3*l):"RGB"===s?(m=0,b=l,y=2*l):"RBG"===s&&(m=0,y=l,b=2*l),n=t.createImageData(r,i);for(let e=0;e<i*r;f+=d,h+=d,p+=d,g+=d,e++)n.data[f]=(this.data[m++]-c[0])*u[0],n.data[h]=(this.data[b++]-c[1])*u[1],n.data[p]=(this.data[y++]-c[2])*u[2],n.data[g]=-1===v?255:(this.data[v++]-c[3])*u[3]}return n}reshape(e){return new l(this.type,this.data,e)}}const d=l;class f{constructor(e){this.handler=e}async run(e,t,n){const r={};let i={};if("object"!=typeof e||null===e||e instanceof d||Array.isArray(e))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let o=!0;if("object"==typeof t){if(null===t)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof d)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(0===t.length)throw new TypeError("'fetches' cannot be an empty array.");o=!1;for(const e of t){if("string"!=typeof e)throw new TypeError("'fetches' must be a string array or an object.");if(-1===this.outputNames.indexOf(e))throw new RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if("object"==typeof n&&null!==n)i=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else{let e=!1;const s=Object.getOwnPropertyNames(t);for(const n of this.outputNames)if(-1!==s.indexOf(n)){const i=t[n];(null===i||i instanceof d)&&(e=!0,o=!1,r[n]=i)}if(e){if("object"==typeof n&&null!==n)i=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else i=t}}else if(void 0!==t)throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const t of this.inputNames)if(void 0===e[t])throw new Error(`input '${t}' is missing in 'feeds'.`);if(o)for(const e of this.outputNames)r[e]=null;const s=await this.handler.run(e,r,i),a={};for(const e in s)Object.hasOwnProperty.call(s,e)&&(a[e]=new d(s[e].type,s[e].data,s[e].dims));return a}static async create(e,t,n,o){let s,a={};if("string"==typeof e){if(s=e,"object"==typeof t&&null!==t)a=t;else if(void 0!==t)throw new TypeError("'options' must be an object.")}else if(e instanceof Uint8Array){if(s=e,"object"==typeof t&&null!==t)a=t;else if(void 0!==t)throw new TypeError("'options' must be an object.")}else{if(!(e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer))throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");{const r=e;let i=0,u=e.byteLength;if("object"==typeof t&&null!==t)a=t;else if("number"==typeof t){if(i=t,!Number.isSafeInteger(i))throw new RangeError("'byteOffset' must be an integer.");if(i<0||i>=r.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${r.byteLength}).`);if(u=e.byteLength-i,"number"==typeof n){if(u=n,!Number.isSafeInteger(u))throw new RangeError("'byteLength' must be an integer.");if(u<=0||i+u>r.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${r.byteLength-i}].`);if("object"==typeof o&&null!==o)a=o;else if(void 0!==o)throw new TypeError("'options' must be an object.")}else if(void 0!==n)throw new TypeError("'byteLength' must be a number.")}else if(void 0!==t)throw new TypeError("'options' must be an object.");s=new Uint8Array(r,i,u)}}const u=(a.executionProviders||[]).map((e=>"string"==typeof e?e:e.name)),c=await(async e=>{const t=0===e.length?i:e,n=[];for(const e of t){const t=r[e];if(t){if(t.initialized)return t.backend;if(t.aborted)continue;const r=!!t.initPromise;try{return r||(t.initPromise=t.backend.init()),await t.initPromise,t.initialized=!0,t.backend}catch(i){r||n.push({name:e,err:i}),t.aborted=!0}finally{delete t.initPromise}}}throw new Error(`no available backend found. ERR: ${n.map((e=>`[${e.name}] ${e.err}`)).join(", ")}`)})(u),l=await c.createSessionHandler(s,a);return new f(l)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}const h=f},5716:(e,t,n)=>{"use strict";t.R=void 0;const r=n(6027),i=n(1723);t.R=new class{async init(){}async createSessionHandler(e,t){const n=new r.Session(t);return await n.loadModel(e),new i.OnnxjsSessionHandler(n)}}},2818:(e,t,n)=>{"use strict";t.c8=t.rX=void 0;const r=n(8453),i=n(5381),o=n(9544),s=n(6640);t.rX=()=>{if(("number"!=typeof r.env.wasm.initTimeout||r.env.wasm.initTimeout<0)&&(r.env.wasm.initTimeout=0),"boolean"!=typeof r.env.wasm.simd&&(r.env.wasm.simd=!0),"boolean"!=typeof r.env.wasm.proxy&&(r.env.wasm.proxy=!1),"number"!=typeof r.env.wasm.numThreads||!Number.isInteger(r.env.wasm.numThreads)||r.env.wasm.numThreads<=0){const e="undefined"==typeof navigator?(0,i.cpus)().length:navigator.hardwareConcurrency;r.env.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},t.c8=new class{async init(){(0,t.rX)(),await(0,o.initWasm)()}async createSessionHandler(e,t){const n=new s.OnnxruntimeWebAssemblySessionHandler;return await n.loadModel(e,t),Promise.resolve(n)}}},1057:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(8453),t);const o=n(8453);{const e=n(5716).R;(0,o.registerBackend)("webgl",e,-10)}{const e=n(2818).c8;(0,o.registerBackend)("cpu",e,10),(0,o.registerBackend)("wasm",e,10),(0,o.registerBackend)("xnnpack",e,9)}},4910:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAttributeWithCacheKey=void 0;class n{constructor(e){Object.assign(this,e)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map((e=>`${this[e]}`)).join(";")),this._cacheKey}}t.createAttributeWithCacheKey=e=>new n(e)},6874:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Attribute=void 0;const r=n(1446),i=n(1287),o=n(9240),s=n(7273);var a=i.onnxruntime.experimental.fbs;class u{constructor(e){if(this._attributes=new Map,null!=e){for(const t of e)t instanceof r.onnx.AttributeProto?this._attributes.set(t.name,[u.getValue(t),u.getType(t)]):t instanceof a.Attribute&&this._attributes.set(t.name(),[u.getValue(t),u.getType(t)]);if(this._attributes.size<e.length)throw new Error("duplicated attribute names")}}set(e,t,n){this._attributes.set(e,[n,t])}delete(e){this._attributes.delete(e)}getFloat(e,t){return this.get(e,"float",t)}getInt(e,t){return this.get(e,"int",t)}getString(e,t){return this.get(e,"string",t)}getTensor(e,t){return this.get(e,"tensor",t)}getFloats(e,t){return this.get(e,"floats",t)}getInts(e,t){return this.get(e,"ints",t)}getStrings(e,t){return this.get(e,"strings",t)}getTensors(e,t){return this.get(e,"tensors",t)}get(e,t,n){const r=this._attributes.get(e);if(void 0===r){if(void 0!==n)return n;throw new Error(`required attribute not found: ${e}`)}if(r[1]!==t)throw new Error(`type mismatch: expected ${t} but got ${r[1]}`);return r[0]}static getType(e){const t=e instanceof r.onnx.AttributeProto?e.type:e.type();switch(t){case r.onnx.AttributeProto.AttributeType.FLOAT:return"float";case r.onnx.AttributeProto.AttributeType.INT:return"int";case r.onnx.AttributeProto.AttributeType.STRING:return"string";case r.onnx.AttributeProto.AttributeType.TENSOR:return"tensor";case r.onnx.AttributeProto.AttributeType.FLOATS:return"floats";case r.onnx.AttributeProto.AttributeType.INTS:return"ints";case r.onnx.AttributeProto.AttributeType.STRINGS:return"strings";case r.onnx.AttributeProto.AttributeType.TENSORS:return"tensors";default:throw new Error(`attribute type is not supported yet: ${r.onnx.AttributeProto.AttributeType[t]}`)}}static getValue(e){const t=e instanceof r.onnx.AttributeProto?e.type:e.type();if(t===r.onnx.AttributeProto.AttributeType.GRAPH||t===r.onnx.AttributeProto.AttributeType.GRAPHS)throw new Error("graph attribute is not supported yet");const n=this.getValueNoCheck(e);if(t===r.onnx.AttributeProto.AttributeType.INT&&s.LongUtil.isLong(n))return s.LongUtil.longToNumber(n);if(t===r.onnx.AttributeProto.AttributeType.INTS){const e=n,t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];t[n]=s.LongUtil.longToNumber(r)}return t}if(t===r.onnx.AttributeProto.AttributeType.TENSOR)return e instanceof r.onnx.AttributeProto?o.Tensor.fromProto(n):o.Tensor.fromOrtTensor(n);if(t===r.onnx.AttributeProto.AttributeType.TENSORS){if(e instanceof r.onnx.AttributeProto)return n.map((e=>o.Tensor.fromProto(e)));if(e instanceof a.Attribute)return n.map((e=>o.Tensor.fromOrtTensor(e)))}if(t===r.onnx.AttributeProto.AttributeType.STRING&&e instanceof r.onnx.AttributeProto){const e=n;return(0,s.decodeUtf8String)(e)}return t===r.onnx.AttributeProto.AttributeType.STRINGS&&e instanceof r.onnx.AttributeProto?n.map(s.decodeUtf8String):n}static getValueNoCheck(e){return e instanceof r.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(e):this.getValueNoCheckFromOrtFormat(e)}static getValueNoCheckFromOnnxFormat(e){switch(e.type){case r.onnx.AttributeProto.AttributeType.FLOAT:return e.f;case r.onnx.AttributeProto.AttributeType.INT:return e.i;case r.onnx.AttributeProto.AttributeType.STRING:return e.s;case r.onnx.AttributeProto.AttributeType.TENSOR:return e.t;case r.onnx.AttributeProto.AttributeType.GRAPH:return e.g;case r.onnx.AttributeProto.AttributeType.FLOATS:return e.floats;case r.onnx.AttributeProto.AttributeType.INTS:return e.ints;case r.onnx.AttributeProto.AttributeType.STRINGS:return e.strings;case r.onnx.AttributeProto.AttributeType.TENSORS:return e.tensors;case r.onnx.AttributeProto.AttributeType.GRAPHS:return e.graphs;default:throw new Error(`unsupported attribute type: ${r.onnx.AttributeProto.AttributeType[e.type]}`)}}static getValueNoCheckFromOrtFormat(e){switch(e.type()){case a.AttributeType.FLOAT:return e.f();case a.AttributeType.INT:return e.i();case a.AttributeType.STRING:return e.s();case a.AttributeType.TENSOR:return e.t();case a.AttributeType.GRAPH:return e.g();case a.AttributeType.FLOATS:return e.floatsArray();case a.AttributeType.INTS:{const t=[];for(let n=0;n<e.intsLength();n++)t.push(e.ints(n));return t}case a.AttributeType.STRINGS:{const t=[];for(let n=0;n<e.stringsLength();n++)t.push(e.strings(n));return t}case a.AttributeType.TENSORS:{const t=[];for(let n=0;n<e.tensorsLength();n++)t.push(e.tensors(n));return t}default:throw new Error(`unsupported attribute type: ${a.AttributeType[e.type()]}`)}}}t.Attribute=u},1975:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveBackend=t.backend=void 0;const r=n(4418),i=new Map;async function o(e){const n=t.backend;if(void 0!==n[e]&&function(e){const t=e;return"initialize"in t&&"function"==typeof t.initialize&&"createSessionHandler"in t&&"function"==typeof t.createSessionHandler&&"dispose"in t&&"function"==typeof t.dispose}(n[e])){const t=n[e];let r=t.initialize();if("object"==typeof r&&"then"in r&&(r=await r),r)return i.set(e,t),t}}t.backend={webgl:new r.WebGLBackend},t.resolveBackend=async function e(t){if(!t)return e(["webgl"]);{const e="string"==typeof t?[t]:t;for(const t of e){const e=i.get(t);if(e)return e;const n=await o(t);if(n)return n}}throw new Error("no available backend to use")}},4418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLBackend=void 0;const r=n(8453),i=n(1315),o=n(2171),s=n(3389);t.WebGLBackend=class{get contextId(){return r.env.webgl.contextId}set contextId(e){r.env.webgl.contextId=e}get matmulMaxBatchSize(){return r.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(e){r.env.webgl.matmulMaxBatchSize=e}get textureCacheMode(){return r.env.webgl.textureCacheMode}set textureCacheMode(e){r.env.webgl.textureCacheMode=e}get pack(){return r.env.webgl.pack}set pack(e){r.env.webgl.pack=e}get async(){return r.env.webgl.async}set async(e){r.env.webgl.async=e}initialize(){try{return this.glContext=(0,s.createWebGLContext)(this.contextId),"number"!=typeof this.matmulMaxBatchSize&&(this.matmulMaxBatchSize=16),"string"!=typeof this.textureCacheMode&&(this.textureCacheMode="full"),"boolean"!=typeof this.pack&&(this.pack=!1),"boolean"!=typeof this.async&&(this.async=!1),i.Logger.setWithEnv(r.env),i.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(e){return i.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${e}`),!1}}createSessionHandler(e){return new o.WebGLSessionHandler(this,e)}dispose(){this.glContext.dispose()}}},6859:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoordsGlslLib=void 0;const r=n(7273),i=n(1997),o=n(6757),s=n(7618),a=n(432);class u extends i.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new i.GlslLibRoutine("\n vec2 offsetToCoords(int offset, int width, int height) {\n int t = offset / width;\n int s = offset - t*width;\n vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);\n return coords;\n }\n ")}}coordsToOffset(){return{coordsToOffset:new i.GlslLibRoutine("\n int coordsToOffset(vec2 coords, int width, int height) {\n float s = coords.s * float(width);\n float t = coords.t * float(height);\n int offset = int(t) * width + int(s);\n return offset;\n }\n ")}}getOutputSamplingSnippet(){const e=this.context.outputTextureLayout;return e.isPacked?this.getPackedOutputSamplingSnippet(e):this.getUnpackedOutputSamplingSnippet(e)}getPackedOutputSamplingSnippet(e){const t=e.unpackedShape,n=[e.width,e.height],r={},s="getOutputCoords";switch(t.length){case 0:r[s]=this.getOutputScalarCoords();break;case 1:r[s]=this.getOutputPacked1DCoords(t,n);break;case 2:r[s]=this.getOutputPacked2DCoords(t,n);break;case 3:r[s]=this.getOutputPacked3DCoords(t,n);break;default:r[s]=this.getOutputPackedNDCoords(t,n)}const a=`\n void setOutput(vec4 val) {\n ${(0,o.getGlsl)(this.context.glContext.version).output} = val;\n }\n `;return r.floatTextureSetRGBA=new i.GlslLibRoutine(a),r}getUnpackedOutputSamplingSnippet(e){const t=e.unpackedShape,n=[e.width,e.height],r={},s="getOutputCoords";switch(t.length){case 0:r[s]=this.getOutputScalarCoords();break;case 1:r[s]=this.getOutputUnpacked1DCoords(t,n);break;case 2:r[s]=this.getOutputUnpacked2DCoords(t,n);break;case 3:r[s]=this.getOutputUnpacked3DCoords(t,n);break;case 4:r[s]=this.getOutputUnpacked4DCoords(t,n);break;case 5:r[s]=this.getOutputUnpacked5DCoords(t,n);break;case 6:r[s]=this.getOutputUnpacked6DCoords(t,n);break;default:throw new Error(`Unsupported output dimensionality: ${t.length}`)}const a=`\n void setOutput(float val) {\n ${(0,o.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0);\n }\n `;return r.floatTextureSetR=new i.GlslLibRoutine(a),r}getOutputScalarCoords(){return new i.GlslLibRoutine("\n int getOutputCoords() {\n return 0;\n }\n ")}getOutputPacked1DCoords(e,t){const n=t;let r="";return 1===n[0]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.y * ${n[1]}.0);\n }\n `,new i.GlslLibRoutine(r)):1===n[1]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.x * ${n[0]}.0);\n }\n `,new i.GlslLibRoutine(r)):(r=`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n return 2 * (resTexRC.y * ${n[0]} + resTexRC.x);\n }\n `,new i.GlslLibRoutine(r))}getOutputPacked2DCoords(e,t){let n="";if(r.ArrayUtil.arraysEqual(e,t))return n=`\n ivec2 getOutputCoords() {\n return 2 * ivec2(TexCoords.xy * vec2(${t[0]}, ${t[1]}));\n }\n `,new i.GlslLibRoutine(n);const o=t,s=Math.ceil(e[1]/2);return n=`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${o[0]}, ${o[1]}));\n\n int index = resTexRC.y * ${o[0]} + resTexRC.x;\n\n // reverse r and c order for packed texture\n int r = imod(index, ${s}) * 2;\n int c = 2 * (index / ${s});\n\n return ivec2(r, c);\n }\n `,new i.GlslLibRoutine(n)}getOutputPacked3DCoords(e,t){const n=[t[0],t[1]],r=Math.ceil(e[2]/2),o=r*Math.ceil(e[1]/2),s=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n int index = resTexRC.y * ${n[0]} + resTexRC.x;\n\n int b = index / ${o};\n index -= b * ${o};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${r}) * 2;\n int c = 2 * (index / ${r});\n\n return ivec3(b, r, c);\n }\n `;return new i.GlslLibRoutine(s)}getOutputPackedNDCoords(e,t){const n=[t[0],t[1]],r=Math.ceil(e[e.length-1]/2),o=r*Math.ceil(e[e.length-2]/2);let s=o,a="",u="b, r, c";for(let t=2;t<e.length-1;t++)s*=e[e.length-t-1],a=`\n int b${t} = index / ${s};\n index -= b${t} * ${s};\n `+a,u=`b${t}, `+u;const c=`\n ivec${e.length} getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n int index = resTexRC.y * ${n[0]} + resTexRC.x;\n\n ${a}\n\n int b = index / ${o};\n index -= b * ${o};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${r}) * 2;\n int c = 2 * (index / ${r});\n\n return ivec${e.length}(${u});\n }\n `;return new i.GlslLibRoutine(c)}getOutputUnpacked1DCoords(e,t){const n=`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n return resTexRC.y * ${t[0]} + resTexRC.x;\n }\n `;return new i.GlslLibRoutine(n)}getOutputUnpacked2DCoords(e,t){const n=`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n int r = index / ${e[1]};\n int c = index - r * ${e[1]};\n return ivec2(r, c);\n }\n `;return new i.GlslLibRoutine(n)}getOutputUnpacked3DCoords(e,t){let n="";const r=e.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=e[r-1];for(let t=r-3;t>=0;--t)o[t]=o[t+1]*e[t+1];const s=["r","c","d"],a=o.map(((e,t)=>`int ${s[t]} = index / ${e}; ${t===o.length-1?`int ${s[t+1]} = index - ${s[t]} * ${e}`:`index -= ${s[t]} * ${e}`};`)).join("");return n=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${a}\n return ivec3(r, c, d);\n }\n `,new i.GlslLibRoutine(n)}getOutputUnpacked4DCoords(e,t){let n="";const r=e.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=e[r-1];for(let t=r-3;t>=0;--t)o[t]=o[t+1]*e[t+1];const s=["r","c","d","d2"],a=o.map(((e,t)=>`int ${s[t]} = index / ${e}; ${t===o.length-1?`int ${s[t+1]} = index - ${s[t]} * ${e}`:`index -= ${s[t]} * ${e}`};`)).join("");return n=`\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${a}\n return ivec4(r, c, d, d2);\n }\n `,new i.GlslLibRoutine(n)}getOutputUnpacked5DCoords(e,t){let n="";const r=e.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=e[r-1];for(let t=r-3;t>=0;--t)o[t]=o[t+1]*e[t+1];const s=["r","c","d","d2","d3"],a=o.map(((e,t)=>`int ${s[t]} = index / ${e}; ${t===o.length-1?`int ${s[t+1]} = index - ${s[t]} * ${e}`:`index -= ${s[t]} * ${e}`};`)).join("");return n=`\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${a}\n return ivec5(r, c, d, d2, d3);\n }\n `,new i.GlslLibRoutine(n)}getOutputUnpacked6DCoords(e,t){let n="";const r=e.length;let o=null;r<2&&(o=[]),o=new Array(r-1),o[r-2]=e[r-1];for(let t=r-3;t>=0;--t)o[t]=o[t+1]*e[t+1];const s=["r","c","d","d2","d3","d4"],a=o.map(((e,t)=>`int ${s[t]} = index / ${e}; ${t===o.length-1?`int ${s[t+1]} = index - ${s[t]} * ${e}`:`index -= ${s[t]} * ${e}`};`)).join("");return n=`\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${a}\n return ivec6(r, c, d, d2, d3, d4);\n }\n `,new i.GlslLibRoutine(n)}getCommonUtilFuncs(){const e={};let t="uvFromFlat";e[t]=new i.GlslLibRoutine("\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texC = index / texNumR;\n int texR = index - texC * texNumR;\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\n // v.\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\n }\n "),t="packedUVfrom1D",e[t]=new i.GlslLibRoutine("\n vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),t="packedUVfrom2D",e[t]=new i.GlslLibRoutine("\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),t="packedUVfrom3D",e[t]=new i.GlslLibRoutine("\n vec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),t="sampleTexture";const n=(0,o.getGlsl)(this.context.glContext.version);return e[t]=new i.GlslLibRoutine(`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${n.texture2D}(textureSampler, uv).r;\n }`),e}getInputsSamplingSnippets(){const e={},t=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach(((n,r)=>{const i=this.context.inputTextureLayouts[r],o=(0,a.generateShaderFuncNameFromInputSamplerName)(n);i.isPacked?e[o]=this.getPackedSamplerFromInput(o,n,i):e[o]=this.getUnpackedSamplerFromInput(o,n,i);const s=(0,a.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(n);i.unpackedShape.length<=t.unpackedShape.length&&(i.isPacked?e[s]=this.getPackedSamplerAtOutputCoords(s,i,t,n):e[s]=this.getUnpackedSamplerAtOutputCoords(s,i,t,n))})),e}getPackedSamplerAtOutputCoords(e,t,n,o){const s=t.unpackedShape,u=n.unpackedShape,c=o,l=(0,a.generateShaderFuncNameFromInputSamplerName)(c),d=s.length,f=u.length,h=r.BroadcastUtil.getBroadcastDims(s,u),p=(0,a.getCoordsDataType)(f),g=f-d;let m;const b=(0,a.getGlChannels)();m=0===d?"":f<2&&h.length>=1?"coords = 0;":h.map((e=>`coords.${b[e+g]} = 0;`)).join("\n");let y="";y=f<2&&d>0?"coords":s.map(((e,t)=>`coords.${b[t+g]}`)).join(", ");let v="return outputValue;";const _=1===r.ShapeUtil.size(s),w=1===r.ShapeUtil.size(u);if(1!==d||_||w){if(_&&!w)v=1===f?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(h.length){const e=d-2,t=d-1;h.indexOf(e)>-1&&h.indexOf(t)>-1?v="return vec4(outputValue.x);":h.indexOf(e)>-1?v="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":h.indexOf(t)>-1&&(v="return vec4(outputValue.xx, outputValue.zz);")}}else v="\n return vec4(outputValue.xy, outputValue.xy);\n ";const x=`\n vec4 ${e}() {\n ${p} coords = getOutputCoords();\n \n int lastDim = coords.${b[f-1]};\n coords.${b[f-1]} = coords.${b[f-2]};\n coords.${b[f-2]} = lastDim;\n \n ${m}\n vec4 outputValue = ${l}(${y});\n ${v}\n }\n `;return new i.GlslLibRoutine(x,["coordinates.getOutputCoords"])}getUnpackedSamplerAtOutputCoords(e,t,n,o){const s=[n.width,n.height],u=[t.width,t.height],c=t.unpackedShape.length,l=n.unpackedShape.length,d=t.unpackedShape,f=n.unpackedShape,h=(0,a.generateShaderFuncNameFromInputSamplerName)(o);if(c===l&&r.ArrayUtil.arraysEqual(u,s)){const t=`\n float ${e}() {\n return sampleTexture(${o}, TexCoords);\n }\n `;return new i.GlslLibRoutine(t,["coordinates.sampleTexture"])}const p=(0,a.getCoordsDataType)(l),g=r.BroadcastUtil.getBroadcastDims(d,f),m=l-c;let b;const y=(0,a.getGlChannels)();b=0===c?"":l<2&&g.length>=1?"coords = 0;":g.map((e=>`coords.${y[e+m]} = 0;`)).join("\n");let v="";v=l<2&&c>0?"coords":t.unpackedShape.map(((e,t)=>`coords.${y[t+m]}`)).join(", ");const _=`\n float ${e}() {\n ${p} coords = getOutputCoords();\n ${b}\n return ${h}(${v});\n }\n `;return new i.GlslLibRoutine(_,["coordinates.getOutputCoords"])}getPackedSamplerFromInput(e,t,n){switch(n.unpackedShape.length){case 0:return this.getPackedSamplerScalar(e,t);case 1:return this.getPackedSampler1D(e,t,n);case 2:return this.getPackedSampler2D(e,t,n);case 3:return this.getPackedSampler3D(e,t,n);default:return this.getPackedSamplerND(e,t,n)}}getUnpackedSamplerFromInput(e,t,n){const r=n.unpackedShape;switch(r.length){case 0:return this.getUnpackedSamplerScalar(e,t,n);case 1:return this.getUnpackedSampler1D(e,t,n);case 2:return this.getUnpackedSampler2D(e,t,n);case 3:return this.getUnpackedSampler3D(e,t,n);case 4:return this.getUnpackedSampler4D(e,t,n);case 5:return this.getUnpackedSampler5D(e,t,n);case 6:return this.getUnpackedSampler6D(e,t,n);default:throw new Error(`Unsupported dimension ${r.length}-D`)}}getPackedSamplerScalar(e,t){const n=`\n vec4 ${e}() {\n return ${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${t}, halfCR);\n }\n `;return new i.GlslLibRoutine(n)}getPackedSampler1D(e,t,n){const r=[n.width,n.height],s=[r[1],r[0]],a=(0,o.getGlsl)(this.context.glContext.version),u=`vec4 ${e}(int index) {\n vec2 uv = packedUVfrom1D(\n ${s[0]}, ${s[1]}, index);\n return ${a.texture2D}(${t}, uv);\n }`;return new i.GlslLibRoutine(u,["coordinates.packedUVfrom1D"])}getPackedSampler2D(e,t,n){const s=n.unpackedShape,a=[n.width,n.height],u=(0,o.getGlsl)(this.context.glContext.version),c=a[0],l=a[1];if(null!=a&&r.ArrayUtil.arraysEqual(s,a)){const n=`vec4 ${e}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${l}.0, ${c}.0);\n return ${u.texture2D}(${t}, uv);\n }`;return new i.GlslLibRoutine(n)}const d=a,f=Math.ceil(s[1]/2),h=`vec4 ${e}(int row, int col) {\n vec2 uv = packedUVfrom2D(${d[1]}, ${d[0]}, ${f}, row, col);\n return ${u.texture2D}(${t}, uv);\n }`;return new i.GlslLibRoutine(h,["coordinates.packedUVfrom2D"])}getPackedSampler3D(e,t,n){const r=n.unpackedShape,s=[n.width,n.height],u=[s[0],s[1]],c=(0,o.getGlsl)(this.context.glContext.version);if(1===r[0]){const o=r.slice(1),s=[1,2],u=(0,a.squeezeInputShape)(r,o),c=["b","row","col"],l=JSON.parse(JSON.stringify(n));l.unpackedShape=u;const d=this.getPackedSamplerFromInput(e,t,l),f=`${d.routineBody}\n vec4 ${e}(int b, int row, int col) {\n return ${e}(${(0,a.getSqueezedParams)(c,s)});\n } `;return new i.GlslLibRoutine(f,d.dependencies)}const l=u[0],d=u[1],f=Math.ceil(r[2]/2),h=`vec4 ${e}(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ${d}, ${l}, ${f*Math.ceil(r[1]/2)}, ${f}, b, row, col);\n return ${c.texture2D}(${t}, uv);}`;return new i.GlslLibRoutine(h,["coordinates.packedUVfrom3D"])}getPackedSamplerND(e,t,n){const r=n.unpackedShape,s=r.length,a=[n.width,n.height],u=(0,o.getGlsl)(this.context.glContext.version),c=[a[0],a[1]],l=c[1],d=c[0],f=Math.ceil(r[s-1]/2);let h=f*Math.ceil(r[s-2]/2),p="int b, int row, int col",g=`b * ${h} + (row / 2) * ${f} + (col / 2)`;for(let e=2;e<s-1;e++)p=`int b${e}, `+p,h*=r[s-e-1],g=`b${e} * ${h} + `+g;const m=`vec4 ${e}(${p}) {\n int index = ${g};\n int texR = index / ${d};\n int texC = index - texR * ${d};\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${d}, ${l});\n return ${u.texture2D}(${t}, uv);\n }`;return new i.GlslLibRoutine(m)}getUnpackedSamplerScalar(e,t,n){const[r,o]=[n.width,n.height];if(1===r&&1===o){const n=`\n float ${e}() {\n return sampleTexture(${t}, halfCR);\n }\n `;return new i.GlslLibRoutine(n,["coordinates.sampleTexture"])}const s=`\n float ${e}() {\n int offset_${t} = coordsToOffset(TexCoords, ${r}, ${o});\n vec2 uv = uvFromFlat(${r}, ${o}, offset_${t});\n return sampleTexture(${t}, uv);\n }\n `;return new i.GlslLibRoutine(s,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler1D(e,t,n){const r=n.width,o=n.height;if(1===o&&1===r){const n=`\n float ${e}(int index) {\n return sampleTexture(${t}, halfCR);\n }\n `;return new i.GlslLibRoutine(n,["coordinates.sampleTexture"])}if(1===o){const n=`\n float ${e}(int index) {\n vec2 uv = vec2((float(index) + 0.5) / ${r}.0, 0.5);\n return sampleTexture(${t}, uv);\n }\n `;return new i.GlslLibRoutine(n,["coordinates.sampleTexture"])}if(1===r){const n=`\n float ${e}(int index) {\n vec2 uv = vec2(0.5, (float(index) + 0.5) / ${o}.0);\n return sampleTexture(${t}, uv);\n }\n `;return new i.GlslLibRoutine(n,["coordinates.sampleTexture"])}const s=`\n float ${e}(int index) {\n vec2 uv = uvFromFlat(${r}, ${o}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new i.GlslLibRoutine(s,["coordinates.uvFromFlat","coordinates.sampleTexture"])}getUnpackedSampler2D(e,t,n){const o=n.unpackedShape,u=[n.height,n.width];if(null!=u&&r.ArrayUtil.arraysEqual(o,u)){const n=`\n float ${e}(int row, int col) {\n vec2 uv = (vec2(row, col) + halfCR) / vec2(${u[1]}.0, ${u[0]}.0);\n return sampleTexture(${t}, uv);\n }\n `;return new i.GlslLibRoutine(n,["coordinates.sampleTexture"])}const{newShape:c,keptDims:l}=(0,s.squeezeShape)(o),d=c;if(d.length<o.length){const r=(0,a.squeezeInputShape)(o,d),s=JSON.parse(JSON.stringify(n));s.unpackedShape=r;const u=["col","row"],c=`\n ${this.getUnpackedSamplerFromInput(e,t,s).routineBody}\n float ${e}(int row, int col) {\n return ${e}(${(0,a.getSqueezedParams)(u,l)});\n }\n `;return new i.GlslLibRoutine(c,["coordinates.sampleTexture"])}const f=u[1],h=u[0];if(1===h){const n=`\n float ${e}(int row, int col) {\n int offset_${t} = coordsToOffset(TexCoords, ${f}, ${h});\n float index = dot(vec3(row, col, offset_${t}), vec3(${o[1]}, 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / ${f}.0);\n return sampleTexture(${t}, uv);\n }\n `;return new i.GlslLibRoutine(n,["coordinates.sampleTexture","coordinates.coordsToOffset"])}if(1===f){const n=`\n float ${e}(int row, int col) {\n int offset_${t} = coordsToOffset(TexCoords, ${f}, ${h});\n float index = dot(vec3(row, col, offset_${t}), vec3(${o[1]}, 1, 1));\n vec2 uv = vec2((index + 0.5) / ${h}.0, 0.5);\n return sampleTexture(${t}, uv);\n }\n `;return new i.GlslLibRoutine(n,["coordinates.sampleTexture","coordinates.coordsToOffset"])}const p=`\n float ${e}(int row, int col) {\n int index = col * ${o[1]} + row;\n vec2 uv = uvFromFlat(${f}, ${h}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new i.GlslLibRoutine(p,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler3D(e,t,n){const r=n.unpackedShape,o=r[1]*r[2],u=r[2],{newShape:c,keptDims:l}=(0,s.squeezeShape)(r),d=c;if(d.length<r.length){const o=(0,a.squeezeInputShape)(r,d),s=["batch","col","row"],u=JSON.parse(JSON.stringify(n));u.unpackedShape=o;const c=this.getUnpackedSamplerFromInput(e,t,u),f=l.reverse(),h=`\n ${c.routineBody}\n float ${e}(int batch, int row, int col) {\n return ${e}(${(0,a.getSqueezedParams)(s,f)});\n }\n `;return new i.GlslLibRoutine(h,c.dependencies)}const f=`\n float ${e}(int depth, int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = depth * ${o} + col * ${u} + row;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new i.GlslLibRoutine(f,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler4D(e,t,n){const r=n.unpackedShape,o=r[3],s=r[2]*o,a=`\n float ${e}(int row, int col, int depth, int depth2) {\n int index = row * ${r[1]*s} + col * ${s} +\n depth2 * ${o} + depth;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new i.GlslLibRoutine(a,["coordinates.uvFromFlat","coordinates.sampleTexture"])}getUnpackedSampler5D(e,t,n){const r=n.unpackedShape,o=r[4],u=r[3]*o,c=r[2]*u,l=r[1]*c,{newShape:d,keptDims:f}=(0,s.squeezeShape)(r);if(d.length<r.length){const o=(0,a.squeezeInputShape)(r,d),s=["row","col","depth","depth2","depth3"],u=JSON.parse(JSON.stringify(n));u.unpackedShape=o;const c=`\n ${this.getUnpackedSamplerFromInput(e,t,u).routineBody}\n float ${e}(int row, int col, int depth, int depth2, int depth3) {\n return ${e}(${(0,a.getSqueezedParams)(s,f)});\n }\n `;return new i.GlslLibRoutine(c,["coordinates.sampleTexture","coordinates.uvFromFlat"])}const h=`\n float ${e}(int row, int col, int depth, int depth2, int depth3) {\n int index = row * ${l} + col * ${c} + depth * ${u} +\n depth3 * ${o} + depth2;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new i.GlslLibRoutine(h,["coordinates.sampleTexture","coordinates.uvFromFlat"])}getUnpackedSampler6D(e,t,n){const r=n.unpackedShape,o=r[5],u=r[4]*o,c=r[3]*u,l=r[2]*c,d=r[1]*l,{newShape:f,keptDims:h}=(0,s.squeezeShape)(r);if(f.length<r.length){const o=(0,a.squeezeInputShape)(r,f),s=["row","col","depth","depth2","depth3","depth4"],u=JSON.parse(JSON.stringify(n));u.unpackedShape=o;const c=`\n ${this.getUnpackedSamplerFromInput(e,t,u).routineBody}\n float ${e}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return ${e}(${(0,a.getSqueezedParams)(s,h)});\n }\n `;return new i.GlslLibRoutine(c,["coordinates.sampleTexture","coordinates.uvFromFlat"])}const p=`\n float ${e}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = row * ${d} + col * ${l} + depth * ${c} +\n depth2 * ${u} + depth3 * ${o} + depth4;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new i.GlslLibRoutine(p,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}toVec(){const e=this.context.outputTextureLayout,t=e.shape.length,n=e.strides,r=e.width,o=e.height,s=[];for(let e=0;e<t-1;++e)s.push(`\n c[${e}] = offset / ${n[e]};`),s.push(`\n offset -= c[${e}] * ${n[e]};`);s.push(`\n c[${t-1}] = offset;`);const a=`\n void toVec(vec2 texCoords, out int c[${t}]) {\n int offset = coordsToOffset(texCoords, ${r}, ${o});\n ${s.join("")}\n }\n void toVec(int offset, out int c[${t}]) {\n ${s.join("")}\n }\n `;return{toVec:new i.GlslLibRoutine(a,["coordinates.coordsToOffset"])}}valueFrom(){const e={};return this.context.programInfo.inputNames.forEach(((t,n)=>{const r=this.context.inputTextureLayouts[n],o=(r.unpackedShape.length>0?r.unpackedShape:r.shape).length;let s=`_${t}`;e[s]=new i.GlslLibRoutine(this.getValueFromSingle(t,o,r.width,r.height,!1),[`shapeUtils.indicesToOffset${s}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),s+="_T",e[s]=new i.GlslLibRoutine(this.getValueFromSingle(t,o,r.width,r.height,!0),[`shapeUtils.indicesToOffset${s}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])})),e}getValueFromSingle(e,t,n,r,i){let s=`_${e}`;return i&&(s+="_T"),`\n float ${s}(int m[${t}]) {\n int offset = indicesToOffset${s}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n float value = getColorAsFloat(${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${e}, coords));\n return value;\n }\n `}getPackedValueFrom(e,t,n,r,i){let s=`_${e}_Pack`;return i&&(s+="_T"),`\n vec4 ${s}(int m[${t}]) {\n int offset = indicesToOffset_${e}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n return ${(0,o.getGlsl)(this.context.glContext.version).texture2D}(${e}, coords);\n }\n `}}t.CoordsGlslLib=u},1997:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TopologicalSortGlslRoutines=t.GlslLibRoutineNode=t.GlslLibRoutine=t.GlslLib=t.GlslContext=t.FunctionType=void 0,(n=t.FunctionType||(t.FunctionType={}))[n.ValueBased=0]="ValueBased",n[n.Positional=1]="Positional",t.GlslContext=class{constructor(e,t,n,r){this.glContext=e,this.programInfo=t,this.inputTextureLayouts=n,this.outputTextureLayout=r}},t.GlslLib=class{constructor(e){this.context=e}},t.GlslLibRoutine=class{constructor(e,t){this.routineBody=e,this.dependencies=t}},t.GlslLibRoutineNode=class{constructor(e,t,n){this.name=e,this.dependencies=n||[],t&&(this.routineBody=t)}addDependency(e){e&&this.dependencies.push(e)}},t.TopologicalSortGlslRoutines=class{static returnOrderedNodes(e){if(!e||0===e.length)return[];if(1===e.length)return e;const t=new Set,n=new Set,r=new Array;return this.createOrderedNodes(e,t,n,r),r}static createOrderedNodes(e,t,n,r){for(let i=0;i<e.length;++i)this.dfsTraverse(e[i],t,n,r)}static dfsTraverse(e,t,n,r){if(!e||n.has(e.name))return;if(t.has(e.name))throw new Error("Cyclic dependency detected. Can't topologically sort routines needed for shader.");t.add(e.name);const i=e.dependencies;if(i&&i.length>0)for(let e=0;e<i.length;++e)this.dfsTraverse(i[e],t,n,r);r.push(e),n.add(e.name),t.delete(e.name)}}},1371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EncodingGlslLib=void 0;const r=n(1997);class i extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new r.GlslLibRoutine("highp vec4 encode(highp float f) {\n return vec4(f, 0.0, 0.0, 0.0);\n }\n ")}}decodeFloat32(){return{decode:new r.GlslLibRoutine("highp float decode(highp vec4 rgba) {\n return rgba.r;\n }\n ")}}encodeUint8(){const e=i.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new r.GlslLibRoutine(`\n highp vec4 encode(highp float f) {\n highp float F = abs(f);\n highp float Sign = step(0.0,-f);\n highp float Exponent = floor(log2(F));\n highp float Mantissa = (exp2(- Exponent) * F);\n Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));\n highp vec4 rgba;\n rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0));\n rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);\n rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));\n rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));\n ${e}\n rgba = rgba / 255.0; // values need to be normalized to [0,1]\n return rgba;\n }\n `)}}decodeUint8(){const e=i.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new r.GlslLibRoutine(`\n highp float decode(highp vec4 rgba) {\n rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]\n ${e}\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n `)}}static isLittleEndian(){const e=new ArrayBuffer(4),t=new Uint32Array(e),n=new Uint8Array(e);if(t[0]=3735928559,239===n[0])return!0;if(222===n[0])return!1;throw new Error("unknown endianness")}}t.EncodingGlslLib=i},2691:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FragColorGlslLib=void 0;const r=n(1997),i=n(6757);class o extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const e=(0,i.getGlsl)(this.context.glContext.version);return{setFragColor:new r.GlslLibRoutine(`\n void setFragColor(float value) {\n ${e.output} = encode(value);\n }\n `,["encoding.encode"])}}getColorAsFloat(){return{getColorAsFloat:new r.GlslLibRoutine("\n float getColorAsFloat(vec4 color) {\n return decode(color);\n }\n ",["encoding.decode"])}}}t.FragColorGlslLib=o},3878:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.replaceInlines=void 0;const n=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;t.replaceInlines=function(e){const t={};let r;for(;null!==(r=n.exec(e));){const e=r[3].split(",").map((e=>{const t=e.trim().split(" ");return t&&2===t.length?{type:t[0],name:t[1]}:null})).filter((e=>null!==e));t[r[2]]={params:e,body:r[4]}}for(const n in t){const i="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__",n),o=new RegExp(i,"gm");for(;null!==(r=o.exec(e));){const i=r[1],o=r[2],s=r[3].split(","),a=i?`${i} ${o};`:"";let u=t[n].body,c="";t[n].params.forEach(((e,t)=>{e&&(c+=`${e.type} ${e.name} = ${s[t]};\n`)})),u=`${c}\n ${u}`,u=u.replace("return",`${o} = `);const l=`\n ${a}\n {\n ${u}\n }\n `;e=e.replace(r[0],l)}}return e.replace(n,"")}},8897:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlslPreprocessor=void 0;const r=n(1997),i=n(3878),o=n(1248),s=n(6757);t.GlslPreprocessor=class{constructor(e,t,n,i){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new r.GlslContext(e,t,n,i),Object.keys(o.glslRegistry).forEach((e=>{const t=new o.glslRegistry[e](this.context);this.libs[e]=t}));const s=this.glslLibRoutineDependencyGraph;for(const e in this.libs){const t=this.libs[e].getFunctions();for(const n in t){const i=e+"."+n;let o;s[i]?(o=s[i],o.routineBody=t[n].routineBody):(o=new r.GlslLibRoutineNode(i,t[n].routineBody),s[i]=o);const a=t[n].dependencies;if(a)for(let e=0;e<a.length;++e)if(s[a[e]])o.addDependency(s[a[e]]);else{const t=new r.GlslLibRoutineNode(a[e]);s[a[e]]=t,o.addDependency(t)}}}}preprocess(){const e=this.context.programInfo;let t=e.shaderSource;return this.context.programInfo.hasMain||(t=`${t}\n ${(0,s.getDefaultFragShaderMain)(this.context.glContext.version,this.context.outputTextureLayout.shape.length)}`),t=(0,i.replaceInlines)(t),`${(0,s.getFragShaderPreamble)(this.context.glContext.version)}\n ${this.getUniforms(e.inputNames,e.variables)}\n ${this.getImports(t)}\n ${t}`}getImports(e){const t=this.selectGlslLibRoutinesToBeIncluded(e);if(0===t.length)return"";let n="";for(let e=0;e<t.length;++e){if(!t[e].routineBody)throw new Error(`Missing body for the Glsl Library routine: ${t[e].name}`);n+=t[e].routineBody+"\n"}return n}selectGlslLibRoutinesToBeIncluded(e){const t=[];return Object.keys(this.glslLibRoutineDependencyGraph).forEach((n=>{const r=n.split(".")[1];-1!==e.indexOf(r)&&t.push(this.glslLibRoutineDependencyGraph[n])})),r.TopologicalSortGlslRoutines.returnOrderedNodes(t)}getUniforms(e,t){const n=[];if(e)for(const t of e)n.push(`uniform sampler2D ${t};`);if(t)for(const e of t)n.push(`uniform ${e.type} ${e.name}${e.arrayLength?`[${e.arrayLength}]`:""};`);return n.join("\n")}}},1248:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.glslRegistry=void 0;const r=n(6859),i=n(1371),o=n(2691),s=n(9183),a=n(9314);t.glslRegistry={encoding:i.EncodingGlslLib,fragcolor:o.FragColorGlslLib,vec:a.VecGlslLib,shapeUtils:s.ShapeUtilsGlslLib,coordinates:r.CoordsGlslLib}},9183:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShapeUtilsGlslLib=void 0;const r=n(1997);class i extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){const e=this.context.outputTextureLayout.shape.length,t={};return this.context.programInfo.inputNames.forEach(((n,i)=>{const o=this.context.inputTextureLayouts[i].unpackedShape;if(o.length<=e){const i=o.length,s=e-i,a=`bcastIndices_${n}`;let u="";for(let e=0;e<i;++e)u+=`\n realIndices[${e}] = int( mod(float(bcastedIndices[${s+e}]), ${o[e]}.0) );\n `;const c=`\n void ${a} (int bcastedIndices[${e}], out int realIndices[${i}]) {\n ${u}\n }\n `;t[a]=new r.GlslLibRoutine(c)}})),t}bcastMatmulIndex(){const e=this.context.outputTextureLayout.shape.length,t={};return this.context.programInfo.inputNames.forEach(((n,i)=>{const o=this.context.inputTextureLayouts[i].shape;if(!(o.length<2||o.length>e)){const i=o.length,s=e-i,a=`bcastMatmulIndices_${n}`;let u="";for(let e=0;e<i-2;++e)u+=`\n realIndices[${e}] = int( mod(float(bcastedIndices[${s+e}]), ${o[e]}.0) );\n `;const c=`\n void ${a}(int bcastedIndices[${e}], out int realIndices[${i}]) {\n ${u}\n realIndices[${i-1}] = bcastedIndices[${e-1}];\n realIndices[${i-2}] = bcastedIndices[${e-2}];\n }\n `;t[a]=new r.GlslLibRoutine(c)}})),t}indicesToOffset(){const e={};return this.context.programInfo.inputNames.forEach(((t,n)=>{const o=this.context.inputTextureLayouts[n].shape,s=this.context.inputTextureLayouts[n].strides,a=o.length;let u=`indicesToOffset_${t}`;e[u]=new r.GlslLibRoutine(i.indexToOffsetSingle(u,a,s)),u=`indicesToOffset_${t}_T`,e[u]=new r.GlslLibRoutine(i.indexToOffsetSingle(u,a,s.slice().reverse()))})),e}static indexToOffsetSingle(e,t,n){let r="";for(let e=t-1;e>=0;--e)r+=`\n offset += indices[${e}] * ${n[e]};\n `;return`\n int ${e}(int indices[${t}]) {\n int offset = 0;\n ${r}\n return offset;\n }\n `}offsetToIndices(){const e={};return this.context.programInfo.inputNames.forEach(((t,n)=>{const o=this.context.inputTextureLayouts[n].shape,s=this.context.inputTextureLayouts[n].strides,a=o.length;let u=`offsetToIndices_${t}`;e[u]=new r.GlslLibRoutine(i.offsetToIndicesSingle(u,a,s)),u=`offsetToIndices_${t}_T`,e[u]=new r.GlslLibRoutine(i.offsetToIndicesSingle(u,a,s.slice().reverse()))})),e}static offsetToIndicesSingle(e,t,n){const r=[];for(let e=0;e<t-1;++e)r.push(`\n indices[${e}] = offset / ${n[e]};`),r.push(`\n offset -= indices[${e}] * ${n[e]};`);return r.push(`\n indices[${t-1}] = offset;`),`\n void ${e}(int offset, out int indices[${t}]) {\n ${r.join("")}\n }\n `}incrementIndices(){const e={};return this.context.programInfo.inputNames.forEach(((t,n)=>{const i=this.context.inputTextureLayouts[n].shape,o=i.length,s=`incrementIndices_${t}`;let a="";for(let e=0;e<o;++e)a+=`\n shape[${e}] = ${i[e]};`;const u=`\n void ${s}(int axis, out int indices[${o}]) {\n int shape[${o}];\n ${a};\n for(int i = ${o} -1 ; i >= 0; --i) {\n if(i > axis) continue;\n indices[i] += 1;\n if(indices[i] < shape[i]) {\n break;\n }\n indices[i] = 0;\n }\n }\n `;e[s]=new r.GlslLibRoutine(u)})),e}}t.ShapeUtilsGlslLib=i},6757:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultFragShaderMain=t.getFragShaderPreamble=t.getVertexShaderSource=t.getGlsl=void 0;const n={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},r={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function i(e){return 1===e?n:r}t.getGlsl=i,t.getVertexShaderSource=function(e){const t=i(e);return`${t.version}\n precision highp float;\n ${t.attribute} vec3 position;\n ${t.attribute} vec2 textureCoord;\n\n ${t.varyingVertex} vec2 TexCoords;\n\n void main()\n {\n gl_Position = vec4(position, 1.0);\n TexCoords = textureCoord;\n }`},t.getFragShaderPreamble=function(e){const t=i(e);return`${t.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${t.varyingFrag} vec2 TexCoords;\n ${t.outputDeclaration}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n // Custom vector types to handle higher dimenalities.\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n `},t.getDefaultFragShaderMain=function(e,t){return`\n void main() {\n int indices[${t}];\n toVec(TexCoords, indices);\n vec4 result = vec4(process(indices));\n ${i(e).output} = result;\n }\n `}},9314:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VecGlslLib=void 0;const r=n(1997);class i extends r.GlslLib{constructor(e){super(e)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const e=this.context.outputTextureLayout.shape.length,t={add:"+=",sub:"-=",mul:"*=",div:"/="},n={};for(const i in t){const o=`${i}Vec`;let s="";for(let n=0;n<e;++n)s+=`\n dest[${n}] ${t[i]} src[${n}];\n `;const a=`\n void ${o}(int src[${e}], out int dest[${e}]) {\n ${s}\n }\n `;n[o]=new r.GlslLibRoutine(a)}return n}copyVec(){const e=this.context.outputTextureLayout.shape.length;let t="";for(let n=0;n<e;++n)t+=`\n dest[${n}] = src[${n}];\n `;const n=`\n void copyVec(int src[${e}], out int dest[${e}]) {\n ${t}\n }\n `;return{copyVec:new r.GlslLibRoutine(n)}}setVecItem(){const e=this.context.outputTextureLayout.shape.length;let t=`\n if(index < 0)\n index =${e} + index;\n if (index == 0)\n m[0] = value;\n `;for(let n=1;n<e-1;++n)t+=`\n else if (index == ${n})\n m[${n}] = value;\n `;t+=`\n else\n m[${e-1}] = value;\n `;const n=`\n void setVecItem(out int m[${e}], int index, int value) {\n ${t}\n }\n `;return{setVecItem:new r.GlslLibRoutine(n)}}getVecItem(){const e=this.context.outputTextureLayout.shape.length;let t=`\n if(index < 0)\n index = ${e} + index;\n if (index == 0)\n return m[0];\n `;for(let n=1;n<e-1;++n)t+=`\n else if (index == ${n})\n return m[${n}];\n `;t+=`\n else\n return m[${e-1}];\n `;const n=`\n int getVecItem(int m[${e}], int index) {\n ${t}\n }\n `;return{getVecItem:new r.GlslLibRoutine(n)}}}t.VecGlslLib=i},7860:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLInferenceHandler=void 0;const r=n(1315),i=n(9240),o=n(7273),s=n(9),a=n(7379),u=n(2488),c=n(540),l=n(3314),d=n(5639);t.WebGLInferenceHandler=class{constructor(e){this.session=e,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(e,t){return(0,l.calculateTextureWidthAndHeight)(this.session.layoutStrategy,e,t)}executeProgram(e,t){if(t.length<e.inputNames.length)throw new Error(`Input size mustn't be less than ${e.inputNames.length}.`);if(e.inputNames.length!==e.inputTypes.length)throw new Error("input names size does not match input types");const n=[];for(let r=0;r<e.inputNames.length;++r)n[r]=this.getOrCreateTextureData(t[r],e.inputTypes[r]);const r=((e,t)=>{const n=t.map((e=>`${e.unpackedShape.join(",")};${e.width}x${e.height}`)).join("_");let r=e.name;return e.cacheHint&&(r+="["+e.cacheHint+"]"),r+=":"+n,r})(e,n);let i=this.session.programManager.getArtifact(r);const o=i?i.programInfo:"function"==typeof e.get?e.get():e,s=(0,l.createTextureLayoutFromTextureType)(this.session.layoutStrategy,o.output.dims,o.output.textureType),a=this.createTextureData(s,o.output.type);return i||(i=this.session.programManager.build(o,n,a),this.session.programManager.setArtifact(r,i)),this.runProgram(i,n,a),a}run(e,t){return this.executeProgram(e,t).tensor}runProgram(e,t,n){for(let n=0;n<t.length;++n)if(!!t[n].isPacked!=(e.programInfo.inputTypes[n]===d.TextureType.packed))throw new Error(`input[${n}] property packed inconsistent`);if(!!n.isPacked!=(e.programInfo.output.textureType===d.TextureType.packed))throw new Error("output property packed inconsistent");this.session.programManager.run(e,t,n)}getOrCreateTextureData(e,t){let n=this.getTextureData(e.dataId,t===d.TextureType.packed);if(!n&&(n=this.getTextureData(e.dataId,t!==d.TextureType.packed),n))return t===d.TextureType.packed?this.pack(n):this.unpack(n);if(!n){const r=(0,l.createTextureLayoutFromTextureType)(this.session.layoutStrategy,e.dims,t);if(t===d.TextureType.packedLastDimension){const n=1,r=4,i=e.dims;if(4===i.length){const o=[i[0],Math.ceil(i[1]*i[2]*i[3]/r)],s=(0,l.createTextureLayoutFromTextureType)(this.session.layoutStrategy,o,t);let a=e.numberData;if(i[1]*i[2]*i[3]%r!=0){const t=i[0],o=i[1]*i[2]*i[3],s=Math.ceil(o*n/r)*r;a=new Float32Array(t*s);for(let r=0;r<t;++r){const t=r*o,i=r*s+r%n*o;a.set(e.numberData.subarray(t,t+o),i)}}return this.createTextureData(s,e.type,a,e,1)}}if(t===d.TextureType.packed){const t=(0,l.createTextureLayoutFromShape)(this.session.layoutStrategy,e.dims,1,[],{reverseWH:!0}),r=this.createTextureData(t,e.type,e.numberData,e,1);n=this.pack(r)}else n=this.createTextureData(r,e.type,e.numberData,e,1)}return n}createTextureDataFromLayoutBindTensor(e,t,n,r){return this.createTextureData(e,t,n,r,1)}createTextureData(e,t,n,i,o){r.Logger.verbose("InferenceHandler",`Creating TextureData: layout:[${JSON.stringify(e)}]`);const s=this.session.textureManager.createTextureFromLayout(t,e,n,o);return this.createTextureDataFromTexture(e,t,s,i)}reshapeUnpacked(e,t){const n=this.getOrCreateTextureData(e,d.TextureType.unpacked),r={channels:n.channels,height:n.height,width:n.width,shape:0!==t.length?t:[1],strides:o.ShapeUtil.computeStrides(t),unpackedShape:t};return this.createTextureDataFromTexture(r,e.type,n.texture).tensor}reshapePacked(e,t){const n=this.getOrCreateTextureData(e,d.TextureType.packed);if((0,a.isReshapeCheap)(e.dims,t)){const r={channels:n.channels,height:n.height,width:n.width,shape:0!==t.length?t:[1],strides:o.ShapeUtil.computeStrides(t),unpackedShape:t,isPacked:!0};return this.createTextureDataFromTexture(r,e.type,n.texture).tensor}const r=(0,a.processDims3D)(e.dims),i=(0,a.processDims3D)(t),s=this.reshapePacked(e,r),u=this.run((0,a.createPackedReshape3DProgramInfoLoader)(this,s,i),[s]);return this.reshapePacked(u,t)}cast(e,t){const n=this.getOrCreateTextureData(e,d.TextureType.unpacked);return this.createTextureDataFromTexture(n,t,n.texture).tensor}createTextureDataFromTexture(e,t,n,r,o){const s=Object.assign(Object.assign({},e),{tensor:r||new i.Tensor(e.unpackedShape,t,(e=>this.readTexture(s)),(async e=>this.readTextureAsync(s)),void 0,o),texture:n});return this.setTextureData(s.tensor.dataId,s,e.isPacked),s}getTextureData(e,t=!1){return this.session.isInitializer(e)?this.session.getTextureData(e,t):t?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,t,n=!1){this.session.isInitializer(e)?this.session.setTextureData(e,t,n):(n?this.packedTextureDataCache:this.unpackedTextureDataCache).set(e,t)}isTextureLayoutCached(e,t=!1){return!!this.getTextureData(e.dataId,t)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((e=>this.session.textureManager.releaseTexture(e))),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((e=>this.session.textureManager.releaseTexture(e))),this.unpackedTextureDataCache=new Map}readTexture(e){return e.isPacked?this.readTexture(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,u.encodeAsUint8)(this,e))}async readTextureAsync(e){return e.isPacked?this.readTextureAsync(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,u.encodeAsUint8)(this,e))}pack(e){return this.executeProgram((0,s.createPackProgramInfoLoader)(this,e.tensor),[e.tensor])}unpack(e){return this.executeProgram((0,c.createUnpackProgramInfoLoader)(this,e.tensor),[e.tensor])}}},4110:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WEBGL_OP_RESOLVE_RULES=void 0;const s=n(8817),a=o(n(5194)),u=n(4752),c=n(6668),l=n(9754),d=n(5042),f=n(6742),h=n(4125),p=n(6149),g=n(5378),m=n(6981),b=n(7413),y=n(7006),v=n(8276),_=n(5565),w=n(2834),x=n(1010),T=n(8126),S=n(2801),O=n(565),E=n(2444),P=n(815),A=n(564),C=n(5416),I=n(1240),R=n(5944),M=n(5707),k=o(n(9087)),D=n(7862),j=n(3980);t.WEBGL_OP_RESOLVE_RULES=[["Abs","","6+",k.abs],["Acos","","7+",k.acos],["Add","","7+",a.add],["And","","7+",a.and],["Asin","","7+",k.asin],["Atan","","7+",k.atan],["AveragePool","","7+",w.averagePool,w.parseAveragePoolAttributes],["BatchNormalization","","7+",s.batchNormalization,s.parseBatchNormalizationAttributes],["Cast","","6+",u.cast,u.parseCastAttributes],["Ceil","","6+",k.ceil],["Clip","","6-10",k.clip,k.parseClipAttributes],["Clip","","11+",k.clipV11],["Concat","","4+",c.concat,c.parseConcatAttributes],["Conv","","1+",l.conv,l.parseConvAttributes],["ConvTranspose","","1+",d.convTranspose,d.parseConvTransposeAttributes],["Cos","","7+",k.cos],["Div","","7+",a.div],["Dropout","","7+",k.identity],["DepthToSpace","","1+",f.depthToSpace,f.parseDepthToSpaceAttributes],["Equal","","7+",a.equal],["Elu","","6+",k.elu,k.parseEluAttributes],["Exp","","6+",k.exp],["Flatten","","1+",h.flatten,h.parseFlattenAttributes],["Floor","","6+",k.floor],["FusedConv","com.microsoft","1+",l.conv,l.parseConvAttributes],["Gather","","1+",p.gather,p.parseGatherAttributes],["Gemm","","7-10",g.gemm,g.parseGemmAttributesV7],["Gemm","","11+",g.gemm,g.parseGemmAttributesV11],["GlobalAveragePool","","1+",w.globalAveragePool,w.parseGlobalAveragePoolAttributes],["GlobalMaxPool","","1+",w.globalMaxPool],["Greater","","7+",a.greater],["Identity","","1+",k.identity],["ImageScaler","","1+",m.imageScaler,m.parseImageScalerAttributes],["InstanceNormalization","","6+",b.instanceNormalization,b.parseInstanceNormalizationAttributes],["LeakyRelu","","6+",k.leakyRelu,k.parseLeakyReluAttributes],["Less","","7+",a.less],["LRN","","1+",y.lrn,y.parseLrnAttributes],["Log","","6+",k.log],["MatMul","","1+",v.matMul,v.parseMatMulAttributes],["MaxPool","","1+",w.maxPool,w.parseMaxPoolAttributes],["Mul","","7+",a.mul],["Neg","","6+",k.neg],["Not","","1+",k.not],["Or","","7+",a.or],["Pad","","2-10",_.padV2,_.parsePadAttributesV2],["Pad","","11+",_.padV11,_.parsePadAttributesV11],["Pow","","7+",a.pow],["PRelu","","7+",a.pRelu],["ReduceLogSum","","1+",x.reduceLogSum,x.parseReduceAttributes],["ReduceMax","","1+",x.reduceMax,x.parseReduceAttributes],["ReduceMean","","1+",x.reduceMean,x.parseReduceAttributes],["ReduceMin","","1+",x.reduceMin,x.parseReduceAttributes],["ReduceProd","","1+",x.reduceProd,x.parseReduceAttributes],["ReduceSum","","1-12",x.reduceSum,x.parseReduceAttributes],["ReduceSumSquare","","1+",x.reduceLogSumSquare,x.parseReduceAttributes],["Relu","","6+",k.relu],["Reshape","","5+",T.reshape],["Resize","","10",S.resize,S.parseResizeAttributesV10],["Resize","","11+",S.resize,S.parseResizeAttributesV11],["Shape","","1+",O.shape],["Sigmoid","","6+",k.sigmoid],["Sin","","7+",k.sin],["Slice","","10+",E.sliceV10],["Slice","","1-9",E.slice,E.parseSliceAttributes],["Softmax","","1-12",P.softmax,P.parseSoftmaxAttributes],["Softmax","","13+",P.softmaxV13,P.parseSoftmaxAttributesV13],["Split","","2-12",A.split,A.parseSplitAttributes],["Sqrt","","6+",k.sqrt],["Squeeze","","1-12",C.squeeze,C.parseSqueezeAttributes],["Squeeze","","13+",C.squeezeV13],["Sub","","7+",a.sub],["Sum","","6+",I.sum],["Tan","","7+",k.tan],["Tanh","","6+",k.tanh],["Tile","","6+",R.tile],["Transpose","","1+",M.transpose,M.parseTransposeAttributes],["Upsample","","7-8",j.upsample,j.parseUpsampleAttributesV7],["Upsample","","9",j.upsample,j.parseUpsampleAttributesV9],["Unsqueeze","","1-12",D.unsqueeze,D.parseUnsqueezeAttributes],["Unsqueeze","","13+",D.unsqueezeV13],["Xor","","7+",a.xor]]},8817:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBatchNormalizationAttributes=t.batchNormalization=void 0;const r=n(4910),i=n(6757),o=n(5639),s={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]};t.batchNormalization=(e,t,n)=>(u(t),[e.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>a(e,t,n)}),t)]),t.parseBatchNormalizationAttributes=e=>{const t=e.attributes.getFloat("epsilon",1e-5),n=e.attributes.getFloat("momentum",.9),i=e.attributes.getInt("spatial",1);return(0,r.createAttributeWithCacheKey)({epsilon:t,momentum:n,spatial:i})};const a=(e,t,n)=>{const r=(0,i.getGlsl)(e.session.backend.glContext.version),a=t[0].dims.length,[u,c]=e.calculateTextureWidthAndHeight(t[1].dims,o.TextureType.unpacked),l=`\n float process(int[${a}] indices) {\n vec2 position = offsetToCoords(indices[1], ${u}, ${c});\n float scale = getColorAsFloat(${r.texture2D}(Scale, position));\n float mean = getColorAsFloat(${r.texture2D}(Mean, position));\n float variance = getColorAsFloat(${r.texture2D}(Variance, position));\n float b = getColorAsFloat(${r.texture2D}(B, position));\n\n return scale * ( (_A(indices) - mean) / sqrt(variance + float(${n.epsilon})) ) + b;\n }`;return Object.assign(Object.assign({},s),{output:{dims:t[0].dims,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:l})},u=e=>{if(!e||5!==e.length)throw new Error("BatchNormalization requires 5 inputs.");const t=e[0],n=e[1],r=e[2],i=e[3],o=e[4];if(t.dims.length<3||1!==n.dims.length||1!==r.dims.length||1!==i.dims.length||1!==o.dims.length)throw new Error("invalid input shape.");if(n.dims[0]!==t.dims[1]||r.dims[0]!==t.dims[1]||i.dims[0]!==t.dims[1]||o.dims[0]!==t.dims[1])throw new Error("invalid input shape.");if("float32"!==t.type&&"float64"!==t.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type||"float32"!==i.type&&"float64"!==i.type||"float32"!==o.type&&"float64"!==o.type)throw new Error("invalid input tensor types.")}},5194:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xor=t.sub=t.pRelu=t.pow=t.or=t.mul=t.less=t.greater=t.equal=t.div=t.and=t.add=t.glslPRelu=t.glslPow=t.glslXor=t.glslOr=t.glslAnd=t.glslLess=t.glslGreater=t.glslEqual=t.glslSub=t.glslMul=t.glslDiv=t.glslAdd=void 0;const r=n(7273),i=n(1997),o=n(6757),s=n(5639);function a(){const e="add_";return{body:`\n float ${e}(float a, float b) {\n return a + b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 + v2;\n }\n `,name:e,type:i.FunctionType.ValueBased}}function u(){const e="div_";return{body:`\n float ${e}(float a, float b) {\n return a / b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 / v2;\n }\n `,name:e,type:i.FunctionType.ValueBased}}function c(){const e="mul_";return{body:`\n float ${e}(float a, float b) {\n return a * b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 * v2;\n }\n `,name:e,type:i.FunctionType.ValueBased}}function l(){const e="sub_";return{body:`\n float ${e}(float a, float b) {\n return a - b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 - v2;\n }\n `,name:e,type:i.FunctionType.ValueBased}}function d(){const e="equal_";return{body:`\n float ${e}(float a, float b) {\n return float(a == b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4(equal(v1, v2));\n }\n `,name:e,type:i.FunctionType.ValueBased}}function f(){const e="greater_";return{body:`\n float ${e}(float a, float b) {\n return float(a > b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4( v1.r > v2.r ,\n v1.g > v2.g,\n v1.b > v2.b,\n v1.a > v2.a );\n }\n `,name:e,type:i.FunctionType.ValueBased}}function h(){const e="less_";return{body:`\n float ${e}(float a, float b) {\n return float(a < b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4( v1.r < v2.r ,\n v1.g < v2.g,\n v1.b < v2.b,\n v1.a < v2.a );\n }\n `,name:e,type:i.FunctionType.ValueBased}}function p(){const e="and_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) && bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r && b2.r ,\n b1.g && b2.g,\n b1.b && b2.b,\n b1.a && b2.a );\n }\n `,name:e,type:i.FunctionType.ValueBased}}function g(){const e="or_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) || bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r || b2.r ,\n b1.g || b2.g,\n b1.b || b2.b,\n b1.a || b2.a );\n }\n `,name:e,type:i.FunctionType.ValueBased}}function m(){const e="xor_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) ^^ bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r ^^ b2.r ,\n b1.g ^^ b2.g,\n b1.b ^^ b2.b,\n b1.a ^^ b2.a );\n }\n `,name:e,type:i.FunctionType.ValueBased}}function b(){return function(e){const t=`${e}_`;return{body:`\n float ${t}(float a, float b) {\n return ${e}(a, b);\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return ${e}(v1, v2);\n }\n `,name:t,type:i.FunctionType.ValueBased}}("pow")}function y(){const e="prelu_";return{body:`\n float ${e}(float a, float b) {\n return a < 0.0 ? a * b: a;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4(\n v1.r < 0.0 ? v1.r * v2.r: v1.r,\n v1.g < 0.0 ? v1.g * v2.g: v1.g,\n v1.b < 0.0 ? v1.b * v2.b: v1.b,\n v1.a < 0.0 ? v1.a * v2.a: v1.a\n );\n }\n `,name:e,type:i.FunctionType.ValueBased}}t.glslAdd=a,t.glslDiv=u,t.glslMul=c,t.glslSub=l,t.glslEqual=d,t.glslGreater=f,t.glslLess=h,t.glslAnd=p,t.glslOr=g,t.glslXor=m,t.glslPow=b,t.glslPRelu=y;const v=(e,t,n,r=t[0].type,i)=>{const o=e.session.pack?s.TextureType.packed:s.TextureType.unpacked;return{name:n.name,inputNames:["A","B"],inputTypes:[o,o],cacheHint:i,get:()=>_(e,t,n,r)}},_=(e,t,n,i=t[0].type)=>{const a=e.session.pack?s.TextureType.packed:s.TextureType.unpacked,u=!r.ShapeUtil.areEqual(t[0].dims,t[1].dims);let c=t[0].dims;const l=e.session.pack;if(u){const s=r.BroadcastUtil.calcShape(t[0].dims,t[1].dims,!1);if(!s)throw new Error("Can't perform binary op on the given tensors");c=s;const u=c.length,d=0!==t[0].dims.length?t[0].dims.length:1,f=0!==t[1].dims.length?t[1].dims.length:1,h=0!==t[0].dims.length?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",p=0!==t[1].dims.length?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",g=(0,o.getGlsl)(e.session.backend.glContext.version),m=l?`\n ${n.body}\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n vec4 result = ${n.name}(a, b);\n ${g.output} = result;\n }`:`\n ${n.body}\n float process(int indices[${u}]) {\n int aindices[${d}];\n int bindices[${f}];\n ${h}\n ${p}\n return ${n.name}(_A(aindices), _B(bindices));\n }`;return{name:n.name,inputNames:["A","B"],inputTypes:[a,a],output:{dims:c,type:i,textureType:a},shaderSource:m,hasMain:l}}const d=(0,o.getGlsl)(e.session.backend.glContext.version),f=`\n ${n.body}\n void main() {\n vec4 v1 = ${d.texture2D}(A, TexCoords);\n vec4 v2 = ${d.texture2D}(B, TexCoords);\n vec4 result = ${n.name}(v1, v2);\n ${d.output} = result;\n }\n `;return{name:n.name,inputNames:["A","B"],inputTypes:[a,a],output:{dims:t[0].dims,type:i,textureType:a},shaderSource:f,hasMain:!0}};t.add=(e,t)=>[e.run(v(e,t,a()),t)],t.and=(e,t)=>[e.run(v(e,t,p(),"bool"),t)],t.div=(e,t)=>[e.run(v(e,t,u()),t)],t.equal=(e,t)=>[e.run(v(e,t,d(),"bool"),t)],t.greater=(e,t)=>[e.run(v(e,t,f(),"bool"),t)],t.less=(e,t)=>[e.run(v(e,t,h(),"bool"),t)],t.mul=(e,t)=>[e.run(v(e,t,c()),t)],t.or=(e,t)=>[e.run(v(e,t,g(),"bool"),t)],t.pow=(e,t)=>[e.run(v(e,t,b()),t)],t.pRelu=(e,t)=>[e.run(v(e,t,y()),t)],t.sub=(e,t)=>[e.run(v(e,t,l()),t)],t.xor=(e,t)=>[e.run(v(e,t,m(),"bool"),t)]},4752:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCastAttributes=t.cast=void 0;const r=n(7273);t.cast=(e,t,n)=>(i(t),[e.cast(t[0],n)]),t.parseCastAttributes=e=>r.ProtoUtil.tensorDataTypeFromProto(e.attributes.getInt("to"));const i=e=>{if(!e||1!==e.length)throw new Error("Cast requires 1 input.");if("string"===e[0].type)throw new Error("Invalid input type.")}},4595:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedConcatProgramInfoLoader=void 0;const r=n(6757),i=n(5639),o=n(432),s=n(5614);t.createPackedConcatProgramInfoLoader=(e,t,n)=>{const u=(c=t.length,l=n.cacheKey,{name:"Concat (packed)",inputNames:Array.from({length:c},((e,t)=>`X${t}`)),inputTypes:Array(c).fill(i.TextureType.packed),cacheHint:l});var c,l;return Object.assign(Object.assign({},u),{get:()=>((e,t,n,u)=>{const c=n[0].dims.slice();if(u>=c.length||u<-1*c.length)throw new Error("axis specified for concat doesn't match input dimensionality");u<0&&(u=c.length+u);const l=c.slice(0);for(let e=1;e<n.length;e++){const t=n[e].dims.slice();for(let e=0;e<c.length;e++)if(e===u)l[u]+=t[e];else if(c[e]!==t[e])throw new Error("non concat dimensions must match")}const d=l.length,f=(0,s.getChannels)("coords",d),h=(0,o.getCoordsDataType)(d),p=(0,s.unpackFromChannel)(),g=n.map((e=>e.dims)),m=(0,o.getGlChannels)(d),b=new Array(g.length-1);b[0]=g[0][u];for(let e=1;e<b.length;e++)b[e]=b[e-1]+g[e][u];const y=m[u],v=m.slice(-2),_=m.join();let w=`if (${y} < ${b[0]}) {\n return getChannel(\n getX0(${_}), vec2(${v.join()}));\n }`;for(let e=1;e<b.length;e++){const t=b[e-1];w+=`\n if (${y} < ${b[e]} && ${y} >= ${b[e-1]}) {\n return getChannel(\n getX${e}(${a(m,y,t)}),\n vec2(${a(v,y,t)}));\n }`}const x=b.length,T=b[b.length-1];w+=`\n return getChannel(\n getX${x}(${a(m,y,T)}),\n vec2(${a(v,y,T)}));`;const S=(0,r.getGlsl)(e.session.backend.glContext.version),O=`\n ${p}\n float getValue(${m.map((e=>"int "+e))}) {\n ${w}\n }\n\n void main() {\n ${h} coords = getOutputCoords();\n int lastDim = coords.${m[d-1]};\n coords.${m[d-1]} = coords.${m[d-2]};\n coords.${m[d-2]} = lastDim;\n\n vec4 result = vec4(getValue(${f}), 0., 0., 0.);\n\n ${f[d-1]} = ${f[d-1]} + 1;\n if (${f[d-1]} < ${l[d-1]}) {\n result.g = getValue(${f});\n }\n\n ${f[d-2]} = ${f[d-2]} + 1;\n if (${f[d-2]} < ${l[d-2]}) {\n result.a = getValue(${f});\n }\n\n ${f[d-1]} = ${f[d-1]} - 1;\n if (${f[d-2]} < ${l[d-2]} &&\n ${f[d-1]} < ${l[d-1]}) {\n result.b = getValue(${f});\n }\n ${S.output} = result;\n }\n `;return Object.assign(Object.assign({},t),{output:{dims:l,type:n[0].type,textureType:i.TextureType.packed},shaderSource:O,hasMain:!0})})(e,u,t,n.axis)})};const a=(e,t,n)=>{const r=e.indexOf(t);return e.map(((e,t)=>t===r?`${e} - ${n}`:e)).join()}},6668:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseConcatAttributes=t.concat=void 0;const r=n(4910),i=n(5639),o=n(4595);t.concat=(e,t,n)=>(d(t),e.session.pack&&t[0].dims.length>1?[e.run((0,o.createPackedConcatProgramInfoLoader)(e,t,n),t)]:[e.run(s(e,t,n),t)]);const s=(e,t,n)=>{const r=(o=t.length,s=n.cacheKey,{name:"Concat",inputNames:Array.from({length:o},((e,t)=>`X${t}`)),inputTypes:Array(o).fill(i.TextureType.unpacked),cacheHint:s});var o,s;return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const o=n[0].dims.slice();if(r>=o.length||r<-1*o.length)throw new Error("axis specified for concat doesn't match input dimensionality");r<0&&(r=o.length+r);const s=o.slice(0);for(let e=1;e<n.length;e++){const t=n[e].dims.slice();for(let e=0;e<o.length;e++)if(e===r)s[r]+=t[e];else if(o[e]!==t[e])throw new Error("non concat dimensions must match")}const d=s.length,f=new Array(n.length);let h=0;for(let e=0;e<f.length;++e)h+=n[e].dims[r],f[e]=h;let p="";p=n.length<5?a(f):u(f);const g=`\n ${c(n.length,d)}\n ${l(f)}\n ${p}\n float process(int indices[${d}]) {\n int textureIndex = getTextureWhereDataResides (indices[${r}]);\n\n if(textureIndex != 0) {\n indices[${r}] = indices[${r}] - int(getSizeInConcatAxisValueFromIndex(textureIndex-int(1)));\n }\n\n return fetchDataFromCorrectTexture(textureIndex, indices);\n }`;return Object.assign(Object.assign({},t),{output:{dims:s,type:n[0].type,textureType:i.TextureType.unpacked},shaderSource:g})})(0,r,t,n.axis)})},a=e=>`int getTextureWhereDataResides(int index) {\n ${e.map(((e,t)=>`if(index<${e}) {return ${t};}\n`)).join("")}\n }`,u=e=>a(e),c=(e,t)=>{const n=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${t}]) {`];for(let t=0;t<e;++t)0===t?n.push(`\tif (textureIndex == ${t}) { return _X${t}(indices); }`):t===e-1?n.push(`\telse { return _X${t}(indices); }`):n.push(`\telse if (textureIndex == ${t}) { return _X${t}(indices); }`);return n.push("\t}"),n.join("\n")},l=e=>{const t=["int getSizeInConcatAxisValueFromIndex(int index) {"];for(let n=0;n<e.length;++n)0===n?t.push(`\tif (index == ${n}) { return ${e[n]}; }`):n===e.length-1?t.push(`\telse { return ${e[n]}; }`):t.push(`\telse if (index == ${n}) { return ${e[n]}; }`);return t.push("\t}"),t.join("\n")};t.parseConcatAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis")});const d=e=>{if(!e||e.length<1)throw new Error("too few inputs");const t=e[0].type,n=e[0].dims.length;if("string"===t)throw new Error("string tensor is not supported yet");for(const r of e){if(r.type!==t)throw new Error("input tensors should be one type");if(r.dims.length!==n)throw new Error("input tensors should have the same shape")}}},7825:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnpackedGroupedConvProgramInfoLoader=void 0;const r=n(1315),i=n(6757),o=n(5639),s=n(9754),a=n(2150);t.createUnpackedGroupedConvProgramInfoLoader=(e,t,n)=>{const u=(c=t.length>2,l=n.cacheKey,{name:"GroupedConv",inputNames:c?["X","W","Bias"]:["X","W"],inputTypes:c?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:l});var c,l;return Object.assign(Object.assign({},u),{get:()=>((e,t,n,u)=>{const c=t.length>2?"value += getBias(output_channel);":"",l=t[0].dims.slice(),d=t[1].dims.slice(),f=d[0]/u.group;r.Logger.verbose("GroupedConv",`autpPad:${u.autoPad}, dilations:${u.dilations}, group:${u.group}, kernelShape:${u.kernelShape}, pads:${u.pads}, strides:${u.strides}`);const h=(0,s.calculateOutputShape)(l,d,u.dilations,u.pads,u.strides),p=(0,i.getGlsl)(e.session.backend.glContext.version),{activationFunction:g,applyActivation:m}=(0,a.getActivationSnippet)(u),b=`\n const ivec2 strides = ivec2(${u.strides[0]}, ${u.strides[1]});\n const ivec2 pads = ivec2(${u.pads[0]}, ${u.pads[1]});\n ${g}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n ivec2 xRCCorner = coords.zw * strides - pads;\n int group_id = output_channel / ${f};\n\n float value = 0.0;\n for (int wInChannel = 0; wInChannel < ${d[1]}; wInChannel++) {\n int input_channel = group_id * ${d[1]} + wInChannel;\n for (int wHeight = 0; wHeight < ${d[2]}; wHeight++) {\n int xHeight = xRCCorner.x + wHeight * ${u.dilations[0]};\n\n if (xHeight < 0 || xHeight >= ${l[2]}) {\n continue;\n }\n\n for (int wWidth = 0; wWidth < ${d[3]}; wWidth++) {\n int xWidth = xRCCorner.y + wWidth * ${u.dilations[1]};\n if (xWidth < 0 || xWidth >= ${l[3]}) {\n continue;\n }\n\n float xVal = getX(batch, input_channel, xWidth, xHeight);\n float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\n value += xVal*wVal;\n }\n }\n }\n ${c}\n ${m}\n ${p.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:h,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:b,hasMain:!0})})(e,t,u,n)})}},7708:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conv2DPacked=t.conv2DPackedPointwise=void 0;const r=n(9754),i=n(5950),o=n(5632);t.conv2DPackedPointwise=(e,t,n)=>{const i=t[0].dims,s=t[1].dims,a=(0,r.calculateOutputShape)(i,s,n.dilations,n.pads,n.strides),u=e.reshapePacked(t[0],[i[1],i[2]*i[3]]),c=e.reshapePacked(t[1],[s[0],s[1]]),l=t.length>2?[c,u,t[2]]:[c,u],d=e.run((0,o.createPackedMatmulProgramInfoLoader)(e,l,n),l);return e.reshapePacked(d,a)},t.conv2DPacked=(e,t,n)=>{const s=t[0].dims,a=t[1].dims,u=(0,r.calculateOutputShape)(s,a,n.dilations,n.pads,n.strides),c=e.run((0,i.createPackedIm2ColProgramInfoLoader)(e,t[0],t[1],u,n),[t[0]]),l=e.reshapePacked(t[1],[a[0],a[1]*a[2]*a[3]]),d=3===t.length?[l,c,t[2]]:[l,c],f=e.run((0,o.createPackedMatmulProgramInfoLoader)(e,d,n),d);return e.reshapePacked(f,u)}},5042:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseConvTransposeAttributes=t.convTranspose=void 0;const r=n(4910),i=n(6757),o=n(5639),s=n(2150),a=(e,t,n,r,i,o)=>(e-1)*t+n+(r-1)*i+1-o,u=(e,t,n,r,i)=>{const o=Math.floor(e/2);"SAME_UPPER"===t?(n[r]=o,n[i]=e-o):"SAME_LOWER"===t&&(n[r]=e-o,n[i]=o)};t.convTranspose=(e,t,n)=>(f(t,n),c(e,t,n));const c=(e,t,n)=>{const r=d(n,t);return[l(e,t,r)]},l=(e,t,n)=>e.run(((e,t,n)=>{const r=(a=t.length>2,u=n.cacheKey,{name:"ConvTranspose",inputNames:a?["X","W","B"]:["X","W"],inputTypes:a?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:u});var a,u;return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const a=t.length>2?"getB(output_channel)":"0.0",u=t[0].dims,c=t[1].dims,l=c[1],d=c[0]/r.group,f=[t[0].dims[0],t[1].dims[1]*r.group,...r.outputShape],h=(0,i.getGlsl)(e.session.backend.glContext.version),{activationFunction:p,applyActivation:g}=(0,s.getActivationSnippet)(r),m=`\n const ivec2 strides = ivec2(${r.strides[0]}, ${r.strides[1]});\n const ivec2 pads = ivec2(${r.pads[0]}, ${r.pads[1]});\n ${p}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n\n ivec2 loc = coords.zw + pads;\n\n int group_id = output_channel / ${l};\n int wOutChannel = output_channel - group_id * ${l};\n\n float value = ${a};\n for (int inChannelOffset = 0; inChannelOffset < ${d}; inChannelOffset++) {\n int input_channel = group_id * ${d} + inChannelOffset;\n for (int wWOff = 0; wWOff < ${c[2]}; wWOff++) {\n for (int wHOff = 0; wHOff < ${c[3]}; wHOff++) {\n ivec2 wOff = ivec2(wWOff * ${r.dilations[0]}, wHOff * ${r.dilations[1]});\n ivec2 wLoc = loc - wOff;\n ivec2 wLocIn = wLoc / strides;\n if (\n wLocIn * strides == wLoc &&\n wLocIn.x >= 0 && wLocIn.x < ${u[2]} &&\n wLocIn.y >= 0 && wLocIn.y < ${u[3]}\n ) {\n float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\n float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\n value += xVal * wVal;\n }\n }\n }\n }\n ${g}\n ${h.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:f,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:m,hasMain:!0})})(e,t,r,n)})})(e,t,n),t),d=(e,t)=>{const n=e.kernelShape.slice();if(0===e.kernelShape.length)for(let e=2;e<t[1].dims.length;++e)n.push(t[1].dims[e]);const r=e.pads.slice(),i=e.outputShape.slice();((e,t,n,r,i,o,s,c)=>{const l=e.length-2,d=0===c.length;for(let f=0;f<l;++f){const h=d?e[f+2]*o[f]:c[f],p=a(e[f+2],o[f],i[f],t[f],n[f],h);u(p,r,i,f,f+l),d&&c.push(o[f]*(e[f+2]-1)+s[f]+(t[f]-1)*n[f]+1-i[f]-i[f+l])}})(t[0].dims,n,e.dilations,e.autoPad,r,e.strides,e.outputPadding,i);const o=Object.assign({},e);return Object.assign(o,{kernelShape:n,pads:r,outputShape:i,cacheKey:e.cacheKey}),o};t.parseConvTransposeAttributes=e=>{const t=e.attributes,n=(0,s.parseInternalActivationAttributes)(t),i=t.getString("auto_pad","NOTSET"),o=t.getInts("dilations",[1,1]),a=t.getInt("group",1),u=t.getInts("kernel_shape",[]),c=t.getInts("output_padding",[0,0]),l=t.getInts("output_shape",[]),d=t.getInts("pads",[0,0,0,0]),f=t.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:i,dilations:o,group:a,kernelShape:u,outputPadding:c,outputShape:l,pads:d,strides:f},n))};const f=(e,t)=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==e[0].dims.length||4!==e[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(e[0].dims[1]!==e[1].dims[0])throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");const n=e[1].dims[1]*t.group;if(3===e.length&&(1!==e[2].dims.length||e[2].dims[0]!==n))throw new Error("invalid bias");const r=e[0].dims.length-2;if(t.dilations.length!==r)throw new Error(`dilations should be ${r}D`);if(t.strides.length!==r)throw new Error(`strides should be ${r}D`);if(t.pads.length!==2*r)throw new Error(`pads should be ${2*r}D`);if(t.outputPadding.length!==r)throw new Error(`output_padding should be ${r}D`);if(0!==t.kernelShape.length&&t.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if(0!==t.outputShape.length&&t.outputShape.length!==e[0].dims.length-2)throw new Error("invalid output shape");if("float32"!==e[0].type||"float32"!==e[1].type)throw new Error("ConvTranspose input(X,W) should be float tensor");if(3===e.length&&"float32"!==e[2].type)throw new Error("ConvTranspose input(bias) should be float tensor")}},9754:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseConvAttributes=t.conv=t.calculateOutputShape=void 0;const r=n(4910),i=n(7273),o=n(7825),s=n(7708),a=n(3281),u=n(2150),c=n(1625),l=n(8276);t.calculateOutputShape=(e,t,n,r,i)=>{const o=e[0],s=e.slice(2),a=s.length,u=t[0],c=t.slice(2).map(((e,t)=>e+(e-1)*(n[t]-1))),l=s.map(((e,t)=>e+r[t]+r[t+a])).map(((e,t)=>Math.floor((e-c[t]+i[t])/i[t])));return[o,u].concat(...l)},t.conv=(e,t,n)=>(g(t,n),d(e,t,n));const d=(e,t,n)=>{const r=p(n,t),i=e.session.pack,a=1===r.kernelShape[0]&&1===r.kernelShape[1];return r.group>1?[e.run((0,o.createUnpackedGroupedConvProgramInfoLoader)(e,t,r),t)]:a&&i?[f(e,t,r)]:i&&4===t[0].dims.length&&1===t[0].dims[0]&&!a?[(0,s.conv2DPacked)(e,t,r)]:[h(e,t,r)]},f=(e,n,r)=>{const i=n[0].dims,o=n[1].dims,s=(0,t.calculateOutputShape)(i,o,r.dilations,r.pads,r.strides),a=e.reshapeUnpacked(n[0],[i[1],i[2]*i[3]]),u=e.reshapeUnpacked(n[1],[o[0],o[1]]),c=n.length>2?[u,a,n[2]]:[u,a],d=e.run((0,l.createMatmulProgramInfoLoader)(c,r),c);return e.reshapeUnpacked(d,s)},h=(e,n,r)=>{const i=n[0].dims,o=n[1].dims,s=(0,t.calculateOutputShape)(i,o,r.dilations,r.pads,r.strides),u=e.run((0,c.createIm2ColProgramInfoLoader)(e,n[0],n[1],s,r),[n[0]]),l=3===n.length?[u,n[1],n[2]]:[u,n[1]];return e.run((0,a.createDotProductProgramInfoLoader)(e,n,s,r),l)},p=(e,t)=>{const n=e.kernelShape.slice();if(0===e.kernelShape.length)for(let e=2;e<t[1].dims.length;++e)n.push(t[1].dims[e]);const r=e.pads.slice();i.PoolConvUtil.adjustPadsBasedOnAutoPad(t[0].dims,e.strides,e.dilations,n,r,e.autoPad);const o=Object.assign({},e);return Object.assign(o,{kernelShape:n,pads:r,cacheKey:e.cacheKey}),o};t.parseConvAttributes=e=>{const t=e.attributes,n=(0,u.parseInternalActivationAttributes)(t),i=t.getString("auto_pad","NOTSET"),o=t.getInts("dilations",[1,1]),s=t.getInt("group",1),a=t.getInts("kernel_shape",[]),c=t.getInts("pads",[0,0,0,0]),l=t.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:i,dilations:o,group:s,kernelShape:a,pads:c,strides:l},n))};const g=(e,t)=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==e[0].dims.length||4!==e[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(e[0].dims[1]!==e[1].dims[1]*t.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(3===e.length&&(1!==e[2].dims.length||e[1].dims[0]!==e[2].dims[0]))throw new Error("invalid bias");const n=e[0].dims.length-2;if(t.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(t.strides.length!==n)throw new Error(`strides should be ${n}D`);if(t.pads.length!==2*n)throw new Error(`pads should be ${2*n}D`);if(0!==t.kernelShape.length&&t.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if("float32"!==e[0].type||"float32"!==e[1].type)throw new Error("Conv input(X,W) should be float tensor");if(3===e.length&&"float32"!==e[2].type)throw new Error("Conv input(bias) should be float tensor")}},6742:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseDepthToSpaceAttributes=t.depthToSpace=void 0;const r=n(5707);t.depthToSpace=(e,t,n)=>{i(t);const o=n.blocksize,s=o*o,a="DCR"===n.mode?[0,3,4,1,5,2]:[0,1,4,2,5,3],u="DCR"===n.mode?[t[0].dims[0],o,o,t[0].dims[1]/s,t[0].dims[2],t[0].dims[3]]:[t[0].dims[0],t[0].dims[1]/s,o,o,t[0].dims[2],t[0].dims[3]],c=e.reshapeUnpacked(t[0],u),l={perm:a,cacheKey:`${a}`},[d]=(0,r.transpose)(e,[c],l),f=[t[0].dims[0],t[0].dims[1]/s,t[0].dims[2]*o,t[0].dims[3]*o];return[e.reshapeUnpacked(d,f)]},t.parseDepthToSpaceAttributes=e=>{const t=e.attributes.getInt("blocksize");if(t<1)throw new Error(`blocksize must be >= 1, but got : ${t} for DepthToSpace`);const n=e.attributes.getString("mode","DCR");if("DCR"!==n&&"CRD"!==n)throw new Error(`unrecognized mode: ${n} for DepthToSpace`);return{mode:n,blocksize:t}};const i=e=>{if(1!==e.length)throw new Error(`DepthToSpace expect 1 inputs, but got ${e.length}`);if("string"===e[0].type||4!==e[0].dims.length)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},3281:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDotProductProgramInfoLoader=void 0;const r=n(7273),i=n(6757),o=n(5639),s=n(2150),a=n(1625);t.createDotProductProgramInfoLoader=(e,t,n,u)=>{const c=((e,t)=>({name:"ConvDotProduct",inputNames:e?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:e?[o.TextureType.unpacked,o.TextureType.packedLastDimension,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.packedLastDimension],cacheKey:t.activationCacheKey}))(t.length>2,u);return Object.assign(Object.assign({},c),{get:()=>((e,t,n,u,c)=>{const l=n[0].dims,d=n[1].dims,f=[d[0],Math.ceil(l[1]*d[2]*d[3]/4)],h=(0,a.calculateIm2ColDims)(l,d,u),[p,g]=e.calculateTextureWidthAndHeight(f,o.TextureType.packedLastDimension),m=r.ShapeUtil.computeStrides(h),[b,y]=e.calculateTextureWidthAndHeight(h,o.TextureType.packedLastDimension),v=u.length,_=n.length<3?"0.0":"_B(b)",w=Math.ceil(l[1]*d[2]*d[3]/4),{activationFunction:x,applyActivation:T}=(0,s.getActivationSnippet)(c),S=(0,i.getGlsl)(e.session.backend.glContext.version),O=`\n${x}\nfloat process(int indices[${v}]) {\n int b[1];\n b[0] = indices[1];\n int im2col[4];\n im2col[0] = indices[0];\n im2col[1] = indices[2];\n im2col[2] = indices[3];\n int im2colOffset = im2col[0] * ${m[0]} + im2col[1] * ${m[1]} + im2col[2] * ${m[2]};\n int kernelOffset = indices[1] * ${f[1]};\n float value = ${_};\n for (int i = 0; i < ${w}; ++i) {\n vec2 im2colCoords = offsetToCoords(im2colOffset, ${b}, ${y});\n vec2 kernelCoords = offsetToCoords(kernelOffset, ${p}, ${g});\n value += dot(${S.texture2D}(Im2Col, im2colCoords), ${S.texture2D}(K, kernelCoords));\n ++im2colOffset;\n ++kernelOffset;\n }\n ${T}\n return value;\n}`;return Object.assign(Object.assign({},t),{output:{dims:u,type:n[0].type,textureType:o.TextureType.unpacked},shaderSource:O})})(e,c,t,n,u)})}},4125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseFlattenAttributes=t.flatten=void 0;const r=n(7273);t.flatten=(e,t,n)=>{i(t,n);const o=r.ShapeUtil.flattenShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],o)]},t.parseFlattenAttributes=e=>e.attributes.getInt("axis",1);const i=(e,t)=>{if(!e||1!==e.length)throw new Error("Flatten requires 1 input.");const n=e[0].dims.length;if(0===n)throw new Error("scalar tensor is not supported.");if(t<-n||t>n)throw new Error("Invalid axis");if("string"===e[0].type)throw new Error("string tensor is not supported.")}},2150:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseInternalActivationAttributes=t.getActivationSnippet=void 0;const r=n(7273),i=n(9087);t.getActivationSnippet=function(e){let t;switch(e.activation){case"Relu":t=(0,i.glslRelu)();break;case"Sigmoid":t=(0,i.glslSigmoid)();break;case"Clip":t=(0,i.glslClip)(e.clipMin,e.clipMax);break;default:return{activationFunction:"",applyActivation:""}}const n=t.name;return{activationFunction:t.body,applyActivation:`value = ${n}_(value);`}},t.parseInternalActivationAttributes=e=>{const t=e.getString("activation","");if("Clip"===t){const[n,i]=e.getFloats("activation_params",[r.MIN_CLIP,r.MAX_CLIP]);return{activation:t,clipMax:i,clipMin:n,activationCacheKey:`${t}:${n},${i}`}}return{activation:t,activationCacheKey:t}}},6149:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseGatherAttributes=t.gather=void 0;const r=n(4910),i=n(6145),o=n(7273),s=n(5639);t.gather=(e,t,n)=>(c(t,n.axis),[e.run(u(e,t,n),t)]),t.parseGatherAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",0)});const a={name:"Gather",inputNames:["A","B"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked]},u=(e,t,n)=>{const r=Object.assign(Object.assign({},a),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const i=n[0].dims.slice(),a=n[1].dims.slice(),u=new Array(i.length+a.length-1);r=o.ShapeUtil.normalizeAxis(r,i.length);const c=[];for(let e=0;e<u.length;e++)e<r?(u[e]=i[e],c.push(`inputIdx[${e}] = outputIdx[${e}];`)):e<r+a.length?(u[e]=a[e-r],c.push(`indexDataIdx[${e-r}] = outputIdx[${e}];`)):(u[e]=i[e-a.length+1],c.push(`inputIdx[${e-a.length+1}] = outputIdx[${e}];`));const l=`\n float process(int outputIdx[${u.length||1}]) {\n int inputIdx[${i.length}];\n int indexDataIdx[${a.length||1}];\n indexDataIdx[0] = 0;\n ${c.join("\n ")}\n int idx = int(_B(indexDataIdx));\n inputIdx[${r}] = idx < 0 ? idx + ${i[r]} : idx;\n return _A(inputIdx);\n }`;return Object.assign(Object.assign({},t),{output:{dims:u,type:n[0].type,textureType:s.TextureType.unpacked},shaderSource:l})})(0,r,t,n.axis)})},c=(e,t)=>{if(!e||2!==e.length)throw new Error("Gather requires 2 inputs.");const n=e[0].dims.length;if(n<1)throw new Error("Invalid input shape.");if(t<-n||t>n-1)throw new Error("Invalid axis.");if(-1===i.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invaid input type.");if("int32"!==e[1].type&&"int16"!==e[1].type)throw new Error("Invaid input type.")}},5378:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseGemmAttributesV11=t.parseGemmAttributesV7=t.gemm=void 0;const r=n(4910),i=n(7273),o=n(5639);t.gemm=(e,t,n)=>(c(t,n),[e.run(a(t,n),t)]);const s=(e,t)=>{const n=0!==e.attributes.getInt("transA",0),i=0!==e.attributes.getInt("transB",0),o=e.attributes.getFloat("alpha",1),s=e.attributes.getFloat("beta",1);return(0,r.createAttributeWithCacheKey)({transA:n,transB:i,alpha:o,beta:s,isOptionalC:t})};t.parseGemmAttributesV7=e=>s(e,!1),t.parseGemmAttributesV11=e=>s(e,!0);const a=(e,t)=>{const n={name:"Gemm",inputNames:3===e.length?["A","B","C"]:["A","B"],inputTypes:3===e.length?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],key:t.cacheKey};return Object.assign(Object.assign({},n),{get:()=>u(n,e,t)})},u=(e,t,n)=>{const r=t[0].dims.slice(),s=t[1].dims.slice(),[a,u]=i.GemmUtil.getShapeOfGemmResult(r,n.transA,s,n.transB,3===t.length?t[2].dims:void 0),c=[a,u];if(!c)throw new Error("Can't use gemm on the given tensors");let l=r[r.length-1],d="";n.transA&&(l=r[0]),n.transA&&n.transB?d="value += _A_T(a) * _B_T(b);":n.transA&&!n.transB?d="value += _A_T(a) * _B(b);":!n.transA&&n.transB?d="value += _A(a) * _B_T(b);":n.transA||n.transB||(d="value += _A(a) * _B(b);");const f=c.length,h=`\n float process(int indices[${f}]) {\n int a[${f}];\n int b[${f}];\n ${3===t.length?`int c[${t[2].dims.length}];`:""}\n\n copyVec(indices, a);\n copyVec(indices, b);\n ${3===t.length?"bcastIndices_C(indices, c);":""}\n\n float value = 0.0;\n for (int k=0; k<${l}; ++k) {\n a[${f-1}] = k;\n b[${f-2}] = k;\n ${d}\n }\n\n value = value * alpha;\n ${3===t.length?"value += beta * _C(c);":""}\n return value;\n }`;return Object.assign(Object.assign({},e),{output:{dims:c,type:t[0].type,textureType:o.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:n.alpha},{name:"beta",type:"float",data:n.beta}],shaderSource:h})},c=(e,t)=>{if(!e)throw new Error("Input is missing");if(t.isOptionalC&&(e.length<2||e.length>3))throw new Error("Invaid input shape.");if(!t.isOptionalC&&3!==e.length)throw new Error("Gemm requires 3 inputs");if(3===e.length&&1!==e[2].dims.length&&2!==e[2].dims.length)throw new Error("Invalid input shape of C");if("float32"!==e[0].type&&"float64"!==e[0].type||"float32"!==e[1].type&&"float64"!==e[1].type||3===e.length&&"float32"!==e[2].type&&"float64"!==e[2].type)throw new Error("Invalid input type.");if(e[0].type!==e[1].type||3===e.length&&e[0].type!==e[2].type)throw new Error("Input types are mismatched")}},5950:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedIm2ColProgramInfoLoader=void 0;const r=n(6757),i=n(5639),o=n(5614);t.createPackedIm2ColProgramInfoLoader=(e,t,n,s,a)=>{const u=(c=a.cacheKey,{name:"Im2Col (packed)",inputNames:["A"],inputTypes:[i.TextureType.packed],cacheHint:c});var c;return Object.assign(Object.assign({},u),{get:()=>((e,t,n,s,a,u)=>{const c=n.dims,l=s.dims,d=a.length,f=[l[1]*l[2]*l[3],a[2]*a[3]],h=l[2]*l[3],p=(0,o.unpackFromChannel)(),g=(0,r.getGlsl)(e.session.backend.glContext.version);let m="";for(let e=0;e<=1;e++)for(let t=0;t<=1;t++)m+=`\n blockIndex = rc.x + ${t};\n pos = rc.y + ${e};\n\n if(blockIndex < ${f[1]} && pos < ${f[0]}) {\n offsetY = int(blockIndex / (${a[d-1]})) * ${u.strides[0]} -\n ${u.pads[0]};\n d0 = offsetY + ${u.dilations[0]} * (imod(pos, ${h}) / ${l[2]});\n\n if(d0 < ${c[2]} && d0 >= 0) {\n offsetX = imod(blockIndex, ${a[d-1]}) * ${u.strides[1]} -\n ${u.pads[1]};\n d1 = offsetX + ${u.dilations[1]} * imod(imod(pos, ${h}), ${l[2]});\n\n if(d1 < ${c[3]} && d1 >= 0) {\n\n ch = int(float(pos)/ ${h}.);\n innerDims = vec2(d0, d1);\n result[${2*e+t}] = getChannel(\n getA(0, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n\n `;const b=`\n ${p}\n\n void main() {\n ivec2 rc = getOutputCoords();\n vec4 result = vec4(0.0);\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n ${m}\n ${g.output} = result;\n }\n `;return Object.assign(Object.assign({},t),{output:{dims:f,type:n.type,textureType:i.TextureType.packed},shaderSource:b,hasMain:!0})})(e,u,t,n,s,a)})}},1625:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateIm2ColDims=t.createIm2ColProgramInfoLoader=void 0;const r=n(5639);t.createIm2ColProgramInfoLoader=(e,n,i,o,s)=>{const a=(u=s.cacheKey,{name:"Im2Col",inputNames:["X"],inputTypes:[r.TextureType.unpacked],cacheHint:u});var u;return Object.assign(Object.assign({},a),{get:()=>((e,n,i,o,s,a)=>{const u=i.dims,c=o.dims,l=s.length,d=(0,t.calculateIm2ColDims)(u,c,s,4),f=`\n const int XC = ${u[1]};\n const int XH = ${u[2]};\n const int XW = ${u[3]};\n const int KH = ${a.kernelShape[0]};\n const int KW = ${a.kernelShape[1]};\n const int dilationH = ${a.dilations[0]};\n const int dilationW = ${a.dilations[1]};\n const int strideH = ${a.strides[0]};\n const int strideW = ${a.strides[1]};\n const int padH = ${a.pads[0]};\n const int padW = ${a.pads[1]};\n const int KHKW = KH*KW;\n const int XCKHKW = XC * KHKW;\n const int outputChannels = 4;\n vec4 process(int indices[${l}]) {\n int b = indices[0]; // batch size\n int oh = indices[1] * strideH - padH; //output height\n int ow = indices[2] * strideW - padW; //output width\n int p = indices[3] * outputChannels; //patch\n vec4 value = vec4(0.0);\n for(int i=0; i < outputChannels; ++i) {\n if(p < XCKHKW) {\n int patchC = p / KHKW;\n int patchH = (p - patchC*KHKW) / KW;\n int patchW = (p - patchC*KHKW) - patchH * KW;\n int xh2 = oh + patchH * dilationH;\n int xw2 = ow + patchW * dilationW;\n int x[${u.length}];\n x[0] = b;\n x[1] = patchC;\n x[2] = xh2;\n x[3] = xw2;\n if(xh2 >= 0 &&\n xh2 < XH &&\n xw2 >= 0 &&\n xw2 < XW) {\n value[i] = _X(x);\n }\n }\n ++p;\n }\n return value;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:d,type:i.type,textureType:r.TextureType.packedLastDimension},shaderSource:f})})(0,a,n,i,o,s)})},t.calculateIm2ColDims=(e,t,n,r=4)=>[n[0],n[2],n[3],Math.ceil(e[1]*t[2]*t[3]/r)]},6981:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseImageScalerAttributes=t.imageScaler=void 0;const r=n(4910),i=n(5639);t.imageScaler=(e,t,n)=>(u(t),[e.run(s(e,t,n),t)]),t.parseImageScalerAttributes=e=>{const t=e.attributes.getFloat("scale"),n=e.attributes.getFloats("bias");return(0,r.createAttributeWithCacheKey)({scale:t,bias:n})};const o={name:"ImageScaler",inputNames:["X"],inputTypes:[i.TextureType.unpacked]},s=(e,t,n)=>{const r=Object.assign(Object.assign({},o),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const o=n[0].dims.slice(),s=o.length,u=`\n ${a(r.bias.length)}\n float process(int indices[${s}]) {\n return _X(indices) * scale + getBias(bias, indices[1]);\n }`;return Object.assign(Object.assign({},t),{output:{dims:o,type:n[0].type,textureType:i.TextureType.unpacked},variables:[{name:"bias",type:"float",arrayLength:r.bias.length,data:r.bias},{name:"scale",type:"float",data:r.scale}],shaderSource:u})})(0,r,t,n)})},a=e=>{const t=[`float getBias(float bias[${e}], int channel) {`];for(let n=0;n<e;++n)0===n?t.push(`\tif (channel == ${n}) { return bias[${n}]; }`):n===e-1?t.push(`\telse { return bias[${n}]; }`):t.push(`\telse if (channel == ${n}) { return bias[${n}]; }`);return t.push("\t}"),t.join("\n")},u=e=>{if(!e||1!==e.length)throw new Error("ImageScaler requires 1 input.");if(4!==e[0].dims.length)throw new Error("Invalid input shape.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")}},7413:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseInstanceNormalizationAttributes=t.instanceNormalization=void 0;const r=n(6757),i=n(5639);t.instanceNormalization=(e,t,n)=>{c(t);const r=e.run(s(t[0]),t);return[e.run(u(e,t[0],n,r.dims),[t[0],r,t[1],t[2]])]},t.parseInstanceNormalizationAttributes=e=>e.attributes.getFloat("epsilon",1e-5);const o={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[i.TextureType.unpacked]},s=e=>Object.assign(Object.assign({},o),{get:()=>((e,t)=>{const n=t.dims.slice(),r=n[1],o=n[2]*n[3],s=[n[0],r],a=`\n vec4 process(int[2] indices) {\n vec4 v = vec4(0.0);\n int a[4];\n a[0] = indices[0];\n a[1] = indices[1];\n float temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += x;\n }\n }\n float mean = temp / float(${o});\n temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += (x - mean) * (x - mean);\n }\n }\n v.r = mean;\n v.g = temp / float(${o});\n\n return v;\n }`;return Object.assign(Object.assign({},e),{output:{dims:s,type:t.type,textureType:i.TextureType.packedLastDimension},shaderSource:a})})(o,e)}),a={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[i.TextureType.unpacked,i.TextureType.packedLastDimension,i.TextureType.unpacked,i.TextureType.unpacked]},u=(e,t,n,o)=>{const s=Object.assign(Object.assign({},a),{cacheHint:`${n}`});return Object.assign(Object.assign({},s),{get:()=>((e,t,n,o,s)=>{const a=(0,r.getGlsl)(e.session.backend.glContext.version),[u,c]=e.calculateTextureWidthAndHeight(s,i.TextureType.packedLastDimension),[l,d]=[u/4,c],f=`\n vec4 get_MeanAndVariance(int[2] mv) {\n int offset = indicesToOffset_MeanAndVariance(mv);\n vec2 coords = offsetToCoords(offset, ${l}, ${d});\n return ${a.texture2D}(MeanAndVariance, coords);\n }\n\n float process(int[4] indices) {\n int mv[2];\n mv[0] = indices[0];\n mv[1] = indices[1];\n vec4 mean_and_variance = get_MeanAndVariance(mv);\n float mean = mean_and_variance.r;\n float variance = mean_and_variance.g;\n\n int sb[1];\n sb[0] = indices[1];\n float scale = _Scale(sb);\n float b = _B(sb);\n\n return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\n }`;return Object.assign(Object.assign({},t),{output:{dims:n.dims,type:n.type,textureType:i.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:o}],shaderSource:f})})(e,s,t,n,o)})},c=e=>{if(!e||3!==e.length)throw new Error("InstanceNormalization requires 3 inputs.");const t=e[0],n=e[1],r=e[2];if(t.dims.length<3||1!==n.dims.length||1!==r.dims.length)throw new Error("Invalid input shape.");if(n.dims[0]!==t.dims[1]||r.dims[0]!==t.dims[1])throw new Error("Input shapes are mismatched.");if("float32"!==t.type&&"float64"!==t.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type)throw new Error("Invalid input type.");if(4!==e[0].dims.length)throw new Error("Only support 4-D input shape.")}},7006:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLrnProgramInfoLoader=t.parseLrnAttributes=t.lrn=void 0;const r=n(4910),i=n(5639);t.lrn=(e,t,n)=>(a(t),[e.run(s(t,n),t)]),t.parseLrnAttributes=e=>{const t=e.attributes.getFloat("alpha",1e-4),n=e.attributes.getFloat("beta",.75),i=e.attributes.getFloat("bias",1),o=e.attributes.getInt("size");return(0,r.createAttributeWithCacheKey)({alpha:t,beta:n,bias:i,size:o})};const o={name:"LRN",inputNames:["X"],inputTypes:[i.TextureType.unpacked]};function s(e,t){return Object.assign(Object.assign({},o),{cacheHint:t.cacheKey,get:()=>function(e,t){const n=e[0].dims[1],r=e[0].dims.length,s=-Math.floor((t.size-1)/2),a=Math.ceil((t.size-1)/2),u=`float(${t.alpha}) / float(${t.size})`,c=`\n float process(int indices[${r}]) {\n int c = indices[1];\n float x = _X(indices);\n float square_sum = 0.0;\n\n for (int i = ${s}; i <= ${a}; i++) {\n int idx = c + i;\n if (c >= 0 && c < ${n}) {\n indices[1] = idx;\n float j = _X(indices);\n square_sum += j * j;\n }\n }\n return x / pow(float(${t.bias}) + ${u} * square_sum, float(${t.beta}));\n }`;return Object.assign(Object.assign({},o),{cacheHint:t.cacheKey,output:{dims:e[0].dims,type:e[0].type,textureType:i.TextureType.unpacked},shaderSource:c})}(e,t)})}t.createLrnProgramInfoLoader=s;const a=e=>{if(!e||1!==e.length)throw new Error("LRN requires 1 input.");if(4!==e[0].dims.length)throw new Error('currently only support LRN for input with "NCHW" format');if("float32"!==e[0].type)throw new Error("input should be float type")}},5632:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedMatmulProgramInfoLoader=void 0;const r=n(7273),i=n(6757),o=n(5639),s=n(432),a=n(2150),u=n(8276);t.createPackedMatmulProgramInfoLoader=(e,t,n)=>{const c=(l=t.length>2,d=n.activationCacheKey,{name:"MatMul (packed)",inputNames:l?["A","B","Bias"]:["A","B"],inputTypes:l?[o.TextureType.packed,o.TextureType.packed,o.TextureType.packed]:[o.TextureType.packed,o.TextureType.packed],cacheHint:d});var l,d;return Object.assign(Object.assign({},c),{get:()=>((e,t,n,c)=>{const l=n.length>2,d=l?"value += getBiasForMatmul();":"",f=n[0].dims,h=n[1].dims,p=r.BroadcastUtil.calcShape(f,h,!0),g=!r.ShapeUtil.areEqual(n[0].dims,n[1].dims);if(!p)throw new Error("Can't use matmul on the given tensors");const m=f[f.length-1],b=Math.ceil(m/2),y=f.length,v=h.length,_=(0,i.getGlsl)(e.session.backend.glContext.version),w=(0,s.getCoordsDataType)(p.length),x=p.length,T=(0,s.getGlChannels)(),{activationFunction:S,applyActivation:O}=(0,a.getActivationSnippet)(c),E=l?`${(0,u.getBiasForMatmul)(w,T,n[2].dims,p,!0)}`:"",P=g?`${function(e,t,n,i){let o=[],s=[];const a=n[0].dims,u=n[1].dims,c=a.length,l=u.length,d=i.length,f=d-c,h=d-l;o=a.map(((e,n)=>`coords.${t[n+f]}`)),o[c-1]="i*2",o.join(", "),s=u.map(((e,n)=>`coords.${t[n+h]}`)),s[l-2]="i*2",s.join(", ");const p=r.BroadcastUtil.getBroadcastDims(a,i),g=r.BroadcastUtil.getBroadcastDims(u,i),m=p.map((e=>`coords.${t[e+f]} = 0;`)).join("\n"),b=g.map((e=>`coords.${t[e+h]} = 0;`)).join("\n"),y=`int lastDim = coords.${t[d-1]};\n coords.${t[d-1]} = coords.${t[d-2]};\n coords.${t[d-2]} = lastDim;`;return`\nvec4 getAAtOutCoordsMatmul(int i) {\n ${e} coords = getOutputCoords();\n ${y}\n ${m}\n vec4 outputValue = getA(${o});\n return outputValue;\n}\n\nvec4 getBAtOutCoordsMatmul(int i) {\n ${e} coords = getOutputCoords();\n ${y}\n ${b}\n vec4 outputValue = getB(${s});\n return outputValue;\n}`}(w,T,n,p)}`:"",A=g?"getAAtOutCoordsMatmul(i)":`getA(${function(e,t){let n="";for(let r=0;r<t-2;r++)n+=`rc.${e[r]}, `;return n+=`rc.${e[t-2]}, i*2`,n}(T,y)})`,C=g?"getBAtOutCoordsMatmul(i)":`getB(${function(e,t){let n="";for(let r=0;r<t-2;r++)n+=`rc.${e[r]}, `;return n+=`i*2, rc.${e[t-1]}`,n}(T,v)})`,I=`\n ${P}\n ${E}\n ${S}\n void main() {\n ${g?"":`${w} rc =\n getOutputCoords(); int lastDim = rc.${T[x-1]}; rc.${T[x-1]} =\n rc.${T[x-2]}; rc.${T[x-2]} = lastDim;\n `}\n\n vec4 value = vec4(0);\n for (int i = 0; i < ${b}; i++) {\n vec4 a = ${A};\n vec4 b = ${C};\n\n value += (a.rrbb * b.rgrg);\n value += (a.ggaa * b.baba);\n }\n ${d}\n ${O}\n ${_.output} = value;\n }`;return Object.assign(Object.assign({},t),{output:{dims:p,type:n[0].type,textureType:o.TextureType.packed},shaderSource:I,hasMain:!0})})(e,c,t,n)})}},8276:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBiasForMatmul=t.createMatmulProgramInfoLoader=t.parseMatMulAttributes=t.matMul=void 0;const r=n(7273),i=n(5639),o=n(432),s=n(2150),a=n(5632);t.matMul=(e,t,n)=>(l(t),e.session.pack?[e.run((0,a.createPackedMatmulProgramInfoLoader)(e,t,n),t)]:[e.run(c(t,n),t)]),t.parseMatMulAttributes=e=>(0,s.parseInternalActivationAttributes)(e.attributes);const u=(e,t)=>({name:"MatMul",inputNames:e?["A","B","Bias"]:["A","B"],inputTypes:e?[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]:[i.TextureType.unpacked,i.TextureType.unpacked],cacheHint:t});function c(e,t){const n=u(e.length>2,t.activationCacheKey);return Object.assign(Object.assign({},n),{get:()=>function(e,t,n){const a=t[0].dims,u=t[1].dims,c=r.BroadcastUtil.calcShape(a,u,!0);if(!c)throw new Error("Can't use matmul on the given tensors");const l=(0,o.getCoordsDataType)(c.length),f=(0,o.getGlChannels)(),{activationFunction:h,applyActivation:p}=(0,s.getActivationSnippet)(n),g=t.length>2,m=g?"value += getBiasForMatmul();":"",b=g?`${d(l,f,t[2].dims,c,!1)}`:"",y=c.length,v=a.length,_=u.length,w=`\n ${h}\n ${b}\n float process(int indices[${y}]) {\n int a[${v}];\n int b[${_}];\n bcastMatmulIndices_A(indices, a);\n bcastMatmulIndices_B(indices, b);\n\n float value;\n for (int k=0; k<${a[a.length-1]}; ++k) {\n a[${v-1}] = k;\n b[${_-2}] = k;\n value += _A(a) * _B(b);\n }\n ${m}\n ${p}\n return value;\n }`;return Object.assign(Object.assign({},e),{output:{dims:c,type:t[0].type,textureType:i.TextureType.unpacked},shaderSource:w})}(n,e,t)})}t.createMatmulProgramInfoLoader=c;const l=e=>{if(!e||2!==e.length)throw new Error("MatMul requires 2 inputs.");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error("shared dimension does not match.");if("float32"!==e[0].type&&"float64"!==e[0].type||"float32"!==e[1].type&&"float64"!==e[1].type)throw new Error("inputs should be float type");if(e[0].type!==e[1].type)throw new Error("inputs types should match")};function d(e,t,n,i,o){let s="";const a=n.length,u=i.length,c=u-a;s=u<2&&a>0?"coords":n.map(((e,n)=>`coords.${t[n+c]}`)).join(", ");const l=r.BroadcastUtil.getBroadcastDims(n,i).map((e=>`coords.${t[e+c]} = 0;`)).join("\n");let d="vec4(outputValue.xx, outputValue.yy)";return 1===r.ShapeUtil.size(n)&&(d="vec4(outputValue.x)"),o?`\nvec4 getBiasForMatmul() {\n ${e} coords = getOutputCoords();\n ${l}\n vec4 outputValue = getBias(${s});\n return ${d};\n}`:`\nfloat getBiasForMatmul() {\n ${e} coords = getOutputCoords();\n ${l}\n return getBias(coords.x);\n}`}t.getBiasForMatmul=d},9:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPackProgramInfoLoader=void 0;const r=n(6757),i=n(5639),o=n(432),s=n(5614),a={name:"pack",inputNames:["A"],inputTypes:[i.TextureType.unpackedReversed]};t.createPackProgramInfoLoader=(e,t)=>Object.assign(Object.assign({},a),{get:()=>((e,t)=>{const n=(0,r.getGlsl)(e.session.backend.glContext.version),u=t.dims,c=u.length,l=t.dims.length,d=(0,o.getCoordsDataType)(l),f=(0,s.getChannels)("rc",l),h=(p=l,g=f,m=u[u.length-2],b=u[u.length-1],0===p||1===p?"":`\n int r = ${g[p-2]};\n int c = ${g[p-1]};\n int rp1 = ${g[p-2]} + 1;\n int cp1 = ${g[p-1]} + 1;\n bool rEdge = rp1 >= ${b};\n bool cEdge = cp1 >= ${m};\n `);var p,g,m,b;let y;y=0===c?[1,1]:1===c?[u[0],1]:[u[l-1],u[l-2]];const v=function(e,t,n){if(0===e)return"false";if(1===e)return`rc > ${t[0]}`;let r="";for(let i=e-2;i<e;i++)r+=`${n[i]} >= ${t[i-e+2]}`,i<e-1&&(r+="||");return r}(l,y,f),_=function(e,t){const n=e.length;if(0===n)return"getA(), 0, 0, 0";if(1===n)return`getA(rc),\n rc + 1 >= ${e[0]} ? 0. : getA(rc + 1),\n 0, 0`;let r="";if(n>2)for(let e=0;e<n-2;++e)r+=`${t[e]},`;return`getA(${r}r, c),\n rEdge ? 0. : getA(${r}rp1, c),\n cEdge ? 0. : getA(${r}r, cp1),\n rEdge || cEdge ? 0. : getA(${r}rp1, cp1)`}(u,f),w=`\n void main() {\n ${d} rc = getOutputCoords();\n\n if(${v}) {\n ${n.output} = vec4(0);\n } else {\n ${h}\n\n ${n.output} = vec4(${_});\n }\n }\n `;return Object.assign(Object.assign({},a),{hasMain:!0,output:{dims:t.dims,type:t.type,textureType:i.TextureType.packed},shaderSource:w})})(e,t)})},5614:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unpackFromChannel=t.getChannels=t.getVecChannels=void 0;const r=n(432);function i(e,t){return(0,r.getGlChannels)(t).map((t=>`${e}.${t}`))}t.getVecChannels=i,t.getChannels=function(e,t){return 1===t?[e]:i(e,t)},t.unpackFromChannel=function(){return"\n float getChannel(vec4 frag, int dim) {\n int modCoord = imod(dim, 2);\n return modCoord == 0 ? frag.r : frag.g;\n }\n\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n "}},5565:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePadAttributesV11=t.padV11=t.parsePadAttributesV2=t.padV2=void 0;const r=n(4910),i=n(7273),o=n(6757),s=n(5639),a={name:"Pad",inputNames:["A"],inputTypes:[s.TextureType.unpacked]};t.padV2=(e,t,n)=>(l(t),[e.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>c(e,t[0],n)}),t)]),t.parsePadAttributesV2=e=>{const t=e.attributes.getString("mode","constant"),n=e.attributes.getFloat("value",0),i=e.attributes.getInts("pads");return(0,r.createAttributeWithCacheKey)({mode:t,value:n,pads:i})},t.padV11=(e,n,r)=>{d(n);const i=u(e,n,r);return(0,t.padV2)(e,[n[0]],i)},t.parsePadAttributesV11=e=>e.attributes.getString("mode","constant");const u=(e,t,n)=>{if(!e.session.isInitializer(t[1].dataId)||t.length>=3&&!e.session.isInitializer(t[2].dataId))throw new Error("dynamic pad attributes are not allowed");const i=Array.from(t[1].integerData),o=t.length>=3?t[2].floatData[0]:0;return(0,r.createAttributeWithCacheKey)({mode:n,pads:i,value:o})},c=(e,t,n)=>{const r=i.ShapeUtil.padShape(t.dims.slice(),n.pads),o=r.length,a=`\n ${f(e,t,n)}\n float process(int[${o}] indices) {\n return padA(indices);\n }`;return{name:"Pad",inputNames:["A"],inputTypes:[s.TextureType.unpacked],output:{dims:r,type:t.type,textureType:s.TextureType.unpacked},shaderSource:a}},l=e=>{if(!e||1!==e.length)throw new Error("Pad requires 1 input");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")},d=e=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Pad requires 2 or 3 inputs");if("int32"!==e[1].type)throw new Error("Invalid input type.");if(e.length>=3&&"string"===e[2].type)throw new Error("Invalid input type.")},f=(e,t,n)=>{const r=(0,o.getGlsl)(e.session.backend.glContext.version),[a,u]=e.calculateTextureWidthAndHeight(t.dims,s.TextureType.unpacked),c=i.ShapeUtil.computeStrides(t.dims);switch(n.mode){case"constant":return h(r,t.dims,c,a,u,n.pads,n.value);case"reflect":return p(r,t.dims,c,a,u,n.pads);case"edge":return g(r,t.dims,c,a,u,n.pads);default:throw new Error("Invalid mode")}},h=(e,t,n,r,i,o,s)=>{const a=t.length;let u="";for(let e=a-1;e>=0;--e)u+=`\n k = m[${e}] - ${o[e]};\n if (k < 0) return constant;\n if (k >= ${t[e]}) return constant;\n offset += k * ${n[e]};\n `;return`\n float padA(int m[${a}]) {\n const float constant = float(${s});\n int offset = 0;\n int k = 0;\n ${u}\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `},p=(e,t,n,r,i,o)=>{const s=t.length;let a="";for(let e=s-1;e>=0;--e)a+=`\n k = m[${e}] - ${o[e]};\n if (k < 0) { k = -k; }\n {\n const int _2n_1 = ${2*(t[e]-1)};\n k = int( mod( float(k), float(_2n_1) ) ) ;\n if(k >= ${t[e]}) { k = _2n_1 - k; }\n }\n offset += k * ${n[e]};\n `;return`\n float padA(int m[${s}]) {\n int offset = 0;\n int k = 0;\n ${a}\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `},g=(e,t,n,r,i,o)=>{const s=t.length;let a="";for(let e=s-1;e>=0;--e)a+=`\n k = m[${e}] - ${o[e]};\n if (k < 0) k = 0;\n if (k >= ${t[e]}) k = ${t[e]-1};\n offset += k * ${n[e]};\n `;return`\n float padA(int m[${s}]) {\n int offset = 0;\n int k = 0;\n ${a}\n vec2 coords = offsetToCoords(offset, ${r}, ${i});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `}},2834:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalMaxPool=t.parseMaxPoolAttributes=t.maxPool=t.parseGlobalAveragePoolAttributes=t.globalAveragePool=t.parseAveragePoolAttributes=t.averagePool=void 0;const r=n(4910),i=n(7273),o=n(5639);t.averagePool=(e,t,n)=>{d(t);const r={name:"AveragePool",inputNames:["X"],inputTypes:[o.TextureType.unpacked],cacheHint:n.cacheKey};return[e.run(Object.assign(Object.assign({},r),{get:()=>s(t,r,!1,n)}),t)]},t.parseAveragePoolAttributes=e=>{const t=e.attributes.getString("auto_pad","NOTSET"),n=e.attributes.getInt("ceil_mode",0),i=0!==e.attributes.getInt("count_include_pad",0),o=e.attributes.getInts("kernel_shape"),s=e.attributes.getInts("strides",[]),a=e.attributes.getInts("pads",[]);if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,r.createAttributeWithCacheKey)({autoPad:t,ceilMode:n,countIncludePad:i,kernelShape:o,strides:s,pads:a})};const s=(e,t,n,r)=>{const[s,a]=u(e,r,n),c=i.ShapeUtil.size(s.kernelShape);let l="";s.countIncludePad?l+=`value /= float(${c});`:l+=`value /= float(${c} - pad);`;const d=`\n ${f(e[0].dims,s,"value += _X(x);",l,"0.0")}\n `;return Object.assign(Object.assign({},t),{output:{dims:a,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:d})};t.globalAveragePool=(e,t,n)=>{d(t);const r={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[o.TextureType.unpacked],cacheHint:`${n.countIncludePad}`};return[e.run(Object.assign(Object.assign({},r),{get:()=>s(t,r,!0,n)}),t)]},t.parseGlobalAveragePoolAttributes=e=>{const t=0!==e.attributes.getInt("count_include_pad",0);return(0,r.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:t,kernelShape:[],strides:[],pads:[]})},t.maxPool=(e,t,n)=>{d(t);const r={name:"MaxPool",inputNames:["X"],inputTypes:[o.TextureType.unpacked],cacheHint:n.cacheKey};return[e.run(Object.assign(Object.assign({},r),{get:()=>a(t,r,!1,n)}),t)]},t.parseMaxPoolAttributes=e=>{const t=e.attributes.getString("auto_pad","NOTSET"),n=e.attributes.getInt("ceil_mode",0),i=e.attributes.getInts("kernel_shape"),o=e.attributes.getInts("strides",[]),s=e.attributes.getInts("pads",[]),a=e.attributes.getInt("storage_order",0),u=e.attributes.getInts("dilations",[]);if(0!==a)throw new Error("column major storage order is not yet supported for MaxPool");if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,r.createAttributeWithCacheKey)({autoPad:t,ceilMode:n,countIncludePad:!1,kernelShape:i,strides:o,pads:s,storageOrder:a,dilations:u})};const a=(e,t,n,r)=>{const[i,s]=u(e,r,n),a=`\n ${f(e[0].dims,i,"\n value = max(_X(x), value);\n ","","-1e5")}\n `;return Object.assign(Object.assign({},t),{output:{dims:s,type:e[0].type,textureType:o.TextureType.unpacked},shaderSource:a})},u=(e,t,n)=>{const r=e[0].dims.slice(),o=Object.hasOwnProperty.call(t,"dilations"),s=t.kernelShape.slice(),a=t.strides.slice(),u=o?t.dilations.slice():[],c=t.pads.slice();i.PoolConvUtil.adjustPoolAttributes(n,r,s,a,u,c);const l=i.PoolConvUtil.computePoolOutputShape(n,r,a,u,s,c,t.autoPad),d=Object.assign({},t);return o?Object.assign(d,{kernelShape:s,strides:a,pads:c,dilations:u,cacheKey:t.cacheKey}):Object.assign(d,{kernelShape:s,strides:a,pads:c,cacheKey:t.cacheKey}),[d,l]},c={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},l={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[o.TextureType.unpacked]};t.globalMaxPool=(e,t)=>(d(t),[e.run(Object.assign(Object.assign({},l),{get:()=>a(t,l,!0,c)}),t)]);const d=e=>{if(!e||1!==e.length)throw new Error("Pool ops requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")},f=(e,t,n,r,o)=>{const s=e.length;if(t.kernelShape.length<=2){const i=t.kernelShape[t.kernelShape.length-1],a=t.strides[t.strides.length-1],u=t.pads[t.pads.length/2-1],c=t.pads[t.pads.length-1],l=e[s-1];let d="",f="",h="";if(d=u+c!==0?`\n for (int i = 0; i < ${i}; i++) {\n x[${s} - 1] = indices[${s} - 1] * ${a} - ${u} + i;\n if (x[${s} - 1] < 0 || x[${s} - 1] >= ${l}) {\n pad++;\n continue;\n }\n ${n}\n }`:`\n for (int i = 0; i < ${i}; i++) {\n x[${s} - 1] = indices[${s} - 1] * ${a} - ${u} + i;\n ${n}\n }`,2===t.kernelShape.length){const n=t.kernelShape[t.kernelShape.length-2],r=t.strides[t.strides.length-2],o=t.pads[t.pads.length/2-2],a=t.pads[t.pads.length-2],u=e[s-2];f=o+a!==0?`\n for (int j = 0; j < ${n}; j++) {\n x[${s} - 2] = indices[${s} - 2] * ${r} - ${o} + j;\n if (x[${s} - 2] < 0 || x[${s} - 2] >= ${u}) {\n pad+= ${i};\n continue;\n }\n `:`\n for (int j = 0; j < ${n}; j++) {\n x[${s} - 2] = indices[${s} - 2] * ${r} - ${o} + j;\n `,h="\n }\n "}return`\n float process(int indices[${s}]) {\n int x[${s}];\n copyVec(indices, x);\n\n float value = ${o};\n int pad = 0;\n ${f}\n ${d}\n ${h}\n ${r}\n return value;\n }\n `}{const a=i.ShapeUtil.size(t.kernelShape),u=i.ShapeUtil.computeStrides(t.kernelShape),c=u.length,l=t.pads.length,d=p(c),f=h(e,"inputDims"),g=h(t.pads,"pads"),m=h(u,"kernelStrides"),b=h(t.strides,"strides");let y="";return y=t.pads.reduce(((e,t)=>e+t))?`\n if (x[j] >= inputDims[j] || x[j] < 0) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n ${n}\n }`:`\n }\n ${n}\n `,`\n ${d}\n float process(int indices[${s}]) {\n int x[${s}];\n copyVec(indices, x);\n int offset[${c}];\n int pads[${l}];\n int inputDims[${s}];\n int kernelStrides[${c}];\n int strides[${c}];\n ${g}\n ${f}\n ${b}\n ${m}\n\n float value = ${o};\n int pad = 0;\n bool isPad = false;\n for (int i = 0; i < ${a}; i++) {\n offsetToIndices(i, kernelStrides, offset);\n isPad = false;\n for (int j = ${s} - ${c}; j < ${s}; j++) {\n x[j] = indices[j] * strides[j - ${s} + ${c}]\n + offset[j - ${s} + ${c}] - pads[j - 2];\n ${y}\n }\n ${r}\n\n return value;\n }\n `}},h=(e,t)=>{let n="";for(let r=0;r<e.length;r++)n+=`\n ${t}[${r}] = ${e[r]};\n `;return n},p=e=>`\n void offsetToIndices(int offset, int[${e}] strides, out int[${e}] indices) {\n if (${e} == 0) {\n return;\n }\n for (int i = 0; i < ${e} - 1; ++i) {\n indices[i] = offset / strides[i];\n offset -= indices[i] * strides[i];\n }\n indices[${e} - 1] = offset;\n }`},1010:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduceLogSumSquare=t.reduceLogSum=t.reduceProd=t.reduceMin=t.reduceMax=t.reduceMean=t.reduceSum=t.parseReduceAttributes=void 0;const r=n(4910),i=n(6145),o=n(7273),s=n(5639),a=(e,t,n,r,i)=>{c(t);const o={name:r,inputNames:["A"],inputTypes:[s.TextureType.unpacked]};return[e.run(Object.assign(Object.assign({},o),{cacheHint:n.cacheKey,get:()=>u(e,t,n,r,i,o)}),t)]};t.parseReduceAttributes=e=>{const t=e.attributes.getInts("axes",[]),n=1===e.attributes.getInt("keepdims",1);return(0,r.createAttributeWithCacheKey)({axes:t,keepDims:n})};const u=(e,t,n,r,i,a)=>{const u=[],c=t[0].dims.length||1,l=[],d=o.ShapeUtil.normalizeAxes(n.axes,t[0].dims.length),f=i(t,d);let h=f[1];for(let e=0;e<t[0].dims.length;e++)d.indexOf(e)>=0||0===d.length?(n.keepDims&&u.push(1),h=`\n for(int j${e} = 0; j${e} < ${t[0].dims[e]}; j${e}++) {\n inputIdx[${e}] = j${e};\n ${h}\n }`):(l.push(`inputIdx[${e}] = outputIdx[${u.length}];`),u.push(t[0].dims[e]));const p=`\n float process(int outputIdx[${u.length||1}]) {\n float value; // final result\n int inputIdx[${c}]; // addressing input data\n ${l.join("\n")}\n ${f[0]} // init ops for reduce max/min\n ${h}\n ${f[2]} // final computation for reduce mean\n return value;\n }`;return Object.assign(Object.assign({},a),{output:{dims:u,type:t[0].type,textureType:s.TextureType.unpacked},shaderSource:p})},c=e=>{if(!e||1!==e.length)throw new Error("Reduce op requires 1 input.");if(-1===i.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.")};t.reduceSum=(e,t,n)=>a(e,t,n,"ReduceSum",(()=>["value = 0.0;","value += _A(inputIdx);",""])),t.reduceMean=(e,t,n)=>a(e,t,n,"ReduceMean",((e,t)=>{let n=1;for(let r=0;r<e[0].dims.length;r++)(t.indexOf(r)>=0||0===t.length)&&(n*=e[0].dims[r]);return["value = 0.0;","value += _A(inputIdx);",`value /= ${n}.;`]})),t.reduceMax=(e,t,n)=>a(e,t,n,"ReduceMax",((e,t)=>{const n=[];for(let r=0;r<e[0].dims.length;r++)(t.indexOf(r)>=0||0===t.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = max(value, _A(inputIdx));",""]})),t.reduceMin=(e,t,n)=>a(e,t,n,"ReduceMin",((e,t)=>{const n=[];for(let r=0;r<e[0].dims.length;r++)(t.indexOf(r)>=0||0===t.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]})),t.reduceProd=(e,t,n)=>a(e,t,n,"ReduceProd",(()=>["value = 1.0;","value *= _A(inputIdx);",""])),t.reduceLogSum=(e,t,n)=>a(e,t,n,"ReduceLogSum",(()=>["value = 0.0;","value += _A(inputIdx);","value = log(value);"])),t.reduceLogSumSquare=(e,t,n)=>a(e,t,n,"ReduceLogSumSquare",(()=>["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""]))},7379:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isReshapeCheap=t.processDims3D=t.createPackedReshape3DProgramInfoLoader=void 0;const r=n(7273),i=n(6757),o=n(5639),s=n(5614);t.createPackedReshape3DProgramInfoLoader=(e,t,n)=>{const a=(e=>({name:"Reshape (packed)",inputTypes:[o.TextureType.packed],inputNames:["A"],cacheHint:`${e}`}))(n);return Object.assign(Object.assign({},a),{get:()=>((e,t,n,a)=>{const u=t.dims,c=a;let l="";for(let e=0;e<4;e++){let t="";switch(e){case 0:t="outputCoords = rc;";break;case 1:t="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:t="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:t="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}l+=`\n ${t}\n ${e>0?"if(outputCoords.y < rows && outputCoords.z < cols){":""}\n int flattenedIndex = getFlattenedIndex(outputCoords);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\n vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${e}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\n\n ${e>0?"}":""}\n `}const d=(0,i.getGlsl)(e.session.backend.glContext.version),f=`\n ${function(e){const t=r.ShapeUtil.computeStrides(e),n=["b","r","c"],i="index";return`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${t.map(((e,r)=>`int ${n[r]} = ${i} / ${e}; ${r===t.length-1?`int ${n[r+1]} = ${i} - ${n[r]} * ${e}`:`index -= ${n[r]} * ${e}`};`)).join("")}\n return ivec3(b, r, c);\n }\n `}(u)}\n ${function(e){const t=r.ShapeUtil.computeStrides(e);return`\n int getFlattenedIndex(ivec3 coords) {\n // reverse y, z order\n return coords.x * ${t[0]} + coords.z * ${t[1]} + coords.y;\n }\n`}(c)}\n ${(0,s.unpackFromChannel)()}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.0);\n\n ivec3 outputCoords;\n int rows = ${c[2]};\n int cols = ${c[1]};\n\n ${l}\n ${d.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:c,type:t.type,textureType:o.TextureType.packed},shaderSource:f,hasMain:!0})})(e,t,a,n)})},t.processDims3D=function(e){if(0===e.length)return[1,1,1];let t=1;for(let n=0;n<e.length-2;++n)t*=e[n];return[t,e.length>1?e[e.length-2]:1,e[e.length-1]]},t.isReshapeCheap=function(e,t){let n=!1;return n=0===e.length||0===t.length||(e.length<2||t.length<2?e[e.length-1]===t[t.length-1]:e[e.length-1]===t[t.length-1]&&e[e.length-2]===t[t.length-2]),n}},8126:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reshape=void 0;const r=n(7273);t.reshape=(e,t)=>{const n=r.ShapeUtil.calculateReshapedDims(t[0].dims,t[1].integerData);return e.session.pack?[e.reshapePacked(t[0],n)]:[e.reshapeUnpacked(t[0],n)]}},2801:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseResizeAttributesV11=t.parseResizeAttributesV10=t.resize=void 0;const r=n(6757),i=n(5639),o=n(432),s=n(5614),a=n(3980),u={name:"Resize",inputNames:["A"],inputTypes:[i.TextureType.packed]};t.resize=(e,t,n)=>((0,a.validateInputs)(t,n),[e.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>c(e,t,n)}),t)]),t.parseResizeAttributesV10=e=>(0,a.parseUpsampleAttributes)(e,10),t.parseResizeAttributesV11=e=>(0,a.parseUpsampleAttributes)(e,11);const c=(e,t,n)=>{const a=(0,r.getGlsl)(e.session.backend.glContext.version),[c,d]=l(t,n);if(c.every((e=>1===e))&&"tf_crop_and_resize"!==n.coordinateTransformMode)return Object.assign(Object.assign({},u),{output:{dims:d,type:t[0].type,textureType:i.TextureType.packed},hasMain:!0,shaderSource:`void main() {\n vec4 v = ${a.texture2D}(X, TexCoords);\n ${a.output} = v;\n }`});const f=d.length;if(f<2)throw new Error(`output dimension should be at least 2, but got ${f}`);const h=d[f-2],p=d[f-1],g=t[0].dims;if(f!==g.length)throw new Error(`output dimension should match input ${g.length}, but got ${f}`);const m=g[f-2],b=g[f-1],y=c[f-2],v=c[f-1];let _="";if("linear"!==n.mode)throw new Error(`resize (packed) does not support mode: '${n.mode}'`);switch(n.coordinateTransformMode){case"asymmetric":_="\n vec4 getSourceFracIndex(ivec4 coords) {\n return vec4(coords) / scaleWHWH;\n }\n ";break;case"half_pixel":_="\n vec4 getSourceFracIndex(ivec4 coords) {\n return (vec4(coords) + 0.5) / scaleWHWH - 0.5;\n }\n ";break;case"pytorch_half_pixel":_=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 fcoords = vec4(coords);\n return vec4(\n ${p}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\n ${h}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\n ${p}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\n ${h}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\n );\n }\n `;break;case"align_corners":_=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 resized = vec4(${p}.0 - 1.0, ${h}.0 - 1.0, ${p}.0 - 1.0,\n ${h}.0 - 1.0);\n vec4 original = vec4(${b}.0 - 1.0, ${m}.0 - 1.0, ${b}.0 - 1.0,\n ${m}.0 - 1.0);\n vec4 new_scale = original / resized;\n return vec4(coords) * new_scale;\n }\n `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${n.coordinateTransformMode}'`)}const w=(0,o.getCoordsDataType)(f),x=`\n const vec2 inputWH = vec2(${m}.0, ${b}.0);\n const vec4 scaleWHWH = vec4(float(${y}), float(${v}), float(${y}), float(${v}));\n ${(0,s.unpackFromChannel)()}\n ${_}\n float getAValue(int x10, int r, int c, int d) {\n return getChannel(getA(x10, r, c, d), vec2(c, d));\n }\n void main() {\n ${w} rc = getOutputCoords();\n\n int batch = rc[0];\n int depth = rc[1];\n\n // retrieve the 4 coordinates that is used in the 4 packed output values.\n ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\n\n // calculate the source index in fraction\n vec4 sourceFrac = getSourceFracIndex(coords);\n\n // get the lower and upper bound of the 4 values that will be packed into one texel.\n ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\n ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\n ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\n ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\n\n bool hasNextRow = rc.w < ${h-1};\n bool hasNextCol = rc.z < ${p-1};\n\n // pack x00, x01, x10, x11's top-left corner into one vec4 structure\n vec4 topLeft = vec4(\n getAValue(batch, depth, x00.x, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's top-right corner into one vec4 structure\n vec4 topRight = vec4(\n getAValue(batch, depth, x00.x, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\n vec4 bottomLeft = vec4(\n getAValue(batch, depth, x00.z, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\n vec4 bottomRight = vec4(\n getAValue(batch, depth, x00.z, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\n\n // calculate the interpolation fraction on u and v direction\n vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\n vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\n\n vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\n vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\n vec4 newValue = mix(top, bottom, clampFrac.xxzz);\n\n ${a.output} = vec4(newValue);\n }\n `;return Object.assign(Object.assign({},u),{output:{dims:d,type:t[0].type,textureType:i.TextureType.packed},hasMain:!0,shaderSource:x})},l=(e,t)=>{const n=e[0].dims;let r,i=t.scales;if(0===i.length){const o=e[t.scalesInputIdx];if(o&&0!==o.size){if(e[t.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");i=d(o,t.mode,t.isResize)}else{const o=e[t.sizesInputIdx];if(!o||0===o.size)throw new Error("Either scales or sizes MUST be provided as input.");r=Array.from(o.integerData),i=f(r,n,t.mode,t.isResize)}}else if(e[t.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");const o=r||n.map(((e,t)=>Math.floor(e*i[t])));return[i,o]},d=(e,t,n)=>{const r=Array.from(e.floatData);return(0,a.scalesValidation)(r,t,n),r},f=(e,t,n,r)=>{const i=t.length,o=new Array(i);for(let n=0,r=i;n<r;n++)if(0===t[n]){if(0!==e[n])throw new Error("Input dim is zero but required output dim is non-zero.");o[n]=1}else o[n]=e[n]/t[n];return(0,a.scalesValidation)(o,n,r),o}},565:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shape=void 0;const r=n(9240);t.shape=(e,t)=>(i(t),[new r.Tensor([t[0].dims.length],"int32",void 0,void 0,new Int32Array(t[0].dims))]);const i=e=>{if(!e||1!==e.length)throw new Error("Shape requires 1 input.")}},2444:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sliceV10=t.parseSliceAttributes=t.slice=void 0;const r=n(4910),i=n(6145),o=n(7273),s=n(5639),a={name:"Slice",inputNames:["A"],inputTypes:[s.TextureType.unpacked]};t.slice=(e,t,n)=>(c(t),[e.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>u(e,t[0],n)}),t)]),t.parseSliceAttributes=e=>{const t=e.attributes.getInts("starts"),n=e.attributes.getInts("ends"),i=e.attributes.getInts("axes",[]);return(0,r.createAttributeWithCacheKey)({starts:t,ends:n,axes:i})};const u=(e,t,n)=>{const r=0===n.axes.length?t.dims.slice(0).map(((e,t)=>t)):n.axes,i=o.ShapeUtil.normalizeAxes(r,t.dims.length),u=n.starts.map(((e,n)=>e>t.dims[i[n]]-1?t.dims[i[n]]:o.ShapeUtil.normalizeAxis(e,t.dims[i[n]]))),c=n.ends.map(((e,n)=>e>t.dims[i[n]]-1?t.dims[i[n]]:o.ShapeUtil.normalizeAxis(e,t.dims[i[n]]))),l=t.dims.slice(),d=[];for(let e=0;e<i.length;e++)l[i[e]]=c[e]-u[e],u[e]>0&&d.push(`outputIdx[${i[e]}] += ${u[e]};`);const f=`\n float process(int outputIdx[${l.length}]) {\n ${d.join("\n ")}\n return _A(outputIdx);\n }`;return Object.assign(Object.assign({},a),{output:{dims:l,type:t.type,textureType:s.TextureType.unpacked},shaderSource:f})},c=e=>{if(!e||1!==e.length)throw new Error("Slice requires 1 input.");if(-1===i.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.")};t.sliceV10=(e,t)=>{d(t);const n=l(e,t);return[e.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>u(e,t[0],n)}),[t[0]])]};const l=(e,t)=>{if(!e.session.isInitializer(t[1].dataId)||!e.session.isInitializer(t[2].dataId)||t.length>=4&&!e.session.isInitializer(t[3].dataId)||t.length>=5&&!e.session.isInitializer(t[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(t.length>=5&&t[4].integerData.some((e=>1!==e)))throw new Error("currently non-1 steps is not supported for Slice");const n=Array.from(t[1].integerData),r=Array.from(t[2].integerData),i=t.length>=4?Array.from(t[3].integerData):[];return{starts:n,ends:r,axes:i,cacheKey:`${i};${n};${r}`}},d=e=>{if(!e||e.length<3||e.length>5)throw new Error("Invalid input number.");if("int32"!==e[1].type||1!==e[1].dims.length)throw new Error("Invalid input type.");if("int32"!==e[2].type||1!==e[2].dims.length)throw new Error("Invalid input type.");if(e.length>=4&&("int32"!==e[3].type||1!==e[3].dims.length))throw new Error("Invalid input type.");if(e.length>=5&&("int32"!==e[4].type||1!==e[4].dims.length))throw new Error("Invalid input type.")}},815:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.softmaxV13=t.parseSoftmaxAttributesV13=t.parseSoftmaxAttributes=t.softmax=void 0;const r=n(4910),i=n(7273),o=n(6757),s=n(5639),a=n(5707),u={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[s.TextureType.unpacked]},c={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked]},l={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked,s.TextureType.unpacked]};t.softmax=(e,t,n)=>{g(t);const r=t[0].dims.slice(),o=i.ShapeUtil.normalizeAxis(n.axis,r.length),s=i.ShapeUtil.sizeToDimension(r,o),a=i.ShapeUtil.sizeFromDimension(r,o);return d(e,t,n,s,a)},t.parseSoftmaxAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",1)}),t.parseSoftmaxAttributesV13=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",-1)}),t.softmaxV13=(e,t,n)=>{g(t);const o=t[0].dims.slice(),s=i.ShapeUtil.normalizeAxis(n.axis,o.length),u=o.length,c=s!==u-1,l=[];let f,h=[],p=[];c&&(h=Array.from({length:u}).map(((e,t)=>t)),h[s]=u-1,h[u-1]=s,h.map((e=>l.push(o[e]))),f=(0,r.createAttributeWithCacheKey)({perm:h}),p=(0,a.transpose)(e,t,f));const m=c?i.ShapeUtil.sizeToDimension(l,u-1):i.ShapeUtil.sizeToDimension(o,u-1),b=c?i.ShapeUtil.sizeFromDimension(l,u-1):i.ShapeUtil.sizeFromDimension(o,u-1),y=d(e,c?p:t,n,m,b);return c?(0,a.transpose)(e,y,f):y};const d=(e,t,n,r,i)=>{const o=f(e,t[0],r,i,[r]),s=e.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>o}),t),a=h(e,t[0],r,i,o.output.dims,[r]),d=e.run(Object.assign(Object.assign({},c),{cacheHint:n.cacheKey,get:()=>a}),[t[0],s]),g=p(e,t[0],r,i,o.output.dims,a.output.dims);return[e.run(Object.assign(Object.assign({},l),{cacheHint:n.cacheKey,get:()=>g}),[t[0],s,d])]},f=(e,t,n,r,i)=>{const[a,c]=e.calculateTextureWidthAndHeight(t.dims,s.TextureType.unpacked),l=i.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==i.length)throw new Error("Dimensionality of the output should be 1");if(i[0]!==n)throw new Error("Shape of the output should be equal to logical row count");const d=(0,o.getGlsl)(e.session.backend.glContext.version),f=`\n float process(int[${l}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float max = getColorAsFloat(${d.texture2D}(A, offsetToCoords(logical_row_start_offset, ${a},\n ${c} )));\n for(int i=1; i<${r}; ++i)\n {\n float current = getColorAsFloat(${d.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${a}, ${c})));\n if(current > max)\n max = current;\n }\n\n return max;\n }`;return Object.assign(Object.assign({},u),{output:{dims:i,type:t.type,textureType:s.TextureType.unpacked},shaderSource:f})},h=(e,t,n,r,i,a)=>{const[u,l]=e.calculateTextureWidthAndHeight(t.dims,s.TextureType.unpacked),d=a.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==a.length)throw new Error("Dimensionality of the output should be 1");if(a[0]!==n)throw new Error("Shape of the output should be equal to logical row count");if(1!==i.length)throw new Error("Dimensionality of the intermediate results should be 1");if(i[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const f=`\n float process(int[${d}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float norm_factor = 0.0;\n float max = _Max(indices);\n for(int i=0; i<${r}; ++i)\n {\n norm_factor += exp(getColorAsFloat(${(0,o.getGlsl)(e.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${u}, ${l}))) - max);\n }\n\n return norm_factor;\n }`;return Object.assign(Object.assign({},c),{output:{dims:a,type:t.type,textureType:s.TextureType.unpacked},shaderSource:f})},p=(e,t,n,r,i,o)=>{const[a,u]=e.calculateTextureWidthAndHeight(t.dims,s.TextureType.unpacked),c=t.dims.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==i.length||1!==o.length)throw new Error("Dimensionality of the intermediate results should be 1");if(i[0]!==n||o[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const d=`\n float process(int[${c}] indices) {\n\n // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\n int offset = coordsToOffset(TexCoords, ${a}, ${u});\n\n //determine the logical row for this index\n int logical_row_index[1];\n logical_row_index[0] = offset / ${r};\n\n float norm_factor = _Norm(logical_row_index);\n\n // avoid possible division by 0\n // if norm_facor is 0, all elements are zero\n // if so, return 0\n if(norm_factor == 0.0)\n return 0.0;\n\n return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\n }`;return Object.assign(Object.assign({},l),{output:{dims:t.dims,type:t.type,textureType:s.TextureType.unpacked},shaderSource:d})},g=e=>{if(!e||1!==e.length)throw new Error("Softmax requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type")}},564:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSplitAttributes=t.split=void 0;const r=n(4910),i=n(7273),o=n(5639),s={name:"Split",inputNames:["A"],inputTypes:[o.TextureType.unpacked]};t.split=(e,t,n)=>{c(t);const r=i.ShapeUtil.normalizeAxis(n.axis,t[0].dims.length),o=a(e,t,r,n),l=[];for(let i=0;i<o;++i)l.push(e.run(Object.assign(Object.assign({},s),{cacheHint:`${n.cacheKey};${i}`,get:()=>u(e,t[0],n,r,i)}),t));return l},t.parseSplitAttributes=e=>{const t=e.attributes.getInt("axis",0),n=e.attributes.getInts("split",[]),i=e.outputs.length;return(0,r.createAttributeWithCacheKey)({axis:t,split:n,numOutputs:i})};const a=(e,t,n,r)=>{const[,o]=i.SplitUtil.splitShape(t[0].dims,n,r.split,r.numOutputs);return o.length},u=(e,t,n,r,a)=>{const[u,c]=i.SplitUtil.splitShape(t.dims,r,n.split,n.numOutputs),l=c[a],d=u[a],f=`\n float process(int indices[${d.length}]) {\n indices[${r}] += ${l};\n return _A(indices);\n }\n `;return Object.assign(Object.assign({},s),{cacheHint:`${n.cacheKey}:${a}`,output:{dims:d,type:t.type,textureType:o.TextureType.unpacked},shaderSource:f})},c=e=>{if(!e||1!==e.length)throw new Error("Split requires one input.");if("int8"!==e[0].type&&"uint8"!==e[0].type&&"int16"!==e[0].type&&"uint16"!==e[0].type&&"int32"!==e[0].type&&"uint32"!==e[0].type&&"float32"!==e[0].type&&"float64"!==e[0].type&&"bool"!==e[0].type)throw new Error("Invalid input type.")}},5416:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSqueezeAttributes=t.squeezeV13=t.squeeze=void 0;const r=n(7273);t.squeeze=(e,t,n)=>{i(t);const o=r.ShapeUtil.squeezeShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],o)]},t.squeezeV13=(e,n)=>(o(n),(0,t.squeeze)(e,[n[0]],Array.from(n[1].integerData))),t.parseSqueezeAttributes=e=>e.attributes.getInts("axes");const i=e=>{if(!e||1!==e.length)throw new Error("Squeeze requires 1 input.");if("string"===e[0].type)throw new Error("invalid input tensor types.")},o=e=>{if(!e||2!==e.length)throw new Error("Squeeze requires 2 inputs.");if("int32"!==e[1].type)throw new Error("Invalid input type.")}},1240:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sum=void 0;const r=n(6757),i=n(5639);t.sum=(e,t)=>{s(t);const n={name:"Sum",inputNames:t.map(((e,t)=>`X${t}`)),inputTypes:new Array(t.length).fill(i.TextureType.unpacked)};return[e.run(Object.assign(Object.assign({},n),{get:()=>o(e,t,n)}),t)]};const o=(e,t,n)=>{const o=(0,r.getGlsl)(e.session.backend.glContext.version),s=t[0].dims.slice(),a=`\n void main() {\n vec4 result = ${t.map(((e,t)=>`${o.texture2D}(X${t},TexCoords)`)).join(" + ")};\n ${o.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:s,type:t[0].type,textureType:i.TextureType.unpacked},hasMain:!0,shaderSource:a})},s=e=>{if(!e||0===e.length)throw new Error("Sum requires inputs.");const t=e[0].dims.length;for(let n=1;n<e.length;n++){if(t!==e[n].dims.length)throw new Error("Input shapes are mismatched.");for(let r=0;r<t;r++)if(e[0].dims[r]!==e[n].dims[r])throw new Error("Input shapes are not matched.")}if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.");for(let t=1;t<e.length;t++)if(e[0].type!==e[t].type)throw new Error("Input types are not matched.")}},5944:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tile=void 0;const r=n(6145),i=n(5639);t.tile=(e,t)=>{s(t);const n={name:"Tile",inputNames:["A"],inputTypes:[i.TextureType.unpacked]};return[e.run(Object.assign(Object.assign({},n),{get:()=>o(e,t,n)}),t)]};const o=(e,t,n)=>{const r=t[0].dims.slice(),o=new Array(r.length),s=[];for(let e=0;e<r.length;e++)o[e]=r[e]*t[1].numberData[e],s.push(`inputIdx[${e}] = int(mod(float(outputIdx[${e}]), ${r[e]}.));`);const a=o.length,u=`\n float process(int outputIdx[${a}]) {\n int inputIdx[${a}];\n ${s.join("\n")}\n return _A(inputIdx);\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:o,type:t[0].type,textureType:i.TextureType.unpacked},shaderSource:u})},s=e=>{if(!e||2!==e.length)throw new Error("Tile requires 2 input.");if(1!==e[1].dims.length)throw new Error("The second input shape must 1 dimension.");if(e[1].dims[0]!==e[0].dims.length)throw new Error("Invalid input shape.");if(-1===r.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.");if("int32"!==e[1].type&&"int16"!==e[1].type)throw new Error("Invalid repeat type.")}},5707:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTransposeAttributes=t.transpose=void 0;const r=n(4910),i=n(7273),o=n(5639),s={name:"Transpose",inputNames:["A"],inputTypes:[o.TextureType.unpacked]};t.transpose=(e,t,n)=>(d(t),[e.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>a(e,t[0],n.perm)}),t)]),t.parseTransposeAttributes=e=>(0,r.createAttributeWithCacheKey)({perm:e.attributes.getInts("perm",[])});const a=(e,t,n)=>{const r=t.dims;n=u(r,n);const i=c(r,n),a=r.length,d=`\n ${l("perm",n,a)}\n float process(int indices[${a}]) {\n int a[${a}];\n perm(a, indices);\n return _A(a);\n }`;return Object.assign(Object.assign({},s),{output:{dims:i,type:t.type,textureType:o.TextureType.unpacked},shaderSource:d})},u=(e,t)=>(t&&t.length!==e.length&&(t=[...e.keys()].reverse()),t),c=(e,t)=>(t=u(e,t),i.ShapeUtil.sortBasedOnPerm(e,t)),l=(e,t,n)=>{const r=[];r.push(`void ${e}(out int a[${n}], int src[${n}]) {`);for(let e=0;e<n;++e)r.push(`\ta[${t[e]}]=src[${e}];`);return r.push("\t}"),r.join("\n")},d=e=>{if(!e||1!==e.length)throw new Error("Transpose requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("input should be float tensor")}},2488:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeAsUint8=void 0;const r=n(6757),i=n(5639);t.encodeAsUint8=(e,t)=>{const n=t.shape,o=(0,r.getGlsl)(e.session.backend.glContext.version),s=`\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n bool isNaN(float val) {\n return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n highp vec4 encodeAsUint8(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float value = ${o.texture2D}(X,TexCoords).r;\n ${o.output} = encodeAsUint8(value);\n }`,a={name:"Uint8Encode",inputTypes:[i.TextureType.unpacked],inputNames:["X"],output:{dims:n,type:t.tensor.type,textureType:i.TextureType.downloadUint8AsFloat},shaderSource:s,hasMain:!0};return e.executeProgram(a,[t.tensor])}},9087:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tanh=t.tan=t.sqrt=t.sin=t.sigmoid=t.relu=t.not=t.neg=t.log=t.parseLeakyReluAttributes=t.leakyRelu=t.identity=t.floor=t.exp=t.parseEluAttributes=t.elu=t.cos=t.ceil=t.clipV11=t.parseClipAttributes=t.clip=t.atan=t.asin=t.acos=t.abs=t.glslTanh=t.glslTan=t.glslSqrt=t.glslSigmoid=t.glslRelu=t.glslSin=t.glslNot=t.glslNeg=t.glslLog=t.glslLeakyRelu=t.glslIdentity=t.glslClip=t.glslFloor=t.glslExp=t.glslElu=t.glslCos=t.glslCeil=t.glslAtan=t.glslAsin=t.glslAcos=t.glslAbs=void 0;const r=n(4910),i=n(7273),o=n(1997),s=n(6757),a=n(5639);function u(){return C("abs")}function c(){return C("acos")}function l(){return C("asin")}function d(){return C("atan")}function f(){return C("ceil")}function h(){return C("cos")}function p(e){const t="elu";return{body:`\n const float alpha = float(${e});\n\n float ${t}_(float a) {\n return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;\n }\n vec4 ${t}_(vec4 v) {\n return vec4(${t}_(v.x), ${t}_(v.y), ${t}_(v.z), ${t}_(v.w));\n }\n `,name:t,type:o.FunctionType.ValueBased}}function g(){return C("exp")}function m(){return C("floor")}function b(e,t){const n="clip";return{body:`\n const float min = float(${e});\n const float max = float(${t});\n\n float ${n}_(float a) {\n return clamp(a, min, max);\n }\n vec4 ${n}_(vec4 v) {\n return clamp(v, min, max);\n }\n `,name:n,type:o.FunctionType.ValueBased}}function y(){const e="indentity";return{body:`\n float ${e}_(float a) {\n return a;\n }\n vec4 ${e}_(vec4 v) {\n return v;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function v(e){const t="leakyRelu";return{body:`\n const float alpha = float(${e});\n\n float ${t}_(float a) {\n return a < 0.0 ? a * alpha : a;\n }\n vec4 ${t}_(vec4 v) {\n return vec4(${t}_(v.x), ${t}_(v.y), ${t}_(v.z), ${t}_(v.w));\n }\n `,name:t,type:o.FunctionType.ValueBased}}function _(){return C("log")}function w(){const e="neg";return{body:`\n float ${e}_(float a) {\n return -a;\n }\n vec4 ${e}_(vec4 v) {\n return -v;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function x(){const e="not";return{body:`\n float ${e}_(float a) {\n return float( ! bool(a) );\n }\n bool ${e}_(bool a) {\n return !a;\n }\n vec4 ${e}_(vec4 v) {\n return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\n }\n bvec4 ${e}_(bvec4 v) {\n return bvec4(!v.x, !v.y, !v.z, !v.w);\n }\n `,name:e,type:o.FunctionType.ValueBased}}function T(){return C("sin")}function S(){const e="relu";return{body:`\n float ${e}_(float a) {\n return max( a, 0.0 );\n }\n vec4 ${e}_(vec4 v) {\n return max( v, 0.0 );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function O(){const e="sigmoid";return{body:`\n float ${e}_(float a) {\n return 1.0 / (1.0 + exp(-a));\n }\n vec4 ${e}_(vec4 v) {\n return 1.0 / (1.0 + exp(-v));\n }\n `,name:e,type:o.FunctionType.ValueBased}}function E(){return C("sqrt")}function P(){return C("tan")}function A(){const e="tanh";return{body:`\n float ${e}_(float a) {\n a = clamp(a, -10., 10.);\n a = exp(2.*a);\n return (a - 1.) / (a + 1.);\n }\n vec4 ${e}_(vec4 v) {\n v = clamp(v, -10., 10.);\n v = exp(2.*v);\n return (v - 1.) / (v + 1.);\n }\n `,name:e,type:o.FunctionType.ValueBased}}function C(e){return{body:`\n float ${e}_(float a) {\n return ${e}(a);\n }\n vec4 ${e}_(vec4 v) {\n return ${e}(v);\n }\n `,name:e,type:o.FunctionType.ValueBased}}t.glslAbs=u,t.glslAcos=c,t.glslAsin=l,t.glslAtan=d,t.glslCeil=f,t.glslCos=h,t.glslElu=p,t.glslExp=g,t.glslFloor=m,t.glslClip=b,t.glslIdentity=y,t.glslLeakyRelu=v,t.glslLog=_,t.glslNeg=w,t.glslNot=x,t.glslSin=T,t.glslRelu=S,t.glslSigmoid=O,t.glslSqrt=E,t.glslTan=P,t.glslTanh=A;const I=(e,t,n,r)=>{const i=e.session.pack?a.TextureType.packed:a.TextureType.unpacked,o={name:n.name,inputTypes:[i],inputNames:["A"],cacheHint:r};return Object.assign(Object.assign({},o),{get:()=>((e,t,n,r)=>{const i=e.session.pack?a.TextureType.packed:a.TextureType.unpacked,o=(0,s.getGlsl)(e.session.backend.glContext.version);return Object.assign(Object.assign({},t),{output:{dims:n.dims,type:n.type,textureType:i},shaderSource:`\n ${r.body}\n void main() {\n vec4 v = ${o.texture2D}(A, TexCoords);\n v = ${r.name}_(v);\n ${o.output} = v;\n }\n `,hasMain:!0})})(e,o,t,n)})};t.abs=(e,t)=>[e.run(I(e,t[0],u()),t)],t.acos=(e,t)=>[e.run(I(e,t[0],c()),t)],t.asin=(e,t)=>[e.run(I(e,t[0],l()),t)],t.atan=(e,t)=>[e.run(I(e,t[0],d()),t)],t.clip=(e,t,n)=>[e.run(I(e,t[0],b(n.min,n.max),n.cacheKey),t)],t.parseClipAttributes=e=>(0,r.createAttributeWithCacheKey)({min:e.attributes.getFloat("min",i.MIN_CLIP),max:e.attributes.getFloat("max",i.MAX_CLIP)}),t.clipV11=(e,n)=>{const r=R(e,n);return(0,t.clip)(e,[n[0]],r)};const R=(e,t)=>{if(t.length>=3&&(!e.session.isInitializer(t[1].dataId)||!e.session.isInitializer(t[2].dataId)))throw new Error("dynamic clip attributes are not allowed");const n=t.length>=3?t[1].numberData[0]:i.MIN_CLIP,o=t.length>=3?t[2].numberData[0]:i.MAX_CLIP;return(0,r.createAttributeWithCacheKey)({min:n,max:o})};t.ceil=(e,t)=>[e.run(I(e,t[0],f()),t)],t.cos=(e,t)=>[e.run(I(e,t[0],h()),t)],t.elu=(e,t,n)=>[e.run(I(e,t[0],p(n.alpha),n.cacheKey),t)],t.parseEluAttributes=e=>(0,r.createAttributeWithCacheKey)({alpha:e.attributes.getFloat("alpha",1)}),t.exp=(e,t)=>[e.run(I(e,t[0],g()),t)],t.floor=(e,t)=>[e.run(I(e,t[0],m()),t)],t.identity=(e,t)=>[e.run(I(e,t[0],y()),t)],t.leakyRelu=(e,t,n)=>[e.run(I(e,t[0],v(n.alpha),n.cacheKey),t)],t.parseLeakyReluAttributes=e=>(0,r.createAttributeWithCacheKey)({alpha:e.attributes.getFloat("alpha",.01)}),t.log=(e,t)=>[e.run(I(e,t[0],_()),t)],t.neg=(e,t)=>[e.run(I(e,t[0],w()),t)],t.not=(e,t)=>[e.run(I(e,t[0],x()),t)],t.relu=(e,t)=>[e.run(I(e,t[0],S()),t)],t.sigmoid=(e,t)=>[e.run(I(e,t[0],O()),t)],t.sin=(e,t)=>[e.run(I(e,t[0],T()),t)],t.sqrt=(e,t)=>[e.run(I(e,t[0],E()),t)],t.tan=(e,t)=>[e.run(I(e,t[0],P()),t)],t.tanh=(e,t)=>[e.run(I(e,t[0],A()),t)]},540:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUnpackProgramInfoLoader=t.createUnpackProgramInfo=void 0;const r=n(6757),i=n(5639),o=n(432),s=n(5614),a={name:"unpack",inputNames:["A"],inputTypes:[i.TextureType.packed]};t.createUnpackProgramInfo=(e,t)=>{const n=t.dims.length,u=(0,s.getChannels)("rc",n),c=u.slice(-2),l=(0,o.getCoordsDataType)(n),d=(0,s.unpackFromChannel)(),f=0===t.dims.length?"":function(e,t){if(1===e)return"rc";let n="";for(let r=0;r<e;r++)n+=t[r],r<e-1&&(n+=",");return n}(n,u),h=n<=1?"rc":`vec2(${c.join(",")})`,p=`\n ${d}\n void main() {\n ${l} rc = getOutputCoords();\n\n // Sample the texture with the coords to get the rgba channel value.\n vec4 packedInput = getA(${f});\n\n ${(0,r.getGlsl)(e.session.backend.glContext.version).output} = vec4(getChannel(packedInput, ${h}), 0, 0, 0);\n }\n `;return Object.assign(Object.assign({},a),{hasMain:!0,output:{dims:t.dims,type:t.type,textureType:i.TextureType.unpacked},shaderSource:p})},t.createUnpackProgramInfoLoader=(e,n)=>Object.assign(Object.assign({},a),{get:()=>(0,t.createUnpackProgramInfo)(e,n)})},7862:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseUnsqueezeAttributes=t.unsqueezeV13=t.unsqueeze=void 0;const r=n(7273);t.unsqueeze=(e,t,n)=>{i(t);const o=r.ShapeUtil.unsqueezeShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],o)]},t.unsqueezeV13=(e,n)=>(o(n),(0,t.unsqueeze)(e,[n[0]],Array.from(n[1].integerData))),t.parseUnsqueezeAttributes=e=>e.attributes.getInts("axes");const i=e=>{if(!e||1!==e.length)throw new Error("Unsqueeze requires 1 input.");if("string"===e[0].type)throw new Error("invalid input tensor types.")},o=e=>{if(!e||2!==e.length)throw new Error("Unsqueeze requires 2 inputs.");if("int32"!==e[1].type)throw new Error("Invalid input type.")}},3980:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scalesValidation=t.validateInputs=t.parseUpsampleAttributes=t.parseUpsampleAttributesV9=t.parseUpsampleAttributesV7=t.upsample=void 0;const r=n(4910),i=n(6757),o=n(5639),s={name:"Upsample",inputNames:["X"],inputTypes:[o.TextureType.unpacked]};t.upsample=(e,n,r)=>((0,t.validateInputs)(n,r),[e.run(Object.assign(Object.assign({},s),{cacheHint:r.cacheKey,get:()=>a(e,n,r)}),n)]),t.parseUpsampleAttributesV7=e=>(0,t.parseUpsampleAttributes)(e,7),t.parseUpsampleAttributesV9=e=>(0,t.parseUpsampleAttributes)(e,9),t.parseUpsampleAttributes=(e,n)=>{const i=n>=10,o=e.attributes.getString("mode","nearest");if("nearest"!==o&&"linear"!==o&&(n<11||"cubic"!==o))throw new Error(`unrecognized mode: ${o}`);let s=[];n<9&&(s=e.attributes.getFloats("scales"),(0,t.scalesValidation)(s,o,i));const a=e.attributes.getFloat("extrapolation_value",0),u=n>10?e.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(-1===["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(u))throw new Error(`coordinate_transform_mode '${u}' is not supported`);const c="tf_crop_and_resize"===u,l=c,d="nearest"===o&&n>=11?e.attributes.getString("nearest_mode","round_prefer_floor"):"";if(-1===["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(d))throw new Error(`nearest_mode '${d}' is not supported`);const f=e.attributes.getFloat("cubic_coeff_a",-.75),h=0!==e.attributes.getInt("exclude_outside",0);if(h&&"cubic"!==o)throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");const p=n<11||"nearest"===o&&"asymmetric"===u&&"floor"===d;let g=0,m=0,b=0;return n>10?e.inputs.length>2?(g=1,m=2,b=3):(m=1,b=2):9===n&&(m=1),(0,r.createAttributeWithCacheKey)({opset:n,isResize:i,mode:o,scales:s,extrapolationValue:a,coordinateTransformMode:u,useExtrapolation:l,needRoiInput:c,nearestMode:d,cubicCoefficientA:f,excludeOutside:h,useNearest2xOptimization:p,roiInputIdx:g,scalesInputIdx:m,sizesInputIdx:b})};const a=(e,t,n)=>{const r=(0,i.getGlsl)(e.session.backend.glContext.version),[a,u]=e.calculateTextureWidthAndHeight(t[0].dims,o.TextureType.unpacked),c=t[0].dims.map(((e,t)=>Math.floor(e*n.scales[t]))),[l,d]=e.calculateTextureWidthAndHeight(c,o.TextureType.unpacked),f=c.length,h=new Array(f),p=new Array(f);let g=`\n int output_pitches[${f}];\n int input_pitches[${f}];\n `;for(let e=f-1;e>=0;e--)h[e]=e===f-1?1:h[e+1]*c[e+1],p[e]=e===f-1?1:p[e+1]*t[0].dims[e+1],g+=`\n output_pitches[${e}] = ${h[e]};\n input_pitches[${e}] = ${p[e]};\n `;const m=`\n float getInputFloat(int index) {\n vec2 coords = offsetToCoords(index, ${a}, ${u});\n float value = getColorAsFloat(${r.texture2D}(X, coords));\n return value;\n }\n `,b="nearest"===n.mode?`\n ${m}\n float process(int indices[${f}]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${l}, ${d});\n\n ${g}\n\n int d, m;\n for (int dim = 0; dim < ${f}; ++dim) {\n d = output_index / output_pitches[dim];\n m = output_index - d * output_pitches[dim];\n output_index = m;\n\n if (scales[dim] != 1 && d > 0) {\n int d2 = d / scales[dim];\n m = d - d2 * scales[dim];\n d = d2;\n }\n input_index += input_pitches[dim] * d;\n }\n\n return getInputFloat(input_index);\n }`:4===f?`\n ${m}\n float process(int indices[4]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${l}, ${d});\n\n ${g}\n\n int m;\n int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m / output_pitches[1];\n m = m - index_of_dim1 * output_pitches[1];\n index_of_dim2 = m / output_pitches[2];\n m = m - index_of_dim2 * output_pitches[2];\n index_of_dim3 = m;\n\n int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\n index_of_input_dim2 = index_of_dim2 / scales[2];\n y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\n index_of_input_dim3 = index_of_dim3 / scales[3];\n x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\n\n input_index = index_of_dim0 * input_pitches[0] +\n index_of_dim1 * input_pitches[1] +\n index_of_input_dim2 * input_pitches[2] +\n index_of_input_dim3;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim2 = false;\n if (index_of_input_dim2 == (${t[0].dims[2]} - 1)) {\n // It's the end in dimension 2\n x01 = x00;\n end_of_dim2 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[2]);\n }\n\n if (index_of_input_dim3 == (input_pitches[2] - 1)) {\n // It's the end in dimension 3\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\n }`:`\n ${m}\n float process(int indices[2]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${l}, ${d});\n\n ${g}\n\n int m;\n int index_of_dim0, index_of_dim1;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m;\n\n int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\n index_of_input_dim0 = index_of_dim0 / scales[0];\n y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\n index_of_input_dim1 = index_of_dim1 / scales[1];\n x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\n\n input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim0 = false;\n if (index_of_input_dim0 == (${t[0].dims[0]} - 1)) {\n // It's the end in dimension 0\n x01 = x00;\n end_of_dim0 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[0]);\n }\n\n if (index_of_input_dim1 == (input_pitches[0] - 1)) {\n // It's the end in dimension 1\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\n }`;return Object.assign(Object.assign({},s),{output:{dims:c,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:b,variables:[{name:"scales",type:"int",arrayLength:n.scales.length,data:n.scales.map((e=>Math.ceil(e)))}]})};t.validateInputs=(e,t)=>{if(!e||t.opset<9&&1!==e.length||t.opset>=9&&t.opset<11&&2!==e.length||t.opset>=11&&e.length<2)throw new Error("invalid inputs.");if(t.scales.length>0&&e[0].dims.length!==t.scales.length)throw new Error("Invalid input shape.");if("string"===e[0].type)throw new Error("Invalid input tensor types.")},t.scalesValidation=(e,t,n)=>{if(n){for(const t of e)if(t<=0)throw new Error("Scale value should be greater than 0.")}else for(const t of e)if(t<1)throw new Error("Scale value should be greater than or equal to 1.");if(!("linear"!==t&&"cubic"!==t||2===e.length||4===e.length&&1===e[0]&&1===e[1]))throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${n?"Resize":"Upsample"} opeartor.`)}},2757:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProgramManager=void 0;const r=n(8453),i=n(1315),o=n(8897),s=n(6757);t.ProgramManager=class{constructor(e,t,n){this.profiler=e,this.glContext=t,this.textureLayoutStrategy=n,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,n){var r;this.profiler.event("op",`ProgramManager.run ${null!==(r=e.programInfo.name)&&void 0!==r?r:"unknown kernel"}`,(()=>{var r;const o=this.glContext.gl,s=e.program;o.useProgram(s);try{this.bindOutput(n),this.attributesBound||this.bindAttributes(e.attribLocations),this.bindUniforms(e.uniformLocations,null!==(r=e.programInfo.variables)&&void 0!==r?r:[],t)}catch(t){throw i.Logger.error("ProgramManager",e.programInfo.shaderSource),t}this.profiler.event("backend","GlContext.draw()",(()=>{this.glContext.draw()}))}),this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach((e=>this.glContext.deleteProgram(e.program)))}build(e,t,n){return this.profiler.event("backend","ProgramManager.build",(()=>{const r=new o.GlslPreprocessor(this.glContext,e,t,n),i=r.preprocess(),s=this.compile(i);return{programInfo:e,program:s,uniformLocations:this.getUniformLocations(s,r.context.programInfo.inputNames,r.context.programInfo.variables),attribLocations:this.getAttribLocations(s)}}))}compile(e){if(!this.vertexShader){i.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");const e=(0,s.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(e,this.glContext.gl.VERTEX_SHADER)}r.env.debug&&i.Logger.verbose("ProrgramManager",`FragShader:\n${e}\n`);const t=this.glContext.compileShader(e,this.glContext.gl.FRAGMENT_SHADER),n=this.glContext.createProgram(this.vertexShader,t);return this.glContext.deleteShader(t),n}bindOutput(e){const t=e.width,n=e.height;i.Logger.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${t}/${n}, shape=${e.shape}, type=${e.tensor.type}`),this.glContext.attachFramebuffer(e.texture,t,n)}bindAttributes(e){const t=e.position,n=e.textureCoord;this.glContext.setVertexAttributes(t,n),this.attributesBound=!0}bindUniforms(e,t,n){var r;const i=this.glContext.gl;let o=0;for(const{name:s,type:a,location:u,arrayLength:c}of e){const e=null===(r=t.find((e=>e.name===s)))||void 0===r?void 0:r.data;if("sampler2D"!==a&&!e)throw new Error(`variable '${s}' does not have data defined in program info`);switch(a){case"sampler2D":this.bindTexture(n[o],u,o),o++;break;case"float":c?i.uniform1fv(u,e):i.uniform1f(u,e);break;case"int":c?i.uniform1iv(u,e):i.uniform1i(u,e);break;default:throw new Error(`Uniform not implemented: ${a}`)}}}bindTexture(e,t,n){this.glContext.bindTextureToUniform(e.texture,n,t)}getAttribLocations(e){return{position:this.getAttribLocation(e,"position"),textureCoord:this.getAttribLocation(e,"textureCoord")}}getUniformLocations(e,t,n){const r=[];if(t)for(const n of t)r.push({name:n,type:"sampler2D",location:this.getUniformLocation(e,n)});if(n)for(const t of n)r.push(Object.assign(Object.assign({},t),{location:this.getUniformLocation(e,t.name)}));return r}getUniformLocation(e,t){const n=this.glContext.gl.getUniformLocation(e,t);if(null===n)throw new Error(`Uniform ${t} not found.`);return n}getAttribLocation(e,t){return this.glContext.gl.getAttribLocation(e,t)}}},2171:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLSessionHandler=void 0;const r=n(1315),i=n(5881),o=n(7860),s=n(4110),a=n(2757),u=n(7618),c=n(5243);t.WebGLSessionHandler=class{constructor(e,t){this.backend=e,this.context=t,this.layoutStrategy=new u.PreferLogicalStrategy(e.glContext.maxTextureSize),this.programManager=new a.ProgramManager(this.context.profiler,e.glContext,this.layoutStrategy),this.textureManager=new c.TextureManager(e.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:"full"===e.textureCacheMode}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=e.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new o.WebGLInferenceHandler(this)}onGraphInitialized(e){const t=e.getValues().filter((e=>-1===e.from&&e.tensor)).map((e=>e.tensor.dataId));this.initializers=new Set(t)}isInitializer(e){return!!this.initializers&&this.initializers.has(e)}addInitializer(e){this.initializers.add(e)}getTextureData(e,t){return t?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,t,n=!1){r.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),n?this.packedTextureDataCache.set(e,t):this.unpackedTextureDataCache.set(e,t)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((e=>this.textureManager.releaseTexture(e,!0))),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((e=>this.textureManager.releaseTexture(e,!0))),this.unpackedTextureDataCache=new Map}resolve(e,t,n){const r=(0,i.resolveOperator)(e,t,s.WEBGL_OP_RESOLVE_RULES);return{impl:r.opImpl,context:r.opInit?r.opInit(e,n):e}}}},9622:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Uint8DataEncoder=t.RGBAFloatDataEncoder=t.RedFloat32DataEncoder=void 0;const r=n(1315);t.RedFloat32DataEncoder=class{constructor(e,t=1){if(1===t)this.internalFormat=e.R32F,this.format=e.RED,this.textureType=e.FLOAT,this.channelSize=t;else{if(4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA32F,this.format=e.RGBA,this.textureType=e.FLOAT,this.channelSize=t}}encode(e,t){let n,i;return e.constructor!==Float32Array&&(r.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),i=new Float32Array(e)),t*this.channelSize>e.length?(r.Logger.warning("Encoder","Source data too small. Allocating larger array"),i=e,n=this.allocate(t*this.channelSize),i.forEach(((e,t)=>n[t]=e))):(i=e,n=i),n}allocate(e){return new Float32Array(4*e)}decode(e,t){return 1===this.channelSize?e.filter(((e,t)=>t%4==0)).subarray(0,t):e.subarray(0,t)}},t.RGBAFloatDataEncoder=class{constructor(e,t=1,n){if(1!==t&&4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA,this.format=e.RGBA,this.channelSize=t,this.textureType=n||e.FLOAT}encode(e,t){let n=e;return 1===this.channelSize&&(r.Logger.verbose("Encoder","Exploding into a larger array"),n=this.allocate(t),e.forEach(((e,t)=>n[4*t]=e))),n}allocate(e){return new Float32Array(4*e)}decode(e,t){return 1===this.channelSize?e.filter(((e,t)=>t%4==0)).subarray(0,t):e.subarray(0,t)}},t.Uint8DataEncoder=class{constructor(e,t=1){if(this.channelSize=4,1===t)this.internalFormat=e.ALPHA,this.format=e.ALPHA,this.textureType=e.UNSIGNED_BYTE,this.channelSize=t;else{if(4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA,this.format=e.RGBA,this.textureType=e.UNSIGNED_BYTE,this.channelSize=t}}encode(e,t){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}allocate(e){return new Uint8Array(e*this.channelSize)}decode(e,t){if(e instanceof Uint8Array)return e.subarray(0,t);throw new Error(`Invalid array type: ${e.constructor}`)}}},7618:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBatchDim=t.sizeToSquarishShape=t.getRowsCols=t.sizeFromShape=t.isInt=t.parseAxisParam=t.squeezeShape=t.PreferLogicalStrategy=t.AlwaysKeepOriginalSizeStrategy=void 0;const r=n(1315),i=n(7273);function o(e,t){const n=[],r=[],i=null!=t&&Array.isArray(t)&&0===t.length,o=null==t||i?null:s(t,e).sort();let a=0;for(let t=0;t<e.length;++t){if(null!=o){if(o[a]===t&&1!==e[t])throw new Error(`Can't squeeze axis ${t} since its dim '${e[t]}' is not 1`);(null==o[a]||o[a]>t)&&1===e[t]&&(n.push(e[t]),r.push(t)),o[a]<=t&&a++}1!==e[t]&&(n.push(e[t]),r.push(t))}return{newShape:n,keptDims:r}}function s(e,t){const n=t.length;return e=null==e?t.map(((e,t)=>t)):[].concat(e),(0,i.assert)(e.every((e=>e>=-n&&e<n)),(()=>`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`)),(0,i.assert)(e.every(a),(()=>`All values in axis param must be integers but got axis ${e}`)),e.map((e=>e<0?n+e:e))}function a(e){return e%1==0}function u(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n<e.length;n++)t*=e[n];return t}function c(e){const t=Math.ceil(Math.sqrt(e));return[t,Math.ceil(e/t)]}t.AlwaysKeepOriginalSizeStrategy=class{constructor(e){this.maxTextureSize=e}computeTextureWH(e,t){if(0===e.length)return[1,1];const n=this.maxTextureSize;if(t&&void 0!==t.breakAxis){const i=t.breakAxis>=e.length?1:e.slice(t.breakAxis).reduce(((e,t)=>e*t)),o=t.breakAxis<=0?1:e.slice(0,t.breakAxis).reduce(((e,t)=>e*t));if(!(i>n||o>n))return[i,o];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${e}, breakAxis:${t.breakAxis}`)}const i=e.reduce(((e,t)=>e*t));let o=Math.floor(Math.sqrt(i));for(;o<n&&o<i&&i%o!=0;o++);if(o>=n||i%o!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${e}`);return[o,i/o]}},t.PreferLogicalStrategy=class{constructor(e){this.maxTextureSize=e}computeTextureWH(e,t){const n=this.computeTexture(e,t);return t&&t.isPacked&&(n[0]/=2,n[1]/=2),t&&t.reverseWH?[n[1],n[0]]:n}computeTexture(e,t){const n=t&&t.isPacked;if(0===e.length)return n?[2,2]:[1,1];let i=this.maxTextureSize;if(t&&void 0!==t.breakAxis){const n=t.breakAxis>=e.length?1:e.slice(t.breakAxis).reduce(((e,t)=>e*t)),o=t.breakAxis<=0?1:e.slice(0,t.breakAxis).reduce(((e,t)=>e*t));if(!(n>i||o>i))return[n,o];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${e}, breakAxis:${t.breakAxis}`)}let s=e.slice(0);if(n&&(i*=2,s=s.map(((e,t)=>t>=s.length-2?s[t]%2==0?s[t]:s[t]+1:s[t])),1===s.length&&(s=[2,s[0]])),2!==s.length){const e=o(s);s=e.newShape}const a=u(s);return s.length<=1&&a<=i?[1,a]:2===s.length&&s[0]<=i&&s[1]<=i?s:3===s.length&&s[0]*s[1]<=i&&s[2]<=i?[s[0]*s[1],s[2]]:3===s.length&&s[0]<=i&&s[1]*s[2]<=i?[s[0],s[1]*s[2]]:4===s.length&&s[0]*s[1]*s[2]<=i&&s[3]<=i?[s[0]*s[1]*s[2],s[3]]:4===s.length&&s[0]<=i&&s[1]*s[2]*s[3]<=i?[s[0],s[1]*s[2]*s[3]]:n?c(a/4).map((e=>2*e)):c(a)}},t.squeezeShape=o,t.parseAxisParam=s,t.isInt=a,t.sizeFromShape=u,t.getRowsCols=function(e){if(0===e.length)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]},t.sizeToSquarishShape=c,t.getBatchDim=function(e,t=2){return u(e.slice(0,e.length-t))}},3314:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTextureLayoutFromShape=t.calculateTextureWidthAndHeight=t.createTextureLayoutFromTextureType=void 0;const r=n(7273),i=n(5639);t.createTextureLayoutFromTextureType=(e,n,r)=>{const o=r===i.TextureType.unpacked||r===i.TextureType.unpackedReversed?1:4,s=r===i.TextureType.packed,a=r===i.TextureType.unpackedReversed||r===i.TextureType.packed,u=r===i.TextureType.packedLastDimension?n.length-1:void 0,c=r===i.TextureType.packedLastDimension?n.map(((e,t)=>t===n.length-1?4*e:e)):void 0;return(0,t.createTextureLayoutFromShape)(e,n,o,c,{isPacked:s,reverseWH:a,breakAxis:u})},t.calculateTextureWidthAndHeight=(e,n,r)=>{const i=(0,t.createTextureLayoutFromTextureType)(e,n,r);return[i.width,i.height]},t.createTextureLayoutFromShape=(e,t,n=1,i,o)=>{const s=!(!o||!o.isPacked),[a,u]=e.computeTextureWH(s&&i||t,o),c=t.length;let l=t.slice(0);if(0===c&&(l=[1]),1===n)i=t;else if(s){if(4!==n)throw new Error("a packed texture must be 4-channel");i=t,c>0&&(l[c-1]=Math.ceil(l[c-1]/2)),c>1&&(l[c-2]=Math.ceil(l[c-2]/2))}else if(!i)throw new Error("Unpacked shape is needed when using channels > 1");return{width:a,height:u,channels:n,isPacked:s,shape:l,strides:r.ShapeUtil.computeStrides(l),unpackedShape:i,reversedWH:o&&o.reverseWH}}},5243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextureManager=void 0;const r=n(1315);t.TextureManager=class{constructor(e,t,n,r){this.glContext=e,this.layoutStrategy=t,this.profiler=n,this.config=r,this.pendingRead=new Map,r.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(e,t,n,i){const o=this.toEncoderType(e),s=this.glContext.getEncoder(o,t.channels||1,i);if(t.isPacked&&1===i)throw new Error("not implemented");const a=t.width,u=t.height;let c,l;if(this.config.reuseTextures){c=`${a}x${u}_${s.format}_${s.internalFormat}_${s.textureType}`,l=this.inUseTextures.get(c),l||(l=[],this.inUseTextures.set(c,l));const t=this.idleTextures.get(c);if(t&&t.length>0){const r=t.pop();return l.push(r),1===i&&this.glContext.updateTexture(r,a,u,s,this.toTextureData(e,n)),r}}r.Logger.verbose("TextureManager",`Creating new texture of size ${t.width}x${t.height}`);const d=this.glContext.allocateTexture(a,u,s,this.toTextureData(e,n));return this.config.reuseTextures&&(l.push(d),this.textureLookup.set(d,c)),d}readTexture(e,t,n){return n||(n=1),this.profiler.event("backend","TextureManager.readTexture",(()=>{const r=e.shape.reduce(((e,t)=>e*t))*n,i=this.glContext.readTexture(e.texture,e.width,e.height,r,this.toEncoderType(t),n);return this.toTensorData(t,i)}))}async readTextureAsync(e,t,n){const r=e.tensor.dataId;if(n||(n=1),this.pendingRead.has(r)){const e=this.pendingRead.get(r);return new Promise((t=>null==e?void 0:e.push(t)))}return this.profiler.event("backend","TextureManager.readTextureAsync",(async()=>{this.pendingRead.set(r,[]);const i=e.shape.reduce(((e,t)=>e*t))*n;await this.glContext.createAndWaitForFence();const o=this.glContext.readTexture(e.texture,e.width,e.height,i,this.toEncoderType(t),n),s=this.toTensorData(t,o),a=this.pendingRead.get(r);return this.pendingRead.delete(r),null==a||a.forEach((e=>e(s))),s}))}readUint8TextureAsFloat(e){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",(()=>{const t=e.shape.reduce(((e,t)=>e*t)),n=this.glContext.readTexture(e.texture,e.width,e.height,4*t,"byte",4);return new Float32Array(n.buffer,n.byteOffset,t)}))}releaseTexture(e,t){let n;if(this.config.reuseTextures&&(n=this.textureLookup.get(e.texture),n)){t&&this.textureLookup.delete(n);const r=this.inUseTextures.get(n);if(r){const t=r.indexOf(e.texture);if(-1!==t){r.splice(t,1);let i=this.idleTextures.get(n);i||(i=[],this.idleTextures.set(n,i)),i.push(e.texture)}}}n&&!t||(r.Logger.verbose("TextureManager",`Deleting texture of size ${e.width}x${e.height}`),this.glContext.deleteTexture(e.texture))}toTensorData(e,t){switch(e){case"int16":return t instanceof Int16Array?t:Int16Array.from(t);case"int32":return t instanceof Int32Array?t:Int32Array.from(t);case"int8":return t instanceof Int8Array?t:Int8Array.from(t);case"uint16":return t instanceof Uint16Array?t:Uint16Array.from(t);case"uint32":return t instanceof Uint32Array?t:Uint32Array.from(t);case"uint8":case"bool":return t instanceof Uint8Array?t:Uint8Array.from(t);case"float32":return t instanceof Float32Array?t:Float32Array.from(t);case"float64":return t instanceof Float64Array?t:Float64Array.from(t);default:throw new Error(`TensorData type ${e} is not supported`)}}toTextureData(e,t){if(t)return t instanceof Float32Array?t:new Float32Array(t)}toEncoderType(e){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},5639:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TextureType=void 0,(n=t.TextureType||(t.TextureType={}))[n.unpacked=0]="unpacked",n[n.unpackedReversed=1]="unpackedReversed",n[n.packed=2]="packed",n[n.downloadUint8AsFloat=3]="downloadUint8AsFloat",n[n.packedLastDimension=4]="packedLastDimension"},432:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGlChannels=t.getCoordsDataType=t.getSqueezedParams=t.squeezeInputShape=t.generateShaderFuncNameFromInputSamplerNameAtOutCoords=t.generateShaderFuncNameFromInputSamplerName=t.repeatedTry=t.getPackedShape=void 0;const r=n(7273);t.getPackedShape=function(e){const t=e.length;return e.slice(0,t-1).concat(e[t-1]/4)},t.repeatedTry=async function(e,t=(e=>0),n){return new Promise(((r,i)=>{let o=0;const s=()=>{if(e())return void r();o++;const a=t(o);null!=n&&o>=n?i():setTimeout(s,a)};s()}))},t.generateShaderFuncNameFromInputSamplerName=function(e){return(0,r.assert)(void 0!==e&&0!==e.length,(()=>"empty string found for sampler name")),"get"+e.charAt(0).toUpperCase()+e.slice(1)},t.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(e){return(0,r.assert)(void 0!==e&&0!==e.length,(()=>"empty string found for sampler name")),"get"+e.charAt(0).toUpperCase()+e.slice(1)+"AtOutCoords"},t.squeezeInputShape=function(e,t){let n=JSON.parse(JSON.stringify(e));return n=t,n},t.getSqueezedParams=function(e,t){return t.map((t=>e[t])).join(", ")},t.getCoordsDataType=function(e){if(e<=1)return"int";if(2===e)return"ivec2";if(3===e)return"ivec3";if(4===e)return"ivec4";if(5===e)return"ivec5";if(6===e)return"ivec6";throw Error(`GPU for rank ${e} is not yet supported`)},t.getGlChannels=function(e=6){return["x","y","z","w","u","v"].slice(0,e)}},3389:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNewWebGLContext=t.createWebGLContext=void 0;const r=n(1315),i=n(3524),o={};function s(e){const t=function(){if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas)throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}const e=document.createElement("canvas");return e.width=1,e.height=1,e}();let n;const o={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!e||"webgl2"===e)&&(n=t.getContext("webgl2",o),n))try{return new i.WebGLContext(n,2)}catch(e){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${e}`)}if((!e||"webgl"===e)&&(n=t.getContext("webgl",o)||t.getContext("experimental-webgl",o),n))try{return new i.WebGLContext(n,1)}catch(e){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${e}`)}throw new Error("WebGL is not supported")}t.createWebGLContext=function e(t){let n;t&&"webgl2"!==t||!("webgl2"in o)?t&&"webgl"!==t||!("webgl"in o)||(n=o.webgl):n=o.webgl2,n=n||s(t),t=t||1===n.version?"webgl":"webgl2";const r=n.gl;return o[t]=n,r.isContextLost()?(delete o[t],e(t)):(r.disable(r.DEPTH_TEST),r.disable(r.STENCIL_TEST),r.disable(r.BLEND),r.disable(r.DITHER),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SAMPLE_COVERAGE),r.enable(r.SCISSOR_TEST),r.enable(r.CULL_FACE),r.cullFace(r.BACK),n)},t.createNewWebGLContext=s},3524:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLContext=t.linearSearchLastTrue=void 0;const s=n(8453),a=o(n(9622)),u=n(432);function c(e){let t=0;for(;t<e.length&&e[t]();++t);return t-1}t.linearSearchLastTrue=c,t.WebGLContext=class{constructor(e,t){this.frameBufferBound=!1,this.itemsToPoll=[],this.gl=e,this.version=t,this.getExtensions(),this.vertexbuffer=this.createVertexbuffer(),this.framebuffer=this.createFramebuffer(),this.queryVitalParameters()}allocateTexture(e,t,n,r){const i=this.gl,o=i.createTexture();i.bindTexture(i.TEXTURE_2D,o),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE);const s=r?n.encode(r,e*t):null;return i.texImage2D(i.TEXTURE_2D,0,n.internalFormat,e,t,0,n.format,n.textureType,s),this.checkError(),o}updateTexture(e,t,n,r,i){const o=this.gl;o.bindTexture(o.TEXTURE_2D,e);const s=r.encode(i,t*n);o.texSubImage2D(o.TEXTURE_2D,0,0,0,t,n,r.format,r.textureType,s),this.checkError()}attachFramebuffer(e,t,n){const r=this.gl;r.bindTexture(r.TEXTURE_2D,e),r.bindFramebuffer(r.FRAMEBUFFER,this.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0),this.checkError(),r.viewport(0,0,t,n),r.scissor(0,0,t,n)}readTexture(e,t,n,r,i,o){const s=this.gl;o||(o=1),this.frameBufferBound||this.attachFramebuffer(e,t,n);const a=this.getEncoder(i,o),u=a.allocate(t*n);return s.bindTexture(s.TEXTURE_2D,e),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,e,0),s.readPixels(0,0,t,n,s.RGBA,a.textureType,u),this.checkError(),a.decode(u,r)}isFramebufferReady(){return!0}getActiveTexture(){const e=this.gl;return"TEXTURE"+(e.getParameter(this.gl.ACTIVE_TEXTURE)-e.TEXTURE0)}getTextureBinding(){return this.gl.getParameter(this.gl.TEXTURE_BINDING_2D)}getFramebufferBinding(){return this.gl.getParameter(this.gl.FRAMEBUFFER_BINDING)}setVertexAttributes(e,t){const n=this.gl;n.vertexAttribPointer(e,3,n.FLOAT,!1,20,0),n.enableVertexAttribArray(e),-1!==t&&(n.vertexAttribPointer(t,2,n.FLOAT,!1,20,12),n.enableVertexAttribArray(t)),this.checkError()}createProgram(e,t){const n=this.gl,r=n.createProgram();return n.attachShader(r,e),n.attachShader(r,t),n.linkProgram(r),r}compileShader(e,t){const n=this.gl,r=n.createShader(t);if(!r)throw new Error(`createShader() returned null with type ${t}`);if(n.shaderSource(r,e),n.compileShader(r),!1===n.getShaderParameter(r,n.COMPILE_STATUS))throw new Error(`Failed to compile shader: ${n.getShaderInfoLog(r)}\nShader source:\n${e}`);return r}deleteShader(e){this.gl.deleteShader(e)}bindTextureToUniform(e,t,n){const r=this.gl;r.activeTexture(r.TEXTURE0+t),this.checkError(),r.bindTexture(r.TEXTURE_2D,e),this.checkError(),r.uniform1i(n,t),this.checkError()}draw(){this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.checkError()}checkError(){if(s.env.debug){const e=this.gl,t=e.getError();let n="";switch(t){case e.NO_ERROR:return;case e.INVALID_ENUM:n="INVALID_ENUM";break;case e.INVALID_VALUE:n="INVALID_VALUE";break;case e.INVALID_OPERATION:n="INVALID_OPERATION";break;case e.INVALID_FRAMEBUFFER_OPERATION:n="INVALID_FRAMEBUFFER_OPERATION";break;case e.OUT_OF_MEMORY:n="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n="CONTEXT_LOST_WEBGL";break;default:n=`Unknown WebGL Error: ${t.toString(16)}`}throw new Error(n)}}deleteTexture(e){this.gl.deleteTexture(e)}deleteProgram(e){this.gl.deleteProgram(e)}getEncoder(e,t,n=0){if(2===this.version)return new a.RedFloat32DataEncoder(this.gl,t);switch(e){case"float":return 1===n||this.isRenderFloat32Supported?new a.RGBAFloatDataEncoder(this.gl,t):new a.RGBAFloatDataEncoder(this.gl,t,this.textureHalfFloatExtension.HALF_FLOAT_OES);case"int":throw new Error("not implemented");case"byte":return new a.Uint8DataEncoder(this.gl,t);default:throw new Error(`Invalid dataType: ${e}`)}}clearActiveTextures(){const e=this.gl;for(let t=0;t<this.maxTextureImageUnits;++t)e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,null)}dispose(){if(this.disposed)return;const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteFramebuffer(this.framebuffer),e.bindBuffer(e.ARRAY_BUFFER,null),e.deleteBuffer(this.vertexbuffer),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),e.finish(),this.disposed=!0}createDefaultGeometry(){return new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0])}createVertexbuffer(){const e=this.gl,t=e.createBuffer();if(!t)throw new Error("createBuffer() returned null");const n=this.createDefaultGeometry();return e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW),this.checkError(),t}createFramebuffer(){const e=this.gl.createFramebuffer();if(!e)throw new Error("createFramebuffer returned null");return e}queryVitalParameters(){const e=this.gl;if(this.isFloatTextureAttachableToFrameBuffer=this.checkFloatTextureAttachableToFrameBuffer(),this.isRenderFloat32Supported=this.checkRenderFloat32(),this.isFloat32DownloadSupported=this.checkFloat32Download(),1===this.version&&!this.textureHalfFloatExtension&&!this.isRenderFloat32Supported)throw new Error("both float32 and float16 TextureType are not supported");this.isBlendSupported=!this.isRenderFloat32Supported||this.checkFloat32Blend(),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxTextureImageUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.version}getExtensions(){2===this.version?(this.colorBufferFloatExtension=this.gl.getExtension("EXT_color_buffer_float"),this.disjointTimerQueryWebgl2Extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")):(this.textureFloatExtension=this.gl.getExtension("OES_texture_float"),this.textureHalfFloatExtension=this.gl.getExtension("OES_texture_half_float"))}checkFloatTextureAttachableToFrameBuffer(){const e=this.gl,t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);const n=2===this.version?e.RGBA32F:e.RGBA;e.texImage2D(e.TEXTURE_2D,0,n,1,1,0,e.RGBA,e.FLOAT,null);const r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0);const i=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(t),e.deleteFramebuffer(r),i}checkRenderFloat32(){if(2===this.version){if(!this.colorBufferFloatExtension)return!1}else if(!this.textureFloatExtension)return!1;return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Download(){if(2===this.version){if(!this.colorBufferFloatExtension)return!1}else{if(!this.textureFloatExtension)return!1;if(!this.gl.getExtension("WEBGL_color_buffer_float"))return!1}return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Blend(){const e=this.gl;let t,n,r,i,o;try{t=e.createTexture(),n=e.createFramebuffer(),e.bindTexture(e.TEXTURE_2D,t);const s=2===this.version?e.RGBA32F:e.RGBA;return e.texImage2D(e.TEXTURE_2D,0,s,1,1,0,e.RGBA,e.FLOAT,null),e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),e.enable(e.BLEND),r=e.createShader(e.VERTEX_SHADER),!!r&&(e.shaderSource(r,"void main(){}"),e.compileShader(r),i=e.createShader(e.FRAGMENT_SHADER),!!i&&(e.shaderSource(i,"precision highp float;void main(){gl_FragColor=vec4(0.5);}"),e.compileShader(i),o=e.createProgram(),!!o&&(e.attachShader(o,r),e.attachShader(o,i),e.linkProgram(o),e.useProgram(o),e.drawArrays(e.POINTS,0,1),e.getError()===e.NO_ERROR)))}finally{e.disable(e.BLEND),o&&e.deleteProgram(o),r&&e.deleteShader(r),i&&e.deleteShader(i),n&&(e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteFramebuffer(n)),t&&(e.bindTexture(e.TEXTURE_2D,null),e.deleteTexture(t))}}beginTimer(){if(2===this.version&&this.disjointTimerQueryWebgl2Extension){const e=this.gl,t=this.disjointTimerQueryWebgl2Extension,n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}throw new Error("WebGL1 profiling currently not supported.")}endTimer(){if(2!==this.version||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");{const e=this.gl,t=this.disjointTimerQueryWebgl2Extension;e.endQuery(t.TIME_ELAPSED_EXT)}}isTimerResultAvailable(e){let t=!1,n=!1;if(2!==this.version||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");{const r=this.gl,i=this.disjointTimerQueryWebgl2Extension;t=r.getQueryParameter(e,r.QUERY_RESULT_AVAILABLE),n=r.getParameter(i.GPU_DISJOINT_EXT)}return t&&!n}getTimerResult(e){let t=0;if(2!==this.version)throw new Error("WebGL1 profiling currently not supported");{const n=this.gl;t=n.getQueryParameter(e,n.QUERY_RESULT),n.deleteQuery(e)}return t/1e6}async waitForQueryAndGetTime(e){return await(0,u.repeatedTry)((()=>this.isTimerResultAvailable(e))),this.getTimerResult(e)}async createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t;const n=e,r=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);return e.flush(),t=null===r?()=>!0:()=>{const e=n.clientWaitSync(r,0,0);return e===n.ALREADY_SIGNALED||e===n.CONDITION_SATISFIED},{query:r,isFencePassed:t}}async pollFence(e){return new Promise((t=>{this.addItemToPoll((()=>e.isFencePassed()),(()=>t()))}))}pollItems(){const e=c(this.itemsToPoll.map((e=>e.isDoneFn)));for(let t=0;t<=e;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}async addItemToPoll(e,t){this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||await(0,u.repeatedTry)((()=>(this.pollItems(),0===this.itemsToPoll.length)))}}},6496:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExecutionPlan=void 0;const r=n(1315);class i{constructor(e,t){this.op=e,this.node=t}}t.ExecutionPlan=class{constructor(e,t,n){this.graph=e,this.profiler=n,this.initialize(t)}initialize(e){this.profiler.event("session","ExecutionPlan.initialize",(()=>{const t=this.graph.getNodes();if(t.length!==e.length)throw new Error("The size of nodes and OPs do not match.");this._ops=e.map(((e,n)=>new i(e,t[n]))),this.reset(),this._starter=[],this._ops.forEach(((e,t)=>{let n=!0;for(const t of e.node.inputs)if(!this._values[t]&&-1===this.graph.getInputIndices().indexOf(t)){n=!1;break}n&&this._starter.push(t)}))}))}reset(){this._values=this.graph.getValues().map((e=>e.tensor))}async execute(e,t){return this.profiler.event("session","ExecutionPlan.execute",(async()=>{this.reset();const n=e.createInferenceHandler(),i=this.graph.getInputIndices();if(t.length!==i.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${t.length} expected: ${i.length}`);t.forEach(((e,t)=>{const n=i[t];this._values[n]=e}));const o=this._starter.slice(0),s=this.graph.getValues(),a=this.graph.getNodes();let u=0;for(;u<o.length;){const e=o[u++],t=this._ops[e],i=t.node.inputs.map((e=>this._values[e]));if(-1!==i.indexOf(void 0))throw new Error(`unresolved input detected: op: ${t.node}`);const c=i;r.Logger.verbose("ExecPlan",`Runing op:${t.node.name} (${c.map(((e,n)=>`'${t.node.inputs[n]}': ${e.type}[${e.dims.join(",")}]`)).join(", ")})`);const l=await this.profiler.event("node",t.node.name,(async()=>t.op.impl(n,c,t.op.context)));if(l.length!==t.node.outputs.length)throw new Error("the size of output does not match model definition.");l.forEach(((e,n)=>{const r=t.node.outputs[n];if(this._values[r])throw new Error(`output [${r}] already has value: op:${t.node.name}`);this._values[r]=e}));const d=new Set;l.forEach(((e,n)=>{const r=t.node.outputs[n];for(const e of s[r].to){const t=a[e];let n=!0;for(const e of t.inputs)if(!this._values[e]){n=!1;break}n&&d.add(e)}})),o.push(...d)}const c=[];for(let e=0;e<this.graph.getOutputIndices().length;e++){const t=this.graph.getOutputIndices()[e],n=this._values[t];if(void 0===n)throw new Error(`required output [${t}] does not have value`);0===t?await n.getData():n.data,c.push(n)}return r.Logger.verbose("ExecPlan","disposing of inferenceHandler"),n.dispose(),c}))}}},4662:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Graph=void 0;const r=n(1446),i=n(6874),o=n(1287),s=n(9240),a=n(7273);var u=o.onnxruntime.experimental.fbs;t.Graph={from:(e,t)=>new d(e,t)};class c{constructor(e){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,e&&(this.type=a.ProtoUtil.tensorValueTypeFromProto(e.type.tensorType))}get from(){return this._from}get to(){return this._to}}class l{constructor(e,t){e instanceof r.onnx.NodeProto?(this.name=e.name,this.opType=e.opType,this.attributes=new i.Attribute(e.attribute)):e instanceof u.Node&&(this.name=null!=t?t:e.name(),this.opType=e.opType(),this.attributes=new i.Attribute(a.ProtoUtil.tensorAttributesFromORTFormat(e))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class d{constructor(e,t){if(!e)throw new TypeError("graph is empty");this.buildGraph(e),this.transformGraph(t),this.checkIsAcyclic()}getInputIndices(){return this._allInputIndices}getInputNames(){return this._allInputNames}getOutputIndices(){return this._allOutputIndices}getOutputNames(){return this._allOutputNames}getValues(){return this._allData}getNodes(){return this._nodes}buildGraph(e){if(e instanceof r.onnx.GraphProto)this.buildGraphFromOnnxFormat(e);else{if(!(e instanceof u.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(e)}}buildGraphFromOnnxFormat(e){const t=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const n=new Map;if(!e.input)throw new Error("missing information in graph: input");const r=[];for(const n of e.input){if(t.has(n.name))throw new Error(`duplicated input name: ${n.name}`);const e=this._allData.push(new c(n))-1;t.set(n.name,e),r.push(n.name)}if(!e.initializer)throw new Error("missing information in graph: initializer");for(const n of e.initializer){let e=t.get(n.name);if(void 0===e){const r=new c;r.type={shape:{dims:a.ProtoUtil.tensorDimsFromProto(n.dims)},tensorType:a.ProtoUtil.tensorDataTypeFromProto(n.dataType)},e=this._allData.push(r)-1,t.set(n.name,e)}this._allData[e]._from=-1,this._allData[e].tensor=s.Tensor.fromProto(n)}for(let e=0;e<this._allData.length;e++)this._allData[e].tensor||(this._allInputIndices.push(e),this._allInputNames.push(r[e]));if(!e.output)throw new Error("missing information in graph: output");for(const n of e.output){if(t.has(n.name))throw new Error(`duplicated output name: ${n.name}`);const e=this._allData.push(new c(n))-1;t.set(n.name,e),this._allOutputIndices.push(e),this._allOutputNames.push(n.name)}if(!e.node)throw new Error("missing information in graph: node");for(const t of e.node){if(!t.name)for(let e=0;;e++){const r=`unnamed_${t.opType}_${e}`;if(!n.has(r)){t.name=r;break}}if(n.has(t.name))throw new Error(`duplicated node name: ${t.name}`);const e=this._nodes.push(new l(t))-1;n.set(t.name,e)}for(let n=0;n<this._nodes.length;n++){const r=this._nodes[n],i=e.node[n];if(!i.output)throw new Error(`missing output for node: ${i.name}`);for(const e of i.output){let o=t.get(e);if(void 0===o&&(o=this._allData.push(new c)-1,t.set(e,o)),r.outputs.push(o),void 0!==this._allData[o]._from)throw new Error(`multiple nodes output to one data value: ${o}`);if(this._allData[o]._from=n,"Constant"===i.opType){if(!i.attribute||1!==i.attribute.length||!i.attribute[0].t)throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(!i.output||1!==i.output.length)throw new Error("missing output or incorrect number of outputs for this Constant operator");r.outputs.pop(),r.executeNode=!1,this._allData[o]._from=-1,this._allData[o].tensor=s.Tensor.fromProto(i.attribute[0].t)}}}for(let n=0;n<this._nodes.length;n++){const r=this._nodes[n],i=e.node[n];if(!i.input)throw new Error(`missing input for node: ${i.name}`);for(const e of i.input){const o=t.get(e);if(void 0===o){if(""===e&&3===i.input.length&&"Resize"===i.opType)continue;throw new Error(`unrecognized input '${e}' for node: ${i.name}`)}r.inputs.push(o),this._allData[o]._to.push(n)}}return!0}buildGraphFromOrtFormat(e){var t,n,r;const i=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const o=new Map,d=[];for(let o=0;o<e.inputsLength();o++){const s=e.inputs(o);if(i.has(s))throw new Error(`duplicated input name: ${s}`);for(let o=0;o<e.nodeArgsLength();o++)if((null===(t=e.nodeArgs(o))||void 0===t?void 0:t.name())===s){const t=new c;if((null===(r=null===(n=e.nodeArgs(o))||void 0===n?void 0:n.type())||void 0===r?void 0:r.valueType())!==u.TypeInfoValue.tensor_type)throw new Error("Unexpected value type for the nodeArg.");const l=e.nodeArgs(o).type().value(new u.TensorTypeAndShape),f=a.ProtoUtil.tensorDataTypeFromProto(l.elemType()),h=l.shape(),p=[];for(let e=0;e<h.dimLength();e++)p.push(a.LongUtil.longToNumber(h.dim(e).value().dimValue()));t.type={shape:{dims:p},tensorType:f};const g=this._allData.push(t)-1;i.set(s,g),d.push(s)}}for(let t=0;t<e.initializersLength();t++){const n=e.initializers(t);let r=i.get(n.name());if(void 0===r){const e=new c,t=a.ProtoUtil.tensorDimsFromORTFormat(n),o=a.ProtoUtil.tensorDataTypeFromProto(n.dataType());e.type={shape:{dims:t},tensorType:o},r=this._allData.push(e)-1,i.set(n.name(),r)}this._allData[r]._from=-1,this._allData[r].tensor=s.Tensor.fromOrtTensor(n)}for(let e=0;e<this._allData.length;e++)this._allData[e].tensor||(this._allInputIndices.push(e),this._allInputNames.push(d[e]));for(let t=0;t<e.outputsLength();t++){const n=e.outputs(t);if(i.has(n))throw new Error(`duplicated output name: ${n}`);const r=this._allData.push(new c)-1;i.set(n,r),this._allOutputIndices.push(r),this._allOutputNames.push(n)}if(!e.nodes)throw new Error("missing information in graph: node");for(let t=0;t<e.nodesLength();t++){const n=e.nodes(t);let r=n.name();if(!r)for(let e=0;r=`unnamed_${n.opType()}_${e}`,o.has(r);e++);if(o.has(r))throw new Error(`duplicated node name: ${r}`);const i=this._nodes.push(new l(n,r))-1;o.set(r,i)}for(let t=0;t<this._nodes.length;t++){const n=this._nodes[t],r=e.nodes(t);if(null==r)throw new Error(`No node exists at index ${t}`);if(0===(null==r?void 0:r.outputsLength()))throw new Error(`missing output for node: ${r.name}`);for(let e=0;e<(null==r?void 0:r.outputsLength());e++){const o=null==r?void 0:r.outputs(e);let a=i.get(o);if(void 0===a&&(a=this._allData.push(new c)-1,i.set(o,a)),n.outputs.push(a),void 0!==this._allData[a]._from)throw new Error(`multiple nodes output to one data value: ${a}`);if(this._allData[a]._from=t,"Constant"===r.opType()){if(1!==r.attributesLength()||!r.attributes(0).t())throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(1!==r.outputsLength())throw new Error("missing output or incorrect number of outputs for this Constant operator");n.outputs.pop(),n.executeNode=!1,this._allData[a]._from=-1,this._allData[a].tensor=s.Tensor.fromOrtTensor(r.attributes(0).t())}}}for(let t=0;t<this._nodes.length;t++){const n=this._nodes[t],r=e.nodes(t);if(0===r.inputsLength())throw new Error(`missing input for node: ${r.name}`);for(let e=0;e<r.inputsLength();e++){const o=r.inputs(e),s=i.get(o);if(void 0===s)throw new Error(`unrecognized input '${o}' for node: ${r.name()}`);n.inputs.push(s),this._allData[s]._to.push(t)}}}checkIsAcyclic(){const e=new Set;this._allInputIndices.forEach((t=>{this._allData[t]._to.forEach((t=>{e.add(t)}))}));const t=Array.from(e),n=new Array(this._nodes.length).fill("white");for(;t.length>0;){const e=t.pop();"gray"===n[e]?n[e]="black":(t.push(e),n[e]="gray",this._nodes[e].outputs.forEach((r=>{const i=this._allData[r];if(void 0!==i.tensor)throw new Error("node outputs should not be initialized");if(i._from!==e)throw new Error("from property of the Value object doesn't match index of Node being processed");i._to.forEach((e=>{if("gray"===n[e])throw new Error("model graph is cyclic");"white"===n[e]&&t.push(e)}))})))}}transformGraph(e){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),e&&e.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let e=0;const t=new Array(this._nodes.length,0);let n=0;for(let e=0;e<this._nodes.length;e++)t[e]=n,this._nodes[e].executeNode?(n!==e&&(this._nodes[n]=this._nodes[e]),n++):this._nodes[e].outputs.forEach((e=>{this._allData[e]._from=-2}));this._nodes.splice(n,this._nodes.length-n);for(let e=0;e<this._allData.length;e++){const n=this._allData[e];void 0!==n._from&&-1!==n._from&&-2!==n._from&&(n._from=t[n._from]);for(let e=0;e<n._to.length;e++){if(!(n._to[e]>=0))throw new Error("Trying to update a removed node");n._to[e]=t[n._to[e]]}}e=0;for(let t=0;t<this._allData.length;t++)if(-2!==this._allData[t].from||-1!==this._allOutputIndices.indexOf(t+e)){if(e>0){let n=-1;void 0!==this._allData[t].from&&-1!==this._allData[t].from?(n=this._nodes[this._allData[t].from].outputs.indexOf(t+e),-1!==n&&(this._nodes[this._allData[t].from].outputs[n]=t)):(n=this._allInputIndices.indexOf(t+e),-1!==n&&(this._allInputIndices[n]=t)),this._allData[t].to.forEach((r=>{n=this._nodes[r].inputs.indexOf(t+e),-1!==n&&(this._nodes[r].inputs[n]=t)})),0===this._allData[t].to.length&&(n=this._allOutputIndices.indexOf(t+e),-1!==n&&(this._allOutputIndices[n]=t))}}else e++,this._allData.splice(t,1),t--}deleteNode(e){const t=this._nodes[e];if(t.outputs.length>1)for(let e=1;e<t.outputs.length;e++)if(this._allData[t.outputs[e]].to.length>0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ");t.executeNode=!1;const n=t.inputs[0],r=t.outputs[0],i=this._allData[r].to;for(let n=0;n<t.inputs.length;n++){const r=this._allData[t.inputs[n]].to.indexOf(e);if(-1===r)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[t.inputs[n]].to.splice(r,1)}this._allData[r]._to=[];const o=this._allOutputIndices.indexOf(r);if(-1!==o&&(this._allOutputIndices[o]=n),i&&i.length>0)for(const e of i){const t=this._nodes[e].inputs.indexOf(r);if(-1===t)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[e].inputs[t]=n,this._allData[n].to.push(e)}}removeAllDropoutNodes(){let e=0;for(const t of this._nodes){if("Dropout"===t.opType){if(1!==t.inputs.length)throw new Error("Dropout nodes should only contain one input. ");if(1!==t.outputs.length&&2!==t.outputs.length)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(2===t.outputs.length&&0!==this._allData[t.outputs[1]]._to.length)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(e)}e++}}removeAllIdentityNodes(){let e=0;for(const t of this._nodes)"Identity"===t.opType&&this.deleteNode(e),e++}isActivation(e){switch(e.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const e of this._nodes)if("Conv"===e.opType){const t=this._allData[e.outputs[0]]._to;if(1===t.length&&this.isActivation(this._nodes[t[0]])){const n=this._nodes[t[0]];if("Clip"===n.opType)if(1===n.inputs.length)try{e.attributes.set("activation_params","floats",[n.attributes.getFloat("min"),n.attributes.getFloat("max")])}catch(t){e.attributes.set("activation_params","floats",[a.MIN_CLIP,a.MAX_CLIP])}else{if(!(n.inputs.length>=3&&void 0!==this._allData[n.inputs[1]].tensor&&void 0!==this._allData[n.inputs[2]].tensor))continue;e.attributes.set("activation_params","floats",[this._allData[n.inputs[1]].tensor.floatData[0],this._allData[n.inputs[2]].tensor.floatData[0]])}e.attributes.set("activation","string",n.opType),this.deleteNode(t[0])}}}}},1315:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.now=t.Profiler=t.Logger=void 0;const n={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},r={none:new class{log(e,t,n){}},console:new class{log(e,t,n){console.log(`${this.color(e)} ${n?"[35m"+n+"[0m ":""}${t}`)}color(e){switch(e){case"verbose":return"[34;40mv[0m";case"info":return"[32mi[0m";case"warning":return"[30;43mw[0m";case"error":return"[31;40me[0m";case"fatal":return"[101mf[0m";default:throw new Error(`unsupported severity: ${e}`)}}}},i={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let o={"":i};function s(e,t,n,r){if(void 0===t)return i=e,{verbose:s.verbose.bind(null,i),info:s.info.bind(null,i),warning:s.warning.bind(null,i),error:s.error.bind(null,i),fatal:s.fatal.bind(null,i)};if(void 0===n)a(e,t);else if("number"==typeof n&&void 0===r)a(e,t);else if("string"==typeof n&&void 0===r)a(e,n,0,t);else{if("string"!=typeof n||"number"!=typeof r)throw new TypeError("input is valid");a(e,n,0,t)}var i}function a(e,t,i,s){const a=o[s||""]||o[""];n[e]<n[a.minimalSeverity]||(a.logDateTime&&(t=`${(new Date).toISOString()}|${t}`),a.logSourceLocation,r[a.provider].log(e,t,s))}!function(e){function t(e){o={},n("",e||{})}function n(e,n){if("*"===e)t(n);else{const t=o[e]||i;o[e]={provider:n.provider||t.provider,minimalSeverity:n.minimalSeverity||t.minimalSeverity,logDateTime:void 0===n.logDateTime?t.logDateTime:n.logDateTime,logSourceLocation:void 0===n.logSourceLocation?t.logSourceLocation:n.logSourceLocation}}}e.verbose=function(t,n){e("verbose",t,n)},e.info=function(t,n){e("info",t,n)},e.warning=function(t,n){e("warning",t,n)},e.error=function(t,n){e("error",t,n)},e.fatal=function(t,n){e("fatal",t,n)},e.reset=t,e.set=n,e.setWithEnv=function(e){const t={};e.logLevel&&(t.minimalSeverity=e.logLevel),n("",t)}}(s||(s={})),t.Logger=s;class u{constructor(e,t,n,r,i,o){this.category=e,this.name=t,this.startTime=n,this.endCallback=r,this.timer=i,this.ctx=o}async end(){return this.endCallback(this)}async checkTimer(){if(void 0===this.ctx||void 0===this.timer)throw new Error("No webgl timer found");return this.ctx.endTimer(),this.ctx.waitForQueryAndGetTime(this.timer)}}class c{constructor(e,t,n,r){this.category=e,this.name=t,this.startTime=n,this.endTime=r}}t.Profiler=class{static create(e){return void 0===e?new this:new this(e.maxNumberEvents,e.flushBatchSize,e.flushIntervalInMilliseconds)}constructor(e,t,n){this._started=!1,this._flushPointer=0,this._started=!1,this._maxNumberEvents=void 0===e?1e4:e,this._flushBatchSize=void 0===t?10:t,this._flushIntervalInMilliseconds=void 0===n?5e3:n}start(){this._started=!0,this._timingEvents=[],this._flushTime=(0,t.now)(),this._flushPointer=0}stop(){for(this._started=!1;this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer])}event(e,t,n,r){const i=this._started?this.begin(e,t,r):void 0;let o=!1;const s=n();if(s&&"function"==typeof s.then)return o=!0,new Promise(((e,t)=>{s.then((async t=>{i&&await i.end(),e(t)}),(async e=>{i&&await i.end(),t(e)}))}));if(!o&&i){const e=i.end();if(e&&"function"==typeof e.then)return new Promise(((t,n)=>{e.then((()=>{t(s)}),(e=>{n(e)}))}))}return s}begin(e,n,r){if(!this._started)throw new Error("profiler is not started yet");if(void 0===r){const r=(0,t.now)();return this.flush(r),new u(e,n,r,(e=>this.endSync(e)))}{const t=r.beginTimer();return new u(e,n,0,(async e=>this.end(e)),t,r)}}async end(e){const t=await e.checkTimer();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new c(e.category,e.name,e.startTime,t)),this.flush(t))}endSync(e){const n=(0,t.now)();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new c(e.category,e.name,e.startTime,n)),this.flush(n))}logOneEvent(e){t.Logger.verbose(`Profiler.${e.category}`,`${(e.endTime-e.startTime).toFixed(2)}ms on event '${e.name}' at ${e.endTime.toFixed(2)}`)}flush(e){if(this._timingEvents.length-this._flushPointer>=this._flushBatchSize||e-this._flushTime>=this._flushIntervalInMilliseconds){for(const e=this._flushPointer;this._flushPointer<e+this._flushBatchSize&&this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer]);this._flushTime=(0,t.now)()}}get started(){return this._started}},t.now="undefined"!=typeof performance&&performance.now?()=>performance.now():Date.now},1745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=void 0;const r=n(5686),i=n(1446),o=n(4662),s=n(1287),a=n(7273);var u=s.onnxruntime.experimental.fbs;t.Model=class{constructor(){}load(e,t,n){if(!n)try{return void this.loadFromOnnxFormat(e,t)}catch(e){if(void 0!==n)throw e}this.loadFromOrtFormat(e,t)}loadFromOnnxFormat(e,t){const n=i.onnx.ModelProto.decode(e);if(a.LongUtil.longToNumber(n.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=n.opsetImport.map((e=>({domain:e.domain,version:a.LongUtil.longToNumber(e.version)}))),this._graph=o.Graph.from(n.graph,t)}loadFromOrtFormat(e,t){const n=new r.flatbuffers.ByteBuffer(e),i=u.InferenceSession.getRootAsInferenceSession(n).model();if(a.LongUtil.longToNumber(i.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let e=0;e<i.opsetImportLength();e++){const t=i.opsetImport(e);this._opsets.push({domain:null==t?void 0:t.domain(),version:a.LongUtil.longToNumber(t.version())})}this._graph=o.Graph.from(i.graph(),t)}get graph(){return this._graph}get opsets(){return this._opsets}}},6145:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FLOAT_TYPES=t.INT_TYPES=t.NUMBER_TYPES=void 0,t.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],t.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],t.FLOAT_TYPES=["float32","float64"]},5881:(e,t)=>{"use strict";function n(e,t){if(t.endsWith("+")){const n=Number.parseInt(t.substring(0,t.length-1),10);return!isNaN(n)&&n<=e}if(2===t.split("-").length){const n=t.split("-"),r=Number.parseInt(n[0],10),i=Number.parseInt(n[1],10);return!isNaN(r)&&!isNaN(i)&&r<=e&&e<=i}return Number.parseInt(t,10)===e}Object.defineProperty(t,"__esModule",{value:!0}),t.resolveOperator=void 0,t.resolveOperator=function(e,t,r){for(const i of r){const r=i[0],o=i[1],s=i[2],a=i[3],u=i[4];if(e.opType===r)for(const e of t)if((e.domain===o||"ai.onnx"===e.domain&&""===o)&&n(e.version,s))return{opImpl:a,opInit:u}}throw new TypeError(`cannot resolve operator '${e.opType}' with opsets: ${t.map((e=>`${e.domain||"ai.onnx"} v${e.version}`)).join(", ")}`)}},1287:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onnxruntime=void 0;const r=n(5686);var i,o;(function(e){let t;!function(e){e[e.UNDEFINED=0]="UNDEFINED",e[e.FLOAT=1]="FLOAT",e[e.INT=2]="INT",e[e.STRING=3]="STRING",e[e.TENSOR=4]="TENSOR",e[e.GRAPH=5]="GRAPH",e[e.FLOATS=6]="FLOATS",e[e.INTS=7]="INTS",e[e.STRINGS=8]="STRINGS",e[e.TENSORS=9]="TENSORS",e[e.GRAPHS=10]="GRAPHS",e[e.SPARSE_TENSOR=11]="SPARSE_TENSOR",e[e.SPARSE_TENSORS=12]="SPARSE_TENSORS"}(t=e.AttributeType||(e.AttributeType={}))})((o=(i=t.onnxruntime||(t.onnxruntime={})).experimental||(i.experimental={})).fbs||(o.fbs={})),function(e){!function(e){!function(e){let t;!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.VALUE=1]="VALUE",e[e.PARAM=2]="PARAM"}(t=e.DimensionValueType||(e.DimensionValueType={}))}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){let t;!function(e){e[e.UNDEFINED=0]="UNDEFINED",e[e.FLOAT=1]="FLOAT",e[e.UINT8=2]="UINT8",e[e.INT8=3]="INT8",e[e.UINT16=4]="UINT16",e[e.INT16=5]="INT16",e[e.INT32=6]="INT32",e[e.INT64=7]="INT64",e[e.STRING=8]="STRING",e[e.BOOL=9]="BOOL",e[e.FLOAT16=10]="FLOAT16",e[e.DOUBLE=11]="DOUBLE",e[e.UINT32=12]="UINT32",e[e.UINT64=13]="UINT64",e[e.COMPLEX64=14]="COMPLEX64",e[e.COMPLEX128=15]="COMPLEX128",e[e.BFLOAT16=16]="BFLOAT16"}(t=e.TensorDataType||(e.TensorDataType={}))}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){let t;!function(e){e[e.Primitive=0]="Primitive",e[e.Fused=1]="Fused"}(t=e.NodeType||(e.NodeType={}))}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){let t;!function(e){e[e.NONE=0]="NONE",e[e.tensor_type=1]="tensor_type",e[e.sequence_type=2]="sequence_type",e[e.map_type=3]="map_type"}(t=e.TypeInfoValue||(e.TypeInfoValue={}))}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsShape(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsShape(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}dim(t,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new e.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}dimLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}static startShape(e){e.startObject(1)}static addDim(e,t){e.addFieldOffset(0,t,0)}static createDimVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startDimVector(e,t){e.startVector(4,t,4)}static endShape(e){return e.endObject()}static createShape(e,t){return n.startShape(e),n.addDim(e,t),n.endShape(e)}}t.Shape=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDimension(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDimension(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}value(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}denotation(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startDimension(e){e.startObject(2)}static addValue(e,t){e.addFieldOffset(0,t,0)}static addDenotation(e,t){e.addFieldOffset(1,t,0)}static endDimension(e){return e.endObject()}static createDimension(e,t,r){return n.startDimension(e),n.addValue(e,t),n.addDenotation(e,r),n.endDimension(e)}}t.Dimension=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDimensionValue(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDimensionValue(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}dimType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):e.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}dimParam(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}static startDimensionValue(e){e.startObject(3)}static addDimType(t,n){t.addFieldInt8(0,n,e.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(e,t){e.addFieldInt64(1,t,e.createLong(0,0))}static addDimParam(e,t){e.addFieldOffset(2,t,0)}static endDimensionValue(e){return e.endObject()}static createDimensionValue(e,t,r,i){return n.startDimensionValue(e),n.addDimType(e,t),n.addDimValue(e,r),n.addDimParam(e,i),n.endDimensionValue(e)}}t.DimensionValue=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTensorTypeAndShape(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTensorTypeAndShape(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}elemType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}shape(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startTensorTypeAndShape(e){e.startObject(2)}static addElemType(t,n){t.addFieldInt32(0,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(e,t){e.addFieldOffset(1,t,0)}static endTensorTypeAndShape(e){return e.endObject()}static createTensorTypeAndShape(e,t,r){return n.startTensorTypeAndShape(e),n.addElemType(e,t),n.addShape(e,r),n.endTensorTypeAndShape(e)}}t.TensorTypeAndShape=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMapType(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMapType(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}keyType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}valueType(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startMapType(e){e.startObject(2)}static addKeyType(t,n){t.addFieldInt32(0,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(e,t){e.addFieldOffset(1,t,0)}static endMapType(e){return e.endObject()}static createMapType(e,t,r){return n.startMapType(e),n.addKeyType(e,t),n.addValueType(e,r),n.endMapType(e)}}t.MapType=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSequenceType(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSequenceType(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}elemType(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSequenceType(e){e.startObject(1)}static addElemType(e,t){e.addFieldOffset(0,t,0)}static endSequenceType(e){return e.endObject()}static createSequenceType(e,t){return n.startSequenceType(e),n.addElemType(e,t),n.endSequenceType(e)}}t.SequenceType=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){(e.fbs||(e.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}nodeIndex(){return this.bb.readUint32(this.bb_pos)}srcArgIndex(){return this.bb.readInt32(this.bb_pos+4)}dstArgIndex(){return this.bb.readInt32(this.bb_pos+8)}static createEdgeEnd(e,t,n,r){return e.prep(4,12),e.writeInt32(r),e.writeInt32(n),e.writeInt32(t),e.offset()}}}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNodeEdge(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNodeEdge(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}nodeIndex(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb_pos+e):0}inputEdges(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*t,this.bb):null}inputEdgesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}outputEdges(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new e.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*t,this.bb):null}outputEdgesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startNodeEdge(e){e.startObject(3)}static addNodeIndex(e,t){e.addFieldInt32(0,t,0)}static addInputEdges(e,t){e.addFieldOffset(1,t,0)}static startInputEdgesVector(e,t){e.startVector(12,t,4)}static addOutputEdges(e,t){e.addFieldOffset(2,t,0)}static startOutputEdgesVector(e,t){e.startVector(12,t,4)}static endNodeEdge(e){return e.endObject()}static createNodeEdge(e,t,r,i){return n.startNodeEdge(e),n.addNodeIndex(e,t),n.addInputEdges(e,r),n.addOutputEdges(e,i),n.endNodeEdge(e)}}t.NodeEdge=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNode(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNode(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}domain(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}sinceVersion(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt32(this.bb_pos+e):0}index(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint32(this.bb_pos+e):0}opType(e){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}type(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.NodeType.Primitive}executionProviderType(e){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__string(this.bb_pos+t,e):null}inputs(e,t){let n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}inputsLength(){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__vector_len(this.bb_pos+e):0}outputs(e,t){let n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}outputsLength(){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.__vector_len(this.bb_pos+e):0}attributes(t,n){let r=this.bb.__offset(this.bb_pos,24);return r?(n||new e.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}attributesLength(){let e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__vector_len(this.bb_pos+e):0}inputArgCounts(e){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+4*e):0}inputArgCountsLength(){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__vector_len(this.bb_pos+e):0}inputArgCountsArray(){let e=this.bb.__offset(this.bb_pos,26);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}implicitInputs(e,t){let n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}implicitInputsLength(){let e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__vector_len(this.bb_pos+e):0}static startNode(e){e.startObject(13)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addDomain(e,t){e.addFieldOffset(2,t,0)}static addSinceVersion(e,t){e.addFieldInt32(3,t,0)}static addIndex(e,t){e.addFieldInt32(4,t,0)}static addOpType(e,t){e.addFieldOffset(5,t,0)}static addType(t,n){t.addFieldInt32(6,n,e.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(e,t){e.addFieldOffset(7,t,0)}static addInputs(e,t){e.addFieldOffset(8,t,0)}static createInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInputsVector(e,t){e.startVector(4,t,4)}static addOutputs(e,t){e.addFieldOffset(9,t,0)}static createOutputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOutputsVector(e,t){e.startVector(4,t,4)}static addAttributes(e,t){e.addFieldOffset(10,t,0)}static createAttributesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startAttributesVector(e,t){e.startVector(4,t,4)}static addInputArgCounts(e,t){e.addFieldOffset(11,t,0)}static createInputArgCountsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startInputArgCountsVector(e,t){e.startVector(4,t,4)}static addImplicitInputs(e,t){e.addFieldOffset(12,t,0)}static createImplicitInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startImplicitInputsVector(e,t){e.startVector(4,t,4)}static endNode(e){return e.endObject()}static createNode(e,t,r,i,o,s,a,u,c,l,d,f,h,p){return n.startNode(e),n.addName(e,t),n.addDocString(e,r),n.addDomain(e,i),n.addSinceVersion(e,o),n.addIndex(e,s),n.addOpType(e,a),n.addType(e,u),n.addExecutionProviderType(e,c),n.addInputs(e,l),n.addOutputs(e,d),n.addAttributes(e,f),n.addInputArgCounts(e,h),n.addImplicitInputs(e,p),n.endNode(e)}}t.Node=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsValueInfo(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsValueInfo(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}type(t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startValueInfo(e){e.startObject(3)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addType(e,t){e.addFieldOffset(2,t,0)}static endValueInfo(e){return e.endObject()}static createValueInfo(e,t,r,i){return n.startValueInfo(e),n.addName(e,t),n.addDocString(e,r),n.addType(e,i),n.endValueInfo(e)}}t.ValueInfo=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTypeInfo(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTypeInfo(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}denotation(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}valueType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):e.experimental.fbs.TypeInfoValue.NONE}value(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}static startTypeInfo(e){e.startObject(3)}static addDenotation(e,t){e.addFieldOffset(0,t,0)}static addValueType(t,n){t.addFieldInt8(1,n,e.experimental.fbs.TypeInfoValue.NONE)}static addValue(e,t){e.addFieldOffset(2,t,0)}static endTypeInfo(e){return e.endObject()}static createTypeInfo(e,t,r,i){return n.startTypeInfo(e),n.addDenotation(e,t),n.addValueType(e,r),n.addValue(e,i),n.endTypeInfo(e)}}t.TypeInfo=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsOperatorSetId(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsOperatorSetId(e,n){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}domain(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}version(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}static startOperatorSetId(e){e.startObject(2)}static addDomain(e,t){e.addFieldOffset(0,t,0)}static addVersion(e,t){e.addFieldInt64(1,t,e.createLong(0,0))}static endOperatorSetId(e){return e.endObject()}static createOperatorSetId(e,n,r){return t.startOperatorSetId(e),t.addDomain(e,n),t.addVersion(e,r),t.endOperatorSetId(e)}}e.OperatorSetId=t}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTensor(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTensor(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}dims(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}dimsLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}dataType(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}rawData(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint8(this.bb.__vector(this.bb_pos+t)+e):0}rawDataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}rawDataArray(){let e=this.bb.__offset(this.bb_pos,12);return e?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}stringData(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}stringDataLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}static startTensor(e){e.startObject(6)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addDims(e,t){e.addFieldOffset(2,t,0)}static createDimsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startDimsVector(e,t){e.startVector(8,t,8)}static addDataType(t,n){t.addFieldInt32(3,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(e,t){e.addFieldOffset(4,t,0)}static createRawDataVector(e,t){e.startVector(1,t.length,1);for(let n=t.length-1;n>=0;n--)e.addInt8(t[n]);return e.endVector()}static startRawDataVector(e,t){e.startVector(1,t,1)}static addStringData(e,t){e.addFieldOffset(5,t,0)}static createStringDataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startStringDataVector(e,t){e.startVector(4,t,4)}static endTensor(e){return e.endObject()}static createTensor(e,t,r,i,o,s,a){return n.startTensor(e),n.addName(e,t),n.addDocString(e,r),n.addDims(e,i),n.addDataType(e,o),n.addRawData(e,s),n.addStringData(e,a),n.endTensor(e)}}t.Tensor=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSparseTensor(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSparseTensor(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}values(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}indices(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dims(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}dimsLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSparseTensor(e){e.startObject(3)}static addValues(e,t){e.addFieldOffset(0,t,0)}static addIndices(e,t){e.addFieldOffset(1,t,0)}static addDims(e,t){e.addFieldOffset(2,t,0)}static createDimsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startDimsVector(e,t){e.startVector(8,t,8)}static endSparseTensor(e){return e.endObject()}static createSparseTensor(e,t,r,i){return n.startSparseTensor(e),n.addValues(e,t),n.addIndices(e,r),n.addDims(e,i),n.endSparseTensor(e)}}t.SparseTensor=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsAttribute(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsAttribute(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}type(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.AttributeType.UNDEFINED}f(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat32(this.bb_pos+e):0}i(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}s(e){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}t(t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}g(t){let n=this.bb.__offset(this.bb_pos,18);return n?(t||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}floats(e){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readFloat32(this.bb.__vector(this.bb_pos+t)+4*e):0}floatsLength(){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__vector_len(this.bb_pos+e):0}floatsArray(){let e=this.bb.__offset(this.bb_pos,20);return e?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}ints(e){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}intsLength(){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.__vector_len(this.bb_pos+e):0}strings(e,t){let n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}stringsLength(){let e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__vector_len(this.bb_pos+e):0}tensors(t,n){let r=this.bb.__offset(this.bb_pos,26);return r?(n||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}tensorsLength(){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__vector_len(this.bb_pos+e):0}graphs(t,n){let r=this.bb.__offset(this.bb_pos,28);return r?(n||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}graphsLength(){let e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__vector_len(this.bb_pos+e):0}static startAttribute(e){e.startObject(13)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addType(t,n){t.addFieldInt32(2,n,e.experimental.fbs.AttributeType.UNDEFINED)}static addF(e,t){e.addFieldFloat32(3,t,0)}static addI(e,t){e.addFieldInt64(4,t,e.createLong(0,0))}static addS(e,t){e.addFieldOffset(5,t,0)}static addT(e,t){e.addFieldOffset(6,t,0)}static addG(e,t){e.addFieldOffset(7,t,0)}static addFloats(e,t){e.addFieldOffset(8,t,0)}static createFloatsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addFloat32(t[n]);return e.endVector()}static startFloatsVector(e,t){e.startVector(4,t,4)}static addInts(e,t){e.addFieldOffset(9,t,0)}static createIntsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startIntsVector(e,t){e.startVector(8,t,8)}static addStrings(e,t){e.addFieldOffset(10,t,0)}static createStringsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startStringsVector(e,t){e.startVector(4,t,4)}static addTensors(e,t){e.addFieldOffset(11,t,0)}static createTensorsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startTensorsVector(e,t){e.startVector(4,t,4)}static addGraphs(e,t){e.addFieldOffset(12,t,0)}static createGraphsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startGraphsVector(e,t){e.startVector(4,t,4)}static endAttribute(e){return e.endObject()}static createAttribute(e,t,r,i,o,s,a,u,c,l,d,f,h,p){return n.startAttribute(e),n.addName(e,t),n.addDocString(e,r),n.addType(e,i),n.addF(e,o),n.addI(e,s),n.addS(e,a),n.addT(e,u),n.addG(e,c),n.addFloats(e,l),n.addInts(e,d),n.addStrings(e,f),n.addTensors(e,h),n.addGraphs(e,p),n.endAttribute(e)}}t.Attribute=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsGraph(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsGraph(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}initializers(t,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}initializersLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}nodeArgs(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodeArgsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}nodes(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new e.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}maxNodeIndex(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readUint32(this.bb_pos+e):0}nodeEdges(t,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new e.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodeEdgesLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}inputs(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}inputsLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}outputs(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}outputsLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}sparseInitializers(t,n){let r=this.bb.__offset(this.bb_pos,18);return r?(n||new e.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}sparseInitializersLength(){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}static startGraph(e){e.startObject(8)}static addInitializers(e,t){e.addFieldOffset(0,t,0)}static createInitializersVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInitializersVector(e,t){e.startVector(4,t,4)}static addNodeArgs(e,t){e.addFieldOffset(1,t,0)}static createNodeArgsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodeArgsVector(e,t){e.startVector(4,t,4)}static addNodes(e,t){e.addFieldOffset(2,t,0)}static createNodesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodesVector(e,t){e.startVector(4,t,4)}static addMaxNodeIndex(e,t){e.addFieldInt32(3,t,0)}static addNodeEdges(e,t){e.addFieldOffset(4,t,0)}static createNodeEdgesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodeEdgesVector(e,t){e.startVector(4,t,4)}static addInputs(e,t){e.addFieldOffset(5,t,0)}static createInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInputsVector(e,t){e.startVector(4,t,4)}static addOutputs(e,t){e.addFieldOffset(6,t,0)}static createOutputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOutputsVector(e,t){e.startVector(4,t,4)}static addSparseInitializers(e,t){e.addFieldOffset(7,t,0)}static createSparseInitializersVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startSparseInitializersVector(e,t){e.startVector(4,t,4)}static endGraph(e){return e.endObject()}static createGraph(e,t,r,i,o,s,a,u,c){return n.startGraph(e),n.addInitializers(e,t),n.addNodeArgs(e,r),n.addNodes(e,i),n.addMaxNodeIndex(e,o),n.addNodeEdges(e,s),n.addInputs(e,a),n.addOutputs(e,u),n.addSparseInitializers(e,c),n.endGraph(e)}}t.Graph=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsModel(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsModel(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}irVersion(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}opsetImport(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}opsetImportLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}producerName(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}producerVersion(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__string(this.bb_pos+t,e):null}domain(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__string(this.bb_pos+t,e):null}modelVersion(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}docString(e){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__string(this.bb_pos+t,e):null}graph(t){let n=this.bb.__offset(this.bb_pos,18);return n?(t||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}graphDocString(e){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__string(this.bb_pos+t,e):null}static startModel(e){e.startObject(9)}static addIrVersion(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addOpsetImport(e,t){e.addFieldOffset(1,t,0)}static createOpsetImportVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOpsetImportVector(e,t){e.startVector(4,t,4)}static addProducerName(e,t){e.addFieldOffset(2,t,0)}static addProducerVersion(e,t){e.addFieldOffset(3,t,0)}static addDomain(e,t){e.addFieldOffset(4,t,0)}static addModelVersion(e,t){e.addFieldInt64(5,t,e.createLong(0,0))}static addDocString(e,t){e.addFieldOffset(6,t,0)}static addGraph(e,t){e.addFieldOffset(7,t,0)}static addGraphDocString(e,t){e.addFieldOffset(8,t,0)}static endModel(e){return e.endObject()}static createModel(e,t,r,i,o,s,a,u,c,l){return n.startModel(e),n.addIrVersion(e,t),n.addOpsetImport(e,r),n.addProducerName(e,i),n.addProducerVersion(e,o),n.addDomain(e,s),n.addModelVersion(e,a),n.addDocString(e,u),n.addGraph(e,c),n.addGraphDocString(e,l),n.endModel(e)}}t.Model=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKernelCreateInfos(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKernelCreateInfos(e,n){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}nodeIndices(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb.__vector(this.bb_pos+t)+4*e):0}nodeIndicesLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}nodeIndicesArray(){let e=this.bb.__offset(this.bb_pos,4);return e?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}kernelDefHashes(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}kernelDefHashesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}static startKernelCreateInfos(e){e.startObject(2)}static addNodeIndices(e,t){e.addFieldOffset(0,t,0)}static createNodeIndicesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startNodeIndicesVector(e,t){e.startVector(4,t,4)}static addKernelDefHashes(e,t){e.addFieldOffset(1,t,0)}static createKernelDefHashesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startKernelDefHashesVector(e,t){e.startVector(8,t,8)}static endKernelCreateInfos(e){return e.endObject()}static createKernelCreateInfos(e,n,r){return t.startKernelCreateInfos(e),t.addNodeIndices(e,n),t.addKernelDefHashes(e,r),t.endKernelCreateInfos(e)}}e.KernelCreateInfos=t}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSubGraphSessionState(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSubGraphSessionState(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}graphId(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}sessionState(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSubGraphSessionState(e){e.startObject(2)}static addGraphId(e,t){e.addFieldOffset(0,t,0)}static addSessionState(e,t){e.addFieldOffset(1,t,0)}static endSubGraphSessionState(e){let t=e.endObject();return e.requiredField(t,4),t}static createSubGraphSessionState(e,t,r){return n.startSubGraphSessionState(e),n.addGraphId(e,t),n.addSessionState(e,r),n.endSubGraphSessionState(e)}}t.SubGraphSessionState=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSessionState(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSessionState(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}kernels(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}subGraphSessionStates(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}subGraphSessionStatesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSessionState(e){e.startObject(2)}static addKernels(e,t){e.addFieldOffset(0,t,0)}static addSubGraphSessionStates(e,t){e.addFieldOffset(1,t,0)}static createSubGraphSessionStatesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startSubGraphSessionStatesVector(e,t){e.startVector(4,t,4)}static endSessionState(e){return e.endObject()}static createSessionState(e,t,r){return n.startSessionState(e),n.addKernels(e,t),n.addSubGraphSessionStates(e,r),n.endSessionState(e)}}t.SessionState=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInferenceSession(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInferenceSession(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static bufferHasIdentifier(e){return e.__has_identifier("ORTM")}ortVersion(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}model(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}sessionState(t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new e.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startInferenceSession(e){e.startObject(3)}static addOrtVersion(e,t){e.addFieldOffset(0,t,0)}static addModel(e,t){e.addFieldOffset(1,t,0)}static addSessionState(e,t){e.addFieldOffset(2,t,0)}static endInferenceSession(e){return e.endObject()}static finishInferenceSessionBuffer(e,t){e.finish(t,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(e,t){e.finish(t,"ORTM",!0)}static createInferenceSession(e,t,r,i){return n.startInferenceSession(e),n.addOrtVersion(e,t),n.addModel(e,r),n.addSessionState(e,i),n.endInferenceSession(e)}}t.InferenceSession=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={}))},1723:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OnnxjsSessionHandler=void 0;const r=n(8453),i=n(9240);t.OnnxjsSessionHandler=class{constructor(e){this.session=e,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(e,t,n){const o=new Map;for(const t in e)if(Object.hasOwnProperty.call(e,t)){const n=e[t];o.set(t,new i.Tensor(n.dims,n.type,void 0,void 0,n.data))}const s=await this.session.run(o),a={};return s.forEach(((e,t)=>{a[t]=new r.Tensor(e.type,e.data,e.dims)})),a}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6027:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;const r=n(7067),i=n(1296),o=n(1975),s=n(6496),a=n(1315),u=n(1745);t.Session=class{constructor(e={}){this._initialized=!1,this.backendHint=e.backendHint,this.profiler=a.Profiler.create(e.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}get inputNames(){return this._model.graph.getInputNames()}get outputNames(){return this._model.graph.getOutputNames()}startProfiling(){this.profiler.start()}endProfiling(){this.profiler.stop()}async loadModel(e,t,n){await this.profiler.event("session","Session.loadModel",(async()=>{const s=await(0,o.resolveBackend)(this.backendHint);if(this.sessionHandler=s.createSessionHandler(this.context),this._model=new u.Model,"string"==typeof e){const t=e.endsWith(".ort");if("undefined"==typeof fetch){const n=await(0,i.promisify)(r.readFile)(e);this.initialize(n,t)}else{const n=await fetch(e),r=await n.arrayBuffer();this.initialize(new Uint8Array(r),t)}}else if(ArrayBuffer.isView(e))this.initialize(e);else{const r=new Uint8Array(e,t||0,n||e.byteLength);this.initialize(r)}}))}initialize(e,t){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",(()=>{const n=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(e,n,t),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new s.ExecutionPlan(this._model.graph,this._ops,this.profiler)})),this._initialized=!0}async run(e){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",(async()=>{const t=this.normalizeAndValidateInputs(e),n=await this._executionPlan.execute(this.sessionHandler,t);return this.createOutput(n)}))}normalizeAndValidateInputs(e){const t=this._model.graph.getInputNames();if(Array.isArray(e)){if(e.length!==t.length)throw new Error(`incorrect input array length: expected ${t.length} but got ${e.length}`)}else{if(e.size!==t.length)throw new Error(`incorrect input map size: expected ${t.length} but got ${e.size}`);const n=new Array(e.size);let r=0;for(let i=0;i<t.length;++i){const o=e.get(t[i]);if(!o)throw new Error(`missing input tensor for: '${name}'`);n[r++]=o}e=n}if(this.context.graphInputTypes&&0!==this.context.graphInputTypes.length&&this.context.graphInputDims&&0!==this.context.graphInputDims.length)this.validateInputTensorDims(this.context.graphInputDims,e,!1);else{const t=this._model.graph.getInputIndices(),n=this._model.graph.getValues(),r=new Array(t.length);for(let i=0;i<t.length;++i){const o=n[t[i]];r[i]=o.type.shape.dims,this.context.graphInputTypes.push(o.type.tensorType),this.context.graphInputDims.push(e[i].dims)}this.validateInputTensorDims(r,e,!0)}return this.validateInputTensorTypes(this.context.graphInputTypes,e),e}validateInputTensorTypes(e,t){for(let n=0;n<t.length;n++){const r=e[n],i=t[n].type;if(r!==i)throw new Error(`input tensor[${n}] check failed: expected type '${r}' but got ${i}`)}}validateInputTensorDims(e,t,n){for(let r=0;r<t.length;r++){const i=e[r],o=t[r].dims;if(!this.compareTensorDims(i,o,n))throw new Error(`input tensor[${r}] check failed: expected shape '[${i.join(",")}]' but got [${o.join(",")}]`)}}compareTensorDims(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(e[r]!==t[r]&&(!n||0!==e[r]))return!1;return!0}createOutput(e){const t=this._model.graph.getOutputNames();if(e.length!==t.length)throw new Error("expected number of outputs do not match number of generated outputs");const n=new Map;for(let r=0;r<t.length;++r)n.set(t[r],e[r]);return n}initializeOps(e){const t=e.getNodes();this._ops=new Array(t.length);for(let n=0;n<t.length;n++)this._ops[n]=this.sessionHandler.resolve(t[n],this._model.opsets,e)}}},9240:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Tensor=void 0;const i=n(3442),o=r(n(3720)),s=n(1446),a=n(1287),u=n(7273);var c=a.onnxruntime.experimental.fbs;class l{get data(){if(void 0===this.cache){const e=this.dataProvider(this.dataId);if(e.length!==this.size)throw new Error("Length of data provided by the Data Provider is inconsistent with the dims of this Tensor.");this.cache=e}return this.cache}get stringData(){if("string"!==this.type)throw new TypeError("data type is not string");return this.data}get integerData(){switch(this.type){case"uint8":case"int8":case"uint16":case"int16":case"int32":case"uint32":case"bool":return this.data;default:throw new TypeError("data type is not integer (uint8, int8, uint16, int16, int32, uint32, bool)")}}get floatData(){switch(this.type){case"float32":case"float64":return this.data;default:throw new TypeError("data type is not float (float32, float64)")}}get numberData(){if("string"!==this.type)return this.data;throw new TypeError("type cannot be non-number (string)")}get(e){return this.data[u.ShapeUtil.indicesToOffset(e,this.strides)]}set(e,t){this.data[u.ShapeUtil.indicesToOffset(e,this.strides)]=t}async getData(){return void 0===this.cache&&(this.cache=await this.asyncDataProvider(this.dataId)),this.cache}get strides(){return this._strides||(this._strides=u.ShapeUtil.computeStrides(this.dims)),this._strides}constructor(e,t,n,r,o,s=i.Guid.create()){this.dims=e,this.type=t,this.dataProvider=n,this.asyncDataProvider=r,this.cache=o,this.dataId=s,this.size=u.ShapeUtil.validateDimsAndCalcSize(e);const a=this.size,c=void 0===n&&void 0===r&&void 0===o;if(void 0!==o&&o.length!==a)throw new RangeError("Input dims doesn't match data length.");if("string"===t){if(!(void 0===o||Array.isArray(o)&&o.every((e=>"string"==typeof e))))throw new TypeError("cache should be a string array");c&&(this.cache=new Array(a))}else{if(void 0!==o){const e=f(t);if(!(o instanceof e))throw new TypeError(`cache should be type ${e.name}`)}if(c){const e=new ArrayBuffer(a*function(e){switch(e){case"bool":case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;case"float64":return 8;default:throw new Error(`cannot calculate sizeof() on type ${e}`)}}(t));this.cache=function(e,t){return new(f(t))(e)}(e,t)}}}static fromProto(e){if(!e)throw new Error("cannot construct Value from an empty tensor");const t=u.ProtoUtil.tensorDataTypeFromProto(e.dataType),n=u.ProtoUtil.tensorDimsFromProto(e.dims),r=new l(n,t);if("string"===t)e.stringData.forEach(((e,t)=>{r.data[t]=(0,u.decodeUtf8String)(e)}));else if(e.rawData&&"number"==typeof e.rawData.byteLength&&e.rawData.byteLength>0){const t=r.data,n=new DataView(e.rawData.buffer,e.rawData.byteOffset,e.rawData.byteLength),i=d(e.dataType),o=e.rawData.byteLength/i;if(e.rawData.byteLength%i!=0)throw new Error("invalid buffer length");if(t.length!==o)throw new Error("buffer length mismatch");for(let r=0;r<o;r++){const o=p(n,e.dataType,r*i);t[r]=o}}else{let t;switch(e.dataType){case s.onnx.TensorProto.DataType.FLOAT:t=e.floatData;break;case s.onnx.TensorProto.DataType.INT32:case s.onnx.TensorProto.DataType.INT16:case s.onnx.TensorProto.DataType.UINT16:case s.onnx.TensorProto.DataType.INT8:case s.onnx.TensorProto.DataType.UINT8:case s.onnx.TensorProto.DataType.BOOL:t=e.int32Data;break;case s.onnx.TensorProto.DataType.INT64:t=e.int64Data;break;case s.onnx.TensorProto.DataType.DOUBLE:t=e.doubleData;break;case s.onnx.TensorProto.DataType.UINT32:case s.onnx.TensorProto.DataType.UINT64:t=e.uint64Data;break;default:throw new Error("unspecific error")}if(null==t)throw new Error("failed to populate data from a tensorproto value");const n=r.data;if(n.length!==t.length)throw new Error("array length mismatch");for(let r=0;r<t.length;r++){const i=t[r];o.default.isLong(i)?n[r]=h(i,e.dataType):n[r]=i}}return r}static fromData(e,t,n){return new l(t,n,void 0,void 0,e)}static fromOrtTensor(e){if(!e)throw new Error("cannot construct Value from an empty tensor");const t=u.ProtoUtil.tensorDimsFromORTFormat(e),n=u.ProtoUtil.tensorDataTypeFromProto(e.dataType()),r=new l(t,n);if("string"===n)for(let t=0;t<e.stringDataLength();t++)r.data[t]=e.stringData(t);else if(e.rawDataArray()&&"number"==typeof e.rawDataLength()&&e.rawDataLength()>0){const t=r.data,n=new DataView(e.rawDataArray().buffer,e.rawDataArray().byteOffset,e.rawDataLength()),i=d(e.dataType()),o=e.rawDataLength()/i;if(e.rawDataLength()%i!=0)throw new Error("invalid buffer length");if(t.length!==o)throw new Error("buffer length mismatch");for(let r=0;r<o;r++){const o=p(n,e.dataType(),r*i);t[r]=o}}return r}}function d(e){switch(e){case s.onnx.TensorProto.DataType.UINT8:case s.onnx.TensorProto.DataType.INT8:case s.onnx.TensorProto.DataType.BOOL:return 1;case s.onnx.TensorProto.DataType.UINT16:case s.onnx.TensorProto.DataType.INT16:return 2;case s.onnx.TensorProto.DataType.FLOAT:case s.onnx.TensorProto.DataType.INT32:case s.onnx.TensorProto.DataType.UINT32:return 4;case s.onnx.TensorProto.DataType.INT64:case s.onnx.TensorProto.DataType.DOUBLE:case s.onnx.TensorProto.DataType.UINT64:return 8;default:throw new Error(`cannot calculate sizeof() on type ${s.onnx.TensorProto.DataType[e]}`)}}function f(e){switch(e){case"bool":case"uint8":return Uint8Array;case"int8":return Int8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;default:throw new Error("unspecified error")}}function h(e,t){if(t===s.onnx.TensorProto.DataType.INT64||t===c.TensorDataType.INT64){if(e.greaterThanOrEqual(2147483648)||e.lessThan(-2147483648))throw new TypeError("int64 is not supported")}else{if(t!==s.onnx.TensorProto.DataType.UINT32&&t!==c.TensorDataType.UINT32&&t!==s.onnx.TensorProto.DataType.UINT64&&t!==c.TensorDataType.UINT64)throw new TypeError(`not a LONG type: ${s.onnx.TensorProto.DataType[t]}`);if(e.greaterThanOrEqual(4294967296)||e.lessThan(0))throw new TypeError("uint64 is not supported")}return e.toNumber()}function p(e,t,n){switch(t){case s.onnx.TensorProto.DataType.BOOL:case s.onnx.TensorProto.DataType.UINT8:return e.getUint8(n);case s.onnx.TensorProto.DataType.INT8:return e.getInt8(n);case s.onnx.TensorProto.DataType.UINT16:return e.getUint16(n,!0);case s.onnx.TensorProto.DataType.INT16:return e.getInt16(n,!0);case s.onnx.TensorProto.DataType.FLOAT:return e.getFloat32(n,!0);case s.onnx.TensorProto.DataType.INT32:return e.getInt32(n,!0);case s.onnx.TensorProto.DataType.UINT32:return e.getUint32(n,!0);case s.onnx.TensorProto.DataType.INT64:return h(o.default.fromBits(e.getUint32(n,!0),e.getUint32(n+4,!0),!1),t);case s.onnx.TensorProto.DataType.DOUBLE:return e.getFloat64(n,!0);case s.onnx.TensorProto.DataType.UINT64:return h(o.default.fromBits(e.getUint32(n,!0),e.getUint32(n+4,!0),!0),t);default:throw new Error(`cannot read from DataView for type ${s.onnx.TensorProto.DataType[t]}`)}}t.Tensor=l},7273:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeUtf8String=t.MAX_CLIP=t.MIN_CLIP=t.PoolConvUtil=t.ReduceUtil=t.SplitUtil=t.MathUtil=t.ShapeUtil=t.LongUtil=t.ProtoUtil=t.GemmUtil=t.arrayCopyHelper=t.BroadcastUtil=t.MatMulUtil=t.ArrayUtil=t.assert=t.checkInputsShape=void 0;const i=n(5686),o=r(n(3720)),s=n(1446),a=n(9240);t.checkInputsShape=function(e,...t){if(!e||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].dims||e[n].dims.length!==t[n])return!1;return!0},t.assert=function(e,t){if(!e)throw new Error("string"==typeof t?t:t())},t.ArrayUtil=class{static arraysEqual(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}};class u{static preprocessInputShapes(e,t){return[1===e.length?[1,e[0]]:e,1===t.length?[t[0],1]:t]}static postprocessOutputShape(e,t,n){1===t&&e.splice(e.length-2,1),1===n&&e.pop()}static calcMatMulShape(e,t){return e[1]!==t[0]?void 0:[e[0],t[1]]}}t.MatMulUtil=u;class c{static calcShape(e,t,n=!1){const r=e.length,i=t.length;if(0===r)return t;if(0===i)return e;const o=Math.max(e.length,t.length),s=new Array(o);if(n){if(r<2||i<2)return;const n=u.calcMatMulShape([e[r-2],e[r-1]],[t[i-2],t[i-1]]);if(void 0===n)return;[s[o-2],s[o-1]]=n}for(let a=n?3:1;a<=o;a++){const n=r-a<0?1:e[r-a],u=i-a<0?1:t[i-a];if(n!==u&&n>1&&u>1)return;s[o-a]=Math.max(n,u)}return s}static index(e,t){const n=new Array(t.length);return c.fillIndex(e,t,n),n}static fillIndex(e,t,n){const r=e.length-t.length;for(let i=0;i<t.length;i++)n[i]=e[r+i]%t[i]}static calc(e,t,n,r,i){const o=c.calcShape(e.dims,t.dims);if(o){if(r&&!f.areEqual(o,e.dims))return;const s=f.size(o),u=r?e:new a.Tensor(o,i||e.type);if(0===o.length)u.set([],n(e.get([]),t.get([])));else{const r=new Array(o.length),i=new Array(e.dims.length),a=new Array(t.dims.length);let l,d=0,f=0,h=!1,p=!1;0===e.dims.length&&(d=e.get([]),h=!0),0===t.dims.length&&(f=t.get([]),p=!0);for(let g=0;g<s;g++){l=g;for(let e=o.length-1;e>=0;e--)r[e]=l%o[e],l=Math.floor(l/o[e]);h||(c.fillIndex(r,e.dims,i),d=e.get(i)),p||(c.fillIndex(r,t.dims,a),f=t.get(a)),u.set(r,n(d,f))}}return u}}static isValidBroadcast(e,t){const n=e.length,r=t.length;if(n>r)return!1;for(let i=1;i<=n;i++)if(1!==e[n-i]&&e[n-i]!==t[r-i])return!1;return!0}static getBroadcastDims(e,t){const n=e.length,r=[];for(let i=0;i<n;i++){const o=n-1-i,s=e[o]||1;(t[t.length-1-i]||1)>1&&1===s&&r.unshift(o)}return r}}t.BroadcastUtil=c,t.arrayCopyHelper=function(e,t,n,r,i){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+i>t.length)throw new Error("source indices to be copied are outside bounds");if(n+i>e.length)throw new Error("target array is too small to hold result");for(let o=0;o<i;o++)e[n+o]=t[r+o]},t.GemmUtil=class{static getShapeOfGemmResult(e,t,n,r,i){if(2!==e.length||2!==n.length)throw new Error("shape need to be of size 2");let o,s,a;t?(o=e[1],s=e[0]):(o=e[0],s=e[1]);let u=-1;if(r?(a=n[0],u=1):(a=n[1],u=0),n[u]!==s)throw new Error("dimension mismatch");if(o<=0||a<=0||s<=0)throw new Error("invalid shape specified");if(i&&!c.isValidBroadcast(i,[o,a]))throw new Error("gemm: invalid bias shape for broadcast");return[o,a,s]}};class l{static tensorDataTypeFromProto(e){switch(e){case s.onnx.TensorProto.DataType.INT8:return"int8";case s.onnx.TensorProto.DataType.UINT8:return"uint8";case s.onnx.TensorProto.DataType.BOOL:return"bool";case s.onnx.TensorProto.DataType.INT16:return"int16";case s.onnx.TensorProto.DataType.UINT16:return"uint16";case s.onnx.TensorProto.DataType.INT32:return"int32";case s.onnx.TensorProto.DataType.UINT32:return"uint32";case s.onnx.TensorProto.DataType.FLOAT:return"float32";case s.onnx.TensorProto.DataType.DOUBLE:return"float64";case s.onnx.TensorProto.DataType.STRING:return"string";case s.onnx.TensorProto.DataType.INT64:return"int32";case s.onnx.TensorProto.DataType.UINT64:return"uint32";default:throw new Error(`unsupported data type: ${s.onnx.TensorProto.DataType[e]}`)}}static tensorDataTypeStringToEnum(e){switch(e){case"int8":return s.onnx.TensorProto.DataType.INT8;case"uint8":return s.onnx.TensorProto.DataType.UINT8;case"bool":return s.onnx.TensorProto.DataType.BOOL;case"int16":return s.onnx.TensorProto.DataType.INT16;case"uint16":return s.onnx.TensorProto.DataType.UINT16;case"int32":return s.onnx.TensorProto.DataType.INT32;case"uint32":return s.onnx.TensorProto.DataType.UINT32;case"float32":return s.onnx.TensorProto.DataType.FLOAT;case"float64":return s.onnx.TensorProto.DataType.DOUBLE;case"string":return s.onnx.TensorProto.DataType.STRING;case"int64":return s.onnx.TensorProto.DataType.INT64;case"uint64":return s.onnx.TensorProto.DataType.UINT64;default:throw new Error(`unsupported data type: ${e}`)}}static tensorDimsFromProto(e){return e.map((e=>o.default.isLong(e)?e.toNumber():e))}static tensorValueTypeFromProto(e){return{tensorType:l.tensorDataTypeFromProto(e.elemType),shape:{dims:l.tensorDimsFromProto(e.shape.dim.map((e=>e.dimValue)))}}}static tensorDimsFromORTFormat(e){const t=[];for(let n=0;n<e.dimsLength();n++)t.push(d.longToNumber(e.dims(n)));return t}static tensorAttributesFromORTFormat(e){const t=[];for(let n=0;n<e.attributesLength();n++)t.push(e.attributes(n));return t}}t.ProtoUtil=l;class d{static longToNumber(e,t){return o.default.isLong(e)?e.toNumber():e instanceof i.flatbuffers.Long?o.default.fromValue({low:e.low,high:e.high,unsigned:null!=t&&t}).toNumber():e}static isLong(e){return o.default.isLong(e)||e instanceof i.flatbuffers.Long}}t.LongUtil=d;class f{static size(e){return f.getSizeFromDimensionRange(e,0,e.length)}static sizeFromDimension(e,t){if(t<0||t>e.length)throw new Error(`invalid dimension of ${t} for sizeFromDimension as Tensor has ${e.length} dimensions.`);return f.getSizeFromDimensionRange(e,t,e.length)}static sizeToDimension(e,t){if(t<0||t>e.length)throw new Error(`invalid dimension of ${t} for sizeToDimension as Tensor has ${e.length} dimensions.`);return f.getSizeFromDimensionRange(e,0,t)}static getSizeFromDimensionRange(e,t,n){let r=1;for(let i=t;i<n;i++){if(e[i]<=0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.");r*=e[i]}return r}static computeStrides(e){const t=e.length;if(0===t)return[];if(1===t)return[1];const n=new Array(t);n[t-1]=1,n[t-2]=e[t-1];for(let r=t-3;r>=0;--r)n[r]=n[r+1]*e[r+1];return n}static transpose(e){return e.slice().reverse()}static indicesToOffset(e,t,n){void 0===n&&(n=e.length);let r=0;for(let i=0;i<n;++i)r+=t[i]*e[i];return r}static offsetToIndices(e,t){const n=t.length;if(0===n)return[];if(1===n)return[e*t[0]];const r=new Array(t.length);for(let n=0;n<r.length-1;++n)r[n]=Math.floor(e/t[n]),e-=r[n]*t[n];return r[r.length-1]=e,r}static normalizeAxis(e,t){if(e<-t&&e>=t)throw new Error("unsupported axis for this operation.");return e<0?e+t:e}static normalizeAxes(e,t){return e.map((e=>this.normalizeAxis(e,t)))}static incrementIndex(e,t,n){if(0===t.length||0===e.length)throw new Error("Index incrementing unsupported for scalar Tensor");if(void 0===n)n=t.length;else if(n<=0||n>t.length)throw new Error("Incorrect axis to increment on");for(let r=n-1;r>=0&&(e[r]++,!(e[r]<t[r]));--r)e[r]=0}static calculateReshapedDims(e,t){if(0===t.length){if(0===e.length||1===f.size(e))return[];throw new Error("cannot reshape to a scalar Tensor")}const n=t.length,r=new Array(n);let i=-1,o=1;for(let s=0;s<n;s++){if(t[s]<-1)throw new Error("a dimension in shape hints cannot be less than -1");if(-1===t[s]){if(-1!==i)throw new Error("at most one dimension in shape hints can be -1");i=s}else{if(0===t[s]){if(s>=e.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");r[s]=e[s]}else r[s]=t[s];o*=r[s]}}const s=f.size(e);if(-1!==i){if(s%o!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${e}] Output shape: [${t}]`);r[i]=s/o}else if(o!==s)throw new Error("reshapedDims and originalDims don't have matching sizes");return r}static sortBasedOnPerm(e,t){return t?t.map((t=>e[t])):e.slice().reverse()}static padShape(e,t){const n=e.length;return e.map(((e,r)=>e+t[r]+t[r+n]))}static areEqual(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}static validateDimsAndCalcSize(e){if(e.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let t=1;for(const n of e){if(!Number.isInteger(n))throw new TypeError(`Invalid shape: ${n} is not an integer`);if(n<0||n>2147483647)throw new TypeError(`Invalid shape: length ${n} is not allowed`);t*=n}return t}static flattenShape(e,t){t<0&&(t+=e.length);const n=e.reduce(((e,t)=>e*t),1),r=e.slice(t).reduce(((e,t)=>e*t),1);return[n/r,r]}static squeezeShape(e,t){const n=new Array;t=f.normalizeAxes(t,e.length);for(let r=0;r<e.length;r++){const i=t.indexOf(r)>=0;if(i&&1!==e[r])throw new Error("squeeze an axis of size different than 1");(0===t.length&&e[r]>1||t.length>0&&!i)&&n.push(e[r])}return n}static unsqueezeShape(e,t){const n=new Array(e.length+t.length);n.fill(0);for(let e=0;e<t.length;e++){const r=f.normalizeAxis(t[e],n.length);if(r>=n.length)throw new Error("'axes' has an out of range axis");if(0!==n[r])throw new Error("'axes' has a duplicate axis");n[r]=1}let r=0;for(let t=0;t<n.length;t++)0===n[t]&&(n[t]=e[r++]);if(r!==e.length)throw new Error("the unsqueezed dimension could not be established");return n}}t.ShapeUtil=f,t.MathUtil=class{static sqr(e,t,n,r,i){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+i>t.length)throw new Error("source indices to be copied are outside bounds");if(n+i>e.length)throw new Error("target array is too small to hold result");for(let o=0;o<i;o++)e[n+o]+=Math.pow(t[r+o],2)}static axpy(e,t,n,r,i,o){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+i>t.length)throw new Error("source indices to be copied are outside bounds");if(n+i>e.length)throw new Error("target array is too small to hold result");for(let s=0;s<i;s++)e[n+s]+=o*t[r+s]}static powx(e,t,n,r,i,o){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+i>t.length)throw new Error("source indices to be copied are outside bounds");if(n+i>e.length)throw new Error("target array is too small to hold result");for(let s=0;s<i;s++)e[n+s]=Math.pow(t[r+s],o)}static mul(e,t,n,r,i){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+i>t.length)throw new Error("source indices to be copied are outside bounds");if(n+i>e.length)throw new Error("target array is too small to hold result");for(let o=0;o<i;o++)e[n+o]=t[r+o]*e[n+o]}};class h{static splitShape(e,t,n,r){if(0===n.length){if(!r)throw new Error("need to know number of outputs when the 'split' attribute is not specified");h.determineSplit(e[t],r,n)}const i=[],o=[0];for(let r=0;r<n.length;++r){0!==r&&o.push(o[r-1]+n[r-1]);const s=e.slice();s[t]=n[r],i.push(s)}return[i,o]}static determineSplit(e,t,n){if(e%t!=0)throw new Error("cannot split tensor to equal sized parts");for(let r=0;r<t;++r)n.push(e/t)}}t.SplitUtil=h;class p{static calcReduce(e,t,n,r,i){const o=e.dims.slice(0);0===t.length&&o.forEach(((e,n)=>t.push(n)));const s=p.calcReduceShape(o,t,!0),u=f.size(s),l=new a.Tensor(s,e.type),d=f.computeStrides(s),h=f.computeStrides(o),g=new Array(o.length);for(let n=0;n<u;n++){const s=f.offsetToIndices(n,d);c.fillIndex(s,o,g),l.set(s,p.calcReduceByAxis(e.numberData,t,o,0,f.indicesToOffset(g,h),r,i))}return n?l:new a.Tensor(p.calcReduceShape(o,t,n),l.type,void 0,void 0,l.data,l.dataId)}static calcReduceByAxis(e,t,n,r,i,o,s){let a=0;if(r>=t.length)return o(e[i]);const u=t[r],c=u>=n.length?1:f.size(n.slice(u+1));for(let l=0;l<n[u];l++)a=0===l?p.calcReduceByAxis(e,t,n,r+1,i,o,s):s(a,p.calcReduceByAxis(e,t,n,r+1,i,o,s)),i+=c;return a}static calcReduceShape(e,t,n){const r=e.slice();for(let e=0;e<t.length;e++)r[t[e]]=n?1:0;return r.filter((e=>0!==e))}}t.ReduceUtil=p;class g{static adjustPoolAttributes(e,t,n,r,i,o){if(!e&&n.length!==t.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(e)for(let e=0;e<t.length-2;e++)e>=n.length?n.push(t[e+2]):n[e]=t[e+2];for(let e=0;e<n.length;e++)if(e<r.length){if(r[e]<0)throw new Error("strides should be greater than or equal to 1")}else r.push(1);for(let e=0;e<n.length;e++)if(e<i.length){if(i[e]<0)throw new Error("dilations should be greater than or equal to 1")}else i.push(1);for(let e=0;e<2*n.length;e++)if(e<o.length){if(o[e]<0)throw new Error("pad should be greater than or equal to 1")}else o.push(0);for(let e=0;e<n.length;e++){if(n[e]<=0)throw new Error("kernel shapes need to be greater than 0");if(o[e]>=n[e]||o[e+n.length]>=n[e])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(e,t,n,r,i,o){if(o){if(i.length!==2*(e.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(t.length!==e.length-2)throw new Error("length of strides should be the length of data dimensions");if(r.length!==e.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let s=0;s<e.length-2;s++)g.adjustPadAndReturnShape(e[s+2],t[s],n[s],r[s],i,s,s+e.length-2,o)}}static computePoolOutputShape(e,t,n,r,i,o,s){if(t.length<=0)throw new Error("input shape must be of size greater than 0");const a=[t[0],t[1]];return g.computeShapeHelper(e,t,a,n,r,i,o,s),a}static computeConvOutputShape(e,t,n,r,i,o,s){if(e.length<=0||t.length<=0)throw new Error("invalid input tensor dims or invalid filter tensor dims");const a=[e[0],t[0]];return g.computeShapeHelper(!1,e,a,n,r,i,o,s),a}static computeShapeHelper(e,t,n,r,i,o,s,a){if(e)for(let e=0;e<t.length-2;e++)n.push(1);else for(let e=0;e<t.length-2;e++)n.push(g.adjustPadAndReturnShape(t[e+2],r[e],i[e],o[e],s,e,e+t.length-2,a))}static adjustPadAndReturnShape(e,t,n,r,i,o,s,a){const u=n*(r-1)+1;if(!a||"NOTSET"===a)return Math.floor((e+i[o]+i[s]-u)/t+1);switch(a){case"VALID":return i[o]=0,i[s]=0,Math.floor((e-u)/t+1);case"SAME_LOWER":case"SAME_UPPER":if(1!==n)throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");{const n=((e+t-1)/t-1)*t+r-e;return i[o]="SAME_LOWER"===a?Math.floor((n+1)/2):Math.floor(n/2),i[s]=n-i[o],Math.floor((e+n-r)/t+1)}default:throw new Error("Unsupported AutoPad type")}}}t.PoolConvUtil=g,t.MIN_CLIP=-34028234663852886e22,t.MAX_CLIP=34028234663852886e22,t.decodeUtf8String=function(e){return(new TextDecoder).decode(e)}},3838:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebGpuBackend=void 0;const r=n(8453),i=n(4955),o=n(7771),s=n(8510),a=n(8305);t.WebGpuBackend=class{constructor(){this.currentKernelId=null,this.commandEncoder=null,this.computePassEncoder=null,this.pendingDispatchNumber=0,this.profilingEnabled=!1}get currentKernelCustomData(){if(null===this.currentKernelId)throw new Error("currentKernelCustomData(): currentKernelId is null. (should not happen)");let e=this.kernelCustomData.get(this.currentKernelId);return e||(e={},this.kernelCustomData.set(this.currentKernelId,e)),e}async initialize(){if(!navigator.gpu)throw new Error("WebGpuBackend: WebGPU is not available.");const e=await navigator.gpu.requestAdapter();if(!e)throw new Error("WebGpuBackend: Failed to get GPU adapter.");const t={requiredLimits:{maxComputeWorkgroupStorageSize:e.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:e.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:e.limits.maxStorageBufferBindingSize}};e.features.has("timestamp-query-inside-passes")&&"default"===r.env.webgpu.profilingMode&&(this.profilingEnabled=!0,t.requiredFeatures=["timestamp-query-inside-passes"]),this.device=await e.requestDevice(t),this.gpuDataManager=(0,o.createGpuDataManager)(this),this.programManager=new a.ProgramManager(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,this.device.onuncapturederror=e=>{e.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${e.error.message}`)},this.profilingEnabled&&(this.profilingQuerySet=this.device.createQuerySet({type:"timestamp",count:2}))}dispose(){}getCommandEncoder(){return this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder()),this.commandEncoder}getComputePassEncoder(){return this.computePassEncoder||(this.computePassEncoder=this.getCommandEncoder().beginComputePass()),this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){this.endComputePass(),this.device.queue.submit([this.getCommandEncoder().finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0}run(e,t,n,r,o){if(t.length!==e.inputTypes.length)throw new Error(`Input size must be equal to ${e.inputTypes.length}.`);const s=[];for(let e=0;e<t.length;++e){const n=this.gpuDataManager.get(t[e].data);if(!n)throw new Error(`no GPU data for input: ${t[e].data}`);s[e]=n}const a=((e,t,n)=>{const r=t.map((e=>`${e.join(",")}`)).join("_"),i=n.join("_");let o=e.name;return e.cacheHint&&(o+="["+e.cacheHint+"]"),o+=":"+r+";"+i,o})(e,t.map((e=>e.dims)),s.map((e=>e.type)));let u=this.programManager.getArtifact(a);const c=u?u.programInfo:"function"==typeof e.get?e.get():e,l=0===n.length?c.outputs.map(((e,t)=>t)):n;if(l.length!==c.outputs.length)throw new Error(`Output size ${l.length} must be equal to ${c.outputs.length}.`);const d=[],f=[];for(let e=0;e<c.outputs.length;++e){if(!Number.isInteger(l[e])||l[e]<-2||l[e]>=c.outputs.length)throw new Error(`Invalid output index: ${l[e]}`);const t=-1===l[e],n=-2===l[e],i=t||n?o(c.outputs[e].dataType,c.outputs[e].dims):r(l[e],c.outputs[e].dataType,c.outputs[e].dims),s=this.gpuDataManager.get(i.data);if(!s)throw new Error(`no GPU data for output: ${i.data}`);if(t&&this.temporaryData.push(s),n){let e=this.kernelPersistentData.get(this.currentKernelId);e||(e=[],this.kernelPersistentData.set(this.currentKernelId,e)),e.push(s)}d.push(i),f.push(s)}const h=this.programManager.normalizeDispatchGroupSize(c.dispatchGroup(t));return u||(u=this.programManager.build(c,h),this.programManager.setArtifact(a,u)),(0,i.LOG_DEBUG)("info",(()=>`[ProgramManager] run "${c.name}" (key=${a}) with ${h[0]}x${h[1]}x${h[2]}`)),this.programManager.run(u,s,f,h),d}upload(e,t){this.gpuDataManager.upload(e,t)}memcpy(e,t){this.gpuDataManager.memcpy(e,t)}async download(e,t){const n=await this.gpuDataManager.download(e);t().set(new Uint8Array(n))}alloc(e){return this.gpuDataManager.create(e).id}free(e){return this.gpuDataManager.release(e)}createKernel(e,t,n){const r=s.WEBGPU_OP_RESOLVE_RULES.get(e);if(!r)throw new Error(`kernel not implemented: ${e}`);this.kernels.set(t,[e,r[0],[r[1],n]])}releaseKernel(e){const t=this.kernelPersistentData.get(e);if(t){for(const e of t)this.gpuDataManager.release(e.id);this.kernelPersistentData.delete(e)}this.kernelCustomData.delete(e),this.kernels.delete(e)}computeKernel(e,t){const n=this.kernels.get(e);if(!n)throw new Error(`kernel not created: ${e}`);const[r,o,s]=n;if(null!==this.currentKernelId)throw new Error(`kernel "${r}" is not allowed to be called recursively`);this.currentKernelId=e,s[0]&&(s[1]=s[0](s[1]),s[0]=void 0),(0,i.LOG_DEBUG)("info",(()=>`[WebGPU] Start to run kernel "${r}"...`)),this.temporaryData=[];try{return o(t,s[1]),0}catch(e){return(0,i.LOG_DEBUG)("warning",`[WebGPU] Kernel "${r}" failed. Error: ${e}`),1}finally{for(const e of this.temporaryData)this.gpuDataManager.release(e.id);this.temporaryData=[],this.currentKernelId=null}}}},7675:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const r=n(7917),i=n(3838),o=n(4955),s=n(6952);class a{constructor(e,t,n,r){this.module=e,this.dataType=t,this.data=n,this.dims=r}getFloat32Array(){return new Float32Array(this.module.HEAP8.buffer,this.data,s.ShapeUtil.size(this.dims))}reshape(e){if(s.ShapeUtil.size(e)!==s.ShapeUtil.size(this.dims))throw new Error("Invalid new shape");return new a(this.module,this.dataType,this.data,e)}}class u{get customData(){return this.backend.currentKernelCustomData}constructor(e,t,n){this.module=e,this.backend=t;const r=e.HEAPU32;let i=n>>2;this.opKernelContext=r[i++];const o=r[i++],s=[];for(let t=0;t<o;t++){const t=r[i++],n=r[i++],o=r[i++],u=[];for(let e=0;e<o;e++)u.push(r[i++]);s.push(new a(e,t,n,u))}this.inputs=s}compute(e,t){var n,i,o;const u=null!==(i=null===(n=null==t?void 0:t.inputs)||void 0===n?void 0:n.map((e=>"number"==typeof e?this.inputs[e]:e)))&&void 0!==i?i:this.inputs,c=null!==(o=null==t?void 0:t.outputs)&&void 0!==o?o:[];return this.backend.run(e,u,c,((e,t,n)=>new a(this.module,t,this.output(e,n),n)),((e,t)=>{const n=(0,r.getTensorElementSize)(e);if(!n)throw new Error(`Unsupported data type: ${e}`);const i=n*s.ShapeUtil.size(t);return new a(this.module,e,this.backend.gpuDataManager.create(i).id,t)}))}output(e,t){const n=this.module.stackSave();try{const n=this.module.stackAlloc(4*(1+t.length));let r=n>>2;this.module.HEAPU32[r++]=t.length;for(let e=0;e<t.length;e++)this.module.HEAPU32[r++]=t[e];return this.module._JsepOutput(this.opKernelContext,e,n)}finally{this.module.stackRestore(n)}}}t.init=async e=>{const t=e.jsepInit;if(t&&navigator.gpu){const n=new i.WebGpuBackend;await n.initialize(),t({backend:n},(e=>n.alloc(e)),(e=>n.free(e)),((t,r,i,s=!1)=>{if(s)(0,o.LOG_DEBUG)("verbose",(()=>`[WebGPU] jsepCopyGpuToGpu: src=${t}, dst=${r}, size=${i}`)),n.memcpy(t,r);else{(0,o.LOG_DEBUG)("verbose",(()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${t}, gpuDataId=${r}, size=${i}`));const s=e.HEAPU8.subarray(t,t+i);n.upload(r,s)}}),(async(t,r,i)=>{(0,o.LOG_DEBUG)("verbose",(()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${t}, dataOffset=${r}, size=${i}`)),await n.download(t,(()=>e.HEAPU8.subarray(r,r+i)))}),((e,t,r)=>n.createKernel(e,t,r)),(e=>n.releaseKernel(e)),((t,r)=>{(0,o.LOG_DEBUG)("verbose",(()=>`[WebGPU] jsepRun: kernel=${t}, contextDataOffset=${r}`));const i=new u(e,n,r);return n.computeKernel(t,i)}))}}},4955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOG_DEBUG=t.LOG=void 0;const r=n(8453),i=n(7917),o=["V","I","W","E","F"];t.LOG=(e,t)=>{const n=(0,i.logLevelStringToEnum)(e);var s,a;n>=(0,i.logLevelStringToEnum)(r.env.logLevel)&&(s=n,a="function"==typeof t?t():t,console.log(`[${o[s]},${(new Date).toISOString()}]${a}`))},t.LOG_DEBUG=(...e)=>{r.env.debug&&(0,t.LOG)(...e)}},6952:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_CLIP=t.MIN_CLIP=t.GemmUtil=t.PoolConvUtil=t.ShapeUtil=t.BroadcastUtil=t.MatMulUtil=void 0;class n{static calcMatMulShape(e,t){return e[1]!==t[0]?void 0:[e[0],t[1]]}}t.MatMulUtil=n;class r{static calcShape(e,t,r=!1){const i=e.length,o=t.length;if(0===i)return t;if(0===o)return e;const s=Math.max(e.length,t.length),a=new Array(s);if(r){if(i<2||o<2)return;const r=n.calcMatMulShape([e[i-2],e[i-1]],[t[o-2],t[o-1]]);if(void 0===r)return;[a[s-2],a[s-1]]=r}for(let n=r?3:1;n<=s;n++){const r=i-n<0?1:e[i-n],u=o-n<0?1:t[o-n];if(r!==u&&r>1&&u>1)return;a[s-n]=Math.max(r,u)}return a}static isValidBroadcast(e,t){const n=e.length,r=t.length;if(n>r)return!1;for(let i=1;i<=n;i++)if(1!==e[n-i]&&e[n-i]!==t[r-i])return!1;return!0}}t.BroadcastUtil=r;class i{static size(e){return i.getSizeFromDimensionRange(e,0,e.length)}static sizeFromDimension(e,t){if(t<0||t>e.length)throw new Error(`invalid dimension of ${t} for sizeFromDimension as Tensor has ${e.length} dimensions.`);return i.getSizeFromDimensionRange(e,t,e.length)}static sizeToDimension(e,t){if(t<0||t>e.length)throw new Error(`invalid dimension of ${t} for sizeToDimension as Tensor has ${e.length} dimensions.`);return i.getSizeFromDimensionRange(e,0,t)}static getSizeFromDimensionRange(e,t,n){let r=1;for(let i=t;i<n;i++){if(e[i]<=0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.");r*=e[i]}return r}static computeStrides(e){const t=e.length;if(0===t)return[];if(1===t)return[1];const n=new Array(t);n[t-1]=1,n[t-2]=e[t-1];for(let r=t-3;r>=0;--r)n[r]=n[r+1]*e[r+1];return n}static normalizeAxis(e,t){if(e<-t&&e>=t)throw new Error("unsupported axis for this operation.");return e<0?e+t:e}static normalizeAxes(e,t){return e.map((n=>this.normalizeAxis(n,null!=t?t:e.length)))}static sortBasedOnPerm(e,t){return t?t.map((t=>e[t])):e.slice().reverse()}static padShape(e,t){const n=e.length;return e.map(((e,r)=>e+t[r]+t[r+n]))}static areEqual(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}}t.ShapeUtil=i;class o{static adjustPoolAttributes(e,t,n,r,i,o){if(!e&&n.length!==t.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(e)for(let e=0;e<t.length-2;e++)e>=n.length?n.push(t[e+2]):n[e]=t[e+2];for(let e=0;e<n.length;e++)if(e<r.length){if(r[e]<0)throw new Error("strides should be greater than or equal to 1")}else r.push(1);for(let e=0;e<n.length;e++)if(e<i.length){if(i[e]<0)throw new Error("dilations should be greater than or equal to 1")}else i.push(1);for(let e=0;e<2*n.length;e++)if(e<o.length){if(o[e]<0)throw new Error("pad should be greater than or equal to 1")}else o.push(0);for(let e=0;e<n.length;e++){if(n[e]<=0)throw new Error("kernel shapes need to be greater than 0");if(o[e]>=n[e]||o[e+n.length]>=n[e])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(e,t,n,r,i,s,a){if(a){if(i.length!==2*(e.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(t.length!==e.length-2)throw new Error("length of strides should be the length of data dimensions");if(r.length!==e.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let u=0;u<e.length-2;u++)o.adjustPadAndReturnShape(e[u+(s?1:2)],t[u],n[u],r[u],i,u,u+e.length-2,a)}}static computePoolOutputShape(e,t,n,r,i,s,a){if(t.length<=0)throw new Error("input shape must be of size greater than 0");const u=[t[0],t[1]];return o.computeShapeHelper(e,t,u,n,r,i,s,a),u}static computeConvOutputShape(e,t,n,r,i,s,a){if(e.length<=0||t.length<=0)throw new Error("invalid input tensor dims or invalid filter tensor dims");const u=[e[0],t[0]];return o.computeShapeHelper(!1,e,u,n,r,i,s,a),u}static computeShapeHelper(e,t,n,r,i,s,a,u){if(e)for(let e=0;e<t.length-2;e++)n.push(1);else for(let e=0;e<t.length-2;e++)n.push(o.adjustPadAndReturnShape(t[e+2],r[e],i[e],s[e],a,e,e+t.length-2,u))}static adjustPadAndReturnShape(e,t,n,r,i,o,s,a){const u=n*(r-1)+1;if(!a||"NOTSET"===a)return Math.floor((e+i[o]+i[s]-u)/t+1);switch(a){case"VALID":return i[o]=0,i[s]=0,Math.floor((e-u)/t+1);case"SAME_LOWER":case"SAME_UPPER":if(1!==n)throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");{const n=((e+t-1)/t-1)*t+r-e;return i[o]="SAME_LOWER"===a?Math.floor((n+1)/2):Math.floor(n/2),i[s]=n-i[o],Math.floor((e+n-r)/t+1)}default:throw new Error("Unsupported AutoPad type")}}}t.PoolConvUtil=o,t.GemmUtil=class{static getShapeOfGemmResult(e,t,n,i,o){if(2!==e.length||2!==n.length)throw new Error("shape need to be of size 2");let s,a,u;t?(s=e[1],a=e[0]):(s=e[0],a=e[1]);let c=-1;if(i?(u=n[0],c=1):(u=n[1],c=0),n[c]!==a)throw new Error("dimension mismatch");if(s<=0||u<=0||a<=0)throw new Error("invalid shape specified");if(o&&!r.isValidBroadcast(o,[s,u]))throw new Error("gemm: invalid bias shape for broadcast");return[s,u,a]}},t.MIN_CLIP=-34028234663852886e22,t.MAX_CLIP=34028234663852886e22},387:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAttributeWithCacheKey=void 0;class n{constructor(e){Object.assign(this,e)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map((e=>`${this[e]}`)).join(";")),this._cacheKey}}t.createAttributeWithCacheKey=e=>new n(e)},7771:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGpuDataManager=void 0;const r=n(4955),i=n(1163),o=e=>16*Math.ceil(e/16);let s=0;class a{constructor(e){this.backend=e,this.storageCache=new Map,this.downloadCache=new Map,this.buffersForUploadingPending=[],this.buffersPending=[]}upload(e,t){const n=t.buffer,i=t.byteOffset,s=t.byteLength,a=o(s),u=this.storageCache.get(e);if(!u)throw new Error("gpu data for uploading does not exist");if(u.originalSize!==s)throw new Error(`inconsistent data size. gpu data size=${u.originalSize}, data size=${s}`);const c=this.backend.device.createBuffer({mappedAtCreation:!0,size:a,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),l=c.getMappedRange();new Uint8Array(l).set(new Uint8Array(n,i,s)),c.unmap();const d=this.backend.getCommandEncoder();this.backend.endComputePass(),d.copyBufferToBuffer(c,0,u.gpuData.buffer,0,a),(0,r.LOG_DEBUG)("verbose",(()=>`[WebGPU] GpuDataManager.upload(id=${e})`)),this.buffersForUploadingPending.push(c)}memcpy(e,t){const n=this.storageCache.get(e);if(!n)throw new Error("source gpu data for memcpy does not exist");const r=this.storageCache.get(t);if(!r)throw new Error("destination gpu data for memcpy does not exist");if(n.originalSize!==r.originalSize)throw new Error("inconsistent source and destination gpu data size");const i=o(n.originalSize);this.backend.getCommandEncoder().copyBufferToBuffer(n.gpuData.buffer,0,r.gpuData.buffer,0,i)}create(e,t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){const n=o(e),a=this.backend.device.createBuffer({size:n,usage:t}),u={id:s++,type:i.GpuDataType.default,buffer:a};return this.storageCache.set(u.id,{gpuData:u,originalSize:e}),(0,r.LOG_DEBUG)("verbose",(()=>`[WebGPU] GpuDataManager.create(size=${e}) => id=${u.id}`)),u}get(e){var t;return null===(t=this.storageCache.get(e))||void 0===t?void 0:t.gpuData}release(e){const t=this.storageCache.get(e);if(!t)throw new Error("releasing data does not exist");return(0,r.LOG_DEBUG)("verbose",(()=>`[WebGPU] GpuDataManager.release(id=${e}), gpuDataId=${t.gpuData.id}`)),this.storageCache.delete(e),this.buffersPending.push(t.gpuData.buffer),this.downloadCache.get(e)&&this.downloadCache.delete(e),t.originalSize}async download(e){const t=this.downloadCache.get(e);if(t)return t.data;const n=this.storageCache.get(e);if(!n)throw new Error("data does not exist");const r=this.backend.getCommandEncoder();this.backend.endComputePass();const i=this.backend.device.createBuffer({size:n.originalSize,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});r.copyBufferToBuffer(n.gpuData.buffer,0,i,0,n.originalSize),this.backend.flush();const o=new Promise((e=>{i.mapAsync(GPUMapMode.READ).then((()=>{const t=i.getMappedRange().slice(0);i.destroy(),e(t)}))}));return this.downloadCache.set(e,{data:o}),o}refreshPendingBuffers(){for(const e of this.buffersForUploadingPending)e.destroy();for(const e of this.buffersPending)e.destroy()}}t.createGpuDataManager=(...e)=>new a(...e)},8510:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WEBGPU_OP_RESOLVE_RULES=void 0;const s=o(n(504)),a=n(9770),u=n(4271),c=n(1522),l=o(n(5262)),d=n(2625),f=o(n(9302));t.WEBGPU_OP_RESOLVE_RULES=new Map([["Abs",[f.abs]],["Acos",[f.acos]],["Acosh",[f.acosh]],["Add",[s.add]],["Asin",[f.asin]],["Asinh",[f.asinh]],["Atan",[f.atan]],["Atanh",[f.atanh]],["AveragePool",[l.averagePool,l.parseAveragePoolAttributes]],["Ceil",[f.ceil]],["ClipV10",[f.clipV10]],["Clip",[f.clip]],["Conv",[a.conv,a.parseConvAttributes]],["Cos",[f.cos]],["Cosh",[f.cosh]],["Div",[s.div]],["Elu",[f.elu,f.parseAlphaAttributes]],["Erf",[f.erf]],["Exp",[f.exp]],["Floor",[f.floor]],["Gemm",[u.gemm,u.parseGemmAttributes]],["GlobalAveragePool",[l.globalAveragePool,l.parseGlobalAveragePoolAttributes]],["GlobalMaxPool",[l.globalMaxPool,l.parseGlobalMaxPoolAttributes]],["LeakyRelu",[f.leakyRelu,f.parseAlphaAttributes]],["MatMul",[c.matMul]],["MaxPool",[l.maxPool,l.parseMaxPoolAttributes]],["Mul",[s.mul]],["Neg",[f.neg]],["Pow",[s.pow]],["Reciprocal",[f.reciprocal]],["Relu",[f.relu]],["Sigmoid",[f.sigmoid]],["Sin",[f.sin]],["Sinh",[f.sinh]],["Sqrt",[f.sqrt]],["Sub",[s.sub]],["Tan",[f.tan]],["Tanh",[f.tanh]],["ThresholdedRelu",[f.thresholdedRelu,f.parseAlphaAttributes]],["Transpose",[d.transpose,d.parseTransposeAttributes]]])},1427:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.biasActivationSnippet=t.activationFnSnippet=t.typeSnippet=void 0,t.typeSnippet=e=>{switch(e){case 1:return"f32";case 2:return"vec2<f32>";case 3:return"vec3<f32>";case 4:return"vec4<f32>";default:throw new Error(`${e}-component is not supported.`)}},t.activationFnSnippet=(e,t=!1,n=!1,r=3)=>"",t.biasActivationSnippet=(e,t)=>`\n ${e?"value = value + getBiasByOutputCoords(coords);":""}\n ${t?"value = activation(value, coords);":""}\n `},9456:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConv2DMatMulProgramInfo=void 0;const r=n(4955),i=n(6952),o=n(1163),s=n(1427),a=n(4085),u=n(158);t.createConv2DMatMulProgramInfo=(e,t,n,c,l,d,f,h,p)=>{const g="NHWC"===n.format,m=g?e[0].dims[3]:e[0].dims[1],b=c[0],y=g?c[2]:c[3],v=g?c[1]:c[2],_=g?c[3]:c[1],w=((m%4==0||m%3==0)&&g||y%4==0&&!g)&&_%4==0,x=g?_:y*v,T=g?y*v:_,S=w?[8,8,1]:[x<=4?4:16,x>4&&T<=4?4:16,1],O=w?[4,4,1]:[x<=4?1:2,x>4&&T<=4?1:2,1],E=[Math.ceil(x/S[0]/O[0]),Math.ceil(T/S[1]/O[1]),Math.ceil(b/S[2]/O[1])];(0,r.LOG_DEBUG)("verbose",(()=>`[conv2d_mm_webgpu] dispatch = ${E}`));const P=w?g&&m%4!=0?3:4:O[0],A=S[1]*O[1],C=S[0]*O[0],I=Math.max(S[0]*P,S[1]),R=l%A==0,M=d%C==0,k=f%I==0,D=w?[P,4,4]:[1,1,1],j=[`@group(0) @binding(0) var<storage, read> x: array<${w&&4===P?"vec4<f32>":"f32"}>;`,`@group(0) @binding(1) var<storage, read> w: array<${w?"vec4<f32>":"f32"}>;`];let $=`\n fn setOutputAtIndex(flatIndex : i32, value : ${w?"vec4<f32>":"f32"}) {\n result[flatIndex] = ${w?"vec4<f32>":"f32"}(value);\n }\n fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${w?"vec4<f32>":"f32"}) {\n let flatIndex = getOutputIndexFromCoords(vec4<i32>(d0, d1, d2, d3));\n setOutputAtIndex(flatIndex ${w?"/ 4":""}, value);\n }`;return h&&(j.push(`@group(0) @binding(2) var<storage, read> bias: array<${w?"vec4<f32>":"f32"}>;`),$+=`\n fn getBiasByOutputCoords(coords : vec4<i32>) -> ${w?"vec4<f32>":"f32"} {\n return bias[coords.${g?"w":"y"}${w?"/ 4":""}];\n }`),Object.assign(Object.assign({},t),{outputs:[{dims:c,dataType:e[0].dataType,gpuDataType:o.GpuDataType.default}],dispatchGroup:()=>({x:E[0],y:E[1],z:E[2]}),getShaderSource:()=>`\n ${a.utilFunctions}\n //struct Uniforms { xShape : vec4<i32>, wShape : vec4<i32>, outShape : vec4<i32>,\n // outShapeStrides: vec3<i32>, filterDims : vec2<i32>, pad : vec2<i32>, stride : vec2<i32>,\n // dilation : vec2<i32>, dimAOuter : i32, dimBOuter : i32, dimInner : i32 };\n ${j.join("")}\n @group(0) @binding(${j.length}) var<storage, read_write> result: array<${w?"vec4<f32>":"f32"}>;\n //@group(0) @binding(${j.length+1}) var<uniform> uniforms: Uniforms;\n\n const xShape : vec4<i32> = vec4<i32>(${e[0].dims.join(",")});\n const wShape : vec4<i32> = vec4<i32>(${e[1].dims.join(",")});\n const outShape : vec4<i32> = vec4<i32>(${c.join(",")});\n const outShapeStrides : vec3<i32> = vec3<i32>(${i.ShapeUtil.computeStrides(c).slice(0,3).join(",")});\n const filterDims : vec2<i32> = vec2<i32>(${n.kernelShape[0]}, ${n.kernelShape[1]});\n const pad : vec2<i32> = vec2<i32>(${n.pads[0]}, ${n.pads[1]});\n const stride : vec2<i32> = vec2<i32>(${n.strides[0]}, ${n.strides[1]});\n const dilation : vec2<i32> = vec2<i32>(${n.dilations[0]}, ${n.dilations[1]});\n const dimAOuter : i32 = ${l};\n const dimBOuter : i32 = ${d};\n const dimInner : i32 = ${f};\n ${$}\n ${((e,t,n,r,i=!1,o,a=!1,u=4,c=4,l=4)=>{const d=e?"\n let coord = vec4<i32>(batch, xRow, xCol, xCh);\n ":"\n let coord = vec4<i32>(batch, xCh, xRow, xCol);\n ",f=e?"\n let coords = vec4<i32>(\n batch,\n row / outWidth,\n row % outWidth,\n col);\n ":"\n let coords = vec4<i32>(\n batch,\n row,\n col / outWidth,\n col % outWidth);\n ",h=e?"xShape[1]":"xShape[2]",p=e?"xShape[2]":"xShape[3]",g=e?"row":"col",m=e?"col":"row",b=`\n let inChannels = wShape[2];\n let outWidth = ${e?"outShape[2]":"outShape[3]"};\n let outRow = ${g} / outWidth;\n let outCol = ${g} % outWidth;\n\n let WRow = ${m} / (filterDims[1] * inChannels);\n let WCol = ${m} / inChannels % filterDims[1];\n let xRow = outRow * stride[0] + dilation[0] * WRow - pad[0];\n let xCol = outCol * stride[1] + dilation[1] * WCol - pad[1];\n let xCh = ${m} % inChannels;\n var resData = ${(0,s.typeSnippet)(u)}(0.0);\n // The bounds checking is always needed since we use it to pad zero for\n // the 'same' padding type.\n if (xRow >= 0 && xRow < ${h} && xCol >= 0 && xCol < ${p}) {\n ${d}\n let xIndex = getIndexFromCoords4D(coord, xShape);\n ${(e=>{switch(e){case 1:return"resData = x[xIndex];";case 3:return"resData = vec3<f32>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);";case 4:return"resData = x[xIndex / 4];";default:throw new Error(`innerElementSize ${e} is not supported.`)}})(u)}\n }\n return resData;`,y=e?t&&r?`\n let col = colIn * ${u};\n ${b}`:`\n let col = colIn * ${u};\n if (row < dimAOuter && col < dimInner) {\n ${b}\n }\n return ${(0,s.typeSnippet)(u)}(0.0);`:r&&n?`\n let col = colIn * ${u};\n ${b}`:`\n let col = colIn * ${u};\n if (row < dimInner && col < dimBOuter) {\n ${b}\n }\n return ${(0,s.typeSnippet)(u)}(0.0);`,v=`${(e=>{switch(e){case 1:return"return w[row * wShape[3] + colIn];";case 4:return"return w[row * wShape[3] / 4 + colIn];";default:throw new Error(`innerElementSize ${e} is not supported.`)}})(c)}`,_=(0,s.typeSnippet)(l),w=e?(0,s.typeSnippet)(u):(0,s.typeSnippet)(c),x=e?(0,s.typeSnippet)(c):(0,s.typeSnippet)(u);return`\n ${(0,s.activationFnSnippet)(o,a,4===l,4)}\n fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${w} {\n ${e?y:v}\n }\n\n fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${x} {\n ${e?v:y}\n }\n\n fn mm_write(batch: i32, row : i32, colIn : i32, valueIn : ${_}) {\n let col = colIn * ${l};\n if (row < dimAOuter && col < dimBOuter)\n {\n var value = valueIn;\n let outWidth = ${e?"outShape[2]":"outShape[3]"};\n ${f}\n ${(0,s.biasActivationSnippet)(i,o)}\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\n }\n }`})(g,R,M,k,h,void 0,!1,D[0],D[1],D[2])}\n ${w?(0,u.makeMatMulPackedVec4Source)(O,S,!g,I):(0,u.makeMatMulPackedSource)(O,S,!g,I,!1,void 0,p)}`})}},4085:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.utilFunctions=void 0,t.utilFunctions="\nfn getIndexFromCoords4D(coords : vec4<i32>, shape : vec4<i32>) -> i32 {\n return dot(coords, vec4<i32>(\n shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1));\n}\nfn getOutputIndexFromCoords(coords : vec4<i32>) -> i32 {\n return dot(coords, vec4<i32>(\n outShapeStrides.x, outShapeStrides.y, outShapeStrides.z, 1));\n}\n"},158:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeMatMulPackedSource=t.makeMatMulPackedVec4Source=void 0,t.makeMatMulPackedVec4Source=(e,t,n=!1,r=32,i=!1,o=32,s=!1)=>{const a=t[1]*e[1],u=t[0]*e[0],c=n?a:r,l=n?r:a,d=c/t[0],f=r/t[1];if((!n||4!==d||4!==e[1])&&(n||3!==d&&4!==d)||c%t[0]!=0||r%t[1]!=0||4!==e[0])throw new Error(`If transposeA ${n} is true, innerElementSize ${d} and workPerThread[1] ${e[1]} must be 4.\n Otherwise, innerElementSize ${d} must be 3 or 4.\n tileAWidth ${c} must be divisible by workgroupSize[0]${t[0]}. tileInner ${r} must be divisible by workgroupSize[1] ${t[1]}. colPerThread ${e[0]} must be 4.`);return`\nvar<workgroup> mm_Asub : array<array<vec${d}<f32>, ${c/d}>, ${l}>;\nvar<workgroup> mm_Bsub : array<array<vec4<f32>, ${u/e[0]}>, ${r}>;\n\nconst rowPerThread = ${e[1]};\nconst colPerThread = ${e[0]};\nconst innerElementSize = ${d};\nconst tileInner = ${r};\n\n@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]})\nfn main(@builtin(local_invocation_id) localId : vec3<u32>,\n @builtin(global_invocation_id) globalId : vec3<u32>,\n @builtin(workgroup_id) workgroupId : vec3<u32>) {\n let localRow = i32(localId.y);\n let tileRow = ${s?"0":"localRow * rowPerThread"};\n let tileCol = i32(localId.x);\n\n let globalRow = ${s?"0":"i32(globalId.y) * rowPerThread"};\n let globalCol = i32(globalId.x);\n let batch = ${i?"0":"i32(globalId.z)"};\n let globalRowStart = i32(workgroupId.y) * ${a};\n\n let numTiles = ${i?`${Math.ceil(o/r)}`:"(dimInner - 1) / tileInner + 1"};\n var kStart = ${i?`i32(globalId.z) * ${o}`:"0"};\n\n var acc: array<vec4<f32>, rowPerThread>;\n\n // Loop over shared dimension.\n let tileRowB = localRow * ${f};\n for (var t = 0; t < numTiles; t = t + 1) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n let inputRow = tileRow + innerRow;\n let inputCol = tileCol;\n ${h=n,h?"\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n kStart + inputRow,\n globalRowStart / innerElementSize + inputCol);\n ":"\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n globalRow + innerRow,\n kStart / innerElementSize + inputCol);\n "}\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${f}; innerRow = innerRow + 1) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batch, kStart + inputRow, globalCol);\n }\n kStart = kStart + tileInner;\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n for (var k = 0; k < tileInner / innerElementSize; k = k + 1) {\n let BCached0 = mm_Bsub[k * innerElementSize][tileCol];\n let BCached1 = mm_Bsub[k * innerElementSize + 1][tileCol];\n let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol];\n ${3===d?"":"let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];"}\n\n ${((e,t)=>e?`\n let ACached0 = mm_Asub[k * innerElementSize][localRow];\n let ACached1 = mm_Asub[k * innerElementSize + 1][localRow];\n let ACached2 = mm_Asub[k * innerElementSize + 2][localRow];\n ${3===t?"":"let ACached3 = mm_Asub[k * innerElementSize + 3][localRow];"}\n for (var i = 0; i < rowPerThread; i = i + 1) {\n acc[i] = BCached0 * ACached0[i] + acc[i];\n acc[i] = BCached1 * ACached1[i] + acc[i];\n acc[i] = BCached2 * ACached2[i] + acc[i];\n ${3===t?"":"acc[i] = BCached3 * ACached3[i] + acc[i];"}\n }`:`\n for (var i = 0; i < rowPerThread; i = i + 1) {\n let ACached = mm_Asub[tileRow + i][k];\n acc[i] = BCached0 * ACached.x + acc[i];\n acc[i] = BCached1 * ACached.y + acc[i];\n acc[i] = BCached2 * ACached.z + acc[i];\n ${3===t?"":"acc[i] = BCached3 * ACached.w + acc[i];"}\n }`)(n,d)}\n }\n\n workgroupBarrier();\n }\n\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]);\n }\n}`;var h};const n=e=>e?"\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n kStart + inputRow,\n globalRowStart + inputCol);\n ":"\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n globalRowStart + inputRow,\n kStart + inputCol);\n ";t.makeMatMulPackedSource=(e,t,r=!1,i=32,o=!1,s=32,a=!1)=>{const u=e[1]*t[1],c=e[0]*t[0],l=r?u:i,d=r?i:u;if(d%t[1]!=0||l%t[0]!=0||i%t[1]!=0)throw new Error(`tileAHight ${d} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${l} must be divisible by workgroupSize[0]${t[0]}, tileInner ${i} must be divisible by workgroupSize[1]${t[1]}`);const f=d/t[1],h=l/t[0],p=i/t[1],g=a?`\n let localRow = i32(localId.y);\n let localCol = i32(localId.x);\n let globalRowStart = i32(workgroupId.y) * ${u};\n let globalColStart = i32(workgroupId.x) * ${c};\n\n // Loop over shared dimension.\n for (var t = 0; t < numTiles; t = t + 1) {\n // Load one tile of A into local memory.\n for (var inputRow = localRow; inputRow < ${d}; inputRow = inputRow + ${t[1]}) {\n for (var inputCol = localCol; inputCol < ${l}; inputCol = inputCol + ${t[0]}) {\n ${n(r)}\n }\n }\n // Load one tile of B into local memory.\n for (var inputRow = localRow; inputRow < ${i}; inputRow = inputRow + ${t[1]}) {\n for (var inputCol = localCol; inputCol < ${c}; inputCol = inputCol + ${t[0]}) {\n mm_Bsub[inputRow][inputCol] = mm_readB(batch,\n kStart + inputRow,\n globalColStart + inputCol);\n }\n }\n kStart = kStart + tileInner;\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array<f32, colPerThread>;\n for (var k = 0; k < tileInner; k = k + 1) {\n for (var inner = 0; inner < colPerThread; inner = inner + 1) {\n BCached[inner] = mm_Bsub[k][localCol + inner * ${t[0]}];\n }\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n let ACached = ${r?`mm_Asub[k][localRow + innerRow * ${t[1]}];`:`mm_Asub[localRow + innerRow * ${t[1]}][k];`}\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n acc[innerRow][innerCol] = acc[innerRow][innerCol] +\n ACached * BCached[innerCol];\n }\n }\n }\n workgroupBarrier();\n }\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n let gRow = globalRowStart + localRow + innerRow * ${t[1]};\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n let gCol = globalColStart + localCol + innerCol * ${t[0]};\n mm_write(batch, gRow, gCol, acc[innerRow][innerCol]);\n }\n }\n `:`\nlet tileRow = i32(localId.y) * rowPerThread;\nlet tileCol = i32(localId.x) * colPerThread;\n\nlet globalRow = i32(globalId.y) * rowPerThread;\nlet globalCol = i32(globalId.x) * colPerThread;\nlet globalRowStart = i32(workgroupId.y) * ${u};\n\nlet tileRowA = i32(localId.y) * ${f};\nlet tileColA = i32(localId.x) * ${h};\nlet tileRowB = i32(localId.y) * ${p};\n// Loop over shared dimension.\nfor (var t = 0; t < numTiles; t = t + 1) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < ${f}; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < ${h}; innerCol = innerCol + 1) {\n let inputRow = tileRowA + innerRow;\n let inputCol = tileColA + innerCol;\n ${n(r)}\n }\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${p}; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol + innerCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batch,\n kStart + inputRow,\n globalCol + innerCol);\n }\n }\n kStart = kStart + tileInner;\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array<f32, colPerThread>;\n for (var k = 0; k < tileInner; k = k + 1) {\n for (var inner = 0; inner < colPerThread; inner = inner + 1) {\n BCached[inner] = mm_Bsub[k][tileCol + inner];\n }\n\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n ${(e=>e?"let ACached = mm_Asub[k][tileRow + innerRow];":"let ACached = mm_Asub[tileRow + innerRow][k];")(r)}\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol];\n }\n }\n }\n\n workgroupBarrier();\n}\n\nfor (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n mm_write(batch, globalRow + innerRow, globalCol + innerCol,\n acc[innerRow][innerCol]);\n }\n}\n`;return`\n var<workgroup> mm_Asub : array<array<f32, ${l}>, ${d}>;\n var<workgroup> mm_Bsub : array<array<f32, ${c}>, ${i}>;\n const rowPerThread = ${e[1]};\n const colPerThread = ${e[0]};\n const tileInner = ${i};\n\n@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]})\nfn main(@builtin(local_invocation_id) localId : vec3<u32>,\n @builtin(global_invocation_id) globalId : vec3<u32>,\n @builtin(workgroup_id) workgroupId : vec3<u32>) {\n let batch = ${o?"0":"i32(globalId.z)"};\n let numTiles = ${o?`${Math.ceil(s/i)}`:"(dimInner - 1) / tileInner + 1"};\n var kStart = ${o?`i32(globalId.z) * ${s}`:"0"};\n\n var acc : array<array<f32, colPerThread>, rowPerThread>;\n\n // Without this initialization strange values show up in acc.\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n acc[innerRow][innerCol] = 0.0;\n }\n }\n ${g}\n }\n`}},504:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sub=t.pow=t.mul=t.div=t.add=void 0;const r=n(6952),i=n(1163),o=n(2075),s=(e,t,n,s,a)=>{const u={name:t,inputTypes:[i.GpuDataType.default,i.GpuDataType.default],cacheHint:a};return Object.assign(Object.assign({},u),{get:()=>((e,t,n,s,a,u=t.dataType)=>{var c,l;const d=!r.ShapeUtil.areEqual(t.dims,n.dims);let f=t.dims,h=r.ShapeUtil.size(t.dims),p=!1;if(d){const e=r.BroadcastUtil.calcShape(t.dims,n.dims,!1);if(!e)throw new Error("Can't perform binary op on the given tensors");f=e,h=r.ShapeUtil.size(f);let i=1;for(let e=0;e<f.length;e++){const r=null!==(c=t.dims[t.dims.length-e])&&void 0!==c?c:1;if(r!==(null!==(l=n.dims[n.dims.length-e])&&void 0!==l?l:1))break;i*=r}i%4==0&&(p=!0)}else p=!0;return Object.assign(Object.assign({},e),{getShaderSource:e=>((e,t,n,i,s,a,u,c,l="f32",d="f32",f="f32")=>{const h=r.ShapeUtil.size(i),p=Math.ceil(h/4);let g,m;"string"==typeof u?g=m=(e,t)=>`${u}((${e}),(${t}))`:"function"==typeof u?g=m=u:(g=u.scalar,m=u.vector);let b="";const y=(0,o.createIndicesHelper)("output",i);if(a){const e=e=>{const t=r.ShapeUtil.computeStrides(e),n=[];for(let r=e.length-1;r>=0;r--){const o=0===i.length?"0u":1===i.length?"(*outputIndices)":`(*outputIndices)[${r+i.length-e.length}]`;n.push(`${t[r]}u * (${o} % ${e[r]}u)`)}return n.length>0?n.join("+"):"0u"};b=`\n ${y.o2iImpl}\n\n fn calcOffsetA(outputIndices: ptr<function, ${y.iType}>) -> u32 {\n return ${e(t)};\n }\n\n fn calcOffsetB(outputIndices: ptr<function, ${y.iType}>) -> u32 {\n return ${e(n)};\n }\n `}let v;if(s)v=a?`\n ${y.indicesVariableDeclaration("outputIndices")}\n ${y.o2iCall("global_idx * 4u","outputIndices")}\n let offsetA = calcOffsetA(&outputIndices);\n let offsetB = calcOffsetB(&outputIndices);\n outputData[global_idx] = ${m("aData[offsetA / 4u]","bData[offsetB / 4u]")};`:`outputData[global_idx] = ${m("aData[global_idx]","bData[global_idx]")};`;else{if(!a)throw new Error("no necessary to use scalar implementation for element-wise binary op implementation.");const e=e=>{const t=`aData[indexA${e}][componentA${e}]`,n=`bData[indexB${e}][componentB${e}]`;return`\n ${y.o2iCall(`global_idx * 4u + ${e}u`,"outputIndices")}\n let offsetA${e} = calcOffsetA(&outputIndices);\n let offsetB${e} = calcOffsetB(&outputIndices);\n let indexA${e} = offsetA${e} / 4u;\n let indexB${e} = offsetB${e} / 4u;\n let componentA${e} = offsetA${e} % 4u;\n let componentB${e} = offsetB${e} % 4u;\n outputData[global_idx][${e}] = ${g(t,n)};`};v=`\n ${y.indicesVariableDeclaration("outputIndices")}\n ${e(0)}\n ${e(1)}\n ${e(2)}\n ${e(3)}`}return`\n @group(0) @binding(0) var<storage, read> aData : array<vec4<${l}>>;\n @group(0) @binding(1) var<storage, read> bData : array<vec4<${d}>>;\n @group(0) @binding(2) var<storage, read_write> outputData : array<vec4<${f}>>;\n\n ${null!=c?c:""}\n ${b}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(p)}\n ${v}\n }`})(e,t.dims,n.dims,f,p,d,s,a),outputs:[{dims:f,dataType:u,gpuDataType:i.GpuDataType.default}],dispatchGroup:()=>({x:Math.ceil(h/64/(p?4:1))})})})(u,e[0],e[1],n,s)})};t.add=e=>{e.compute(s(e.inputs,"Add",((e,t)=>`${e}+${t}`)))},t.div=e=>{e.compute(s(e.inputs,"Div",((e,t)=>`${e}/${t}`)))},t.mul=e=>{e.compute(s(e.inputs,"Mul",((e,t)=>`${e}*${t}`)))},t.pow=e=>{e.compute(s(e.inputs,"Pow",{scalar:(e,t)=>`pow_f32(${e},${t})`,vector:(e,t)=>`pow_vf32(${e},${t})`},"\n fn pow_f32(a : f32, b : f32) -> f32 {\n if (b == 0.0) {\n return 1.0;\n } else if (a < 0.0 && b != floor(b)) {\n return pow(a, b); // NaN\n }\n return select(sign(a), 1.0, round(abs(b) % 2.0) != 1.0) * pow(abs(a), b);\n }\n fn pow_vf32(a : vec4<f32>, b : vec4<f32>) -> vec4<f32> {\n // TODO: implement vectorized pow\n return vec4<f32>(pow_f32(a.x, b.x), pow_f32(a.y, b.y), pow_f32(a.z, b.z), pow_f32(a.w, b.w));\n }\n "))},t.sub=e=>{e.compute(s(e.inputs,"Sub",((e,t)=>`${e}-${t}`)))}},2075:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createShaderHelper=t.createIndicesHelper=t.WORKGROUP_SIZE=void 0;const r=n(6952);t.WORKGROUP_SIZE=64,t.createIndicesHelper=(e,t)=>{const n=t.length<2?"u32":`array<u32, ${t.length}>`,i=r.ShapeUtil.computeStrides(t);let o="";for(let e=0;e<t.length-1;e++)o+=`\n let dim${e} = current / ${i[e]}u;\n let rest${e} = current % ${i[e]}u;\n (*indices)[${e}] = dim${e};\n current = rest${e};\n `;o+=`(*indices)[${t.length-1}] = current;`;const s=t.length<2?"":`\n fn ih_o2i_${e}(offset: u32, indices: ptr<function, ${n}>) {\n var current = offset;\n ${o}\n }`,a=[];if(0===t.length)a.push("0u");else if(t.length<2)a.push("(*indices)");else for(let e=t.length-1;e>=0;e--)a.push(`${i[e]}u * ((*indices)[${e}])`);return{o2iImpl:s,o2iCall:(n,r)=>t.length<2?`${r}=${n};`:`ih_o2i_${e}(${n}, &${r});`,i2oImpl:t.length<2?"":`\n fn ih_i2o_${e}(indices: ptr<function, ${n}>) -> u32 {\n return ${a.join("+")};\n }`,i2oExpression:(n,r)=>t.length<2?`(${r?"*":""}${n})`:`ih_i2o_${e}(${r?"":"&"}${n})`,indicesVariableDeclaration:(e,t)=>`var ${e}:${n}${t?`=${n}(${t.join(",")})`:""};`,iType:n}};class i{constructor(e){this.normalizedDispatchGroup=e}guardAgainstOutOfBoundsWorkgroupSizes(e){return`if (global_idx >= ${"number"==typeof e?`${e}u`:e}) { return; }`}mainStart(e=t.WORKGROUP_SIZE){const n="number"==typeof e?e:e[0],r="number"==typeof e?1:e[1],i="number"==typeof e?1:e[2],o=1===this.normalizedDispatchGroup[1]&&1===this.normalizedDispatchGroup[2];return`@compute @workgroup_size(${n}, ${r}, ${i})\n fn main(${o?"@builtin(global_invocation_id) global_id : vec3<u32>":"@builtin(local_invocation_index) local_index : u32,\n @builtin(workgroup_id) workgroup_id : vec3<u32>"}) {\n ${o?"let global_idx = global_id.x;":`let global_idx = (workgroup_id.z * ${this.normalizedDispatchGroup[0]*this.normalizedDispatchGroup[1]}u +\n workgroup_id.y * ${this.normalizedDispatchGroup[0]}u + workgroup_id.x) * ${n*r*i}u + local_index;`}\n `}}t.createShaderHelper=e=>new i(e)},9192:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGroupedConvProgramInfoLoader=void 0;const r=n(6952),i=n(1163),o=n(2075),s=n(9770),a=n(3997);t.createGroupedConvProgramInfoLoader=(e,t,n)=>{const u=(c=e.length>2,l=t.cacheKey,{name:"GroupedConv",inputTypes:c?[i.GpuDataType.default,i.GpuDataType.default,i.GpuDataType.default]:[i.GpuDataType.default,i.GpuDataType.default],cacheHint:l});var c,l;return Object.assign(Object.assign({},u),{get:()=>((e,t,n,u)=>{const c=e.length>2,l=c?"value += b[output_channel];":"",d=e[0].dims,f=e[1].dims,h=f[0]/n.group,p="f32",{activationFunction:g,applyActivation:m}=(0,a.getActicationSnippet)(n),b=[`@group(0) @binding(0) var<storage, read> x : array<${p}>;`,`@group(0) @binding(1) var<storage, read> w : array<${p}>;`];c&&b.push(`@group(0) @binding(2) var<storage, read> b : array<${p}>;`);const y="NHWC"===n.format,v=(0,s.calculateOutputShape)(d,f,n.dilations,n.pads,n.strides,y),_=r.ShapeUtil.size(v),w=(0,o.createIndicesHelper)("output",v),x=(0,o.createIndicesHelper)("x",d),T=(0,o.createIndicesHelper)("w",f);return Object.assign(Object.assign({},t),{outputs:[{dims:u?u(v):v,dataType:e[0].dataType,gpuDataType:i.GpuDataType.default}],getShaderSource:e=>`\n const strides: vec2<u32> = vec2(${n.strides[0]}u, ${n.strides[1]}u);\n const pads: vec2<u32> = vec2(${n.pads[0]}u, ${n.pads[1]}u);\n\n ${b.join("\n")}\n @group(0) @binding(${b.length}) var<storage, read_write> output : array<${p}>;\n\n ${g}\n ${w.o2iImpl}\n ${x.i2oImpl}\n ${T.i2oImpl}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(_)}\n\n ${w.indicesVariableDeclaration("outputIndices")}\n ${w.o2iCall("global_idx","outputIndices")}\n let batch: u32 = outputIndices[0];\n let output_channel: u32 = outputIndices[${y?3:1}];\n let xRCCorner: vec2<u32> = vec2<u32>(outputIndices[${y?1:2}], outputIndices[${y?2:3}]) * strides - pads;\n let group_id: u32 = output_channel / ${h}u;\n\n var value: ${p} = ${p}(0);\n for (var wInChannel: u32 = 0u; wInChannel < ${f[1]}u; wInChannel++) {\n let input_channel = group_id * ${f[1]}u + wInChannel;\n for (var wHeight: u32 = 0u; wHeight < ${f[2]}u; wHeight++) {\n let xHeight = xRCCorner.x + wHeight * ${n.dilations[0]}u;\n\n if (xHeight < 0u || xHeight >= ${d[y?1:2]}u) {\n continue;\n }\n\n for (var wWidth: u32 = 0u; wWidth < ${f[3]}u; wWidth++) {\n let xWidth = xRCCorner.y + wWidth * ${n.dilations[1]}u;\n if (xWidth < 0u || xWidth >= ${d[y?2:3]}u) {\n continue;\n }\n\n ${x.indicesVariableDeclaration("xIndices",y?["batch","xHeight","xWidth","input_channel"]:["batch","input_channel","xHeight","xWidth"])}\n let xVal = x[${x.i2oExpression("xIndices")}];\n ${T.indicesVariableDeclaration("wIndices",["output_channel","wInChannel","wHeight","wWidth"])}\n let wVal = w[${T.i2oExpression("wIndices")}];\n value += xVal*wVal;\n }\n }\n }\n ${l}\n ${m}\n output[global_idx] = value;\n }`,dispatchGroup:()=>({x:Math.ceil(_/64)})})})(e,u,t,n)})}},9770:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conv=t.parseConvAttributes=t.calculateOutputShape=void 0;const r=n(6952),i=n(387),o=n(9192),s=n(3822),a=n(3997),u=n(2625);t.calculateOutputShape=(e,t,n,r,i,o)=>{const s=e[0],a=e.slice(o?1:2,o?3:4),u=a.length,c=t[0],l=t.slice(2).map(((e,t)=>e+(e-1)*(n[t]-1))),d=a.map(((e,t)=>e+r[t]+r[t+u])).map(((e,t)=>Math.floor((e-l[t]+i[t])/i[t])));return d.splice(0,0,s),d.splice(o?3:1,0,c),d};const c=(0,i.createAttributeWithCacheKey)({perm:[2,3,1,0]}),l=(e,t)=>{const n=e.kernelShape.slice();for(let e=2;e<t[1].dims.length;++e)0===n[e-2]&&(n[e-2]=t[1].dims[e]);const i=e.pads.slice();r.PoolConvUtil.adjustPadsBasedOnAutoPad(t[0].dims,e.strides,e.dilations,n,i,"NHWC"===e.format,e.autoPad);const o=Object.assign({},e);return Object.assign(o,{kernelShape:n,pads:i,cacheKey:e.cacheKey}),o};t.parseConvAttributes=e=>{const t=(0,a.parseInternalActivationAttributes)(e),n=e.format,r=["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][e.auto_pad],o=e.dilations,s=e.group,u=e.kernel_shape,c=e.pads,l=e.strides,d=e.w_is_const();return(0,i.createAttributeWithCacheKey)(Object.assign({autoPad:r,format:n,dilations:o,group:s,kernelShape:u,pads:c,strides:l,wIsConst:d},t))},t.conv=(e,n)=>{((e,t)=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==e[0].dims.length&&3!==e[0].dims.length)throw new Error("currently only support conv 1D and 2D");if(e[0].dims.length!==e[1].dims.length)throw new Error("filter does not have same dimension as input");if(e[0].dims["NHWC"===t.format?e[0].dims.length-1:1]!==e[1].dims[1]*t.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(3===e.length&&(1!==e[2].dims.length||e[1].dims[0]!==e[2].dims[0]))throw new Error("invalid bias");const n=e[0].dims.length-2;if(t.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(t.strides.length!==n)throw new Error(`strides should be ${n}D`);if(t.pads.length!==2*n)throw new Error(`pads should be ${2*n}D`);if(0!==t.kernelShape.length&&t.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if(1!==e[0].dataType||1!==e[1].dataType)throw new Error("Conv input(X,W) should be float tensor");if(3===e.length&&1!==e[2].dataType)throw new Error("Conv input(bias) should be float tensor")})(e.inputs,n),3===e.inputs[0].dims.length?((e,t)=>{const n="NHWC"===t.format,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];3===e.inputs.length&&r.push(e.inputs[2]);const i=[0,t.pads[0],0,t.pads[1]],s=[1].concat(t.strides),a=[1].concat(t.dilations),u=[1].concat(t.kernelShape),c=l(Object.assign(Object.assign({},t),{pads:i,strides:s,dilations:a,kernelShape:u}),r);e.compute((0,o.createGroupedConvProgramInfoLoader)(r,c,(e=>n?[e[0],e[2],e[3]]:[])))})(e,n):((e,n,r)=>{var i;const a=l(r,n),d=3===n.length,f="NHWC"===r.format,h=n[0].dims[f?1:2],p=n[0].dims[f?2:3],g=n[0].dims[f?3:1],m=n[1].dims[2],b=n[1].dims[3],y=(0,t.calculateOutputShape)(n[0].dims,n[1].dims,r.dilations,a.pads,r.strides,f),v=y[f?1:2],_=y[f?2:3],w=y[f?3:1];if(f&&m===h&&b===p&&"VALID"===r.autoPad||1===m&&1===b&&1===r.dilations[0]&&1===r.dilations[1]&&1===r.strides[0]&&1===r.strides[1]&&("SAME_UPPER"===r.autoPad||"SAME_LOWER"===r.autoPad||"VALID"===r.autoPad))return void e.compute((0,o.createGroupedConvProgramInfoLoader)(n,a));if(!f||1!==r.group)return void e.compute((0,o.createGroupedConvProgramInfoLoader)(n,a));const x=f?v*_:w,T=f?w:v*_,S=m*b*g,O=null!==(i=e.customData.wT)&&void 0!==i?i:e.compute(Object.assign(Object.assign({},u.transposeProgramMetadata),{cacheHint:c.cacheKey,get:()=>(0,u.createTransposeProgramInfo)(n[1],c.perm)}),{inputs:[1],outputs:[r.wIsConst?-2:-1]})[0];r.wIsConst&&!e.customData.wT&&(e.customData.wT=O);const E=[n[0],O];d&&(f||1!==n[2].dims.length?E.push(n[2]):E.push(n[2].reshape([n[2].dims[0],1,1]))),e.compute((0,s.createConv2DMatMulProgramInfoLoader)(E,a,y,x,T,S,d,!0),{inputs:E})})(e,e.inputs,n)}},3822:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConv2DMatMulProgramInfoLoader=void 0;const r=n(1163),i=n(9456);t.createConv2DMatMulProgramInfoLoader=(e,t,n,o,s,a,u,c)=>{const l=((e,t)=>({name:"Conv2DMatMul",inputTypes:e?[r.GpuDataType.default,r.GpuDataType.default,r.GpuDataType.default]:[r.GpuDataType.default,r.GpuDataType.default],cacheHint:t}))(u,t.cacheKey);return Object.assign(Object.assign({},l),{get:()=>(0,i.createConv2DMatMulProgramInfo)(e,l,t,n,o,s,a,u,c)})}},3997:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseInternalActivationAttributes=t.getActicationSnippet=void 0;const r=n(6952);t.getActicationSnippet=e=>{switch(e.activation){case"Relu":return{activationFunction:"",applyActivation:"value = max(value, 0.0);"};case"Sigmoid":return{activationFunction:"",applyActivation:"value = (1.0 / (1.0 + exp(-value)));"};case"Clip":return{activationFunction:`const clip_min_=f32(${e.clipMin});const clip_max_=f32(${e.clipMax});`,applyActivation:"value = clamp(value, clip_min_, clip_max_);"};default:return{activationFunction:"",applyActivation:""}}},t.parseInternalActivationAttributes=e=>{const t=(null==e?void 0:e.activation)||"";if("Clip"===t){const[n,i]=(null==e?void 0:e.activation_params)||[r.MIN_CLIP,r.MAX_CLIP];return{activation:t,clipMax:i,clipMin:n,activationCacheKey:`${t}:${n},${i}`}}return{activation:t,activationCacheKey:t}}},4271:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseGemmAttributes=t.gemm=void 0;const r=n(6952),i=n(387),o=n(1163);t.gemm=(e,t)=>{(e=>{if(!e)throw new Error("Input is missing");if(e.length<2||e.length>3)throw new Error("Invaid input number.");if(3===e.length&&e[2].dims.length>2)throw new Error("Invalid input shape of C");if(1!==e[0].dataType||1!==e[1].dataType||3===e.length&&1!==e[2].dataType)throw new Error("Invalid input type.");if(e[0].dataType!==e[1].dataType||3===e.length&&e[0].dataType!==e[2].dataType)throw new Error("Input types are mismatched")})(e.inputs),e.compute(((e,t)=>{const n={name:"Gemm",inputTypes:3===e.length?[o.GpuDataType.default,o.GpuDataType.default,o.GpuDataType.default]:[o.GpuDataType.default,o.GpuDataType.default],cacheHint:t.cacheKey};return Object.assign(Object.assign({},n),{get:()=>((e,t,n)=>{const i=t[0].dims.slice(),s=t[1].dims.slice(),[a,u,c]=r.GemmUtil.getShapeOfGemmResult(i,n.transA,s,n.transB,3===t.length?t[2].dims:void 0),l=[a,u];if(!l)throw new Error("Can't use gemm on the given tensors");const d=r.ShapeUtil.size(l);let f="";n.transA&&n.transB?f="value += a[k * M + m] * b[n * K + k];":n.transA&&!n.transB?f="value += a[k * M + m] * b[k * N + n];":!n.transA&&n.transB?f="value += a[m * K + k] * b[n * K + k];":n.transA||n.transB||(f="value += a[m * K + k] * b[k * N + n];");const h="f32",p=1===n.alpha?"":"value *= alpha;",g=3===t.length?`value += beta * c[${((e,t,n)=>{if(0===n.length)return"0u";const r=1===n.length&&1!==e||2===n.length&&n[0]!==e,i=n[n.length-1]!==t;let o="0u";return r||(o+=`+ m * ${n[n.length-1]}u`),i||(o+="+n"),o})(a,u,t[2].dims)}];`:"",m=[`@group(0) @binding(0) var<storage, read> a : array<${h}>;`,`@group(0) @binding(1) var<storage, read> b : array<${h}>;`];return 3===t.length&&m.push(`@group(0) @binding(2) var<storage, read> c : array<${h}>;`),Object.assign(Object.assign({},e),{outputs:[{dims:l,dataType:t[0].dataType,gpuDataType:o.GpuDataType.default}],getShaderSource:e=>`\n const M: u32 = ${a}u;\n const N: u32 = ${u}u;\n const K: u32 = ${c}u;\n const alpha = ${h}(${n.alpha});\n const beta = ${h}(${n.beta});\n\n ${m.join("\n")}\n @group(0) @binding(${t.length}) var<storage, read_write> output : array<${h}>;\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(d)}\n\n let m = global_id.x / N;\n let n = global_id.x % N;\n\n var value = ${h}(0);\n for (var k: u32 = 0u; k<${c}u; k++) {\n ${f}\n }\n\n ${p}\n ${g}\n output[global_id.x] = value;\n\n }`,dispatchGroup:()=>({x:Math.ceil(d/64)})})})(n,e,t)})})(e.inputs,t))},t.parseGemmAttributes=e=>(0,i.createAttributeWithCacheKey)(e)},1522:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matMul=t.createMatmulProgramInfoLoader=void 0;const r=n(6952),i=n(1163),o=n(3997);t.createMatmulProgramInfoLoader=(e,t)=>{const n=(s=e.length>2,a=t.activationCacheKey,{name:"MatMul",inputTypes:s?[i.GpuDataType.default,i.GpuDataType.default,i.GpuDataType.default]:[i.GpuDataType.default,i.GpuDataType.default],cacheHint:a});var s,a;return Object.assign(Object.assign({},n),{get:()=>((e,t,n)=>{const s=t[0].dims,a=t[1].dims,u=r.BroadcastUtil.calcShape(s,a,!0);if(!u)throw new Error("Can't use matmul on the given tensors");const c=r.ShapeUtil.size(u),l="f32",{activationFunction:d,applyActivation:f}=(0,o.getActicationSnippet)(n),h=u[u.length-2],p=s[s.length-1],g=u[u.length-1];return Object.assign(Object.assign({},e),{outputs:[{dims:u,dataType:t[0].dataType,gpuDataType:i.GpuDataType.default}],getShaderSource:e=>`\n const M: u32 = ${h}u;\n const N: u32 = ${g}u;\n const K: u32 = ${p}u;\n\n @group(0) @binding(0) var<storage, read> a : array<${l}>;\n @group(0) @binding(1) var<storage, read> b : array<${l}>;\n @group(0) @binding(2) var<storage, read_write> output : array<${l}>;\n\n ${d}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(c)}\n\n let stack = global_idx / (M * N);\n let mn = global_idx % (M * N);\n let n = global_idx % N;\n let m = mn / N;\n\n let offsetA = stack * (M * K);\n let offsetB = stack * (K * N);\n\n var value = ${l}(0);\n for (var k: u32 = 0u; k<${p}u; k++) {\n value += a[offsetA + m * K + k] * b[offsetB + k * N + n];\n }\n ${f}\n output[global_idx] = value;\n }`,dispatchGroup:()=>({x:Math.ceil(c/64)})})})(n,e,t)})},t.matMul=e=>{(e=>{if(!e||2!==e.length)throw new Error("MatMul requires 2 inputs.");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error("shared dimension does not match.");if(1!==e[0].dataType||1!==e[1].dataType)throw new Error("inputs should be float type")})(e.inputs),e.compute((0,t.createMatmulProgramInfoLoader)(e.inputs,{activation:"",activationCacheKey:""}))}},5262:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalMaxPool=t.parseGlobalMaxPoolAttributes=t.parseMaxPoolAttributes=t.maxPool=t.globalAveragePool=t.parseGlobalAveragePoolAttributes=t.averagePool=t.parseAveragePoolAttributes=void 0;const r=n(6952),i=n(387),o=n(1163),s=n(2075),a=e=>{if(!e||1!==e.length)throw new Error("Pool ops requires 1 input.");if(4!==e[0].dims.length)throw new Error("Pool ops supports 2-D inputs only for now.");if(1!==e[0].dataType)throw new Error("Invalid input type.")},u=(e,t,n)=>{const i="NHWC"===t.format,o=i?[e[0].dims[0],e[0].dims[3],e[0].dims[1],e[0].dims[2]]:e[0].dims.slice(),s=Object.hasOwnProperty.call(t,"dilations"),a=t.kernelShape.slice(),u=t.strides.slice(),c=s?t.dilations.slice():[],l=t.pads.slice();r.PoolConvUtil.adjustPoolAttributes(n,o,a,u,c,l);const d=r.PoolConvUtil.computePoolOutputShape(n,o,u,c,a,l,t.autoPad),f=Object.assign({},t);return s?Object.assign(f,{kernelShape:a,strides:u,pads:l,dilations:c,cacheKey:t.cacheKey}):Object.assign(f,{kernelShape:a,strides:u,pads:l,cacheKey:t.cacheKey}),[f,i?[d[0],d[2],d[3],d[1]]:d]},c=(e,t,n,i,o,a,u,c)=>{const l="NHWC"===i.format,d=t.length,f=r.ShapeUtil.size(n),h=(0,s.createIndicesHelper)("output",n),p=(0,s.createIndicesHelper)("x",t);if(i.kernelShape.length<=2){const n=i.kernelShape[i.kernelShape.length-1],r=i.strides[i.strides.length-1],s=i.pads[i.pads.length/2-1],g=d-(l?2:1);let m="",b="",y="";if(m=s+i.pads[i.pads.length-1]!==0?`\n for (var i: u32 = 0u; i < ${n}u; i++) {\n xIndices[${g}] = indices[${g}] * ${r} - ${s} + i;\n if (xIndices[${g}] < 0 || xIndices[${g}] >= ${t[g]}) {\n pad++;\n continue;\n }\n let x_val = x[${p.i2oExpression("xIndices")}];\n ${o}\n }`:`\n for (var i: u32 = 0u; i < ${n}u; i++) {\n xIndices[${g}] = indices[${g}] * ${r} - ${s} + i;\n let x_val = x[${p.i2oExpression("xIndices")}];\n ${o}\n }`,2===i.kernelShape.length){const e=i.kernelShape[i.kernelShape.length-2],r=i.strides[i.strides.length-2],o=i.pads[i.pads.length/2-2],s=i.pads[i.pads.length-2],a=d-(l?3:2),u=t[a];b=o+s!==0?`\n for (var j: u32 = 0u; j < ${e}u; j++) {\n xIndices[${a}] = indices[${a}] * ${r} - ${o} + j;\n if (xIndices[${a}] < 0 || xIndices[${a}] >= ${u}) {\n pad+= ${n};\n continue;\n }\n `:`\n for (var j: u32 = 0u; j < ${e}u; j++) {\n xIndices[${a}] = indices[${a}] * ${r} - ${o} + j;\n `,y="\n }\n "}return`\n @group(0) @binding(0) var<storage, read> x : array<${u}>;\n @group(0) @binding(1) var<storage, read_write> output : array<${u}>;\n\n ${h.o2iImpl}\n ${p.i2oImpl}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(f)}\n\n ${h.indicesVariableDeclaration("indices")}\n ${h.o2iCall("global_idx","indices")}\n ${h.indicesVariableDeclaration("xIndices")}\n ${h.o2iCall("global_idx","xIndices")}\n\n var value: ${u} = ${u}(${c});\n var pad = 0;\n ${b}\n ${m}\n ${y}\n ${a}\n\n output[global_idx] = value;\n }`}{if(l)throw new Error("Pooling with kernelShape.length > 2 is not supported for NHWC format.");const n=r.ShapeUtil.size(i.kernelShape),s=r.ShapeUtil.computeStrides(i.kernelShape),g=s.length,m=i.pads.length;let b="";return b=i.pads.reduce(((e,t)=>e+t))?`\n if (xIndices[j] >= inputDims[j]) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n let x_val = x[${p.i2oExpression("xIndices")}];\n ${o}\n }`:`\n }\n let x_val = x[${p.i2oExpression("xIndices")}];\n ${o}\n `,`\n @group(0) @binding(0) var<storage, read> x : array<${u}>;\n @group(0) @binding(1) var<storage, read_write> output : array<${u}>;\n\n ${h.o2iImpl}\n ${p.i2oImpl}\n\n const pads = array<u32, ${m}>(${i.pads.map((e=>`${e}u`)).join(",")});\n const inputDims = array<u32, ${d}>(${t.map((e=>`${e}u`)).join(",")});\n const kernelStrides = array<u32, ${g}>(${s.map((e=>`${e}u`)).join(",")});\n const strides = array<u32, ${g}>(${i.strides.map((e=>`${e}u`)).join(",")});\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(f)}\n\n ${h.indicesVariableDeclaration("indices")}\n ${h.o2iCall("global_idx","indices")}\n ${h.indicesVariableDeclaration("xIndices")}\n ${h.o2iCall("global_idx","xIndices")}\n\n var offsets: array<u32, ${g}>;\n\n var value = ${u}(${c});\n var pad = 0;\n var isPad = false;\n\n for (var i: u32 = 0u; i < ${n}u; i++) {\n var offset = i;\n for (var j = 0u; j < ${g-1}u; j++) {\n offsets[j] = offset / kernelStrides[j];\n offset -= offsets[j] * kernelStrides[j];\n }\n offsets[${g-1}] = offset;\n\n isPad = false;\n for (var j = ${d-g}u; j < ${d}u; j++) {\n xIndices[j] = indices[j] * strides[j - ${d-g}u]\n + offsets[j - ${d-g}u] - pads[j - 2u];\n ${b}\n }\n ${a}\n\n output[global_idx] = value;\n }`}},l=e=>({format:e.format,autoPad:["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),d=(e,t,n,i)=>{const[s,a]=u(e,i,n),l=r.ShapeUtil.size(s.kernelShape),d="f32";let f="";return s.countIncludePad?f+=`value /= ${d}(${l});`:f+=`value /= ${d}(${l} - pad);`,Object.assign(Object.assign({},t),{outputs:[{dims:a,dataType:e[0].dataType,gpuDataType:o.GpuDataType.default}],getShaderSource:t=>c(t,e[0].dims,a,s,"value += x_val;",f,d,"0.0"),dispatchGroup:()=>({x:Math.ceil(r.ShapeUtil.size(a)/64)})})};t.parseAveragePoolAttributes=e=>{const t=0!==e.count_include_pad,n=l(e);if(0!==n.ceilMode)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,i.createAttributeWithCacheKey)(Object.assign({countIncludePad:t},n))},t.averagePool=(e,t)=>{a(e.inputs);const n={name:"AveragePool",inputTypes:[o.GpuDataType.default],cacheHint:t.cacheKey};e.compute(Object.assign(Object.assign({},n),{get:()=>d(e.inputs,n,!1,t)}))};const f={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""};t.parseGlobalAveragePoolAttributes=e=>{const t=e.format;return Object.assign(Object.assign({format:t},f),{cacheKey:t})},t.globalAveragePool=(e,t)=>{a(e.inputs);const n={name:"GlobalAveragePool",inputTypes:[o.GpuDataType.default],cacheHint:t.cacheKey};e.compute(Object.assign(Object.assign({},n),{get:()=>d(e.inputs,n,!0,t)}))};const h=(e,t,n,i)=>{const[s,a]=u(e,i,n);return Object.assign(Object.assign({},t),{outputs:[{dims:a,dataType:e[0].dataType,gpuDataType:o.GpuDataType.default}],getShaderSource:t=>c(t,e[0].dims,a,s,"\n value = max(x_val, value);\n ","","f32","-1e5"),dispatchGroup:()=>({x:Math.ceil(r.ShapeUtil.size(a)/64)})})};t.maxPool=(e,t)=>{a(e.inputs);const n={name:"MaxPool",inputTypes:[o.GpuDataType.default],cacheHint:t.cacheKey};e.compute(Object.assign(Object.assign({},n),{get:()=>h(e.inputs,n,!1,t)}))},t.parseMaxPoolAttributes=e=>{const t=e.storage_order,n=e.dilations,r=l(e);if(0!==t)throw new Error("column major storage order is not yet supported for MaxPool");if(0!==r.ceilMode)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,i.createAttributeWithCacheKey)(Object.assign({storageOrder:t,dilations:n},r))},t.parseGlobalMaxPoolAttributes=e=>{const t=e.format;return Object.assign(Object.assign({format:t},f),{cacheKey:t})},t.globalMaxPool=(e,t)=>{a(e.inputs);const n={name:"GlobalMaxPool",inputTypes:[o.GpuDataType.default],cacheHint:t.cacheKey};e.compute(Object.assign(Object.assign({},n),{get:()=>h(e.inputs,n,!0,t)}))}},2625:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTransposeAttributes=t.transpose=t.createTransposeProgramInfo=t.transposeProgramMetadata=void 0;const r=n(6952),i=n(387),o=n(1163),s=n(2075);t.transposeProgramMetadata={name:"Transpose",inputTypes:[o.GpuDataType.default]};const a=(e,t)=>t&&t.length!==e.length?[...e.keys()].reverse():t;t.createTransposeProgramInfo=(e,n)=>{const i=e.dims,u=a(i,n),c=((e,t)=>r.ShapeUtil.sortBasedOnPerm(e,a(e,t)))(i,u),l=i.length,d=r.ShapeUtil.size(c),f=(0,s.createIndicesHelper)("output",c),h=(0,s.createIndicesHelper)("a",i);return Object.assign(Object.assign({},t.transposeProgramMetadata),{outputs:[{dims:c,dataType:e.dataType,gpuDataType:o.GpuDataType.default}],getShaderSource:e=>`\n @group(0) @binding(0) var<storage, read> a : array<f32>;\n @group(0) @binding(1) var<storage, read_write> output : array<f32>;\n\n ${((e,t)=>{const n=[];n.push(`fn perm(a: ptr<function, array<u32, ${t}>>, i: ptr<function, array<u32, ${t}>>) {`);for(let r=0;r<t;++r)n.push(`\t(*a)[${e[r]}]=(*i)[${r}];`);return n.push("\t}"),n.join("\n")})(u,l)}\n ${f.o2iImpl}\n ${h.i2oImpl}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(d)}\n\n ${f.indicesVariableDeclaration("indices")}\n ${f.o2iCall("global_idx","indices")}\n ${h.indicesVariableDeclaration("aIndices")}\n perm(&aIndices, &indices);\n\n output[global_idx] = a[${h.i2oExpression("aIndices")}];\n }`,dispatchGroup:()=>({x:Math.ceil(d/64)})})},t.transpose=(e,n)=>{(e=>{if(!e||1!==e.length)throw new Error("Transpose requires 1 input.");if(1!==e[0].dataType)throw new Error("input should be float tensor")})(e.inputs),e.compute(Object.assign(Object.assign({},t.transposeProgramMetadata),{cacheHint:n.cacheKey,get:()=>(0,t.createTransposeProgramInfo)(e.inputs[0],n.perm)}))},t.parseTransposeAttributes=e=>(0,i.createAttributeWithCacheKey)({perm:e.perm})},9302:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.thresholdedRelu=t.tanh=t.tan=t.sqrt=t.sinh=t.sin=t.sigmoid=t.relu=t.reciprocal=t.neg=t.leakyRelu=t.floor=t.exp=t.erf=t.elu=t.parseAlphaAttributes=t.cosh=t.cos=t.ceil=t.clip=t.clipV10=t.atanh=t.atan=t.asinh=t.asin=t.acosh=t.acos=t.abs=void 0;const r=n(6952),i=n(387),o=n(1163),s=(e,t,n,i,s)=>{const a={name:t,inputTypes:[o.GpuDataType.default],cacheHint:s};return Object.assign(Object.assign({},a),{get:()=>((e,t,n,i)=>Object.assign(Object.assign({},e),{getShaderSource:e=>((e,t,n,r)=>{const i=Math.ceil(t/4);let o="";return o="string"==typeof n?`${n}(a)`:n("a"),`\n @group(0) @binding(0) var<storage, read> inputData : array<vec4<f32>>;\n @group(0) @binding(1) var<storage, read_write> outputData : array<vec4<f32>>;\n\n ${null!=r?r:""}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(i)}\n\n let a = inputData[global_idx];\n outputData[global_idx] = ${o};\n }`})(e,r.ShapeUtil.size(t.dims),n,i),outputs:[{dims:t.dims,dataType:t.dataType,gpuDataType:o.GpuDataType.default}],dispatchGroup:e=>({x:Math.ceil(r.ShapeUtil.size(e[0].dims)/64/4)})}))(a,e,n,i)})};t.abs=e=>{e.compute(s(e.inputs[0],"Abs","abs"))},t.acos=e=>{e.compute(s(e.inputs[0],"Acos","acos"))},t.acosh=e=>{e.compute(s(e.inputs[0],"Acosh","acosh"))},t.asin=e=>{e.compute(s(e.inputs[0],"Asin","asin"))},t.asinh=e=>{e.compute(s(e.inputs[0],"Asinh","asinh"))},t.atan=e=>{e.compute(s(e.inputs[0],"Atan","atan"))},t.atanh=e=>{e.compute(s(e.inputs[0],"Atanh","atanh"))},t.clipV10=(e,t)=>{e.compute(s(e.inputs[0],"Clip",(e=>`clamp(${e}, clip_min_, clip_max_)`),`\n const clip_min_: vec4<f32> = vec4(f32(${t.min}));\n const clip_max_: vec4<f32> = vec4(f32(${t.max}));\n`,t.cacheKey),{inputs:[0]})},t.clip=e=>{const n=(e=>{const t=e.length>=2?e[1].getFloat32Array()[0]:r.MIN_CLIP,n=e.length>=3?e[2].getFloat32Array()[0]:r.MAX_CLIP;return(0,i.createAttributeWithCacheKey)({min:t,max:n})})(e.inputs);(0,t.clipV10)(e,n)},t.ceil=e=>{e.compute(s(e.inputs[0],"Ceil","ceil"))},t.cos=e=>{e.compute(s(e.inputs[0],"Cos","cos"))},t.cosh=e=>{e.compute(s(e.inputs[0],"Cosh","cosh"))},t.parseAlphaAttributes=e=>(0,i.createAttributeWithCacheKey)(e),t.elu=(e,t)=>{e.compute(s(e.inputs[0],"Elu",(e=>`elu_vf32(${e})`),`\n const elu_alpha_: f32 = f32(${t.alpha});\n\n fn elu_f32(a: f32) -> f32 {\n return select((exp(a) - 1.0) * elu_alpha_, a, a >= 0.0);\n }\n\n fn elu_vf32(v: vec4<f32>) -> vec4<f32> {\n return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w));\n }`,t.cacheKey))},t.erf=e=>{e.compute(s(e.inputs[0],"Erf",(e=>`erf_vf32(${e})`),"\n const r0: f32 = 0.3275911;\n const r1: f32 = 0.254829592;\n const r2: f32 = -0.284496736;\n const r3: f32 = 1.421413741;\n const r4: f32 = -1.453152027;\n const r5: f32 = 1.061405429;\n\n fn erf_vf32(v: vec4<f32>) -> vec4<f32> {\n let absv = abs(v);\n let x = 1.0 / (1.0 + r0 * absv);\n return sign(v) * (1.0 - ((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x * exp(-absv * absv));\n }"))},t.exp=e=>{e.compute(s(e.inputs[0],"Exp","exp"))},t.floor=e=>{e.compute(s(e.inputs[0],"Floor","floor"))},t.leakyRelu=(e,t)=>{e.compute(s(e.inputs[0],"LeakyRelu",(e=>`select(leaky_relu_alpha_ * ${e}, ${e}, ${e} >= vec4<f32>(0.0))`),`const leaky_relu_alpha_: f32 = f32(${t.alpha});`,t.cacheKey))},t.neg=e=>{e.compute(s(e.inputs[0],"Neg",(e=>`-${e}`)))},t.reciprocal=e=>{e.compute(s(e.inputs[0],"Reciprocal",(e=>`1.0/${e}`)))},t.relu=e=>{e.compute(s(e.inputs[0],"Relu",(e=>`select(vec4<f32>(0.0), ${e}, ${e} > vec4<f32>(0.0))`)))},t.sigmoid=e=>{e.compute(s(e.inputs[0],"Sigmoid",(e=>`(1.0 / (1.0 + exp(-${e})))`)))},t.sin=e=>{e.compute(s(e.inputs[0],"Sin","sin"))},t.sinh=e=>{e.compute(s(e.inputs[0],"Sinh","sinh"))},t.sqrt=e=>{e.compute(s(e.inputs[0],"Sqrt","sqrt"))},t.tan=e=>{e.compute(s(e.inputs[0],"Tan","tan"))},t.tanh=e=>{e.compute(s(e.inputs[0],"Tanh","tanh"))},t.thresholdedRelu=(e,t)=>(e.compute(s(e.inputs[0],"ThresholdedRelu",(e=>`select(vec4<f32>(0.0), ${e}, ${e} > thresholded_relu_alpha_)`),`const thresholded_relu_alpha_: vec4<f32> = vec4<f32>(${t.alpha});`,t.cacheKey)),0)},8305:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProgramManager=void 0;const r=n(4955),i=n(2075);t.ProgramManager=class{constructor(e){this.backend=e,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,n,r){const i=this.backend.device,o=this.backend.getComputePassEncoder();this.backend.profilingEnabled&&o.writeTimestamp(this.backend.profilingQuerySet,0),o.setPipeline(e.computePipeline);const s=[];for(const e of t)s.push({binding:s.length,resource:{buffer:e.buffer}});for(const e of n)s.push({binding:s.length,resource:{buffer:e.buffer}});const a=i.createBindGroup({layout:e.computePipeline.getBindGroupLayout(0),entries:s});if(o.setBindGroup(0,a),o.dispatchWorkgroups(...r),this.backend.pendingDispatchNumber++,this.backend.profilingEnabled){o.writeTimestamp(this.backend.profilingQuerySet,1);const e=this.backend.gpuDataManager.create(16,GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE),t=this.backend.gpuDataManager.create(16,GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST);this.backend.endComputePass(),this.backend.getCommandEncoder().resolveQuerySet(this.backend.profilingQuerySet,0,2,e.buffer,0),this.backend.getCommandEncoder().copyBufferToBuffer(e.buffer,0,t.buffer,0,16),this.backend.flush();const n=this.backend.currentKernelId,r=this.backend.kernels.get(n)[0];t.buffer.mapAsync(GPUMapMode.READ).then((()=>{const i=new BigUint64Array(t.buffer.getMappedRange()),o=i[0],s=i[1];t.buffer.unmap(),void 0===this.backend.profilingTimeBase&&(this.backend.profilingTimeBase=o);const a=Number(o-this.backend.profilingTimeBase),u=Number(s-this.backend.profilingTimeBase);if(!Number.isSafeInteger(a)||!Number.isSafeInteger(u))throw new RangeError("incorrect timestamp range");this.backend.gpuDataManager.release(e.id),this.backend.gpuDataManager.release(t.id),console.log(`[profiling] kernel "${n}|${r}" execution time: ${u-a} ns`)}))}this.backend.pendingDispatchNumber>=16&&this.backend.flush()}dispose(){}build(e,t){const n=this.backend.device,o=e.getShaderSource((0,i.createShaderHelper)(t)),s=n.createShaderModule({code:o});return(0,r.LOG_DEBUG)("verbose",(()=>`[WebGPU] shader code: ${o}`)),{programInfo:e,computePipeline:n.createComputePipeline({compute:{module:s,entryPoint:"main"},layout:"auto"})}}normalizeDispatchGroupSize(e){const t="number"==typeof e?e:e.x,n="number"==typeof e?1:e.y||1,r="number"==typeof e?1:e.z||1,i=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(t<=i&&n<=i&&r<=i)return[t,n,r];const o=t*n*r;let s=Math.ceil(Math.sqrt(o));if(s>i){if(s=Math.ceil(Math.cbrt(o)),s>i)throw new Error("Total dispatch size exceeds WebGPU maximum.");return[s,s,s]}return[s,s,1]}}},1163:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.GpuDataType=void 0,(n=t.GpuDataType||(t.GpuDataType={}))[n.default=0]="default",n[n.upload=1]="upload",n[n.profile=2]="profile"},3899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iterateExtraOptions=void 0,t.iterateExtraOptions=(e,n,r,i)=>{if("object"==typeof e&&null!==e){if(r.has(e))throw new Error("Circular reference in options");r.add(e)}Object.entries(e).forEach((([e,o])=>{const s=n?n+e:e;if("object"==typeof o)(0,t.iterateExtraOptions)(o,s+".",r,i);else if("string"==typeof o||"number"==typeof o)i(s,o.toString());else{if("boolean"!=typeof o)throw new Error("Can't handle extra config type: "+typeof o);i(s,o?"1":"0")}}))}},9544:function(e,t,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.endProfiling=t.run=t.releaseSession=t.createSession=t.createSessionFinalize=t.createSessionAllocate=t.initOrt=t.initWasm=void 0;const a=n(8453),u=n(7675),c=s(n(1259)),l=n(263),d=()=>!!a.env.wasm.proxy&&"undefined"!=typeof document;let f,h,p,g=!1,m=!1,b=!1;const y=[],v=[],_=[],w=[],x=[],T=[],S=()=>{if(g||!m||b||!f)throw new Error("worker not ready")},O=e=>{switch(e.data.type){case"init-wasm":g=!1,e.data.err?(b=!0,h[1](e.data.err)):(m=!0,h[0]());break;case"init-ort":e.data.err?p[1](e.data.err):p[0]();break;case"create_allocate":e.data.err?y.shift()[1](e.data.err):y.shift()[0](e.data.out);break;case"create_finalize":e.data.err?v.shift()[1](e.data.err):v.shift()[0](e.data.out);break;case"create":e.data.err?_.shift()[1](e.data.err):_.shift()[0](e.data.out);break;case"release":e.data.err?w.shift()[1](e.data.err):w.shift()[0]();break;case"run":e.data.err?x.shift()[1](e.data.err):x.shift()[0](e.data.out);break;case"end-profiling":e.data.err?T.shift()[1](e.data.err):T.shift()[0]()}},E="undefined"!=typeof document?null===(r=null===document||void 0===document?void 0:document.currentScript)||void 0===r?void 0:r.src:void 0;t.initWasm=async()=>{if(d()){if(m)return;if(g)throw new Error("multiple calls to 'initWasm()' detected.");if(b)throw new Error("previous call to 'initWasm()' failed.");return g=!0,void 0===a.env.wasm.wasmPaths&&E&&0!==E.indexOf("blob:")&&(a.env.wasm.wasmPaths=E.substr(0,+E.lastIndexOf("/")+1)),new Promise(((e,t)=>{null==f||f.terminate(),f=n(8050).Z(),f.onmessage=O,h=[e,t];const r={type:"init-wasm",in:a.env.wasm};f.postMessage(r)}))}return(0,l.initializeWebAssembly)(a.env.wasm)},t.initOrt=async(e,t)=>{if(d())return S(),new Promise(((n,r)=>{p=[n,r];const i={type:"init-ort",in:{numThreads:e,loggingLevel:t}};f.postMessage(i)}));c.initOrt(e,t),await(0,u.init)((0,l.getInstance)())},t.createSessionAllocate=async e=>d()?(S(),new Promise(((t,n)=>{y.push([t,n]);const r={type:"create_allocate",in:{model:e}};f.postMessage(r,[e.buffer])}))):c.createSessionAllocate(e),t.createSessionFinalize=async(e,t)=>d()?(S(),new Promise(((n,r)=>{v.push([n,r]);const i={type:"create_finalize",in:{modeldata:e,options:t}};f.postMessage(i)}))):c.createSessionFinalize(e,t),t.createSession=async(e,t)=>d()?(S(),new Promise(((n,r)=>{_.push([n,r]);const i={type:"create",in:{model:e,options:t}};f.postMessage(i,[e.buffer])}))):c.createSession(e,t),t.releaseSession=async e=>{if(d())return S(),new Promise(((t,n)=>{w.push([t,n]);const r={type:"release",in:e};f.postMessage(r)}));c.releaseSession(e)},t.run=async(e,t,n,r,i)=>d()?(S(),new Promise(((o,s)=>{x.push([o,s]);const a={type:"run",in:{sessionId:e,inputIndices:t,inputs:n,outputIndices:r,options:i}};f.postMessage(a,c.extractTransferableBuffers(n))}))):c.run(e,t,n,r,i),t.endProfiling=async e=>{if(d())return S(),new Promise(((t,n)=>{T.push([t,n]);const r={type:"end-profiling",in:e};f.postMessage(r)}));c.endProfiling(e)}},7918:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setRunOptions=void 0;const r=n(3899),i=n(9444),o=n(263);t.setRunOptions=e=>{const t=(0,o.getInstance)();let n=0;const s=[],a=e||{};try{if(void 0===(null==e?void 0:e.logSeverityLevel))a.logSeverityLevel=2;else if("number"!=typeof e.logSeverityLevel||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(void 0===(null==e?void 0:e.logVerbosityLevel))a.logVerbosityLevel=0;else if("number"!=typeof e.logVerbosityLevel||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);void 0===(null==e?void 0:e.terminate)&&(a.terminate=!1);let o=0;if(void 0!==(null==e?void 0:e.tag)&&(o=(0,i.allocWasmString)(e.tag,s)),n=t._OrtCreateRunOptions(a.logSeverityLevel,a.logVerbosityLevel,!!a.terminate,o),0===n)throw new Error("Can't create run options");return void 0!==(null==e?void 0:e.extra)&&(0,r.iterateExtraOptions)(e.extra,"",new WeakSet,((e,r)=>{const o=(0,i.allocWasmString)(e,s),a=(0,i.allocWasmString)(r,s);if(0!==t._OrtAddRunConfigEntry(n,o,a))throw new Error(`Can't set a run config entry: ${e} - ${r}`)})),[n,s]}catch(e){throw 0!==n&&t._OrtReleaseRunOptions(n),s.forEach(t._free),e}}},6640:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OnnxruntimeWebAssemblySessionHandler=void 0;const r=n(2806),i=n(8453),o=n(2850),s=n(9544),a=n(7917);let u;t.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(e){const t=await fetch(e),n=await t.arrayBuffer();return(0,s.createSessionAllocate)(new Uint8Array(n))}async loadModel(e,t){if(u||(await(0,s.initOrt)(i.env.wasm.numThreads,(0,a.logLevelStringToEnum)(i.env.logLevel)),u=!0),"string"==typeof e)if("undefined"==typeof fetch){const n=await(0,o.promisify)(r.readFile)(e);[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSession)(n,t)}else{const n=await this.createSessionAllocate(e);[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSessionFinalize)(n,t)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSession)(e,t)}async dispose(){return(0,s.releaseSession)(this.sessionId)}async run(e,t,n){const r=[],o=[];Object.entries(e).forEach((e=>{const t=e[0],n=e[1],i=this.inputNames.indexOf(t);if(-1===i)throw new Error(`invalid input '${t}'`);r.push(n),o.push(i)}));const a=[];Object.entries(t).forEach((e=>{const t=e[0],n=this.outputNames.indexOf(t);if(-1===n)throw new Error(`invalid output '${t}'`);a.push(n)}));const u=await(0,s.run)(this.sessionId,o,r.map((e=>[e.type,e.dims,e.data])),a,n),c={};for(let e=0;e<u.length;e++)c[this.outputNames[a[e]]]=new i.Tensor(u[e][0],u[e][2],u[e][1]);return c}startProfiling(){}endProfiling(){(0,s.endProfiling)(this.sessionId)}}},7622:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSessionOptions=void 0;const r=n(3899),i=n(9444),o=n(263);t.setSessionOptions=e=>{var t,n,s,a;const u=(0,o.getInstance)();let c=0;const l=[],d=e||{};(e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});const t=e.extra.session;t.use_ort_model_bytes_directly||(t.use_ort_model_bytes_directly="1"),e.executionProviders&&e.executionProviders.some((e=>"webgpu"===("string"==typeof e?e:e.name)))&&(e.enableMemPattern=!1)})(d);try{const e=(e=>{switch(e){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}})(null!==(t=d.graphOptimizationLevel)&&void 0!==t?t:"all"),f=(e=>{switch(e){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}})(null!==(n=d.executionMode)&&void 0!==n?n:"sequential"),h="string"==typeof d.logId?(0,i.allocWasmString)(d.logId,l):0,p=null!==(s=d.logSeverityLevel)&&void 0!==s?s:2;if(!Number.isInteger(p)||p<0||p>4)throw new Error(`log serverity level is not valid: ${p}`);const g=null!==(a=d.logVerbosityLevel)&&void 0!==a?a:0;if(!Number.isInteger(g)||g<0||g>4)throw new Error(`log verbosity level is not valid: ${g}`);const m="string"==typeof d.optimizedModelFilePath?(0,i.allocWasmString)(d.optimizedModelFilePath,l):0;if(c=u._OrtCreateSessionOptions(e,!!d.enableCpuMemArena,!!d.enableMemPattern,f,!!d.enableProfiling,0,h,p,g,m),0===c)throw new Error("Can't create session options");return d.executionProviders&&((e,t,n)=>{for(const r of t){let t="string"==typeof r?r:r.name;switch(t){case"xnnpack":t="XNNPACK";break;case"webgpu":t="JS";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${t}`)}const s=(0,i.allocWasmString)(t,n);if(0!==(0,o.getInstance)()._OrtAppendExecutionProvider(e,s))throw new Error(`Can't append execution provider: ${t}`)}})(c,d.executionProviders,l),void 0!==d.extra&&(0,r.iterateExtraOptions)(d.extra,"",new WeakSet,((e,t)=>{const n=(0,i.allocWasmString)(e,l),r=(0,i.allocWasmString)(t,l);if(0!==u._OrtAddSessionConfigEntry(c,n,r))throw new Error(`Can't set a session config entry: ${e} - ${t}`)})),[c,l]}catch(e){throw 0!==c&&u._OrtReleaseSessionOptions(c),l.forEach(u._free),e}}},9444:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.allocWasmString=void 0;const r=n(263);t.allocWasmString=(e,t)=>{const n=(0,r.getInstance)(),i=n.lengthBytesUTF8(e)+1,o=n._malloc(i);return n.stringToUTF8(e,o,i),t.push(o),o}},7917:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logLevelStringToEnum=t.tensorTypeToTypedArrayConstructor=t.getTensorElementSize=t.tensorDataTypeEnumToString=t.tensorDataTypeStringToEnum=void 0,t.tensorDataTypeStringToEnum=e=>{switch(e){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${e}`)}},t.tensorDataTypeEnumToString=e=>{switch(e){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${e}`)}},t.getTensorElementSize=e=>[void 0,4,1,1,2,2,4,8,void 0,1,2,8,4,8,void 0,void 0,void 0][e],t.tensorTypeToTypedArrayConstructor=e=>{switch(e){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${e}`)}},t.logLevelStringToEnum=e=>{switch(e){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${e}`)}}},1259:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractTransferableBuffers=t.endProfiling=t.run=t.releaseSession=t.createSession=t.createSessionFinalize=t.createSessionAllocate=t.initOrt=void 0;const r=n(7918),i=n(7622),o=n(9444),s=n(7917),a=n(263);t.initOrt=(e,t)=>{const n=(0,a.getInstance)()._OrtInit(e,t);if(0!==n)throw new Error(`Can't initialize onnxruntime. error code = ${n}`)};const u=new Map;t.createSessionAllocate=e=>{const t=(0,a.getInstance)(),n=t._malloc(e.byteLength);return t.HEAPU8.set(e,n),[n,e.byteLength]},t.createSessionFinalize=(e,t)=>{const n=(0,a.getInstance)();let r=0,o=0,s=[];try{if([o,s]=(0,i.setSessionOptions)(t),r=n._OrtCreateSession(e[0],e[1],o),0===r)throw new Error("Can't create a session")}finally{n._free(e[0]),0!==o&&n._OrtReleaseSessionOptions(o),s.forEach(n._free)}const c=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),d=[],f=[],h=[],p=[];for(let e=0;e<c;e++){const t=n._OrtGetInputName(r,e);if(0===t)throw new Error("Can't get an input name");f.push(t),d.push(n.UTF8ToString(t))}for(let e=0;e<l;e++){const t=n._OrtGetOutputName(r,e);if(0===t)throw new Error("Can't get an output name");p.push(t),h.push(n.UTF8ToString(t))}return u.set(r,[r,f,p]),[r,d,h]},t.createSession=(e,n)=>{const r=(0,t.createSessionAllocate)(e);return(0,t.createSessionFinalize)(r,n)},t.releaseSession=e=>{const t=(0,a.getInstance)(),n=u.get(e);if(!n)throw new Error("invalid session id");const r=n[0],i=n[1],o=n[2];i.forEach(t._OrtFree),o.forEach(t._OrtFree),t._OrtReleaseSession(r),u.delete(e)},t.run=async(e,t,n,i,c)=>{const l=(0,a.getInstance)(),d=u.get(e);if(!d)throw new Error("invalid session id");const f=d[0],h=d[1],p=d[2],g=t.length,m=i.length;let b=0,y=[];const v=[],_=[];try{[b,y]=(0,r.setRunOptions)(c);for(let e=0;e<g;e++){const t=n[e][0],r=n[e][1],i=n[e][2];let a,u;if(Array.isArray(i)){u=4*i.length,a=l._malloc(u),_.push(a);let e=a/4;for(let t=0;t<i.length;t++){if("string"!=typeof i[t])throw new TypeError(`tensor data at index ${t} is not a string`);l.HEAPU32[e++]=(0,o.allocWasmString)(i[t],_)}}else u=i.byteLength,a=l._malloc(u),_.push(a),l.HEAPU8.set(new Uint8Array(i.buffer,i.byteOffset,u),a);const c=l.stackSave(),d=l.stackAlloc(4*r.length);try{let e=d/4;r.forEach((t=>l.HEAP32[e++]=t));const n=l._OrtCreateTensor((0,s.tensorDataTypeStringToEnum)(t),a,u,d,r.length);if(0===n)throw new Error("Can't create a tensor");v.push(n)}finally{l.stackRestore(c)}}const e=l.stackSave(),a=l.stackAlloc(4*g),u=l.stackAlloc(4*g),d=l.stackAlloc(4*m),w=l.stackAlloc(4*m);try{let e=a/4,n=u/4,r=d/4,o=w/4;for(let r=0;r<g;r++)l.HEAPU32[e++]=v[r],l.HEAPU32[n++]=h[t[r]];for(let e=0;e<m;e++)l.HEAPU32[r++]=0,l.HEAPU32[o++]=p[i[e]];let c=l._OrtRun(f,u,a,g,w,m,d,b);const y=l.jsepRunPromise;y&&void 0!==y.then&&(c=await y);const _=[];if(0===c)for(let e=0;e<m;e++){const t=l.HEAPU32[d/4+e],n=l.stackSave(),r=l.stackAlloc(16);let i,o=0;try{if(c=l._OrtGetTensorData(t,r,r+4,r+8,r+12),0!==c)throw new Error(`Can't access output tensor data. error code = ${c}`);let e=r/4;const n=l.HEAPU32[e++];o=l.HEAPU32[e++];const a=l.HEAPU32[e++],u=l.HEAPU32[e++],d=[];for(let e=0;e<u;e++)d.push(l.HEAPU32[a/4+e]);l._OrtFree(a);const f=0===d.length?1:d.reduce(((e,t)=>e*t));if(i=(0,s.tensorDataTypeEnumToString)(n),"string"===i){const e=[];let t=o/4;for(let n=0;n<f;n++){const r=l.HEAPU32[t++],i=n===f-1?void 0:l.HEAPU32[t]-r;e.push(l.UTF8ToString(r,i))}_.push([i,d,e])}else{const e=new((0,s.tensorTypeToTypedArrayConstructor)(i))(f);new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(l.HEAPU8.subarray(o,o+e.byteLength)),_.push([i,d,e])}}finally{l.stackRestore(n),"string"===i&&o&&l._free(o),l._OrtReleaseTensor(t)}}if(0===c)return _;throw new Error(`failed to call OrtRun(). error code = ${c}.`)}finally{l.stackRestore(e)}}finally{v.forEach(l._OrtReleaseTensor),_.forEach(l._free),l._OrtReleaseRunOptions(b),y.forEach(l._free)}},t.endProfiling=e=>{const t=(0,a.getInstance)(),n=u.get(e);if(!n)throw new Error("invalid session id");const r=n[0],i=t._OrtEndProfiling(r);if(0===i)throw new Error("Can't get an profile file name");t._OrtFree(i)},t.extractTransferableBuffers=e=>{const t=[];for(const n of e){const e=n[2];!Array.isArray(e)&&e.buffer&&t.push(e.buffer)}return t}},263:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.dispose=t.getInstance=t.initializeWebAssembly=void 0;const s=o(n(6449)),a=n(932),u=n(3474);let c,l=!1,d=!1,f=!1;t.initializeWebAssembly=async e=>{if(l)return Promise.resolve();if(d)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(f)throw new Error("previous call to 'initializeWebAssembly()' failed.");d=!0;const t=e.initTimeout,r=e.numThreads,i=e.simd,o=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(e){return!1}})(),h=i&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(e){return!1}})(),p=e.wasmPaths,g="string"==typeof p?p:void 0,m=((e,t)=>t?e?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":e?"ort-wasm-simd.wasm":"ort-wasm.wasm")(h,o),b="object"==typeof p?p[m]:void 0;let y=!1;const v=[];if(t>0&&v.push(new Promise((e=>{setTimeout((()=>{y=!0,e()}),t)}))),v.push(new Promise(((e,t)=>{const r=o?u:a,i={locateFile:(e,t)=>o&&e.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(4154)],{type:"text/javascript"})):e.endsWith(".wasm")?b||(null!=g?g:t)+m:t+e};if(o)if("undefined"==typeof Blob)i.mainScriptUrlOrBlob=s.join("/","ort-wasm-threaded.js");else{const e=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;i.mainScriptUrlOrBlob=new Blob([e],{type:"text/javascript"})}r(i).then((t=>{d=!1,l=!0,c=t,e()}),(e=>{d=!1,f=!0,t(e)}))}))),await Promise.race(v),y)throw new Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},t.getInstance=()=>{if(l&&c)return c;throw new Error("WebAssembly is not initialized yet.")},t.dispose=()=>{var e;!l||d||f||(d=!0,null===(e=c.PThread)||void 0===e||e.terminateAllThreads(),c=void 0,d=!1,l=!1,f=!0)}},8050:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(6614),i=n.n(r);function o(){return i()('/*!\n* ONNX Runtime Web v1.15.1\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var e={899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iterateExtraOptions=void 0,t.iterateExtraOptions=(e,n,r,a)=>{if("object"==typeof e&&null!==e){if(r.has(e))throw new Error("Circular reference in options");r.add(e)}Object.entries(e).forEach((([e,o])=>{const i=n?n+e:e;if("object"==typeof o)(0,t.iterateExtraOptions)(o,i+".",r,a);else if("string"==typeof o||"number"==typeof o)a(i,o.toString());else{if("boolean"!=typeof o)throw new Error("Can\'t handle extra config type: "+typeof o);a(i,o?"1":"0")}}))}},918:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setRunOptions=void 0;const r=n(899),a=n(444),o=n(263);t.setRunOptions=e=>{const t=(0,o.getInstance)();let n=0;const i=[],s=e||{};try{if(void 0===(null==e?void 0:e.logSeverityLevel))s.logSeverityLevel=2;else if("number"!=typeof e.logSeverityLevel||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(void 0===(null==e?void 0:e.logVerbosityLevel))s.logVerbosityLevel=0;else if("number"!=typeof e.logVerbosityLevel||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);void 0===(null==e?void 0:e.terminate)&&(s.terminate=!1);let o=0;if(void 0!==(null==e?void 0:e.tag)&&(o=(0,a.allocWasmString)(e.tag,i)),n=t._OrtCreateRunOptions(s.logSeverityLevel,s.logVerbosityLevel,!!s.terminate,o),0===n)throw new Error("Can\'t create run options");return void 0!==(null==e?void 0:e.extra)&&(0,r.iterateExtraOptions)(e.extra,"",new WeakSet,((e,r)=>{const o=(0,a.allocWasmString)(e,i),s=(0,a.allocWasmString)(r,i);if(0!==t._OrtAddRunConfigEntry(n,o,s))throw new Error(`Can\'t set a run config entry: ${e} - ${r}`)})),[n,i]}catch(e){throw 0!==n&&t._OrtReleaseRunOptions(n),i.forEach(t._free),e}}},622:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSessionOptions=void 0;const r=n(899),a=n(444),o=n(263);t.setSessionOptions=e=>{var t,n,i,s;const u=(0,o.getInstance)();let c=0;const l=[],f=e||{};(e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});const t=e.extra.session;t.use_ort_model_bytes_directly||(t.use_ort_model_bytes_directly="1"),e.executionProviders&&e.executionProviders.some((e=>"webgpu"===("string"==typeof e?e:e.name)))&&(e.enableMemPattern=!1)})(f);try{const e=(e=>{switch(e){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}})(null!==(t=f.graphOptimizationLevel)&&void 0!==t?t:"all"),p=(e=>{switch(e){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}})(null!==(n=f.executionMode)&&void 0!==n?n:"sequential"),d="string"==typeof f.logId?(0,a.allocWasmString)(f.logId,l):0,m=null!==(i=f.logSeverityLevel)&&void 0!==i?i:2;if(!Number.isInteger(m)||m<0||m>4)throw new Error(`log serverity level is not valid: ${m}`);const g=null!==(s=f.logVerbosityLevel)&&void 0!==s?s:0;if(!Number.isInteger(g)||g<0||g>4)throw new Error(`log verbosity level is not valid: ${g}`);const h="string"==typeof f.optimizedModelFilePath?(0,a.allocWasmString)(f.optimizedModelFilePath,l):0;if(c=u._OrtCreateSessionOptions(e,!!f.enableCpuMemArena,!!f.enableMemPattern,p,!!f.enableProfiling,0,d,m,g,h),0===c)throw new Error("Can\'t create session options");return f.executionProviders&&((e,t,n)=>{for(const r of t){let t="string"==typeof r?r:r.name;switch(t){case"xnnpack":t="XNNPACK";break;case"webgpu":t="JS";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${t}`)}const i=(0,a.allocWasmString)(t,n);if(0!==(0,o.getInstance)()._OrtAppendExecutionProvider(e,i))throw new Error(`Can\'t append execution provider: ${t}`)}})(c,f.executionProviders,l),void 0!==f.extra&&(0,r.iterateExtraOptions)(f.extra,"",new WeakSet,((e,t)=>{const n=(0,a.allocWasmString)(e,l),r=(0,a.allocWasmString)(t,l);if(0!==u._OrtAddSessionConfigEntry(c,n,r))throw new Error(`Can\'t set a session config entry: ${e} - ${t}`)})),[c,l]}catch(e){throw 0!==c&&u._OrtReleaseSessionOptions(c),l.forEach(u._free),e}}},444:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.allocWasmString=void 0;const r=n(263);t.allocWasmString=(e,t)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(e)+1,o=n._malloc(a);return n.stringToUTF8(e,o,a),t.push(o),o}},917:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logLevelStringToEnum=t.tensorTypeToTypedArrayConstructor=t.getTensorElementSize=t.tensorDataTypeEnumToString=t.tensorDataTypeStringToEnum=void 0,t.tensorDataTypeStringToEnum=e=>{switch(e){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${e}`)}},t.tensorDataTypeEnumToString=e=>{switch(e){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${e}`)}},t.getTensorElementSize=e=>[void 0,4,1,1,2,2,4,8,void 0,1,2,8,4,8,void 0,void 0,void 0][e],t.tensorTypeToTypedArrayConstructor=e=>{switch(e){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${e}`)}},t.logLevelStringToEnum=e=>{switch(e){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${e}`)}}},259:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractTransferableBuffers=t.endProfiling=t.run=t.releaseSession=t.createSession=t.createSessionFinalize=t.createSessionAllocate=t.initOrt=void 0;const r=n(918),a=n(622),o=n(444),i=n(917),s=n(263);t.initOrt=(e,t)=>{const n=(0,s.getInstance)()._OrtInit(e,t);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;t.createSessionAllocate=e=>{const t=(0,s.getInstance)(),n=t._malloc(e.byteLength);return t.HEAPU8.set(e,n),[n,e.byteLength]},t.createSessionFinalize=(e,t)=>{const n=(0,s.getInstance)();let r=0,o=0,i=[];try{if([o,i]=(0,a.setSessionOptions)(t),r=n._OrtCreateSession(e[0],e[1],o),0===r)throw new Error("Can\'t create a session")}finally{n._free(e[0]),0!==o&&n._OrtReleaseSessionOptions(o),i.forEach(n._free)}const c=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],d=[],m=[];for(let e=0;e<c;e++){const t=n._OrtGetInputName(r,e);if(0===t)throw new Error("Can\'t get an input name");p.push(t),f.push(n.UTF8ToString(t))}for(let e=0;e<l;e++){const t=n._OrtGetOutputName(r,e);if(0===t)throw new Error("Can\'t get an output name");m.push(t),d.push(n.UTF8ToString(t))}return u.set(r,[r,p,m]),[r,f,d]},t.createSession=(e,n)=>{const r=(0,t.createSessionAllocate)(e);return(0,t.createSessionFinalize)(r,n)},t.releaseSession=e=>{const t=(0,s.getInstance)(),n=u.get(e);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],o=n[2];a.forEach(t._OrtFree),o.forEach(t._OrtFree),t._OrtReleaseSession(r),u.delete(e)},t.run=async(e,t,n,a,c)=>{const l=(0,s.getInstance)(),f=u.get(e);if(!f)throw new Error("invalid session id");const p=f[0],d=f[1],m=f[2],g=t.length,h=a.length;let y=0,v=[];const b=[],w=[];try{[y,v]=(0,r.setRunOptions)(c);for(let e=0;e<g;e++){const t=n[e][0],r=n[e][1],a=n[e][2];let s,u;if(Array.isArray(a)){u=4*a.length,s=l._malloc(u),w.push(s);let e=s/4;for(let t=0;t<a.length;t++){if("string"!=typeof a[t])throw new TypeError(`tensor data at index ${t} is not a string`);l.HEAPU32[e++]=(0,o.allocWasmString)(a[t],w)}}else u=a.byteLength,s=l._malloc(u),w.push(s),l.HEAPU8.set(new Uint8Array(a.buffer,a.byteOffset,u),s);const c=l.stackSave(),f=l.stackAlloc(4*r.length);try{let e=f/4;r.forEach((t=>l.HEAP32[e++]=t));const n=l._OrtCreateTensor((0,i.tensorDataTypeStringToEnum)(t),s,u,f,r.length);if(0===n)throw new Error("Can\'t create a tensor");b.push(n)}finally{l.stackRestore(c)}}const e=l.stackSave(),s=l.stackAlloc(4*g),u=l.stackAlloc(4*g),f=l.stackAlloc(4*h),_=l.stackAlloc(4*h);try{let e=s/4,n=u/4,r=f/4,o=_/4;for(let r=0;r<g;r++)l.HEAPU32[e++]=b[r],l.HEAPU32[n++]=d[t[r]];for(let e=0;e<h;e++)l.HEAPU32[r++]=0,l.HEAPU32[o++]=m[a[e]];let c=l._OrtRun(p,u,s,g,_,h,f,y);const v=l.jsepRunPromise;v&&void 0!==v.then&&(c=await v);const w=[];if(0===c)for(let e=0;e<h;e++){const t=l.HEAPU32[f/4+e],n=l.stackSave(),r=l.stackAlloc(16);let a,o=0;try{if(c=l._OrtGetTensorData(t,r,r+4,r+8,r+12),0!==c)throw new Error(`Can\'t access output tensor data. error code = ${c}`);let e=r/4;const n=l.HEAPU32[e++];o=l.HEAPU32[e++];const s=l.HEAPU32[e++],u=l.HEAPU32[e++],f=[];for(let e=0;e<u;e++)f.push(l.HEAPU32[s/4+e]);l._OrtFree(s);const p=0===f.length?1:f.reduce(((e,t)=>e*t));if(a=(0,i.tensorDataTypeEnumToString)(n),"string"===a){const e=[];let t=o/4;for(let n=0;n<p;n++){const r=l.HEAPU32[t++],a=n===p-1?void 0:l.HEAPU32[t]-r;e.push(l.UTF8ToString(r,a))}w.push([a,f,e])}else{const e=new((0,i.tensorTypeToTypedArrayConstructor)(a))(p);new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(l.HEAPU8.subarray(o,o+e.byteLength)),w.push([a,f,e])}}finally{l.stackRestore(n),"string"===a&&o&&l._free(o),l._OrtReleaseTensor(t)}}if(0===c)return w;throw new Error(`failed to call OrtRun(). error code = ${c}.`)}finally{l.stackRestore(e)}}finally{b.forEach(l._OrtReleaseTensor),w.forEach(l._free),l._OrtReleaseRunOptions(y),v.forEach(l._free)}},t.endProfiling=e=>{const t=(0,s.getInstance)(),n=u.get(e);if(!n)throw new Error("invalid session id");const r=n[0],a=t._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");t._OrtFree(a)},t.extractTransferableBuffers=e=>{const t=[];for(const n of e){const e=n[2];!Array.isArray(e)&&e.buffer&&t.push(e.buffer)}return t}},263:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.dispose=t.getInstance=t.initializeWebAssembly=void 0;const i=o(n(449)),s=n(932),u=n(474);let c,l=!1,f=!1,p=!1;t.initializeWebAssembly=async e=>{if(l)return Promise.resolve();if(f)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(p)throw new Error("previous call to \'initializeWebAssembly()\' failed.");f=!0;const t=e.initTimeout,r=e.numThreads,a=e.simd,o=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(e){return!1}})(),d=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(e){return!1}})(),m=e.wasmPaths,g="string"==typeof m?m:void 0,h=((e,t)=>t?e?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":e?"ort-wasm-simd.wasm":"ort-wasm.wasm")(d,o),y="object"==typeof m?m[h]:void 0;let v=!1;const b=[];if(t>0&&b.push(new Promise((e=>{setTimeout((()=>{v=!0,e()}),t)}))),b.push(new Promise(((e,t)=>{const r=o?u:s,a={locateFile:(e,t)=>o&&e.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):e.endsWith(".wasm")?y||(null!=g?g:t)+h:t+e};if(o)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=i.join("/","ort-wasm-threaded.js");else{const e=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([e],{type:"text/javascript"})}r(a).then((t=>{f=!1,l=!0,c=t,e()}),(e=>{f=!1,p=!0,t(e)}))}))),await Promise.race(b),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},t.getInstance=()=>{if(l&&c)return c;throw new Error("WebAssembly is not initialized yet.")},t.dispose=()=>{var e;!l||f||p||(f=!0,null===(e=c.PThread)||void 0===e||e.terminateAllThreads(),c=void 0,f=!1,l=!1,p=!0)}},474:(e,t,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){function t(){return P.buffer!=D&&G(P.buffer),F}function r(){return P.buffer!=D&&G(P.buffer),U}function a(){return P.buffer!=D&&G(P.buffer),I}function o(){return P.buffer!=D&&G(P.buffer),W}function i(){return P.buffer!=D&&G(P.buffer),j}var s,u,c;e=e||{},s||(s=void 0!==e?e:{}),s.ready=new Promise((function(e,t){u=e,c=t}));var l,f,p,d,m,g,h=Object.assign({},s),y="./this.program",v=(e,t)=>{throw t},b="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=s.ENVIRONMENT_IS_PTHREAD||!1,S="";function T(e){return s.locateFile?s.locateFile(e,S):S+e}if(_){let t;S=w?n(908).dirname(S)+"/":"//",g=()=>{m||(d=n(384),m=n(908))},l=function(e,t){return g(),e=m.normalize(e),d.readFileSync(e,t?void 0:"utf8")},p=e=>((e=l(e,!0)).buffer||(e=new Uint8Array(e)),e),f=(e,t,n)=>{g(),e=m.normalize(e),d.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},1<process.argv.length&&(y=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof ie))throw e})),process.on("unhandledRejection",(function(e){throw e})),v=(e,t)=>{if(C)throw process.exitCode=e,t;t instanceof ie||x("exiting due to exception: "+t),process.exit(e)},s.inspect=function(){return"[Emscripten Module object]"};try{t=n(925)}catch(e){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),e}n.g.Worker=t.Worker}else(b||w)&&(w?S=self.location.href:"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),_scriptDir&&(S=_scriptDir),S=0!==S.indexOf("blob:")?S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(l=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},w&&(p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),f=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var A=console.log.bind(console),E=console.warn.bind(console);_&&(g(),A=e=>d.writeSync(1,e+"\\n"),E=e=>d.writeSync(2,e+"\\n"));var M,R=s.print||A,x=s.printErr||E;Object.assign(s,h),h=null,s.thisProgram&&(y=s.thisProgram),s.quit&&(v=s.quit),s.wasmBinary&&(M=s.wasmBinary);var C=s.noExitRuntime||!0;"object"!=typeof WebAssembly&&ne("no native wasm support detected");var P,k,D,F,U,I,W,j,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function Y(e,t,n){var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16<n-t&&e.buffer&&L)return L.decode(e.buffer instanceof SharedArrayBuffer?e.slice(t,n):e.subarray(t,n));for(r="";t<n;){var a=e[t++];if(128&a){var o=63&e[t++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|o);else{var i=63&e[t++];65536>(a=224==(240&a)?(15&a)<<12|o<<6|i:(7&a)<<18|o<<12|i<<6|63&e[t++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function z(e,t){return(e>>>=0)?Y(r(),e,t):""}function B(e,t,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var o=0;o<e.length;++o){var i=e.charCodeAt(o);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++o)),127>=i){if(n>=r)break;t[n++>>>0]=i}else{if(2047>=i){if(n+1>=r)break;t[n++>>>0]=192|i>>6}else{if(65535>=i){if(n+2>=r)break;t[n++>>>0]=224|i>>12}else{if(n+3>=r)break;t[n++>>>0]=240|i>>18,t[n++>>>0]=128|i>>12&63}t[n++>>>0]=128|i>>6&63}t[n++>>>0]=128|63&i}}return t[n>>>0]=0,n-a}function N(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t}function G(e){D=e,s.HEAP8=F=new Int8Array(e),s.HEAP16=new Int16Array(e),s.HEAP32=I=new Int32Array(e),s.HEAPU8=U=new Uint8Array(e),s.HEAPU16=new Uint16Array(e),s.HEAPU32=W=new Uint32Array(e),s.HEAPF32=new Float32Array(e),s.HEAPF64=j=new Float64Array(e)}O&&(D=s.buffer);var q=s.INITIAL_MEMORY||16777216;if(O)P=s.wasmMemory,D=s.buffer;else if(s.wasmMemory)P=s.wasmMemory;else if(!((P=new WebAssembly.Memory({initial:q/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");P&&(D=P.buffer),q=D.byteLength,G(D);var $,V=[],J=[],Q=[];function X(){var e=s.preRun.shift();V.unshift(e)}var K,Z=0,ee=null,te=null;function ne(e){throw O?postMessage({cmd:"onAbort",arg:e}):s.onAbort&&s.onAbort(e),x(e="Aborted("+e+")"),H=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),c(e),e}function re(){return K.startsWith("data:application/octet-stream;base64,")}function ae(){var e=K;try{if(e==K&&M)return new Uint8Array(M);if(p)return p(e);throw"both async and sync fetching of the wasm failed"}catch(e){ne(e)}}K="ort-wasm-threaded.wasm",re()||(K=T(K));var oe={};function ie(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function se(e){(e=fe.La[e])||ne(),fe.Xa(e)}function ue(e){var t=fe.lb();if(!t)return 6;fe.Ra.push(t),fe.La[e.Ka]=t,t.Ka=e.Ka;var n={cmd:"run",start_routine:e.pb,arg:e.ib,pthread_ptr:e.Ka};return t.Qa=()=>{n.time=performance.now(),t.postMessage(n,e.vb)},t.loaded&&(t.Qa(),delete t.Qa),0}function ce(e){if(O)return He(1,1,e);C||(fe.qb(),s.onExit&&s.onExit(e),H=!0),v(e,new ie(e))}function le(e,t){if(!t&&O)throw de(e),"unwind";ce(e)}var fe={Oa:[],Ra:[],$a:[],La:{},Ua:function(){O&&fe.mb()},xb:function(){},mb:function(){fe.receiveObjectTransfer=fe.ob,fe.threadInitTLS=fe.Za,fe.setExitStatus=fe.Ya,C=!1},Ya:function(){},qb:function(){for(var e of Object.values(fe.La))fe.Xa(e);for(e of fe.Oa)e.terminate();fe.Oa=[]},Xa:function(e){var t=e.Ka;delete fe.La[t],fe.Oa.push(e),fe.Ra.splice(fe.Ra.indexOf(e),1),e.Ka=0,ct(t)},ob:function(){},Za:function(){fe.$a.forEach((e=>e()))},nb:function(e,t){e.onmessage=n=>{var r=(n=n.data).cmd;if(e.Ka&&(fe.kb=e.Ka),n.targetThread&&n.targetThread!=rt()){var a=fe.La[n.yb];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?De(n.queue):"spawnThread"===r?ue(n):"cleanupThread"===r?se(n.thread):"killThread"===r?(n=n.thread,r=fe.La[n],delete fe.La[n],r.terminate(),ct(n),fe.Ra.splice(fe.Ra.indexOf(r),1),r.Ka=0):"cancelThread"===r?fe.La[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(e.loaded=!0,t&&t(e),e.Qa&&(e.Qa(),delete e.Qa)):"print"===r?R("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?e.postMessage(n):"onAbort"===r?s.onAbort&&s.onAbort(n.arg):r&&x("worker sent an unknown command "+r);fe.kb=void 0},e.onerror=e=>{throw x("worker sent an error! "+e.filename+":"+e.lineno+": "+e.message),e},_&&(e.on("message",(function(t){e.onmessage({data:t})})),e.on("error",(function(t){e.onerror(t)})),e.on("detachedExit",(function(){}))),e.postMessage({cmd:"load",urlOrBlob:s.mainScriptUrlOrBlob||_scriptDir,wasmMemory:P,wasmModule:k})},hb:function(){var e=T("ort-wasm-threaded.worker.js");fe.Oa.push(new Worker(e))},lb:function(){return 0==fe.Oa.length&&(fe.hb(),fe.nb(fe.Oa[0])),fe.Oa.pop()}};function pe(e){for(;0<e.length;)e.shift()(s)}function de(e){if(O)return He(2,0,e);try{le(e)}catch(e){e instanceof ie||"unwind"==e||v(1,e)}}s.PThread=fe,s.establishStackSpace=function(){var e=rt(),t=a()[e+44>>2>>>0];e=a()[e+48>>2>>>0],ft(t,t-e),dt(t)};var me,ge,he=[];function ye(e){this.Pa=e-24,this.gb=function(e){o()[this.Pa+4>>2>>>0]=e},this.cb=function(e){o()[this.Pa+8>>2>>>0]=e},this.eb=function(){a()[this.Pa>>2>>>0]=0},this.bb=function(){t()[this.Pa+12>>0>>>0]=0},this.fb=function(){t()[this.Pa+13>>0>>>0]=0},this.Ua=function(e,t){this.ab(),this.gb(e),this.cb(t),this.eb(),this.bb(),this.fb()},this.ab=function(){o()[this.Pa+16>>2>>>0]=0}}function ve(e,t,n,r){return O?He(3,1,e,t,n,r):be(e,t,n,r)}function be(e,t,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?ve(e,t,n,r):(e={pb:n,Ka:e,ib:r,vb:a},O?(e.wb="spawnThread",postMessage(e,a),0):ue(e))}function we(e,t,n){return O?He(4,1,e,t,n):0}function _e(e,t){if(O)return He(5,1,e,t)}function Oe(e,t){if(O)return He(6,1,e,t)}function Se(e,t,n){if(O)return He(7,1,e,t,n)}function Te(e,t,n){return O?He(8,1,e,t,n):0}function Ae(e,t){if(O)return He(9,1,e,t)}function Ee(e,t,n){if(O)return He(10,1,e,t,n)}function Me(e,t,n,r){if(O)return He(11,1,e,t,n,r)}function Re(e,t,n,r){if(O)return He(12,1,e,t,n,r)}function xe(e,t,n,r){if(O)return He(13,1,e,t,n,r)}function Ce(e){if(O)return He(14,1,e)}function Pe(e,t){if(O)return He(15,1,e,t)}function ke(e,t,n){if(O)return He(16,1,e,t,n)}function De(e){Atomics.store(a(),e>>2,1),rt()&&ut(e),Atomics.compareExchange(a(),e>>2,1,0)}function Fe(e){return o()[e>>>2]+4294967296*a()[e+4>>>2]}function Ue(e,t,n,r,a,o){return O?He(17,1,e,t,n,r,a,o):-52}function Ie(e,t,n,r,a,o){if(O)return He(18,1,e,t,n,r,a,o)}function We(e){var n=N(e)+1,r=at(n);return r&&B(e,t(),r,n),r}function je(e,t,n){function r(e){return(e=e.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?e[1]:"GMT"}if(O)return He(19,1,e,t,n);var i=(new Date).getFullYear(),s=new Date(i,0,1),u=new Date(i,6,1);i=s.getTimezoneOffset();var c=u.getTimezoneOffset(),l=Math.max(i,c);a()[e>>2>>>0]=60*l,a()[t>>2>>>0]=Number(i!=c),e=r(s),t=r(u),e=We(e),t=We(t),c<i?(o()[n>>2>>>0]=e,o()[n+4>>2>>>0]=t):(o()[n>>2>>>0]=t,o()[n+4>>2>>>0]=e)}function He(e,t){var n=arguments.length-2,r=arguments;return function(e){var t=pt();return e=e(),dt(t),e}((()=>{for(var a=mt(8*n),o=a>>3,s=0;s<n;s++){var u=r[2+s];i()[o+s>>>0]=u}return st(e,n,a,t)}))}s.invokeEntryPoint=function(e,t){var n=he[e];n||(e>=he.length&&(he.length=e+1),he[e]=n=$.get(e)),e=n(t),C?fe.Ya(e):lt(e)},s.executeNotifiedProxyingQueue=De,ge=_?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:O?()=>performance.now()-s.__performance_now_clock_drift:()=>performance.now();var Le,Ye=[],ze={};function Be(){if(!Le){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:y||"./this.program"};for(e in ze)void 0===ze[e]?delete t[e]:t[e]=ze[e];var n=[];for(e in t)n.push(e+"="+t[e]);Le=n}return Le}function Ne(e,n){if(O)return He(20,1,e,n);var r=0;return Be().forEach((function(a,i){var s=n+r;for(i=o()[e+4*i>>2>>>0]=s,s=0;s<a.length;++s)t()[i++>>0>>>0]=a.charCodeAt(s);t()[i>>0>>>0]=0,r+=a.length+1})),0}function Ge(e,t){if(O)return He(21,1,e,t);var n=Be();o()[e>>2>>>0]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),o()[t>>2>>>0]=r,0}function qe(e){return O?He(22,1,e):52}function $e(e,t,n,r){return O?He(23,1,e,t,n,r):52}function Ve(e,t,n,r,a){return O?He(24,1,e,t,n,r,a):70}var Je=[null,[],[]];function Qe(e,t,n,a){if(O)return He(25,1,e,t,n,a);for(var i=0,s=0;s<n;s++){var u=o()[t>>2>>>0],c=o()[t+4>>2>>>0];t+=8;for(var l=0;l<c;l++){var f=r()[u+l>>>0],p=Je[e];0===f||10===f?((1===e?R:x)(Y(p,0)),p.length=0):p.push(f)}i+=c}return o()[a>>2>>>0]=i,0}function Xe(e){return 0==e%4&&(0!=e%100||0==e%400)}var Ke=[31,29,31,30,31,30,31,31,30,31,30,31],Ze=[31,28,31,30,31,30,31,31,30,31,30,31];function et(e,n,r,o){function i(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=n[0]+e;return e}function s(e,t){return i(e,t,"0")}function u(e,t){function n(e){return 0>e?-1:0<e?1:0}var r;return 0===(r=n(e.getFullYear()-t.getFullYear()))&&0===(r=n(e.getMonth()-t.getMonth()))&&(r=n(e.getDate()-t.getDate())),r}function c(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function l(e){var t=e.Ma;for(e=new Date(new Date(e.Na+1900,0,1).getTime());0<t;){var n=e.getMonth(),r=(Xe(e.getFullYear())?Ke:Ze)[n];if(!(t>r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return n=new Date(e.getFullYear()+1,0,4),t=c(new Date(e.getFullYear(),0,4)),n=c(n),0>=u(t,e)?0>=u(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var f=a()[o+40>>2>>>0];for(var p in o={tb:a()[o>>2>>>0],sb:a()[o+4>>2>>>0],Sa:a()[o+8>>2>>>0],Va:a()[o+12>>2>>>0],Ta:a()[o+16>>2>>>0],Na:a()[o+20>>2>>>0],Ja:a()[o+24>>2>>>0],Ma:a()[o+28>>2>>>0],zb:a()[o+32>>2>>>0],rb:a()[o+36>>2>>>0],ub:f?z(f):""},r=z(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),f[p]);var d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),m="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(e){return d[e.Ja].substring(0,3)},"%A":function(e){return d[e.Ja]},"%b":function(e){return m[e.Ta].substring(0,3)},"%B":function(e){return m[e.Ta]},"%C":function(e){return s((e.Na+1900)/100|0,2)},"%d":function(e){return s(e.Va,2)},"%e":function(e){return i(e.Va,2," ")},"%g":function(e){return l(e).toString().substring(2)},"%G":function(e){return l(e)},"%H":function(e){return s(e.Sa,2)},"%I":function(e){return 0==(e=e.Sa)?e=12:12<e&&(e-=12),s(e,2)},"%j":function(e){for(var t=0,n=0;n<=e.Ta-1;t+=(Xe(e.Na+1900)?Ke:Ze)[n++]);return s(e.Va+t,3)},"%m":function(e){return s(e.Ta+1,2)},"%M":function(e){return s(e.sb,2)},"%n":function(){return"\\n"},"%p":function(e){return 0<=e.Sa&&12>e.Sa?"AM":"PM"},"%S":function(e){return s(e.tb,2)},"%t":function(){return"\\t"},"%u":function(e){return e.Ja||7},"%U":function(e){return s(Math.floor((e.Ma+7-e.Ja)/7),2)},"%V":function(e){var t=Math.floor((e.Ma+7-(e.Ja+6)%7)/7);if(2>=(e.Ja+371-e.Ma-2)%7&&t++,t)53==t&&(4==(n=(e.Ja+371-e.Ma)%7)||3==n&&Xe(e.Na)||(t=1));else{t=52;var n=(e.Ja+7-e.Ma-1)%7;(4==n||5==n&&Xe(e.Na%400-1))&&t++}return s(t,2)},"%w":function(e){return e.Ja},"%W":function(e){return s(Math.floor((e.Ma+7-(e.Ja+6)%7)/7),2)},"%y":function(e){return(e.Na+1900).toString().substring(2)},"%Y":function(e){return e.Na+1900},"%z":function(e){var t=0<=(e=e.rb);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.ub},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](o)));return p=function(e){var t=Array(N(e)+1);return B(e,t,0,t.length),t}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(e,n){t().set(e,n>>>0)}(p,e),p.length-1)}fe.Ua();var tt=[null,ce,de,ve,we,_e,Oe,Se,Te,Ae,Ee,Me,Re,xe,Ce,Pe,ke,Ue,Ie,je,Ne,Ge,qe,$e,Ve,Qe],nt={b:function(e){return at(e+24)+24},c:function(e,t,n){throw new ye(e).Ua(t,n),e},L:function(e){ot(e,!w,1,!b),fe.Za()},l:function(e){O?postMessage({cmd:"cleanupThread",thread:e}):se(e)},D:be,i:we,R:_e,z:Oe,B:Se,T:Te,P:Ae,I:Ee,O:Me,p:Re,A:xe,x:Ce,Q:Pe,y:ke,r:function(){},j:function(){ne("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},s:function(){ne("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},q:function(){return Date.now()},E:function(){return 2097152},V:function(){return!0},F:function(e,t,n,r){if(e==t)setTimeout((()=>De(r)));else if(O)postMessage({targetThread:e,cmd:"processProxyingQueue",queue:r});else{if(!(e=fe.La[e]))return;e.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},K:function(){return-1},W:function(e,t){e=new Date(1e3*Fe(e)),a()[t>>2>>>0]=e.getUTCSeconds(),a()[t+4>>2>>>0]=e.getUTCMinutes(),a()[t+8>>2>>>0]=e.getUTCHours(),a()[t+12>>2>>>0]=e.getUTCDate(),a()[t+16>>2>>>0]=e.getUTCMonth(),a()[t+20>>2>>>0]=e.getUTCFullYear()-1900,a()[t+24>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[t+28>>2>>>0]=e},X:function(e,t){e=new Date(1e3*Fe(e)),a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),a()[t+20>>2>>>0]=e.getFullYear()-1900,a()[t+24>>2>>>0]=e.getDay();var n=new Date(e.getFullYear(),0,1),r=(e.getTime()-n.getTime())/864e5|0;a()[t+28>>2>>>0]=r,a()[t+36>>2>>>0]=-60*e.getTimezoneOffset(),r=new Date(e.getFullYear(),6,1).getTimezoneOffset(),e=0|(r!=(n=n.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(n,r)),a()[t+32>>2>>>0]=e},Y:function(e){var t=new Date(a()[e+20>>2>>>0]+1900,a()[e+16>>2>>>0],a()[e+12>>2>>>0],a()[e+8>>2>>>0],a()[e+4>>2>>>0],a()[e>>2>>>0],0),n=a()[e+32>>2>>>0],r=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),u=Math.min(s,i);return 0>n?a()[e+32>>2>>>0]=Number(i!=s&&u==r):0<n!=(u==r)&&(i=Math.max(s,i),t.setTime(t.getTime()+6e4*((0<n?u:i)-r))),a()[e+24>>2>>>0]=t.getDay(),n=(t.getTime()-o.getTime())/864e5|0,a()[e+28>>2>>>0]=n,a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),t.getTime()/1e3|0},G:Ue,H:Ie,Z:function e(t,n,r){e.jb||(e.jb=!0,je(t,n,r))},d:function(){ne("")},m:function(){if(!_&&!w){var e="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";me||(me={}),me[e]||(me[e]=1,_&&(e="warning: "+e),x(e))}},w:function(){return 4294901760},f:ge,S:function(e,t,n){r().copyWithin(e>>>0,t>>>0,t+n>>>0)},g:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},J:function(e,t,n){Ye.length=t,n>>=3;for(var r=0;r<t;r++)Ye[r]=i()[n+r>>>0];return(0>e?oe[-e-1]:tt[e]).apply(null,Ye)},v:function(e){var t=r().length;if((e>>>=0)<=t||4294901760<e)return!1;for(var n=1;4>=n;n*=2){var a=t*(1+.2/n);a=Math.min(a,e+100663296);var o=Math;a=Math.max(e,a),o=o.min.call(o,4294901760,a+(65536-a%65536)%65536);e:{try{P.grow(o-D.byteLength+65535>>>16),G(P.buffer);var i=1;break e}catch(e){}i=void 0}if(i)return!0}return!1},U:function(){throw"unwind"},M:Ne,N:Ge,k:le,h:qe,o:$e,t:Ve,n:Qe,u:function e(r,a){e.Wa||(e.Wa=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(_)try{var t=n(760);return()=>t.randomBytes(1)[0]}catch(e){}return()=>ne("randomDevice")}());for(var o=0;o<a;o++)t()[r+o>>0>>>0]=e.Wa();return 0},a:P||s.wasmMemory,C:et,e:function(e,t,n,r){return et(e,t,n,r)}};!function(){function e(e,t){s.asm=e.exports,fe.$a.push(s.asm.wa),$=s.asm.za,J.unshift(s.asm._),k=t,O||(Z--,s.monitorRunDependencies&&s.monitorRunDependencies(Z),0==Z&&(null!==ee&&(clearInterval(ee),ee=null),te&&(e=te,te=null,e())))}function t(t){e(t.instance,t.module)}function n(e){return function(){if(!M&&(b||w)){if("function"==typeof fetch&&!K.startsWith("file://"))return fetch(K,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at \'"+K+"\'";return e.arrayBuffer()})).catch((function(){return ae()}));if(f)return new Promise((function(e,t){f(K,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return ae()}))}().then((function(e){return WebAssembly.instantiate(e,r)})).then((function(e){return e})).then(e,(function(e){x("failed to asynchronously prepare wasm: "+e),ne(e)}))}var r={a:nt};if(O||(Z++,s.monitorRunDependencies&&s.monitorRunDependencies(Z)),s.instantiateWasm)try{return s.instantiateWasm(r,e)}catch(e){return x("Module.instantiateWasm callback failed with error: "+e),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||re()||K.startsWith("file://")||_||"function"!=typeof fetch?n(t):fetch(K,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(t,(function(e){return x("wasm streaming compile failed: "+e),x("falling back to ArrayBuffer instantiation"),n(t)}))}))).catch(c)}(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm._).apply(null,arguments)},s._OrtInit=function(){return(s._OrtInit=s.asm.$).apply(null,arguments)},s._OrtCreateSessionOptions=function(){return(s._OrtCreateSessionOptions=s.asm.aa).apply(null,arguments)},s._OrtAppendExecutionProvider=function(){return(s._OrtAppendExecutionProvider=s.asm.ba).apply(null,arguments)},s._OrtAddSessionConfigEntry=function(){return(s._OrtAddSessionConfigEntry=s.asm.ca).apply(null,arguments)},s._OrtReleaseSessionOptions=function(){return(s._OrtReleaseSessionOptions=s.asm.da).apply(null,arguments)},s._OrtCreateSession=function(){return(s._OrtCreateSession=s.asm.ea).apply(null,arguments)},s._OrtReleaseSession=function(){return(s._OrtReleaseSession=s.asm.fa).apply(null,arguments)},s._OrtGetInputCount=function(){return(s._OrtGetInputCount=s.asm.ga).apply(null,arguments)},s._OrtGetOutputCount=function(){return(s._OrtGetOutputCount=s.asm.ha).apply(null,arguments)},s._OrtGetInputName=function(){return(s._OrtGetInputName=s.asm.ia).apply(null,arguments)},s._OrtGetOutputName=function(){return(s._OrtGetOutputName=s.asm.ja).apply(null,arguments)},s._OrtFree=function(){return(s._OrtFree=s.asm.ka).apply(null,arguments)},s._OrtCreateTensor=function(){return(s._OrtCreateTensor=s.asm.la).apply(null,arguments)},s._OrtGetTensorData=function(){return(s._OrtGetTensorData=s.asm.ma).apply(null,arguments)},s._OrtReleaseTensor=function(){return(s._OrtReleaseTensor=s.asm.na).apply(null,arguments)},s._OrtCreateRunOptions=function(){return(s._OrtCreateRunOptions=s.asm.oa).apply(null,arguments)},s._OrtAddRunConfigEntry=function(){return(s._OrtAddRunConfigEntry=s.asm.pa).apply(null,arguments)},s._OrtReleaseRunOptions=function(){return(s._OrtReleaseRunOptions=s.asm.qa).apply(null,arguments)},s._OrtRun=function(){return(s._OrtRun=s.asm.ra).apply(null,arguments)},s._OrtEndProfiling=function(){return(s._OrtEndProfiling=s.asm.sa).apply(null,arguments)};var rt=s._pthread_self=function(){return(rt=s._pthread_self=s.asm.ta).apply(null,arguments)},at=s._malloc=function(){return(at=s._malloc=s.asm.ua).apply(null,arguments)};s._free=function(){return(s._free=s.asm.va).apply(null,arguments)},s.__emscripten_tls_init=function(){return(s.__emscripten_tls_init=s.asm.wa).apply(null,arguments)};var ot=s.__emscripten_thread_init=function(){return(ot=s.__emscripten_thread_init=s.asm.xa).apply(null,arguments)};s.__emscripten_thread_crashed=function(){return(s.__emscripten_thread_crashed=s.asm.ya).apply(null,arguments)};var it,st=s._emscripten_run_in_main_runtime_thread_js=function(){return(st=s._emscripten_run_in_main_runtime_thread_js=s.asm.Aa).apply(null,arguments)},ut=s.__emscripten_proxy_execute_task_queue=function(){return(ut=s.__emscripten_proxy_execute_task_queue=s.asm.Ba).apply(null,arguments)},ct=s.__emscripten_thread_free_data=function(){return(ct=s.__emscripten_thread_free_data=s.asm.Ca).apply(null,arguments)},lt=s.__emscripten_thread_exit=function(){return(lt=s.__emscripten_thread_exit=s.asm.Da).apply(null,arguments)},ft=s._emscripten_stack_set_limits=function(){return(ft=s._emscripten_stack_set_limits=s.asm.Ea).apply(null,arguments)},pt=s.stackSave=function(){return(pt=s.stackSave=s.asm.Fa).apply(null,arguments)},dt=s.stackRestore=function(){return(dt=s.stackRestore=s.asm.Ga).apply(null,arguments)},mt=s.stackAlloc=function(){return(mt=s.stackAlloc=s.asm.Ha).apply(null,arguments)};function gt(){function e(){if(!it&&(it=!0,s.calledRun=!0,!H)&&(O||pe(J),u(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),!O)){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;){var e=s.postRun.shift();Q.unshift(e)}pe(Q)}}if(!(0<Z))if(O)u(s),O||pe(J),postMessage({cmd:"loaded"});else{if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)X();pe(V),0<Z||(s.setStatus?(s.setStatus("Running..."),setTimeout((function(){setTimeout((function(){s.setStatus("")}),1),e()}),1)):e())}}if(s.___cxa_is_pointer_type=function(){return(s.___cxa_is_pointer_type=s.asm.Ia).apply(null,arguments)},s.UTF8ToString=z,s.stringToUTF8=function(e,t,n){return B(e,r(),t,n)},s.lengthBytesUTF8=N,s.keepRuntimeAlive=function(){return C},s.wasmMemory=P,s.stackSave=pt,s.stackRestore=dt,s.stackAlloc=mt,s.ExitStatus=ie,s.PThread=fe,te=function e(){it||gt(),it||(te=e)},s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);0<s.preInit.length;)s.preInit.pop()();return gt(),e.ready});e.exports=r},932:(e,t,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){var t,r,a;e=e||{},t||(t=void 0!==e?e:{}),t.ready=new Promise((function(e,t){r=e,a=t}));var o,i,s,u,c,l,f=Object.assign({},t),p="./this.program",d=(e,t)=>{throw t},m="object"==typeof window,g="function"==typeof importScripts,h="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y="";h?(y=g?n(908).dirname(y)+"/":"//",l=()=>{c||(u=n(384),c=n(908))},o=function(e,t){return l(),e=c.normalize(e),u.readFileSync(e,t?void 0:"utf8")},s=e=>((e=o(e,!0)).buffer||(e=new Uint8Array(e)),e),i=(e,t,n)=>{l(),e=c.normalize(e),u.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},1<process.argv.length&&(p=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof $))throw e})),process.on("unhandledRejection",(function(e){throw e})),d=(e,t)=>{if(_)throw process.exitCode=e,t;t instanceof $||w("exiting due to exception: "+t),process.exit(e)},t.inspect=function(){return"[Emscripten Module object]"}):(m||g)&&(g?y=self.location.href:"undefined"!=typeof document&&document.currentScript&&(y=document.currentScript.src),_scriptDir&&(y=_scriptDir),y=0!==y.indexOf("blob:")?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",o=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},g&&(s=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),i=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)});var v,b=t.print||console.log.bind(console),w=t.printErr||console.warn.bind(console);Object.assign(t,f),f=null,t.thisProgram&&(p=t.thisProgram),t.quit&&(d=t.quit),t.wasmBinary&&(v=t.wasmBinary);var _=t.noExitRuntime||!0;"object"!=typeof WebAssembly&&B("no native wasm support detected");var O,S,T,A,E,M,R=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function C(e,t,n){var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16<n-t&&e.buffer&&x)return x.decode(e.subarray(t,n));for(r="";t<n;){var a=e[t++];if(128&a){var o=63&e[t++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|o);else{var i=63&e[t++];65536>(a=224==(240&a)?(15&a)<<12|o<<6|i:(7&a)<<18|o<<12|i<<6|63&e[t++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function P(e,t){return(e>>>=0)?C(A,e,t):""}function k(e,t,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var o=0;o<e.length;++o){var i=e.charCodeAt(o);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++o)),127>=i){if(n>=r)break;t[n++>>>0]=i}else{if(2047>=i){if(n+1>=r)break;t[n++>>>0]=192|i>>6}else{if(65535>=i){if(n+2>=r)break;t[n++>>>0]=224|i>>12}else{if(n+3>=r)break;t[n++>>>0]=240|i>>18,t[n++>>>0]=128|i>>12&63}t[n++>>>0]=128|i>>6&63}t[n++>>>0]=128|63&i}}return t[n>>>0]=0,n-a}function D(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t}function F(){var e=O.buffer;S=e,t.HEAP8=T=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=E=new Int32Array(e),t.HEAPU8=A=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=M=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}var U=[],I=[],W=[];function j(){var e=t.preRun.shift();U.unshift(e)}var H,L=0,Y=null,z=null;function B(e){throw t.onAbort&&t.onAbort(e),w(e="Aborted("+e+")"),R=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),a(e),e}function N(){return H.startsWith("data:application/octet-stream;base64,")}if(H="ort-wasm.wasm",!N()){var G=H;H=t.locateFile?t.locateFile(G,y):y+G}function q(){var e=H;try{if(e==H&&v)return new Uint8Array(v);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){B(e)}}function $(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function V(e){for(;0<e.length;)e.shift()(t)}function J(e){this.sa=e-24,this.Ia=function(e){M[this.sa+4>>2>>>0]=e},this.Ba=function(e){M[this.sa+8>>2>>>0]=e},this.Ga=function(){E[this.sa>>2>>>0]=0},this.Aa=function(){T[this.sa+12>>0>>>0]=0},this.Ha=function(){T[this.sa+13>>0>>>0]=0},this.ya=function(e,t){this.za(),this.Ia(e),this.Ba(t),this.Ga(),this.Aa(),this.Ha()},this.za=function(){M[this.sa+16>>2>>>0]=0}}function Q(e){var t=D(e)+1,n=ie(t);return n&&k(e,T,n,t),n}var X={};function K(){if(!Z){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(e in X)void 0===X[e]?delete t[e]:t[e]=X[e];var n=[];for(e in t)n.push(e+"="+t[e]);Z=n}return Z}var Z,ee=[null,[],[]];function te(e){return 0==e%4&&(0!=e%100||0==e%400)}var ne=[31,29,31,30,31,30,31,31,30,31,30,31],re=[31,28,31,30,31,30,31,31,30,31,30,31];function ae(e,t,n,r){function a(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=n[0]+e;return e}function o(e,t){return a(e,t,"0")}function i(e,t){function n(e){return 0>e?-1:0<e?1:0}var r;return 0===(r=n(e.getFullYear()-t.getFullYear()))&&0===(r=n(e.getMonth()-t.getMonth()))&&(r=n(e.getDate()-t.getDate())),r}function s(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function u(e){var t=e.qa;for(e=new Date(new Date(e.ra+1900,0,1).getTime());0<t;){var n=e.getMonth(),r=(te(e.getFullYear())?ne:re)[n];if(!(t>r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return n=new Date(e.getFullYear()+1,0,4),t=s(new Date(e.getFullYear(),0,4)),n=s(n),0>=i(t,e)?0>=i(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var c=E[r+40>>2>>>0];for(var l in r={Ea:E[r>>2>>>0],Da:E[r+4>>2>>>0],ta:E[r+8>>2>>>0],va:E[r+12>>2>>>0],ua:E[r+16>>2>>>0],ra:E[r+20>>2>>>0],la:E[r+24>>2>>>0],qa:E[r+28>>2>>>0],Ja:E[r+32>>2>>>0],Ca:E[r+36>>2>>>0],Fa:c?P(c):""},n=P(n),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),c[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in c={"%a":function(e){return f[e.la].substring(0,3)},"%A":function(e){return f[e.la]},"%b":function(e){return p[e.ua].substring(0,3)},"%B":function(e){return p[e.ua]},"%C":function(e){return o((e.ra+1900)/100|0,2)},"%d":function(e){return o(e.va,2)},"%e":function(e){return a(e.va,2," ")},"%g":function(e){return u(e).toString().substring(2)},"%G":function(e){return u(e)},"%H":function(e){return o(e.ta,2)},"%I":function(e){return 0==(e=e.ta)?e=12:12<e&&(e-=12),o(e,2)},"%j":function(e){for(var t=0,n=0;n<=e.ua-1;t+=(te(e.ra+1900)?ne:re)[n++]);return o(e.va+t,3)},"%m":function(e){return o(e.ua+1,2)},"%M":function(e){return o(e.Da,2)},"%n":function(){return"\\n"},"%p":function(e){return 0<=e.ta&&12>e.ta?"AM":"PM"},"%S":function(e){return o(e.Ea,2)},"%t":function(){return"\\t"},"%u":function(e){return e.la||7},"%U":function(e){return o(Math.floor((e.qa+7-e.la)/7),2)},"%V":function(e){var t=Math.floor((e.qa+7-(e.la+6)%7)/7);if(2>=(e.la+371-e.qa-2)%7&&t++,t)53==t&&(4==(n=(e.la+371-e.qa)%7)||3==n&&te(e.ra)||(t=1));else{t=52;var n=(e.la+7-e.qa-1)%7;(4==n||5==n&&te(e.ra%400-1))&&t++}return o(t,2)},"%w":function(e){return e.la},"%W":function(e){return o(Math.floor((e.qa+7-(e.la+6)%7)/7),2)},"%y":function(e){return(e.ra+1900).toString().substring(2)},"%Y":function(e){return e.ra+1900},"%z":function(e){var t=0<=(e=e.Ca);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.Fa},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),c)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),c[l](r)));return l=function(e){var t=Array(D(e)+1);return k(e,t,0,t.length),t}(n=n.replace(/\\0\\0/g,"%")),l.length>t?0:(T.set(l,e>>>0),l.length-1)}var oe={a:function(e){return ie(e+24)+24},b:function(e,t,n){throw new J(e).ya(t,n),e},g:function(){return 0},I:function(){},w:function(){},y:function(){},K:function(){return 0},G:function(){},C:function(){},F:function(){},k:function(){},x:function(){},u:function(){},H:function(){},v:function(){},n:function(){},p:function(){B("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},o:function(){B("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},l:function(){return Date.now()},L:function(){return!0},M:function(e,t){e=new Date(1e3*(M[e>>>2]+4294967296*E[e+4>>>2])),E[t>>2>>>0]=e.getUTCSeconds(),E[t+4>>2>>>0]=e.getUTCMinutes(),E[t+8>>2>>>0]=e.getUTCHours(),E[t+12>>2>>>0]=e.getUTCDate(),E[t+16>>2>>>0]=e.getUTCMonth(),E[t+20>>2>>>0]=e.getUTCFullYear()-1900,E[t+24>>2>>>0]=e.getUTCDay(),E[t+28>>2>>>0]=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},N:function(e,t){e=new Date(1e3*(M[e>>>2]+4294967296*E[e+4>>>2])),E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),E[t+20>>2>>>0]=e.getFullYear()-1900,E[t+24>>2>>>0]=e.getDay();var n=new Date(e.getFullYear(),0,1);E[t+28>>2>>>0]=(e.getTime()-n.getTime())/864e5|0,E[t+36>>2>>>0]=-60*e.getTimezoneOffset();var r=new Date(e.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[t+32>>2>>>0]=0|(r!=n&&e.getTimezoneOffset()==Math.min(n,r))},O:function(e){var t=new Date(E[e+20>>2>>>0]+1900,E[e+16>>2>>>0],E[e+12>>2>>>0],E[e+8>>2>>>0],E[e+4>>2>>>0],E[e>>2>>>0],0),n=E[e+32>>2>>>0],r=t.getTimezoneOffset(),a=new Date(t.getFullYear(),0,1),o=new Date(t.getFullYear(),6,1).getTimezoneOffset(),i=a.getTimezoneOffset(),s=Math.min(i,o);return 0>n?E[e+32>>2>>>0]=Number(o!=i&&s==r):0<n!=(s==r)&&(o=Math.max(i,o),t.setTime(t.getTime()+6e4*((0<n?s:o)-r))),E[e+24>>2>>>0]=t.getDay(),E[e+28>>2>>>0]=(t.getTime()-a.getTime())/864e5|0,E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),t.getTime()/1e3|0},z:function(){return-52},B:function(){},m:function e(t,n,r){e.xa||(e.xa=!0,function(e,t,n){function r(e){return(e=e.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?e[1]:"GMT"}var a=(new Date).getFullYear(),o=new Date(a,0,1),i=new Date(a,6,1);a=o.getTimezoneOffset();var s=i.getTimezoneOffset();E[e>>2>>>0]=60*Math.max(a,s),E[t>>2>>>0]=Number(a!=s),e=r(o),t=r(i),e=Q(e),t=Q(t),s<a?(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t):(M[n>>2>>>0]=t,M[n+4>>2>>>0]=e)}(t,n,r))},d:function(){B("")},t:function(){return 4294901760},h:h?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now(),J:function(e,t,n){A.copyWithin(e>>>0,t>>>0,t+n>>>0)},f:function(e){var t=A.length;if(4294901760<(e>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);var a=Math;r=Math.max(e,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);e:{try{O.grow(a-S.byteLength+65535>>>16),F();var o=1;break e}catch(e){}o=void 0}if(o)return!0}return!1},D:function(e,t){var n=0;return K().forEach((function(r,a){var o=t+n;for(a=M[e+4*a>>2>>>0]=o,o=0;o<r.length;++o)T[a++>>0>>>0]=r.charCodeAt(o);T[a>>0>>>0]=0,n+=r.length+1})),0},E:function(e,t){var n=K();M[e>>2>>>0]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),M[t>>2>>>0]=r,0},r:function(e){_||(t.onExit&&t.onExit(e),R=!0),d(e,new $(e))},e:function(){return 52},j:function(){return 52},q:function(){return 70},i:function(e,t,n,r){for(var a=0,o=0;o<n;o++){var i=M[t>>2>>>0],s=M[t+4>>2>>>0];t+=8;for(var u=0;u<s;u++){var c=A[i+u>>>0],l=ee[e];0===c||10===c?((1===e?b:w)(C(l,0)),l.length=0):l.push(c)}a+=s}return M[r>>2>>>0]=a,0},s:function e(t,r){e.wa||(e.wa=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(h)try{var t=n(760);return()=>t.randomBytes(1)[0]}catch(e){}return()=>B("randomDevice")}());for(var a=0;a<r;a++)T[t+a>>0>>>0]=e.wa();return 0},A:ae,c:function(e,t,n,r){return ae(e,t,n,r)}};!function(){function e(e){t.asm=e.exports,O=t.asm.P,F(),I.unshift(t.asm.Q),L--,t.monitorRunDependencies&&t.monitorRunDependencies(L),0==L&&(null!==Y&&(clearInterval(Y),Y=null),z&&(e=z,z=null,e()))}function n(t){e(t.instance)}function r(e){return function(){if(!v&&(m||g)){if("function"==typeof fetch&&!H.startsWith("file://"))return fetch(H,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at \'"+H+"\'";return e.arrayBuffer()})).catch((function(){return q()}));if(i)return new Promise((function(e,t){i(H,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return q()}))}().then((function(e){return WebAssembly.instantiate(e,o)})).then((function(e){return e})).then(e,(function(e){w("failed to asynchronously prepare wasm: "+e),B(e)}))}var o={a:oe};if(L++,t.monitorRunDependencies&&t.monitorRunDependencies(L),t.instantiateWasm)try{return t.instantiateWasm(o,e)}catch(e){return w("Module.instantiateWasm callback failed with error: "+e),!1}(v||"function"!=typeof WebAssembly.instantiateStreaming||N()||H.startsWith("file://")||h||"function"!=typeof fetch?r(n):fetch(H,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,o).then(n,(function(e){return w("wasm streaming compile failed: "+e),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.Q).apply(null,arguments)},t._OrtInit=function(){return(t._OrtInit=t.asm.R).apply(null,arguments)},t._OrtCreateSessionOptions=function(){return(t._OrtCreateSessionOptions=t.asm.S).apply(null,arguments)},t._OrtAppendExecutionProvider=function(){return(t._OrtAppendExecutionProvider=t.asm.T).apply(null,arguments)},t._OrtAddSessionConfigEntry=function(){return(t._OrtAddSessionConfigEntry=t.asm.U).apply(null,arguments)},t._OrtReleaseSessionOptions=function(){return(t._OrtReleaseSessionOptions=t.asm.V).apply(null,arguments)},t._OrtCreateSession=function(){return(t._OrtCreateSession=t.asm.W).apply(null,arguments)},t._OrtReleaseSession=function(){return(t._OrtReleaseSession=t.asm.X).apply(null,arguments)},t._OrtGetInputCount=function(){return(t._OrtGetInputCount=t.asm.Y).apply(null,arguments)},t._OrtGetOutputCount=function(){return(t._OrtGetOutputCount=t.asm.Z).apply(null,arguments)},t._OrtGetInputName=function(){return(t._OrtGetInputName=t.asm._).apply(null,arguments)},t._OrtGetOutputName=function(){return(t._OrtGetOutputName=t.asm.$).apply(null,arguments)},t._OrtFree=function(){return(t._OrtFree=t.asm.aa).apply(null,arguments)},t._OrtCreateTensor=function(){return(t._OrtCreateTensor=t.asm.ba).apply(null,arguments)},t._OrtGetTensorData=function(){return(t._OrtGetTensorData=t.asm.ca).apply(null,arguments)},t._OrtReleaseTensor=function(){return(t._OrtReleaseTensor=t.asm.da).apply(null,arguments)},t._OrtCreateRunOptions=function(){return(t._OrtCreateRunOptions=t.asm.ea).apply(null,arguments)},t._OrtAddRunConfigEntry=function(){return(t._OrtAddRunConfigEntry=t.asm.fa).apply(null,arguments)},t._OrtReleaseRunOptions=function(){return(t._OrtReleaseRunOptions=t.asm.ga).apply(null,arguments)},t._OrtRun=function(){return(t._OrtRun=t.asm.ha).apply(null,arguments)},t._OrtEndProfiling=function(){return(t._OrtEndProfiling=t.asm.ia).apply(null,arguments)};var ie=t._malloc=function(){return(ie=t._malloc=t.asm.ja).apply(null,arguments)};t._free=function(){return(t._free=t.asm.ka).apply(null,arguments)};var se,ue=t.stackSave=function(){return(ue=t.stackSave=t.asm.ma).apply(null,arguments)},ce=t.stackRestore=function(){return(ce=t.stackRestore=t.asm.na).apply(null,arguments)},le=t.stackAlloc=function(){return(le=t.stackAlloc=t.asm.oa).apply(null,arguments)};function fe(){function e(){if(!se&&(se=!0,t.calledRun=!0,!R)){if(V(I),r(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;){var e=t.postRun.shift();W.unshift(e)}V(W)}}if(!(0<L)){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)j();V(U),0<L||(t.setStatus?(t.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t.setStatus("")}),1),e()}),1)):e())}}if(t.___cxa_is_pointer_type=function(){return(t.___cxa_is_pointer_type=t.asm.pa).apply(null,arguments)},t.UTF8ToString=P,t.stringToUTF8=function(e,t,n){return k(e,A,t,n)},t.lengthBytesUTF8=D,t.stackSave=ue,t.stackRestore=ce,t.stackAlloc=le,z=function e(){se||fe(),se||(z=e)},t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();return fe(),e.ready});e.exports=r},154:e=>{"use strict";e.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},760:()=>{},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";const e=n(259),t=n(263);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,t.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(e=>postMessage({type:"init-wasm",err:e})));break;case"init-ort":try{const{numThreads:t,loggingLevel:r}=n.data.in;(0,e.initOrt)(t,r),postMessage({type:"init-ort"})}catch(e){postMessage({type:"init-ort",err:e})}break;case"create_allocate":try{const{model:t}=n.data.in,r=(0,e.createSessionAllocate)(t);postMessage({type:"create_allocate",out:r})}catch(e){postMessage({type:"create_allocate",err:e})}break;case"create_finalize":try{const{modeldata:t,options:r}=n.data.in,a=(0,e.createSessionFinalize)(t,r);postMessage({type:"create_finalize",out:a})}catch(e){postMessage({type:"create_finalize",err:e})}break;case"create":try{const{model:t,options:r}=n.data.in,a=(0,e.createSession)(t,r);postMessage({type:"create",out:a})}catch(e){postMessage({type:"create",err:e})}break;case"release":try{const t=n.data.in;(0,e.releaseSession)(t),postMessage({type:"release"})}catch(e){postMessage({type:"release",err:e})}break;case"run":try{const{sessionId:t,inputIndices:r,inputs:a,outputIndices:o,options:i}=n.data.in;(0,e.run)(t,r,a,o,i).then((t=>{postMessage({type:"run",out:t},(0,e.extractTransferableBuffers)(t))}),(e=>{postMessage({type:"run",err:e})}))}catch(e){postMessage({type:"run",err:e})}break;case"end-profiling":try{const t=n.data.in;(0,e.endProfiling)(t),postMessage({type:"end-profiling"})}catch(e){postMessage({type:"end-profiling",err:e})}}}})()})();\n',"Worker",void 0,void 0)}},6614:e=>{"use strict";e.exports=function(e,t,n,r){var i=self||window;try{try{var o;try{o=new i.Blob([e])}catch(t){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(e),o=o.getBlob()}var s=i.URL||i.webkitURL,a=s.createObjectURL(o),u=new i[t](a,n);return s.revokeObjectURL(a),u}catch(r){return new i[t]("data:application/javascript,".concat(encodeURIComponent(e)),n)}}catch(e){if(!r)throw Error("Inline worker is not supported");return new i[t](r,n)}}},3474:(e,t,n)=>{var r,i=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){function t(){return M.buffer!=D&&H(M.buffer),j}function i(){return M.buffer!=D&&H(M.buffer),$}function o(){return M.buffer!=D&&H(M.buffer),N}function s(){return M.buffer!=D&&H(M.buffer),L}function a(){return M.buffer!=D&&H(M.buffer),F}var u,c,l;e=e||{},u||(u=void 0!==e?e:{}),u.ready=new Promise((function(e,t){c=e,l=t}));var d,f,h,p,g,m,b=Object.assign({},u),y="./this.program",v=(e,t)=>{throw t},_="object"==typeof window,w="function"==typeof importScripts,x="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,T=u.ENVIRONMENT_IS_PTHREAD||!1,S="";function O(e){return u.locateFile?u.locateFile(e,S):S+e}if(x){let t;S=w?n(908).dirname(S)+"/":"//",m=()=>{g||(p=n(1384),g=n(908))},d=function(e,t){return m(),e=g.normalize(e),p.readFileSync(e,t?void 0:"utf8")},h=e=>((e=d(e,!0)).buffer||(e=new Uint8Array(e)),e),f=(e,t,n)=>{m(),e=g.normalize(e),p.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},1<process.argv.length&&(y=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof ae))throw e})),process.on("unhandledRejection",(function(e){throw e})),v=(e,t)=>{if(R)throw process.exitCode=e,t;t instanceof ae||I("exiting due to exception: "+t),process.exit(e)},u.inspect=function(){return"[Emscripten Module object]"};try{t=n(9925)}catch(e){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),e}n.g.Worker=t.Worker}else(_||w)&&(w?S=self.location.href:"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),r&&(S=r),S=0!==S.indexOf("blob:")?S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):"",x||(d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},w&&(h=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),f=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}));x&&"undefined"==typeof performance&&(n.g.performance=n(6953).performance);var E=console.log.bind(console),P=console.warn.bind(console);x&&(m(),E=e=>p.writeSync(1,e+"\n"),P=e=>p.writeSync(2,e+"\n"));var A,C=u.print||E,I=u.printErr||P;Object.assign(u,b),b=null,u.thisProgram&&(y=u.thisProgram),u.quit&&(v=u.quit),u.wasmBinary&&(A=u.wasmBinary);var R=u.noExitRuntime||!0;"object"!=typeof WebAssembly&&re("no native wasm support detected");var M,k,D,j,$,N,L,F,U=!1,B="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function V(e,t,n){var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16<n-t&&e.buffer&&B)return B.decode(e.buffer instanceof SharedArrayBuffer?e.slice(t,n):e.subarray(t,n));for(r="";t<n;){var i=e[t++];if(128&i){var o=63&e[t++];if(192==(224&i))r+=String.fromCharCode((31&i)<<6|o);else{var s=63&e[t++];65536>(i=224==(240&i)?(15&i)<<12|o<<6|s:(7&i)<<18|o<<12|s<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function z(e,t){return(e>>>=0)?V(i(),e,t):""}function W(e,t,n,r){if(!(0<r))return 0;var i=n>>>=0;r=n+r-1;for(var o=0;o<e.length;++o){var s=e.charCodeAt(o);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++o)),127>=s){if(n>=r)break;t[n++>>>0]=s}else{if(2047>=s){if(n+1>=r)break;t[n++>>>0]=192|s>>6}else{if(65535>=s){if(n+2>=r)break;t[n++>>>0]=224|s>>12}else{if(n+3>=r)break;t[n++>>>0]=240|s>>18,t[n++>>>0]=128|s>>12&63}t[n++>>>0]=128|s>>6&63}t[n++>>>0]=128|63&s}}return t[n>>>0]=0,n-i}function G(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t}function H(e){D=e,u.HEAP8=j=new Int8Array(e),u.HEAP16=new Int16Array(e),u.HEAP32=N=new Int32Array(e),u.HEAPU8=$=new Uint8Array(e),u.HEAPU16=new Uint16Array(e),u.HEAPU32=L=new Uint32Array(e),u.HEAPF32=new Float32Array(e),u.HEAPF64=F=new Float64Array(e)}T&&(D=u.buffer);var q=u.INITIAL_MEMORY||16777216;if(T)M=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)M=u.wasmMemory;else if(!((M=new WebAssembly.Memory({initial:q/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw I("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),x&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");M&&(D=M.buffer),q=D.byteLength,H(D);var K,Y=[],X=[],J=[];function Z(){var e=u.preRun.shift();Y.unshift(e)}var Q,ee=0,te=null,ne=null;function re(e){throw T?postMessage({cmd:"onAbort",arg:e}):u.onAbort&&u.onAbort(e),I(e="Aborted("+e+")"),U=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),l(e),e}function ie(){return Q.startsWith("data:application/octet-stream;base64,")}function oe(){var e=Q;try{if(e==Q&&A)return new Uint8Array(A);if(h)return h(e);throw"both async and sync fetching of the wasm failed"}catch(e){re(e)}}Q="ort-wasm-threaded.wasm",ie()||(Q=O(Q));var se={};function ae(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function ue(e){(e=fe.La[e])||re(),fe.Xa(e)}function ce(e){var t=fe.lb();if(!t)return 6;fe.Ra.push(t),fe.La[e.Ka]=t,t.Ka=e.Ka;var n={cmd:"run",start_routine:e.pb,arg:e.ib,pthread_ptr:e.Ka};return t.Qa=()=>{n.time=performance.now(),t.postMessage(n,e.vb)},t.loaded&&(t.Qa(),delete t.Qa),0}function le(e){if(T)return Ue(1,1,e);R||(fe.qb(),u.onExit&&u.onExit(e),U=!0),v(e,new ae(e))}function de(e,t){if(!t&&T)throw pe(e),"unwind";le(e)}var fe={Oa:[],Ra:[],$a:[],La:{},Ua:function(){T&&fe.mb()},xb:function(){},mb:function(){fe.receiveObjectTransfer=fe.ob,fe.threadInitTLS=fe.Za,fe.setExitStatus=fe.Ya,R=!1},Ya:function(){},qb:function(){for(var e of Object.values(fe.La))fe.Xa(e);for(e of fe.Oa)e.terminate();fe.Oa=[]},Xa:function(e){var t=e.Ka;delete fe.La[t],fe.Oa.push(e),fe.Ra.splice(fe.Ra.indexOf(e),1),e.Ka=0,lt(t)},ob:function(){},Za:function(){fe.$a.forEach((e=>e()))},nb:function(e,t){e.onmessage=n=>{var r=(n=n.data).cmd;if(e.Ka&&(fe.kb=e.Ka),n.targetThread&&n.targetThread!=it()){var i=fe.La[n.yb];i?i.postMessage(n,n.transferList):I('Internal error! Worker sent a message "'+r+'" to target pthread '+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?De(n.queue):"spawnThread"===r?ce(n):"cleanupThread"===r?ue(n.thread):"killThread"===r?(n=n.thread,r=fe.La[n],delete fe.La[n],r.terminate(),lt(n),fe.Ra.splice(fe.Ra.indexOf(r),1),r.Ka=0):"cancelThread"===r?fe.La[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(e.loaded=!0,t&&t(e),e.Qa&&(e.Qa(),delete e.Qa)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?I("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?e.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&I("worker sent an unknown command "+r);fe.kb=void 0},e.onerror=e=>{throw I("worker sent an error! "+e.filename+":"+e.lineno+": "+e.message),e},x&&(e.on("message",(function(t){e.onmessage({data:t})})),e.on("error",(function(t){e.onerror(t)})),e.on("detachedExit",(function(){}))),e.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||r,wasmMemory:M,wasmModule:k})},hb:function(){var e=O("ort-wasm-threaded.worker.js");fe.Oa.push(new Worker(e))},lb:function(){return 0==fe.Oa.length&&(fe.hb(),fe.nb(fe.Oa[0])),fe.Oa.pop()}};function he(e){for(;0<e.length;)e.shift()(u)}function pe(e){if(T)return Ue(2,0,e);try{de(e)}catch(e){e instanceof ae||"unwind"==e||v(1,e)}}u.PThread=fe,u.establishStackSpace=function(){var e=it(),t=o()[e+44>>2>>>0];e=o()[e+48>>2>>>0],ft(t,t-e),pt(t)};var ge,me,be=[];function ye(e){this.Pa=e-24,this.gb=function(e){s()[this.Pa+4>>2>>>0]=e},this.cb=function(e){s()[this.Pa+8>>2>>>0]=e},this.eb=function(){o()[this.Pa>>2>>>0]=0},this.bb=function(){t()[this.Pa+12>>0>>>0]=0},this.fb=function(){t()[this.Pa+13>>0>>>0]=0},this.Ua=function(e,t){this.ab(),this.gb(e),this.cb(t),this.eb(),this.bb(),this.fb()},this.ab=function(){s()[this.Pa+16>>2>>>0]=0}}function ve(e,t,n,r){return T?Ue(3,1,e,t,n,r):_e(e,t,n,r)}function _e(e,t,n,r){if("undefined"==typeof SharedArrayBuffer)return I("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var i=[];return T&&0===i.length?ve(e,t,n,r):(e={pb:n,Ka:e,ib:r,vb:i},T?(e.wb="spawnThread",postMessage(e,i),0):ce(e))}function we(e,t,n){return T?Ue(4,1,e,t,n):0}function xe(e,t){if(T)return Ue(5,1,e,t)}function Te(e,t){if(T)return Ue(6,1,e,t)}function Se(e,t,n){if(T)return Ue(7,1,e,t,n)}function Oe(e,t,n){return T?Ue(8,1,e,t,n):0}function Ee(e,t){if(T)return Ue(9,1,e,t)}function Pe(e,t,n){if(T)return Ue(10,1,e,t,n)}function Ae(e,t,n,r){if(T)return Ue(11,1,e,t,n,r)}function Ce(e,t,n,r){if(T)return Ue(12,1,e,t,n,r)}function Ie(e,t,n,r){if(T)return Ue(13,1,e,t,n,r)}function Re(e){if(T)return Ue(14,1,e)}function Me(e,t){if(T)return Ue(15,1,e,t)}function ke(e,t,n){if(T)return Ue(16,1,e,t,n)}function De(e){Atomics.store(o(),e>>2,1),it()&&ct(e),Atomics.compareExchange(o(),e>>2,1,0)}function je(e){return s()[e>>>2]+4294967296*o()[e+4>>>2]}function $e(e,t,n,r,i,o){return T?Ue(17,1,e,t,n,r,i,o):-52}function Ne(e,t,n,r,i,o){if(T)return Ue(18,1,e,t,n,r,i,o)}function Le(e){var n=G(e)+1,r=ot(n);return r&&W(e,t(),r,n),r}function Fe(e,t,n){function r(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}if(T)return Ue(19,1,e,t,n);var i=(new Date).getFullYear(),a=new Date(i,0,1),u=new Date(i,6,1);i=a.getTimezoneOffset();var c=u.getTimezoneOffset(),l=Math.max(i,c);o()[e>>2>>>0]=60*l,o()[t>>2>>>0]=Number(i!=c),e=r(a),t=r(u),e=Le(e),t=Le(t),c<i?(s()[n>>2>>>0]=e,s()[n+4>>2>>>0]=t):(s()[n>>2>>>0]=t,s()[n+4>>2>>>0]=e)}function Ue(e,t){var n=arguments.length-2,r=arguments;return function(e){var t=ht();return e=e(),pt(t),e}((()=>{for(var i=gt(8*n),o=i>>3,s=0;s<n;s++){var u=r[2+s];a()[o+s>>>0]=u}return ut(e,n,i,t)}))}u.invokeEntryPoint=function(e,t){var n=be[e];n||(e>=be.length&&(be.length=e+1),be[e]=n=K.get(e)),e=n(t),R?fe.Ya(e):dt(e)},u.executeNotifiedProxyingQueue=De,me=x?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:T?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var Be,Ve=[],ze={};function We(){if(!Be){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:y||"./this.program"};for(e in ze)void 0===ze[e]?delete t[e]:t[e]=ze[e];var n=[];for(e in t)n.push(e+"="+t[e]);Be=n}return Be}function Ge(e,n){if(T)return Ue(20,1,e,n);var r=0;return We().forEach((function(i,o){var a=n+r;for(o=s()[e+4*o>>2>>>0]=a,a=0;a<i.length;++a)t()[o++>>0>>>0]=i.charCodeAt(a);t()[o>>0>>>0]=0,r+=i.length+1})),0}function He(e,t){if(T)return Ue(21,1,e,t);var n=We();s()[e>>2>>>0]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),s()[t>>2>>>0]=r,0}function qe(e){return T?Ue(22,1,e):52}function Ke(e,t,n,r){return T?Ue(23,1,e,t,n,r):52}function Ye(e,t,n,r,i){return T?Ue(24,1,e,t,n,r,i):70}var Xe=[null,[],[]];function Je(e,t,n,r){if(T)return Ue(25,1,e,t,n,r);for(var o=0,a=0;a<n;a++){var u=s()[t>>2>>>0],c=s()[t+4>>2>>>0];t+=8;for(var l=0;l<c;l++){var d=i()[u+l>>>0],f=Xe[e];0===d||10===d?((1===e?C:I)(V(f,0)),f.length=0):f.push(d)}o+=c}return s()[r>>2>>>0]=o,0}function Ze(e){return 0==e%4&&(0!=e%100||0==e%400)}var Qe=[31,29,31,30,31,30,31,31,30,31,30,31],et=[31,28,31,30,31,30,31,31,30,31,30,31];function tt(e,n,r,i){function s(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=n[0]+e;return e}function a(e,t){return s(e,t,"0")}function u(e,t){function n(e){return 0>e?-1:0<e?1:0}var r;return 0===(r=n(e.getFullYear()-t.getFullYear()))&&0===(r=n(e.getMonth()-t.getMonth()))&&(r=n(e.getDate()-t.getDate())),r}function c(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function l(e){var t=e.Ma;for(e=new Date(new Date(e.Na+1900,0,1).getTime());0<t;){var n=e.getMonth(),r=(Ze(e.getFullYear())?Qe:et)[n];if(!(t>r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return n=new Date(e.getFullYear()+1,0,4),t=c(new Date(e.getFullYear(),0,4)),n=c(n),0>=u(t,e)?0>=u(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var d=o()[i+40>>2>>>0];for(var f in i={tb:o()[i>>2>>>0],sb:o()[i+4>>2>>>0],Sa:o()[i+8>>2>>>0],Va:o()[i+12>>2>>>0],Ta:o()[i+16>>2>>>0],Na:o()[i+20>>2>>>0],Ja:o()[i+24>>2>>>0],Ma:o()[i+28>>2>>>0],zb:o()[i+32>>2>>>0],rb:o()[i+36>>2>>>0],ub:d?z(d):""},r=z(r),d={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(f,"g"),d[f]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(f in d={"%a":function(e){return h[e.Ja].substring(0,3)},"%A":function(e){return h[e.Ja]},"%b":function(e){return p[e.Ta].substring(0,3)},"%B":function(e){return p[e.Ta]},"%C":function(e){return a((e.Na+1900)/100|0,2)},"%d":function(e){return a(e.Va,2)},"%e":function(e){return s(e.Va,2," ")},"%g":function(e){return l(e).toString().substring(2)},"%G":function(e){return l(e)},"%H":function(e){return a(e.Sa,2)},"%I":function(e){return 0==(e=e.Sa)?e=12:12<e&&(e-=12),a(e,2)},"%j":function(e){for(var t=0,n=0;n<=e.Ta-1;t+=(Ze(e.Na+1900)?Qe:et)[n++]);return a(e.Va+t,3)},"%m":function(e){return a(e.Ta+1,2)},"%M":function(e){return a(e.sb,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.Sa&&12>e.Sa?"AM":"PM"},"%S":function(e){return a(e.tb,2)},"%t":function(){return"\t"},"%u":function(e){return e.Ja||7},"%U":function(e){return a(Math.floor((e.Ma+7-e.Ja)/7),2)},"%V":function(e){var t=Math.floor((e.Ma+7-(e.Ja+6)%7)/7);if(2>=(e.Ja+371-e.Ma-2)%7&&t++,t)53==t&&(4==(n=(e.Ja+371-e.Ma)%7)||3==n&&Ze(e.Na)||(t=1));else{t=52;var n=(e.Ja+7-e.Ma-1)%7;(4==n||5==n&&Ze(e.Na%400-1))&&t++}return a(t,2)},"%w":function(e){return e.Ja},"%W":function(e){return a(Math.floor((e.Ma+7-(e.Ja+6)%7)/7),2)},"%y":function(e){return(e.Na+1900).toString().substring(2)},"%Y":function(e){return e.Na+1900},"%z":function(e){var t=0<=(e=e.rb);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.ub},"%%":function(){return"%"}},r=r.replace(/%%/g,"\0\0"),d)r.includes(f)&&(r=r.replace(new RegExp(f,"g"),d[f](i)));return f=function(e){var t=Array(G(e)+1);return W(e,t,0,t.length),t}(r=r.replace(/\0\0/g,"%")),f.length>n?0:(function(e,n){t().set(e,n>>>0)}(f,e),f.length-1)}fe.Ua();var nt=[null,le,pe,ve,we,xe,Te,Se,Oe,Ee,Pe,Ae,Ce,Ie,Re,Me,ke,$e,Ne,Fe,Ge,He,qe,Ke,Ye,Je],rt={b:function(e){return ot(e+24)+24},c:function(e,t,n){throw new ye(e).Ua(t,n),e},L:function(e){st(e,!w,1,!_),fe.Za()},l:function(e){T?postMessage({cmd:"cleanupThread",thread:e}):ue(e)},D:_e,i:we,R:xe,z:Te,B:Se,T:Oe,P:Ee,I:Pe,O:Ae,p:Ce,A:Ie,x:Re,Q:Me,y:ke,r:function(){},j:function(){re("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},s:function(){re("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},q:function(){return Date.now()},E:function(){return 2097152},V:function(){return!0},F:function(e,t,n,r){if(e==t)setTimeout((()=>De(r)));else if(T)postMessage({targetThread:e,cmd:"processProxyingQueue",queue:r});else{if(!(e=fe.La[e]))return;e.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},K:function(){return-1},W:function(e,t){e=new Date(1e3*je(e)),o()[t>>2>>>0]=e.getUTCSeconds(),o()[t+4>>2>>>0]=e.getUTCMinutes(),o()[t+8>>2>>>0]=e.getUTCHours(),o()[t+12>>2>>>0]=e.getUTCDate(),o()[t+16>>2>>>0]=e.getUTCMonth(),o()[t+20>>2>>>0]=e.getUTCFullYear()-1900,o()[t+24>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,o()[t+28>>2>>>0]=e},X:function(e,t){e=new Date(1e3*je(e)),o()[t>>2>>>0]=e.getSeconds(),o()[t+4>>2>>>0]=e.getMinutes(),o()[t+8>>2>>>0]=e.getHours(),o()[t+12>>2>>>0]=e.getDate(),o()[t+16>>2>>>0]=e.getMonth(),o()[t+20>>2>>>0]=e.getFullYear()-1900,o()[t+24>>2>>>0]=e.getDay();var n=new Date(e.getFullYear(),0,1),r=(e.getTime()-n.getTime())/864e5|0;o()[t+28>>2>>>0]=r,o()[t+36>>2>>>0]=-60*e.getTimezoneOffset(),r=new Date(e.getFullYear(),6,1).getTimezoneOffset(),e=0|(r!=(n=n.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(n,r)),o()[t+32>>2>>>0]=e},Y:function(e){var t=new Date(o()[e+20>>2>>>0]+1900,o()[e+16>>2>>>0],o()[e+12>>2>>>0],o()[e+8>>2>>>0],o()[e+4>>2>>>0],o()[e>>2>>>0],0),n=o()[e+32>>2>>>0],r=t.getTimezoneOffset(),i=new Date(t.getFullYear(),0,1),s=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=i.getTimezoneOffset(),u=Math.min(a,s);return 0>n?o()[e+32>>2>>>0]=Number(s!=a&&u==r):0<n!=(u==r)&&(s=Math.max(a,s),t.setTime(t.getTime()+6e4*((0<n?u:s)-r))),o()[e+24>>2>>>0]=t.getDay(),n=(t.getTime()-i.getTime())/864e5|0,o()[e+28>>2>>>0]=n,o()[e>>2>>>0]=t.getSeconds(),o()[e+4>>2>>>0]=t.getMinutes(),o()[e+8>>2>>>0]=t.getHours(),o()[e+12>>2>>>0]=t.getDate(),o()[e+16>>2>>>0]=t.getMonth(),t.getTime()/1e3|0},G:$e,H:Ne,Z:function e(t,n,r){e.jb||(e.jb=!0,Fe(t,n,r))},d:function(){re("")},m:function(){if(!x&&!w){var e="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";ge||(ge={}),ge[e]||(ge[e]=1,x&&(e="warning: "+e),I(e))}},w:function(){return 4294901760},f:me,S:function(e,t,n){i().copyWithin(e>>>0,t>>>0,t+n>>>0)},g:function(){return x?n(3993).cpus().length:navigator.hardwareConcurrency},J:function(e,t,n){Ve.length=t,n>>=3;for(var r=0;r<t;r++)Ve[r]=a()[n+r>>>0];return(0>e?se[-e-1]:nt[e]).apply(null,Ve)},v:function(e){var t=i().length;if((e>>>=0)<=t||4294901760<e)return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);var o=Math;r=Math.max(e,r),o=o.min.call(o,4294901760,r+(65536-r%65536)%65536);e:{try{M.grow(o-D.byteLength+65535>>>16),H(M.buffer);var s=1;break e}catch(e){}s=void 0}if(s)return!0}return!1},U:function(){throw"unwind"},M:Ge,N:He,k:de,h:qe,o:Ke,t:Ye,n:Je,u:function e(r,i){e.Wa||(e.Wa=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(x)try{var t=n(760);return()=>t.randomBytes(1)[0]}catch(e){}return()=>re("randomDevice")}());for(var o=0;o<i;o++)t()[r+o>>0>>>0]=e.Wa();return 0},a:M||u.wasmMemory,C:tt,e:function(e,t,n,r){return tt(e,t,n,r)}};!function(){function e(e,t){u.asm=e.exports,fe.$a.push(u.asm.wa),K=u.asm.za,X.unshift(u.asm._),k=t,T||(ee--,u.monitorRunDependencies&&u.monitorRunDependencies(ee),0==ee&&(null!==te&&(clearInterval(te),te=null),ne&&(e=ne,ne=null,e())))}function t(t){e(t.instance,t.module)}function n(e){return function(){if(!A&&(_||w)){if("function"==typeof fetch&&!Q.startsWith("file://"))return fetch(Q,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Q+"'";return e.arrayBuffer()})).catch((function(){return oe()}));if(f)return new Promise((function(e,t){f(Q,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return oe()}))}().then((function(e){return WebAssembly.instantiate(e,r)})).then((function(e){return e})).then(e,(function(e){I("failed to asynchronously prepare wasm: "+e),re(e)}))}var r={a:rt};if(T||(ee++,u.monitorRunDependencies&&u.monitorRunDependencies(ee)),u.instantiateWasm)try{return u.instantiateWasm(r,e)}catch(e){return I("Module.instantiateWasm callback failed with error: "+e),!1}(A||"function"!=typeof WebAssembly.instantiateStreaming||ie()||Q.startsWith("file://")||x||"function"!=typeof fetch?n(t):fetch(Q,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(t,(function(e){return I("wasm streaming compile failed: "+e),I("falling back to ArrayBuffer instantiation"),n(t)}))}))).catch(l)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm._).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.$).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.aa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.ba).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.ca).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm.da).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.ea).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.fa).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.ga).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.ha).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.ia).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.ja).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.ka).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.la).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.ma).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.na).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.oa).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.pa).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.qa).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.ra).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.sa).apply(null,arguments)};var it=u._pthread_self=function(){return(it=u._pthread_self=u.asm.ta).apply(null,arguments)},ot=u._malloc=function(){return(ot=u._malloc=u.asm.ua).apply(null,arguments)};u._free=function(){return(u._free=u.asm.va).apply(null,arguments)},u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.wa).apply(null,arguments)};var st=u.__emscripten_thread_init=function(){return(st=u.__emscripten_thread_init=u.asm.xa).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.ya).apply(null,arguments)};var at,ut=u._emscripten_run_in_main_runtime_thread_js=function(){return(ut=u._emscripten_run_in_main_runtime_thread_js=u.asm.Aa).apply(null,arguments)},ct=u.__emscripten_proxy_execute_task_queue=function(){return(ct=u.__emscripten_proxy_execute_task_queue=u.asm.Ba).apply(null,arguments)},lt=u.__emscripten_thread_free_data=function(){return(lt=u.__emscripten_thread_free_data=u.asm.Ca).apply(null,arguments)},dt=u.__emscripten_thread_exit=function(){return(dt=u.__emscripten_thread_exit=u.asm.Da).apply(null,arguments)},ft=u._emscripten_stack_set_limits=function(){return(ft=u._emscripten_stack_set_limits=u.asm.Ea).apply(null,arguments)},ht=u.stackSave=function(){return(ht=u.stackSave=u.asm.Fa).apply(null,arguments)},pt=u.stackRestore=function(){return(pt=u.stackRestore=u.asm.Ga).apply(null,arguments)},gt=u.stackAlloc=function(){return(gt=u.stackAlloc=u.asm.Ha).apply(null,arguments)};function mt(){function e(){if(!at&&(at=!0,u.calledRun=!0,!U)&&(T||he(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!T)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var e=u.postRun.shift();J.unshift(e)}he(J)}}if(!(0<ee))if(T)c(u),T||he(X),postMessage({cmd:"loaded"});else{if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)Z();he(Y),0<ee||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),e()}),1)):e())}}if(u.___cxa_is_pointer_type=function(){return(u.___cxa_is_pointer_type=u.asm.Ia).apply(null,arguments)},u.UTF8ToString=z,u.stringToUTF8=function(e,t,n){return W(e,i(),t,n)},u.lengthBytesUTF8=G,u.keepRuntimeAlive=function(){return R},u.wasmMemory=M,u.stackSave=ht,u.stackRestore=pt,u.stackAlloc=gt,u.ExitStatus=ae,u.PThread=fe,ne=function e(){at||mt(),at||(ne=e)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);0<u.preInit.length;)u.preInit.pop()();return mt(),e.ready});e.exports=i},932:(e,t,n)=>{var r,i=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){var t,i,o;e=e||{},t||(t=void 0!==e?e:{}),t.ready=new Promise((function(e,t){i=e,o=t}));var s,a,u,c,l,d,f=Object.assign({},t),h="./this.program",p=(e,t)=>{throw t},g="object"==typeof window,m="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y="";b?(y=m?n(908).dirname(y)+"/":"//",d=()=>{l||(c=n(1384),l=n(908))},s=function(e,t){return d(),e=l.normalize(e),c.readFileSync(e,t?void 0:"utf8")},u=e=>((e=s(e,!0)).buffer||(e=new Uint8Array(e)),e),a=(e,t,n)=>{d(),e=l.normalize(e),c.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},1<process.argv.length&&(h=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof K))throw e})),process.on("unhandledRejection",(function(e){throw e})),p=(e,t)=>{if(x)throw process.exitCode=e,t;t instanceof K||w("exiting due to exception: "+t),process.exit(e)},t.inspect=function(){return"[Emscripten Module object]"}):(g||m)&&(m?y=self.location.href:"undefined"!=typeof document&&document.currentScript&&(y=document.currentScript.src),r&&(y=r),y=0!==y.indexOf("blob:")?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},m&&(u=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),a=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)});var v,_=t.print||console.log.bind(console),w=t.printErr||console.warn.bind(console);Object.assign(t,f),f=null,t.thisProgram&&(h=t.thisProgram),t.quit&&(p=t.quit),t.wasmBinary&&(v=t.wasmBinary);var x=t.noExitRuntime||!0;"object"!=typeof WebAssembly&&W("no native wasm support detected");var T,S,O,E,P,A,C=!1,I="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(e,t,n){var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16<n-t&&e.buffer&&I)return I.decode(e.subarray(t,n));for(r="";t<n;){var i=e[t++];if(128&i){var o=63&e[t++];if(192==(224&i))r+=String.fromCharCode((31&i)<<6|o);else{var s=63&e[t++];65536>(i=224==(240&i)?(15&i)<<12|o<<6|s:(7&i)<<18|o<<12|s<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function M(e,t){return(e>>>=0)?R(E,e,t):""}function k(e,t,n,r){if(!(0<r))return 0;var i=n>>>=0;r=n+r-1;for(var o=0;o<e.length;++o){var s=e.charCodeAt(o);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++o)),127>=s){if(n>=r)break;t[n++>>>0]=s}else{if(2047>=s){if(n+1>=r)break;t[n++>>>0]=192|s>>6}else{if(65535>=s){if(n+2>=r)break;t[n++>>>0]=224|s>>12}else{if(n+3>=r)break;t[n++>>>0]=240|s>>18,t[n++>>>0]=128|s>>12&63}t[n++>>>0]=128|s>>6&63}t[n++>>>0]=128|63&s}}return t[n>>>0]=0,n-i}function D(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t}function j(){var e=T.buffer;S=e,t.HEAP8=O=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=P=new Int32Array(e),t.HEAPU8=E=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=A=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}var $=[],N=[],L=[];function F(){var e=t.preRun.shift();$.unshift(e)}var U,B=0,V=null,z=null;function W(e){throw t.onAbort&&t.onAbort(e),w(e="Aborted("+e+")"),C=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),o(e),e}function G(){return U.startsWith("data:application/octet-stream;base64,")}if(U="ort-wasm.wasm",!G()){var H=U;U=t.locateFile?t.locateFile(H,y):y+H}function q(){var e=U;try{if(e==U&&v)return new Uint8Array(v);if(u)return u(e);throw"both async and sync fetching of the wasm failed"}catch(e){W(e)}}function K(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Y(e){for(;0<e.length;)e.shift()(t)}function X(e){this.sa=e-24,this.Ia=function(e){A[this.sa+4>>2>>>0]=e},this.Ba=function(e){A[this.sa+8>>2>>>0]=e},this.Ga=function(){P[this.sa>>2>>>0]=0},this.Aa=function(){O[this.sa+12>>0>>>0]=0},this.Ha=function(){O[this.sa+13>>0>>>0]=0},this.ya=function(e,t){this.za(),this.Ia(e),this.Ba(t),this.Ga(),this.Aa(),this.Ha()},this.za=function(){A[this.sa+16>>2>>>0]=0}}function J(e){var t=D(e)+1,n=ae(t);return n&&k(e,O,n,t),n}var Z={};function Q(){if(!ee){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:h||"./this.program"};for(e in Z)void 0===Z[e]?delete t[e]:t[e]=Z[e];var n=[];for(e in t)n.push(e+"="+t[e]);ee=n}return ee}var ee,te=[null,[],[]];function ne(e){return 0==e%4&&(0!=e%100||0==e%400)}var re=[31,29,31,30,31,30,31,31,30,31,30,31],ie=[31,28,31,30,31,30,31,31,30,31,30,31];function oe(e,t,n,r){function i(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=n[0]+e;return e}function o(e,t){return i(e,t,"0")}function s(e,t){function n(e){return 0>e?-1:0<e?1:0}var r;return 0===(r=n(e.getFullYear()-t.getFullYear()))&&0===(r=n(e.getMonth()-t.getMonth()))&&(r=n(e.getDate()-t.getDate())),r}function a(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function u(e){var t=e.qa;for(e=new Date(new Date(e.ra+1900,0,1).getTime());0<t;){var n=e.getMonth(),r=(ne(e.getFullYear())?re:ie)[n];if(!(t>r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return n=new Date(e.getFullYear()+1,0,4),t=a(new Date(e.getFullYear(),0,4)),n=a(n),0>=s(t,e)?0>=s(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var c=P[r+40>>2>>>0];for(var l in r={Ea:P[r>>2>>>0],Da:P[r+4>>2>>>0],ta:P[r+8>>2>>>0],va:P[r+12>>2>>>0],ua:P[r+16>>2>>>0],ra:P[r+20>>2>>>0],la:P[r+24>>2>>>0],qa:P[r+28>>2>>>0],Ja:P[r+32>>2>>>0],Ca:P[r+36>>2>>>0],Fa:c?M(c):""},n=M(n),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),c[l]);var d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),f="January February March April May June July August September October November December".split(" ");for(l in c={"%a":function(e){return d[e.la].substring(0,3)},"%A":function(e){return d[e.la]},"%b":function(e){return f[e.ua].substring(0,3)},"%B":function(e){return f[e.ua]},"%C":function(e){return o((e.ra+1900)/100|0,2)},"%d":function(e){return o(e.va,2)},"%e":function(e){return i(e.va,2," ")},"%g":function(e){return u(e).toString().substring(2)},"%G":function(e){return u(e)},"%H":function(e){return o(e.ta,2)},"%I":function(e){return 0==(e=e.ta)?e=12:12<e&&(e-=12),o(e,2)},"%j":function(e){for(var t=0,n=0;n<=e.ua-1;t+=(ne(e.ra+1900)?re:ie)[n++]);return o(e.va+t,3)},"%m":function(e){return o(e.ua+1,2)},"%M":function(e){return o(e.Da,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.ta&&12>e.ta?"AM":"PM"},"%S":function(e){return o(e.Ea,2)},"%t":function(){return"\t"},"%u":function(e){return e.la||7},"%U":function(e){return o(Math.floor((e.qa+7-e.la)/7),2)},"%V":function(e){var t=Math.floor((e.qa+7-(e.la+6)%7)/7);if(2>=(e.la+371-e.qa-2)%7&&t++,t)53==t&&(4==(n=(e.la+371-e.qa)%7)||3==n&&ne(e.ra)||(t=1));else{t=52;var n=(e.la+7-e.qa-1)%7;(4==n||5==n&&ne(e.ra%400-1))&&t++}return o(t,2)},"%w":function(e){return e.la},"%W":function(e){return o(Math.floor((e.qa+7-(e.la+6)%7)/7),2)},"%y":function(e){return(e.ra+1900).toString().substring(2)},"%Y":function(e){return e.ra+1900},"%z":function(e){var t=0<=(e=e.Ca);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.Fa},"%%":function(){return"%"}},n=n.replace(/%%/g,"\0\0"),c)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),c[l](r)));return l=function(e){var t=Array(D(e)+1);return k(e,t,0,t.length),t}(n=n.replace(/\0\0/g,"%")),l.length>t?0:(O.set(l,e>>>0),l.length-1)}var se={a:function(e){return ae(e+24)+24},b:function(e,t,n){throw new X(e).ya(t,n),e},g:function(){return 0},I:function(){},w:function(){},y:function(){},K:function(){return 0},G:function(){},C:function(){},F:function(){},k:function(){},x:function(){},u:function(){},H:function(){},v:function(){},n:function(){},p:function(){W("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},o:function(){W("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},l:function(){return Date.now()},L:function(){return!0},M:function(e,t){e=new Date(1e3*(A[e>>>2]+4294967296*P[e+4>>>2])),P[t>>2>>>0]=e.getUTCSeconds(),P[t+4>>2>>>0]=e.getUTCMinutes(),P[t+8>>2>>>0]=e.getUTCHours(),P[t+12>>2>>>0]=e.getUTCDate(),P[t+16>>2>>>0]=e.getUTCMonth(),P[t+20>>2>>>0]=e.getUTCFullYear()-1900,P[t+24>>2>>>0]=e.getUTCDay(),P[t+28>>2>>>0]=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},N:function(e,t){e=new Date(1e3*(A[e>>>2]+4294967296*P[e+4>>>2])),P[t>>2>>>0]=e.getSeconds(),P[t+4>>2>>>0]=e.getMinutes(),P[t+8>>2>>>0]=e.getHours(),P[t+12>>2>>>0]=e.getDate(),P[t+16>>2>>>0]=e.getMonth(),P[t+20>>2>>>0]=e.getFullYear()-1900,P[t+24>>2>>>0]=e.getDay();var n=new Date(e.getFullYear(),0,1);P[t+28>>2>>>0]=(e.getTime()-n.getTime())/864e5|0,P[t+36>>2>>>0]=-60*e.getTimezoneOffset();var r=new Date(e.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),P[t+32>>2>>>0]=0|(r!=n&&e.getTimezoneOffset()==Math.min(n,r))},O:function(e){var t=new Date(P[e+20>>2>>>0]+1900,P[e+16>>2>>>0],P[e+12>>2>>>0],P[e+8>>2>>>0],P[e+4>>2>>>0],P[e>>2>>>0],0),n=P[e+32>>2>>>0],r=t.getTimezoneOffset(),i=new Date(t.getFullYear(),0,1),o=new Date(t.getFullYear(),6,1).getTimezoneOffset(),s=i.getTimezoneOffset(),a=Math.min(s,o);return 0>n?P[e+32>>2>>>0]=Number(o!=s&&a==r):0<n!=(a==r)&&(o=Math.max(s,o),t.setTime(t.getTime()+6e4*((0<n?a:o)-r))),P[e+24>>2>>>0]=t.getDay(),P[e+28>>2>>>0]=(t.getTime()-i.getTime())/864e5|0,P[e>>2>>>0]=t.getSeconds(),P[e+4>>2>>>0]=t.getMinutes(),P[e+8>>2>>>0]=t.getHours(),P[e+12>>2>>>0]=t.getDate(),P[e+16>>2>>>0]=t.getMonth(),t.getTime()/1e3|0},z:function(){return-52},B:function(){},m:function e(t,n,r){e.xa||(e.xa=!0,function(e,t,n){function r(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}var i=(new Date).getFullYear(),o=new Date(i,0,1),s=new Date(i,6,1);i=o.getTimezoneOffset();var a=s.getTimezoneOffset();P[e>>2>>>0]=60*Math.max(i,a),P[t>>2>>>0]=Number(i!=a),e=r(o),t=r(s),e=J(e),t=J(t),a<i?(A[n>>2>>>0]=e,A[n+4>>2>>>0]=t):(A[n>>2>>>0]=t,A[n+4>>2>>>0]=e)}(t,n,r))},d:function(){W("")},t:function(){return 4294901760},h:b?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now(),J:function(e,t,n){E.copyWithin(e>>>0,t>>>0,t+n>>>0)},f:function(e){var t=E.length;if(4294901760<(e>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);var i=Math;r=Math.max(e,r),i=i.min.call(i,4294901760,r+(65536-r%65536)%65536);e:{try{T.grow(i-S.byteLength+65535>>>16),j();var o=1;break e}catch(e){}o=void 0}if(o)return!0}return!1},D:function(e,t){var n=0;return Q().forEach((function(r,i){var o=t+n;for(i=A[e+4*i>>2>>>0]=o,o=0;o<r.length;++o)O[i++>>0>>>0]=r.charCodeAt(o);O[i>>0>>>0]=0,n+=r.length+1})),0},E:function(e,t){var n=Q();A[e>>2>>>0]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),A[t>>2>>>0]=r,0},r:function(e){x||(t.onExit&&t.onExit(e),C=!0),p(e,new K(e))},e:function(){return 52},j:function(){return 52},q:function(){return 70},i:function(e,t,n,r){for(var i=0,o=0;o<n;o++){var s=A[t>>2>>>0],a=A[t+4>>2>>>0];t+=8;for(var u=0;u<a;u++){var c=E[s+u>>>0],l=te[e];0===c||10===c?((1===e?_:w)(R(l,0)),l.length=0):l.push(c)}i+=a}return A[r>>2>>>0]=i,0},s:function e(t,r){e.wa||(e.wa=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(b)try{var t=n(760);return()=>t.randomBytes(1)[0]}catch(e){}return()=>W("randomDevice")}());for(var i=0;i<r;i++)O[t+i>>0>>>0]=e.wa();return 0},A:oe,c:function(e,t,n,r){return oe(e,t,n,r)}};!function(){function e(e){t.asm=e.exports,T=t.asm.P,j(),N.unshift(t.asm.Q),B--,t.monitorRunDependencies&&t.monitorRunDependencies(B),0==B&&(null!==V&&(clearInterval(V),V=null),z&&(e=z,z=null,e()))}function n(t){e(t.instance)}function r(e){return function(){if(!v&&(g||m)){if("function"==typeof fetch&&!U.startsWith("file://"))return fetch(U,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+U+"'";return e.arrayBuffer()})).catch((function(){return q()}));if(a)return new Promise((function(e,t){a(U,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return q()}))}().then((function(e){return WebAssembly.instantiate(e,i)})).then((function(e){return e})).then(e,(function(e){w("failed to asynchronously prepare wasm: "+e),W(e)}))}var i={a:se};if(B++,t.monitorRunDependencies&&t.monitorRunDependencies(B),t.instantiateWasm)try{return t.instantiateWasm(i,e)}catch(e){return w("Module.instantiateWasm callback failed with error: "+e),!1}(v||"function"!=typeof WebAssembly.instantiateStreaming||G()||U.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(U,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,i).then(n,(function(e){return w("wasm streaming compile failed: "+e),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(o)}(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.Q).apply(null,arguments)},t._OrtInit=function(){return(t._OrtInit=t.asm.R).apply(null,arguments)},t._OrtCreateSessionOptions=function(){return(t._OrtCreateSessionOptions=t.asm.S).apply(null,arguments)},t._OrtAppendExecutionProvider=function(){return(t._OrtAppendExecutionProvider=t.asm.T).apply(null,arguments)},t._OrtAddSessionConfigEntry=function(){return(t._OrtAddSessionConfigEntry=t.asm.U).apply(null,arguments)},t._OrtReleaseSessionOptions=function(){return(t._OrtReleaseSessionOptions=t.asm.V).apply(null,arguments)},t._OrtCreateSession=function(){return(t._OrtCreateSession=t.asm.W).apply(null,arguments)},t._OrtReleaseSession=function(){return(t._OrtReleaseSession=t.asm.X).apply(null,arguments)},t._OrtGetInputCount=function(){return(t._OrtGetInputCount=t.asm.Y).apply(null,arguments)},t._OrtGetOutputCount=function(){return(t._OrtGetOutputCount=t.asm.Z).apply(null,arguments)},t._OrtGetInputName=function(){return(t._OrtGetInputName=t.asm._).apply(null,arguments)},t._OrtGetOutputName=function(){return(t._OrtGetOutputName=t.asm.$).apply(null,arguments)},t._OrtFree=function(){return(t._OrtFree=t.asm.aa).apply(null,arguments)},t._OrtCreateTensor=function(){return(t._OrtCreateTensor=t.asm.ba).apply(null,arguments)},t._OrtGetTensorData=function(){return(t._OrtGetTensorData=t.asm.ca).apply(null,arguments)},t._OrtReleaseTensor=function(){return(t._OrtReleaseTensor=t.asm.da).apply(null,arguments)},t._OrtCreateRunOptions=function(){return(t._OrtCreateRunOptions=t.asm.ea).apply(null,arguments)},t._OrtAddRunConfigEntry=function(){return(t._OrtAddRunConfigEntry=t.asm.fa).apply(null,arguments)},t._OrtReleaseRunOptions=function(){return(t._OrtReleaseRunOptions=t.asm.ga).apply(null,arguments)},t._OrtRun=function(){return(t._OrtRun=t.asm.ha).apply(null,arguments)},t._OrtEndProfiling=function(){return(t._OrtEndProfiling=t.asm.ia).apply(null,arguments)};var ae=t._malloc=function(){return(ae=t._malloc=t.asm.ja).apply(null,arguments)};t._free=function(){return(t._free=t.asm.ka).apply(null,arguments)};var ue,ce=t.stackSave=function(){return(ce=t.stackSave=t.asm.ma).apply(null,arguments)},le=t.stackRestore=function(){return(le=t.stackRestore=t.asm.na).apply(null,arguments)},de=t.stackAlloc=function(){return(de=t.stackAlloc=t.asm.oa).apply(null,arguments)};function fe(){function e(){if(!ue&&(ue=!0,t.calledRun=!0,!C)){if(Y(N),i(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;){var e=t.postRun.shift();L.unshift(e)}Y(L)}}if(!(0<B)){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)F();Y($),0<B||(t.setStatus?(t.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t.setStatus("")}),1),e()}),1)):e())}}if(t.___cxa_is_pointer_type=function(){return(t.___cxa_is_pointer_type=t.asm.pa).apply(null,arguments)},t.UTF8ToString=M,t.stringToUTF8=function(e,t,n){return k(e,E,t,n)},t.lengthBytesUTF8=D,t.stackSave=ce,t.stackRestore=le,t.stackAlloc=de,z=function e(){ue||fe(),ue||(z=e)},t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();return fe(),e.ready});e.exports=i},4537:e=>{"use strict";e.exports=function(e,t){for(var n=new Array(arguments.length-1),r=0,i=2,o=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise((function(i,s){n[r]=function(e){if(o)if(o=!1,e)s(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){o&&(o=!1,s(e))}}))}},7419:(e,t)=>{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),i=new Array(123),o=0;o<64;)i[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;n.encode=function(e,t,n){for(var i,o=null,s=[],a=0,u=0;t<n;){var c=e[t++];switch(u){case 0:s[a++]=r[c>>2],i=(3&c)<<4,u=1;break;case 1:s[a++]=r[i|c>>4],i=(15&c)<<2,u=2;break;case 2:s[a++]=r[i|c>>6],s[a++]=r[63&c],u=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return u&&(s[a++]=r[i],s[a++]=61,1===u&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";n.decode=function(e,t,n){for(var r,o=n,a=0,u=0;u<e.length;){var c=e.charCodeAt(u++);if(61===c&&a>1)break;if(void 0===(c=i[c]))throw Error(s);switch(a){case 0:r=c,a=1;break;case 1:t[n++]=r<<2|(48&c)>>4,r=c,a=2;break;case 2:t[n++]=(15&r)<<4|(60&c)>>2,r=c,a=3;break;case 3:t[n++]=(3&r)<<6|c,a=0}}if(1===a)throw Error(s);return n-o},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},9211:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},945:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function o(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function s(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function a(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?i:o,e.writeFloatBE=r?o:i,e.readFloatLE=r?s:a,e.readFloatBE=r?a:s}():function(){function t(e,t,n,r){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,n,r)}}function s(e,t,n){var r=e(t,n),i=2*(r>>31)+1,o=r>>>23&255,s=8388607&r;return 255===o?s?NaN:i*(1/0):0===o?1401298464324817e-60*i*s:i*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=s.bind(null,i),e.readFloatBE=s.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function o(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function s(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function a(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?i:o,e.writeDoubleBE=r?o:i,e.readDoubleLE=r?s:a,e.readDoubleBE=r?a:s}():function(){function t(e,t,n,r,i,o){var s=r<0?1:0;if(s&&(r=-r),0===r)e(0,i,o+t),e(1/r>0?0:2147483648,i,o+n);else if(isNaN(r))e(0,i,o+t),e(2146959360,i,o+n);else if(r>17976931348623157e292)e(0,i,o+t),e((s<<31|2146435072)>>>0,i,o+n);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,i,o+t),e((s<<31|a/4294967296)>>>0,i,o+n);else{var u=Math.floor(Math.log(r)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(a=r*Math.pow(2,-u))>>>0,i,o+t),e((s<<31|u+1023<<20|1048576*a&1048575)>>>0,i,o+n)}}}function s(e,t,n,r,i){var o=e(r,i+t),s=e(r,i+n),a=2*(s>>31)+1,u=s>>>20&2047,c=4294967296*(1048575&s)+o;return 2047===u?c?NaN:a*(1/0):0===u?5e-324*a*c:a*Math.pow(2,u-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=s.bind(null,i,0,4),e.readDoubleBE=s.bind(null,o,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},6662:e=>{"use strict";e.exports=function(e,t,n){var r=n||8192,i=r>>>1,o=null,s=r;return function(n){if(n<1||n>i)return e(n);s+n>r&&(o=e(r),s=0);var a=t.call(o,s,s+=n);return 7&s&&(s=1+(7|s)),a}}},4997:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,i=null,o=[],s=0;t<n;)(r=e[t++])<128?o[s++]=r:r>191&&r<224?o[s++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(r>>10),o[s++]=56320+(1023&r)):o[s++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))},n.write=function(e,t,n){for(var r,i,o=n,s=0;s<e.length;++s)(r=e.charCodeAt(s))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&i),++s,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-o}},3442:(e,t)=>{"use strict";t.__esModule=!0;var n=function(){function e(t){if(!t)throw new TypeError("Invalid argument; `value` has no value.");this.value=e.EMPTY,t&&e.isGuid(t)&&(this.value=t)}return e.isGuid=function(t){var n=t.toString();return t&&(t instanceof e||e.validator.test(n))},e.create=function(){return new e([e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-"))},e.createEmpty=function(){return new e("emptyguid")},e.parse=function(t){return new e(t)},e.raw=function(){return[e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-")},e.gen=function(e){for(var t="",n=0;n<e;n++)t+=(65536*(1+Math.random())|0).toString(16).substring(1);return t},e.prototype.equals=function(t){return e.isGuid(t)&&this.value===t.toString()},e.prototype.isEmpty=function(){return this.value===e.EMPTY},e.prototype.toString=function(){return this.value},e.prototype.toJSON=function(){return{value:this.value}},e.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),e.EMPTY="00000000-0000-0000-0000-000000000000",e}();t.Guid=n},3720:e=>{e.exports=n;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function r(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=r;var i={},o={};function s(e,t){var n,r,s;return t?(s=0<=(e>>>=0)&&e<256)&&(r=o[e])?r:(n=u(e,(0|e)<0?-1:0,!0),s&&(o[e]=n),n):(s=-128<=(e|=0)&&e<128)&&(r=i[e])?r:(n=u(e,e<0?-1:0,!1),s&&(i[e]=n),n)}function a(e,t){if(isNaN(e))return t?b:m;if(t){if(e<0)return b;if(e>=h)return x}else{if(e<=-p)return T;if(e+1>=p)return w}return e<0?a(-e,t).neg():u(e%f|0,e/f|0,t)}function u(e,t,r){return new n(e,t,r)}n.fromInt=s,n.fromNumber=a,n.fromBits=u;var c=Math.pow;function l(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return m;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return l(e.substring(1),t,n).neg();for(var i=a(c(n,8)),o=m,s=0;s<e.length;s+=8){var u=Math.min(8,e.length-s),d=parseInt(e.substring(s,s+u),n);if(u<8){var f=a(c(n,u));o=o.mul(f).add(a(d))}else o=(o=o.mul(i)).add(a(d))}return o.unsigned=t,o}function d(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?l(e,t):u(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=l,n.fromValue=d;var f=4294967296,h=f*f,p=h/2,g=s(1<<24),m=s(0);n.ZERO=m;var b=s(0,!0);n.UZERO=b;var y=s(1);n.ONE=y;var v=s(1,!0);n.UONE=v;var _=s(-1);n.NEG_ONE=_;var w=u(-1,2147483647,!1);n.MAX_VALUE=w;var x=u(-1,-1,!0);n.MAX_UNSIGNED_VALUE=x;var T=u(0,-2147483648,!1);n.MIN_VALUE=T;var S=n.prototype;S.toInt=function(){return this.unsigned?this.low>>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},S.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(T)){var t=a(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=a(c(e,6),this.unsigned),o=this,s="";;){var u=o.div(i),l=(o.sub(u.mul(i)).toInt()>>>0).toString(e);if((o=u).isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},S.isZero=function(){return 0===this.high&&0===this.low},S.eqz=S.isZero,S.isNegative=function(){return!this.unsigned&&this.high<0},S.isPositive=function(){return this.unsigned||this.high>=0},S.isOdd=function(){return 1==(1&this.low)},S.isEven=function(){return 0==(1&this.low)},S.equals=function(e){return r(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},S.eq=S.equals,S.notEquals=function(e){return!this.eq(e)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(e){return this.comp(e)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(e){return this.comp(e)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(e){return this.comp(e)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(e){return this.comp(e)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(e){if(r(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(y)},S.neg=S.negate,S.add=function(e){r(e)||(e=d(e));var t=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,s=e.high>>>16,a=65535&e.high,c=e.low>>>16,l=0,f=0,h=0,p=0;return h+=(p+=o+(65535&e.low))>>>16,f+=(h+=i+c)>>>16,l+=(f+=n+a)>>>16,l+=t+s,u((h&=65535)<<16|(p&=65535),(l&=65535)<<16|(f&=65535),this.unsigned)},S.subtract=function(e){return r(e)||(e=d(e)),this.add(e.neg())},S.sub=S.subtract,S.multiply=function(e){if(this.isZero())return m;if(r(e)||(e=d(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return m;if(this.eq(T))return e.isOdd()?T:m;if(e.eq(T))return this.isOdd()?T:m;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(g)&&e.lt(g))return a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,o=this.low>>>16,s=65535&this.low,c=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.low,p=0,b=0,y=0,v=0;return y+=(v+=s*h)>>>16,b+=(y+=o*h)>>>16,y&=65535,b+=(y+=s*f)>>>16,p+=(b+=i*h)>>>16,b&=65535,p+=(b+=o*f)>>>16,b&=65535,p+=(b+=s*l)>>>16,p+=n*h+i*f+o*l+s*c,u((y&=65535)<<16|(v&=65535),(p&=65535)<<16|(b&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(e){if(r(e)||(e=d(e)),e.isZero())throw Error("division by zero");var n,i,o;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?b:m;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return v;o=b}else{if(this.eq(T))return e.eq(y)||e.eq(_)?T:e.eq(T)?y:(n=this.shr(1).div(e).shl(1)).eq(m)?e.isNegative()?y:_:(i=this.sub(e.mul(n)),o=n.add(i.div(e)));if(e.eq(T))return this.unsigned?b:m;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=m}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),l=s<=48?1:c(2,s-48),f=a(n),h=f.mul(e);h.isNegative()||h.gt(i);)h=(f=a(n-=l,this.unsigned)).mul(e);f.isZero()&&(f=y),o=o.add(f),i=i.sub(h)}return o},S.div=S.divide,S.modulo=function(e){return r(e)||(e=d(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return u(~this.low,~this.high,this.unsigned)},S.and=function(e){return r(e)||(e=d(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},S.or=function(e){return r(e)||(e=d(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},S.xor=function(e){return r(e)||(e=d(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},S.shiftLeft=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):u(0,this.low<<e-32,this.unsigned)},S.shl=S.shiftLeft,S.shiftRight=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(e){if(r(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},S.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},S.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},1446:(e,t,n)=>{"use strict";var r,i,o,s=n(2100),a=s.Reader,u=s.Writer,c=s.util,l=s.roots.default||(s.roots.default={});l.onnx=((o={}).Version=(r={},(i=Object.create(r))[r[0]="_START_VERSION"]=0,i[r[1]="IR_VERSION_2017_10_10"]=1,i[r[2]="IR_VERSION_2017_10_30"]=2,i[r[3]="IR_VERSION_2017_11_3"]=3,i[r[4]="IR_VERSION_2019_1_22"]=4,i[r[5]="IR_VERSION"]=5,i),o.AttributeProto=function(){function e(e){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.refAttrName="",e.prototype.docString="",e.prototype.type=0,e.prototype.f=0,e.prototype.i=c.Long?c.Long.fromBits(0,0,!1):0,e.prototype.s=c.newBuffer([]),e.prototype.t=null,e.prototype.g=null,e.prototype.floats=c.emptyArray,e.prototype.ints=c.emptyArray,e.prototype.strings=c.emptyArray,e.prototype.tensors=c.emptyArray,e.prototype.graphs=c.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.name&&e.hasOwnProperty("name")&&t.uint32(10).string(e.name),null!=e.f&&e.hasOwnProperty("f")&&t.uint32(21).float(e.f),null!=e.i&&e.hasOwnProperty("i")&&t.uint32(24).int64(e.i),null!=e.s&&e.hasOwnProperty("s")&&t.uint32(34).bytes(e.s),null!=e.t&&e.hasOwnProperty("t")&&l.onnx.TensorProto.encode(e.t,t.uint32(42).fork()).ldelim(),null!=e.g&&e.hasOwnProperty("g")&&l.onnx.GraphProto.encode(e.g,t.uint32(50).fork()).ldelim(),null!=e.floats&&e.floats.length){t.uint32(58).fork();for(var n=0;n<e.floats.length;++n)t.float(e.floats[n]);t.ldelim()}if(null!=e.ints&&e.ints.length){for(t.uint32(66).fork(),n=0;n<e.ints.length;++n)t.int64(e.ints[n]);t.ldelim()}if(null!=e.strings&&e.strings.length)for(n=0;n<e.strings.length;++n)t.uint32(74).bytes(e.strings[n]);if(null!=e.tensors&&e.tensors.length)for(n=0;n<e.tensors.length;++n)l.onnx.TensorProto.encode(e.tensors[n],t.uint32(82).fork()).ldelim();if(null!=e.graphs&&e.graphs.length)for(n=0;n<e.graphs.length;++n)l.onnx.GraphProto.encode(e.graphs[n],t.uint32(90).fork()).ldelim();return null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(106).string(e.docString),null!=e.type&&e.hasOwnProperty("type")&&t.uint32(160).int32(e.type),null!=e.refAttrName&&e.hasOwnProperty("refAttrName")&&t.uint32(170).string(e.refAttrName),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.AttributeProto;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.name=e.string();break;case 21:r.refAttrName=e.string();break;case 13:r.docString=e.string();break;case 20:r.type=e.int32();break;case 2:r.f=e.float();break;case 3:r.i=e.int64();break;case 4:r.s=e.bytes();break;case 5:r.t=l.onnx.TensorProto.decode(e,e.uint32());break;case 6:r.g=l.onnx.GraphProto.decode(e,e.uint32());break;case 7:if(r.floats&&r.floats.length||(r.floats=[]),2==(7&i))for(var o=e.uint32()+e.pos;e.pos<o;)r.floats.push(e.float());else r.floats.push(e.float());break;case 8:if(r.ints&&r.ints.length||(r.ints=[]),2==(7&i))for(o=e.uint32()+e.pos;e.pos<o;)r.ints.push(e.int64());else r.ints.push(e.int64());break;case 9:r.strings&&r.strings.length||(r.strings=[]),r.strings.push(e.bytes());break;case 10:r.tensors&&r.tensors.length||(r.tensors=[]),r.tensors.push(l.onnx.TensorProto.decode(e,e.uint32()));break;case 11:r.graphs&&r.graphs.length||(r.graphs=[]),r.graphs.push(l.onnx.GraphProto.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!c.isString(e.name))return"name: string expected";if(null!=e.refAttrName&&e.hasOwnProperty("refAttrName")&&!c.isString(e.refAttrName))return"refAttrName: string expected";if(null!=e.docString&&e.hasOwnProperty("docString")&&!c.isString(e.docString))return"docString: string expected";if(null!=e.type&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:}if(null!=e.f&&e.hasOwnProperty("f")&&"number"!=typeof e.f)return"f: number expected";if(null!=e.i&&e.hasOwnProperty("i")&&!(c.isInteger(e.i)||e.i&&c.isInteger(e.i.low)&&c.isInteger(e.i.high)))return"i: integer|Long expected";if(null!=e.s&&e.hasOwnProperty("s")&&!(e.s&&"number"==typeof e.s.length||c.isString(e.s)))return"s: buffer expected";if(null!=e.t&&e.hasOwnProperty("t")&&(n=l.onnx.TensorProto.verify(e.t)))return"t."+n;if(null!=e.g&&e.hasOwnProperty("g")&&(n=l.onnx.GraphProto.verify(e.g)))return"g."+n;if(null!=e.floats&&e.hasOwnProperty("floats")){if(!Array.isArray(e.floats))return"floats: array expected";for(var t=0;t<e.floats.length;++t)if("number"!=typeof e.floats[t])return"floats: number[] expected"}if(null!=e.ints&&e.hasOwnProperty("ints")){if(!Array.isArray(e.ints))return"ints: array expected";for(t=0;t<e.ints.length;++t)if(!(c.isInteger(e.ints[t])||e.ints[t]&&c.isInteger(e.ints[t].low)&&c.isInteger(e.ints[t].high)))return"ints: integer|Long[] expected"}if(null!=e.strings&&e.hasOwnProperty("strings")){if(!Array.isArray(e.strings))return"strings: array expected";for(t=0;t<e.strings.length;++t)if(!(e.strings[t]&&"number"==typeof e.strings[t].length||c.isString(e.strings[t])))return"strings: buffer[] expected"}if(null!=e.tensors&&e.hasOwnProperty("tensors")){if(!Array.isArray(e.tensors))return"tensors: array expected";for(t=0;t<e.tensors.length;++t)if(n=l.onnx.TensorProto.verify(e.tensors[t]))return"tensors."+n}if(null!=e.graphs&&e.hasOwnProperty("graphs")){if(!Array.isArray(e.graphs))return"graphs: array expected";for(t=0;t<e.graphs.length;++t){var n;if(n=l.onnx.GraphProto.verify(e.graphs[t]))return"graphs."+n}}return null},e.fromObject=function(e){if(e instanceof l.onnx.AttributeProto)return e;var t=new l.onnx.AttributeProto;switch(null!=e.name&&(t.name=String(e.name)),null!=e.refAttrName&&(t.refAttrName=String(e.refAttrName)),null!=e.docString&&(t.docString=String(e.docString)),e.type){case"UNDEFINED":case 0:t.type=0;break;case"FLOAT":case 1:t.type=1;break;case"INT":case 2:t.type=2;break;case"STRING":case 3:t.type=3;break;case"TENSOR":case 4:t.type=4;break;case"GRAPH":case 5:t.type=5;break;case"FLOATS":case 6:t.type=6;break;case"INTS":case 7:t.type=7;break;case"STRINGS":case 8:t.type=8;break;case"TENSORS":case 9:t.type=9;break;case"GRAPHS":case 10:t.type=10}if(null!=e.f&&(t.f=Number(e.f)),null!=e.i&&(c.Long?(t.i=c.Long.fromValue(e.i)).unsigned=!1:"string"==typeof e.i?t.i=parseInt(e.i,10):"number"==typeof e.i?t.i=e.i:"object"==typeof e.i&&(t.i=new c.LongBits(e.i.low>>>0,e.i.high>>>0).toNumber())),null!=e.s&&("string"==typeof e.s?c.base64.decode(e.s,t.s=c.newBuffer(c.base64.length(e.s)),0):e.s.length&&(t.s=e.s)),null!=e.t){if("object"!=typeof e.t)throw TypeError(".onnx.AttributeProto.t: object expected");t.t=l.onnx.TensorProto.fromObject(e.t)}if(null!=e.g){if("object"!=typeof e.g)throw TypeError(".onnx.AttributeProto.g: object expected");t.g=l.onnx.GraphProto.fromObject(e.g)}if(e.floats){if(!Array.isArray(e.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");t.floats=[];for(var n=0;n<e.floats.length;++n)t.floats[n]=Number(e.floats[n])}if(e.ints){if(!Array.isArray(e.ints))throw TypeError(".onnx.AttributeProto.ints: array expected");for(t.ints=[],n=0;n<e.ints.length;++n)c.Long?(t.ints[n]=c.Long.fromValue(e.ints[n])).unsigned=!1:"string"==typeof e.ints[n]?t.ints[n]=parseInt(e.ints[n],10):"number"==typeof e.ints[n]?t.ints[n]=e.ints[n]:"object"==typeof e.ints[n]&&(t.ints[n]=new c.LongBits(e.ints[n].low>>>0,e.ints[n].high>>>0).toNumber())}if(e.strings){if(!Array.isArray(e.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(t.strings=[],n=0;n<e.strings.length;++n)"string"==typeof e.strings[n]?c.base64.decode(e.strings[n],t.strings[n]=c.newBuffer(c.base64.length(e.strings[n])),0):e.strings[n].length&&(t.strings[n]=e.strings[n])}if(e.tensors){if(!Array.isArray(e.tensors))throw TypeError(".onnx.AttributeProto.tensors: array expected");for(t.tensors=[],n=0;n<e.tensors.length;++n){if("object"!=typeof e.tensors[n])throw TypeError(".onnx.AttributeProto.tensors: object expected");t.tensors[n]=l.onnx.TensorProto.fromObject(e.tensors[n])}}if(e.graphs){if(!Array.isArray(e.graphs))throw TypeError(".onnx.AttributeProto.graphs: array expected");for(t.graphs=[],n=0;n<e.graphs.length;++n){if("object"!=typeof e.graphs[n])throw TypeError(".onnx.AttributeProto.graphs: object expected");t.graphs[n]=l.onnx.GraphProto.fromObject(e.graphs[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.floats=[],n.ints=[],n.strings=[],n.tensors=[],n.graphs=[]),t.defaults){if(n.name="",n.f=0,c.Long){var r=new c.Long(0,0,!1);n.i=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.i=t.longs===String?"0":0;t.bytes===String?n.s="":(n.s=[],t.bytes!==Array&&(n.s=c.newBuffer(n.s))),n.t=null,n.g=null,n.docString="",n.type=t.enums===String?"UNDEFINED":0,n.refAttrName=""}if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.f&&e.hasOwnProperty("f")&&(n.f=t.json&&!isFinite(e.f)?String(e.f):e.f),null!=e.i&&e.hasOwnProperty("i")&&("number"==typeof e.i?n.i=t.longs===String?String(e.i):e.i:n.i=t.longs===String?c.Long.prototype.toString.call(e.i):t.longs===Number?new c.LongBits(e.i.low>>>0,e.i.high>>>0).toNumber():e.i),null!=e.s&&e.hasOwnProperty("s")&&(n.s=t.bytes===String?c.base64.encode(e.s,0,e.s.length):t.bytes===Array?Array.prototype.slice.call(e.s):e.s),null!=e.t&&e.hasOwnProperty("t")&&(n.t=l.onnx.TensorProto.toObject(e.t,t)),null!=e.g&&e.hasOwnProperty("g")&&(n.g=l.onnx.GraphProto.toObject(e.g,t)),e.floats&&e.floats.length){n.floats=[];for(var i=0;i<e.floats.length;++i)n.floats[i]=t.json&&!isFinite(e.floats[i])?String(e.floats[i]):e.floats[i]}if(e.ints&&e.ints.length)for(n.ints=[],i=0;i<e.ints.length;++i)"number"==typeof e.ints[i]?n.ints[i]=t.longs===String?String(e.ints[i]):e.ints[i]:n.ints[i]=t.longs===String?c.Long.prototype.toString.call(e.ints[i]):t.longs===Number?new c.LongBits(e.ints[i].low>>>0,e.ints[i].high>>>0).toNumber():e.ints[i];if(e.strings&&e.strings.length)for(n.strings=[],i=0;i<e.strings.length;++i)n.strings[i]=t.bytes===String?c.base64.encode(e.strings[i],0,e.strings[i].length):t.bytes===Array?Array.prototype.slice.call(e.strings[i]):e.strings[i];if(e.tensors&&e.tensors.length)for(n.tensors=[],i=0;i<e.tensors.length;++i)n.tensors[i]=l.onnx.TensorProto.toObject(e.tensors[i],t);if(e.graphs&&e.graphs.length)for(n.graphs=[],i=0;i<e.graphs.length;++i)n.graphs[i]=l.onnx.GraphProto.toObject(e.graphs[i],t);return null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),null!=e.type&&e.hasOwnProperty("type")&&(n.type=t.enums===String?l.onnx.AttributeProto.AttributeType[e.type]:e.type),null!=e.refAttrName&&e.hasOwnProperty("refAttrName")&&(n.refAttrName=e.refAttrName),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e.AttributeType=function(){var e={},t=Object.create(e);return t[e[0]="UNDEFINED"]=0,t[e[1]="FLOAT"]=1,t[e[2]="INT"]=2,t[e[3]="STRING"]=3,t[e[4]="TENSOR"]=4,t[e[5]="GRAPH"]=5,t[e[6]="FLOATS"]=6,t[e[7]="INTS"]=7,t[e[8]="STRINGS"]=8,t[e[9]="TENSORS"]=9,t[e[10]="GRAPHS"]=10,t}(),e}(),o.ValueInfoProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.type=null,e.prototype.docString="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.name&&e.hasOwnProperty("name")&&t.uint32(10).string(e.name),null!=e.type&&e.hasOwnProperty("type")&&l.onnx.TypeProto.encode(e.type,t.uint32(18).fork()).ldelim(),null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(26).string(e.docString),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.ValueInfoProto;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.name=e.string();break;case 2:r.type=l.onnx.TypeProto.decode(e,e.uint32());break;case 3:r.docString=e.string();break;default:e.skipType(7&i)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!c.isString(e.name))return"name: string expected";if(null!=e.type&&e.hasOwnProperty("type")){var t=l.onnx.TypeProto.verify(e.type);if(t)return"type."+t}return null!=e.docString&&e.hasOwnProperty("docString")&&!c.isString(e.docString)?"docString: string expected":null},e.fromObject=function(e){if(e instanceof l.onnx.ValueInfoProto)return e;var t=new l.onnx.ValueInfoProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.type){if("object"!=typeof e.type)throw TypeError(".onnx.ValueInfoProto.type: object expected");t.type=l.onnx.TypeProto.fromObject(e.type)}return null!=e.docString&&(t.docString=String(e.docString)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.name="",n.type=null,n.docString=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.type&&e.hasOwnProperty("type")&&(n.type=l.onnx.TypeProto.toObject(e.type,t)),null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),o.NodeProto=function(){function e(e){if(this.input=[],this.output=[],this.attribute=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.input=c.emptyArray,e.prototype.output=c.emptyArray,e.prototype.name="",e.prototype.opType="",e.prototype.domain="",e.prototype.attribute=c.emptyArray,e.prototype.docString="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.input&&e.input.length)for(var n=0;n<e.input.length;++n)t.uint32(10).string(e.input[n]);if(null!=e.output&&e.output.length)for(n=0;n<e.output.length;++n)t.uint32(18).string(e.output[n]);if(null!=e.name&&e.hasOwnProperty("name")&&t.uint32(26).string(e.name),null!=e.opType&&e.hasOwnProperty("opType")&&t.uint32(34).string(e.opType),null!=e.attribute&&e.attribute.length)for(n=0;n<e.attribute.length;++n)l.onnx.AttributeProto.encode(e.attribute[n],t.uint32(42).fork()).ldelim();return null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(50).string(e.docString),null!=e.domain&&e.hasOwnProperty("domain")&&t.uint32(58).string(e.domain),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.NodeProto;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.input&&r.input.length||(r.input=[]),r.input.push(e.string());break;case 2:r.output&&r.output.length||(r.output=[]),r.output.push(e.string());break;case 3:r.name=e.string();break;case 4:r.opType=e.string();break;case 7:r.domain=e.string();break;case 5:r.attribute&&r.attribute.length||(r.attribute=[]),r.attribute.push(l.onnx.AttributeProto.decode(e,e.uint32()));break;case 6:r.docString=e.string();break;default:e.skipType(7&i)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.input&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var t=0;t<e.input.length;++t)if(!c.isString(e.input[t]))return"input: string[] expected"}if(null!=e.output&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(t=0;t<e.output.length;++t)if(!c.isString(e.output[t]))return"output: string[] expected"}if(null!=e.name&&e.hasOwnProperty("name")&&!c.isString(e.name))return"name: string expected";if(null!=e.opType&&e.hasOwnProperty("opType")&&!c.isString(e.opType))return"opType: string expected";if(null!=e.domain&&e.hasOwnProperty("domain")&&!c.isString(e.domain))return"domain: string expected";if(null!=e.attribute&&e.hasOwnProperty("attribute")){if(!Array.isArray(e.attribute))return"attribute: array expected";for(t=0;t<e.attribute.length;++t){var n=l.onnx.AttributeProto.verify(e.attribute[t]);if(n)return"attribute."+n}}return null!=e.docString&&e.hasOwnProperty("docString")&&!c.isString(e.docString)?"docString: string expected":null},e.fromObject=function(e){if(e instanceof l.onnx.NodeProto)return e;var t=new l.onnx.NodeProto;if(e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.NodeProto.input: array expected");t.input=[];for(var n=0;n<e.input.length;++n)t.input[n]=String(e.input[n])}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.NodeProto.output: array expected");for(t.output=[],n=0;n<e.output.length;++n)t.output[n]=String(e.output[n])}if(null!=e.name&&(t.name=String(e.name)),null!=e.opType&&(t.opType=String(e.opType)),null!=e.domain&&(t.domain=String(e.domain)),e.attribute){if(!Array.isArray(e.attribute))throw TypeError(".onnx.NodeProto.attribute: array expected");for(t.attribute=[],n=0;n<e.attribute.length;++n){if("object"!=typeof e.attribute[n])throw TypeError(".onnx.NodeProto.attribute: object expected");t.attribute[n]=l.onnx.AttributeProto.fromObject(e.attribute[n])}}return null!=e.docString&&(t.docString=String(e.docString)),t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.input=[],n.output=[],n.attribute=[]),t.defaults&&(n.name="",n.opType="",n.docString="",n.domain=""),e.input&&e.input.length){n.input=[];for(var r=0;r<e.input.length;++r)n.input[r]=e.input[r]}if(e.output&&e.output.length)for(n.output=[],r=0;r<e.output.length;++r)n.output[r]=e.output[r];if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.opType&&e.hasOwnProperty("opType")&&(n.opType=e.opType),e.attribute&&e.attribute.length)for(n.attribute=[],r=0;r<e.attribute.length;++r)n.attribute[r]=l.onnx.AttributeProto.toObject(e.attribute[r],t);return null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),o.ModelProto=function(){function e(e){if(this.opsetImport=[],this.metadataProps=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.irVersion=c.Long?c.Long.fromBits(0,0,!1):0,e.prototype.opsetImport=c.emptyArray,e.prototype.producerName="",e.prototype.producerVersion="",e.prototype.domain="",e.prototype.modelVersion=c.Long?c.Long.fromBits(0,0,!1):0,e.prototype.docString="",e.prototype.graph=null,e.prototype.metadataProps=c.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.irVersion&&e.hasOwnProperty("irVersion")&&t.uint32(8).int64(e.irVersion),null!=e.producerName&&e.hasOwnProperty("producerName")&&t.uint32(18).string(e.producerName),null!=e.producerVersion&&e.hasOwnProperty("producerVersion")&&t.uint32(26).string(e.producerVersion),null!=e.domain&&e.hasOwnProperty("domain")&&t.uint32(34).string(e.domain),null!=e.modelVersion&&e.hasOwnProperty("modelVersion")&&t.uint32(40).int64(e.modelVersion),null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(50).string(e.docString),null!=e.graph&&e.hasOwnProperty("graph")&&l.onnx.GraphProto.encode(e.graph,t.uint32(58).fork()).ldelim(),null!=e.opsetImport&&e.opsetImport.length)for(var n=0;n<e.opsetImport.length;++n)l.onnx.OperatorSetIdProto.encode(e.opsetImport[n],t.uint32(66).fork()).ldelim();if(null!=e.metadataProps&&e.metadataProps.length)for(n=0;n<e.metadataProps.length;++n)l.onnx.StringStringEntryProto.encode(e.metadataProps[n],t.uint32(114).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.ModelProto;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.irVersion=e.int64();break;case 8:r.opsetImport&&r.opsetImport.length||(r.opsetImport=[]),r.opsetImport.push(l.onnx.OperatorSetIdProto.decode(e,e.uint32()));break;case 2:r.producerName=e.string();break;case 3:r.producerVersion=e.string();break;case 4:r.domain=e.string();break;case 5:r.modelVersion=e.int64();break;case 6:r.docString=e.string();break;case 7:r.graph=l.onnx.GraphProto.decode(e,e.uint32());break;case 14:r.metadataProps&&r.metadataProps.length||(r.metadataProps=[]),r.metadataProps.push(l.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.irVersion&&e.hasOwnProperty("irVersion")&&!(c.isInteger(e.irVersion)||e.irVersion&&c.isInteger(e.irVersion.low)&&c.isInteger(e.irVersion.high)))return"irVersion: integer|Long expected";if(null!=e.opsetImport&&e.hasOwnProperty("opsetImport")){if(!Array.isArray(e.opsetImport))return"opsetImport: array expected";for(var t=0;t<e.opsetImport.length;++t)if(n=l.onnx.OperatorSetIdProto.verify(e.opsetImport[t]))return"opsetImport."+n}if(null!=e.producerName&&e.hasOwnProperty("producerName")&&!c.isString(e.producerName))return"producerName: string expected";if(null!=e.producerVersion&&e.hasOwnProperty("producerVersion")&&!c.isString(e.producerVersion))return"producerVersion: string expected";if(null!=e.domain&&e.hasOwnProperty("domain")&&!c.isString(e.domain))return"domain: string expected";if(null!=e.modelVersion&&e.hasOwnProperty("modelVersion")&&!(c.isInteger(e.modelVersion)||e.modelVersion&&c.isInteger(e.modelVersion.low)&&c.isInteger(e.modelVersion.high)))return"modelVersion: integer|Long expected";if(null!=e.docString&&e.hasOwnProperty("docString")&&!c.isString(e.docString))return"docString: string expected";if(null!=e.graph&&e.hasOwnProperty("graph")&&(n=l.onnx.GraphProto.verify(e.graph)))return"graph."+n;if(null!=e.metadataProps&&e.hasOwnProperty("metadataProps")){if(!Array.isArray(e.metadataProps))return"metadataProps: array expected";for(t=0;t<e.metadataProps.length;++t){var n;if(n=l.onnx.StringStringEntryProto.verify(e.metadataProps[t]))return"metadataProps."+n}}return null},e.fromObject=function(e){if(e instanceof l.onnx.ModelProto)return e;var t=new l.onnx.ModelProto;if(null!=e.irVersion&&(c.Long?(t.irVersion=c.Long.fromValue(e.irVersion)).unsigned=!1:"string"==typeof e.irVersion?t.irVersion=parseInt(e.irVersion,10):"number"==typeof e.irVersion?t.irVersion=e.irVersion:"object"==typeof e.irVersion&&(t.irVersion=new c.LongBits(e.irVersion.low>>>0,e.irVersion.high>>>0).toNumber())),e.opsetImport){if(!Array.isArray(e.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");t.opsetImport=[];for(var n=0;n<e.opsetImport.length;++n){if("object"!=typeof e.opsetImport[n])throw TypeError(".onnx.ModelProto.opsetImport: object expected");t.opsetImport[n]=l.onnx.OperatorSetIdProto.fromObject(e.opsetImport[n])}}if(null!=e.producerName&&(t.producerName=String(e.producerName)),null!=e.producerVersion&&(t.producerVersion=String(e.producerVersion)),null!=e.domain&&(t.domain=String(e.domain)),null!=e.modelVersion&&(c.Long?(t.modelVersion=c.Long.fromValue(e.modelVersion)).unsigned=!1:"string"==typeof e.modelVersion?t.modelVersion=parseInt(e.modelVersion,10):"number"==typeof e.modelVersion?t.modelVersion=e.modelVersion:"object"==typeof e.modelVersion&&(t.modelVersion=new c.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber())),null!=e.docString&&(t.docString=String(e.docString)),null!=e.graph){if("object"!=typeof e.graph)throw TypeError(".onnx.ModelProto.graph: object expected");t.graph=l.onnx.GraphProto.fromObject(e.graph)}if(e.metadataProps){if(!Array.isArray(e.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(t.metadataProps=[],n=0;n<e.metadataProps.length;++n){if("object"!=typeof e.metadataProps[n])throw TypeError(".onnx.ModelProto.metadataProps: object expected");t.metadataProps[n]=l.onnx.StringStringEntryProto.fromObject(e.metadataProps[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.opsetImport=[],n.metadataProps=[]),t.defaults){if(c.Long){var r=new c.Long(0,0,!1);n.irVersion=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.irVersion=t.longs===String?"0":0;n.producerName="",n.producerVersion="",n.domain="",c.Long?(r=new c.Long(0,0,!1),n.modelVersion=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.modelVersion=t.longs===String?"0":0,n.docString="",n.graph=null}if(null!=e.irVersion&&e.hasOwnProperty("irVersion")&&("number"==typeof e.irVersion?n.irVersion=t.longs===String?String(e.irVersion):e.irVersion:n.irVersion=t.longs===String?c.Long.prototype.toString.call(e.irVersion):t.longs===Number?new c.LongBits(e.irVersion.low>>>0,e.irVersion.high>>>0).toNumber():e.irVersion),null!=e.producerName&&e.hasOwnProperty("producerName")&&(n.producerName=e.producerName),null!=e.producerVersion&&e.hasOwnProperty("producerVersion")&&(n.producerVersion=e.producerVersion),null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),null!=e.modelVersion&&e.hasOwnProperty("modelVersion")&&("number"==typeof e.modelVersion?n.modelVersion=t.longs===String?String(e.modelVersion):e.modelVersion:n.modelVersion=t.longs===String?c.Long.prototype.toString.call(e.modelVersion):t.longs===Number?new c.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber():e.modelVersion),null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),null!=e.graph&&e.hasOwnProperty("graph")&&(n.graph=l.onnx.GraphProto.toObject(e.graph,t)),e.opsetImport&&e.opsetImport.length){n.opsetImport=[];for(var i=0;i<e.opsetImport.length;++i)n.opsetImport[i]=l.onnx.OperatorSetIdProto.toObject(e.opsetImport[i],t)}if(e.metadataProps&&e.metadataProps.length)for(n.metadataProps=[],i=0;i<e.metadataProps.length;++i)n.metadataProps[i]=l.onnx.StringStringEntryProto.toObject(e.metadataProps[i],t);return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),o.StringStringEntryProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.key&&e.hasOwnProperty("key")&&t.uint32(10).string(e.key),null!=e.value&&e.hasOwnProperty("value")&&t.uint32(18).string(e.value),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.StringStringEntryProto;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&i)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!c.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!c.isString(e.value)?"value: string expected":null},e.fromObject=function(e){if(e instanceof l.onnx.StringStringEntryProto)return e;var t=new l.onnx.StringStringEntryProto;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.key="",n.value=""),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=e.value),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),o.TensorAnnotation=function(){function e(e){if(this.quantParameterTensorNames=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tensorName="",e.prototype.quantParameterTensorNames=c.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.tensorName&&e.hasOwnProperty("tensorName")&&t.uint32(10).string(e.tensorName),null!=e.quantParameterTensorNames&&e.quantParameterTensorNames.length)for(var n=0;n<e.quantParameterTensorNames.length;++n)l.onnx.StringStringEntryProto.encode(e.quantParameterTensorNames[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.TensorAnnotation;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.tensorName=e.string();break;case 2:r.quantParameterTensorNames&&r.quantParameterTensorNames.length||(r.quantParameterTensorNames=[]),r.quantParameterTensorNames.push(l.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tensorName&&e.hasOwnProperty("tensorName")&&!c.isString(e.tensorName))return"tensorName: string expected";if(null!=e.quantParameterTensorNames&&e.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(e.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var t=0;t<e.quantParameterTensorNames.length;++t){var n=l.onnx.StringStringEntryProto.verify(e.quantParameterTensorNames[t]);if(n)return"quantParameterTensorNames."+n}}return null},e.fromObject=function(e){if(e instanceof l.onnx.TensorAnnotation)return e;var t=new l.onnx.TensorAnnotation;if(null!=e.tensorName&&(t.tensorName=String(e.tensorName)),e.quantParameterTensorNames){if(!Array.isArray(e.quantParameterTensorNames))throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: array expected");t.quantParameterTensorNames=[];for(var n=0;n<e.quantParameterTensorNames.length;++n){if("object"!=typeof e.quantParameterTensorNames[n])throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: object expected");t.quantParameterTensorNames[n]=l.onnx.StringStringEntryProto.fromObject(e.quantParameterTensorNames[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.quantParameterTensorNames=[]),t.defaults&&(n.tensorName=""),null!=e.tensorName&&e.hasOwnProperty("tensorName")&&(n.tensorName=e.tensorName),e.quantParameterTensorNames&&e.quantParameterTensorNames.length){n.quantParameterTensorNames=[];for(var r=0;r<e.quantParameterTensorNames.length;++r)n.quantParameterTensorNames[r]=l.onnx.StringStringEntryProto.toObject(e.quantParameterTensorNames[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),o.GraphProto=function(){function e(e){if(this.node=[],this.initializer=[],this.input=[],this.output=[],this.valueInfo=[],this.quantizationAnnotation=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.node=c.emptyArray,e.prototype.name="",e.prototype.initializer=c.emptyArray,e.prototype.docString="",e.prototype.input=c.emptyArray,e.prototype.output=c.emptyArray,e.prototype.valueInfo=c.emptyArray,e.prototype.quantizationAnnotation=c.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.node&&e.node.length)for(var n=0;n<e.node.length;++n)l.onnx.NodeProto.encode(e.node[n],t.uint32(10).fork()).ldelim();if(null!=e.name&&e.hasOwnProperty("name")&&t.uint32(18).string(e.name),null!=e.initializer&&e.initializer.length)for(n=0;n<e.initializer.length;++n)l.onnx.TensorProto.encode(e.initializer[n],t.uint32(42).fork()).ldelim();if(null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(82).string(e.docString),null!=e.input&&e.input.length)for(n=0;n<e.input.length;++n)l.onnx.ValueInfoProto.encode(e.input[n],t.uint32(90).fork()).ldelim();if(null!=e.output&&e.output.length)for(n=0;n<e.output.length;++n)l.onnx.ValueInfoProto.encode(e.output[n],t.uint32(98).fork()).ldelim();if(null!=e.valueInfo&&e.valueInfo.length)for(n=0;n<e.valueInfo.length;++n)l.onnx.ValueInfoProto.encode(e.valueInfo[n],t.uint32(106).fork()).ldelim();if(null!=e.quantizationAnnotation&&e.quantizationAnnotation.length)for(n=0;n<e.quantizationAnnotation.length;++n)l.onnx.TensorAnnotation.encode(e.quantizationAnnotation[n],t.uint32(114).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.GraphProto;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push(l.onnx.NodeProto.decode(e,e.uint32()));break;case 2:r.name=e.string();break;case 5:r.initializer&&r.initializer.length||(r.initializer=[]),r.initializer.push(l.onnx.TensorProto.decode(e,e.uint32()));break;case 10:r.docString=e.string();break;case 11:r.input&&r.input.length||(r.input=[]),r.input.push(l.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 12:r.output&&r.output.length||(r.output=[]),r.output.push(l.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 13:r.valueInfo&&r.valueInfo.length||(r.valueInfo=[]),r.valueInfo.push(l.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 14:r.quantizationAnnotation&&r.quantizationAnnotation.length||(r.quantizationAnnotation=[]),r.quantizationAnnotation.push(l.onnx.TensorAnnotation.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.node&&e.hasOwnProperty("node")){if(!Array.isArray(e.node))return"node: array expected";for(var t=0;t<e.node.length;++t)if(n=l.onnx.NodeProto.verify(e.node[t]))return"node."+n}if(null!=e.name&&e.hasOwnProperty("name")&&!c.isString(e.name))return"name: string expected";if(null!=e.initializer&&e.hasOwnProperty("initializer")){if(!Array.isArray(e.initializer))return"initializer: array expected";for(t=0;t<e.initializer.length;++t)if(n=l.onnx.TensorProto.verify(e.initializer[t]))return"initializer."+n}if(null!=e.docString&&e.hasOwnProperty("docString")&&!c.isString(e.docString))return"docString: string expected";if(null!=e.input&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(t=0;t<e.input.length;++t)if(n=l.onnx.ValueInfoProto.verify(e.input[t]))return"input."+n}if(null!=e.output&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(t=0;t<e.output.length;++t)if(n=l.onnx.ValueInfoProto.verify(e.output[t]))return"output."+n}if(null!=e.valueInfo&&e.hasOwnProperty("valueInfo")){if(!Array.isArray(e.valueInfo))return"valueInfo: array expected";for(t=0;t<e.valueInfo.length;++t)if(n=l.onnx.ValueInfoProto.verify(e.valueInfo[t]))return"valueInfo."+n}if(null!=e.quantizationAnnotation&&e.hasOwnProperty("quantizationAnnotation")){if(!Array.isArray(e.quantizationAnnotation))return"quantizationAnnotation: array expected";for(t=0;t<e.quantizationAnnotation.length;++t){var n;if(n=l.onnx.TensorAnnotation.verify(e.quantizationAnnotation[t]))return"quantizationAnnotation."+n}}return null},e.fromObject=function(e){if(e instanceof l.onnx.GraphProto)return e;var t=new l.onnx.GraphProto;if(e.node){if(!Array.isArray(e.node))throw TypeError(".onnx.GraphProto.node: array expected");t.node=[];for(var n=0;n<e.node.length;++n){if("object"!=typeof e.node[n])throw TypeError(".onnx.GraphProto.node: object expected");t.node[n]=l.onnx.NodeProto.fromObject(e.node[n])}}if(null!=e.name&&(t.name=String(e.name)),e.initializer){if(!Array.isArray(e.initializer))throw TypeError(".onnx.GraphProto.initializer: array expected");for(t.initializer=[],n=0;n<e.initializer.length;++n){if("object"!=typeof e.initializer[n])throw TypeError(".onnx.GraphProto.initializer: object expected");t.initializer[n]=l.onnx.TensorProto.fromObject(e.initializer[n])}}if(null!=e.docString&&(t.docString=String(e.docString)),e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.GraphProto.input: array expected");for(t.input=[],n=0;n<e.input.length;++n){if("object"!=typeof e.input[n])throw TypeError(".onnx.GraphProto.input: object expected");t.input[n]=l.onnx.ValueInfoProto.fromObject(e.input[n])}}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.GraphProto.output: array expected");for(t.output=[],n=0;n<e.output.length;++n){if("object"!=typeof e.output[n])throw TypeError(".onnx.GraphProto.output: object expected");t.output[n]=l.onnx.ValueInfoProto.fromObject(e.output[n])}}if(e.valueInfo){if(!Array.isArray(e.valueInfo))throw TypeError(".onnx.GraphProto.valueInfo: array expected");for(t.valueInfo=[],n=0;n<e.valueInfo.length;++n){if("object"!=typeof e.valueInfo[n])throw TypeError(".onnx.GraphProto.valueInfo: object expected");t.valueInfo[n]=l.onnx.ValueInfoProto.fromObject(e.valueInfo[n])}}if(e.quantizationAnnotation){if(!Array.isArray(e.quantizationAnnotation))throw TypeError(".onnx.GraphProto.quantizationAnnotation: array expected");for(t.quantizationAnnotation=[],n=0;n<e.quantizationAnnotation.length;++n){if("object"!=typeof e.quantizationAnnotation[n])throw TypeError(".onnx.GraphProto.quantizationAnnotation: object expected");t.quantizationAnnotation[n]=l.onnx.TensorAnnotation.fromObject(e.quantizationAnnotation[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.node=[],n.initializer=[],n.input=[],n.output=[],n.valueInfo=[],n.quantizationAnnotation=[]),t.defaults&&(n.name="",n.docString=""),e.node&&e.node.length){n.node=[];for(var r=0;r<e.node.length;++r)n.node[r]=l.onnx.NodeProto.toObject(e.node[r],t)}if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),e.initializer&&e.initializer.length)for(n.initializer=[],r=0;r<e.initializer.length;++r)n.initializer[r]=l.onnx.TensorProto.toObject(e.initializer[r],t);if(null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),e.input&&e.input.length)for(n.input=[],r=0;r<e.input.length;++r)n.input[r]=l.onnx.ValueInfoProto.toObject(e.input[r],t);if(e.output&&e.output.length)for(n.output=[],r=0;r<e.output.length;++r)n.output[r]=l.onnx.ValueInfoProto.toObject(e.output[r],t);if(e.valueInfo&&e.valueInfo.length)for(n.valueInfo=[],r=0;r<e.valueInfo.length;++r)n.valueInfo[r]=l.onnx.ValueInfoProto.toObject(e.valueInfo[r],t);if(e.quantizationAnnotation&&e.quantizationAnnotation.length)for(n.quantizationAnnotation=[],r=0;r<e.quantizationAnnotation.length;++r)n.quantizationAnnotation[r]=l.onnx.TensorAnnotation.toObject(e.quantizationAnnotation[r],t);return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),o.TensorProto=function(){function e(e){if(this.dims=[],this.floatData=[],this.int32Data=[],this.stringData=[],this.int64Data=[],this.externalData=[],this.doubleData=[],this.uint64Data=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.dims=c.emptyArray,e.prototype.dataType=0,e.prototype.segment=null,e.prototype.floatData=c.emptyArray,e.prototype.int32Data=c.emptyArray,e.prototype.stringData=c.emptyArray,e.prototype.int64Data=c.emptyArray,e.prototype.name="",e.prototype.docString="",e.prototype.rawData=c.newBuffer([]),e.prototype.externalData=c.emptyArray,e.prototype.dataLocation=0,e.prototype.doubleData=c.emptyArray,e.prototype.uint64Data=c.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.dims&&e.dims.length){t.uint32(10).fork();for(var n=0;n<e.dims.length;++n)t.int64(e.dims[n]);t.ldelim()}if(null!=e.dataType&&e.hasOwnProperty("dataType")&&t.uint32(16).int32(e.dataType),null!=e.segment&&e.hasOwnProperty("segment")&&l.onnx.TensorProto.Segment.encode(e.segment,t.uint32(26).fork()).ldelim(),null!=e.floatData&&e.floatData.length){for(t.uint32(34).fork(),n=0;n<e.floatData.length;++n)t.float(e.floatData[n]);t.ldelim()}if(null!=e.int32Data&&e.int32Data.length){for(t.uint32(42).fork(),n=0;n<e.int32Data.length;++n)t.int32(e.int32Data[n]);t.ldelim()}if(null!=e.stringData&&e.stringData.length)for(n=0;n<e.stringData.length;++n)t.uint32(50).bytes(e.stringData[n]);if(null!=e.int64Data&&e.int64Data.length){for(t.uint32(58).fork(),n=0;n<e.int64Data.length;++n)t.int64(e.int64Data[n]);t.ldelim()}if(null!=e.name&&e.hasOwnProperty("name")&&t.uint32(66).string(e.name),null!=e.rawData&&e.hasOwnProperty("rawData")&&t.uint32(74).bytes(e.rawData),null!=e.doubleData&&e.doubleData.length){for(t.uint32(82).fork(),n=0;n<e.doubleData.length;++n)t.double(e.doubleData[n]);t.ldelim()}if(null!=e.uint64Data&&e.uint64Data.length){for(t.uint32(90).fork(),n=0;n<e.uint64Data.length;++n)t.uint64(e.uint64Data[n]);t.ldelim()}if(null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(98).string(e.docString),null!=e.externalData&&e.externalData.length)for(n=0;n<e.externalData.length;++n)l.onnx.StringStringEntryProto.encode(e.externalData[n],t.uint32(106).fork()).ldelim();return null!=e.dataLocation&&e.hasOwnProperty("dataLocation")&&t.uint32(112).int32(e.dataLocation),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.TensorProto;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:if(r.dims&&r.dims.length||(r.dims=[]),2==(7&i))for(var o=e.uint32()+e.pos;e.pos<o;)r.dims.push(e.int64());else r.dims.push(e.int64());break;case 2:r.dataType=e.int32();break;case 3:r.segment=l.onnx.TensorProto.Segment.decode(e,e.uint32());break;case 4:if(r.floatData&&r.floatData.length||(r.floatData=[]),2==(7&i))for(o=e.uint32()+e.pos;e.pos<o;)r.floatData.push(e.float());else r.floatData.push(e.float());break;case 5:if(r.int32Data&&r.int32Data.length||(r.int32Data=[]),2==(7&i))for(o=e.uint32()+e.pos;e.pos<o;)r.int32Data.push(e.int32());else r.int32Data.push(e.int32());break;case 6:r.stringData&&r.stringData.length||(r.stringData=[]),r.stringData.push(e.bytes());break;case 7:if(r.int64Data&&r.int64Data.length||(r.int64Data=[]),2==(7&i))for(o=e.uint32()+e.pos;e.pos<o;)r.int64Data.push(e.int64());else r.int64Data.push(e.int64());break;case 8:r.name=e.string();break;case 12:r.docString=e.string();break;case 9:r.rawData=e.bytes();break;case 13:r.externalData&&r.externalData.length||(r.externalData=[]),r.externalData.push(l.onnx.StringStringEntryProto.decode(e,e.uint32()));break;case 14:r.dataLocation=e.int32();break;case 10:if(r.doubleData&&r.doubleData.length||(r.doubleData=[]),2==(7&i))for(o=e.uint32()+e.pos;e.pos<o;)r.doubleData.push(e.double());else r.doubleData.push(e.double());break;case 11:if(r.uint64Data&&r.uint64Data.length||(r.uint64Data=[]),2==(7&i))for(o=e.uint32()+e.pos;e.pos<o;)r.uint64Data.push(e.uint64());else r.uint64Data.push(e.uint64());break;default:e.skipType(7&i)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.dims&&e.hasOwnProperty("dims")){if(!Array.isArray(e.dims))return"dims: array expected";for(var t=0;t<e.dims.length;++t)if(!(c.isInteger(e.dims[t])||e.dims[t]&&c.isInteger(e.dims[t].low)&&c.isInteger(e.dims[t].high)))return"dims: integer|Long[] expected"}if(null!=e.dataType&&e.hasOwnProperty("dataType")&&!c.isInteger(e.dataType))return"dataType: integer expected";if(null!=e.segment&&e.hasOwnProperty("segment")&&(n=l.onnx.TensorProto.Segment.verify(e.segment)))return"segment."+n;if(null!=e.floatData&&e.hasOwnProperty("floatData")){if(!Array.isArray(e.floatData))return"floatData: array expected";for(t=0;t<e.floatData.length;++t)if("number"!=typeof e.floatData[t])return"floatData: number[] expected"}if(null!=e.int32Data&&e.hasOwnProperty("int32Data")){if(!Array.isArray(e.int32Data))return"int32Data: array expected";for(t=0;t<e.int32Data.length;++t)if(!c.isInteger(e.int32Data[t]))return"int32Data: integer[] expected"}if(null!=e.stringData&&e.hasOwnProperty("stringData")){if(!Array.isArray(e.stringData))return"stringData: array expected";for(t=0;t<e.stringData.length;++t)if(!(e.stringData[t]&&"number"==typeof e.stringData[t].length||c.isString(e.stringData[t])))return"stringData: buffer[] expected"}if(null!=e.int64Data&&e.hasOwnProperty("int64Data")){if(!Array.isArray(e.int64Data))return"int64Data: array expected";for(t=0;t<e.int64Data.length;++t)if(!(c.isInteger(e.int64Data[t])||e.int64Data[t]&&c.isInteger(e.int64Data[t].low)&&c.isInteger(e.int64Data[t].high)))return"int64Data: integer|Long[] expected"}if(null!=e.name&&e.hasOwnProperty("name")&&!c.isString(e.name))return"name: string expected";if(null!=e.docString&&e.hasOwnProperty("docString")&&!c.isString(e.docString))return"docString: string expected";if(null!=e.rawData&&e.hasOwnProperty("rawData")&&!(e.rawData&&"number"==typeof e.rawData.length||c.isString(e.rawData)))return"rawData: buffer expected";if(null!=e.externalData&&e.hasOwnProperty("externalData")){if(!Array.isArray(e.externalData))return"externalData: array expected";for(t=0;t<e.externalData.length;++t){var n;if(n=l.onnx.StringStringEntryProto.verify(e.externalData[t]))return"externalData."+n}}if(null!=e.dataLocation&&e.hasOwnProperty("dataLocation"))switch(e.dataLocation){default:return"dataLocation: enum value expected";case 0:case 1:}if(null!=e.doubleData&&e.hasOwnProperty("doubleData")){if(!Array.isArray(e.doubleData))return"doubleData: array expected";for(t=0;t<e.doubleData.length;++t)if("number"!=typeof e.doubleData[t])return"doubleData: number[] expected"}if(null!=e.uint64Data&&e.hasOwnProperty("uint64Data")){if(!Array.isArray(e.uint64Data))return"uint64Data: array expected";for(t=0;t<e.uint64Data.length;++t)if(!(c.isInteger(e.uint64Data[t])||e.uint64Data[t]&&c.isInteger(e.uint64Data[t].low)&&c.isInteger(e.uint64Data[t].high)))return"uint64Data: integer|Long[] expected"}return null},e.fromObject=function(e){if(e instanceof l.onnx.TensorProto)return e;var t=new l.onnx.TensorProto;if(e.dims){if(!Array.isArray(e.dims))throw TypeError(".onnx.TensorProto.dims: array expected");t.dims=[];for(var n=0;n<e.dims.length;++n)c.Long?(t.dims[n]=c.Long.fromValue(e.dims[n])).unsigned=!1:"string"==typeof e.dims[n]?t.dims[n]=parseInt(e.dims[n],10):"number"==typeof e.dims[n]?t.dims[n]=e.dims[n]:"object"==typeof e.dims[n]&&(t.dims[n]=new c.LongBits(e.dims[n].low>>>0,e.dims[n].high>>>0).toNumber())}if(null!=e.dataType&&(t.dataType=0|e.dataType),null!=e.segment){if("object"!=typeof e.segment)throw TypeError(".onnx.TensorProto.segment: object expected");t.segment=l.onnx.TensorProto.Segment.fromObject(e.segment)}if(e.floatData){if(!Array.isArray(e.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(t.floatData=[],n=0;n<e.floatData.length;++n)t.floatData[n]=Number(e.floatData[n])}if(e.int32Data){if(!Array.isArray(e.int32Data))throw TypeError(".onnx.TensorProto.int32Data: array expected");for(t.int32Data=[],n=0;n<e.int32Data.length;++n)t.int32Data[n]=0|e.int32Data[n]}if(e.stringData){if(!Array.isArray(e.stringData))throw TypeError(".onnx.TensorProto.stringData: array expected");for(t.stringData=[],n=0;n<e.stringData.length;++n)"string"==typeof e.stringData[n]?c.base64.decode(e.stringData[n],t.stringData[n]=c.newBuffer(c.base64.length(e.stringData[n])),0):e.stringData[n].length&&(t.stringData[n]=e.stringData[n])}if(e.int64Data){if(!Array.isArray(e.int64Data))throw TypeError(".onnx.TensorProto.int64Data: array expected");for(t.int64Data=[],n=0;n<e.int64Data.length;++n)c.Long?(t.int64Data[n]=c.Long.fromValue(e.int64Data[n])).unsigned=!1:"string"==typeof e.int64Data[n]?t.int64Data[n]=parseInt(e.int64Data[n],10):"number"==typeof e.int64Data[n]?t.int64Data[n]=e.int64Data[n]:"object"==typeof e.int64Data[n]&&(t.int64Data[n]=new c.LongBits(e.int64Data[n].low>>>0,e.int64Data[n].high>>>0).toNumber())}if(null!=e.name&&(t.name=String(e.name)),null!=e.docString&&(t.docString=String(e.docString)),null!=e.rawData&&("string"==typeof e.rawData?c.base64.decode(e.rawData,t.rawData=c.newBuffer(c.base64.length(e.rawData)),0):e.rawData.length&&(t.rawData=e.rawData)),e.externalData){if(!Array.isArray(e.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(t.externalData=[],n=0;n<e.externalData.length;++n){if("object"!=typeof e.externalData[n])throw TypeError(".onnx.TensorProto.externalData: object expected");t.externalData[n]=l.onnx.StringStringEntryProto.fromObject(e.externalData[n])}}switch(e.dataLocation){case"DEFAULT":case 0:t.dataLocation=0;break;case"EXTERNAL":case 1:t.dataLocation=1}if(e.doubleData){if(!Array.isArray(e.doubleData))throw TypeError(".onnx.TensorProto.doubleData: array expected");for(t.doubleData=[],n=0;n<e.doubleData.length;++n)t.doubleData[n]=Number(e.doubleData[n])}if(e.uint64Data){if(!Array.isArray(e.uint64Data))throw TypeError(".onnx.TensorProto.uint64Data: array expected");for(t.uint64Data=[],n=0;n<e.uint64Data.length;++n)c.Long?(t.uint64Data[n]=c.Long.fromValue(e.uint64Data[n])).unsigned=!0:"string"==typeof e.uint64Data[n]?t.uint64Data[n]=parseInt(e.uint64Data[n],10):"number"==typeof e.uint64Data[n]?t.uint64Data[n]=e.uint64Data[n]:"object"==typeof e.uint64Data[n]&&(t.uint64Data[n]=new c.LongBits(e.uint64Data[n].low>>>0,e.uint64Data[n].high>>>0).toNumber(!0))}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dims=[],n.floatData=[],n.int32Data=[],n.stringData=[],n.int64Data=[],n.doubleData=[],n.uint64Data=[],n.externalData=[]),t.defaults&&(n.dataType=0,n.segment=null,n.name="",t.bytes===String?n.rawData="":(n.rawData=[],t.bytes!==Array&&(n.rawData=c.newBuffer(n.rawData))),n.docString="",n.dataLocation=t.enums===String?"DEFAULT":0),e.dims&&e.dims.length){n.dims=[];for(var r=0;r<e.dims.length;++r)"number"==typeof e.dims[r]?n.dims[r]=t.longs===String?String(e.dims[r]):e.dims[r]:n.dims[r]=t.longs===String?c.Long.prototype.toString.call(e.dims[r]):t.longs===Number?new c.LongBits(e.dims[r].low>>>0,e.dims[r].high>>>0).toNumber():e.dims[r]}if(null!=e.dataType&&e.hasOwnProperty("dataType")&&(n.dataType=e.dataType),null!=e.segment&&e.hasOwnProperty("segment")&&(n.segment=l.onnx.TensorProto.Segment.toObject(e.segment,t)),e.floatData&&e.floatData.length)for(n.floatData=[],r=0;r<e.floatData.length;++r)n.floatData[r]=t.json&&!isFinite(e.floatData[r])?String(e.floatData[r]):e.floatData[r];if(e.int32Data&&e.int32Data.length)for(n.int32Data=[],r=0;r<e.int32Data.length;++r)n.int32Data[r]=e.int32Data[r];if(e.stringData&&e.stringData.length)for(n.stringData=[],r=0;r<e.stringData.length;++r)n.stringData[r]=t.bytes===String?c.base64.encode(e.stringData[r],0,e.stringData[r].length):t.bytes===Array?Array.prototype.slice.call(e.stringData[r]):e.stringData[r];if(e.int64Data&&e.int64Data.length)for(n.int64Data=[],r=0;r<e.int64Data.length;++r)"number"==typeof e.int64Data[r]?n.int64Data[r]=t.longs===String?String(e.int64Data[r]):e.int64Data[r]:n.int64Data[r]=t.longs===String?c.Long.prototype.toString.call(e.int64Data[r]):t.longs===Number?new c.LongBits(e.int64Data[r].low>>>0,e.int64Data[r].high>>>0).toNumber():e.int64Data[r];if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.rawData&&e.hasOwnProperty("rawData")&&(n.rawData=t.bytes===String?c.base64.encode(e.rawData,0,e.rawData.length):t.bytes===Array?Array.prototype.slice.call(e.rawData):e.rawData),e.doubleData&&e.doubleData.length)for(n.doubleData=[],r=0;r<e.doubleData.length;++r)n.doubleData[r]=t.json&&!isFinite(e.doubleData[r])?String(e.doubleData[r]):e.doubleData[r];if(e.uint64Data&&e.uint64Data.length)for(n.uint64Data=[],r=0;r<e.uint64Data.length;++r)"number"==typeof e.uint64Data[r]?n.uint64Data[r]=t.longs===String?String(e.uint64Data[r]):e.uint64Data[r]:n.uint64Data[r]=t.longs===String?c.Long.prototype.toString.call(e.uint64Data[r]):t.longs===Number?new c.LongBits(e.uint64Data[r].low>>>0,e.uint64Data[r].high>>>0).toNumber(!0):e.uint64Data[r];if(null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),e.externalData&&e.externalData.length)for(n.externalData=[],r=0;r<e.externalData.length;++r)n.externalData[r]=l.onnx.StringStringEntryProto.toObject(e.externalData[r],t);return null!=e.dataLocation&&e.hasOwnProperty("dataLocation")&&(n.dataLocation=t.enums===String?l.onnx.TensorProto.DataLocation[e.dataLocation]:e.dataLocation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e.DataType=function(){var e={},t=Object.create(e);return t[e[0]="UNDEFINED"]=0,t[e[1]="FLOAT"]=1,t[e[2]="UINT8"]=2,t[e[3]="INT8"]=3,t[e[4]="UINT16"]=4,t[e[5]="INT16"]=5,t[e[6]="INT32"]=6,t[e[7]="INT64"]=7,t[e[8]="STRING"]=8,t[e[9]="BOOL"]=9,t[e[10]="FLOAT16"]=10,t[e[11]="DOUBLE"]=11,t[e[12]="UINT32"]=12,t[e[13]="UINT64"]=13,t[e[14]="COMPLEX64"]=14,t[e[15]="COMPLEX128"]=15,t[e[16]="BFLOAT16"]=16,t}(),e.Segment=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.begin=c.Long?c.Long.fromBits(0,0,!1):0,e.prototype.end=c.Long?c.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.begin&&e.hasOwnProperty("begin")&&t.uint32(8).int64(e.begin),null!=e.end&&e.hasOwnProperty("end")&&t.uint32(16).int64(e.end),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.TensorProto.Segment;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.begin=e.int64();break;case 2:r.end=e.int64();break;default:e.skipType(7&i)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.begin&&e.hasOwnProperty("begin")&&!(c.isInteger(e.begin)||e.begin&&c.isInteger(e.begin.low)&&c.isInteger(e.begin.high))?"begin: integer|Long expected":null!=e.end&&e.hasOwnProperty("end")&&!(c.isInteger(e.end)||e.end&&c.isInteger(e.end.low)&&c.isInteger(e.end.high))?"end: integer|Long expected":null},e.fromObject=function(e){if(e instanceof l.onnx.TensorProto.Segment)return e;var t=new l.onnx.TensorProto.Segment;return null!=e.begin&&(c.Long?(t.begin=c.Long.fromValue(e.begin)).unsigned=!1:"string"==typeof e.begin?t.begin=parseInt(e.begin,10):"number"==typeof e.begin?t.begin=e.begin:"object"==typeof e.begin&&(t.begin=new c.LongBits(e.begin.low>>>0,e.begin.high>>>0).toNumber())),null!=e.end&&(c.Long?(t.end=c.Long.fromValue(e.end)).unsigned=!1:"string"==typeof e.end?t.end=parseInt(e.end,10):"number"==typeof e.end?t.end=e.end:"object"==typeof e.end&&(t.end=new c.LongBits(e.end.low>>>0,e.end.high>>>0).toNumber())),t},e.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(c.Long){var r=new c.Long(0,0,!1);n.begin=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.begin=t.longs===String?"0":0;c.Long?(r=new c.Long(0,0,!1),n.end=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.end=t.longs===String?"0":0}return null!=e.begin&&e.hasOwnProperty("begin")&&("number"==typeof e.begin?n.begin=t.longs===String?String(e.begin):e.begin:n.begin=t.longs===String?c.Long.prototype.toString.call(e.begin):t.longs===Number?new c.LongBits(e.begin.low>>>0,e.begin.high>>>0).toNumber():e.begin),null!=e.end&&e.hasOwnProperty("end")&&("number"==typeof e.end?n.end=t.longs===String?String(e.end):e.end:n.end=t.longs===String?c.Long.prototype.toString.call(e.end):t.longs===Number?new c.LongBits(e.end.low>>>0,e.end.high>>>0).toNumber():e.end),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),e.DataLocation=function(){var e={},t=Object.create(e);return t[e[0]="DEFAULT"]=0,t[e[1]="EXTERNAL"]=1,t}(),e}(),o.TensorShapeProto=function(){function e(e){if(this.dim=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.dim=c.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.dim&&e.dim.length)for(var n=0;n<e.dim.length;++n)l.onnx.TensorShapeProto.Dimension.encode(e.dim[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.TensorShapeProto;e.pos<n;){var i=e.uint32();i>>>3==1?(r.dim&&r.dim.length||(r.dim=[]),r.dim.push(l.onnx.TensorShapeProto.Dimension.decode(e,e.uint32()))):e.skipType(7&i)}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.dim&&e.hasOwnProperty("dim")){if(!Array.isArray(e.dim))return"dim: array expected";for(var t=0;t<e.dim.length;++t){var n=l.onnx.TensorShapeProto.Dimension.verify(e.dim[t]);if(n)return"dim."+n}}return null},e.fromObject=function(e){if(e instanceof l.onnx.TensorShapeProto)return e;var t=new l.onnx.TensorShapeProto;if(e.dim){if(!Array.isArray(e.dim))throw TypeError(".onnx.TensorShapeProto.dim: array expected");t.dim=[];for(var n=0;n<e.dim.length;++n){if("object"!=typeof e.dim[n])throw TypeError(".onnx.TensorShapeProto.dim: object expected");t.dim[n]=l.onnx.TensorShapeProto.Dimension.fromObject(e.dim[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dim=[]),e.dim&&e.dim.length){n.dim=[];for(var r=0;r<e.dim.length;++r)n.dim[r]=l.onnx.TensorShapeProto.Dimension.toObject(e.dim[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e.Dimension=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t;return e.prototype.dimValue=c.Long?c.Long.fromBits(0,0,!1):0,e.prototype.dimParam="",e.prototype.denotation="",Object.defineProperty(e.prototype,"value",{get:c.oneOfGetter(t=["dimValue","dimParam"]),set:c.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.dimValue&&e.hasOwnProperty("dimValue")&&t.uint32(8).int64(e.dimValue),null!=e.dimParam&&e.hasOwnProperty("dimParam")&&t.uint32(18).string(e.dimParam),null!=e.denotation&&e.hasOwnProperty("denotation")&&t.uint32(26).string(e.denotation),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.TensorShapeProto.Dimension;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.dimValue=e.int64();break;case 2:r.dimParam=e.string();break;case 3:r.denotation=e.string();break;default:e.skipType(7&i)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.dimValue&&e.hasOwnProperty("dimValue")&&(t.value=1,!(c.isInteger(e.dimValue)||e.dimValue&&c.isInteger(e.dimValue.low)&&c.isInteger(e.dimValue.high))))return"dimValue: integer|Long expected";if(null!=e.dimParam&&e.hasOwnProperty("dimParam")){if(1===t.value)return"value: multiple values";if(t.value=1,!c.isString(e.dimParam))return"dimParam: string expected"}return null!=e.denotation&&e.hasOwnProperty("denotation")&&!c.isString(e.denotation)?"denotation: string expected":null},e.fromObject=function(e){if(e instanceof l.onnx.TensorShapeProto.Dimension)return e;var t=new l.onnx.TensorShapeProto.Dimension;return null!=e.dimValue&&(c.Long?(t.dimValue=c.Long.fromValue(e.dimValue)).unsigned=!1:"string"==typeof e.dimValue?t.dimValue=parseInt(e.dimValue,10):"number"==typeof e.dimValue?t.dimValue=e.dimValue:"object"==typeof e.dimValue&&(t.dimValue=new c.LongBits(e.dimValue.low>>>0,e.dimValue.high>>>0).toNumber())),null!=e.dimParam&&(t.dimParam=String(e.dimParam)),null!=e.denotation&&(t.denotation=String(e.denotation)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.denotation=""),null!=e.dimValue&&e.hasOwnProperty("dimValue")&&("number"==typeof e.dimValue?n.dimValue=t.longs===String?String(e.dimValue):e.dimValue:n.dimValue=t.longs===String?c.Long.prototype.toString.call(e.dimValue):t.longs===Number?new c.LongBits(e.dimValue.low>>>0,e.dimValue.high>>>0).toNumber():e.dimValue,t.oneofs&&(n.value="dimValue")),null!=e.dimParam&&e.hasOwnProperty("dimParam")&&(n.dimParam=e.dimParam,t.oneofs&&(n.value="dimParam")),null!=e.denotation&&e.hasOwnProperty("denotation")&&(n.denotation=e.denotation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),e}(),o.TypeProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t;return e.prototype.tensorType=null,e.prototype.denotation="",Object.defineProperty(e.prototype,"value",{get:c.oneOfGetter(t=["tensorType"]),set:c.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.tensorType&&e.hasOwnProperty("tensorType")&&l.onnx.TypeProto.Tensor.encode(e.tensorType,t.uint32(10).fork()).ldelim(),null!=e.denotation&&e.hasOwnProperty("denotation")&&t.uint32(50).string(e.denotation),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.TypeProto;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.tensorType=l.onnx.TypeProto.Tensor.decode(e,e.uint32());break;case 6:r.denotation=e.string();break;default:e.skipType(7&i)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tensorType&&e.hasOwnProperty("tensorType")){var t=l.onnx.TypeProto.Tensor.verify(e.tensorType);if(t)return"tensorType."+t}return null!=e.denotation&&e.hasOwnProperty("denotation")&&!c.isString(e.denotation)?"denotation: string expected":null},e.fromObject=function(e){if(e instanceof l.onnx.TypeProto)return e;var t=new l.onnx.TypeProto;if(null!=e.tensorType){if("object"!=typeof e.tensorType)throw TypeError(".onnx.TypeProto.tensorType: object expected");t.tensorType=l.onnx.TypeProto.Tensor.fromObject(e.tensorType)}return null!=e.denotation&&(t.denotation=String(e.denotation)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.denotation=""),null!=e.tensorType&&e.hasOwnProperty("tensorType")&&(n.tensorType=l.onnx.TypeProto.Tensor.toObject(e.tensorType,t),t.oneofs&&(n.value="tensorType")),null!=e.denotation&&e.hasOwnProperty("denotation")&&(n.denotation=e.denotation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e.Tensor=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.elemType=0,e.prototype.shape=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.elemType&&e.hasOwnProperty("elemType")&&t.uint32(8).int32(e.elemType),null!=e.shape&&e.hasOwnProperty("shape")&&l.onnx.TensorShapeProto.encode(e.shape,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.TypeProto.Tensor;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.elemType=e.int32();break;case 2:r.shape=l.onnx.TensorShapeProto.decode(e,e.uint32());break;default:e.skipType(7&i)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.elemType&&e.hasOwnProperty("elemType")&&!c.isInteger(e.elemType))return"elemType: integer expected";if(null!=e.shape&&e.hasOwnProperty("shape")){var t=l.onnx.TensorShapeProto.verify(e.shape);if(t)return"shape."+t}return null},e.fromObject=function(e){if(e instanceof l.onnx.TypeProto.Tensor)return e;var t=new l.onnx.TypeProto.Tensor;if(null!=e.elemType&&(t.elemType=0|e.elemType),null!=e.shape){if("object"!=typeof e.shape)throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");t.shape=l.onnx.TensorShapeProto.fromObject(e.shape)}return t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.elemType=0,n.shape=null),null!=e.elemType&&e.hasOwnProperty("elemType")&&(n.elemType=e.elemType),null!=e.shape&&e.hasOwnProperty("shape")&&(n.shape=l.onnx.TensorShapeProto.toObject(e.shape,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),e}(),o.OperatorSetIdProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.domain="",e.prototype.version=c.Long?c.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.domain&&e.hasOwnProperty("domain")&&t.uint32(10).string(e.domain),null!=e.version&&e.hasOwnProperty("version")&&t.uint32(16).int64(e.version),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new l.onnx.OperatorSetIdProto;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.domain=e.string();break;case 2:r.version=e.int64();break;default:e.skipType(7&i)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.domain&&e.hasOwnProperty("domain")&&!c.isString(e.domain)?"domain: string expected":null!=e.version&&e.hasOwnProperty("version")&&!(c.isInteger(e.version)||e.version&&c.isInteger(e.version.low)&&c.isInteger(e.version.high))?"version: integer|Long expected":null},e.fromObject=function(e){if(e instanceof l.onnx.OperatorSetIdProto)return e;var t=new l.onnx.OperatorSetIdProto;return null!=e.domain&&(t.domain=String(e.domain)),null!=e.version&&(c.Long?(t.version=c.Long.fromValue(e.version)).unsigned=!1:"string"==typeof e.version?t.version=parseInt(e.version,10):"number"==typeof e.version?t.version=e.version:"object"==typeof e.version&&(t.version=new c.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber())),t},e.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(n.domain="",c.Long){var r=new c.Long(0,0,!1);n.version=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.version=t.longs===String?"0":0;return null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),null!=e.version&&e.hasOwnProperty("version")&&("number"==typeof e.version?n.version=t.longs===String?String(e.version):e.version:n.version=t.longs===String?c.Long.prototype.toString.call(e.version):t.longs===Number?new c.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber():e.version),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),o),e.exports=l},2100:(e,t,n)=>{"use strict";e.exports=n(9482)},9482:(e,t,n)=>{"use strict";var r=t;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(1173),r.BufferWriter=n(3155),r.Reader=n(1408),r.BufferReader=n(593),r.util=n(9693),r.rpc=n(5994),r.roots=n(5054),r.configure=i,i()},1408:(e,t,n)=>{"use strict";e.exports=u;var r,i=n(9693),o=i.LongBits,s=i.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},d=function(){return i.Buffer?function(e){return(u.create=function(e){return i.Buffer.isBuffer(e)?new r(e):l(e)})(e)}:l};function f(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw a(this,8);return new o(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=d(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},u.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){r=e,u.create=d(),r._configure();var t=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},593:(e,t,n)=>{"use strict";e.exports=o;var r=n(1408);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(9693);function o(e){r.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},5054:e=>{"use strict";e.exports={}},5994:(e,t,n)=>{"use strict";t.Service=n(7948)},7948:(e,t,n)=>{"use strict";e.exports=i;var r=n(9693);function i(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,n,i,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return r.asPromise(e,a,t,n,i,o);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,n){if(e)return a.emit("error",e,t),s(e);if(null!==n){if(!(n instanceof i))try{n=i[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",n,t),s(null,n)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(e,t,n)=>{"use strict";e.exports=i;var r=n(9693);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new i(n,r)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(r.isString(e)){if(!r.Long)return i.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;i.fromHash=function(e){return e===s?o:new i((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},9693:function(e,t,n){"use strict";var r=t;function i(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)void 0!==e[r[i]]&&n||(e[r[i]]=t[r[i]]);return e}function o(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&i(this,n)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}r.asPromise=n(4537),r.base64=n(7419),r.EventEmitter=n(9211),r.float=n(945),r.inquire=n(7199),r.utf8=n(4997),r.pool=n(6662),r.LongBits=n(1945),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=i,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},1173:(e,t,n)=>{"use strict";e.exports=d;var r,i=n(9693),o=i.LongBits,s=i.base64,a=i.utf8;function u(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var f=function(){return i.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};function h(e,t,n){t[n]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function g(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function m(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}d.create=f(),d.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(e,t,n){return this.tail=this.tail.next=new u(e,t,n),this.len+=t,this},p.prototype=Object.create(u.prototype),p.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(g,10,o.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=o.from(e);return this._push(g,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(g,t.length(),t)},d.prototype.bool=function(e){return this._push(h,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=o.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var b=i.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(i.isString(e)){var n=d.alloc(t=s.length(e));s.decode(e,n,0),e=n}return this.uint32(t)._push(b,t,e)},d.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},d.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},d._configure=function(e){r=e,d.create=f(),r._configure()}},3155:(e,t,n)=>{"use strict";e.exports=o;var r=n(1173);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(9693);function o(){r.call(this)}function s(e,t,n){e.length<40?i.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},o.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},o._configure()},4154:e=>{"use strict";e.exports='"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\n'},7067:()=>{},1296:()=>{},760:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(e,t,n)=>{"use strict";n.r(t),n.d(t,{flatbuffers:()=>r});var r={};r.Offset,r.Table,r.SIZEOF_SHORT=2,r.SIZEOF_INT=4,r.FILE_IDENTIFIER_LENGTH=4,r.SIZE_PREFIX_LENGTH=4,r.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(e,t){this.low=0|e,this.high=0|t},r.Long.create=function(e,t){return 0==e&&0==t?r.Long.ZERO:new r.Long(e,t)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(e){return this.low==e.low&&this.high==e.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(e){if(e)t=e;else var t=1024;this.bb=r.ByteBuffer.allocate(t),this.space=t,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(e){this.force_defaults=e},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(e,t){e>this.minalign&&(this.minalign=e);for(var n=1+~(this.bb.capacity()-this.space+t)&e-1;this.space<n+e+t;){var i=this.bb.capacity();this.bb=r.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(n)},r.Builder.prototype.pad=function(e){for(var t=0;t<e;t++)this.bb.writeInt8(--this.space,0)},r.Builder.prototype.writeInt8=function(e){this.bb.writeInt8(this.space-=1,e)},r.Builder.prototype.writeInt16=function(e){this.bb.writeInt16(this.space-=2,e)},r.Builder.prototype.writeInt32=function(e){this.bb.writeInt32(this.space-=4,e)},r.Builder.prototype.writeInt64=function(e){this.bb.writeInt64(this.space-=8,e)},r.Builder.prototype.writeFloat32=function(e){this.bb.writeFloat32(this.space-=4,e)},r.Builder.prototype.writeFloat64=function(e){this.bb.writeFloat64(this.space-=8,e)},r.Builder.prototype.addInt8=function(e){this.prep(1,0),this.writeInt8(e)},r.Builder.prototype.addInt16=function(e){this.prep(2,0),this.writeInt16(e)},r.Builder.prototype.addInt32=function(e){this.prep(4,0),this.writeInt32(e)},r.Builder.prototype.addInt64=function(e){this.prep(8,0),this.writeInt64(e)},r.Builder.prototype.addFloat32=function(e){this.prep(4,0),this.writeFloat32(e)},r.Builder.prototype.addFloat64=function(e){this.prep(8,0),this.writeFloat64(e)},r.Builder.prototype.addFieldInt8=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt8(t),this.slot(e))},r.Builder.prototype.addFieldInt16=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt16(t),this.slot(e))},r.Builder.prototype.addFieldInt32=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt32(t),this.slot(e))},r.Builder.prototype.addFieldInt64=function(e,t,n){!this.force_defaults&&t.equals(n)||(this.addInt64(t),this.slot(e))},r.Builder.prototype.addFieldFloat32=function(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat32(t),this.slot(e))},r.Builder.prototype.addFieldFloat64=function(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat64(t),this.slot(e))},r.Builder.prototype.addFieldOffset=function(e,t,n){(this.force_defaults||t!=n)&&(this.addOffset(t),this.slot(e))},r.Builder.prototype.addFieldStruct=function(e,t,n){t!=n&&(this.nested(t),this.slot(e))},r.Builder.prototype.nested=function(e){if(e!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},r.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},r.Builder.prototype.slot=function(e){this.vtable[e]=this.offset()},r.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},r.Builder.growByteBuffer=function(e){var t=e.capacity();if(3221225472&t)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var n=t<<1,i=r.ByteBuffer.allocate(n);return i.setPosition(n-t),i.bytes().set(e.bytes(),n-t),i},r.Builder.prototype.addOffset=function(e){this.prep(r.SIZEOF_INT,0),this.writeInt32(this.offset()-e+r.SIZEOF_INT)},r.Builder.prototype.startObject=function(e){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=e;for(var t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()},r.Builder.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var e=this.offset(),t=this.vtable_in_use-1;t>=0&&0==this.vtable[t];t--);for(var n=t+1;t>=0;t--)this.addInt16(0!=this.vtable[t]?e-this.vtable[t]:0);this.addInt16(e-this.object_start);var i=(n+2)*r.SIZEOF_SHORT;this.addInt16(i);var o=0,s=this.space;e:for(t=0;t<this.vtables.length;t++){var a=this.bb.capacity()-this.vtables[t];if(i==this.bb.readInt16(a)){for(var u=r.SIZEOF_SHORT;u<i;u+=r.SIZEOF_SHORT)if(this.bb.readInt16(s+u)!=this.bb.readInt16(a+u))continue e;o=this.vtables[t];break}}return o?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,o-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e},r.Builder.prototype.finish=function(e,t,n){var i=n?r.SIZE_PREFIX_LENGTH:0;if(t){var o=t;if(this.prep(this.minalign,r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH+i),o.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var s=r.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,r.SIZEOF_INT+i),this.addOffset(e),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(e,t){this.finish(e,t,!0)},r.Builder.prototype.requiredField=function(e,t){var n=this.bb.capacity()-e,r=n-this.bb.readInt32(n);if(0==this.bb.readInt16(r+t))throw new Error("FlatBuffers: field "+t+" must be set")},r.Builder.prototype.startVector=function(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(r.SIZEOF_INT,e*t),this.prep(n,e*t)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(e){if(e instanceof Uint8Array)var t=e;else{t=[];for(var n=0;n<e.length;){var r,i=e.charCodeAt(n++);(r=i<55296||i>=56320?i:(i<<10)+e.charCodeAt(n++)+-56613888)<128?t.push(r):(r<2048?t.push(r>>6&31|192):(r<65536?t.push(r>>12&15|224):t.push(r>>18&7|240,r>>12&63|128),t.push(r>>6&63|128)),t.push(63&r|128))}}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),n=0;for(var o=this.space,s=this.bb.bytes();n<t.length;n++)s[o++]=t[n];return this.endVector()},r.Builder.prototype.createLong=function(e,t){return r.Long.create(e,t)},r.ByteBuffer=function(e){this.bytes_=e,this.position_=0},r.ByteBuffer.allocate=function(e){return new r.ByteBuffer(new Uint8Array(e))},r.ByteBuffer.prototype.clear=function(){this.position_=0},r.ByteBuffer.prototype.bytes=function(){return this.bytes_},r.ByteBuffer.prototype.position=function(){return this.position_},r.ByteBuffer.prototype.setPosition=function(e){this.position_=e},r.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},r.ByteBuffer.prototype.readInt8=function(e){return this.readUint8(e)<<24>>24},r.ByteBuffer.prototype.readUint8=function(e){return this.bytes_[e]},r.ByteBuffer.prototype.readInt16=function(e){return this.readUint16(e)<<16>>16},r.ByteBuffer.prototype.readUint16=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8},r.ByteBuffer.prototype.readInt32=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24},r.ByteBuffer.prototype.readUint32=function(e){return this.readInt32(e)>>>0},r.ByteBuffer.prototype.readInt64=function(e){return new r.Long(this.readInt32(e),this.readInt32(e+4))},r.ByteBuffer.prototype.readUint64=function(e){return new r.Long(this.readUint32(e),this.readUint32(e+4))},r.ByteBuffer.prototype.readFloat32=function(e){return r.int32[0]=this.readInt32(e),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(e){return r.int32[r.isLittleEndian?0:1]=this.readInt32(e),r.int32[r.isLittleEndian?1:0]=this.readInt32(e+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(e,t){this.bytes_[e]=t},r.ByteBuffer.prototype.writeUint8=function(e,t){this.bytes_[e]=t},r.ByteBuffer.prototype.writeInt16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8},r.ByteBuffer.prototype.writeUint16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8},r.ByteBuffer.prototype.writeInt32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},r.ByteBuffer.prototype.writeUint32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},r.ByteBuffer.prototype.writeInt64=function(e,t){this.writeInt32(e,t.low),this.writeInt32(e+4,t.high)},r.ByteBuffer.prototype.writeUint64=function(e,t){this.writeUint32(e,t.low),this.writeUint32(e+4,t.high)},r.ByteBuffer.prototype.writeFloat32=function(e,t){r.float32[0]=t,this.writeInt32(e,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(e,t){r.float64[0]=t,this.writeInt32(e,r.int32[r.isLittleEndian?0:1]),this.writeInt32(e+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var e="",t=0;t<r.FILE_IDENTIFIER_LENGTH;t++)e+=String.fromCharCode(this.readInt8(this.position_+r.SIZEOF_INT+t));return e},r.ByteBuffer.prototype.__offset=function(e,t){var n=e-this.readInt32(e);return t<this.readInt16(n)?this.readInt16(n+t):0},r.ByteBuffer.prototype.__union=function(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e},r.ByteBuffer.prototype.__string=function(e,t){e+=this.readInt32(e);var n=this.readInt32(e),i="",o=0;if(e+=r.SIZEOF_INT,t===r.Encoding.UTF8_BYTES)return this.bytes_.subarray(e,e+n);for(;o<n;){var s,a=this.readUint8(e+o++);if(a<192)s=a;else{var u=this.readUint8(e+o++);if(a<224)s=(31&a)<<6|63&u;else{var c=this.readUint8(e+o++);s=a<240?(15&a)<<12|(63&u)<<6|63&c:(7&a)<<18|(63&u)<<12|(63&c)<<6|63&this.readUint8(e+o++)}}s<65536?i+=String.fromCharCode(s):(s-=65536,i+=String.fromCharCode(55296+(s>>10),56320+(1023&s)))}return i},r.ByteBuffer.prototype.__indirect=function(e){return e+this.readInt32(e)},r.ByteBuffer.prototype.__vector=function(e){return e+this.readInt32(e)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(e){return this.readInt32(e+this.readInt32(e))},r.ByteBuffer.prototype.__has_identifier=function(e){if(e.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var t=0;t<r.FILE_IDENTIFIER_LENGTH;t++)if(e.charCodeAt(t)!=this.readInt8(this.position_+r.SIZEOF_INT+t))return!1;return!0},r.ByteBuffer.prototype.createLong=function(e,t){return r.Long.create(e,t)}}},__webpack_module_cache__={};function __nested_webpack_require_606622__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__nested_webpack_require_606622__),n.exports}__nested_webpack_require_606622__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __nested_webpack_require_606622__.d(t,{a:t}),t},__nested_webpack_require_606622__.d=(e,t)=>{for(var n in t)__nested_webpack_require_606622__.o(t,n)&&!__nested_webpack_require_606622__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__nested_webpack_require_606622__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__nested_webpack_require_606622__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__nested_webpack_require_606622__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __nested_webpack_exports__=__nested_webpack_require_606622__(1057);return __nested_webpack_exports__})(),module.exports=t()},3960:(e,t,n)=>{const{EventTarget:r,defineEventAttribute:i}=n(7185),{detect:o}=n(2701),s=o(),a=n.g.AudioContext||n.g.webkitAudioContext;class u extends r{constructor(e,t={},n={}){const{mimeType:r,audioBitsPerSecond:i,videoBitsPerSecond:o,bitsPerSecond:a}=t,{encoderWorkerFactory:c,OggOpusEncoderWasmPath:l,WebMOpusEncoderWasmPath:d}=n;if(super(),this._stream=e,this._state="inactive",this._mimeType=r||"",this._audioBitsPerSecond=i||a,this.workerState="inactive",!u.isTypeSupported(this._mimeType))throw new TypeError("invalid arguments, a MIME Type is not supported");switch(u._parseType(this._mimeType).subtype){case"wave":case"wav":this._mimeType="audio/wave";break;case"webm":this._mimeType="audio/webm";break;case"ogg":this._mimeType="audio/ogg";break;default:switch(s&&s.name){case"chrome":case"edge":default:this._mimeType="audio/webm";break;case"firefox":this._mimeType="audio/ogg";break;case"ios":case"safari":this._mimeType="audio/wave"}}switch(this._mimeType){case"audio/wave":this._wasmPath="";break;case"audio/webm":this._wasmPath=d||"";break;case"audio/ogg":this._wasmPath=l||"";break;default:throw new Error(`Internal Error: Unexpected MIME Type: ${this._mimeType}`)}let f="";document.currentScript?f=document.currentScript.src:self.location&&(f=self.location.href),f=f.substr(0,f.lastIndexOf("/"))+"/encoderWorker.umd.js","function"==typeof u.encoderWorker&&(f=URL.createObjectURL(new Blob([`(${u.encoderWorker})()`]))),this._workerFactory="function"==typeof c?c:e=>new Worker(f),this._spawnWorker()}get stream(){return this._stream}get mimeType(){return this._mimeType}get state(){return this._state}get videoBitsPerSecond(){}get audioBitsPerSecond(){return this._audioBitsPerSecond}_spawnWorker(){this.worker=this._workerFactory(),this.worker.onmessage=e=>this._onmessageFromWorker(e),this.worker.onerror=e=>this._onerrorFromWorker(e),this._postMessageToWorker("loadEncoder",{mimeType:this._mimeType,wasmPath:this._wasmPath})}_postMessageToWorker(e,t={}){switch(e){case"loadEncoder":let{mimeType:r,wasmPath:i}=t;this.worker.postMessage({command:e,mimeType:r,wasmPath:i});break;case"init":let{sampleRate:o,channelCount:s,bitsPerSecond:a}=t;this.worker.postMessage({command:e,sampleRate:o,channelCount:s,bitsPerSecond:a}),this.workerState="encoding",this.source.connect(this.processor),this.processor.connect(this.context.destination);let u=new n.g.Event("start");this.dispatchEvent(u);break;case"pushInputData":let{channelBuffers:c,length:l,duration:d}=t;this.worker.postMessage({command:e,channelBuffers:c,length:l,duration:d});break;case"getEncodedData":case"done":this.worker.postMessage({command:e});break;default:throw new Error("Internal Error: Incorrect postMessage requested.")}}_onmessageFromWorker(e){const{command:t,buffers:r}=e.data;let i;switch(t){case"readyToInit":const{sampleRate:e,channelCount:o}=this;this.workerState="readyToInit","recording"===this.state&&this._postMessageToWorker("init",{sampleRate:e,channelCount:o,bitsPerSecond:this.audioBitsPerSecond});break;case"encodedData":case"lastEncodedData":let s=new Blob(r,{type:this._mimeType});i=new n.g.Event("dataavailable"),i.data=s,this.dispatchEvent(i),"lastEncodedData"===t&&(i=new n.g.Event("stop"),this.dispatchEvent(i),this.workerState="closed")}}_onerrorFromWorker(e){this.source.disconnect(),this.processor.disconnect(),this.worker.terminate(),this.workerState="closed";let t=["FileName: "+e.filename,"LineNumber: "+e.lineno,"Message: "+e.message].join(" - "),r=new n.g.Event("error");r.name="UnknownError",r.message=t,this.dispatchEvent(r)}_enableAudioProcessCallback(e){let t=0;this.processor.onaudioprocess=n=>{const{inputBuffer:r,playbackTime:i}=n,{sampleRate:o,length:s,duration:a,numberOfChannels:u}=r,c=new Array(u);for(let e=0;e<u;e++)c[e]=r.getChannelData(e);const l={channelBuffers:c,length:s,duration:a};this._postMessageToWorker("pushInputData",l),t+=a,t>=e&&(this._postMessageToWorker("getEncodedData"),t=0)}}start(e=Number.MAX_SAFE_INTEGER){if("inactive"!==this.state)throw new Error("DOMException: INVALID_STATE_ERR, state must be inactive.");if(e<0)throw new TypeError("invalid arguments, timeslice should be 0 or higher.");e/=1e3,"closed"===this.workerState&&this._spawnWorker(),this.context=new a;let t=this.stream.getAudioTracks();if(!t[0])throw new Error("DOMException: UnkownError, media track not found.");if(this.channelCount=t[0].getSettings().channelCount||1,this.sampleRate=this.context.sampleRate,this.source=this.context.createMediaStreamSource(this.stream),this.processor=this.context.createScriptProcessor(4096,this.channelCount,this.channelCount),this._state="recording",this._enableAudioProcessCallback(e),"readyToInit"===this.workerState){const{sampleRate:e,channelCount:t}=this;this._postMessageToWorker("init",{sampleRate:e,channelCount:t,bitsPerSecond:this.audioBitsPerSecond})}}stop(){if("inactive"===this.state)throw new Error("DOMException: INVALID_STATE_ERR, state must NOT be inactive.");this.source.disconnect(),this.processor.disconnect(),this.context.close(),this._postMessageToWorker("done"),this._state="inactive"}pause(){if("inactive"===this.state)throw new Error("DOMException: INVALID_STATE_ERR, state must NOT be inactive.");this.source.disconnect(),this.processor.disconnect();let e=new n.g.Event("pause");this.dispatchEvent(e),this._state="paused"}resume(){if("inactive"===this.state)throw new Error("DOMException: INVALID_STATE_ERR, state must NOT be inactive.");this.source.connect(this.processor),this.processor.connect(this.context.destination);let e=new n.g.Event("resume");this.dispatchEvent(e),this._state="recording"}requestData(){if("inactive"===this.state)throw new Error("DOMException: INVALID_STATE_ERR, state must NOT be inactive.");this._postMessageToWorker("getEncodedData")}static isTypeSupported(e){if("string"==typeof e&&!e)return!0;try{var{type:t,subtype:n,codec:r}=u._parseType(e)}catch(e){return!1}if("audio"!==t||"ogg"!==n&&"webm"!==n&&"wave"!==n&&"wav"!==n)return!1;switch(n){case"ogg":case"webm":if("opus"!==r&&r)return!1;break;case"wave":case"wav":if(r)return!1}return!0}static _parseType(e){try{const i=/^(\w+)\/(\w+)(;\s*codecs=(\w+))?$/;var[,t,n,,r]=e.match(i)}catch(t){return"string"!=typeof e||e?null:{type:"",subtype:"",codec:""}}return{type:t,subtype:n,codec:r}}}var c;["start","stop","dataavailable","pause","resume","error"].forEach((e=>i(u.prototype,e))),s&&"edge"===s.name&&(c=Worker.prototype.postMessage,Worker.prototype.postMessage=function(e,t=null){c.apply(this,[e])}),e.exports=u},4155:e=>{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var a,u=[],c=!1,l=-1;function d(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&f())}function f(){if(!c){var e=s(d);c=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new h(e,t)),1!==u.length||c||s(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},3399:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Collector=void 0;var r=n(6486),i=n(3701);function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=function(){function e(){var t,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n=void 0,(t="data")in this?Object.defineProperty(this,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[t]=n,this.data=[]}var t,n;return t=e,(n=[{key:"get",value:function(e){return(0,i.findExistingMetric)(e,this.data)}},{key:"set",value:function(e,t){var n=(0,i.findExistingMetric)(t,this.data);return n?n.value=e:this.data.push({labels:t,value:e}),this}},{key:"collect",value:function(e){return(0,r.filter)(this.data,(function(t){return(0,r.matches)(e)(t.labels)}))}},{key:"resetAll",value:function(){var e=this;return(0,r.each)(this.data,(function(t){e.reset(t.labels)})),this}}])&&o(t.prototype,n),e}();t.Collector=s},4486:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Counter=void 0;var a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(t).apply(this,arguments))}var n,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),n=t,(a=[{key:"inc",value:function(e){return this.add(1,e),this}},{key:"add",value:function(e,t){if(e<0)throw new Error("Expected increment amount to be greater than -1. Received: ".concat(e));var n=this.get(t);return this.set(n?n.value+e:e,t),this}},{key:"reset",value:function(e){this.set(0,e)}}])&&i(n.prototype,a),t}(n(3399).Collector);t.Counter=a},1993:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Gauge=void 0;var a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(t).apply(this,arguments))}var n,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),n=t,(a=[{key:"dec",value:function(e){var t=this.get(e);return this.set(t?t.value-1:0,e),this}},{key:"sub",value:function(e,t){var n=this.get(t);return this.set(n?n.value-e:0,t),this}}])&&i(n.prototype,a),t}(n(4486).Counter);t.Gauge=a},8215:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Histogram=void 0;var r=n(6486);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function c(e){return{entries:(0,r.reduce)(e,(function(e,t){return e[t.toString()]=0,e}),{"+Inf":0}),sum:0,count:0,raw:[]}}var l=function(e){function t(){var e,n,r,o,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?a(e):t}(this,s(t).call(this)),o=void 0,(r="buckets")in(n=a(e))?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,e.buckets=u.sort((function(e,t){return e>t?1:-1})),e.set(c(e.buckets)),e.observe=e.observe.bind(a(e)),e}var n,l;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,e),n=t,l=[{key:"observe",value:function(e,t){var n=this.get(t);null==n&&(n=this.set(c(this.buckets),t).get(t)),n.value.raw.push(e),n.value.entries["+Inf"]+=1;var i=function(e,t){if(t<e[e.length-1])for(var n=0;n<e.length;n+=1)if(t<=e[n])return n}(this.buckets,e);if(null!=i)for(var o=i;o<this.buckets.length;o+=1){var s=n.value.entries[this.buckets[o].toString()];n.value.entries[this.buckets[o].toString()]=s+1}return n.value.sum=(0,r.sum)(n.value.raw),n.value.count+=1,this}},{key:"reset",value:function(e){this.set(c(this.buckets),e)}}],l&&o(n.prototype,l),t}(n(3399).Collector);t.Histogram=l},4427:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={};t.default=void 0;var i=n(4961),o=n(5262);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})),t.default=function(){return new i.Registry}},4961:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Registry=void 0;var r=n(6486),i=n(4486),o=n(1993),s=n(8215),a=n(3701);function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var c=function(){function e(){var t,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n=void 0,(t="data")in this?Object.defineProperty(this,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[t]=n,this.data={counter:{},gauge:{},histogram:{}}}var t,n;return t=e,n=[{key:"validateInput",value:function(e,t,n,i){if(""===String(t))throw new Error("Metric name cannot be empty");if(-1===["counter","gauge","histogram"].indexOf(e))throw new Error("Unknown metric type ".concat(e));if("string"!=typeof n&&null!=n)throw new Error("help must be string or undefined/null");if((0,r.has)(this.data,"".concat(e,".").concat(t)))throw new Error("A metric with the name '".concat(t,"' already exists for type '").concat(e,"'"));if(!Array.isArray(i)&&null!=i)throw new Error("buckets must be array or undefined/null")}},{key:"create",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return this.validateInput(e,t,r,a),"counter"===e?(n=new i.Counter,this.data.counter[t]={help:r,instance:n,type:e}):"gauge"===e?(n=new o.Gauge,this.data.gauge[t]={help:r,instance:n,type:e}):(n=new s.Histogram(a),this.data.histogram[t]={help:r,instance:n,type:e}),n}},{key:"metrics",value:function(){return(0,r.reduce)(this.data,(function(e,t,n){return e+(0,r.reduce)(t,(function(e,t,i){var o=t.instance.collect(),s=e;return t.help.length>0&&(s+="# HELP ".concat(i," ").concat(t.help,"\n")),(s+="# TYPE ".concat(i," ").concat(n,"\n"))+(0,r.reduce)(o,(function(e,t){return e+("histogram"===n?(0,a.formatHistogramOrSummary)(i,t):(0,a.formatCounterOrGauge)(i,t))}),"")}),"")}),"")}},{key:"reset",value:function(){return(0,r.each)(this.data,(function(e){(0,r.each)(e,(function(e){e.instance.resetAll()}))})),this}},{key:"clear",value:function(){return this.data={counter:{},gauge:{},histogram:{}},this}},{key:"get",value:function(e,t){var n=(null!=e?[this.data[e]]:(0,r.valuesIn)(this.data)).find((function(e){return(0,r.has)(e,t)}));return null!=n?n[t].instance:void 0}}],n&&u(t.prototype,n),e}();t.Registry=c},5262:()=>{},3701:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatHistogramOrSummary=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"le",i="",o=function(e){var t=(0,r.map)(e.labels,(function(e,t){return"".concat(t,'="').concat(e,'"')}));return 0===t.length?"":"".concat(t.join(","))}(t);return o.length>0?(i+="".concat(e,"_count{").concat(o,"} ").concat(t.value.count,"\n"),i+="".concat(e,"_sum{").concat(o,"} ").concat(t.value.sum,"\n")):(i+="".concat(e,"_count ").concat(t.value.count,"\n"),i+="".concat(e,"_sum ").concat(t.value.sum,"\n")),(0,r.reduce)(t.value.entries,(function(t,r,s){return o.length>0?i+="".concat(e,"_bucket{").concat(n,'="').concat(s,'",').concat(o,"} ").concat(r,"\n"):i+="".concat(e,"_bucket{").concat(n,'="').concat(s,'"} ').concat(r,"\n"),i}),i)},t.findExistingMetric=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e?(0,r.find)(t,(function(t){return(0,r.isEqual)(t.labels,e)})):t[0]},t.formatCounterOrGauge=function(e,t){var n=" ".concat(t.value.toString());if(null==t.labels||0===Object.keys(t.labels).length)return"".concat(e).concat(n,"\n");var i=(0,r.map)(t.labels,(function(e,t){return"".concat(t,'="').concat(e,'"')}));return"".concat(e,"{").concat(i.join(","),"}").concat(n,"\n")};var r=n(6486)},4375:(e,t,n)=>{let r;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:n.g):e=>(r||(r=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},1798:(e,t,n)=>{"use strict";var r=n(4155),i=65536,o=n(9509).Buffer,s=n.g.crypto||n.g.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var n=o.allocUnsafe(e);if(e>0)if(e>i)for(var a=0;a<e;a+=i)s.getRandomValues(n.slice(a,a+i));else s.getRandomValues(n);return"function"==typeof t?r.nextTick((function(){t(null,n)})):n}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},4281:e=>{"use strict";var t={};function n(e,n,r){r||(r=Error);var i=function(e){var t,r;function i(t,r,i){return e.call(this,function(e,t,r){return"string"==typeof n?n:n(e,t,r)}(t,r,i))||this}return r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,i}(r);i.prototype.name=r.name,i.prototype.code=e,t[e]=i}function r(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,n){var i,o,s,a,u;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-9,n)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(r(t,"type"));else{var c=("number"!=typeof u&&(u=0),u+1>(a=e).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(r(t,"type"))}return s+". Received type ".concat(typeof n)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6753:(e,t,n)=>{"use strict";var r=n(4155),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=l;var o=n(9481),s=n(4229);n(5717)(l,o);for(var a=i(s.prototype),u=0;u<a.length;u++){var c=a[u];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",d)))}function d(){this._writableState.ended||r.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},2725:(e,t,n)=>{"use strict";e.exports=i;var r=n(4605);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}n(5717)(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},9481:(e,t,n)=>{"use strict";var r,i=n(4155);e.exports=O,O.ReadableState=S,n(7187).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=n(2503),u=n(8764).Buffer,c=n.g.Uint8Array||function(){},l=n(4616);o=l&&l.debuglog?l.debuglog("stream"):function(){};var d,f,h,p=n(7327),g=n(1195),m=n(2457).getHighWaterMark,b=n(4281).q,y=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,_=b.ERR_METHOD_NOT_IMPLEMENTED,w=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(5717)(O,a);var x=g.errorOrDestroy,T=["error","close","destroy","pause","resume"];function S(e,t,i){r=r||n(6753),e=e||{},"boolean"!=typeof i&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=n(2553).s),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function O(e){if(r=r||n(6753),!(this instanceof O))return new O(e);var t=this instanceof r;this._readableState=new S(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function E(e,t,n,r,i){o("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?I(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,R(e)))}}(e,a);else if(i||(s=function(e,t){var n,r;return r=t,u.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new y("chunk",["string","Buffer","Uint8Array"],t)),n}(a,t)),s)x(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),r)a.endEmitted?x(e,new w):P(e,a,t,!0);else if(a.ended)x(e,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?P(e,a,t,!1):M(e,a)):P(e,a,t,!1)}else r||(a.reading=!1,M(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function P(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&I(e)),M(e,t)}Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),O.prototype.destroy=g.destroy,O.prototype._undestroy=g.undestroy,O.prototype._destroy=function(e,t){t(e)},O.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=u.from(e,t),t=""),n=!0),E(this,e,t,!1,n)},O.prototype.unshift=function(e){return E(this,e,null,!0,!1)},O.prototype.isPaused=function(){return!1===this._readableState.flowing},O.prototype.setEncoding=function(e){d||(d=n(2553).s);var t=new d(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var A=1073741824;function C(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=A?e=A:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function I(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(R,e))}function R(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function M(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(k,e,t))}function k(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(o("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function D(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function j(e){o("readable nexttick read 0"),e.read(0)}function $(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function L(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function F(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(U,t,e))}function U(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function B(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}O.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):I(this),null;if(0===(e=C(e,t))&&t.ended)return 0===t.length&&F(this),null;var r,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=C(n,t))),null===(r=e>0?L(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&F(this)),null!==r&&this.emit("data",r),r},O.prototype._read=function(e){x(this,new _("_read()"))},O.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,o("pipe count=%d opts=%j",r.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?g:u;function u(){o("onend"),e.end()}r.endEmitted?i.nextTick(a):n.once("end",a),e.on("unpipe",(function t(i,s){o("onunpipe"),i===n&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",f),e.removeListener("unpipe",t),n.removeListener("end",u),n.removeListener("end",g),n.removeListener("data",d),l=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}));var c=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,N(e))}}(n);e.on("drain",c);var l=!1;function d(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==B(r.pipes,e))&&!l&&(o("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function f(t){o("onerror",t),g(),e.removeListener("error",f),0===s(e,"error")&&x(e,t)}function h(){e.removeListener("finish",p),g()}function p(){o("onfinish"),e.removeListener("close",h),g()}function g(){o("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",f),e.once("close",h),e.once("finish",p),e.emit("pipe",n),r.flowing||(o("pipe resume"),n.resume()),e},O.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=B(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},O.prototype.on=function(e,t){var n=a.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,o("on readable",r.length,r.reading),r.length?I(this):r.reading||i.nextTick(j,this))),n},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(D,this),n},O.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(D,this),t},O.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick($,e,t))}(this,e)),e.paused=!1,this},O.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},O.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(o("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<T.length;s++)e.on(T[s],this.emit.bind(this,T[s]));return this._read=function(t){o("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(O.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=n(5850)),f(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),O._fromList=L,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(O.from=function(e,t){return void 0===h&&(h=n(5167)),h(O,e,t)})},4605:(e,t,n)=>{"use strict";e.exports=l;var r=n(4281).q,i=r.ERR_METHOD_NOT_IMPLEMENTED,o=r.ERR_MULTIPLE_CALLBACK,s=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=r.ERR_TRANSFORM_WITH_LENGTH_0,u=n(6753);function c(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new o);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,n){f(e,t,n)}))}function f(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}n(5717)(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,n){n(new i("_transform()"))},l.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},4229:(e,t,n)=>{"use strict";var r,i=n(4155);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=O,O.WritableState=S;var s,a={deprecate:n(4927)},u=n(2503),c=n(8764).Buffer,l=n.g.Uint8Array||function(){},d=n(1195),f=n(2457).getHighWaterMark,h=n(4281).q,p=h.ERR_INVALID_ARG_TYPE,g=h.ERR_METHOD_NOT_IMPLEMENTED,m=h.ERR_MULTIPLE_CALLBACK,b=h.ERR_STREAM_CANNOT_PIPE,y=h.ERR_STREAM_DESTROYED,v=h.ERR_STREAM_NULL_VALUES,_=h.ERR_STREAM_WRITE_AFTER_END,w=h.ERR_UNKNOWN_ENCODING,x=d.errorOrDestroy;function T(){}function S(e,t,s){r=r||n(6753),e=e||{},"boolean"!=typeof s&&(s=t instanceof r),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if("function"!=typeof o)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(R,e,t),e._writableState.errorEmitted=!0,x(e,r)):(o(r),e._writableState.errorEmitted=!0,x(e,r),R(e,t))}(e,n,r,t,o);else{var s=C(n)||e.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||A(e,n),r?i.nextTick(P,e,n,s,o):P(e,n,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function O(e){var t=this instanceof(r=r||n(6753));if(!t&&!s.call(O,this))return new O(e);this._writableState=new S(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function E(e,t,n,r,i,o,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function P(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),R(e,t)}function A(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),s=t.corkedRequestsFree;s.entry=n;for(var a=0,u=!0;n;)i[a]=n,n.isBuf||(u=!1),n=n.next,a+=1;i.allBuffers=u,E(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,d=n.callback;if(E(e,t,!1,t.objectMode?1:c.length,c,l,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function C(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function I(e,t){e._final((function(n){t.pendingcb--,n&&x(e,n),t.prefinished=!0,e.emit("prefinish"),R(e,t)}))}function R(e,t){var n=C(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(I,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}n(5717)(O,u),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(O,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===O&&e&&e._writableState instanceof S}})):s=function(e){return e instanceof this},O.prototype.pipe=function(){x(this,new b)},O.prototype.write=function(e,t,n){var r,o=this._writableState,s=!1,a=!o.objectMode&&(r=e,c.isBuffer(r)||r instanceof l);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=T),o.ending?function(e,t){var n=new _;x(e,n),i.nextTick(t,n)}(this,n):(a||function(e,t,n,r){var o;return null===n?o=new v:"string"==typeof n||t.objectMode||(o=new p("chunk",["string","Buffer"],n)),!o||(x(e,o),i.nextTick(r,o),!1)}(this,o,e,n))&&(o.pendingcb++,s=function(e,t,n,r,i,o){if(!n){var s=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,n)),t}(t,r,i);r!==s&&(n=!0,i="buffer",r=s)}var a=t.objectMode?1:r.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else E(e,t,!1,a,r,i,o);return u}(this,o,a,e,t,n)),s},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||A(this,e))},O.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(e,t,n){n(new g("_write()"))},O.prototype._writev=null,O.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,R(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),O.prototype.destroy=d.destroy,O.prototype._undestroy=d.undestroy,O.prototype._destroy=function(e,t){t(e)}},5850:(e,t,n)=>{"use strict";var r,i=n(4155);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=n(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),d=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function g(e){var t=e[a];if(null!==t){var n=e[h].read();null!==n&&(e[d]=null,e[a]=null,e[u]=null,t(p(n,!1)))}}function m(e){i.nextTick(g,e)}var b=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((o(r={get stream(){return this[h]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(t,n){i.nextTick((function(){e[c]?n(e[c]):t(p(void 0,!0))}))}));var n,r=this[d];if(r)n=new Promise(function(e,t){return function(n,r){e.then((function(){t[l]?n(p(void 0,!0)):t[f](n,r)}),r)}}(r,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(p(o,!1));n=new Promise(this[f])}return this[d]=n,n}},Symbol.asyncIterator,(function(){return this})),o(r,"return",(function(){var e=this;return new Promise((function(t,n){e[h].destroy(null,(function(e){e?n(e):t(p(void 0,!0))}))}))})),r),b);e.exports=function(e){var t,n=Object.create(y,(o(t={},h,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,l,{value:e._readableState.endEmitted,writable:!0}),o(t,f,{value:function(e,t){var r=n[h].read();r?(n[d]=null,n[a]=null,n[u]=null,e(p(r,!1))):(n[a]=e,n[u]=t)},writable:!0}),t));return n[d]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[u];return null!==t&&(n[d]=null,n[a]=null,n[u]=null,t(e)),void(n[c]=e)}var r=n[a];null!==r&&(n[d]=null,n[a]=null,n[u]=null,r(p(void 0,!0))),n[l]=!0})),e.on("readable",m.bind(null,n)),n}},7327:(e,t,n)=>{"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=n(8764).Buffer,a=n(2361).inspect,u=a&&a.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,n;return t=e,n=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,n,r,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,n=i,r=a,s.prototype.copy.call(t,n,r),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0==(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:u,value:function(e,t){return a(this,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],n&&o(t.prototype,n),e}()},1195:(e,t,n)=>{"use strict";var r=n(4155);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(s,this,e)):r.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?n._writableState?n._writableState.errorEmitted?r.nextTick(o,n):(n._writableState.errorEmitted=!0,r.nextTick(i,n,e)):r.nextTick(i,n,e):t?(r.nextTick(o,n),t(e)):r.nextTick(o,n)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}},8610:(e,t,n)=>{"use strict";var r=n(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,n,o){if("function"==typeof n)return e(t,null,n);n||(n={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(o||i);var s=n.readable||!1!==n.readable&&t.readable,a=n.writable||!1!==n.writable&&t.writable,u=function(){t.writable||l()},c=t._writableState&&t._writableState.finished,l=function(){a=!1,c=!0,s||o.call(t)},d=t._readableState&&t._readableState.endEmitted,f=function(){s=!1,d=!0,a||o.call(t)},h=function(e){o.call(t,e)},p=function(){var e;return s&&!d?(t._readableState&&t._readableState.ended||(e=new r),o.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new r),o.call(t,e)):void 0},g=function(){t.req.on("finish",l)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",l),t.on("abort",p),t.req?g():t.on("request",g)):a&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",f),t.on("finish",l),!1!==n.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",f),t.removeListener("error",h),t.removeListener("close",p)}}},5167:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(e,t,n)=>{"use strict";var r,i=n(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var l,d=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var f=t.map((function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===r&&(r=n(8610)),r(e,{readable:t,writable:i},(function(e){if(e)return o(e);a=!0,o()}));var u=!1;return function(t){if(!a&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,(function(e){l||(l=e),e&&f.forEach(u),o||(f.forEach(u),d(l))}))}));return t.reduce(c)}},2457:(e,t,n)=>{"use strict";var r=n(4281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,n,i){var o=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(i?n:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},2503:(e,t,n)=>{e.exports=n(7187).EventEmitter},8473:(e,t,n)=>{(t=e.exports=n(9481)).Stream=t,t.Readable=t,t.Writable=n(4229),t.Duplex=n(6753),t.Transform=n(4605),t.PassThrough=n(2725),t.finished=n(8610),t.pipeline=n(9946)},8778:function(e){var t;t=()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{RingBuffer:()=>n});class n{static fromArray(e,t=0){const r=new n(t);return r.fromArray(e,0===t),r}constructor(e){if(this.buffer=[],this.pos=0,e<0)throw new RangeError("Invalid size.");this.size=e}getSize(){return this.size}getPos(){return this.pos}getBufferLength(){return this.buffer.length}add(...e){e.forEach((e=>{this.buffer[this.pos]=e,this.pos=(this.pos+1)%this.size}))}get(e){if(e<0&&(e+=this.buffer.length),!(e<0||e>this.buffer.length))return this.buffer.length<this.size?this.buffer[e]:this.buffer[(this.pos+e)%this.size]}getFirst(){return this.get(0)}getLast(){return this.get(-1)}getFirstN(e){return 0===e?[]:e<0?this.getLastN(-e):this.toArray().slice(0,e)}getLastN(e){return 0===e?[]:e<0?this.getFirstN(-e):this.toArray().slice(-e)}remove(e,t=1){if(e<0&&(e+=this.buffer.length),e<0||e>this.buffer.length)return[];const n=this.toArray(),r=n.splice(e,t);return this.fromArray(n),r}removeFirst(){return this.remove(0)[0]}removeLast(){return this.remove(-1)[0]}toArray(){return this.buffer.slice(this.pos).concat(this.buffer.slice(0,this.pos))}fromArray(e,t=!1){if(!Array.isArray(e))throw new TypeError("Input value is not an array.");t&&this.resize(e.length),0!==this.size&&(this.buffer=e.slice(-this.size),this.pos=this.buffer.length%this.size)}clear(){this.buffer=[],this.pos=0}resize(e){if(e<0)throw new RangeError("The size does not allow negative values.");if(0===e)this.clear();else if(e!==this.size){const t=this.toArray();this.fromArray(t.slice(-e)),this.pos=this.buffer.length%e}this.size=e}isFull(){return this.buffer.length===this.size}isEmpty(){return 0===this.buffer.length}}return t})(),e.exports=t()},2872:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.interval=t.iif=t.generate=t.fromEventPattern=t.fromEvent=t.from=t.forkJoin=t.empty=t.defer=t.connectable=t.concat=t.combineLatest=t.bindNodeCallback=t.bindCallback=t.UnsubscriptionError=t.TimeoutError=t.SequenceError=t.ObjectUnsubscribedError=t.NotFoundError=t.EmptyError=t.ArgumentOutOfRangeError=t.firstValueFrom=t.lastValueFrom=t.isObservable=t.identity=t.noop=t.pipe=t.NotificationKind=t.Notification=t.Subscriber=t.Subscription=t.Scheduler=t.VirtualAction=t.VirtualTimeScheduler=t.animationFrameScheduler=t.animationFrame=t.queueScheduler=t.queue=t.asyncScheduler=t.async=t.asapScheduler=t.asap=t.AsyncSubject=t.ReplaySubject=t.BehaviorSubject=t.Subject=t.animationFrames=t.observable=t.ConnectableObservable=t.Observable=void 0,t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.combineLatestWith=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=t.config=t.NEVER=t.EMPTY=t.scheduled=t.zip=t.using=t.timer=t.throwError=t.range=t.race=t.partition=t.pairs=t.onErrorResumeNext=t.of=t.never=t.merge=void 0,t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.pairwise=t.onErrorResumeNextWith=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=t.mergeAll=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=void 0,t.zipWith=t.zipAll=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=void 0;var o=n(2419);Object.defineProperty(t,"Observable",{enumerable:!0,get:function(){return o.Observable}});var s=n(9518);Object.defineProperty(t,"ConnectableObservable",{enumerable:!0,get:function(){return s.ConnectableObservable}});var a=n(2801);Object.defineProperty(t,"observable",{enumerable:!0,get:function(){return a.observable}});var u=n(9106);Object.defineProperty(t,"animationFrames",{enumerable:!0,get:function(){return u.animationFrames}});var c=n(3032);Object.defineProperty(t,"Subject",{enumerable:!0,get:function(){return c.Subject}});var l=n(5240);Object.defineProperty(t,"BehaviorSubject",{enumerable:!0,get:function(){return l.BehaviorSubject}});var d=n(3274);Object.defineProperty(t,"ReplaySubject",{enumerable:!0,get:function(){return d.ReplaySubject}});var f=n(280);Object.defineProperty(t,"AsyncSubject",{enumerable:!0,get:function(){return f.AsyncSubject}});var h=n(580);Object.defineProperty(t,"asap",{enumerable:!0,get:function(){return h.asap}}),Object.defineProperty(t,"asapScheduler",{enumerable:!0,get:function(){return h.asapScheduler}});var p=n(2445);Object.defineProperty(t,"async",{enumerable:!0,get:function(){return p.async}}),Object.defineProperty(t,"asyncScheduler",{enumerable:!0,get:function(){return p.asyncScheduler}});var g=n(8615);Object.defineProperty(t,"queue",{enumerable:!0,get:function(){return g.queue}}),Object.defineProperty(t,"queueScheduler",{enumerable:!0,get:function(){return g.queueScheduler}});var m=n(3660);Object.defineProperty(t,"animationFrame",{enumerable:!0,get:function(){return m.animationFrame}}),Object.defineProperty(t,"animationFrameScheduler",{enumerable:!0,get:function(){return m.animationFrameScheduler}});var b=n(4123);Object.defineProperty(t,"VirtualTimeScheduler",{enumerable:!0,get:function(){return b.VirtualTimeScheduler}}),Object.defineProperty(t,"VirtualAction",{enumerable:!0,get:function(){return b.VirtualAction}});var y=n(218);Object.defineProperty(t,"Scheduler",{enumerable:!0,get:function(){return y.Scheduler}});var v=n(3865);Object.defineProperty(t,"Subscription",{enumerable:!0,get:function(){return v.Subscription}});var _=n(5125);Object.defineProperty(t,"Subscriber",{enumerable:!0,get:function(){return _.Subscriber}});var w=n(3104);Object.defineProperty(t,"Notification",{enumerable:!0,get:function(){return w.Notification}}),Object.defineProperty(t,"NotificationKind",{enumerable:!0,get:function(){return w.NotificationKind}});var x=n(9985);Object.defineProperty(t,"pipe",{enumerable:!0,get:function(){return x.pipe}});var T=n(2576);Object.defineProperty(t,"noop",{enumerable:!0,get:function(){return T.noop}});var S=n(4781);Object.defineProperty(t,"identity",{enumerable:!0,get:function(){return S.identity}});var O=n(8386);Object.defineProperty(t,"isObservable",{enumerable:!0,get:function(){return O.isObservable}});var E=n(9309);Object.defineProperty(t,"lastValueFrom",{enumerable:!0,get:function(){return E.lastValueFrom}});var P=n(8182);Object.defineProperty(t,"firstValueFrom",{enumerable:!0,get:function(){return P.firstValueFrom}});var A=n(2351);Object.defineProperty(t,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return A.ArgumentOutOfRangeError}});var C=n(9474);Object.defineProperty(t,"EmptyError",{enumerable:!0,get:function(){return C.EmptyError}});var I=n(8598);Object.defineProperty(t,"NotFoundError",{enumerable:!0,get:function(){return I.NotFoundError}});var R=n(2642);Object.defineProperty(t,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return R.ObjectUnsubscribedError}});var M=n(6156);Object.defineProperty(t,"SequenceError",{enumerable:!0,get:function(){return M.SequenceError}});var k=n(4173);Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return k.TimeoutError}});var D=n(4805);Object.defineProperty(t,"UnsubscriptionError",{enumerable:!0,get:function(){return D.UnsubscriptionError}});var j=n(3050);Object.defineProperty(t,"bindCallback",{enumerable:!0,get:function(){return j.bindCallback}});var $=n(8130);Object.defineProperty(t,"bindNodeCallback",{enumerable:!0,get:function(){return $.bindNodeCallback}});var N=n(9258);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return N.combineLatest}});var L=n(2239);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return L.concat}});var F=n(2873);Object.defineProperty(t,"connectable",{enumerable:!0,get:function(){return F.connectable}});var U=n(7885);Object.defineProperty(t,"defer",{enumerable:!0,get:function(){return U.defer}});var B=n(6332);Object.defineProperty(t,"empty",{enumerable:!0,get:function(){return B.empty}});var V=n(7245);Object.defineProperty(t,"forkJoin",{enumerable:!0,get:function(){return V.forkJoin}});var z=n(5432);Object.defineProperty(t,"from",{enumerable:!0,get:function(){return z.from}});var W=n(3267);Object.defineProperty(t,"fromEvent",{enumerable:!0,get:function(){return W.fromEvent}});var G=n(470);Object.defineProperty(t,"fromEventPattern",{enumerable:!0,get:function(){return G.fromEventPattern}});var H=n(4303);Object.defineProperty(t,"generate",{enumerable:!0,get:function(){return H.generate}});var q=n(1757);Object.defineProperty(t,"iif",{enumerable:!0,get:function(){return q.iif}});var K=n(8990);Object.defineProperty(t,"interval",{enumerable:!0,get:function(){return K.interval}});var Y=n(1846);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return Y.merge}});var X=n(1339);Object.defineProperty(t,"never",{enumerable:!0,get:function(){return X.never}});var J=n(5726);Object.defineProperty(t,"of",{enumerable:!0,get:function(){return J.of}});var Z=n(724);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return Z.onErrorResumeNext}});var Q=n(4380);Object.defineProperty(t,"pairs",{enumerable:!0,get:function(){return Q.pairs}});var ee=n(7273);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ee.partition}});var te=n(5182);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return te.race}});var ne=n(322);Object.defineProperty(t,"range",{enumerable:!0,get:function(){return ne.range}});var re=n(2098);Object.defineProperty(t,"throwError",{enumerable:!0,get:function(){return re.throwError}});var ie=n(7513);Object.defineProperty(t,"timer",{enumerable:!0,get:function(){return ie.timer}});var oe=n(2962);Object.defineProperty(t,"using",{enumerable:!0,get:function(){return oe.using}});var se=n(7654);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return se.zip}});var ae=n(5207);Object.defineProperty(t,"scheduled",{enumerable:!0,get:function(){return ae.scheduled}});var ue=n(6332);Object.defineProperty(t,"EMPTY",{enumerable:!0,get:function(){return ue.EMPTY}});var ce=n(1339);Object.defineProperty(t,"NEVER",{enumerable:!0,get:function(){return ce.NEVER}}),i(n(8433),t);var le=n(3280);Object.defineProperty(t,"config",{enumerable:!0,get:function(){return le.config}});var de=n(6474);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return de.audit}});var fe=n(5382);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return fe.auditTime}});var he=n(9715);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return he.buffer}});var pe=n(3814);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return pe.bufferCount}});var ge=n(7211);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return ge.bufferTime}});var me=n(4943);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return me.bufferToggle}});var be=n(1240);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return be.bufferWhen}});var ye=n(9548);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return ye.catchError}});var ve=n(2128);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return ve.combineAll}});var _e=n(3240);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return _e.combineLatestAll}});var we=n(5024);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return we.combineLatestWith}});var xe=n(4413);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return xe.concatAll}});var Te=n(7498);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return Te.concatMap}});var Se=n(6109);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return Se.concatMapTo}});var Oe=n(9664);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return Oe.concatWith}});var Ee=n(1995);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return Ee.connect}});var Pe=n(993);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return Pe.count}});var Ae=n(496);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return Ae.debounce}});var Ce=n(1385);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return Ce.debounceTime}});var Ie=n(1658);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return Ie.defaultIfEmpty}});var Re=n(5841);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return Re.delay}});var Me=n(8798);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return Me.delayWhen}});var ke=n(1080);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return ke.dematerialize}});var De=n(3054);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return De.distinct}});var je=n(8737);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return je.distinctUntilChanged}});var $e=n(7957);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return $e.distinctUntilKeyChanged}});var Ne=n(8633);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return Ne.elementAt}});var Le=n(911);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return Le.endWith}});var Fe=n(2096);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return Fe.every}});var Ue=n(67);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return Ue.exhaust}});var Be=n(5337);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return Be.exhaustAll}});var Ve=n(5635);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return Ve.exhaustMap}});var ze=n(9745);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return ze.expand}});var We=n(9154);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return We.filter}});var Ge=n(9283);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return Ge.finalize}});var He=n(7119);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return He.find}});var qe=n(4706);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return qe.findIndex}});var Ke=n(9219);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return Ke.first}});var Ye=n(9749);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return Ye.groupBy}});var Xe=n(9438);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return Xe.ignoreElements}});var Je=n(8515);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return Je.isEmpty}});var Ze=n(2435);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return Ze.last}});var Qe=n(7291);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return Qe.map}});var et=n(8313);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return et.mapTo}});var tt=n(3209);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return tt.materialize}});var nt=n(2620);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return nt.max}});var rt=n(3783);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return rt.mergeAll}});var it=n(1788);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return it.flatMap}});var ot=n(9475);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ot.mergeMap}});var st=n(1211);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return st.mergeMapTo}});var at=n(7267);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return at.mergeScan}});var ut=n(9303);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ut.mergeWith}});var ct=n(9714);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ct.min}});var lt=n(3848);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return lt.multicast}});var dt=n(1184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return dt.observeOn}});var ft=n(7582);Object.defineProperty(t,"onErrorResumeNextWith",{enumerable:!0,get:function(){return ft.onErrorResumeNextWith}});var ht=n(2731);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ht.pairwise}});var pt=n(4691);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return pt.pluck}});var gt=n(4474);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return gt.publish}});var mt=n(52);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return mt.publishBehavior}});var bt=n(2110);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return bt.publishLast}});var yt=n(9864);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return yt.publishReplay}});var vt=n(179);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return vt.raceWith}});var _t=n(122);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return _t.reduce}});var wt=n(5313);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return wt.repeat}});var xt=n(4068);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return xt.repeatWhen}});var Tt=n(64);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return Tt.retry}});var St=n(1188);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return St.retryWhen}});var Ot=n(8739);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return Ot.refCount}});var Et=n(4193);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Et.sample}});var Pt=n(6170);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Pt.sampleTime}});var At=n(5876);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return At.scan}});var Ct=n(1791);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Ct.sequenceEqual}});var It=n(5137);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return It.share}});var Rt=n(1348);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Rt.shareReplay}});var Mt=n(8242);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return Mt.single}});var kt=n(3169);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return kt.skip}});var Dt=n(2454);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Dt.skipLast}});var jt=n(6931);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return jt.skipUntil}});var $t=n(7913);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return $t.skipWhile}});var Nt=n(9234);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Nt.startWith}});var Lt=n(276);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return Lt.subscribeOn}});var Ft=n(9253);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return Ft.switchAll}});var Ut=n(8518);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Ut.switchMap}});var Bt=n(1173);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Bt.switchMapTo}});var Vt=n(3855);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Vt.switchScan}});var zt=n(4783);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return zt.take}});var Wt=n(1980);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return Wt.takeLast}});var Gt=n(9845);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Gt.takeUntil}});var Ht=n(6060);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return Ht.takeWhile}});var qt=n(1138);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return qt.tap}});var Kt=n(7306);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return Kt.throttle}});var Yt=n(8968);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return Yt.throttleTime}});var Xt=n(1779);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return Xt.throwIfEmpty}});var Jt=n(8005);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Jt.timeInterval}});var Zt=n(4173);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Zt.timeout}});var Qt=n(7223);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Qt.timeoutWith}});var en=n(8975);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return en.timestamp}});var tn=n(2);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return tn.toArray}});var nn=n(2826);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return nn.window}});var rn=n(7526);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return rn.windowCount}});var on=n(8294);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return on.windowTime}});var sn=n(1883);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return sn.windowToggle}});var an=n(4309);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return an.windowWhen}});var un=n(3041);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return un.withLatestFrom}});var cn=n(8593);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return cn.zipAll}});var ln=n(8096);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return ln.zipWith}})},280:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncSubject=void 0;var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return i(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;n?e.error(o):(s||a)&&(r&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,n=t._hasValue,r=t._value;t._isComplete||(this._isComplete=!0,n&&e.prototype.next.call(this,r),e.prototype.complete.call(this))},t}(n(3032).Subject);t.AsyncSubject=o},5240:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.BehaviorSubject=void 0;var o=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(n(3032).Subject);t.BehaviorSubject=o},3104:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeNotification=t.Notification=t.NotificationKind=void 0;var r,i=n(6332),o=n(5726),s=n(2098),a=n(3005);(r=t.NotificationKind||(t.NotificationKind={})).NEXT="N",r.ERROR="E",r.COMPLETE="C";var u=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){return c(this,e)},e.prototype.do=function(e,t,n){var r=this,i=r.kind,o=r.value,s=r.error;return"N"===i?null==e?void 0:e(o):"E"===i?null==t?void 0:t(s):null==n?void 0:n()},e.prototype.accept=function(e,t,n){var r;return a.isFunction(null===(r=e)||void 0===r?void 0:r.next)?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){var e=this,t=e.kind,n=e.value,r=e.error,a="N"===t?o.of(n):"E"===t?s.throwError((function(){return r})):"C"===t?i.EMPTY:0;if(!a)throw new TypeError("Unexpected notification kind "+t);return a},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();function c(e,t){var n,r,i,o=e,s=o.kind,a=o.value,u=o.error;if("string"!=typeof s)throw new TypeError('Invalid notification, missing "kind"');"N"===s?null===(n=t.next)||void 0===n||n.call(t,a):"E"===s?null===(r=t.error)||void 0===r||r.call(t,u):null===(i=t.complete)||void 0===i||i.call(t)}t.Notification=u,t.observeNotification=c},7286:(e,t)=>{"use strict";function n(e,t,n){return{kind:e,value:t,error:n}}Object.defineProperty(t,"__esModule",{value:!0}),t.createNotification=t.nextNotification=t.errorNotification=t.COMPLETE_NOTIFICATION=void 0,t.COMPLETE_NOTIFICATION=n("C",void 0,void 0),t.errorNotification=function(e){return n("E",void 0,e)},t.nextNotification=function(e){return n("N",e,void 0)},t.createNotification=n},2419:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var r=n(5125),i=n(3865),o=n(2801),s=n(9985),a=n(3280),u=n(3005),c=n(6110),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var o,s=this,a=(o=e)&&o instanceof r.Subscriber||function(e){return e&&u.isFunction(e.next)&&u.isFunction(e.error)&&u.isFunction(e.complete)}(o)&&i.isSubscription(o)?e:new r.SafeSubscriber(e,t,n);return c.errorContext((function(){var e=s,t=e.operator,n=e.source;a.add(t?t.call(a,n):n?s._subscribe(a):s._trySubscribe(a))})),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=d(t))((function(t,i){var o=new r.SafeSubscriber({next:function(t){try{e(t)}catch(e){i(e),o.unsubscribe()}},error:i,complete:t});n.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=d(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function d(e){var t;return null!==(t=null!=e?e:a.config.Promise)&&void 0!==t?t:Promise}t.Observable=l},3274:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ReplaySubject=void 0;var o=n(3032),s=n(7950),a=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=s.dateTimestampProvider);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return i(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,s=n._timestampProvider,a=n._windowTime;r||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var s=n.now(),a=0,u=1;u<r.length&&r[u]<=s;u+=2)a=u;a&&r.splice(0,a+1)}},t}(o.Subject);t.ReplaySubject=a},218:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=void 0;var r=n(7950),i=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=r.dateTimestampProvider.now,e}();t.Scheduler=i},3032:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousSubject=t.Subject=void 0;var s=n(2419),a=n(3865),u=n(2642),c=n(6967),l=n(6110),d=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype.lift=function(e){var t=new f(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new u.ObjectUnsubscribedError},t.prototype.next=function(e){var t=this;l.errorContext((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=o(t.currentObservers),s=i.next();!s.done;s=i.next())s.value.next(e)}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;l.errorContext((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;l.errorContext((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?a.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new a.Subscription((function(){t.currentObservers=null,c.arrRemove(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new s.Observable;return e.source=this,e},t.create=function(e,t){return new f(e,t)},t}(s.Observable);t.Subject=d;var f=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return i(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:a.EMPTY_SUBSCRIPTION},t}(d);t.AnonymousSubject=f},5125:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_OBSERVER=t.SafeSubscriber=t.Subscriber=void 0;var o=n(3005),s=n(3865),a=n(3280),u=n(7968),c=n(2576),l=n(7286),d=n(4590),f=n(6110),h=function(e){function n(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,s.isSubscription(n)&&n.add(r)):r.destination=t.EMPTY_OBSERVER,r}return i(n,e),n.create=function(e,t,n){return new b(e,t,n)},n.prototype.next=function(e){this.isStopped?v(l.nextNotification(e),this):this._next(e)},n.prototype.error=function(e){this.isStopped?v(l.errorNotification(e),this):(this.isStopped=!0,this._error(e))},n.prototype.complete=function(){this.isStopped?v(l.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},n.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n}(s.Subscription);t.Subscriber=h;var p=Function.prototype.bind;function g(e,t){return p.call(e,t)}var m=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){y(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){y(e)}else y(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){y(e)}},e}(),b=function(e){function t(t,n,r){var i,s,u=e.call(this)||this;return o.isFunction(t)||!t?i={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&a.config.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},i={next:t.next&&g(t.next,s),error:t.error&&g(t.error,s),complete:t.complete&&g(t.complete,s)}):i=t,u.destination=new m(i),u}return i(t,e),t}(h);function y(e){a.config.useDeprecatedSynchronousErrorHandling?f.captureError(e):u.reportUnhandledError(e)}function v(e,t){var n=a.config.onStoppedNotification;n&&d.timeoutProvider.setTimeout((function(){return n(e,t)}))}t.SafeSubscriber=b,t.EMPTY_OBSERVER={closed:!0,next:c.noop,error:function(e){throw e},complete:c.noop}},3865:function(e,t,n){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.isSubscription=t.EMPTY_SUBSCRIPTION=t.Subscription=void 0;var s=n(3005),a=n(4805),u=n(6967),c=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,u,c;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var f=r(d),h=f.next();!h.done;h=f.next())h.value.remove(this)}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}else d.remove(this);var p=this.initialTeardown;if(s.isFunction(p))try{p()}catch(e){c=e instanceof a.UnsubscriptionError?e.errors:[e]}var g=this._finalizers;if(g){this._finalizers=null;try{for(var m=r(g),b=m.next();!b.done;b=m.next()){var y=b.value;try{l(y)}catch(e){c=null!=c?c:[],e instanceof a.UnsubscriptionError?c=o(o([],i(c)),i(e.errors)):c.push(e)}}}catch(e){n={error:e}}finally{try{b&&!b.done&&(u=m.return)&&u.call(m)}finally{if(n)throw n.error}}}if(c)throw new a.UnsubscriptionError(c)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&u.arrRemove(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&u.arrRemove(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function l(e){s.isFunction(e)?e():e.unsubscribe()}t.Subscription=c,t.EMPTY_SUBSCRIPTION=c.EMPTY,t.isSubscription=function(e){return e instanceof c||e&&"closed"in e&&s.isFunction(e.remove)&&s.isFunction(e.add)&&s.isFunction(e.unsubscribe)}},3280:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=void 0,t.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},8182:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.firstValueFrom=void 0;var r=n(9474),i=n(5125);t.firstValueFrom=function(e,t){var n="object"==typeof t;return new Promise((function(o,s){var a=new i.SafeSubscriber({next:function(e){o(e),a.unsubscribe()},error:s,complete:function(){n?o(t.defaultValue):s(new r.EmptyError)}});e.subscribe(a)}))}},9309:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastValueFrom=void 0;var r=n(9474);t.lastValueFrom=function(e,t){var n="object"==typeof t;return new Promise((function(i,o){var s,a=!1;e.subscribe({next:function(e){s=e,a=!0},error:o,complete:function(){a?i(s):n?i(t.defaultValue):o(new r.EmptyError)}})}))}},9518:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectableObservable=void 0;var o=n(2419),s=n(3865),a=n(8739),u=n(4990),c=n(4935),l=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,c.hasLift(t)&&(r.lift=t.lift),r}return i(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new s.Subscription;var n=this.getSubject();t.add(this.source.subscribe(u.createOperatorSubscriber(n,void 0,(function(){e._teardown(),n.complete()}),(function(t){e._teardown(),n.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=s.Subscription.EMPTY)}return t},t.prototype.refCount=function(){return a.refCount()(this)},t}(o.Observable);t.ConnectableObservable=l},3050:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallback=void 0;var r=n(9592);t.bindCallback=function(e,t,n){return r.bindCallbackInternals(!1,e,t,n)}},9592:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallbackInternals=void 0;var o=n(9016),s=n(2419),a=n(276),u=n(1914),c=n(1184),l=n(280);t.bindCallbackInternals=function e(t,n,d,f){if(d){if(!o.isScheduler(d))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return e(t,n,f).apply(this,r).pipe(u.mapOneOrManyArgs(d))};f=d}return f?function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return e(t,n).apply(this,r).pipe(a.subscribeOn(f),c.observeOn(f))}:function(){for(var e=this,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var u=new l.AsyncSubject,c=!0;return new s.Observable((function(s){var a=u.subscribe(s);if(c){c=!1;var l=!1,d=!1;n.apply(e,i(i([],r(o)),[function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(t){var r=e.shift();if(null!=r)return void u.error(r)}u.next(1<e.length?e:e[0]),d=!0,l&&u.complete()}])),d&&u.complete(),l=!0}return a}))}}},8130:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindNodeCallback=void 0;var r=n(9592);t.bindNodeCallback=function(e,t,n){return r.bindCallbackInternals(!0,e,t,n)}},9258:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestInit=t.combineLatest=void 0;var r=n(2419),i=n(1203),o=n(5432),s=n(4781),a=n(1914),u=n(2433),c=n(641),l=n(4990),d=n(7738);function f(e,t,n){return void 0===n&&(n=s.identity),function(r){h(t,(function(){for(var i=e.length,s=new Array(i),a=i,u=i,c=function(i){h(t,(function(){var c=o.from(e[i],t),d=!1;c.subscribe(l.createOperatorSubscriber(r,(function(e){s[i]=e,d||(d=!0,u--),u||r.next(n(s.slice()))}),(function(){--a||r.complete()})))}),r)},d=0;d<i;d++)c(d)}),r)}}function h(e,t,n){e?d.executeSchedule(n,e,t):t()}t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=u.popScheduler(e),l=u.popResultSelector(e),d=i.argsArgArrayOrObject(e),h=d.args,p=d.keys;if(0===h.length)return o.from([],n);var g=new r.Observable(f(h,n,p?function(e){return c.createObject(p,e)}:s.identity));return l?g.pipe(a.mapOneOrManyArgs(l)):g},t.combineLatestInit=f},2239:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var r=n(4413),i=n(2433),o=n(5432);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.concatAll()(o.from(e,i.popScheduler(e)))}},2873:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connectable=void 0;var r=n(3032),i=n(2419),o=n(7885),s={connector:function(){return new r.Subject},resetOnDisconnect:!0};t.connectable=function(e,t){void 0===t&&(t=s);var n=null,r=t.connector,a=t.resetOnDisconnect,u=void 0===a||a,c=r(),l=new i.Observable((function(e){return c.subscribe(e)}));return l.connect=function(){return n&&!n.closed||(n=o.defer((function(){return e})).subscribe(c),u&&n.add((function(){return c=r()}))),n},l}},7885:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defer=void 0;var r=n(2419),i=n(7103);t.defer=function(e){return new r.Observable((function(t){i.innerFrom(e()).subscribe(t)}))}},9106:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrames=void 0;var r=n(2419),i=n(6813),o=n(505);function s(e){return new r.Observable((function(t){var n=e||i.performanceTimestampProvider,r=n.now(),s=0,a=function(){t.closed||(s=o.animationFrameProvider.requestAnimationFrame((function(i){s=0;var o=n.now();t.next({timestamp:e?o:i,elapsed:o-r}),a()})))};return a(),function(){s&&o.animationFrameProvider.cancelAnimationFrame(s)}}))}t.animationFrames=function(e){return e?s(e):a};var a=s()},6332:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.empty=t.EMPTY=void 0;var r=n(2419);t.EMPTY=new r.Observable((function(e){return e.complete()})),t.empty=function(e){return e?function(e){return new r.Observable((function(t){return e.schedule((function(){return t.complete()}))}))}(e):t.EMPTY}},7245:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forkJoin=void 0;var r=n(2419),i=n(1203),o=n(7103),s=n(2433),a=n(4990),u=n(1914),c=n(641);t.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=s.popResultSelector(e),l=i.argsArgArrayOrObject(e),d=l.args,f=l.keys,h=new r.Observable((function(e){var t=d.length;if(t)for(var n=new Array(t),r=t,i=t,s=function(t){var s=!1;o.innerFrom(d[t]).subscribe(a.createOperatorSubscriber(e,(function(e){s||(s=!0,i--),n[t]=e}),(function(){return r--}),void 0,(function(){r&&s||(i||e.next(f?c.createObject(f,n):n),e.complete())})))},u=0;u<t;u++)s(u);else e.complete()}));return n?h.pipe(u.mapOneOrManyArgs(n)):h}},5432:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.from=void 0;var r=n(5207),i=n(7103);t.from=function(e,t){return t?r.scheduled(e,t):i.innerFrom(e)}},3267:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0}),t.fromEvent=void 0;var i=n(7103),o=n(2419),s=n(9475),a=n(3909),u=n(3005),c=n(1914),l=["addListener","removeListener"],d=["addEventListener","removeEventListener"],f=["on","off"];function h(e,t){return function(n){return function(r){return e[n](t,r)}}}t.fromEvent=function e(t,n,p,g){if(u.isFunction(p)&&(g=p,p=void 0),g)return e(t,n,p).pipe(c.mapOneOrManyArgs(g));var m=r(function(e){return u.isFunction(e.addEventListener)&&u.isFunction(e.removeEventListener)}(t)?d.map((function(e){return function(r){return t[e](n,r,p)}})):function(e){return u.isFunction(e.addListener)&&u.isFunction(e.removeListener)}(t)?l.map(h(t,n)):function(e){return u.isFunction(e.on)&&u.isFunction(e.off)}(t)?f.map(h(t,n)):[],2),b=m[0],y=m[1];if(!b&&a.isArrayLike(t))return s.mergeMap((function(t){return e(t,n,p)}))(i.innerFrom(t));if(!b)throw new TypeError("Invalid event target");return new o.Observable((function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return b(t),function(){return y(t)}}))}},470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromEventPattern=void 0;var r=n(2419),i=n(3005),o=n(1914);t.fromEventPattern=function e(t,n,s){return s?e(t,n).pipe(o.mapOneOrManyArgs(s)):new r.Observable((function(e){var r=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1===t.length?t[0]:t)},o=t(r);return i.isFunction(n)?function(){return n(r,o)}:void 0}))}},851:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromSubscribable=void 0;var r=n(2419);t.fromSubscribable=function(e){return new r.Observable((function(t){return e.subscribe(t)}))}},4303:function(e,t,n){"use strict";var r=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.generate=void 0;var i=n(4781),o=n(9016),s=n(7885),a=n(1297);t.generate=function(e,t,n,u,c){var l,d,f,h;function p(){var e;return r(this,(function(r){switch(r.label){case 0:e=h,r.label=1;case 1:return t&&!t(e)?[3,4]:[4,f(e)];case 2:r.sent(),r.label=3;case 3:return e=n(e),[3,1];case 4:return[2]}}))}return 1===arguments.length?(h=(l=e).initialState,t=l.condition,n=l.iterate,d=l.resultSelector,f=void 0===d?i.identity:d,c=l.scheduler):(h=e,!u||o.isScheduler(u)?(f=i.identity,c=u):f=u),s.defer(c?function(){return a.scheduleIterable(p(),c)}:p)}},1757:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iif=void 0;var r=n(7885);t.iif=function(e,t,n){return r.defer((function(){return e()?t:n}))}},7103:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof s?s(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.fromReadableStreamLike=t.fromAsyncIterable=t.fromIterable=t.fromPromise=t.fromArrayLike=t.fromInteropObservable=t.innerFrom=void 0;var a=n(3909),u=n(6018),c=n(2419),l=n(9500),d=n(9595),f=n(9906),h=n(2743),p=n(7823),g=n(3005),m=n(7968),b=n(2801);function y(e){return new c.Observable((function(t){var n=e[b.observable]();if(g.isFunction(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}function v(e){return new c.Observable((function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()}))}function _(e){return new c.Observable((function(t){e.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,m.reportUnhandledError)}))}function w(e){return new c.Observable((function(t){var n,r;try{for(var i=s(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()}))}function x(e){return new c.Observable((function(t){(function(e,t){var n,s,a,u;return r(this,void 0,void 0,(function(){var r,c;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,6,11]),n=o(e),i.label=1;case 1:return[4,n.next()];case 2:if((s=i.sent()).done)return[3,4];if(r=s.value,t.next(r),t.closed)return[2];i.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=i.sent(),a={error:c},[3,11];case 6:return i.trys.push([6,,9,10]),s&&!s.done&&(u=n.return)?[4,u.call(n)]:[3,8];case 7:i.sent(),i.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function T(e){return x(p.readableStreamLikeToAsyncGenerator(e))}t.innerFrom=function(e){if(e instanceof c.Observable)return e;if(null!=e){if(l.isInteropObservable(e))return y(e);if(a.isArrayLike(e))return v(e);if(u.isPromise(e))return _(e);if(d.isAsyncIterable(e))return x(e);if(h.isIterable(e))return w(e);if(p.isReadableStreamLike(e))return T(e)}throw f.createInvalidObservableTypeError(e)},t.fromInteropObservable=y,t.fromArrayLike=v,t.fromPromise=_,t.fromIterable=w,t.fromAsyncIterable=x,t.fromReadableStreamLike=T},8990:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.interval=void 0;var r=n(2445),i=n(7513);t.interval=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=r.asyncScheduler),e<0&&(e=0),i.timer(e,e,t)}},1846:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var r=n(3783),i=n(7103),o=n(6332),s=n(2433),a=n(5432);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=s.popScheduler(e),u=s.popNumber(e,1/0),c=e;return c.length?1===c.length?i.innerFrom(c[0]):r.mergeAll(u)(a.from(c,n)):o.EMPTY}},1339:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.never=t.NEVER=void 0;var r=n(2419),i=n(2576);t.NEVER=new r.Observable(i.noop),t.never=function(){return t.NEVER}},5726:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.of=void 0;var r=n(2433),i=n(5432);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r.popScheduler(e);return i.from(e,n)}},724:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=void 0;var r=n(2419),i=n(5498),o=n(4990),s=n(2576),a=n(7103);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.argsOrArgArray(e);return new r.Observable((function(e){var t=0,r=function(){if(t<n.length){var i=void 0;try{i=a.innerFrom(n[t++])}catch(e){return void r()}var u=new o.OperatorSubscriber(e,void 0,s.noop,s.noop);i.subscribe(u),u.add(r)}else e.complete()};r()}))}},4380:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairs=void 0;var r=n(5432);t.pairs=function(e,t){return r.from(Object.entries(e),t)}},7273:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var r=n(8634),i=n(9154),o=n(7103);t.partition=function(e,t,n){return[i.filter(t,n)(o.innerFrom(e)),i.filter(r.not(t,n))(o.innerFrom(e))]}},5182:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.raceInit=t.race=void 0;var r=n(2419),i=n(7103),o=n(5498),s=n(4990);function a(e){return function(t){for(var n=[],r=function(r){n.push(i.innerFrom(e[r]).subscribe(s.createOperatorSubscriber(t,(function(e){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}t.next(e)}))))},o=0;n&&!t.closed&&o<e.length;o++)r(o)}}t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=o.argsOrArgArray(e)).length?i.innerFrom(e[0]):new r.Observable(a(e))},t.raceInit=a},322:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.range=void 0;var r=n(2419),i=n(6332);t.range=function(e,t,n){if(null==t&&(t=e,e=0),t<=0)return i.EMPTY;var o=t+e;return new r.Observable(n?function(t){var r=e;return n.schedule((function(){r<o?(t.next(r++),this.schedule()):t.complete()}))}:function(t){for(var n=e;n<o&&!t.closed;)t.next(n++);t.complete()})}},2098:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwError=void 0;var r=n(2419),i=n(3005);t.throwError=function(e,t){var n=i.isFunction(e)?e:function(){return e},o=function(e){return e.error(n())};return new r.Observable(t?function(e){return t.schedule(o,0,e)}:o)}},7513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timer=void 0;var r=n(2419),i=n(2445),o=n(9016),s=n(1677);t.timer=function(e,t,n){void 0===e&&(e=0),void 0===n&&(n=i.async);var a=-1;return null!=t&&(o.isScheduler(t)?n=t:a=t),new r.Observable((function(t){var r=s.isValidDate(e)?+e-n.now():e;r<0&&(r=0);var i=0;return n.schedule((function(){t.closed||(t.next(i++),0<=a?this.schedule(void 0,a):t.complete())}),r)}))}},2962:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.using=void 0;var r=n(2419),i=n(7103),o=n(6332);t.using=function(e,t){return new r.Observable((function(n){var r=e(),s=t(r);return(s?i.innerFrom(s):o.EMPTY).subscribe(n),function(){r&&r.unsubscribe()}}))}},7654:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=n(2419),s=n(7103),a=n(5498),u=n(6332),c=n(4990),l=n(2433);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=l.popResultSelector(e),d=a.argsOrArgArray(e);return d.length?new o.Observable((function(e){var t=d.map((function(){return[]})),o=d.map((function(){return!1}));e.add((function(){t=o=null}));for(var a=function(a){s.innerFrom(d[a]).subscribe(c.createOperatorSubscriber(e,(function(s){if(t[a].push(s),t.every((function(e){return e.length}))){var u=t.map((function(e){return e.shift()}));e.next(n?n.apply(void 0,i([],r(u))):u),t.some((function(e,t){return!e.length&&o[t]}))&&e.complete()}}),(function(){o[a]=!0,!t[a].length&&e.complete()})))},u=0;!e.closed&&u<d.length;u++)a(u);return function(){t=o=null}})):u.EMPTY}},4990:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.OperatorSubscriber=t.createOperatorSubscriber=void 0;var o=n(5125);t.createOperatorSubscriber=function(e,t,n,r,i){return new s(e,t,n,r,i)};var s=function(e){function t(t,n,r,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return i(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(o.Subscriber);t.OperatorSubscriber=s},6474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.audit=void 0;var r=n(4935),i=n(7103),o=n(4990);t.audit=function(e){return r.operate((function(t,n){var r=!1,s=null,a=null,u=!1,c=function(){if(null==a||a.unsubscribe(),a=null,r){r=!1;var e=s;s=null,n.next(e)}u&&n.complete()},l=function(){a=null,u&&n.complete()};t.subscribe(o.createOperatorSubscriber(n,(function(t){r=!0,s=t,a||i.innerFrom(e(t)).subscribe(a=o.createOperatorSubscriber(n,c,l))}),(function(){u=!0,(!r||!a||a.closed)&&n.complete()})))}))}},5382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.auditTime=void 0;var r=n(2445),i=n(6474),o=n(7513);t.auditTime=function(e,t){return void 0===t&&(t=r.asyncScheduler),i.audit((function(){return o.timer(e,t)}))}},9715:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buffer=void 0;var r=n(4935),i=n(2576),o=n(4990),s=n(7103);t.buffer=function(e){return r.operate((function(t,n){var r=[];return t.subscribe(o.createOperatorSubscriber(n,(function(e){return r.push(e)}),(function(){n.next(r),n.complete()}))),s.innerFrom(e).subscribe(o.createOperatorSubscriber(n,(function(){var e=r;r=[],n.next(e)}),i.noop)),function(){r=null}}))}},3814:function(e,t,n){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferCount=void 0;var i=n(4935),o=n(4990),s=n(6967);t.bufferCount=function(e,t){return void 0===t&&(t=null),t=null!=t?t:e,i.operate((function(n,i){var a=[],u=0;n.subscribe(o.createOperatorSubscriber(i,(function(n){var o,c,l,d,f=null;u++%t==0&&a.push([]);try{for(var h=r(a),p=h.next();!p.done;p=h.next())(b=p.value).push(n),e<=b.length&&(f=null!=f?f:[]).push(b)}catch(e){o={error:e}}finally{try{p&&!p.done&&(c=h.return)&&c.call(h)}finally{if(o)throw o.error}}if(f)try{for(var g=r(f),m=g.next();!m.done;m=g.next()){var b=m.value;s.arrRemove(a,b),i.next(b)}}catch(e){l={error:e}}finally{try{m&&!m.done&&(d=g.return)&&d.call(g)}finally{if(l)throw l.error}}}),(function(){var e,t;try{for(var n=r(a),o=n.next();!o.done;o=n.next()){var s=o.value;i.next(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}i.complete()}),void 0,(function(){a=null})))}))}},7211:function(e,t,n){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferTime=void 0;var i=n(3865),o=n(4935),s=n(4990),a=n(6967),u=n(2445),c=n(2433),l=n(7738);t.bufferTime=function(e){for(var t,n,d=[],f=1;f<arguments.length;f++)d[f-1]=arguments[f];var h=null!==(t=c.popScheduler(d))&&void 0!==t?t:u.asyncScheduler,p=null!==(n=d[0])&&void 0!==n?n:null,g=d[1]||1/0;return o.operate((function(t,n){var o=[],u=!1,c=function(e){var t=e.buffer;e.subs.unsubscribe(),a.arrRemove(o,e),n.next(t),u&&d()},d=function(){if(o){var t=new i.Subscription;n.add(t);var r={buffer:[],subs:t};o.push(r),l.executeSchedule(t,h,(function(){return c(r)}),e)}};null!==p&&p>=0?l.executeSchedule(n,h,d,p,!0):u=!0,d();var f=s.createOperatorSubscriber(n,(function(e){var t,n,i=o.slice();try{for(var s=r(i),a=s.next();!a.done;a=s.next()){var u=a.value,l=u.buffer;l.push(e),g<=l.length&&c(u)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}),(function(){for(;null==o?void 0:o.length;)n.next(o.shift().buffer);null==f||f.unsubscribe(),n.complete(),n.unsubscribe()}),void 0,(function(){return o=null}));t.subscribe(f)}))}},4943:function(e,t,n){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferToggle=void 0;var i=n(3865),o=n(4935),s=n(7103),a=n(4990),u=n(2576),c=n(6967);t.bufferToggle=function(e,t){return o.operate((function(n,o){var l=[];s.innerFrom(e).subscribe(a.createOperatorSubscriber(o,(function(e){var n=[];l.push(n);var r=new i.Subscription;r.add(s.innerFrom(t(e)).subscribe(a.createOperatorSubscriber(o,(function(){c.arrRemove(l,n),o.next(n),r.unsubscribe()}),u.noop)))}),u.noop)),n.subscribe(a.createOperatorSubscriber(o,(function(e){var t,n;try{for(var i=r(l),o=i.next();!o.done;o=i.next())o.value.push(e)}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}}),(function(){for(;l.length>0;)o.next(l.shift());o.complete()})))}))}},1240:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bufferWhen=void 0;var r=n(4935),i=n(2576),o=n(4990),s=n(7103);t.bufferWhen=function(e){return r.operate((function(t,n){var r=null,a=null,u=function(){null==a||a.unsubscribe();var t=r;r=[],t&&n.next(t),s.innerFrom(e()).subscribe(a=o.createOperatorSubscriber(n,u,i.noop))};u(),t.subscribe(o.createOperatorSubscriber(n,(function(e){return null==r?void 0:r.push(e)}),(function(){r&&n.next(r),n.complete()}),void 0,(function(){return r=a=null})))}))}},9548:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catchError=void 0;var r=n(7103),i=n(4990),o=n(4935);t.catchError=function e(t){return o.operate((function(n,o){var s,a=null,u=!1;a=n.subscribe(i.createOperatorSubscriber(o,void 0,void 0,(function(i){s=r.innerFrom(t(i,e(t)(n))),a?(a.unsubscribe(),a=null,s.subscribe(o)):u=!0}))),u&&(a.unsubscribe(),a=null,s.subscribe(o))}))}},2128:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineAll=void 0;var r=n(3240);t.combineAll=r.combineLatestAll},6318:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatest=void 0;var o=n(9258),s=n(4935),a=n(5498),u=n(1914),c=n(9985),l=n(2433);t.combineLatest=function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var d=l.popResultSelector(t);return d?c.pipe(e.apply(void 0,i([],r(t))),u.mapOneOrManyArgs(d)):s.operate((function(e,n){o.combineLatestInit(i([e],r(a.argsOrArgArray(t))))(n)}))}},3240:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestAll=void 0;var r=n(9258),i=n(2069);t.combineLatestAll=function(e){return i.joinAllInternals(r.combineLatest,e)}},5024:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestWith=void 0;var o=n(6318);t.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.combineLatest.apply(void 0,i([],r(e)))}},4919:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var o=n(4935),s=n(4413),a=n(2433),u=n(5432);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.popScheduler(e);return o.operate((function(t,o){s.concatAll()(u.from(i([t],r(e)),n)).subscribe(o)}))}},4413:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatAll=void 0;var r=n(3783);t.concatAll=function(){return r.mergeAll(1)}},7498:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMap=void 0;var r=n(9475),i=n(3005);t.concatMap=function(e,t){return i.isFunction(t)?r.mergeMap(e,t,1):r.mergeMap(e,1)}},6109:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMapTo=void 0;var r=n(7498),i=n(3005);t.concatMapTo=function(e,t){return i.isFunction(t)?r.concatMap((function(){return e}),t):r.concatMap((function(){return e}))}},9664:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concatWith=void 0;var o=n(4919);t.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.concat.apply(void 0,i([],r(e)))}},1995:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;var r=n(3032),i=n(7103),o=n(4935),s=n(851),a={connector:function(){return new r.Subject}};t.connect=function(e,t){void 0===t&&(t=a);var n=t.connector;return o.operate((function(t,r){var o=n();i.innerFrom(e(s.fromSubscribable(o))).subscribe(r),r.add(t.subscribe(o))}))}},993:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.count=void 0;var r=n(122);t.count=function(e){return r.reduce((function(t,n,r){return!e||e(n,r)?t+1:t}),0)}},496:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0;var r=n(4935),i=n(2576),o=n(4990),s=n(7103);t.debounce=function(e){return r.operate((function(t,n){var r=!1,a=null,u=null,c=function(){if(null==u||u.unsubscribe(),u=null,r){r=!1;var e=a;a=null,n.next(e)}};t.subscribe(o.createOperatorSubscriber(n,(function(t){null==u||u.unsubscribe(),r=!0,a=t,u=o.createOperatorSubscriber(n,c,i.noop),s.innerFrom(e(t)).subscribe(u)}),(function(){c(),n.complete()}),void 0,(function(){a=u=null})))}))}},1385:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounceTime=void 0;var r=n(2445),i=n(4935),o=n(4990);t.debounceTime=function(e,t){return void 0===t&&(t=r.asyncScheduler),i.operate((function(n,r){var i=null,s=null,a=null,u=function(){if(i){i.unsubscribe(),i=null;var e=s;s=null,r.next(e)}};function c(){var n=a+e,o=t.now();if(o<n)return i=this.schedule(void 0,n-o),void r.add(i);u()}n.subscribe(o.createOperatorSubscriber(r,(function(n){s=n,a=t.now(),i||(i=t.schedule(c,e),r.add(i))}),(function(){u(),r.complete()}),void 0,(function(){s=i=null})))}))}},1658:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultIfEmpty=void 0;var r=n(4935),i=n(4990);t.defaultIfEmpty=function(e){return r.operate((function(t,n){var r=!1;t.subscribe(i.createOperatorSubscriber(n,(function(e){r=!0,n.next(e)}),(function(){r||n.next(e),n.complete()})))}))}},5841:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0;var r=n(2445),i=n(8798),o=n(7513);t.delay=function(e,t){void 0===t&&(t=r.asyncScheduler);var n=o.timer(e,t);return i.delayWhen((function(){return n}))}},8798:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delayWhen=void 0;var r=n(2239),i=n(4783),o=n(9438),s=n(8313),a=n(9475),u=n(7103);t.delayWhen=function e(t,n){return n?function(s){return r.concat(n.pipe(i.take(1),o.ignoreElements()),s.pipe(e(t)))}:a.mergeMap((function(e,n){return u.innerFrom(t(e,n)).pipe(i.take(1),s.mapTo(e))}))}},1080:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dematerialize=void 0;var r=n(3104),i=n(4935),o=n(4990);t.dematerialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){return r.observeNotification(e,t)})))}))}},3054:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinct=void 0;var r=n(4935),i=n(4990),o=n(2576),s=n(7103);t.distinct=function(e,t){return r.operate((function(n,r){var a=new Set;n.subscribe(i.createOperatorSubscriber(r,(function(t){var n=e?e(t):t;a.has(n)||(a.add(n),r.next(t))}))),t&&s.innerFrom(t).subscribe(i.createOperatorSubscriber(r,(function(){return a.clear()}),o.noop))}))}},8737:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilChanged=void 0;var r=n(4781),i=n(4935),o=n(4990);function s(e,t){return e===t}t.distinctUntilChanged=function(e,t){return void 0===t&&(t=r.identity),e=null!=e?e:s,i.operate((function(n,r){var i,s=!0;n.subscribe(o.createOperatorSubscriber(r,(function(n){var o=t(n);!s&&e(i,o)||(s=!1,i=o,r.next(n))})))}))}},7957:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilKeyChanged=void 0;var r=n(8737);t.distinctUntilKeyChanged=function(e,t){return r.distinctUntilChanged((function(n,r){return t?t(n[e],r[e]):n[e]===r[e]}))}},8633:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementAt=void 0;var r=n(2351),i=n(9154),o=n(1779),s=n(1658),a=n(4783);t.elementAt=function(e,t){if(e<0)throw new r.ArgumentOutOfRangeError;var n=arguments.length>=2;return function(u){return u.pipe(i.filter((function(t,n){return n===e})),a.take(1),n?s.defaultIfEmpty(t):o.throwIfEmpty((function(){return new r.ArgumentOutOfRangeError})))}}},911:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.endWith=void 0;var o=n(2239),s=n(5726);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return o.concat(t,s.of.apply(void 0,i([],r(e))))}}},2096:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.every=void 0;var r=n(4935),i=n(4990);t.every=function(e,t){return r.operate((function(n,r){var o=0;n.subscribe(i.createOperatorSubscriber(r,(function(i){e.call(t,i,o++,n)||(r.next(!1),r.complete())}),(function(){r.next(!0),r.complete()})))}))}},67:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaust=void 0;var r=n(5337);t.exhaust=r.exhaustAll},5337:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustAll=void 0;var r=n(5635),i=n(4781);t.exhaustAll=function(){return r.exhaustMap(i.identity)}},5635:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustMap=void 0;var r=n(7291),i=n(7103),o=n(4935),s=n(4990);t.exhaustMap=function e(t,n){return n?function(o){return o.pipe(e((function(e,o){return i.innerFrom(t(e,o)).pipe(r.map((function(t,r){return n(e,t,o,r)})))})))}:o.operate((function(e,n){var r=0,o=null,a=!1;e.subscribe(s.createOperatorSubscriber(n,(function(e){o||(o=s.createOperatorSubscriber(n,void 0,(function(){o=null,a&&n.complete()})),i.innerFrom(t(e,r++)).subscribe(o))}),(function(){a=!0,!o&&n.complete()})))}))}},9745:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expand=void 0;var r=n(4935),i=n(7788);t.expand=function(e,t,n){return void 0===t&&(t=1/0),t=(t||0)<1?1/0:t,r.operate((function(r,o){return i.mergeInternals(r,o,e,t,void 0,!0,n)}))}},9154:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filter=void 0;var r=n(4935),i=n(4990);t.filter=function(e,t){return r.operate((function(n,r){var o=0;n.subscribe(i.createOperatorSubscriber(r,(function(n){return e.call(t,n,o++)&&r.next(n)})))}))}},9283:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.finalize=void 0;var r=n(4935);t.finalize=function(e){return r.operate((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}},7119:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFind=t.find=void 0;var r=n(4935),i=n(4990);function o(e,t,n){var r="index"===n;return function(n,o){var s=0;n.subscribe(i.createOperatorSubscriber(o,(function(i){var a=s++;e.call(t,i,a,n)&&(o.next(r?a:i),o.complete())}),(function(){o.next(r?-1:void 0),o.complete()})))}}t.find=function(e,t){return r.operate(o(e,t,"value"))},t.createFind=o},4706:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findIndex=void 0;var r=n(4935),i=n(7119);t.findIndex=function(e,t){return r.operate(i.createFind(e,t,"index"))}},9219:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.first=void 0;var r=n(9474),i=n(9154),o=n(4783),s=n(1658),a=n(1779),u=n(4781);t.first=function(e,t){var n=arguments.length>=2;return function(c){return c.pipe(e?i.filter((function(t,n){return e(t,n,c)})):u.identity,o.take(1),n?s.defaultIfEmpty(t):a.throwIfEmpty((function(){return new r.EmptyError})))}}},1788:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flatMap=void 0;var r=n(9475);t.flatMap=r.mergeMap},9749:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupBy=void 0;var r=n(2419),i=n(7103),o=n(3032),s=n(4935),a=n(4990);t.groupBy=function(e,t,n,u){return s.operate((function(s,c){var l;t&&"function"!=typeof t?(n=t.duration,l=t.element,u=t.connector):l=t;var d=new Map,f=function(e){d.forEach(e),e(c)},h=function(e){return f((function(t){return t.error(e)}))},p=0,g=!1,m=new a.OperatorSubscriber(c,(function(t){try{var s=e(t),f=d.get(s);if(!f){d.set(s,f=u?u():new o.Subject);var b=(v=s,_=f,(w=new r.Observable((function(e){p++;var t=_.subscribe(e);return function(){t.unsubscribe(),0==--p&&g&&m.unsubscribe()}}))).key=v,w);if(c.next(b),n){var y=a.createOperatorSubscriber(f,(function(){f.complete(),null==y||y.unsubscribe()}),void 0,void 0,(function(){return d.delete(s)}));m.add(i.innerFrom(n(b)).subscribe(y))}}f.next(l?l(t):t)}catch(e){h(e)}var v,_,w}),(function(){return f((function(e){return e.complete()}))}),h,(function(){return d.clear()}),(function(){return g=!0,0===p}));s.subscribe(m)}))}},9438:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ignoreElements=void 0;var r=n(4935),i=n(4990),o=n(2576);t.ignoreElements=function(){return r.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,o.noop))}))}},8515:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=void 0;var r=n(4935),i=n(4990);t.isEmpty=function(){return r.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,(function(){t.next(!1),t.complete()}),(function(){t.next(!0),t.complete()})))}))}},2069:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.joinAllInternals=void 0;var r=n(4781),i=n(1914),o=n(9985),s=n(9475),a=n(2);t.joinAllInternals=function(e,t){return o.pipe(a.toArray(),s.mergeMap((function(t){return e(t)})),t?i.mapOneOrManyArgs(t):r.identity)}},2435:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.last=void 0;var r=n(9474),i=n(9154),o=n(1980),s=n(1779),a=n(1658),u=n(4781);t.last=function(e,t){var n=arguments.length>=2;return function(c){return c.pipe(e?i.filter((function(t,n){return e(t,n,c)})):u.identity,o.takeLast(1),n?a.defaultIfEmpty(t):s.throwIfEmpty((function(){return new r.EmptyError})))}}},7291:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.map=void 0;var r=n(4935),i=n(4990);t.map=function(e,t){return r.operate((function(n,r){var o=0;n.subscribe(i.createOperatorSubscriber(r,(function(n){r.next(e.call(t,n,o++))})))}))}},8313:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapTo=void 0;var r=n(7291);t.mapTo=function(e){return r.map((function(){return e}))}},3209:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.materialize=void 0;var r=n(3104),i=n(4935),o=n(4990);t.materialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){t.next(r.Notification.createNext(e))}),(function(){t.next(r.Notification.createComplete()),t.complete()}),(function(e){t.next(r.Notification.createError(e)),t.complete()})))}))}},2620:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.max=void 0;var r=n(122),i=n(3005);t.max=function(e){return r.reduce(i.isFunction(e)?function(t,n){return e(t,n)>0?t:n}:function(e,t){return e>t?e:t})}},9821:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var o=n(4935),s=n(5498),a=n(3783),u=n(2433),c=n(5432);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=u.popScheduler(e),l=u.popNumber(e,1/0);return e=s.argsOrArgArray(e),o.operate((function(t,o){a.mergeAll(l)(c.from(i([t],r(e)),n)).subscribe(o)}))}},3783:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=void 0;var r=n(9475),i=n(4781);t.mergeAll=function(e){return void 0===e&&(e=1/0),r.mergeMap(i.identity,e)}},7788:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeInternals=void 0;var r=n(7103),i=n(7738),o=n(4990);t.mergeInternals=function(e,t,n,s,a,u,c,l){var d=[],f=0,h=0,p=!1,g=function(){!p||d.length||f||t.complete()},m=function(e){return f<s?b(e):d.push(e)},b=function(e){u&&t.next(e),f++;var l=!1;r.innerFrom(n(e,h++)).subscribe(o.createOperatorSubscriber(t,(function(e){null==a||a(e),u?m(e):t.next(e)}),(function(){l=!0}),void 0,(function(){if(l)try{f--;for(var e=function(){var e=d.shift();c?i.executeSchedule(t,c,(function(){return b(e)})):b(e)};d.length&&f<s;)e();g()}catch(e){t.error(e)}})))};return e.subscribe(o.createOperatorSubscriber(t,m,(function(){p=!0,g()}))),function(){null==l||l()}}},9475:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMap=void 0;var r=n(7291),i=n(7103),o=n(4935),s=n(7788),a=n(3005);t.mergeMap=function e(t,n,u){return void 0===u&&(u=1/0),a.isFunction(n)?e((function(e,o){return r.map((function(t,r){return n(e,t,o,r)}))(i.innerFrom(t(e,o)))}),u):("number"==typeof n&&(u=n),o.operate((function(e,n){return s.mergeInternals(e,n,t,u)})))}},1211:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMapTo=void 0;var r=n(9475),i=n(3005);t.mergeMapTo=function(e,t,n){return void 0===n&&(n=1/0),i.isFunction(t)?r.mergeMap((function(){return e}),t,n):("number"==typeof t&&(n=t),r.mergeMap((function(){return e}),n))}},7267:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeScan=void 0;var r=n(4935),i=n(7788);t.mergeScan=function(e,t,n){return void 0===n&&(n=1/0),r.operate((function(r,o){var s=t;return i.mergeInternals(r,o,(function(t,n){return e(s,t,n)}),n,(function(e){s=e}),!1,void 0,(function(){return s=null}))}))}},9303:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mergeWith=void 0;var o=n(9821);t.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.merge.apply(void 0,i([],r(e)))}},9714:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.min=void 0;var r=n(122),i=n(3005);t.min=function(e){return r.reduce(i.isFunction(e)?function(t,n){return e(t,n)<0?t:n}:function(e,t){return e<t?e:t})}},3848:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multicast=void 0;var r=n(9518),i=n(3005),o=n(1995);t.multicast=function(e,t){var n=i.isFunction(e)?e:function(){return e};return i.isFunction(t)?o.connect(t,{connector:n}):function(e){return new r.ConnectableObservable(e,n)}}},1184:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeOn=void 0;var r=n(7738),i=n(4935),o=n(4990);t.observeOn=function(e,t){return void 0===t&&(t=0),i.operate((function(n,i){n.subscribe(o.createOperatorSubscriber(i,(function(n){return r.executeSchedule(i,e,(function(){return i.next(n)}),t)}),(function(){return r.executeSchedule(i,e,(function(){return i.complete()}),t)}),(function(n){return r.executeSchedule(i,e,(function(){return i.error(n)}),t)})))}))}},7582:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=t.onErrorResumeNextWith=void 0;var o=n(5498),s=n(724);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.argsOrArgArray(e);return function(e){return s.onErrorResumeNext.apply(void 0,i([e],r(n)))}}t.onErrorResumeNextWith=a,t.onErrorResumeNext=a},2731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairwise=void 0;var r=n(4935),i=n(4990);t.pairwise=function(){return r.operate((function(e,t){var n,r=!1;e.subscribe(i.createOperatorSubscriber(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))}))}},5649:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var r=n(8634),i=n(9154);t.partition=function(e,t){return function(n){return[i.filter(e,t)(n),i.filter(r.not(e,t))(n)]}}},4691:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pluck=void 0;var r=n(7291);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.length;if(0===n)throw new Error("list of properties cannot be empty.");return r.map((function(t){for(var r=t,i=0;i<n;i++){var o=null==r?void 0:r[e[i]];if(void 0===o)return;r=o}return r}))}},4474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publish=void 0;var r=n(3032),i=n(3848),o=n(1995);t.publish=function(e){return e?function(t){return o.connect(e)(t)}:function(e){return i.multicast(new r.Subject)(e)}}},52:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishBehavior=void 0;var r=n(5240),i=n(9518);t.publishBehavior=function(e){return function(t){var n=new r.BehaviorSubject(e);return new i.ConnectableObservable(t,(function(){return n}))}}},2110:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishLast=void 0;var r=n(280),i=n(9518);t.publishLast=function(){return function(e){var t=new r.AsyncSubject;return new i.ConnectableObservable(e,(function(){return t}))}}},9864:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishReplay=void 0;var r=n(3274),i=n(3848),o=n(3005);t.publishReplay=function(e,t,n,s){n&&!o.isFunction(n)&&(s=n);var a=o.isFunction(n)?n:void 0;return function(n){return i.multicast(new r.ReplaySubject(e,t,s),a)(n)}}},9764:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.race=void 0;var o=n(5498),s=n(179);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.raceWith.apply(void 0,i([],r(o.argsOrArgArray(e))))}},179:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.raceWith=void 0;var o=n(5182),s=n(4935),a=n(4781);t.raceWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length?s.operate((function(t,n){o.raceInit(i([t],r(e)))(n)})):a.identity}},122:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduce=void 0;var r=n(8345),i=n(4935);t.reduce=function(e,t){return i.operate(r.scanInternals(e,t,arguments.length>=2,!1,!0))}},8739:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refCount=void 0;var r=n(4935),i=n(4990);t.refCount=function(){return r.operate((function(e,t){var n=null;e._refCount++;var r=i.createOperatorSubscriber(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)n=null;else{var r=e._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),t.unsubscribe()}}));e.subscribe(r),r.closed||(n=e.connect())}))}},5313:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeat=void 0;var r=n(6332),i=n(4935),o=n(4990),s=n(7103),a=n(7513);t.repeat=function(e){var t,n,u=1/0;return null!=e&&("object"==typeof e?(t=e.count,u=void 0===t?1/0:t,n=e.delay):u=e),u<=0?function(){return r.EMPTY}:i.operate((function(e,t){var r,i=0,c=function(){if(null==r||r.unsubscribe(),r=null,null!=n){var e="number"==typeof n?a.timer(n):s.innerFrom(n(i)),u=o.createOperatorSubscriber(t,(function(){u.unsubscribe(),l()}));e.subscribe(u)}else l()},l=function(){var n=!1;r=e.subscribe(o.createOperatorSubscriber(t,void 0,(function(){++i<u?r?c():n=!0:t.complete()}))),n&&c()};l()}))}},4068:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeatWhen=void 0;var r=n(7103),i=n(3032),o=n(4935),s=n(4990);t.repeatWhen=function(e){return o.operate((function(t,n){var o,a,u=!1,c=!1,l=!1,d=function(){return l&&c&&(n.complete(),!0)},f=function(){l=!1,o=t.subscribe(s.createOperatorSubscriber(n,void 0,(function(){l=!0,!d()&&(a||(a=new i.Subject,r.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(n,(function(){o?f():u=!0}),(function(){c=!0,d()})))),a).next()}))),u&&(o.unsubscribe(),o=null,u=!1,f())};f()}))}},64:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retry=void 0;var r=n(4935),i=n(4990),o=n(4781),s=n(7513),a=n(7103);t.retry=function(e){var t;void 0===e&&(e=1/0);var n=(t=e&&"object"==typeof e?e:{count:e}).count,u=void 0===n?1/0:n,c=t.delay,l=t.resetOnSuccess,d=void 0!==l&&l;return u<=0?o.identity:r.operate((function(e,t){var n,r=0,o=function(){var l=!1;n=e.subscribe(i.createOperatorSubscriber(t,(function(e){d&&(r=0),t.next(e)}),void 0,(function(e){if(r++<u){var d=function(){n?(n.unsubscribe(),n=null,o()):l=!0};if(null!=c){var f="number"==typeof c?s.timer(c):a.innerFrom(c(e,r)),h=i.createOperatorSubscriber(t,(function(){h.unsubscribe(),d()}),(function(){t.complete()}));f.subscribe(h)}else d()}else t.error(e)}))),l&&(n.unsubscribe(),n=null,o())};o()}))}},1188:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retryWhen=void 0;var r=n(7103),i=n(3032),o=n(4935),s=n(4990);t.retryWhen=function(e){return o.operate((function(t,n){var o,a,u=!1,c=function(){o=t.subscribe(s.createOperatorSubscriber(n,void 0,void 0,(function(t){a||(a=new i.Subject,r.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(n,(function(){return o?c():u=!0})))),a&&a.next(t)}))),u&&(o.unsubscribe(),o=null,u=!1,c())};c()}))}},4193:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sample=void 0;var r=n(7103),i=n(4935),o=n(2576),s=n(4990);t.sample=function(e){return i.operate((function(t,n){var i=!1,a=null;t.subscribe(s.createOperatorSubscriber(n,(function(e){i=!0,a=e}))),r.innerFrom(e).subscribe(s.createOperatorSubscriber(n,(function(){if(i){i=!1;var e=a;a=null,n.next(e)}}),o.noop))}))}},6170:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleTime=void 0;var r=n(2445),i=n(4193),o=n(8990);t.sampleTime=function(e,t){return void 0===t&&(t=r.asyncScheduler),i.sample(o.interval(e,t))}},5876:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scan=void 0;var r=n(4935),i=n(8345);t.scan=function(e,t){return r.operate(i.scanInternals(e,t,arguments.length>=2,!0))}},8345:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scanInternals=void 0;var r=n(4990);t.scanInternals=function(e,t,n,i,o){return function(s,a){var u=n,c=t,l=0;s.subscribe(r.createOperatorSubscriber(a,(function(t){var n=l++;c=u?e(c,t,n):(u=!0,t),i&&a.next(c)}),o&&function(){u&&a.next(c),a.complete()}))}}},1791:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sequenceEqual=void 0;var r=n(4935),i=n(4990),o=n(7103);t.sequenceEqual=function(e,t){return void 0===t&&(t=function(e,t){return e===t}),r.operate((function(n,r){var s={buffer:[],complete:!1},a={buffer:[],complete:!1},u=function(e){r.next(e),r.complete()},c=function(e,n){var o=i.createOperatorSubscriber(r,(function(r){var i=n.buffer,o=n.complete;0===i.length?o?u(!1):e.buffer.push(r):!t(r,i.shift())&&u(!1)}),(function(){e.complete=!0;var t=n.complete,r=n.buffer;t&&u(0===r.length),null==o||o.unsubscribe()}));return o};n.subscribe(c(s,a)),o.innerFrom(e).subscribe(c(a,s))}))}},5137:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.share=void 0;var o=n(7103),s=n(3032),a=n(5125),u=n(4935);function c(e,t){for(var n=[],s=2;s<arguments.length;s++)n[s-2]=arguments[s];if(!0!==t){if(!1!==t){var u=new a.SafeSubscriber({next:function(){u.unsubscribe(),e()}});return o.innerFrom(t.apply(void 0,i([],r(n)))).subscribe(u)}}else e()}t.share=function(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new s.Subject}:t,r=e.resetOnError,i=void 0===r||r,l=e.resetOnComplete,d=void 0===l||l,f=e.resetOnRefCountZero,h=void 0===f||f;return function(e){var t,r,s,l=0,f=!1,p=!1,g=function(){null==r||r.unsubscribe(),r=void 0},m=function(){g(),t=s=void 0,f=p=!1},b=function(){var e=t;m(),null==e||e.unsubscribe()};return u.operate((function(e,u){l++,p||f||g();var y=s=null!=s?s:n();u.add((function(){0!=--l||p||f||(r=c(b,h))})),y.subscribe(u),!t&&l>0&&(t=new a.SafeSubscriber({next:function(e){return y.next(e)},error:function(e){p=!0,g(),r=c(m,i,e),y.error(e)},complete:function(){f=!0,g(),r=c(m,d),y.complete()}}),o.innerFrom(e).subscribe(t))}))(e)}}},1348:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shareReplay=void 0;var r=n(3274),i=n(5137);t.shareReplay=function(e,t,n){var o,s,a,u,c=!1;return e&&"object"==typeof e?(o=e.bufferSize,u=void 0===o?1/0:o,s=e.windowTime,t=void 0===s?1/0:s,c=void 0!==(a=e.refCount)&&a,n=e.scheduler):u=null!=e?e:1/0,i.share({connector:function(){return new r.ReplaySubject(u,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:c})}},8242:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.single=void 0;var r=n(9474),i=n(6156),o=n(8598),s=n(4935),a=n(4990);t.single=function(e){return s.operate((function(t,n){var s,u=!1,c=!1,l=0;t.subscribe(a.createOperatorSubscriber(n,(function(r){c=!0,e&&!e(r,l++,t)||(u&&n.error(new i.SequenceError("Too many matching values")),u=!0,s=r)}),(function(){u?(n.next(s),n.complete()):n.error(c?new o.NotFoundError("No matching values"):new r.EmptyError)})))}))}},3169:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skip=void 0;var r=n(9154);t.skip=function(e){return r.filter((function(t,n){return e<=n}))}},2454:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipLast=void 0;var r=n(4781),i=n(4935),o=n(4990);t.skipLast=function(e){return e<=0?r.identity:i.operate((function(t,n){var r=new Array(e),i=0;return t.subscribe(o.createOperatorSubscriber(n,(function(t){var o=i++;if(o<e)r[o]=t;else{var s=o%e,a=r[s];r[s]=t,n.next(a)}}))),function(){r=null}}))}},6931:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipUntil=void 0;var r=n(4935),i=n(4990),o=n(7103),s=n(2576);t.skipUntil=function(e){return r.operate((function(t,n){var r=!1,a=i.createOperatorSubscriber(n,(function(){null==a||a.unsubscribe(),r=!0}),s.noop);o.innerFrom(e).subscribe(a),t.subscribe(i.createOperatorSubscriber(n,(function(e){return r&&n.next(e)})))}))}},7913:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipWhile=void 0;var r=n(4935),i=n(4990);t.skipWhile=function(e){return r.operate((function(t,n){var r=!1,o=0;t.subscribe(i.createOperatorSubscriber(n,(function(t){return(r||(r=!e(t,o++)))&&n.next(t)})))}))}},9234:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startWith=void 0;var r=n(2239),i=n(2433),o=n(4935);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.popScheduler(e);return o.operate((function(t,i){(n?r.concat(e,t,n):r.concat(e,t)).subscribe(i)}))}},276:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeOn=void 0;var r=n(4935);t.subscribeOn=function(e,t){return void 0===t&&(t=0),r.operate((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}},9253:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchAll=void 0;var r=n(8518),i=n(4781);t.switchAll=function(){return r.switchMap(i.identity)}},8518:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMap=void 0;var r=n(7103),i=n(4935),o=n(4990);t.switchMap=function(e,t){return i.operate((function(n,i){var s=null,a=0,u=!1,c=function(){return u&&!s&&i.complete()};n.subscribe(o.createOperatorSubscriber(i,(function(n){null==s||s.unsubscribe();var u=0,l=a++;r.innerFrom(e(n,l)).subscribe(s=o.createOperatorSubscriber(i,(function(e){return i.next(t?t(n,e,l,u++):e)}),(function(){s=null,c()})))}),(function(){u=!0,c()})))}))}},1173:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMapTo=void 0;var r=n(8518),i=n(3005);t.switchMapTo=function(e,t){return i.isFunction(t)?r.switchMap((function(){return e}),t):r.switchMap((function(){return e}))}},3855:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchScan=void 0;var r=n(8518),i=n(4935);t.switchScan=function(e,t){return i.operate((function(n,i){var o=t;return r.switchMap((function(t,n){return e(o,t,n)}),(function(e,t){return o=t,t}))(n).subscribe(i),function(){o=null}}))}},4783:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.take=void 0;var r=n(6332),i=n(4935),o=n(4990);t.take=function(e){return e<=0?function(){return r.EMPTY}:i.operate((function(t,n){var r=0;t.subscribe(o.createOperatorSubscriber(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}},1980:function(e,t,n){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.takeLast=void 0;var i=n(6332),o=n(4935),s=n(4990);t.takeLast=function(e){return e<=0?function(){return i.EMPTY}:o.operate((function(t,n){var i=[];t.subscribe(s.createOperatorSubscriber(n,(function(t){i.push(t),e<i.length&&i.shift()}),(function(){var e,t;try{for(var o=r(i),s=o.next();!s.done;s=o.next()){var a=s.value;n.next(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}n.complete()}),void 0,(function(){i=null})))}))}},9845:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeUntil=void 0;var r=n(4935),i=n(4990),o=n(7103),s=n(2576);t.takeUntil=function(e){return r.operate((function(t,n){o.innerFrom(e).subscribe(i.createOperatorSubscriber(n,(function(){return n.complete()}),s.noop)),!n.closed&&t.subscribe(n)}))}},6060:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeWhile=void 0;var r=n(4935),i=n(4990);t.takeWhile=function(e,t){return void 0===t&&(t=!1),r.operate((function(n,r){var o=0;n.subscribe(i.createOperatorSubscriber(r,(function(n){var i=e(n,o++);(i||t)&&r.next(n),!i&&r.complete()})))}))}},1138:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tap=void 0;var r=n(3005),i=n(4935),o=n(4990),s=n(4781);t.tap=function(e,t,n){var a=r.isFunction(e)||t||n?{next:e,error:t,complete:n}:e;return a?i.operate((function(e,t){var n;null===(n=a.subscribe)||void 0===n||n.call(a);var r=!0;e.subscribe(o.createOperatorSubscriber(t,(function(e){var n;null===(n=a.next)||void 0===n||n.call(a,e),t.next(e)}),(function(){var e;r=!1,null===(e=a.complete)||void 0===e||e.call(a),t.complete()}),(function(e){var n;r=!1,null===(n=a.error)||void 0===n||n.call(a,e),t.error(e)}),(function(){var e,t;r&&(null===(e=a.unsubscribe)||void 0===e||e.call(a)),null===(t=a.finalize)||void 0===t||t.call(a)})))})):s.identity}},7306:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=void 0;var r=n(4935),i=n(4990),o=n(7103);t.throttle=function(e,t){return r.operate((function(n,r){var s=null!=t?t:{},a=s.leading,u=void 0===a||a,c=s.trailing,l=void 0!==c&&c,d=!1,f=null,h=null,p=!1,g=function(){null==h||h.unsubscribe(),h=null,l&&(y(),p&&r.complete())},m=function(){h=null,p&&r.complete()},b=function(t){return h=o.innerFrom(e(t)).subscribe(i.createOperatorSubscriber(r,g,m))},y=function(){if(d){d=!1;var e=f;f=null,r.next(e),!p&&b(e)}};n.subscribe(i.createOperatorSubscriber(r,(function(e){d=!0,f=e,(!h||h.closed)&&(u?y():b(e))}),(function(){p=!0,(!(l&&d&&h)||h.closed)&&r.complete()})))}))}},8968:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttleTime=void 0;var r=n(2445),i=n(7306),o=n(7513);t.throttleTime=function(e,t,n){void 0===t&&(t=r.asyncScheduler);var s=o.timer(e,t);return i.throttle((function(){return s}),n)}},1779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfEmpty=void 0;var r=n(9474),i=n(4935),o=n(4990);function s(){return new r.EmptyError}t.throwIfEmpty=function(e){return void 0===e&&(e=s),i.operate((function(t,n){var r=!1;t.subscribe(o.createOperatorSubscriber(n,(function(e){r=!0,n.next(e)}),(function(){return r?n.complete():n.error(e())})))}))}},8005:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeInterval=t.timeInterval=void 0;var r=n(2445),i=n(4935),o=n(4990);t.timeInterval=function(e){return void 0===e&&(e=r.asyncScheduler),i.operate((function(t,n){var r=e.now();t.subscribe(o.createOperatorSubscriber(n,(function(t){var i=e.now(),o=i-r;r=i,n.next(new s(t,o))})))}))};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},4173:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeout=t.TimeoutError=void 0;var r=n(2445),i=n(1677),o=n(4935),s=n(7103),a=n(7029),u=n(4990),c=n(7738);function l(e){throw new t.TimeoutError(e)}t.TimeoutError=a.createErrorClass((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}})),t.timeout=function(e,t){var n=i.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e,a=n.first,d=n.each,f=n.with,h=void 0===f?l:f,p=n.scheduler,g=void 0===p?null!=t?t:r.asyncScheduler:p,m=n.meta,b=void 0===m?null:m;if(null==a&&null==d)throw new TypeError("No timeout provided.");return o.operate((function(e,t){var n,r,i=null,o=0,l=function(e){r=c.executeSchedule(t,g,(function(){try{n.unsubscribe(),s.innerFrom(h({meta:b,lastValue:i,seen:o})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe(u.createOperatorSubscriber(t,(function(e){null==r||r.unsubscribe(),o++,t.next(i=e),d>0&&l(d)}),void 0,void 0,(function(){(null==r?void 0:r.closed)||null==r||r.unsubscribe(),i=null}))),!o&&l(null!=a?"number"==typeof a?a:+a-g.now():d)}))}},7223:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutWith=void 0;var r=n(2445),i=n(1677),o=n(4173);t.timeoutWith=function(e,t,n){var s,a,u;if(n=null!=n?n:r.async,i.isValidDate(e)?s=e:"number"==typeof e&&(a=e),!t)throw new TypeError("No observable provided to switch to");if(u=function(){return t},null==s&&null==a)throw new TypeError("No timeout provided.");return o.timeout({first:s,each:a,scheduler:n,with:u})}},8975:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timestamp=void 0;var r=n(7950),i=n(7291);t.timestamp=function(e){return void 0===e&&(e=r.dateTimestampProvider),i.map((function(t){return{value:t,timestamp:e.now()}}))}},2:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=void 0;var r=n(122),i=n(4935),o=function(e,t){return e.push(t),e};t.toArray=function(){return i.operate((function(e,t){r.reduce(o,[])(e).subscribe(t)}))}},2826:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.window=void 0;var r=n(3032),i=n(4935),o=n(4990),s=n(2576),a=n(7103);t.window=function(e){return i.operate((function(t,n){var i=new r.Subject;n.next(i.asObservable());var u=function(e){i.error(e),n.error(e)};return t.subscribe(o.createOperatorSubscriber(n,(function(e){return null==i?void 0:i.next(e)}),(function(){i.complete(),n.complete()}),u)),a.innerFrom(e).subscribe(o.createOperatorSubscriber(n,(function(){i.complete(),n.next(i=new r.Subject)}),s.noop,u)),function(){null==i||i.unsubscribe(),i=null}}))}},7526:function(e,t,n){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowCount=void 0;var i=n(3032),o=n(4935),s=n(4990);t.windowCount=function(e,t){void 0===t&&(t=0);var n=t>0?t:e;return o.operate((function(t,o){var a=[new i.Subject],u=0;o.next(a[0].asObservable()),t.subscribe(s.createOperatorSubscriber(o,(function(t){var s,c;try{for(var l=r(a),d=l.next();!d.done;d=l.next())d.value.next(t)}catch(e){s={error:e}}finally{try{d&&!d.done&&(c=l.return)&&c.call(l)}finally{if(s)throw s.error}}var f=u-e+1;if(f>=0&&f%n==0&&a.shift().complete(),++u%n==0){var h=new i.Subject;a.push(h),o.next(h.asObservable())}}),(function(){for(;a.length>0;)a.shift().complete();o.complete()}),(function(e){for(;a.length>0;)a.shift().error(e);o.error(e)}),(function(){a=null})))}))}},8294:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowTime=void 0;var r=n(3032),i=n(2445),o=n(3865),s=n(4935),a=n(4990),u=n(6967),c=n(2433),l=n(7738);t.windowTime=function(e){for(var t,n,d=[],f=1;f<arguments.length;f++)d[f-1]=arguments[f];var h=null!==(t=c.popScheduler(d))&&void 0!==t?t:i.asyncScheduler,p=null!==(n=d[0])&&void 0!==n?n:null,g=d[1]||1/0;return s.operate((function(t,n){var i=[],s=!1,c=function(e){var t=e.window,n=e.subs;t.complete(),n.unsubscribe(),u.arrRemove(i,e),s&&d()},d=function(){if(i){var t=new o.Subscription;n.add(t);var s=new r.Subject,a={window:s,subs:t,seen:0};i.push(a),n.next(s.asObservable()),l.executeSchedule(t,h,(function(){return c(a)}),e)}};null!==p&&p>=0?l.executeSchedule(n,h,d,p,!0):s=!0,d();var f=function(e){return i.slice().forEach(e)},m=function(e){f((function(t){var n=t.window;return e(n)})),e(n),n.unsubscribe()};return t.subscribe(a.createOperatorSubscriber(n,(function(e){f((function(t){t.window.next(e),g<=++t.seen&&c(t)}))}),(function(){return m((function(e){return e.complete()}))}),(function(e){return m((function(t){return t.error(e)}))}))),function(){i=null}}))}},1883:function(e,t,n){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowToggle=void 0;var i=n(3032),o=n(3865),s=n(4935),a=n(7103),u=n(4990),c=n(2576),l=n(6967);t.windowToggle=function(e,t){return s.operate((function(n,s){var d=[],f=function(e){for(;0<d.length;)d.shift().error(e);s.error(e)};a.innerFrom(e).subscribe(u.createOperatorSubscriber(s,(function(e){var n=new i.Subject;d.push(n);var r,h=new o.Subscription;try{r=a.innerFrom(t(e))}catch(e){return void f(e)}s.next(n.asObservable()),h.add(r.subscribe(u.createOperatorSubscriber(s,(function(){l.arrRemove(d,n),n.complete(),h.unsubscribe()}),c.noop,f)))}),c.noop)),n.subscribe(u.createOperatorSubscriber(s,(function(e){var t,n,i=d.slice();try{for(var o=r(i),s=o.next();!s.done;s=o.next())s.value.next(e)}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}),(function(){for(;0<d.length;)d.shift().complete();s.complete()}),f,(function(){for(;0<d.length;)d.shift().unsubscribe()})))}))}},4309:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowWhen=void 0;var r=n(3032),i=n(4935),o=n(4990),s=n(7103);t.windowWhen=function(e){return i.operate((function(t,n){var i,a,u=function(e){i.error(e),n.error(e)},c=function(){var t;null==a||a.unsubscribe(),null==i||i.complete(),i=new r.Subject,n.next(i.asObservable());try{t=s.innerFrom(e())}catch(e){return void u(e)}t.subscribe(a=o.createOperatorSubscriber(n,c,c,u))};c(),t.subscribe(o.createOperatorSubscriber(n,(function(e){return i.next(e)}),(function(){i.complete(),n.complete()}),u,(function(){null==a||a.unsubscribe(),i=null})))}))}},3041:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.withLatestFrom=void 0;var o=n(4935),s=n(4990),a=n(7103),u=n(4781),c=n(2576),l=n(2433);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=l.popResultSelector(e);return o.operate((function(t,o){for(var l=e.length,d=new Array(l),f=e.map((function(){return!1})),h=!1,p=function(t){a.innerFrom(e[t]).subscribe(s.createOperatorSubscriber(o,(function(e){d[t]=e,h||f[t]||(f[t]=!0,(h=f.every(u.identity))&&(f=null))}),c.noop))},g=0;g<l;g++)p(g);t.subscribe(s.createOperatorSubscriber(o,(function(e){if(h){var t=i([e],r(d));o.next(n?n.apply(void 0,i([],r(t))):t)}})))}))}},4400:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=n(7654),s=n(4935);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.operate((function(t,n){o.zip.apply(void 0,i([t],r(e))).subscribe(n)}))}},8593:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zipAll=void 0;var r=n(7654),i=n(2069);t.zipAll=function(e){return i.joinAllInternals(r.zip,e)}},8096:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zipWith=void 0;var o=n(4400);t.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.zip.apply(void 0,i([],r(e)))}},7631:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleArray=void 0;var r=n(2419);t.scheduleArray=function(e,t){return new r.Observable((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}},8489:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleAsyncIterable=void 0;var r=n(2419),i=n(7738);t.scheduleAsyncIterable=function(e,t){if(!e)throw new Error("Iterable cannot be null");return new r.Observable((function(n){i.executeSchedule(n,t,(function(){var r=e[Symbol.asyncIterator]();i.executeSchedule(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}},1297:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleIterable=void 0;var r=n(2419),i=n(3725),o=n(3005),s=n(7738);t.scheduleIterable=function(e,t){return new r.Observable((function(n){var r;return s.executeSchedule(n,t,(function(){r=e[i.iterator](),s.executeSchedule(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return o.isFunction(null==r?void 0:r.return)&&r.return()}}))}},4001:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleObservable=void 0;var r=n(7103),i=n(1184),o=n(276);t.scheduleObservable=function(e,t){return r.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},5143:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.schedulePromise=void 0;var r=n(7103),i=n(1184),o=n(276);t.schedulePromise=function(e,t){return r.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},3676:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleReadableStreamLike=void 0;var r=n(8489),i=n(7823);t.scheduleReadableStreamLike=function(e,t){return r.scheduleAsyncIterable(i.readableStreamLikeToAsyncGenerator(e),t)}},5207:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduled=void 0;var r=n(4001),i=n(5143),o=n(7631),s=n(1297),a=n(8489),u=n(9500),c=n(6018),l=n(3909),d=n(2743),f=n(9595),h=n(9906),p=n(7823),g=n(3676);t.scheduled=function(e,t){if(null!=e){if(u.isInteropObservable(e))return r.scheduleObservable(e,t);if(l.isArrayLike(e))return o.scheduleArray(e,t);if(c.isPromise(e))return i.schedulePromise(e,t);if(f.isAsyncIterable(e))return a.scheduleAsyncIterable(e,t);if(d.isIterable(e))return s.scheduleIterable(e,t);if(p.isReadableStreamLike(e))return g.scheduleReadableStreamLike(e,t)}throw h.createInvalidObservableTypeError(e)}},1986:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=void 0;var o=function(e){function t(t,n){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(3865).Subscription);t.Action=o},7574:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameAction=void 0;var o=n(9702),s=n(505),a=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return i(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=s.animationFrameProvider.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var o=t.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(s.animationFrameProvider.cancelAnimationFrame(n),t._scheduled=void 0)},t}(o.AsyncAction);t.AnimationFrameAction=a},2934:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var n,r=this.actions;e=e||r.shift();do{if(n=e.execute(e.state,e.delay))break}while((e=r[0])&&e.id===t&&r.shift());if(this._active=!1,n){for(;(e=r[0])&&e.id===t&&r.shift();)e.unsubscribe();throw n}},t}(n(3643).AsyncScheduler);t.AnimationFrameScheduler=o},2189:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapAction=void 0;var o=n(9702),s=n(8908),a=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return i(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=s.immediateProvider.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var o=t.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(s.immediateProvider.clearImmediate(n),t._scheduled===n&&(t._scheduled=void 0))},t}(o.AsyncAction);t.AsapAction=a},5523:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var n,r=this.actions;e=e||r.shift();do{if(n=e.execute(e.state,e.delay))break}while((e=r[0])&&e.id===t&&r.shift());if(this._active=!1,n){for(;(e=r[0])&&e.id===t&&r.shift();)e.unsubscribe();throw n}},t}(n(3643).AsyncScheduler);t.AsapScheduler=o},9702:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=void 0;var o=n(1986),s=n(8203),a=n(6967),u=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return i(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),s.intervalProvider.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&s.intervalProvider.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,a.arrRemove(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(o.Action);t.AsyncAction=u},3643:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncScheduler=void 0;var o=n(218),s=function(e){function t(t,n){void 0===n&&(n=o.Scheduler.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return i(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(o.Scheduler);t.AsyncScheduler=s},6201:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=void 0;var o=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return i(t,e),t.prototype.schedule=function(t,n){return void 0===n&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.flush(this),0)},t}(n(9702).AsyncAction);t.QueueAction=o},5860:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(n(3643).AsyncScheduler);t.QueueScheduler=o},4123:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualAction=t.VirtualTimeScheduler=void 0;var o=n(9702),s=n(3865),a=function(e){function t(t,n){void 0===t&&(t=u),void 0===n&&(n=1/0);var r=e.call(this,t,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return i(t,e),t.prototype.flush=function(){for(var e,t,n=this.actions,r=this.maxFrames;(t=n[0])&&t.delay<=r&&(n.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=n.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(n(3643).AsyncScheduler);t.VirtualTimeScheduler=a;var u=function(e){function t(t,n,r){void 0===r&&(r=t.index+=1);var i=e.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.index=r,i.active=!0,i.index=t.index=r,i}return i(t,e),t.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return e.prototype.schedule.call(this,n,r);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return s.Subscription.EMPTY},t.prototype.requestAsyncId=function(e,n,r){void 0===r&&(r=0),this.delay=e.frame+r;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,n){void 0===n&&(n=0)},t.prototype._execute=function(t,n){if(!0===this.active)return e.prototype._execute.call(this,t,n)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(o.AsyncAction);t.VirtualAction=u},3660:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrame=t.animationFrameScheduler=void 0;var r=n(7574),i=n(2934);t.animationFrameScheduler=new i.AnimationFrameScheduler(r.AnimationFrameAction),t.animationFrame=t.animationFrameScheduler},505:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrameProvider=void 0;var o=n(3865);t.animationFrameProvider={schedule:function(e){var n=requestAnimationFrame,r=cancelAnimationFrame,i=t.animationFrameProvider.delegate;i&&(n=i.requestAnimationFrame,r=i.cancelAnimationFrame);var s=n((function(t){r=void 0,e(t)}));return new o.Subscription((function(){return null==r?void 0:r(s)}))},requestAnimationFrame:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.requestAnimationFrame)||requestAnimationFrame).apply(void 0,i([],r(e)))},cancelAnimationFrame:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,i([],r(e)))},delegate:void 0}},580:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asap=t.asapScheduler=void 0;var r=n(2189),i=n(5523);t.asapScheduler=new i.AsapScheduler(r.AsapAction),t.asap=t.asapScheduler},2445:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.async=t.asyncScheduler=void 0;var r=n(9702),i=n(3643);t.asyncScheduler=new i.AsyncScheduler(r.AsyncAction),t.async=t.asyncScheduler},7950:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateTimestampProvider=void 0,t.dateTimestampProvider={now:function(){return(t.dateTimestampProvider.delegate||Date).now()},delegate:void 0}},8908:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.immediateProvider=void 0;var o=n(7629),s=o.Immediate.setImmediate,a=o.Immediate.clearImmediate;t.immediateProvider={setImmediate:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=t.immediateProvider.delegate;return((null==o?void 0:o.setImmediate)||s).apply(void 0,i([],r(e)))},clearImmediate:function(e){var n=t.immediateProvider.delegate;return((null==n?void 0:n.clearImmediate)||a)(e)},delegate:void 0}},8203:function(e,t){"use strict";var n=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},r=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.intervalProvider=void 0,t.intervalProvider={setInterval:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.intervalProvider.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,r([e,i],n(o))):setInterval.apply(void 0,r([e,i],n(o)))},clearInterval:function(e){var n=t.intervalProvider.delegate;return((null==n?void 0:n.clearInterval)||clearInterval)(e)},delegate:void 0}},6813:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.performanceTimestampProvider=void 0,t.performanceTimestampProvider={now:function(){return(t.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}},8615:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queue=t.queueScheduler=void 0;var r=n(6201),i=n(5860);t.queueScheduler=new i.QueueScheduler(r.QueueAction),t.queue=t.queueScheduler},4590:function(e,t){"use strict";var n=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},r=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutProvider=void 0,t.timeoutProvider={setTimeout:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.timeoutProvider.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,r([e,i],n(o))):setTimeout.apply(void 0,r([e,i],n(o)))},clearTimeout:function(e){var n=t.timeoutProvider.delegate;return((null==n?void 0:n.clearTimeout)||clearTimeout)(e)},delegate:void 0}},3725:(e,t)=>{"use strict";function n(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.iterator=t.getSymbolIterator=void 0,t.getSymbolIterator=n,t.iterator=n()},2801:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable=void 0,t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},8433:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2351:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=void 0;var r=n(7029);t.ArgumentOutOfRangeError=r.createErrorClass((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}))},9474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=void 0;var r=n(7029);t.EmptyError=r.createErrorClass((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}))},7629:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTools=t.Immediate=void 0;var n,r=1,i={};function o(e){return e in i&&(delete i[e],!0)}t.Immediate={setImmediate:function(e){var t=r++;return i[t]=!0,n||(n=Promise.resolve()),n.then((function(){return o(t)&&e()})),t},clearImmediate:function(e){o(e)}},t.TestTools={pending:function(){return Object.keys(i).length}}},8598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotFoundError=void 0;var r=n(7029);t.NotFoundError=r.createErrorClass((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}}))},2642:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=void 0;var r=n(7029);t.ObjectUnsubscribedError=r.createErrorClass((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}))},6156:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceError=void 0;var r=n(7029);t.SequenceError=r.createErrorClass((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}))},4805:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=void 0;var r=n(7029);t.UnsubscriptionError=r.createErrorClass((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}))},2433:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.popNumber=t.popScheduler=t.popResultSelector=void 0;var r=n(3005),i=n(9016);function o(e){return e[e.length-1]}t.popResultSelector=function(e){return r.isFunction(o(e))?e.pop():void 0},t.popScheduler=function(e){return i.isScheduler(o(e))?e.pop():void 0},t.popNumber=function(e,t){return"number"==typeof o(e)?e.pop():t}},1203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsArgArrayOrObject=void 0;var n=Array.isArray,r=Object.getPrototypeOf,i=Object.prototype,o=Object.keys;t.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(n(t))return{args:t,keys:null};if((a=t)&&"object"==typeof a&&r(a)===i){var s=o(t);return{args:s.map((function(e){return t[e]})),keys:s}}}var a;return{args:e,keys:null}}},5498:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsOrArgArray=void 0;var n=Array.isArray;t.argsOrArgArray=function(e){return 1===e.length&&n(e[0])?e[0]:e}},6967:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrRemove=void 0,t.arrRemove=function(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}},7029:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createErrorClass=void 0,t.createErrorClass=function(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}},641:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObject=void 0,t.createObject=function(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}},6110:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.captureError=t.errorContext=void 0;var r=n(3280),i=null;t.errorContext=function(e){if(r.config.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,o=n.errorThrown,s=n.error;if(i=null,o)throw s}}else e()},t.captureError=function(e){r.config.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7738:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.executeSchedule=void 0,t.executeSchedule=function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(o),!i)return o}},4781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=void 0,t.identity=function(e){return e}},3909:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=void 0,t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},9595:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=void 0;var r=n(3005);t.isAsyncIterable=function(e){return Symbol.asyncIterator&&r.isFunction(null==e?void 0:e[Symbol.asyncIterator])}},1677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidDate=void 0,t.isValidDate=function(e){return e instanceof Date&&!isNaN(e)}},3005:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e}},9500:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInteropObservable=void 0;var r=n(2801),i=n(3005);t.isInteropObservable=function(e){return i.isFunction(e[r.observable])}},2743:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIterable=void 0;var r=n(3725),i=n(3005);t.isIterable=function(e){return i.isFunction(null==e?void 0:e[r.iterator])}},8386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObservable=void 0;var r=n(2419),i=n(3005);t.isObservable=function(e){return!!e&&(e instanceof r.Observable||i.isFunction(e.lift)&&i.isFunction(e.subscribe))}},6018:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=void 0;var r=n(3005);t.isPromise=function(e){return r.isFunction(null==e?void 0:e.then)}},7823:function(e,t,n){"use strict";var r=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},i=this&&this.__await||function(e){return this instanceof i?(this.v=e,this):new i(e)},o=this&&this.__asyncGenerator||function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),s=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){s.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof i?Promise.resolve(n.value.v).then(c,l):d(s[0][2],n)}catch(e){d(s[0][3],e)}var n}function c(e){u("next",e)}function l(e){u("throw",e)}function d(e,t){e(t),s.shift(),s.length&&u(s[0][0],s[0][1])}};Object.defineProperty(t,"__esModule",{value:!0}),t.isReadableStreamLike=t.readableStreamLikeToAsyncGenerator=void 0;var s=n(3005);t.readableStreamLikeToAsyncGenerator=function(e){return o(this,arguments,(function(){var t,n,o;return r(this,(function(r){switch(r.label){case 0:t=e.getReader(),r.label=1;case 1:r.trys.push([1,,9,10]),r.label=2;case 2:return[4,i(t.read())];case 3:return n=r.sent(),o=n.value,n.done?[4,i(void 0)]:[3,5];case 4:return[2,r.sent()];case 5:return[4,i(o)];case 6:return[4,r.sent()];case 7:return r.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))},t.isReadableStreamLike=function(e){return s.isFunction(null==e?void 0:e.getReader)}},9016:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=void 0;var r=n(3005);t.isScheduler=function(e){return e&&r.isFunction(e.schedule)}},4935:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.operate=t.hasLift=void 0;var r=n(3005);function i(e){return r.isFunction(null==e?void 0:e.lift)}t.hasLift=i,t.operate=function(e){return function(t){if(i(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},1914:function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mapOneOrManyArgs=void 0;var o=n(7291),s=Array.isArray;t.mapOneOrManyArgs=function(e){return o.map((function(t){return function(e,t){return s(t)?e.apply(void 0,i([],r(t))):e(t)}(e,t)}))}},2576:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=void 0,t.noop=function(){}},8634:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=void 0,t.not=function(e,t){return function(n,r){return!e.call(t,n,r)}}},9985:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pipeFromArray=t.pipe=void 0;var r=n(4781);function i(e){return 0===e.length?r.identity:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)},t.pipeFromArray=i},7968:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportUnhandledError=void 0;var r=n(3280),i=n(4590);t.reportUnhandledError=function(e){i.timeoutProvider.setTimeout((function(){var t=r.config.onUnhandledError;if(!t)throw e;t(e)}))}},9906:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInvalidObservableTypeError=void 0,t.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},4857:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=t.merge=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.concat=t.combineLatestWith=t.combineLatest=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=void 0,t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.race=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.partition=t.pairwise=t.onErrorResumeNext=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=void 0,t.zipWith=t.zipAll=t.zip=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=void 0;var r=n(6474);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return r.audit}});var i=n(5382);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return i.auditTime}});var o=n(9715);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return o.buffer}});var s=n(3814);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return s.bufferCount}});var a=n(7211);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return a.bufferTime}});var u=n(4943);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return u.bufferToggle}});var c=n(1240);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return c.bufferWhen}});var l=n(9548);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return l.catchError}});var d=n(2128);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return d.combineAll}});var f=n(3240);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return f.combineLatestAll}});var h=n(6318);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return h.combineLatest}});var p=n(5024);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return p.combineLatestWith}});var g=n(4919);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return g.concat}});var m=n(4413);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return m.concatAll}});var b=n(7498);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return b.concatMap}});var y=n(6109);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return y.concatMapTo}});var v=n(9664);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return v.concatWith}});var _=n(1995);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return _.connect}});var w=n(993);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return w.count}});var x=n(496);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return x.debounce}});var T=n(1385);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return T.debounceTime}});var S=n(1658);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return S.defaultIfEmpty}});var O=n(5841);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return O.delay}});var E=n(8798);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return E.delayWhen}});var P=n(1080);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return P.dematerialize}});var A=n(3054);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return A.distinct}});var C=n(8737);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return C.distinctUntilChanged}});var I=n(7957);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return I.distinctUntilKeyChanged}});var R=n(8633);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return R.elementAt}});var M=n(911);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return M.endWith}});var k=n(2096);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return k.every}});var D=n(67);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return D.exhaust}});var j=n(5337);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return j.exhaustAll}});var $=n(5635);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return $.exhaustMap}});var N=n(9745);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return N.expand}});var L=n(9154);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return L.filter}});var F=n(9283);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return F.finalize}});var U=n(7119);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return U.find}});var B=n(4706);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return B.findIndex}});var V=n(9219);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return V.first}});var z=n(9749);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return z.groupBy}});var W=n(9438);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return W.ignoreElements}});var G=n(8515);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return G.isEmpty}});var H=n(2435);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return H.last}});var q=n(7291);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return q.map}});var K=n(8313);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return K.mapTo}});var Y=n(3209);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return Y.materialize}});var X=n(2620);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return X.max}});var J=n(9821);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return J.merge}});var Z=n(3783);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return Z.mergeAll}});var Q=n(1788);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return Q.flatMap}});var ee=n(9475);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ee.mergeMap}});var te=n(1211);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return te.mergeMapTo}});var ne=n(7267);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return ne.mergeScan}});var re=n(9303);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return re.mergeWith}});var ie=n(9714);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ie.min}});var oe=n(3848);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return oe.multicast}});var se=n(1184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return se.observeOn}});var ae=n(7582);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return ae.onErrorResumeNext}});var ue=n(2731);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ue.pairwise}});var ce=n(5649);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ce.partition}});var le=n(4691);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return le.pluck}});var de=n(4474);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return de.publish}});var fe=n(52);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return fe.publishBehavior}});var he=n(2110);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return he.publishLast}});var pe=n(9864);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return pe.publishReplay}});var ge=n(9764);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return ge.race}});var me=n(179);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return me.raceWith}});var be=n(122);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return be.reduce}});var ye=n(5313);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return ye.repeat}});var ve=n(4068);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return ve.repeatWhen}});var _e=n(64);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return _e.retry}});var we=n(1188);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return we.retryWhen}});var xe=n(8739);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return xe.refCount}});var Te=n(4193);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Te.sample}});var Se=n(6170);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Se.sampleTime}});var Oe=n(5876);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Oe.scan}});var Ee=n(1791);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Ee.sequenceEqual}});var Pe=n(5137);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return Pe.share}});var Ae=n(1348);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Ae.shareReplay}});var Ce=n(8242);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return Ce.single}});var Ie=n(3169);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return Ie.skip}});var Re=n(2454);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Re.skipLast}});var Me=n(6931);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return Me.skipUntil}});var ke=n(7913);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return ke.skipWhile}});var De=n(9234);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return De.startWith}});var je=n(276);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return je.subscribeOn}});var $e=n(9253);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return $e.switchAll}});var Ne=n(8518);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Ne.switchMap}});var Le=n(1173);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Le.switchMapTo}});var Fe=n(3855);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Fe.switchScan}});var Ue=n(4783);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return Ue.take}});var Be=n(1980);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return Be.takeLast}});var Ve=n(9845);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Ve.takeUntil}});var ze=n(6060);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return ze.takeWhile}});var We=n(1138);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return We.tap}});var Ge=n(7306);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return Ge.throttle}});var He=n(8968);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return He.throttleTime}});var qe=n(1779);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return qe.throwIfEmpty}});var Ke=n(8005);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Ke.timeInterval}});var Ye=n(4173);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Ye.timeout}});var Xe=n(7223);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Xe.timeoutWith}});var Je=n(8975);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return Je.timestamp}});var Ze=n(2);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return Ze.toArray}});var Qe=n(2826);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return Qe.window}});var et=n(7526);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return et.windowCount}});var tt=n(8294);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return tt.windowTime}});var nt=n(1883);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return nt.windowToggle}});var rt=n(4309);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return rt.windowWhen}});var it=n(3041);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return it.withLatestFrom}});var ot=n(4400);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return ot.zip}});var st=n(8593);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return st.zipAll}});var at=n(8096);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return at.zipWith}})},9509:(e,t,n)=>{var r=n(8764),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function s(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},7539:e=>{"use strict";const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const n=t.splitSections(e);return n&&n[0]},t.getMediaSections=function(e){const n=t.splitSections(e);return n.shift(),n},t.matchPrefix=function(e,n){return t.splitLines(e).filter((e=>0===e.indexOf(n)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const n={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":n.relatedAddress=t[e+1];break;case"rport":n.relatedPort=parseInt(t[e+1],10);break;case"tcptype":n.tcpType=t[e+1];break;case"ufrag":n.ufrag=t[e+1],n.usernameFragment=t[e+1];break;default:void 0===n[t[e]]&&(n[t[e]]=t[e+1])}return n},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const r=e.type;return t.push("typ"),t.push(r),"host"!==r&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let n;const r=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e<r.length;e++)n=r[e].trim().split("="),t[n[0].trim()]=n[1];return t},t.writeFmtp=function(e){let t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const r=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),n={ssrc:parseInt(e.substring(7,t),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substring(t+1,r),n.value=e.substring(r+1)):n.attribute=e.substring(t+1),n},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const n=t.matchPrefix(e,"a=mid:")[0];if(n)return n.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,n){return{role:"auto",fingerprints:t.matchPrefix(e+n,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,n){return t.matchPrefix(e+n,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,n){const r=t.matchPrefix(e+n,"a=ice-ufrag:")[0],i=t.matchPrefix(e+n,"a=ice-pwd:")[0];return r&&i?{usernameFragment:r.substring(12),password:i.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=t.splitLines(e)[0].split(" ");n.profile=r[2];for(let i=3;i<r.length;i++){const o=r[i],s=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){const r=t.parseRtpMap(s),i=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(r.parameters=i.length?t.parseFmtp(i[0]):{},r.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),n.codecs.push(r),r.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(r.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach((e=>{n.headerExtensions.push(t.parseExtmap(e))}));const i=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return n.codecs.forEach((e=>{i.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),n},t.writeRtpDescription=function(e,n){let r="";r+="m="+e+" ",r+=n.codecs.length>0?"9":"0",r+=" "+(n.profile||"UDP/TLS/RTP/SAVPF")+" ",r+=n.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",r+="c=IN IP4 0.0.0.0\r\n",r+="a=rtcp:9 IN IP4 0.0.0.0\r\n",n.codecs.forEach((e=>{r+=t.writeRtpMap(e),r+=t.writeFmtp(e),r+=t.writeRtcpFb(e)}));let i=0;return n.codecs.forEach((e=>{e.maxptime>i&&(i=e.maxptime)})),i>0&&(r+="a=maxptime:"+i+"\r\n"),n.headerExtensions&&n.headerExtensions.forEach((e=>{r+=t.writeExtmap(e)})),r},t.parseRtpEncodingParameters=function(e){const n=[],r=t.parseRtpParameters(e),i=-1!==r.fecMechanisms.indexOf("RED"),o=-1!==r.fecMechanisms.indexOf("ULPFEC"),s=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),a=s.length>0&&s[0].ssrc;let u;const c=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));c.length>0&&c[0].length>1&&c[0][0]===a&&(u=c[0][1]),r.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:a,codecPayloadType:parseInt(e.parameters.apt,10)};a&&u&&(t.rtx={ssrc:u}),n.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:a,mechanism:o?"red+ulpfec":"red"},n.push(t))}})),0===n.length&&a&&n.push({ssrc:a});let l=t.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substring(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substring(5),10)*.95-16e3:void 0,n.forEach((e=>{e.maxBitrate=l}))),n},t.parseRtcpParameters=function(e){const n={},r=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];r&&(n.cname=r.value,n.ssrc=r.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=i.length>0,n.compound=0===i.length;const o=t.matchPrefix(e,"a=rtcp-mux");return n.mux=o.length>0,n},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let n;const r=t.matchPrefix(e,"a=msid:");if(1===r.length)return n=r[0].substring(7).split(" "),{stream:n[0],track:n[1]};const i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return i.length>0?(n=i[0].value.split(" "),{stream:n[0],track:n[1]}):void 0},t.parseSctpDescription=function(e){const n=t.parseMLine(e),r=t.matchPrefix(e,"a=max-message-size:");let i;r.length>0&&(i=parseInt(r[0].substring(19),10)),isNaN(i)&&(i=65536);const o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substring(12),10),protocol:n.fmt,maxMessageSize:i};const s=t.matchPrefix(e,"a=sctpmap:");if(s.length>0){const e=s[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,n,r){let i;const o=void 0!==n?n:2;return i=e||t.generateSessionId(),"v=0\r\no="+(r||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,n){const r=t.splitLines(e);for(let e=0;e<r.length;e++)switch(r[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return r[e].substring(2)}return n?t.getDirection(n):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const n=t.splitLines(e)[0].substring(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}},t.parseOLine=function(e){const n=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const n=t.splitLines(e);for(let e=0;e<n.length;e++)if(n[e].length<2||"="!==n[e].charAt(1))return!1;return!0},e.exports=t},8853:(e,t,n)=>{const r=n(1227)("simple-peer"),i=n(5177),o=n(1798),s=n(8473),a=n(4375),u=n(2114),{Buffer:c}=n(8764),l=65536;function d(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}class f extends s.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=o(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||o(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||f.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},f.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:i(),!this._wrtc)throw"undefined"==typeof window?u(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):u(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(u(e,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((e=>{this.destroy(u(e,"ERR_PC_PEER_IDENTITY"))})),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach((e=>{this.addStream(e)})),this._pc.ontrack=e=>{this._onTrack(e)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((e=>{this._addIceCandidate(e)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((e=>{this.destroy(u(e,"ERR_SET_REMOTE_DESCRIPTION"))})),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(u(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{!t.address||t.address.endsWith(".local")?("Ignoring unsupported ICE candidate.",console.warn("Ignoring unsupported ICE candidate.")):this.destroy(u(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(u(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),e.getTracks().forEach((t=>{this.addTrack(t,e)}))}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const n=this._senderMap.get(e)||new Map;let r=n.get(t);if(r)throw r.removed?u(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):u(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");r=this._pc.addTrack(e,t),n.set(t,r),this._senderMap.set(e,n),this._needsNegotiation()}replaceTrack(e,t,n){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const r=this._senderMap.get(e),i=r?r.get(n):null;if(!i)throw u(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");t&&this._senderMap.set(t,r),null!=i.replaceTrack?i.replaceTrack(t):this.destroy(u(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw u(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const n=this._senderMap.get(e),r=n?n.get(t):null;if(!r)throw u(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{r.removed=!0,this._pc.removeTrack(r)}catch(e){"NS_ERROR_UNEXPECTED"===e.name?this._sendersAwaitingStable.push(r):this.destroy(u(e,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),e.getTracks().forEach((t=>{this.removeTrack(t,e)}))}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,a((()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1})))}negotiate(){if(!this.destroying){if(this.destroyed)throw u(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout((()=>{this._createOffer()}),0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",e&&(e.message||e)),a((()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit("error",e),this.emit("close"),t()})))}_setupData(e){if(!e.channel)return this.destroy(u(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=l),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(u(t,"ERR_DATA_CHANNEL"))};let t=!1;this._closingInterval=setInterval((()=>{this._channel&&"closing"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1}),5e3)}_read(){}_write(e,t,n){if(this.destroyed)return n(u(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(u(e,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>l?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=n):n(null)}else this._debug("write before connect"),this._chunk=e,this._cb=n}_onFinish(){if(this.destroyed)return;const e=()=>{setTimeout((()=>this.destroy()),1e3)};this._connected?e():this.once("connect",e)}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout((()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))}),this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=d(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp})};this._pc.setLocalDescription(e).then((()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(u(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(u(e,"ERR_CREATE_OFFER"))}))}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach((e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))}))}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=d(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()};this._pc.setLocalDescription(e).then((()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(u(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(u(e,"ERR_CREATE_ANSWER"))}))}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&&this.destroy(u(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e,t),this.emit("iceStateChange",e,t),"connected"!==e&&"completed"!==e||(this._pcReady=!0,this._maybeReady()),"failed"===e&&this.destroy(u(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===e&&this.destroy(u(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(e){const t=e=>("[object Array]"===Object.prototype.toString.call(e.values)&&e.values.forEach((t=>{Object.assign(e,t)})),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then((n=>{const r=[];n.forEach((e=>{r.push(t(e))})),e(null,r)}),(t=>e(t))):this._pc.getStats.length>0?this._pc.getStats((n=>{if(this.destroyed)return;const r=[];n.result().forEach((e=>{const n={};e.names().forEach((t=>{n[t]=e.stat(t)})),n.id=e.id,n.type=e.type,n.timestamp=e.timestamp,r.push(t(n))})),e(null,r)}),(t=>e(t))):e(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const e=()=>{this.destroyed||this.getStats(((t,n)=>{if(this.destroyed)return;t&&(n=[]);const r={},i={},o={};let s=!1;n.forEach((e=>{"remotecandidate"!==e.type&&"remote-candidate"!==e.type||(r[e.id]=e),"localcandidate"!==e.type&&"local-candidate"!==e.type||(i[e.id]=e),"candidatepair"!==e.type&&"candidate-pair"!==e.type||(o[e.id]=e)}));const a=e=>{s=!0;let t=i[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=Number(t.port)):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=Number(t.portNumber)):"string"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(":"),this.localAddress=t[0],this.localPort=Number(t[1])),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let n=r[e.remoteCandidateId];n&&(n.ip||n.address)?(this.remoteAddress=n.ip||n.address,this.remotePort=Number(n.port)):n&&n.ipAddress?(this.remoteAddress=n.ipAddress,this.remotePort=Number(n.portNumber)):"string"==typeof e.googRemoteAddress&&(n=e.googRemoteAddress.split(":"),this.remoteAddress=n[0],this.remotePort=Number(n[1])),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(n.forEach((e=>{"transport"===e.type&&e.selectedCandidatePairId&&a(o[e.selectedCandidatePairId]),("googCandidatePair"===e.type&&"true"===e.googActiveConnection||("candidatepair"===e.type||"candidate-pair"===e.type)&&e.selected)&&a(e)})),s||Object.keys(o).length&&!Object.keys(i).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(t){return this.destroy(u(t,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"number"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}else setTimeout(e,100)}))};e()}_onInterval(){!this._cb||!this._channel||this._channel.bufferedAmount>l||this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach((e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0})),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(e){this.destroyed||(e.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):e.candidate||this._iceComplete||(this._iceComplete=!0,this.emit("_iceComplete")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=c.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(null)}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach((t=>{this._debug("on track"),this.emit("track",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some((e=>e.id===t.id))||(this._remoteStreams.push(t),a((()=>{this._debug("on stream"),this.emit("stream",t)})))}))}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],r.apply(null,e)}}f.WEBRTC_SUPPORT=!!i(),f.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},f.channelConfig={},e.exports=f},2553:(e,t,n)=>{"use strict";var r=n(9509).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.s=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=s(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},3607:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.Uneeq=void 0,n(8806);const a=o(n(835)),u=n(6123);s(n(8512),t);var c=n(6123);Object.defineProperty(t,"Uneeq",{enumerable:!0,get:function(){return c.Uneeq}}),s(n(835),t),window.AdapterJS=a,window.Uneeq=u.Uneeq},881:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SoundMeter=void 0;const r=n(2872),i=n(7501);t.SoundMeter=class{constructor(e){this.instant$=new r.BehaviorSubject(0),this.context=e,this.instant=0,this.slow=0,this.clip=0,this.script=e.createScriptProcessor(2048,1,1);const t=this;this.script.onaudioprocess=e=>{const n=e.inputBuffer.getChannelData(0);let r,i=0,o=0;for(r=0;r<n.length;++r)i+=n[r]*n[r],Math.abs(n[r])>.99&&(o+=1);t.instant=Math.sqrt(i/n.length),t.slow=.95*t.slow+.05*t.instant,t.clip=o/n.length,t.instant$.next(parseFloat(t.instant.toFixed(2)))}}connectToSource(e,t){i.logger.log("SoundMeter connecting");try{this.mic=this.context.createMediaStreamSource(e),this.mic.connect(this.script),this.script.connect(this.context.destination),void 0!==t&&t(null)}catch(e){console.error(e),void 0!==t&&t(e)}}stop(){this.mic.disconnect(),this.script.disconnect()}}},2289:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.FrameProcessor=t.validateOptions=t.defaultFrameProcessorOptions=void 0;const i=n(7501),o=n(6447),s=[512,1024,1536];t.defaultFrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,preSpeechPadFrames:1,redemptionFrames:8,frameSamples:1536,minSpeechFrames:3},t.validateOptions=function(e){s.includes(e.frameSamples)||i.logger.warn("You are using an unusual frame size"),(e.positiveSpeechThreshold<0||e.negativeSpeechThreshold>1)&&i.logger.error("postiveSpeechThreshold should be a number between 0 and 1"),(e.negativeSpeechThreshold<0||e.negativeSpeechThreshold>e.positiveSpeechThreshold)&&i.logger.error("negativeSpeechThreshold should be between 0 and positiveSpeechThreshold"),e.preSpeechPadFrames<0&&i.logger.error("preSpeechPadFrames should be positive"),e.redemptionFrames<0&&i.logger.error("preSpeechPadFrames should be positive")};const a=e=>{const t=e.reduce(((e,t)=>(e.push(e[e.length-1]+t.length),e)),[0]),n=new Float32Array(t[t.length-1]);return e.forEach(((e,r)=>{const i=t[r];n.set(e,i)})),n};t.FrameProcessor=class{constructor(e,t,n){this.modelProcessFunc=e,this.modelResetFunc=t,this.options=n,this.speaking=!1,this.redemptionCounter=0,this.active=!1,this.reset=()=>{this.speaking=!1,this.audioBuffer=[],this.modelResetFunc(),this.redemptionCounter=0},this.pause=()=>{this.active=!1,this.reset()},this.resume=()=>{this.active=!0},this.endSegment=()=>{const e=this.audioBuffer;this.audioBuffer=[];const t=this.speaking;this.reset();const n=e.reduce(((e,t)=>e+ +t.isSpeech),0);if(t){if(n>=this.options.minSpeechFrames){const t=a(e.map((e=>e.frame)));return{msg:o.Message.SpeechEnd,audio:t}}return{msg:o.Message.VADMisfire}}return{}},this.process=e=>r(this,void 0,void 0,(function*(){if(!this.active)return{};const t=yield this.modelProcessFunc(e);if(this.audioBuffer.push({frame:e,isSpeech:t.isSpeech>=this.options.positiveSpeechThreshold}),t.isSpeech>=this.options.positiveSpeechThreshold&&this.redemptionCounter&&(this.redemptionCounter=0),t.isSpeech>=this.options.positiveSpeechThreshold&&!this.speaking)return this.speaking=!0,{probs:t,msg:o.Message.SpeechStart};if(t.isSpeech<this.options.negativeSpeechThreshold&&this.speaking&&++this.redemptionCounter>=this.options.redemptionFrames){this.redemptionCounter=0,this.speaking=!1;const e=this.audioBuffer;if(this.audioBuffer=[],e.reduce(((e,t)=>e+ +t.isSpeech),0)>=this.options.minSpeechFrames){const n=a(e.map((e=>e.frame)));return{probs:t,msg:o.Message.SpeechEnd,audio:n}}return{probs:t,msg:o.Message.VADMisfire}}if(!this.speaking)for(;this.audioBuffer.length>this.options.preSpeechPadFrames;)this.audioBuffer.shift();return{probs:t}})),this.audioBuffer=[],this.reset()}}},6447:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=void 0,function(e){e.AudioFrame="AUDIO_FRAME",e.SpeechStart="SPEECH_START",e.VADMisfire="VAD_MISFIRE",e.SpeechEnd="SPEECH_END"}(n||(t.Message=n={}))},9938:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Silero=void 0;const i=n(7501);class o{constructor(e,t){this.ort=e,this.modelFetcher=t,this.init=()=>r(this,void 0,void 0,(function*(){i.logger.debug("initializing vad");const e=yield this.modelFetcher();this._session=yield this.ort.InferenceSession.create(e),this._sr=new this.ort.Tensor("int64",[BigInt(16e3)]),this.reset_state(),i.logger.debug("vad is initialized")})),this.reset_state=()=>{const e=Array(128).fill(0);this._h=new this.ort.Tensor("float32",e,[2,1,64]),this._c=new this.ort.Tensor("float32",e,[2,1,64])},this.process=e=>r(this,void 0,void 0,(function*(){const t={input:new this.ort.Tensor("float32",e,[1,e.length]),h:this._h,c:this._c,sr:this._sr},n=yield this._session.run(t);this._h=n.hn,this._c=n.cn;const[r]=n.output.data;return{notSpeech:1-r,isSpeech:r}}))}}t.Silero=o,o.new=(e,t)=>r(void 0,void 0,void 0,(function*(){const n=new o(e,t);return yield n.init(),n}))},8938:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AudioNodeVAD=t.MicVAD=t.defaultRealTimeVADOptions=void 0;const a=o(n(9793)),u=n(7501),c=n(2289),l=n(6447),d=n(9938);t.defaultRealTimeVADOptions=Object.assign(Object.assign({},c.defaultFrameProcessorOptions),{onFrameProcessed:e=>{},onVADMisfire:()=>{u.logger.debug("VAD misfire")},onSpeechStart:()=>{u.logger.debug("Detected speech start")},onSpeechEnd:()=>{u.logger.debug("Detected speech end")},stream:new MediaStream,assetBasePath:""});class f{static new(e={}){return s(this,void 0,void 0,(function*(){const n=new f(Object.assign(Object.assign({},t.defaultRealTimeVADOptions),e));return yield n.init(),n}))}constructor(e){this.options=e,this.listening=!1,this.init=()=>s(this,void 0,void 0,(function*(){u.logger.log("Initializing real time vad."),void 0===this.options.stream?this.stream=yield navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0}}):this.stream=this.options.stream,this.audioContext=new AudioContext;const e=new MediaStreamAudioSourceNode(this.audioContext,{mediaStream:this.stream});this.audioNodeVAD=yield h.new(this.audioContext,this.options),this.audioNodeVAD.receive(e)})),this.pause=()=>{this.audioNodeVAD.pause(),this.listening=!1},this.start=()=>{this.audioNodeVAD.start(),this.listening=!0},(0,c.validateOptions)(e)}}t.MicVAD=f;class h{static new(e,n={}){return s(this,void 0,void 0,(function*(){const r=new h(e,Object.assign(Object.assign({},t.defaultRealTimeVADOptions),n));return yield r.init(),r}))}constructor(e,t){this.ctx=e,this.options=t,this.pause=()=>{this.frameProcessor.pause()},this.start=()=>{this.frameProcessor.resume()},this.receive=e=>{e.connect(this.entryNode)},this.processFrame=e=>s(this,void 0,void 0,(function*(){const{probs:t,msg:n,audio:r}=yield this.frameProcessor.process(e);switch(void 0!==t&&this.options.onFrameProcessed(t),n){case l.Message.SpeechStart:this.options.onSpeechStart();break;case l.Message.VADMisfire:this.options.onVADMisfire();break;case l.Message.SpeechEnd:this.options.onSpeechEnd(r)}})),this.init=()=>s(this,void 0,void 0,(function*(){yield this.ctx.audioWorklet.addModule(this.options.assetBasePath+"vad.worklet.bundle.min.js");const e=new AudioWorkletNode(this.ctx,"vad-helper-worklet",{processorOptions:{frameSamples:this.options.frameSamples}});this.entryNode=e,a.env.wasm.wasmPaths=this.options.assetBasePath;const t=yield d.Silero.new(a,this.modelFetcher);this.frameProcessor=new c.FrameProcessor(t.process,t.reset_state,{frameSamples:this.options.frameSamples,positiveSpeechThreshold:this.options.positiveSpeechThreshold,negativeSpeechThreshold:this.options.negativeSpeechThreshold,redemptionFrames:this.options.redemptionFrames,preSpeechPadFrames:this.options.preSpeechPadFrames,minSpeechFrames:this.options.minSpeechFrames}),e.port.onmessage=e=>s(this,void 0,void 0,(function*(){var t;if((null===(t=e.data)||void 0===t?void 0:t.message)===l.Message.AudioFrame){const t=e.data.data,n=new Float32Array(t);yield this.processFrame(n)}}))})),this.modelFetcher=()=>s(this,void 0,void 0,(function*(){const e=this.options.assetBasePath+"silero_vad.onnx";return yield fetch(e).then((e=>e.arrayBuffer()))})),(0,c.validateOptions)(t)}}t.AudioNodeVAD=h},4518:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoEditor=void 0;const s=o(n(6551));t.VideoEditor=class{constructor(){}applyChromaKeyEffect(e,t){try{n(6303);const r=s.default();let i,o,a;i=r.transform("reformat"),i.source=t,i.width=e.width,i.height=e.height,a=r.target(e),o=r.effect("chroma"),o.source=i,a.source=o,r.go()}catch(e){console.error(e)}}}},1181:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.API=void 0,t.API=class{set callId(e){this._callId=e}get authToken(){return this.xAuthToken}constructor(e,t="",n=(()=>{})){this.xAuthToken="",this.apiUrl=e,this.apiKey=t,this.loggedOutHandler=n}startSession(e){return this.postRequest("/api/v1/customers/",e,{},{"faceme-api-key":this.apiKey})}endCall(){return this.postRequest("/api/v1/calls/"+this._callId+"/endCall")}avatarStart(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/start",e)}avatarWelcome(){return this.postRequest("/api/v1/avatar/"+this._callId+"/welcome")}avatarAsk(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/ask",{text:e})}avatarStartRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/start")}avatarStopRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/stop")}avatarStopSpeaking(){return this.postRequest("/api/v1/avatar/"+this._callId+"/stopSpeaking")}getAvailableAvatarCount(){return this.getRequest("/api/v1/avatar/"+this._callId+"/available")}startSessionWithToken(e){return this.postRequest("/api/v2/clients/start-session",e,{},{"x-timezone-name":this.getTimeZone()})}setAvatarDebug(e){return this.putRequest("/api/v1/avatar/"+this._callId+"/debug",{enabled:e})}sendMediaUnavailable(e){return this.postRequest("/api/v1/avatar/"+this._callId+"/media/unavailable-update",e)}getEdgeNodeId(e){let t=e.replace("turn:","http://");t=t.replace("turns:","https://");const n=new Request(t,{method:"GET"});return this.makeRequest(n)}getTimeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}makeRequest(e){return n(this,void 0,void 0,(function*(){const t=yield fetch(e);if(!t.ok){401===t.status&&this.loggedOutHandler();const e=yield t.json();throw{status:t.status,body:e}}return 204===t.status?Promise.resolve():(this.xAuthToken=t.headers.get("x-auth-token")||this.xAuthToken,yield t.json())}))}getRequest(e){const t=new Request(this.apiUrl+e,{method:"GET",credentials:"omit",headers:{"x-auth-token":this.xAuthToken}});return this.makeRequest(t)}postRequest(e,t={},n={},r={}){const i={method:"POST",credentials:"omit",headers:Object.assign({"Content-Type":"application/json","x-auth-token":this.xAuthToken},r),body:JSON.stringify(t)},o=new Request(this.apiUrl+e,Object.assign(i,n));return this.makeRequest(o)}putRequest(e,t={},n={}){const r={method:"PUT",credentials:"omit",headers:{"Content-Type":"application/json","x-auth-token":this.xAuthToken},body:JSON.stringify(t)},i=new Request(this.apiUrl+e,Object.assign(r,n));return this.makeRequest(i)}}},2958:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasService=void 0,t.CanvasService=class{constructor(e){this.canvasHeight=720,this.canvasWidth=1280,this.uneeqOptions=e}createCanvas(){const e=document.createElement("canvas");return this.uneeqOptions.avatarVideoContainerElement.appendChild(e),e.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),e.height=this.canvasHeight,e.width=this.canvasWidth,e}}},1546:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceManager=void 0;const i=n(3607),o=n(1929);t.DeviceManager=class{set edgeNodeId(e){this.mediaHandler.setEdgeNodeId(e),this.getDevices(!0)}constructor(e,t){this.options=e,this.api=t,this.speakerConstraints={},this.publishStream=new MediaStream,this.devices={audioInput:[],audioOutput:[],videoInput:[]},this.previousMediaOptions={},this.mediaHandler=new o.MediaHandler(this.options,(()=>this.remoteVideoReady())),this.initMediaConstraints(),this.getDevices(!1)}enableLocalDevices(e,t){const n=this.options.uneeqOptions.sendLocalVideo!==e,r=this.options.uneeqOptions.sendLocalAudio!==t;(n||r)&&(this.previousMediaOptions={sendLocalVideo:this.options.uneeqOptions.sendLocalVideo,sendLocalAudio:this.options.uneeqOptions.sendLocalAudio},this.options.uneeqOptions.sendLocalVideo=e,this.options.uneeqOptions.sendLocalAudio=t,n&&!1===e&&this.publishStream.getVideoTracks().forEach((e=>e.stop())),r&&!1===t&&this.publishStream.getAudioTracks().forEach((e=>e.stop())),this.mediaHandler.publishingStream=!1,this.initMediaConstraints(),this.getDevices(!0))}getDevices(e=!0){if(!this.options.uneeqOptions.sendLocalVideo&&!this.options.uneeqOptions.sendLocalAudio)return void this.initStreamWithoutDevices();const t=this;this.publishStream=new MediaStream,this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),navigator.mediaDevices.getUserMedia(this.userMediaConstraints).then((t=>r(this,void 0,void 0,(function*(){if(this.initDeviceList(),this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),e){if(this.options.uneeqOptions.sendLocalVideo){const e=t.getVideoTracks();e.length>0&&(this.publishStream.getVideoTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream.addTrack(e[0]))}if(this.options.uneeqOptions.sendLocalAudio){const e=t.getAudioTracks();e.length>0&&(this.publishStream.getAudioTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream.addTrack(e[0]))}this.mediaHandler.localStream$.next(this.publishStream)}})))).catch((e=>{t.options.userMessages.next(new i.DeviceErrorMessage(e)),console.error("device error: ",e),this.sendMediaUnavailableInfo("NotAllowedError"===e.name),this.revertMediaOptions()}))}setMicDevice(e,t=!0){const n=this.devices.audioInput.filter((t=>t.deviceId===e));if(n&&n.length>0)this.options.uneeqOptions.preferredMicrophoneId=e,this.audioConstraints.deviceId=e,t&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetMicSuccessMessage(e));else{const t="Uneeq setMic: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}setCamDevice(e,t=!0){const n=this.devices.videoInput.filter((t=>t.deviceId===e));if(n&&n.length>0)this.options.uneeqOptions.preferredCameraId=e,this.videoConstraints.deviceId=e,t&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetCameraSuccessMessage(e));else{const t="Uneeq setCamera: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}setAvatarSpeakerDevice(e){if(this.mediaHandler.avatarVideoElement){const t=this.devices.audioOutput.filter((t=>t.deviceId===e));if(t&&t.length>0)this.options.uneeqOptions.preferredSpeakerId=e,this.mediaHandler.avatarVideoElement.setSinkId(e).then((()=>{this.speakerConstraints.deviceId=e,this.options.userMessages.next(new i.SetSpeakerSuccessMessage(e))})).catch((t=>{const n="Uneeq setSpeaker: Error setting device. "+t.message;this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(n,e))}));else{const t="Uneeq setSpeaker: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(t,e))}}}revertMediaOptions(){this.previousMediaOptions&&(this.options.uneeqOptions.sendLocalAudio=this.previousMediaOptions.sendLocalAudio,this.options.uneeqOptions.sendLocalVideo=this.previousMediaOptions.sendLocalVideo)}initMediaConstraints(){this.audioConstraints={},this.videoConstraints={facingMode:"user",width:640,height:480},this.userMediaConstraints={audio:!!this.options.uneeqOptions.sendLocalAudio&&this.audioConstraints,video:!!this.options.uneeqOptions.sendLocalVideo&&this.videoConstraints}}initStreamWithoutDevices(){this.publishStream.getTracks().forEach((e=>this.publishStream.removeTrack(e))),this.publishStream=new MediaStream,this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),this.mediaHandler.localStream$.next(this.publishStream)}remoteVideoReady(){this.options.uneeqOptions.preferredSpeakerId&&this.setAvatarSpeakerDevice(this.options.uneeqOptions.preferredSpeakerId)}sendMediaUnavailableInfo(e){return r(this,void 0,void 0,(function*(){const t=yield this.getMediaDevices(),n={audioInputs:t.audioInput.length,videoInputs:t.videoInput.length,hasUserDeniedPermission:e};return this.api.sendMediaUnavailable(n)}))}getMediaDevices(){return r(this,void 0,void 0,(function*(){const e=yield navigator.mediaDevices.enumerateDevices(),t={audioInput:[],audioOutput:[],videoInput:[]};return t.audioInput=e.filter((e=>"audioinput"===e.kind)),t.audioOutput=e.filter((e=>"audiooutput"===e.kind)),t.videoInput=e.filter((e=>"videoinput"===e.kind)),t}))}initDeviceList(){return r(this,void 0,void 0,(function*(){navigator.mediaDevices.ondevicechange=e=>{this.initDeviceList()};const e=yield this.getMediaDevices();JSON.stringify(e)!==JSON.stringify(this.devices)&&(this.devices=e,this.options.uneeqOptions.preferredCameraId&&this.setCamDevice(this.options.uneeqOptions.preferredCameraId,!1),this.options.uneeqOptions.preferredMicrophoneId&&this.setMicDevice(this.options.uneeqOptions.preferredMicrophoneId,!1),this.options.userMessages.next(new i.DeviceListUpdatedMessage(this.devices)))}))}}},6886:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DigitalHumanVideoPlayManager=void 0;const r=n(8512),i=n(7501);t.DigitalHumanVideoPlayManager=class{constructor(e,t){this.messages=e,this.publicUnmuteDigitalHumanMethod=t,this.remoteVideoPlayCount=0}play(e){this.video=e,this.playRemoteVideo()}unmuteVideo(){this.video&&this.video.muted&&(this.video.muted=!1,this.messages.next(new r.DigitalHumanUnmuted))}playRemoteVideo(){this.video&&(this.video.onerror=e=>{this.messages.next(new r.DigitalHumanVideoError(e))},this.video.play().then((()=>{this.messages.next(new r.DigitalHumanUnmuted)})).catch((()=>{this.digitalHumanFailedToPlayUnmuted()})))}digitalHumanFailedToPlayUnmuted(){this.messages.next(new r.DigitalHumanFailedToPlay),this.video.muted=!0,this.video.play().then((()=>{i.logger.log("Muting the digital human and playing it succeeded."),this.messages.next(new r.DigitalHumanPlayedInMutedModeSuccess),this.video.addEventListener("click",(()=>{this.publicUnmuteDigitalHumanMethod()}),{once:!0})})).catch((e=>{i.logger.log("Could not play digital human video even as muted, starting exponential backoff.",e),this.playRemoteVideoWithExponentialBackoff()}))}playRemoteVideoWithExponentialBackoff(){this.video&&(this.video.autoplay=!0,this.video.play().then((()=>{this.messages.next(new r.DigitalHumanUnmuted)})),this.remoteVideoPlayCount++,setTimeout((()=>{this.remoteVideoPlayCount<10&&this.playRemoteVideoWithExponentialBackoff()}),100*(this.remoteVideoPlayCount-1)))}}},7789:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocaleDetector=void 0;class n{static validateOrDetectSpeechLocales(e){let t=e.speechToTextLocales;t&&t.length>0&&(t.split(":").forEach((e=>{this.sttSupportedLocales[e]||(console.error(`UneeQ: Speech to text not supported for: ${e}. Defaulting to en-US`),t=this.defaultLocale)})),"undefined"!==t&&"null"!==t||(t=this.defaultLocale));const n=(window.navigator.languages||[window.navigator.language]).map((e=>((e.length<5||"zh-CN"===e)&&(e=this.localeMappings[e]||null),e&&!this.sttSupportedLocales[e]&&(console.warn(`UneeQ: Speech to text not supported for one of the detected languages: ${e}. Replacing with en-US.`),e=this.defaultLocale),e))).slice(0,4).filter(r).filter(((e,t,n)=>n.indexOf(e)===t));let i=n.join(":").replace(/:\s*$/,"");return i&&0!==i.length||(i=this.defaultLocale),t&&t.length>0?console.debug(`UneeQ: Configured speech to text languages: ${t}`):console.warn(`UneeQ: Detected speechToText languages from browser: ${i}`),t||i}}function r(e){return null!=e}t.LocaleDetector=n,n.defaultLocale="en-US",n.localeMappings={en:"en-US",es:"es-ES",fr:"fr-FR",ja:"ja-JP",de:"de-DE",ko:"ko-KR",zh:"cmn-Hans-CN",it:"it-IT",pt:"pt-PT",nl:"nl-NL",sv:"sv-SE",da:"da-DK",no:"no-NO",fi:"fi-FI",ru:"ru-RU",pl:"pl-PL",tr:"tr-TR",ar:"ar-SA",th:"th-TH",id:"id-ID",cs:"cs-CZ",hu:"hu-HU",ro:"ro-RO",he:"he-IL",vi:"vi-VN",uk:"uk-UA",hi:"hi-IN","zh-CN":"cmn-Hans-CN"},n.sttSupportedLocales={"af-ZA":!0,"sq-AL":!0,"am-ET":!0,"ar-DZ":!0,"ar-BH":!0,"ar-EG":!0,"ar-IQ":!0,"ar-IL":!0,"ar-JO":!0,"ar-KW":!0,"ar-LB":!0,"ar-MR":!0,"ar-MA":!0,"ar-OM":!0,"ar-QA":!0,"ar-SA":!0,"ar-PS":!0,"ar-TN":!0,"ar-AE":!0,"ar-YE":!0,"hy-AM":!0,"az-AZ":!0,"eu-ES":!0,"bn-BD":!0,"bn-IN":!0,"bs-BA":!0,"bg-BG":!0,"my-MM":!0,"ca-ES":!0,"yue-Hant-HK":!0,"cmn-Hans-CN":!0,"cmn-Hant-TW":!0,"hr-HR":!0,"cs-CZ":!0,"da-DK":!0,"nl-BE":!0,"nl-NL":!0,"en-AU":!0,"en-CA":!0,"en-GH":!0,"en-HK":!0,"en-IN":!0,"en-IE":!0,"en-KE":!0,"en-NZ":!0,"en-NG":!0,"en-PK":!0,"en-PH":!0,"en-SG":!0,"en-ZA":!0,"en-TZ":!0,"en-GB":!0,"en-US":!0,"et-EE":!0,"fil-PH":!0,"fi-FI":!0,"fr-BE":!0,"fr-CA":!0,"fr-FR":!0,"fr-CH":!0,"gl-ES":!0,"ka-GE":!0,"de-AT":!0,"de-DE":!0,"de-CH":!0,"el-GR":!0,"gu-IN":!0,"iw-IL":!0,"hi-IN":!0,"hu-HU":!0,"is-IS":!0,"id-ID":!0,"it-IT":!0,"it-CH":!0,"ja-JP":!0,"jv-ID":!0,"kn-IN":!0,"kk-KZ":!0,"km-KH":!0,"ko-KR":!0,"lo-LA":!0,"lv-LV":!0,"lt-LT":!0,"mk-MK":!0,"ms-MY":!0,"ml-IN":!0,"mr-IN":!0,"mn-MN":!0,"ne-NP":!0,"no-NO":!0,"fa-IR":!0,"pl-PL":!0,"pt-BR":!0,"pt-PT":!0,"pa-Guru-IN":!0,"ro-RO":!0,"ru-RU":!0,"rw-RW":!0,"sr-RS":!0,"si-LK":!0,"sk-SK":!0,"sl-SI":!0,"ss-latn-za":!0,"st-ZA":!0,"es-AR":!0,"es-BO":!0,"es-CL":!0,"es-CO":!0,"es-CR":!0,"es-DO":!0,"es-EC":!0,"es-SV":!0,"es-GT":!0,"es-HN":!0,"es-MX":!0,"es-NI":!0,"es-PA":!0,"es-PY":!0,"es-PE":!0,"es-PR":!0,"es-ES":!0,"es-US":!0,"es-UY":!0,"es-VE":!0,"su-ID":!0,"sw-KE":!0,"sw-TZ":!0,"sv-SE":!0,"ta-IN":!0,"ta-MY":!0,"ta-SG":!0,"ta-LK":!0,"te-IN":!0,"th-TH":!0,"tn-latn-za":!0,"tr-TR":!0,"ts-ZA":!0,"uk-UA":!0,"ur-IN":!0,"ur-PK":!0,"uz-UZ":!0,"ve-ZA":!0,"vi-VN":!0,"xh-ZA":!0,"zu-ZA":!0}},7501:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.Logger=t.LogType=void 0,function(e){e.debug="debug",e.log="log",e.warn="warn",e.error="error"}(n||(t.LogType=n={}));class r{constructor(){this.enabled=!1}log(e,...t){this.emitLogMessage(n.log,e,t)}warn(e,...t){this.emitLogMessage(n.warn,e,t)}error(e,...t){this.emitLogMessage(n.error,e,t)}debug(e,...t){this.emitLogMessage(n.debug,e,t)}emitLogMessage(e,t,r){(this.enabled||e===n.error)&&(r.length>0?console[e](t,r):console[e](t))}}t.Logger=r,t.logger=new r},1929:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaHandler=void 0;const r=n(2872),i=n(4857),o=n(3607),s=n(4518),a=n(7563),u=n(2958),c=n(7501),l=n(8477);t.MediaHandler=class{constructor(e,t){this.options=e,this.remoteVideoReady=t,this.remoteStream$=new r.BehaviorSubject(null),this.localStream$=new r.BehaviorSubject(null),this.publishState$=new r.BehaviorSubject(a.PublishSubscribeState.DISCONNECTED),this.publishingStream=!1,this.remoteStream$.pipe((0,i.filter)((e=>null!==e))).subscribe((n=>{this.avatarVideoElement=this.options.digitalHumanVideoElement,this.avatarVideoElement.srcObject=n,e.uneeqOptions.avatarVideoContainerElement.style.overflow="hidden",e.uneeqOptions.avatarVideoContainerElement.innerHTML="",e.uneeqOptions.avatarVideoContainerElement.appendChild(this.avatarVideoElement),this.options.uneeqOptions.enableTransparentBackground&&this.initTransparentBackground(this.avatarVideoElement),t()})),this.localStream$.pipe((0,i.filter)((e=>null!==e))).subscribe((t=>{const n=document.createElement("video");this.localVideoElement=n,n.srcObject=t,n.autoplay=!0,n.muted=!0,n.setAttribute("playsinline","true"),n.setAttribute("style","width: 100%; height: 100%;"),e.uneeqOptions.localVideoContainerElement.innerHTML="",e.uneeqOptions.localVideoContainerElement.appendChild(n),this.options.voiceInputManager&&this.options.voiceInputManager.initMicActivity(t),this.options.session.edgeNodeId&&!this.publishingStream&&this.publishVideo()})),this.options.internalMessages$.pipe((0,i.filter)((e=>"AnswerMessage"===e.faceMeMessageType))).subscribe((e=>{void 0!==this.webRTC&&this.webRTC.handleAnswerMessage(e)})),this.options.internalMessages$.pipe((0,i.filter)((e=>"IceCandidateMessage"===e.faceMeMessageType))).subscribe((e=>{void 0!==this.webRTC&&this.webRTC.handleIceCandidate(e)}))}setEdgeNodeId(e){this.options.session.edgeNodeId=e,this.options.session.edgeNodeId&&!this.publishingStream&&this.localStream$.getValue()&&this.publishVideo()}unpublishVideo(){c.logger.log("UserSession | unpublishVideo"),void 0!==this.webRTC&&(this.webRTC.close(),this.webRTC=void 0),this.publishState$.next(a.PublishSubscribeState.DISCONNECTED)}pause(){const e=this.remoteStream$.getValue(),t=this.localStream$.getValue();this.avatarVideoElement.pause(),this.localVideoElement.pause(),t&&t.getTracks().forEach((e=>e.enabled=!1)),e&&e.getTracks().forEach((e=>e.enabled=!1))}resume(){const e=this.remoteStream$.getValue(),t=this.localStream$.getValue();t&&t.getTracks().forEach((e=>e.enabled=!0)),e&&e.getTracks().forEach((e=>e.enabled=!0)),this.avatarVideoElement.play(),this.localVideoElement.play()}stopAllLocalStreams(){const e=this.localStream$.getValue();e&&e.getTracks().forEach((e=>e.stop())),this.publishingStream=!1}endSession(){this.stopAllLocalStreams(),this.options.uneeqOptions.localVideoContainerElement&&this.options.uneeqOptions.localVideoContainerElement&&(this.options.uneeqOptions.localVideoContainerElement.innerHTML=""),this.unpublishVideo(),this.options.uneeqOptions.avatarVideoContainerElement&&this.options.uneeqOptions.avatarVideoContainerElement&&(this.options.uneeqOptions.avatarVideoContainerElement.innerHTML="");const e=this.remoteStream$.getValue();e&&e.getTracks().forEach((e=>e.stop())),this.options.voiceInputManager&&this.options.voiceInputManager.handleSessionEnd()}sendDataMessage(e){this.webRTC&&this.webRTC.sendDataMessage(e)}gatherWebRTCStats(e){var t;null===(t=this.webRTC)||void 0===t||t.getStats(e)}publishVideo(){const e=this.options.session.streamId,t=this.options.session.avatarStreamId,n=this.options.session.turnServerAddresses,r=this.options.session.turnUsername,i=this.options.session.turnPassword,s=this.options.session.forceTurnServerUse,u=this.publishState$,d=this.remoteStream$,f=this.localStream$.getValue();if(!f||!this.options.session.edgeNodeId)return void console.error("Not ready to publish");let h=0;c.logger.log("UserSession | publishVideo - stream:",f,"publishStreamName:",e),c.logger.log("PublishVideo with edge node id: ",this.options.session.edgeNodeId),this.publishingStream=!0,null==this.webRTC?(this.webRTC=new l.UneeqWebRTC({messaging:this.options.messaging,userMessages:this.options.userMessages,publishStreamName:e,subscribeStreamName:t,edgeNodeId:this.options.session.edgeNodeId||"id",diagnostics:this.options.uneeqOptions.diagnostics,onAddStream:e=>{c.logger.log("WEBRTC: onAddStream "+e.stream),d.next(e.stream)},forceTurnServerUse:s,iceServers:[{urls:n,username:r,credential:i}],onConnect:()=>{c.logger.log("UserSession | publishVideo | webRtcInstance | onStateChange - connected"),u.getValue()===a.PublishSubscribeState.CONNECTING&&u.next(a.PublishSubscribeState.CONNECTED)},onError:e=>{c.logger.log("UserSession | publishVideo | webRtcInstance | onConnectionFailed - ",h),h<3?(h++,this.performWebRTCConnection(f),this.options.userMessages.next(new o.ConnectionLostMessage(a.PublishSubscribeState.DISCONNECTED))):(c.logger.log("UserSession | publishVideo | webRtcInstance | Publish failures > 3, so giving up"),u.next(a.PublishSubscribeState.FAILED),this.options.userMessages.next(new o.ConnectionLostMessage(a.PublishSubscribeState.FAILED)))}}),this.performWebRTCConnection(f)):this.webRTC.updateStreamTracks(f)}performWebRTCConnection(e){this.webRTC&&(this.publishState$.next(a.PublishSubscribeState.CONNECTING),this.webRTC.connect(e))}initTransparentBackground(e){const t=new u.CanvasService(this.options.uneeqOptions).createCanvas();(new s.VideoEditor).applyChromaKeyEffect(t,e),this.avatarVideoElement.style.display="none"}}},4887:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;const r=n(4857),i=n(3607),o=n(4050);t.MessageHandler=class{constructor(e,t){this.internalMessages$=e,this.messages=t,this.deviceManager={getDevices:(e,t)=>{}},this.getMessagesOfType("AvatarQuestionText").subscribe((e=>{const t={type:o.PromMessageType.QuestionMessageReceived,value:{id:e.id,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new i.AvatarQuestionMessage(e.question,e.id))})),this.getMessagesOfType("AvatarAnswerText").subscribe((e=>{const t={type:o.PromMessageType.AnswerMessageReceived,value:{id:e.questionId,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new i.AvatarAnswerMessage(e.answer,e.answerAvatar,e.answerSpeech,e.questionId))})),this.getMessagesOfType("AvatarAnswerHTML").subscribe((e=>{this.messages.next(new i.AvatarAnswerContentMessage(e.html,e.messageId,e.hasDisplayHtml)),this.messages.next(new i.InstructionsMessage(e.instructions))})),this.getMessagesOfType("AvatarTextInputStarted").subscribe((e=>this.messages.next(new i.StartedSpeakingMessage))),this.getMessagesOfType("AvatarTextInputFinished").subscribe((e=>{this.messages.next(new i.FinishedSpeakingMessage),this.messages.next(new i.AvatarTextInputFinishedMessage)})),this.getMessagesOfType("AvatarStarting").subscribe((e=>{this.deviceManager.edgeNodeId=e.edgeNodeId})),this.getMessagesOfType("ClientMediaStreamUpdate").subscribe((e=>{this.messages.next(new i.ClientMediaStreamUpdateMessage(e.clientStreamingAudio,e.clientStreamingVideo,e.serverStreamingAudio,e.serverStreamingVideo)),e.clientStreamingAudio&&e.clientStreamingVideo&&e.serverStreamingAudio&&e.serverStreamingVideo&&(this.internalMessages$.next({faceMeMessageType:"sessionLive"}),this.internalMessages$.next({faceMeMessageType:"remoteVideoReadyToPlay"}))})),this.getMessagesOfType("SessionErrorMessage").subscribe((e=>{console.error(e.error),this.messages.next(new i.SessionErrorMessage(e.error))})),this.getMessagesOfType("SessionInfoMessage").subscribe((e=>{this.messages.next(new i.SessionInfoMessage(e.info))})),this.getMessagesOfType("SessionEndedMessage").subscribe((()=>{const e={type:o.PromMessageType.SessionEnded,value:{receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.internalMessages$.next({faceMeMessageType:"sessionEnd"})})),this.getMessagesOfType("AvatarRequestCompleted").subscribe((e=>{this.messages.next(new i.AvatarRequestCompleted(e.reason))})),this.getMessagesOfType("AvatarRequestIgnored").subscribe((e=>{this.messages.next(new i.AvatarRequestIgnored(e.reason))}))}setDeviceManager(e){this.deviceManager=e}getMessagesOfType(e){return this.internalMessages$.pipe((0,r.filter)((t=>t.faceMeMessageType===e)))}}},8957:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingState=t.MessagingService=void 0;const r=n(8637);Object.defineProperty(t,"MessagingService",{enumerable:!0,get:function(){return r.MessagingService}});const i=n(7229);Object.defineProperty(t,"MessagingState",{enumerable:!0,get:function(){return i.MessagingState}})},8637:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingService=void 0;const r=n(2541),i=n(2872),o=n(7501),s=n(7229);t.MessagingService=class{constructor(e,t){this.options={autoReconnect:!0,reconnectTime:5e3,maxReconnectAttempts:3,connectionHeaders:{},maxReconnectLimitReached:()=>{},onReconnect:()=>{}},this.url=e,this.options=Object.assign(this.options,t),this.subscriptions={},this.connectionAttempts=0,this.state$=new i.BehaviorSubject(s.MessagingState.DISCONNECTED),this.messages$=new i.Subject,console.log("connect headers messaging: ",this.options.connectionHeaders);const n={connectHeaders:this.options.connectionHeaders,reconnectDelay:0,connectionTimeout:5e3,discardWebsocketOnCommFailure:!0,brokerURL:this.url.replace("https://","wss://").replace("http://","ws://")};this.stompClient=new r.Client(n),this.stompClient.onConnect=e=>this.onStompConnected(e),this.stompClient.onDisconnect=e=>{o.logger.log("Stomp client disconnected",e)},this.stompClient.onStompError=e=>{o.logger.log("Stomp client error",e),this.onStompClientConnectionClosed(e)},this.stompClient.onWebSocketError=e=>{o.logger.log("Stomp client web socket error",e),this.onStompClientConnectionClosed(e)},this.stompClient.onWebSocketClose=e=>{o.logger.log("Stomp client web socket closed",e),this.onStompClientConnectionClosed(e)}}connect(){this.disconnect(),o.logger.log("MessagingService | connecting..."),this.state$.next(s.MessagingState.CONNECTING),this.connectionAttempts++,this.stompClient.activate()}disconnect(){const e=this.state$.getValue();if(e===s.MessagingState.CONNECTED||e===s.MessagingState.CONNECTING){o.logger.log("Disconnecting stomp client");try{this.subscriptions={},this.options.autoReconnect=!1,this.stompClient.deactivate(),this.stompClient.forceDisconnect(),this.state$.next(s.MessagingState.DISCONNECTED)}catch(e){console.error("MessagingService | disconnect: error",e),this.state$.next(s.MessagingState.DISCONNECTED)}}}send(e,t){o.logger.log("MessagingService | send:",e,t);const n={"content-type":"application/json","x-auth-token":this.options.connectionHeaders["x-auth-token"]},r=JSON.stringify(t);this.stompClient.publish({destination:e,body:r,headers:n})}getTopic(e){o.logger.log("MessagingService | subscribeToTopic: "+e);const t=this.subscriptions[e];if(t)return o.logger.log("existing subscription... not re-subscribing to topic"),t;const n=new i.Subject;return this.stompClient.subscribe(e,(e=>{n.next(e),this.messages$.next(e)})),this.subscriptions[e]=n,n}onStompConnected(e){o.logger.log("MessagingService | connected"),this.state$.next(s.MessagingState.CONNECTED),this.initMessagingSubscription(),this.connectionAttempts=0}onStompClientConnectionClosed(e){this.options.autoReconnect?this.options.maxReconnectAttempts&&this.connectionAttempts<this.options.maxReconnectAttempts?setTimeout((()=>{this.connect()}),this.options.reconnectTime):this.options.maxReconnectLimitReached&&(this.options.maxReconnectLimitReached(),this.disconnect()):this.disconnect()}initMessagingSubscription(){o.logger.log("MessagingService | initMessagingSubscription"),this.stompClient.subscribe("/",(e=>{this.messages$.next(e)}))}}},7229:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingState=void 0,function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(n||(t.MessagingState=n={}))},2694:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsService=void 0;const r=n(3607),i=n(9824),o=n(4050);t.MetricsService=class{constructor(e,t,n){this.uneeqOptions=e,this.internalMessages=t,this.messages=n,this.clientPerformanceStats={},this.options=e,this.internalMessages$=t,this.messages$=n}parseAndLogWebRtcStats(e){try{e.forEach((e=>{var t,n;if("inbound-rtp"===e.type&&"video"===e.kind){this.clientPerformanceStats.frameHeight=new i.ClientPerformanceStat("Frame height",e.frameHeight),this.clientPerformanceStats.frameWidth=new i.ClientPerformanceStat("Frame width",e.frameWidth);const r=e.framesDropped,o=r?r-(null===(t=this.clientPerformanceStats.totalFramesDropped)||void 0===t?void 0:t.value):0;this.clientPerformanceStats.newFramesDropped=o?new i.ClientPerformanceStat("New Frames Dropped",o):new i.ClientPerformanceStat,this.clientPerformanceStats.totalFramesDropped=r?new i.ClientPerformanceStat("Total Frames Dropped",r):new i.ClientPerformanceStat;const s=e.packetsLost,a=s?s-(null===(n=this.clientPerformanceStats.inboundTotalPacketsLost)||void 0===n?void 0:n.value):0;this.clientPerformanceStats.inboundNewPacketsLost=a?new i.ClientPerformanceStat("New packets lost",a):new i.ClientPerformanceStat,this.clientPerformanceStats.inboundTotalPacketsLost=s?new i.ClientPerformanceStat("Total packets lost",s):new i.ClientPerformanceStat;const u=e.framesPerSecond;this.clientPerformanceStats.framesPerSec=u?new i.ClientPerformanceStat("Frames per second",u):new i.ClientPerformanceStat}else if("remote-inbound-rtp"===e.type&&"video"===e.kind){const t=e.roundTripTime;this.clientPerformanceStats.inboundRoundTripTime=t?new i.ClientPerformanceStat("Round Trip Time",t):new i.ClientPerformanceStat}else if("outbound-rtp"===e.type&&"video"===e.kind){const t=e.qualityLimitationReason;this.clientPerformanceStats.outboundQualityLimitationReason=new i.ClientPerformanceStat("Quality Limitation Reason",t)}})),this.options.enableClientPerformanceMessage&&this.messages$.next(new r.ClientPerformanceMessage(this.clientPerformanceStats));const t={type:o.PromMessageType.WebRtcPerformance,value:this.clientPerformanceStats};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t})}catch(e){console.warn("Unable to parseAndLogWebRTCStats",e)}}}},6400:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OnlineStatusService=void 0;const r=n(3607);t.OnlineStatusService=class{constructor(e,t){this.messages=e,this.offlineTimeoutLimitHandler=t,this.online=!0,this.offlineDisconnectTimeLimitMS=1e4,window.addEventListener("offline",(()=>this.handleOffline())),window.addEventListener("online",(()=>this.handleOnline()))}handleOffline(){this.online=!1,this.disconnectTimer=setTimeout((()=>{this.offlineTimeoutLimitHandler()}),this.offlineDisconnectTimeLimitMS),this.sendStatusUpdate()}handleOnline(){this.online=!0,window.clearTimeout(this.disconnectTimer),this.sendStatusUpdate()}sendStatusUpdate(){this.messages.next(new r.OnlineStatusUpdateMessage(this.online))}}},4050:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Prom=t.PromMessageType=void 0;const i=r(n(4427));var o;!function(e){e[e.SessionStart=0]="SessionStart",e[e.WebRtcPerformance=1]="WebRtcPerformance",e[e.AvailabilityCheck=2]="AvailabilityCheck",e[e.QuestionMessageReceived=3]="QuestionMessageReceived",e[e.AnswerMessageReceived=4]="AnswerMessageReceived",e[e.SessionEnded=5]="SessionEnded"}(o||(t.PromMessageType=o={})),t.Prom=class{constructor(e){this.apiUrl=e,this.prom_prefix="client_sdk_",this.registry=(0,i.default)(),this.messageTimings=[],this.metricsPushedCounter=this.registry.create("counter",this.prom_prefix+"metrics_pushed_total","A counter for showcase metrics pushed."),this.sessionStartTime=this.registry.create("histogram",this.prom_prefix+"session_start_duration_seconds","A histogram of session start times.",[1,2.5,4,5,6,7.5,8.5,10,15,30,60]),this.availabilityCheckTime=this.registry.create("histogram",this.prom_prefix+"availability_chk_duration_seconds","A histogram of availability check response times.",[.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.webRtcInboundRTT=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_rtt_duration_seconds","A histogram of client inbound round trip time.",[.001,.002,.005,.01,.02,.05,.1,.5,2,5]),this.webRtcInboundFramesPerSec=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_per_second","A histogram of client inbound frames per second.",[1,2,5,10,15,20,25,35,50]),this.webRtcInboundPacketsLost=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_packets_lost","A histogram of client packets lost.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFramesDropped=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_dropped","A histogram of frames dropped.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFrameHeight=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_height_px","A histogram of frame height in pixels",[60,180,240,360,540,720,1280]),this.webRtcFrameWidth=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_width_px","A histogram of frame width in pixels",[60,180,240,360,540,720,1280,1500,1920]),this.conversationRoundTripTime=this.registry.create("histogram",this.prom_prefix+"conversation_rtt_duration_seconds","A histogram of round trip time of a conversation",[.001,.005,.01,.03,.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.metricsIntervalId=setInterval((()=>{this.sendMetrics()}),1e4)}handleMessage(e){var t,n,r,i,s,a,u;const c=Object.assign(e.labels||{},{platform:"js"});switch(e.type){case o.SessionStart:this.sessionStartTime.observe(e.value,c);break;case o.QuestionMessageReceived:this.messageTimings.push(e.value);break;case o.AnswerMessageReceived:const l=this.calculateConversationRtt(e);l>0&&this.conversationRoundTripTime.observe(l,c);break;case o.WebRtcPerformance:const d=e.value;d.outboundQualityLimitationReason?c.qualityLimitationReason=null===(t=d.outboundQualityLimitationReason)||void 0===t?void 0:t.value:c.qualityLimitationReason="unknown",d.newFramesDropped&&this.webRtcFramesDropped.observe(null===(n=d.newFramesDropped)||void 0===n?void 0:n.value,c),d.framesPerSec&&this.webRtcInboundFramesPerSec.observe(null===(r=d.framesPerSec)||void 0===r?void 0:r.value,c),d.inboundNewPacketsLost&&this.webRtcInboundPacketsLost.observe(null===(i=d.inboundNewPacketsLost)||void 0===i?void 0:i.value,c),d.inboundRoundTripTime&&this.webRtcInboundRTT.observe(null===(s=d.inboundRoundTripTime)||void 0===s?void 0:s.value,c),d.frameHeight&&this.webRtcFrameHeight.observe(null===(a=d.frameHeight)||void 0===a?void 0:a.value,c),d.frameWidth&&this.webRtcFrameWidth.observe(null===(u=d.frameWidth)||void 0===u?void 0:u.value,c);break;case o.AvailabilityCheck:this.availabilityCheckTime.observe(e.value,c);break;case o.SessionEnded:this.stopSendingMetrics()}}calculateConversationRtt(e){if(e.value&&this.messageTimings){const t=this.messageTimings.find((t=>t.id===e.value.id));if(t){const n=t.receivedOn;if(n){const r=(e.value.receivedOn-n)/1e3;return this.messageTimings.splice(this.messageTimings.indexOf(t),1),r}}}return 0}sendMetrics(){this.metricsPushedCounter.inc({platform:"js"});const e=new Request(this.apiUrl+"/client-metrics",{method:"POST",body:this.registry.metrics(),mode:"no-cors"});fetch(e),this.registry.reset()}stopSendingMetrics(){this.metricsIntervalId&&clearInterval(this.metricsIntervalId)}}},8591:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResumeSessionCheck=void 0;const r=n(7501),i=n(39);class o{static validate(e){const t=new i.UneeqLocalStorage;let n=void 0!==e.resumeSession&&e.resumeSession;t.getItemSafely("uneeqResumeSessionPersonaId")===e.conversationId||(r.logger.log("UneeQ: Persona Id's do not match, unable to resume session."),n=!1);const s=o.browserTabIsActive();if(n&&!s&&(r.logger.log("UneeQ: Browser tab is not active so unable to resume"),n=!1),n){const e=t.getItemSafely("uneeqResumeSessionId");if(null!==e)return{resumeSession:!0,resumeSessionId:e}}return{resumeSession:!1}}static browserTabIsActive(){return!document.hidden}}t.ResumeSessionCheck=o},4162:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechHandler=void 0;const o=i(n(759)),s=i(n(3960)),a=n(8778),u=n(8938),c=n(8512),l=n(4542),d=n(7501),f=48e3;t.SpeechHandler=class{constructor(e){this.options=e,this.logPrefix="UneeQ: Speech Recognition: ",this.speechBuffer=new a.RingBuffer(5),this.recordingLive=!1,this.OpusMediaRecorder=s.default,console.warn("UneeQ: SPEECH_RECOGNITION input mode is in development, you may experience issues."),this.options.assetBasePath=this.options.assetBasePath||"https://cdn.uneeq.io/assets/platform/speech-recognition/",this.loadSavedAudioHeaders(),this.initWebsocket(e)}initWebsocket(e){let t=e.apiUrl.replace("https://api.","wss://speech-recognition-service.");t+="/ws/recognize?session_id="+e.sessionId,d.logger.log(this.logPrefix+"Initializing speech recognition websocket to "+t),this.ws=new WebSocket(t),this.ws.onopen=()=>{d.logger.log(this.logPrefix+"WebSocket opened"),this.initMicrophone()},this.ws.onclose=e=>{d.logger.log(this.logPrefix+"WebSocket closed",e)},this.ws.onerror=e=>d.logger.error(this.logPrefix+"WebSocket error",e),this.ws.onmessage=e=>{this.handleWebsocketMessage(e)}}loadSavedAudioHeaders(){return r(this,void 0,void 0,(function*(){const e=this.options.assetBasePath+"opus-media-recorder-header.webm",t=yield fetch(e),n=yield t.arrayBuffer();this.headerBlob=new Blob([n],{type:"audio/webm;codecs=opus"})}))}initVoiceActivityDetection(e){d.logger.log(this.logPrefix+"Going to initialize VAD module."),u.MicVAD.new({onSpeechStart:()=>this.onVadSpeechStart(),onSpeechEnd:()=>this.onVadSpeechEnd(),minSpeechFrames:1,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,redemptionFrames:8,assetBasePath:this.options.assetBasePath,stream:e}).then((e=>{this.micVad=e,this.micVad.start(),d.logger.log(this.logPrefix+"VAD module has started")})).catch((e=>{console.error(this.logPrefix+"Could not initialize VAD module",e)}))}onVadSpeechStart(){d.logger.log(this.logPrefix+"User started speaking"),this.options.messages.next(new c.UserStartedSpeakingMessage),this.sendStartMessage(),this.ws.send(this.headerBlob),d.logger.log(this.logPrefix+"Sending buffered speech audio");const e=new Blob(this.speechBuffer.toArray(),{type:"audio/webm;codecs=opus"});this.ws.send(e),this.recordingLive=!0,this.speechBuffer.clear()}onVadSpeechEnd(){d.logger.log(this.logPrefix+"User stopped speaking"),this.options.messages.next(new c.UserStoppedSpeakingMessage),this.recordingLive=!1,this.sendStopMessage()}handleWebsocketMessage(e){d.logger.log(this.logPrefix+"Got a websocket message: ",e);try{const t=JSON.parse(e.data);if("response"===t.state&&t.results&&t.results[0])return void this.handleTranscriptionResult(t.results[0])}catch(t){console.error(this.logPrefix+"Error processing message",e,t)}}sendStartMessage(){const e={action:l.SpeechRecognitionMessageAction.startTranscription,channels:1,sampleRate:f,interimResults:!0,lang:this.options.locales,phrases:this.options.hintPhrases};this.ws.send(JSON.stringify(e))}sendStopMessage(){const e={action:l.SpeechRecognitionMessageAction.stopTranscription};this.ws.send(JSON.stringify(e))}initMicrophone(){navigator.mediaDevices.getUserMedia({audio:{sampleRate:f,channelCount:1}}).then((e=>{this.initVoiceActivityDetection(e),this.initMediaRecorder(e)})).catch((e=>console.error("Error starting recording",e)))}initMediaRecorder(e){return r(this,void 0,void 0,(function*(){const t=yield(0,o.default)(this.options.assetBasePath+"encoderWorker.umd.js"),n={encoderWorkerFactory:()=>new Worker(t),OggOpusEncoderWasmPath:this.options.assetBasePath+"OggOpusEncoder.wasm",WebMOpusEncoderWasmPath:this.options.assetBasePath+"WebMOpusEncoder.wasm"},r={mimeType:"audio/webm",audioBitsPerSecond:f};this.mediaRecorder=new this.OpusMediaRecorder(e,r,n),this.mediaRecorder.ondataavailable=e=>this.mediaRecorderOnData(e),this.mediaRecorder.onstop=()=>this.sendStopMessage(),this.mediaRecorder.start(100)}))}mediaRecorderOnData(e){e.data&&e.data.size>0&&(!0===this.recordingLive?this.ws.send(e.data):this.speechBuffer.add(e.data))}handleTranscriptionResult(e){d.logger.log(this.logPrefix+`Speech transcription (${e.confidence} confidence): ${e.transcript}`),e.final&&this.options.api.avatarAsk(e.transcript),this.options.messages.next(new c.SpeechTranscriptionMessage(e))}}},1116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamManager=void 0,t.StreamManager=class{constructor(){window.AudioContext=window.AudioContext||window.webkitAudioContext,this.silentAudioTrack=this.generateSilentAudioTrack(),this.canvasVideoTrack=this.generateCanvasVideoTrack()}addCanvasVideoTrackToStream(e){return e.getVideoTracks().forEach((t=>e.removeTrack(t))),e.addTrack(this.canvasVideoTrack),e}addSilentAudioTrackToStream(e){return e.getAudioTracks().forEach((t=>e.removeTrack(t))),e.addTrack(this.silentAudioTrack),e}resumeAudioContext(){this.audioContextInstance&&this.audioContextInstance.resume()}generateCanvasVideoTrack(){const e=document.createElement("canvas");return e.width=40,e.height=30,e.getContext("2d"),e.captureStream(1).getVideoTracks()[0]}generateSilentAudioTrack(){if(!this.audioSourceNode||!this.audioSourceDestination){const e=new window.AudioContext;this.audioContextInstance=e,this.audioSourceDestination=e.createMediaStreamDestination()}return this.audioSourceDestination.stream.getAudioTracks()[0]}}},39:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UneeqLocalStorage=void 0;const r=n(7501);t.UneeqLocalStorage=class{constructor(){}get available(){return void 0===this.localStorageAvailable&&(this.localStorageAvailable=this.checkIfLocalStorageAvailable()),this.localStorageAvailable}setItemSafely(e,t){this.available?localStorage.setItem(e,t):r.logger.log("UneeQ: unable to access localStorage because it is not available.")}getItemSafely(e){return this.available?localStorage.getItem(e):void r.logger.log("UneeQ: unable to access localStorage because it is not available.")}removeItemSafely(e){this.available?localStorage.removeItem(e):r.logger.log("UneeQ: unable to access localStorage because it is not available.")}checkIfLocalStorageAvailable(){const e="UneeqLocalStoreCheck";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}}},8477:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.UneeqWebRTC=void 0;const i=r(n(8853)),o=r(n(835)),s=n(3607),a=n(7501);t.UneeqWebRTC=class{constructor(e){this.fakeDataChannel={},this.MESSAGING_ENDPOINT="/app/v2/webRTC",this.onStats=(e,t)=>{this.options.userMessages.next(new s.WebRtcStatsMessage(t)),this.statTimer=window.setTimeout((()=>{this.client&&this.client.getStats&&this.client.getStats(this.onStats)}),2e3)},this.options=Object.assign({forceTurnServerUse:!1,iceServers:[]},e),this.log("Options",this.options),this.uniqueId=Math.random().toString(36).substring(2,12),RTCPeerConnection.prototype.createDataChannel||(this.warn("Implementing a fake createDataChannel"),RTCPeerConnection.prototype.createDataChannel=()=>this.fakeDataChannel)}connect(e){this.close(),this.client=new i.default({initiator:!0,config:{iceServers:this.options.iceServers},stream:e,channelName:"UneeqChannel"}),this.options.diagnostics&&this.enableDiagnostics(),this.fakeDataChannel.onopen&&(this.warn("Calling channel open on fake data channel"),this.fakeDataChannel.onopen()),this.client.on("error",(e=>{this.log("error",e),void 0!==this.options.onError&&this.options.onError(e)})),this.client.on("signal",(e=>{const t={payload:"",publishStreamName:this.options.publishStreamName,subscribeStreamName:this.options.subscribeStreamName,uniqueId:this.uniqueId,userAgent:navigator.userAgent,edgeNodeId:this.options.edgeNodeId};if("type"in e&&"offer"===e.type)t.payload=JSON.stringify({type:"offer",sdp:e.sdp}),t.type="OfferMessage",this.log("Offer payload ",t),this.options.messaging.send(this.MESSAGING_ENDPOINT,t);else if("candidate"in e){const n=JSON.stringify(e.candidate);this.options.forceTurnServerUse&&!n.match(/typ relay/)||n.match(/::/)||(t.payload=n,t.type="IceCandidate",this.log("IC payload ",t),this.options.messaging.send(this.MESSAGING_ENDPOINT,t))}else this.warn("WARNING Unhandled signal: ",JSON.stringify(e))})),this.client.on("connect",(()=>{this.log("CONNECT"),void 0!==this.options.onConnect&&this.options.onConnect()})),this.client.on("data",(e=>{e.type&&this.log("data: "+e),void 0!==this.options.onData&&this.options.onData(e),this.options.userMessages.next(new s.WebRtcDataMessage(e))})),this.client.on("close",(()=>{this.log("WebRTC session closed: "+this.uniqueId),this.client=null,void 0!==this.options.onClose&&this.options.onClose()})),this.client.on("stream",(e=>{void 0!==this.options.onAddStream&&this.options.onAddStream({stream:e})}))}close(){this.client&&(this.client.destroy(),this.client=null),this.statTimer&&clearTimeout(this.statTimer)}handleAnswerMessage(e){if(this.isMessageForUs(e)&&this.client){const t=JSON.parse(e.payload);return this.log("got answer: ",t),this.client.signal(t),!0}return this.log("ignoring answer: ",e),!1}handleIceCandidate(e){if(this.isMessageForUs(e)&&this.client){const t=JSON.parse(e.payload);if("candidate"in t&&""===t.candidate){if("edge"===o.default.browserDetails.browser){const e=this.client._pc;e.remoteDescription&&e.remoteDescription.type&&e.addIceCandidate(null)}}else this.client.signal({candidate:t});return!0}return!1}sendDataMessage(e){this.client.send(e)}getStats(e){return this.client&&this.client.getStats(e)}updateStreamTracks(e){e.getTracks().forEach((e=>{this.client._pc.getSenders().find((t=>e.kind===t.track.kind)).replaceTrack(e).then((()=>{a.logger.log("Updated publish media stream track for "+e.kind)})).catch((t=>{a.logger.error("Error: updating publish media stream track failed for "+e.kind,t)}))}))}enableDiagnostics(){this.client._pc&&0!==this.client._pc.getStats.length&&(this.client._pc.getStats=""),this.client&&this.client.getStats&&this.client.getStats(this.onStats)}isMessageForUs(e){return e.requestUniqueId===this.uniqueId}log(e,...t){a.logger.log("UneeqWebRTC: "+e,t)}warn(e,...t){a.logger.warn("UneeqWebRTC: "+e,t)}}},4333:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInputManager=void 0;const r=n(4857),i=n(881),o=n(8512),s=n(608),a=n(7501);t.VoiceInputManager=class{constructor(e,t,n,r){this.options=e,this.api=t,this.messages=n,this.enableMicrophone=r,this.microphoneEngageVolume=.02,this.microphoneDisengageVolume=.02,this.voiceActivityNotSpeakingTimeoutMS=1e3,this.voiceActivityAllowInterruptions=!1,this.digitalHumanSpeaking=!1,this.recording=!1,this.setVoiceInputMode(e.voiceInputMode);try{window.AudioContext=window.AudioContext||window.webkitAudioContext,this.audioContext=new AudioContext}catch(e){this.audioContextNotSupported()}this.handleAppMessages()}setVoiceInputMode(e){e===s.VoiceInputMode.PUSH_TO_TALK?this.options.voiceInputMode=s.VoiceInputMode.PUSH_TO_TALK:e===s.VoiceInputMode.VOICE_ACTIVITY?this.options.voiceInputMode=s.VoiceInputMode.VOICE_ACTIVITY:this.messages.next(new o.WarningMessage("Invalid voice input mode selected: "+e))}startRecording(){this.options.voiceInputMode===s.VoiceInputMode.PUSH_TO_TALK?this.apiStartRecording():this.requestNotSupportedInVoiceActivityMode("startRecording")}stopRecording(){this.options.voiceInputMode===s.VoiceInputMode.PUSH_TO_TALK?this.apiStopRecording():this.requestNotSupportedInVoiceActivityMode("stopRecording")}handleSessionEnd(){this.soundMeter&&this.soundMeter.stop()}resumeAudioContext(){a.logger.log("UneeQ: resuming publish stream audio context and initializing mic activity."),this.audioContext&&(this.audioContext.resume(),this.stream&&this.initMicActivity(this.stream))}initMicActivity(e){this.stream=e,this.soundMeter=new i.SoundMeter(this.audioContext),this.soundMeter.connectToSource(e,(e=>this.micActivityConnected(e)))}audioContextNotSupported(){this.options.micActivityMessages&&this.messages.next(new o.MicActivityNotSupportedMessage),this.messages.next(new o.VoiceActivityInputModeNotSupportedMessage),this.setVoiceInputMode(s.VoiceInputMode.PUSH_TO_TALK)}handleAppMessages(){this.messages.subscribe((e=>{switch(e.uneeqMessageType){case o.UneeqMessageType.StartedSpeaking:console.log("StartSpeaking message"),this.digitalHumanSpeaking=!0;break;case o.UneeqMessageType.FinishedSpeaking:this.digitalHumanSpeaking=!1}}))}requestNotSupportedInVoiceActivityMode(e){this.messages.next(new o.WarningMessage("Request not supported in voice activity mode: "+e))}apiStartRecording(){this.recording=!0,this.messages.next(new o.RecordingStartedMessage),this.api.avatarStartRecording().catch((()=>{this.recording=!1,this.messages.next(new o.RecordingStoppedMessage)}))}apiStopRecording(){this.recording=!1,this.api.avatarStopRecording(),this.messages.next(new o.RecordingStoppedMessage)}micActivityConnected(e){e?this.messages.next(new o.MicActivityErrorMessage(e)):this.soundMeter&&this.soundMeter.instant$.pipe((0,r.distinctUntilChanged)()).subscribe((e=>{this.handleVoiceActivity(e)}))}handleVoiceActivity(e){this.options.micActivityMessages&&this.messages.next(new o.MicActivityMessage(e)),this.options.voiceInputMode!==s.VoiceInputMode.VOICE_ACTIVITY||this.digitalHumanSpeaking&&!this.voiceActivityAllowInterruptions||(e>this.microphoneEngageVolume?(this.recording||this.apiStartRecording(),this.clearSilenceTimeout()):e<this.microphoneDisengageVolume&&this.recording&&(this.clearSilenceTimeout(),this.silenceTimeout=setTimeout((()=>{this.recording&&this.apiStopRecording()}),this.voiceActivityNotSpeakingTimeoutMS)))}clearSilenceTimeout(){this.silenceTimeout&&clearTimeout(this.silenceTimeout)}}},9824:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientPerformanceStat=void 0,t.ClientPerformanceStat=class{constructor(e="",t=0){this.label=e,this.value=t}}},8512:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DigitalHumanUnmuted=t.DigitalHumanPlayedInMutedModeSuccess=t.DigitalHumanFailedToPlay=t.DigitalHumanVideoError=t.ClientPerformanceMessage=t.ClientMediaStreamUpdateMessage=t.OnlineStatusUpdateMessage=t.SessionInfoMessage=t.AvatarRequestIgnored=t.AvatarRequestCompleted=t.SessionErrorMessage=t.WebRtcStatsMessage=t.WebRtcDataMessage=t.SessionLiveMessage=t.WarningMessage=t.RecordingStoppedMessage=t.RecordingStartedMessage=t.DevicePermissionAllowedMessage=t.AvatarTextInputFinishedMessage=t.FinishedSpeakingMessage=t.StartedSpeakingMessage=t.UserStoppedSpeakingMessage=t.UserStartedSpeakingMessage=t.SpeechTranscriptionMessage=t.AvatarQuestionMessage=t.InstructionsMessage=t.AvatarAnswerContentMessage=t.AvatarAnswerMessage=t.ResumeSessionUnavailable=t.ConnectionLostMessage=t.VoiceActivityInputModeNotSupportedMessage=t.MicActivityNotSupportedMessage=t.MicActivityMessage=t.MicActivityErrorMessage=t.ServiceUnavailableMessage=t.AvatarUnavailableMessage=t.AvatarAvailableMessage=t.SessionEndedMessage=t.SessionResumedMessage=t.SessionPausedMessage=t.DeviceListUpdatedMessage=t.DeviceErrorMessage=t.SetSpeakerSuccessMessage=t.SetMicSuccessMessage=t.SetCameraSuccessMessage=t.DeviceNotFoundErrorMessage=t.ReadyMessage=t.UneeqMessageType=void 0,function(e){e.Ready="Ready",e.DeviceNotFoundError="DeviceNotFoundError",e.SetCameraSuccess="SetCameraSuccess",e.SetMicSuccess="SetMicSuccess",e.SetSpeakerSuccess="SetSpeakerSuccess",e.SessionPaused="SessionPaused",e.SessionResumed="SessionResumed",e.SessionEnded="SessionEnded",e.AvatarAvailable="AvatarAvailable",e.AvatarUnavailable="AvatarUnavailable",e.ConnectionLost="ConnectionLost",e.ResumeSessionUnavailable="ResumeSessionUnavailable",e.ServiceUnavailable="ServiceUnavailable",e.OnlineStatusUpdate="OnlineStatusUpdate",e.MicActivityNotSupported="MicActivityNotSupported",e.VoiceActivityInputModeNotSupported="VoiceActivityInputModeNotSupported",e.MicActivityError="MicActivityError",e.MicActivity="MicActivity",e.DeviceError="DeviceError",e.DeviceListUpdated="DeviceListUpdated",e.AvatarAnswer="AvatarAnswer",e.AvatarAnswerContent="AvatarAnswerContent",e.Instructions="Instructions",e.StartedSpeaking="StartedSpeaking",e.FinishedSpeaking="FinishedSpeaking",e.AvatarTextInputFinished="AvatarTextInputFinished",e.AvatarQuestionText="AvatarQuestionText",e.SpeechTranscription="SpeechTranscription",e.UserStartedSpeaking="UserStartedSpeaking",e.UserStoppedSpeaking="UserStoppedSpeaking",e.DevicePermissionAllowed="DevicePermissionAllowed",e.RecordingStarted="RecordingStarted",e.RecordingStopped="RecordingStopped",e.Warning="Warning",e.SessionLive="SessionLive",e.WebRtcData="WebRtcData",e.WebRtcStats="WebRtcStats",e.SessionError="SessionError",e.SessionInfo="SessionInfo",e.AvatarRequestCompleted="AvatarRequestCompleted",e.AvatarRequestIgnored="AvatarRequestIgnored",e.ClientMediaStreamUpdate="ClientMediaStreamUpdate",e.ClientPerformanceMessage="ClientPerformanceMessage",e.DigitalHumanVideoError="DigitalHumanVideoError",e.DigitalHumanFailedToPlay="DigitalHumanFailedToPlay",e.DigitalHumanPlayedInMutedModeSuccess="DigitalHumanPlayedInMutedModeSuccess",e.DigitalHumanUnmuted="DigitalHumanUnmuted"}(n||(t.UneeqMessageType=n={})),t.ReadyMessage=class{constructor(){this.uneeqMessageType=n.Ready}},t.DeviceNotFoundErrorMessage=class{constructor(e,t){this.msg=e,this.deviceId=t,this.uneeqMessageType=n.DeviceNotFoundError}},t.SetCameraSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=n.SetCameraSuccess}},t.SetMicSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=n.SetMicSuccess}},t.SetSpeakerSuccessMessage=class{constructor(e){this.deviceId=e,this.uneeqMessageType=n.SetSpeakerSuccess}},t.DeviceErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=n.DeviceError}},t.DeviceListUpdatedMessage=class{constructor(e){this.devices=e,this.uneeqMessageType=n.DeviceListUpdated}},t.SessionPausedMessage=class{constructor(){this.uneeqMessageType=n.SessionPaused}},t.SessionResumedMessage=class{constructor(){this.uneeqMessageType=n.SessionResumed}},t.SessionEndedMessage=class{constructor(){this.uneeqMessageType=n.SessionEnded}},t.AvatarAvailableMessage=class{constructor(){this.uneeqMessageType=n.AvatarAvailable}},t.AvatarUnavailableMessage=class{constructor(){this.uneeqMessageType=n.AvatarUnavailable}},t.ServiceUnavailableMessage=class{constructor(e){this.error=e,this.uneeqMessageType=n.ServiceUnavailable}},t.MicActivityErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=n.MicActivityError}},t.MicActivityMessage=class{constructor(e){this.level=e,this.uneeqMessageType=n.MicActivity}},t.MicActivityNotSupportedMessage=class{constructor(){this.uneeqMessageType=n.MicActivityNotSupported}},t.VoiceActivityInputModeNotSupportedMessage=class{constructor(){this.uneeqMessageType=n.VoiceActivityInputModeNotSupported}},t.ConnectionLostMessage=class{constructor(e){this.connectionState=e,this.uneeqMessageType=n.ConnectionLost}},t.ResumeSessionUnavailable=class{constructor(){this.uneeqMessageType=n.ResumeSessionUnavailable}},t.AvatarAnswerMessage=class{constructor(e,t,r,i){this.answer=e,this.answerAvatar=t,this.answerSpeech=r,this.transcriptId=i,this.uneeqMessageType=n.AvatarAnswer}},t.AvatarAnswerContentMessage=class{constructor(e,t,r=!1){this.content=e,this.transcriptId=t,this.hasDisplayHtml=r,this.uneeqMessageType=n.AvatarAnswerContent}},t.InstructionsMessage=class{constructor(e){this.instructions=e,this.uneeqMessageType=n.Instructions}},t.AvatarQuestionMessage=class{constructor(e,t){this.question=e,this.transcriptId=t,this.uneeqMessageType=n.AvatarQuestionText}},t.SpeechTranscriptionMessage=class{constructor(e){this.speechTranscription=e,this.uneeqMessageType=n.SpeechTranscription}},t.UserStartedSpeakingMessage=class{constructor(){this.uneeqMessageType=n.UserStartedSpeaking}},t.UserStoppedSpeakingMessage=class{constructor(){this.uneeqMessageType=n.UserStoppedSpeaking}},t.StartedSpeakingMessage=class{constructor(){this.uneeqMessageType=n.StartedSpeaking}},t.FinishedSpeakingMessage=class{constructor(){this.uneeqMessageType=n.FinishedSpeaking}},t.AvatarTextInputFinishedMessage=class{constructor(){this.uneeqMessageType=n.AvatarTextInputFinished}},t.DevicePermissionAllowedMessage=class{constructor(){this.uneeqMessageType=n.DevicePermissionAllowed}},t.RecordingStartedMessage=class{constructor(){this.uneeqMessageType=n.RecordingStarted}},t.RecordingStoppedMessage=class{constructor(){this.uneeqMessageType=n.RecordingStopped}},t.WarningMessage=class{constructor(e){this.msg=e,this.uneeqMessageType=n.Warning}},t.SessionLiveMessage=class{constructor(e,t){this.showLogo=e,this.sessionResumed=t,this.uneeqMessageType=n.SessionLive}},t.WebRtcDataMessage=class{constructor(e){this.data=e,this.uneeqMessageType=n.WebRtcData}},t.WebRtcStatsMessage=class{constructor(e){this.stats=e,this.uneeqMessageType=n.WebRtcStats}},t.SessionErrorMessage=class{constructor(e){this.error=e,this.uneeqMessageType=n.SessionError}},t.AvatarRequestCompleted=class{constructor(e){this.reason=e,this.uneeqMessageType=n.AvatarRequestCompleted}},t.AvatarRequestIgnored=class{constructor(e){this.reason=e,this.uneeqMessageType=n.AvatarRequestIgnored}},t.SessionInfoMessage=class{constructor(e){this.info=e,this.uneeqMessageType=n.SessionInfo}},t.OnlineStatusUpdateMessage=class{constructor(e){this.online=e,this.uneeqMessageType=n.OnlineStatusUpdate}},t.ClientMediaStreamUpdateMessage=class{constructor(e,t,r,i){this.clientStreamingAudio=e,this.clientStreamingVideo=t,this.serverStreamingAudio=r,this.serverStreamingVideo=i,this.uneeqMessageType=n.ClientMediaStreamUpdate}},t.ClientPerformanceMessage=class{constructor(e){this.clientPerformance=e,this.uneeqMessageType=n.ClientPerformanceMessage}},t.DigitalHumanVideoError=class{constructor(e){this.error=e,this.uneeqMessageType=n.DigitalHumanVideoError}},t.DigitalHumanFailedToPlay=class{constructor(){this.uneeqMessageType=n.DigitalHumanFailedToPlay,this.msg="Digital Human failed to play with sound. This most likely occurred because the user has not yet interacted with the page and was blocked due to the browser's autoplay policy. Video will automatically be muted and attempted to be played again."}},t.DigitalHumanPlayedInMutedModeSuccess=class{constructor(){this.uneeqMessageType=n.DigitalHumanPlayedInMutedModeSuccess,this.msg="Digital Human was successfully played in muted mode. After the user interacts with the page you will need to call unmuteDigitalHuman() to unmute the video."}},t.DigitalHumanUnmuted=class{constructor(){this.uneeqMessageType=n.DigitalHumanUnmuted}}},7636:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SessionType=void 0,function(e){e[e.WEB=0]="WEB"}(n||(t.SessionType=n={}))},7563:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PublishSubscribeState=void 0,function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.FAILED="FAILED"}(n||(t.PublishSubscribeState=n={}))},9794:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SourceApp=void 0,function(e){e.HOSTED_EXPERIENCE="HOSTED_EXPERIENCE",e.SHOWCASE="SHOWCASE",e.SPLIT_SCREEN="SPLIT_SCREEN",e.INTERACTIONS="INTERACTIONS",e.UNKNOWN="UNKNOWN"}(n||(t.SourceApp=n={}))},4542:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechRecognitionMessageAction=void 0,function(e){e.startTranscription="startTranscription",e.stopTranscription="stopTranscription"}(n||(t.SpeechRecognitionMessageAction=n={}))},608:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInputMode=void 0,function(e){e.PUSH_TO_TALK="PUSH_TO_TALK",e.VOICE_ACTIVITY="VOICE_ACTIVITY",e.SPEECH_RECOGNITION="SPEECH_RECOGNITION"}(n||(t.VoiceInputMode=n={}))},6123:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Uneeq=void 0;const o=n(2872),s=n(4857),a=i(n(4147)),u=n(1181),c=n(1546),l=n(6886),d=n(7789),f=n(7501),h=n(4887),p=n(8957),g=n(2694),m=n(6400),b=n(4050),y=n(8591),v=n(4162),_=n(1116),w=n(39),x=n(4333),T=n(8512),S=n(7636),O=n(7563),E=n(9794),P=n(608);t.Uneeq=class{get sessionId(){return this.session?this.session.id:null}constructor(e){this.ready=new o.BehaviorSubject(!1),this.version=a.default.version,this.messages=new o.Subject,this.internalMessages$=new o.Subject,this.sessionPaused=!1,this.sessionStarted=!1,this.unavailableAvatarMsgSent=!1,this.sessionWasResumed=!1,this.uneeqLocalStorage=new w.UneeqLocalStorage,f.logger.enabled=e.logging||!1,this.options=e,this.options.diagnostics=e.diagnostics||!1,this.options.micActivityMessages=e.micActivityMessages||!1,this.options.sendLocalVideo=void 0===e.sendLocalVideo||e.sendLocalVideo,this.options.sendLocalAudio=void 0===e.sendLocalAudio||e.sendLocalAudio,this.options.enableClientPerformanceMessage=e.enableClientPerformanceMessage||!1,this.options.enableTransparentBackground=e.enableTransparentBackground||!1,this.options.backgroundImageUrl=e.backgroundImageUrl||"",this.options.nameTagImageUrl=e.nameTagImageUrl||"",this.options.speechToTextLocales=d.LocaleDetector.validateOrDetectSpeechLocales(e),this.checkIfResumeSessionIsAvailable(),this.options.voiceInputMode=e.voiceInputMode||P.VoiceInputMode.PUSH_TO_TALK,this.api=new u.API(this.options.url,this.options.apiKey),this.messageCallback=this.options.messageHandler||(()=>{}),this.checkWebRTCSupport(),this.startSessionData={workspaceName:this.options.conversationId,sessionType:S.SessionType.WEB,sdkVersion:this.version,clientWidth:window.screen.availWidth,clientHeight:window.screen.availHeight},this.options.customData&&(this.startSessionData.customData=this.options.customData),f.logger.log(`Uneeq Created (version ${this.version})`),this.streamManager=new _.StreamManager,this.initDigitalHumanVideoElement(),this.metricsService=new g.MetricsService(this.options,this.internalMessages$,this.messages),this.dhVideoPlayManager=new l.DigitalHumanVideoPlayManager(this.messages,(()=>{this.unmuteDigitalHuman()}))}setLoggerEnabled(e){f.logger.enabled=e}init(){this.startSessionTime=Date.now(),this.api.startSession(this.startSessionData).then((e=>{this.session=e,this.initialize()})).catch((e=>{this.sendServiceUnavailableMessage(e)}))}initWithToken(e){return r(this,void 0,void 0,(function*(){this.startSessionTime=Date.now();try{const t=y.ResumeSessionCheck.validate(this.options);!0===t.resumeSession&&(this.startSessionData.resumeSessionId=t.resumeSessionId),this.startSessionData.tokenId=e,this.session=yield this.api.startSessionWithToken(this.startSessionData),console.log("UneeQ Session ID: "+this.session.id),this.session.id===this.startSessionData.resumeSessionId?(f.logger.log("UneeQ: Session was resumed."),this.sessionWasResumed=!0):f.logger.log("UneeQ: Session was not resumed."),this.uneeqLocalStorage.setItemSafely("uneeqResumeSessionId",this.session.id),this.uneeqLocalStorage.setItemSafely("uneeqResumeSessionPersonaId",this.options.conversationId),this.session.sourceApp=E.SourceApp[this.session.sourceApp?this.session.sourceApp:""]?this.session.sourceApp:E.SourceApp.UNKNOWN,this.initialize()}catch(e){this.sendServiceUnavailableMessage(e)}}))}setCamera(e){this.serviceReadyCheck("setCamera")&&this.deviceManager.setCamDevice(e)}setMic(e){this.serviceReadyCheck("setMic")&&this.deviceManager.setMicDevice(e)}setSpeaker(e){this.serviceReadyCheck("setSpeaker")&&this.deviceManager.setAvatarSpeakerDevice(e)}setVoiceInputMode(e){this.serviceReadyCheck("setVoiceInputMode")&&this.voiceInputManager.setVoiceInputMode(e)}enableMicrophone(e=!0){this.deviceManager&&this.deviceManager.enableLocalDevices(this.options.sendLocalVideo,e)}enableCamera(e=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(e,this.options.sendLocalAudio)}enableMicrophoneAndCamera(e=!0){this.serviceReadyCheck("enableMicrohpone")&&this.deviceManager.enableLocalDevices(e,e)}sendTranscript(e){this.serviceReadyCheck("sendTranscript")&&(this.sessionPaused?this.messages.next(new T.WarningMessage("Call to sendTranscript() will be ignored. Session is paused.")):this.api.avatarAsk(e))}getServerStats(){this.deviceManager&&this.deviceManager.mediaHandler&&this.deviceManager.mediaHandler.sendDataMessage("stats")}startRecording(){this.serviceReadyCheck("startRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new T.WarningMessage("Call to startRecording() will be ignored. Session is paused.")):this.voiceInputManager.startRecording())}stopRecording(){this.serviceReadyCheck("stopRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new T.WarningMessage("Call to stopRecording() will be ignored. Session is paused.")):this.voiceInputManager.stopRecording())}stopSpeaking(){return this.api.avatarStopSpeaking()}pauseSession(){return!!this.serviceReadyCheck("pauseSession")&&(this.sessionPaused?(this.messages.next(new T.WarningMessage("Call to pauseSession() will be ignored. Session is paused.")),!1):(this.sessionPaused=!0,this.deviceManager.mediaHandler.pause(),this.messages.next(new T.SessionPausedMessage),!0))}resumeSession(){return!!this.serviceReadyCheck("resumeSession")&&(this.sessionPaused?(this.sessionPaused=!1,this.deviceManager.mediaHandler.resume(),this.messages.next(new T.SessionResumedMessage),!0):(this.messages.next(new T.WarningMessage("Call to resumeSession() will be ignored. Session is unpaused.")),!1))}endSession(){this.serviceReadyCheck("endSession")&&(this.api.endCall(),this.internalMessages$.next({faceMeMessageType:"sessionEnd"}))}setAvatarDebug(e){return this.api.setAvatarDebug(e)}playWelcomeMessage(){return this.api.avatarWelcome()}unmuteDigitalHuman(){this.voiceInputManager.resumeAudioContext(),this.dhVideoPlayManager.unmuteVideo()}initDigitalHumanVideoElement(){const e=document.createElement("video");this.digitalHumanVideoElement=e,e.volume=1,e.controls=!1,e.autoplay=!1,e.setAttribute("playsinline","true"),e.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),e.play().catch((e=>{f.logger.log("UneeQ: Failed to play digital human video. Play() will be re-attempted when stream is ready.",e)}))}gatherWebRtcMetrics(){var e;null===(e=this.deviceManager)||void 0===e||e.mediaHandler.gatherWebRTCStats(((e,t)=>{this.metricsService.parseAndLogWebRtcStats(t)})),setTimeout((()=>{this.gatherWebRtcMetrics()}),5e3)}initMessaging(){this.messages.subscribe((e=>this.messageCallback(e))),this.messaging.state$.pipe((0,s.filter)((e=>e===p.MessagingState.CONNECTED))).subscribe((()=>{this.messaging.getTopic("/topic/avatar/"+this.session.streamId),this.ready.next(!0),this.messages.next(new T.ReadyMessage),this.gatherWebRtcMetrics()})),this.messaging.messages$.subscribe((e=>this.internalMessages$.next(JSON.parse(e.body)))),this.messageHandler=new h.MessageHandler(this.internalMessages$,this.messages),this.messaging.connect(),this.messaging.messages$.subscribe((e=>{f.logger.log("-- Msg -- ",e)}))}initDeviceManager(){this.options.voiceInputMode===P.VoiceInputMode.SPEECH_RECOGNITION?this.speechHandler=new v.SpeechHandler({api:this.api,apiUrl:this.options.url,sessionId:this.session.id,messages:this.messages,assetBasePath:this.options.assetBasePath,locales:this.options.speechToTextLocales||"",hintPhrases:this.options.speechRecognitionHintPhrases||""}):this.voiceInputManager=new x.VoiceInputManager(this.options,this.api,this.messages,(e=>{this.enableMicrophone(e)})),this.deviceManager=new c.DeviceManager({userMessages:this.messages,session:this.session,messages:this.messages,internalMessages$:this.internalMessages$,messaging:this.messaging,uneeqOptions:this.options,streamManager:this.streamManager,voiceInputManager:this.voiceInputManager,digitalHumanVideoElement:this.digitalHumanVideoElement},this.api),this.messageHandler.setDeviceManager(this.deviceManager)}sessionLiveHandler(){if(!this.sessionStarted){this.messages.next(new T.SessionLiveMessage(this.session.showUneeqLogo||!1,this.sessionWasResumed)),this.options.playWelcome&&this.api.avatarWelcome();const e={type:b.PromMessageType.SessionStart,value:(Date.now()-this.startSessionTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.sessionStarted=!0}}initAvatar(){this.ready.pipe((0,s.filter)(Boolean),(0,s.take)(1)).subscribe((()=>{this.internalMessages$.pipe((0,s.filter)((e=>"DevicePermissionAllowedInternal"===e.faceMeMessageType)),(0,s.take)(1)).subscribe((e=>{this.messages.next(new T.DevicePermissionAllowedMessage),this.startAvatarWhenAvailable()})),this.initDeviceManager()})),this.internalMessages$.pipe((0,s.filter)((e=>"sessionLive"===e.faceMeMessageType)),(0,s.take)(1)).subscribe((e=>this.sessionLiveHandler())),this.internalMessages$.pipe((0,s.filter)((e=>"sessionEnd"===e.faceMeMessageType))).subscribe((()=>{this.deviceManager.mediaHandler.endSession(),this.messages.next(new T.SessionEndedMessage),this.messaging.disconnect()})),this.internalMessages$.pipe((0,s.filter)((e=>"remoteVideoReadyToPlay"===e.faceMeMessageType))).subscribe((e=>{this.dhVideoPlayManager.play(this.deviceManager.mediaHandler.avatarVideoElement)}))}startAvatarWhenAvailable(){this.availableResponseTime=Date.now(),this.api.getAvailableAvatarCount().then((e=>{if(e.available>0){const e={type:b.PromMessageType.AvailabilityCheck,value:(Date.now()-this.availableResponseTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new T.AvatarAvailableMessage),this.api.avatarStart({enableTransparentBackground:this.options.enableTransparentBackground,resumeSession:this.sessionWasResumed,backgroundImageUrl:this.options.backgroundImageUrl,nameTagImageUrl:this.options.nameTagImageUrl,speechToTextLocales:this.options.speechToTextLocales}).catch((e=>{console.error("UneeQ: Digital human could not be started. Clearing resumeSession token and ending process.",e),this.uneeqLocalStorage.removeItemSafely("uneeqResumeSessionId")}))}else this.unavailableAvatarMsgSent||(this.unavailableAvatarMsgSent=!0,this.messages.next(new T.AvatarUnavailableMessage)),setTimeout((()=>{this.startAvatarWhenAvailable()}),1e3)}))}initialize(){if(this.session){this.initPromMetricsListener(),this.api.callId=this.session.id,this.initAvatar();const e={maxReconnectAttempts:3,reconnectTime:3e3,maxReconnectLimitReached:()=>{this.messages.next(new T.ConnectionLostMessage(O.PublishSubscribeState.DISCONNECTED)),this.endSession()},connectionHeaders:{"x-auth-token":this.api.authToken}};this.messaging=new p.MessagingService(this.options.url+"/api/messaging",e),this.initMessaging(),this.initOnlineStatusUpdateMessages()}}sendServiceUnavailableMessage(e){const t=new T.ServiceUnavailableMessage(e);this.messages.next(t),this.messageCallback(t)}serviceReadyCheck(e){return!!this.ready.value||(this.messages.next(new T.WarningMessage("Call to "+e+" ignored. Service Not Ready")),!1)}checkWebRTCSupport(){navigator.mediaDevices.getUserMedia||this.sendServiceUnavailableMessage("Error: WEBRTC NOT SUPPORTED")}initOnlineStatusUpdateMessages(){new m.OnlineStatusService(this.messages,(()=>{this.messages.next(new T.ConnectionLostMessage(O.PublishSubscribeState.DISCONNECTED)),this.endSession()}))}initPromMetricsListener(){const e=new b.Prom(this.options.url);this.internalMessages$.pipe((0,s.filter)((e=>"prom"===e.faceMeMessageType))).subscribe((t=>{e.handleMessage(t.promMsg)}))}checkIfResumeSessionIsAvailable(){!0!==this.options.resumeSession||this.uneeqLocalStorage.available||(console.warn("UneeQ: Resuming session is unavailable in this browser because localStorage is not allowed."),this.messages.next(new T.ResumeSessionUnavailable),this.options.resumeSession=!1)}}},4927:(e,t,n)=>{function r(e){try{if(!n.g.localStorage)return!1}catch(e){return!1}var t=n.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}},835:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>ce});var r={};n.r(r),n.d(r,{fixNegotiationNeeded:()=>I,shimAddTrackRemoveTrack:()=>A,shimAddTrackRemoveTrackWithNative:()=>P,shimGetDisplayMedia:()=>w,shimGetSendersWithDtmf:()=>S,shimGetStats:()=>O,shimGetUserMedia:()=>_,shimMediaStream:()=>x,shimOnTrack:()=>T,shimPeerConnection:()=>C,shimSenderReceiverGetStats:()=>E});var i={};n.r(i),n.d(i,{shimAddTransceiver:()=>F,shimCreateAnswer:()=>V,shimCreateOffer:()=>B,shimGetDisplayMedia:()=>M,shimGetParameters:()=>U,shimGetUserMedia:()=>R,shimOnTrack:()=>k,shimPeerConnection:()=>D,shimRTCDataChannel:()=>L,shimReceiverGetStats:()=>$,shimRemoveStream:()=>N,shimSenderGetStats:()=>j});var o={};n.r(o),n.d(o,{shimAudioContext:()=>J,shimCallbacksAPI:()=>G,shimConstraints:()=>q,shimCreateOfferLegacy:()=>X,shimGetUserMedia:()=>H,shimLocalStreamsAPI:()=>z,shimRTCIceServerUrls:()=>K,shimRemoteStreamsAPI:()=>W,shimTrackEventTransceiver:()=>Y});var s={};n.r(s),n.d(s,{removeExtmapAllowMixed:()=>oe,shimAddIceCandidateNullOrEmpty:()=>se,shimConnectionState:()=>ie,shimMaxMessageSize:()=>ne,shimParameterlessSetLocalDescription:()=>ae,shimRTCIceCandidate:()=>ee,shimRTCIceCandidateRelayProtocol:()=>te,shimSendThrowTypeError:()=>re});let a=!0,u=!0;function c(e,t,n){const r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}function l(e,t,n){if(!e.RTCPeerConnection)return;const r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,o),i.apply(this,[e,o])};const o=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(n))return o.apply(this,arguments);const r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function d(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(a=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function f(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(u=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function h(){if("object"==typeof window){if(a)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function p(e,t){u&&console.warn(e+" is deprecated, please use "+t+" instead.")}function g(e){return"[object Object]"===Object.prototype.toString.call(e)}function m(e){return g(e)?Object.keys(e).reduce((function(t,n){const r=g(e[n]),i=r?m(e[n]):e[n],o=r&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[n]:i})}),{}):e}function b(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((r=>{r.endsWith("Id")?b(e,e.get(t[r]),n):r.endsWith("Ids")&&t[r].forEach((t=>{b(e,e.get(t),n)}))})))}function y(e,t,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((t=>{e.forEach((n=>{n.type===r&&n.trackId===t.id&&b(e,n,i)}))})),i}const v=h;function _(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const r=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];let e={};"number"==typeof r.ideal?(e[i("min",n)]=r.ideal,t.optional.push(e),e={},e[i("max",n)]=r.ideal,t.optional.push(e)):(e[i("",n)]=r.ideal,t.optional.push(e))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",n)]=r.exact):["min","max"].forEach((e=>{void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=r(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const s=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||s)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then((n=>{let s=(n=n.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!s&&n.length&&t.includes("back")&&(s=n[n.length-1]),s&&(e.video.deviceId=o.exact?{exact:s.deviceId}:{ideal:s.deviceId}),e.video=r(e.video),v("chrome: "+JSON.stringify(e)),i(e)}))}e.video=r(e.video)}return v("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(e,t,r){i(e,(e=>{n.webkitGetUserMedia(e,t,(e=>{r&&r(o(e))}))}))}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return i(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(o(e))))))}}}function w(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((t=>{const r=n.video&&n.video.width,i=n.video&&n.video.height,o=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function x(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function T(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.track.id)):{track:n.track};const i=new Event("track");i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)})),t.stream.getTracks().forEach((n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.id)):{track:n};const i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else l(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function S(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function O(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,r]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const i=function(e){const t={};return e.result().forEach((e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{n[t]=e.stat(t)})),t[n.id]=n})),t},o=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const r=function(e){n(o(i(e)))};return t.apply(this,[r,e])}return new Promise(((e,n)=>{t.apply(this,[function(t){e(o(i(t)))},n])})).then(n,r)}}function E(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>y(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),l(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>y(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,r;return this.getSenders().forEach((n=>{n.track===e&&(t?r=!0:t=n)})),this.getReceivers().forEach((t=>(t.track===e&&(n?r=!0:n=t),t.track===e))),r||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function P(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();n.apply(this,arguments);const r=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(r)};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),i.apply(this,arguments)}}function A(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return P(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const r=[].slice.call(arguments,1);if(1!==r.length||!r[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((e=>e.track===t)))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[n.id];if(i)i.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=o(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then((e=>o(this,e)))}};e.RTCPeerConnection.prototype[t]=r[t]}));const s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const a=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=a.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((n=>{this._streams[n].getTracks().find((t=>e.track===t))&&(t=this._streams[n])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function C(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}))}function I(e,t){l(e,"negotiationneeded",(e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e}))}function R(e,t){const n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){p("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},r&&r.prototype.getSettings){const t=r.prototype.getSettings;r.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const t=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function M(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}function k(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function D(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,o]=arguments;return r.apply(this,[e||null]).then((e=>{if(t.version<53&&!i)try{e.forEach((e=>{e.type=n[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(i,o)}}function j(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function $(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),l(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function N(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){p("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function L(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function F(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const n=e.length>0;n&&e.forEach((e=>{if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const r=t.apply(this,arguments);if(n){const{sender:t}=r,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return r})}function U(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function B(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function V(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function z(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((n=>t.call(this,n,e))),e.getVideoTracks().forEach((n=>t.call(this,n,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach((e=>{n.includes(e.track)&&this.removeTrack(e)}))})}}function W(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}))}),t.apply(e,arguments)}}}function G(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};let a=function(e,t,n){const r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=a,a=function(e,t,n){const r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=a,a=function(e,t,n){const r=s.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=a}function H(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(q(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function q(e){return e&&void 0!==e.video?Object.assign({},e,{video:m(e.video)}):e}function K(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;n<e.iceServers.length;n++){let r=e.iceServers[n];void 0===r.urls&&r.url?(p("RTCIceServer.url","RTCIceServer.urls"),r=JSON.parse(JSON.stringify(r)),r.urls=r.url,delete r.url,t.push(r)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function Y(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function X(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function J(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Z=n(7539),Q=n.n(Z);function ee(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substring(2)),e.candidate&&e.candidate.length){const n=new t(e),r=Q().parseCandidate(e.candidate);for(const e in r)e in n||Object.defineProperty(n,e,{value:r[e]});return n.toJSON=function(){return{candidate:n.candidate,sdpMid:n.sdpMid,sdpMLineIndex:n.sdpMLineIndex,usernameFragment:n.usernameFragment}},n}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,l(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function te(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||l(e,"icecandidate",(e=>{if(e.candidate){const t=Q().parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function ne(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(function(e){if(!e||!e.sdp)return!1;const t=Q().splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Q().parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))}(arguments[0])){const e=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n}(arguments[0]),n=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n}(e),r=function(e,n){let r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);const i=Q().matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?r=parseInt(i[0].substring(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r}(arguments[0],e);let i;i=0===n&&0===r?Number.POSITIVE_INFINITY:0===n||0===r?Math.max(n,r):Math.min(n,r);const o={};Object.defineProperty(o,"maxMessageSize",{get:()=>i}),this._sctp=o}return n.apply(this,arguments)}}function re(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},l(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function ie(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}function oe(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function se(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ae(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}return e.sdp||"offer"!==e.type&&"answer"!==e.type?n.apply(this,[e]):("offer"===e.type?this.createOffer:this.createAnswer).apply(this).then((e=>n.apply(this,[e])))})}const ue=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=h,a=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator||!e.navigator.userAgent)return t.browser="Not a browser.",t;const{navigator:n}=e;if(n.mozGetUserMedia)t.browser="firefox",t.version=c(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=c(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=c(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),u={browserDetails:a,commonShim:s,extractVersion:c,disableLog:d,disableWarnings:f,sdp:Z};switch(a.browser){case"chrome":if(!r||!C||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),u;if(null===a.version)return n("Chrome shim can not determine version, not shimming."),u;n("adapter.js shimming chrome."),u.browserShim=r,se(e,a),ae(e),_(e,a),x(e),C(e,a),T(e),A(e,a),S(e),O(e),E(e),I(e,a),ee(e),te(e),ie(e),ne(e,a),re(e),oe(e,a);break;case"firefox":if(!i||!D||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),u;n("adapter.js shimming firefox."),u.browserShim=i,se(e,a),ae(e),R(e,a),D(e,a),k(e),N(e),j(e),$(e),L(e),F(e),U(e),B(e),V(e),ee(e),ie(e),ne(e,a),re(e);break;case"safari":if(!o||!t.shimSafari)return n("Safari shim is not included in this adapter release."),u;n("adapter.js shimming safari."),u.browserShim=o,se(e,a),ae(e),K(e),X(e),G(e),z(e),W(e),Y(e),H(e),J(e),ee(e),te(e),ne(e,a),re(e),oe(e,a);break;default:n("Unsupported browser!")}return u}({window:"undefined"==typeof window?void 0:window}),ce=ue},2361:()=>{},4616:()=>{},4147:e=>{"use strict";e.exports=JSON.parse('{"name":"uneeq-js","version":"2.47.1","description":"","main":"dist/index.js","types":"dist/src/index.d.ts","scripts":{"start":"npx webpack -w","test-local":"npx karma start karma.conf.js -logLevel=DEBUG","test":"npx karma start --browsers ChromeHeadless --single-run","test:windows":"karma start karma.conf.js","build":"webpack --config webpack.config.prod.js && webpack --config webpack.config.umd.js","lint":"npx tslint -p tsconfig.json --fix","docs":"npx typedoc --options"},"files":["dist","!dist/test"],"author":"","license":"ISC","dependencies":{"@stomp/stompjs":"^6.0.0","@uehreka/seriously":"^1.0.1","crossoriginworker":"^1.1.0","fast-text-encoding":"^1.0.0","intrinsic-scale":"^3.0.4","onnxruntime-web":"^1.15.1","opus-media-recorder":"^0.8.0","promjs":"^0.4.1","ring-buffer-ts":"^1.2.0","rxjs":"^7.8.1","rxjs-compat":"^6.6.7","simple-peer":"^9.11.1","webrtc-adapter":"^8.2.3"},"devDependencies":{"@types/dom-mediacapture-record":"^1.0.16","@types/jasmine":"^2.8.8","@types/node":"^10.9.4","fetch-mock":"7.7.3","ignore-styles":"^5.0.1","jasmine":"^5.1.0","jasmine-core":"^5.1.0","karma":"^6.4.2","karma-chrome-launcher":"^3.2.0","karma-firefox-launcher":"^2.1.2","karma-jasmine":"^5.1.0","karma-jasmine-html-reporter":"^2.1.0","karma-requirejs":"^1.1.0","karma-typescript":"^5.5.4","karma-typescript-es6-transform":"^5.5.4","nock":"^9.6.1","requirejs":"^2.3.6","ts-loader":"^9.4.4","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-no-focused-test":"^0.5.0","typedoc":"^0.18.0","typescript":"^5.1.6","webpack":"^5.88.2","webpack-cli":"^5.1.4"}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__=__webpack_require__(3607),__webpack_export_target__=exports;for(var i in __webpack_exports__)__webpack_export_target__[i]=__webpack_exports__[i];__webpack_exports__.__esModule&&Object.defineProperty(__webpack_export_target__,"__esModule",{value:!0})})();
|