@dcl/explorer-website 0.1.0-7490119007.commit-67a411a → 2.0.1-7491674013.commit-f0a92ff

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.
@@ -1,4 +1,4 @@
1
- import{e as eventsExports,b as browser$1,_ as __extends$1,g as getAugmentedNamespace,s as sideChannel,c as commonjsGlobal,a as bnExports,B as Buffer,r as require$$0$1,i as inherits_browserExports,d as require$$0$2,f as getDefaultExportFromCjs}from"./index-2E6WC6Jb.js";function _mergeNamespaces(D,E){for(var W=0;W<E.length;W++){const U=E[W];if(typeof U!="string"&&!Array.isArray(U)){for(const Q in U)if(Q!=="default"&&!(Q in D)){const G=Object.getOwnPropertyDescriptor(U,Q);G&&Object.defineProperty(D,Q,G.get?G:{enumerable:!0,get:()=>U[Q]})}}}return Object.freeze(Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}))}var dist$3={},CoinbaseWalletSDK$1={},ScopedLocalStorage$1={};Object.defineProperty(ScopedLocalStorage$1,"__esModule",{value:!0});ScopedLocalStorage$1.ScopedLocalStorage=void 0;class ScopedLocalStorage{constructor(E){this.scope=E}setItem(E,W){localStorage.setItem(this.scopedKey(E),W)}getItem(E){return localStorage.getItem(this.scopedKey(E))}removeItem(E){localStorage.removeItem(this.scopedKey(E))}clear(){const E=this.scopedKey(""),W=[];for(let U=0;U<localStorage.length;U++){const Q=localStorage.key(U);typeof Q=="string"&&Q.startsWith(E)&&W.push(Q)}W.forEach(U=>localStorage.removeItem(U))}scopedKey(E){return`${this.scope}:${E}`}}ScopedLocalStorage$1.ScopedLocalStorage=ScopedLocalStorage;var CoinbaseWalletProvider$1={},safeEventEmitter$1={};Object.defineProperty(safeEventEmitter$1,"__esModule",{value:!0});const events_1=eventsExports;function safeApply$1(D,E,W){try{Reflect.apply(D,E,W)}catch(U){setTimeout(()=>{throw U})}}function arrayClone$1(D){const E=D.length,W=new Array(E);for(let U=0;U<E;U+=1)W[U]=D[U];return W}let SafeEventEmitter$4=class extends events_1.EventEmitter{emit(E,...W){let U=E==="error";const Q=this._events;if(Q!==void 0)U=U&&Q.error===void 0;else if(!U)return!1;if(U){let J;if(W.length>0&&([J]=W),J instanceof Error)throw J;const Y=new Error(`Unhandled error.${J?` (${J.message})`:""}`);throw Y.context=J,Y}const G=Q[E];if(G===void 0)return!1;if(typeof G=="function")safeApply$1(G,this,W);else{const J=G.length,Y=arrayClone$1(G);for(let X=0;X<J;X+=1)safeApply$1(Y[X],this,W)}return!0}};safeEventEmitter$1.default=SafeEventEmitter$4;var dist$2={},classes$1={},fastSafeStringify=stringify$2;stringify$2.default=stringify$2;stringify$2.stable=deterministicStringify;stringify$2.stableStringify=deterministicStringify;var arr=[],replacerStack=[];function stringify$2(D,E,W){decirc(D,"",[],void 0);var U;try{replacerStack.length===0?U=JSON.stringify(D,E,W):U=JSON.stringify(D,replaceGetterValues(E),W)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;arr.length!==0;){var Q=arr.pop();Q.length===4?Object.defineProperty(Q[0],Q[1],Q[3]):Q[0][Q[1]]=Q[2]}}return U}function decirc(D,E,W,U){var Q;if(typeof D=="object"&&D!==null){for(Q=0;Q<W.length;Q++)if(W[Q]===D){var G=Object.getOwnPropertyDescriptor(U,E);G.get!==void 0?G.configurable?(Object.defineProperty(U,E,{value:"[Circular]"}),arr.push([U,E,D,G])):replacerStack.push([D,E]):(U[E]="[Circular]",arr.push([U,E,D]));return}if(W.push(D),Array.isArray(D))for(Q=0;Q<D.length;Q++)decirc(D[Q],Q,W,D);else{var J=Object.keys(D);for(Q=0;Q<J.length;Q++){var Y=J[Q];decirc(D[Y],Y,W,D)}}W.pop()}}function compareFunction(D,E){return D<E?-1:D>E?1:0}function deterministicStringify(D,E,W){var U=deterministicDecirc(D,"",[],void 0)||D,Q;try{replacerStack.length===0?Q=JSON.stringify(U,E,W):Q=JSON.stringify(U,replaceGetterValues(E),W)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;arr.length!==0;){var G=arr.pop();G.length===4?Object.defineProperty(G[0],G[1],G[3]):G[0][G[1]]=G[2]}}return Q}function deterministicDecirc(D,E,W,U){var Q;if(typeof D=="object"&&D!==null){for(Q=0;Q<W.length;Q++)if(W[Q]===D){var G=Object.getOwnPropertyDescriptor(U,E);G.get!==void 0?G.configurable?(Object.defineProperty(U,E,{value:"[Circular]"}),arr.push([U,E,D,G])):replacerStack.push([D,E]):(U[E]="[Circular]",arr.push([U,E,D]));return}try{if(typeof D.toJSON=="function")return}catch{return}if(W.push(D),Array.isArray(D))for(Q=0;Q<D.length;Q++)deterministicDecirc(D[Q],Q,W,D);else{var J={},Y=Object.keys(D).sort(compareFunction);for(Q=0;Q<Y.length;Q++){var X=Y[Q];deterministicDecirc(D[X],X,W,D),J[X]=D[X]}if(U!==void 0)arr.push([U,E,D]),U[E]=J;else return J}W.pop()}}function replaceGetterValues(D){return D=D!==void 0?D:function(E,W){return W},function(E,W){if(replacerStack.length>0)for(var U=0;U<replacerStack.length;U++){var Q=replacerStack[U];if(Q[1]===E&&Q[0]===W){W="[Circular]",replacerStack.splice(U,1);break}}return D.call(this,E,W)}}Object.defineProperty(classes$1,"__esModule",{value:!0});classes$1.EthereumProviderError=classes$1.EthereumRpcError=void 0;const fast_safe_stringify_1$1=fastSafeStringify;let EthereumRpcError$1=class extends Error{constructor(E,W,U){if(!Number.isInteger(E))throw new Error('"code" must be an integer.');if(!W||typeof W!="string")throw new Error('"message" must be a nonempty string.');super(W),this.code=E,U!==void 0&&(this.data=U)}serialize(){const E={code:this.code,message:this.message};return this.data!==void 0&&(E.data=this.data),this.stack&&(E.stack=this.stack),E}toString(){return fast_safe_stringify_1$1.default(this.serialize(),stringifyReplacer$1,2)}};classes$1.EthereumRpcError=EthereumRpcError$1;let EthereumProviderError$1=class extends EthereumRpcError$1{constructor(E,W,U){if(!isValidEthProviderCode$1(E))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(E,W,U)}};classes$1.EthereumProviderError=EthereumProviderError$1;function isValidEthProviderCode$1(D){return Number.isInteger(D)&&D>=1e3&&D<=4999}function stringifyReplacer$1(D,E){if(E!=="[Circular]")return E}var utils$4={},errorConstants$1={};Object.defineProperty(errorConstants$1,"__esModule",{value:!0});errorConstants$1.errorValues=errorConstants$1.errorCodes=void 0;errorConstants$1.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};errorConstants$1.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.serializeError=D.isValidCode=D.getMessageFromCode=D.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const E=errorConstants$1,W=classes$1,U=E.errorCodes.rpc.internal,Q="Unspecified error message. This is a bug, please report it.",G={code:U,message:J(U)};D.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function J(te,re=Q){if(Number.isInteger(te)){const ae=te.toString();if(oe(E.errorValues,ae))return E.errorValues[ae].message;if(Z(te))return D.JSON_RPC_SERVER_ERROR_MESSAGE}return re}D.getMessageFromCode=J;function Y(te){if(!Number.isInteger(te))return!1;const re=te.toString();return!!(E.errorValues[re]||Z(te))}D.isValidCode=Y;function X(te,{fallbackError:re=G,shouldIncludeStack:ae=!1}={}){var fe,de;if(!re||!Number.isInteger(re.code)||typeof re.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(te instanceof W.EthereumRpcError)return te.serialize();const se={};if(te&&typeof te=="object"&&!Array.isArray(te)&&oe(te,"code")&&Y(te.code)){const ce=te;se.code=ce.code,ce.message&&typeof ce.message=="string"?(se.message=ce.message,oe(ce,"data")&&(se.data=ce.data)):(se.message=J(se.code),se.data={originalError:ee(te)})}else{se.code=re.code;const ce=(fe=te)===null||fe===void 0?void 0:fe.message;se.message=ce&&typeof ce=="string"?ce:re.message,se.data={originalError:ee(te)}}const ue=(de=te)===null||de===void 0?void 0:de.stack;return ae&&te&&ue&&typeof ue=="string"&&(se.stack=ue),se}D.serializeError=X;function Z(te){return te>=-32099&&te<=-32e3}function ee(te){return te&&typeof te=="object"&&!Array.isArray(te)?Object.assign({},te):te}function oe(te,re){return Object.prototype.hasOwnProperty.call(te,re)}})(utils$4);var errors$1={};Object.defineProperty(errors$1,"__esModule",{value:!0});errors$1.ethErrors=void 0;const classes_1$1=classes$1,utils_1$1=utils$4,error_constants_1$1=errorConstants$1;errors$1.ethErrors={rpc:{parse:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.parse,D),invalidRequest:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.invalidRequest,D),invalidParams:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.invalidParams,D),methodNotFound:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.methodNotFound,D),internal:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.internal,D),server:D=>{if(!D||typeof D!="object"||Array.isArray(D))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:E}=D;if(!Number.isInteger(E)||E>-32005||E<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return getEthJsonRpcError$1(E,D)},invalidInput:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.invalidInput,D),resourceNotFound:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.resourceNotFound,D),resourceUnavailable:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.resourceUnavailable,D),transactionRejected:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.transactionRejected,D),methodNotSupported:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.methodNotSupported,D),limitExceeded:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.limitExceeded,D)},provider:{userRejectedRequest:D=>getEthProviderError$1(error_constants_1$1.errorCodes.provider.userRejectedRequest,D),unauthorized:D=>getEthProviderError$1(error_constants_1$1.errorCodes.provider.unauthorized,D),unsupportedMethod:D=>getEthProviderError$1(error_constants_1$1.errorCodes.provider.unsupportedMethod,D),disconnected:D=>getEthProviderError$1(error_constants_1$1.errorCodes.provider.disconnected,D),chainDisconnected:D=>getEthProviderError$1(error_constants_1$1.errorCodes.provider.chainDisconnected,D),custom:D=>{if(!D||typeof D!="object"||Array.isArray(D))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:E,message:W,data:U}=D;if(!W||typeof W!="string")throw new Error('"message" must be a nonempty string');return new classes_1$1.EthereumProviderError(E,W,U)}}};function getEthJsonRpcError$1(D,E){const[W,U]=parseOpts$1(E);return new classes_1$1.EthereumRpcError(D,W||utils_1$1.getMessageFromCode(D),U)}function getEthProviderError$1(D,E){const[W,U]=parseOpts$1(E);return new classes_1$1.EthereumProviderError(D,W||utils_1$1.getMessageFromCode(D),U)}function parseOpts$1(D){if(D){if(typeof D=="string")return[D];if(typeof D=="object"&&!Array.isArray(D)){const{message:E,data:W}=D;if(E&&typeof E!="string")throw new Error("Must specify string message.");return[E||void 0,W]}}return[]}(function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.getMessageFromCode=D.serializeError=D.EthereumProviderError=D.EthereumRpcError=D.ethErrors=D.errorCodes=void 0;const E=classes$1;Object.defineProperty(D,"EthereumRpcError",{enumerable:!0,get:function(){return E.EthereumRpcError}}),Object.defineProperty(D,"EthereumProviderError",{enumerable:!0,get:function(){return E.EthereumProviderError}});const W=utils$4;Object.defineProperty(D,"serializeError",{enumerable:!0,get:function(){return W.serializeError}}),Object.defineProperty(D,"getMessageFromCode",{enumerable:!0,get:function(){return W.getMessageFromCode}});const U=errors$1;Object.defineProperty(D,"ethErrors",{enumerable:!0,get:function(){return U.ethErrors}});const Q=errorConstants$1;Object.defineProperty(D,"errorCodes",{enumerable:!0,get:function(){return Q.errorCodes}})})(dist$2);var EventListener={};Object.defineProperty(EventListener,"__esModule",{value:!0});EventListener.EVENTS=void 0;EventListener.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Session$1={},sha256={exports:{}};(function(module){(function(){var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof browser$1=="object"&&browser$1.versions&&browser$1.versions.node;NODE_JS?root=globalThis:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&!0&&module.exports,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(D){return Object.prototype.toString.call(D)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(D){return typeof D=="object"&&D.buffer&&D.buffer.constructor===ArrayBuffer});var createOutputMethod=function(D,E){return function(W){return new Sha256(E,!0).update(W)[D]()}},createMethod=function(D){var E=createOutputMethod("hex",D);NODE_JS&&(E=nodeWrap(E,D)),E.create=function(){return new Sha256(D)},E.update=function(Q){return E.create().update(Q)};for(var W=0;W<OUTPUT_TYPES.length;++W){var U=OUTPUT_TYPES[W];E[U]=createOutputMethod(U,D)}return E},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(D){if(typeof D=="string")return crypto.createHash(algorithm).update(D,"utf8").digest("hex");if(D==null)throw new Error(ERROR);return D.constructor===ArrayBuffer&&(D=new Uint8Array(D)),Array.isArray(D)||ArrayBuffer.isView(D)||D.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(D)).digest("hex"):method(D)};return nodeMethod},createHmacOutputMethod=function(D,E){return function(W,U){return new HmacSha256(W,E,!0).update(U)[D]()}},createHmacMethod=function(D){var E=createHmacOutputMethod("hex",D);E.create=function(Q){return new HmacSha256(Q,D)},E.update=function(Q,G){return E.create(Q).update(G)};for(var W=0;W<OUTPUT_TYPES.length;++W){var U=OUTPUT_TYPES[W];E[U]=createHmacOutputMethod(U,D)}return E};function Sha256(D,E){E?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],D?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=D}Sha256.prototype.update=function(D){if(!this.finalized){var E,W=typeof D;if(W!=="string"){if(W==="object"){if(D===null)throw new Error(ERROR);if(ARRAY_BUFFER&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(D)))throw new Error(ERROR)}else throw new Error(ERROR);E=!0}for(var U,Q=0,G,J=D.length,Y=this.blocks;Q<J;){if(this.hashed&&(this.hashed=!1,Y[0]=this.block,Y[16]=Y[1]=Y[2]=Y[3]=Y[4]=Y[5]=Y[6]=Y[7]=Y[8]=Y[9]=Y[10]=Y[11]=Y[12]=Y[13]=Y[14]=Y[15]=0),E)for(G=this.start;Q<J&&G<64;++Q)Y[G>>2]|=D[Q]<<SHIFT[G++&3];else for(G=this.start;Q<J&&G<64;++Q)U=D.charCodeAt(Q),U<128?Y[G>>2]|=U<<SHIFT[G++&3]:U<2048?(Y[G>>2]|=(192|U>>6)<<SHIFT[G++&3],Y[G>>2]|=(128|U&63)<<SHIFT[G++&3]):U<55296||U>=57344?(Y[G>>2]|=(224|U>>12)<<SHIFT[G++&3],Y[G>>2]|=(128|U>>6&63)<<SHIFT[G++&3],Y[G>>2]|=(128|U&63)<<SHIFT[G++&3]):(U=65536+((U&1023)<<10|D.charCodeAt(++Q)&1023),Y[G>>2]|=(240|U>>18)<<SHIFT[G++&3],Y[G>>2]|=(128|U>>12&63)<<SHIFT[G++&3],Y[G>>2]|=(128|U>>6&63)<<SHIFT[G++&3],Y[G>>2]|=(128|U&63)<<SHIFT[G++&3]);this.lastByteIndex=G,this.bytes+=G-this.start,G>=64?(this.block=Y[16],this.start=G-64,this.hash(),this.hashed=!0):this.start=G}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var D=this.blocks,E=this.lastByteIndex;D[16]=this.block,D[E>>2]|=EXTRA[E&3],this.block=D[16],E>=56&&(this.hashed||this.hash(),D[0]=this.block,D[16]=D[1]=D[2]=D[3]=D[4]=D[5]=D[6]=D[7]=D[8]=D[9]=D[10]=D[11]=D[12]=D[13]=D[14]=D[15]=0),D[14]=this.hBytes<<3|this.bytes>>>29,D[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var D=this.h0,E=this.h1,W=this.h2,U=this.h3,Q=this.h4,G=this.h5,J=this.h6,Y=this.h7,X=this.blocks,Z,ee,oe,te,re,ae,fe,de,se,ue,ce;for(Z=16;Z<64;++Z)re=X[Z-15],ee=(re>>>7|re<<25)^(re>>>18|re<<14)^re>>>3,re=X[Z-2],oe=(re>>>17|re<<15)^(re>>>19|re<<13)^re>>>10,X[Z]=X[Z-16]+ee+X[Z-7]+oe<<0;for(ce=E&W,Z=0;Z<64;Z+=4)this.first?(this.is224?(de=300032,re=X[0]-1413257819,Y=re-150054599<<0,U=re+24177077<<0):(de=704751109,re=X[0]-210244248,Y=re-1521486534<<0,U=re+143694565<<0),this.first=!1):(ee=(D>>>2|D<<30)^(D>>>13|D<<19)^(D>>>22|D<<10),oe=(Q>>>6|Q<<26)^(Q>>>11|Q<<21)^(Q>>>25|Q<<7),de=D&E,te=de^D&W^ce,fe=Q&G^~Q&J,re=Y+oe+fe+K[Z]+X[Z],ae=ee+te,Y=U+re<<0,U=re+ae<<0),ee=(U>>>2|U<<30)^(U>>>13|U<<19)^(U>>>22|U<<10),oe=(Y>>>6|Y<<26)^(Y>>>11|Y<<21)^(Y>>>25|Y<<7),se=U&D,te=se^U&E^de,fe=Y&Q^~Y&G,re=J+oe+fe+K[Z+1]+X[Z+1],ae=ee+te,J=W+re<<0,W=re+ae<<0,ee=(W>>>2|W<<30)^(W>>>13|W<<19)^(W>>>22|W<<10),oe=(J>>>6|J<<26)^(J>>>11|J<<21)^(J>>>25|J<<7),ue=W&U,te=ue^W&D^se,fe=J&Y^~J&Q,re=G+oe+fe+K[Z+2]+X[Z+2],ae=ee+te,G=E+re<<0,E=re+ae<<0,ee=(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10),oe=(G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7),ce=E&W,te=ce^E&U^ue,fe=G&J^~G&Y,re=Q+oe+fe+K[Z+3]+X[Z+3],ae=ee+te,Q=D+re<<0,D=re+ae<<0;this.h0=this.h0+D<<0,this.h1=this.h1+E<<0,this.h2=this.h2+W<<0,this.h3=this.h3+U<<0,this.h4=this.h4+Q<<0,this.h5=this.h5+G<<0,this.h6=this.h6+J<<0,this.h7=this.h7+Y<<0},Sha256.prototype.hex=function(){this.finalize();var D=this.h0,E=this.h1,W=this.h2,U=this.h3,Q=this.h4,G=this.h5,J=this.h6,Y=this.h7,X=HEX_CHARS[D>>28&15]+HEX_CHARS[D>>24&15]+HEX_CHARS[D>>20&15]+HEX_CHARS[D>>16&15]+HEX_CHARS[D>>12&15]+HEX_CHARS[D>>8&15]+HEX_CHARS[D>>4&15]+HEX_CHARS[D&15]+HEX_CHARS[E>>28&15]+HEX_CHARS[E>>24&15]+HEX_CHARS[E>>20&15]+HEX_CHARS[E>>16&15]+HEX_CHARS[E>>12&15]+HEX_CHARS[E>>8&15]+HEX_CHARS[E>>4&15]+HEX_CHARS[E&15]+HEX_CHARS[W>>28&15]+HEX_CHARS[W>>24&15]+HEX_CHARS[W>>20&15]+HEX_CHARS[W>>16&15]+HEX_CHARS[W>>12&15]+HEX_CHARS[W>>8&15]+HEX_CHARS[W>>4&15]+HEX_CHARS[W&15]+HEX_CHARS[U>>28&15]+HEX_CHARS[U>>24&15]+HEX_CHARS[U>>20&15]+HEX_CHARS[U>>16&15]+HEX_CHARS[U>>12&15]+HEX_CHARS[U>>8&15]+HEX_CHARS[U>>4&15]+HEX_CHARS[U&15]+HEX_CHARS[Q>>28&15]+HEX_CHARS[Q>>24&15]+HEX_CHARS[Q>>20&15]+HEX_CHARS[Q>>16&15]+HEX_CHARS[Q>>12&15]+HEX_CHARS[Q>>8&15]+HEX_CHARS[Q>>4&15]+HEX_CHARS[Q&15]+HEX_CHARS[G>>28&15]+HEX_CHARS[G>>24&15]+HEX_CHARS[G>>20&15]+HEX_CHARS[G>>16&15]+HEX_CHARS[G>>12&15]+HEX_CHARS[G>>8&15]+HEX_CHARS[G>>4&15]+HEX_CHARS[G&15]+HEX_CHARS[J>>28&15]+HEX_CHARS[J>>24&15]+HEX_CHARS[J>>20&15]+HEX_CHARS[J>>16&15]+HEX_CHARS[J>>12&15]+HEX_CHARS[J>>8&15]+HEX_CHARS[J>>4&15]+HEX_CHARS[J&15];return this.is224||(X+=HEX_CHARS[Y>>28&15]+HEX_CHARS[Y>>24&15]+HEX_CHARS[Y>>20&15]+HEX_CHARS[Y>>16&15]+HEX_CHARS[Y>>12&15]+HEX_CHARS[Y>>8&15]+HEX_CHARS[Y>>4&15]+HEX_CHARS[Y&15]),X},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var D=this.h0,E=this.h1,W=this.h2,U=this.h3,Q=this.h4,G=this.h5,J=this.h6,Y=this.h7,X=[D>>24&255,D>>16&255,D>>8&255,D&255,E>>24&255,E>>16&255,E>>8&255,E&255,W>>24&255,W>>16&255,W>>8&255,W&255,U>>24&255,U>>16&255,U>>8&255,U&255,Q>>24&255,Q>>16&255,Q>>8&255,Q&255,G>>24&255,G>>16&255,G>>8&255,G&255,J>>24&255,J>>16&255,J>>8&255,J&255];return this.is224||X.push(Y>>24&255,Y>>16&255,Y>>8&255,Y&255),X},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var D=new ArrayBuffer(this.is224?28:32),E=new DataView(D);return E.setUint32(0,this.h0),E.setUint32(4,this.h1),E.setUint32(8,this.h2),E.setUint32(12,this.h3),E.setUint32(16,this.h4),E.setUint32(20,this.h5),E.setUint32(24,this.h6),this.is224||E.setUint32(28,this.h7),D};function HmacSha256(D,E,W){var U,Q=typeof D;if(Q==="string"){var G=[],J=D.length,Y=0,X;for(U=0;U<J;++U)X=D.charCodeAt(U),X<128?G[Y++]=X:X<2048?(G[Y++]=192|X>>6,G[Y++]=128|X&63):X<55296||X>=57344?(G[Y++]=224|X>>12,G[Y++]=128|X>>6&63,G[Y++]=128|X&63):(X=65536+((X&1023)<<10|D.charCodeAt(++U)&1023),G[Y++]=240|X>>18,G[Y++]=128|X>>12&63,G[Y++]=128|X>>6&63,G[Y++]=128|X&63);D=G}else if(Q==="object"){if(D===null)throw new Error(ERROR);if(ARRAY_BUFFER&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(D)))throw new Error(ERROR)}else throw new Error(ERROR);D.length>64&&(D=new Sha256(E,!0).update(D).array());var Z=[],ee=[];for(U=0;U<64;++U){var oe=D[U]||0;Z[U]=92^oe,ee[U]=54^oe}Sha256.call(this,E,W),this.update(ee),this.oKeyPad=Z,this.inner=!0,this.sharedMemory=W}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var D=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(D),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)})()})(sha256);var sha256Exports=sha256.exports;function isFunction(D){return typeof D=="function"}var _enable_super_gross_mode_that_will_cause_bad_things=!1,config$1={Promise:void 0,set useDeprecatedSynchronousErrorHandling(D){if(D){var E=new Error;""+E.stack}_enable_super_gross_mode_that_will_cause_bad_things=D},get useDeprecatedSynchronousErrorHandling(){return _enable_super_gross_mode_that_will_cause_bad_things}};function hostReportError(D){setTimeout(function(){throw D},0)}var empty$1={closed:!0,next:function(D){},error:function(D){if(config$1.useDeprecatedSynchronousErrorHandling)throw D;hostReportError(D)},complete:function(){}},isArray$4=function(){return Array.isArray||function(D){return D&&typeof D.length=="number"}}();function isObject(D){return D!==null&&typeof D=="object"}var UnsubscriptionErrorImpl=function(){function D(E){return Error.call(this),this.message=E?E.length+` errors occurred during unsubscription:
1
+ import{e as eventsExports,b as browser$1,_ as __extends$1,g as getAugmentedNamespace,s as sideChannel,c as commonjsGlobal,a as bnExports,B as Buffer,r as require$$0$1,i as inherits_browserExports,d as require$$0$2,f as getDefaultExportFromCjs}from"./index-RHz4X8Iy.js";function _mergeNamespaces(D,E){for(var W=0;W<E.length;W++){const U=E[W];if(typeof U!="string"&&!Array.isArray(U)){for(const Q in U)if(Q!=="default"&&!(Q in D)){const G=Object.getOwnPropertyDescriptor(U,Q);G&&Object.defineProperty(D,Q,G.get?G:{enumerable:!0,get:()=>U[Q]})}}}return Object.freeze(Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}))}var dist$3={},CoinbaseWalletSDK$1={},ScopedLocalStorage$1={};Object.defineProperty(ScopedLocalStorage$1,"__esModule",{value:!0});ScopedLocalStorage$1.ScopedLocalStorage=void 0;class ScopedLocalStorage{constructor(E){this.scope=E}setItem(E,W){localStorage.setItem(this.scopedKey(E),W)}getItem(E){return localStorage.getItem(this.scopedKey(E))}removeItem(E){localStorage.removeItem(this.scopedKey(E))}clear(){const E=this.scopedKey(""),W=[];for(let U=0;U<localStorage.length;U++){const Q=localStorage.key(U);typeof Q=="string"&&Q.startsWith(E)&&W.push(Q)}W.forEach(U=>localStorage.removeItem(U))}scopedKey(E){return`${this.scope}:${E}`}}ScopedLocalStorage$1.ScopedLocalStorage=ScopedLocalStorage;var CoinbaseWalletProvider$1={},safeEventEmitter$1={};Object.defineProperty(safeEventEmitter$1,"__esModule",{value:!0});const events_1=eventsExports;function safeApply$1(D,E,W){try{Reflect.apply(D,E,W)}catch(U){setTimeout(()=>{throw U})}}function arrayClone$1(D){const E=D.length,W=new Array(E);for(let U=0;U<E;U+=1)W[U]=D[U];return W}let SafeEventEmitter$4=class extends events_1.EventEmitter{emit(E,...W){let U=E==="error";const Q=this._events;if(Q!==void 0)U=U&&Q.error===void 0;else if(!U)return!1;if(U){let J;if(W.length>0&&([J]=W),J instanceof Error)throw J;const Y=new Error(`Unhandled error.${J?` (${J.message})`:""}`);throw Y.context=J,Y}const G=Q[E];if(G===void 0)return!1;if(typeof G=="function")safeApply$1(G,this,W);else{const J=G.length,Y=arrayClone$1(G);for(let X=0;X<J;X+=1)safeApply$1(Y[X],this,W)}return!0}};safeEventEmitter$1.default=SafeEventEmitter$4;var dist$2={},classes$1={},fastSafeStringify=stringify$2;stringify$2.default=stringify$2;stringify$2.stable=deterministicStringify;stringify$2.stableStringify=deterministicStringify;var arr=[],replacerStack=[];function stringify$2(D,E,W){decirc(D,"",[],void 0);var U;try{replacerStack.length===0?U=JSON.stringify(D,E,W):U=JSON.stringify(D,replaceGetterValues(E),W)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;arr.length!==0;){var Q=arr.pop();Q.length===4?Object.defineProperty(Q[0],Q[1],Q[3]):Q[0][Q[1]]=Q[2]}}return U}function decirc(D,E,W,U){var Q;if(typeof D=="object"&&D!==null){for(Q=0;Q<W.length;Q++)if(W[Q]===D){var G=Object.getOwnPropertyDescriptor(U,E);G.get!==void 0?G.configurable?(Object.defineProperty(U,E,{value:"[Circular]"}),arr.push([U,E,D,G])):replacerStack.push([D,E]):(U[E]="[Circular]",arr.push([U,E,D]));return}if(W.push(D),Array.isArray(D))for(Q=0;Q<D.length;Q++)decirc(D[Q],Q,W,D);else{var J=Object.keys(D);for(Q=0;Q<J.length;Q++){var Y=J[Q];decirc(D[Y],Y,W,D)}}W.pop()}}function compareFunction(D,E){return D<E?-1:D>E?1:0}function deterministicStringify(D,E,W){var U=deterministicDecirc(D,"",[],void 0)||D,Q;try{replacerStack.length===0?Q=JSON.stringify(U,E,W):Q=JSON.stringify(U,replaceGetterValues(E),W)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;arr.length!==0;){var G=arr.pop();G.length===4?Object.defineProperty(G[0],G[1],G[3]):G[0][G[1]]=G[2]}}return Q}function deterministicDecirc(D,E,W,U){var Q;if(typeof D=="object"&&D!==null){for(Q=0;Q<W.length;Q++)if(W[Q]===D){var G=Object.getOwnPropertyDescriptor(U,E);G.get!==void 0?G.configurable?(Object.defineProperty(U,E,{value:"[Circular]"}),arr.push([U,E,D,G])):replacerStack.push([D,E]):(U[E]="[Circular]",arr.push([U,E,D]));return}try{if(typeof D.toJSON=="function")return}catch{return}if(W.push(D),Array.isArray(D))for(Q=0;Q<D.length;Q++)deterministicDecirc(D[Q],Q,W,D);else{var J={},Y=Object.keys(D).sort(compareFunction);for(Q=0;Q<Y.length;Q++){var X=Y[Q];deterministicDecirc(D[X],X,W,D),J[X]=D[X]}if(U!==void 0)arr.push([U,E,D]),U[E]=J;else return J}W.pop()}}function replaceGetterValues(D){return D=D!==void 0?D:function(E,W){return W},function(E,W){if(replacerStack.length>0)for(var U=0;U<replacerStack.length;U++){var Q=replacerStack[U];if(Q[1]===E&&Q[0]===W){W="[Circular]",replacerStack.splice(U,1);break}}return D.call(this,E,W)}}Object.defineProperty(classes$1,"__esModule",{value:!0});classes$1.EthereumProviderError=classes$1.EthereumRpcError=void 0;const fast_safe_stringify_1$1=fastSafeStringify;let EthereumRpcError$1=class extends Error{constructor(E,W,U){if(!Number.isInteger(E))throw new Error('"code" must be an integer.');if(!W||typeof W!="string")throw new Error('"message" must be a nonempty string.');super(W),this.code=E,U!==void 0&&(this.data=U)}serialize(){const E={code:this.code,message:this.message};return this.data!==void 0&&(E.data=this.data),this.stack&&(E.stack=this.stack),E}toString(){return fast_safe_stringify_1$1.default(this.serialize(),stringifyReplacer$1,2)}};classes$1.EthereumRpcError=EthereumRpcError$1;let EthereumProviderError$1=class extends EthereumRpcError$1{constructor(E,W,U){if(!isValidEthProviderCode$1(E))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(E,W,U)}};classes$1.EthereumProviderError=EthereumProviderError$1;function isValidEthProviderCode$1(D){return Number.isInteger(D)&&D>=1e3&&D<=4999}function stringifyReplacer$1(D,E){if(E!=="[Circular]")return E}var utils$4={},errorConstants$1={};Object.defineProperty(errorConstants$1,"__esModule",{value:!0});errorConstants$1.errorValues=errorConstants$1.errorCodes=void 0;errorConstants$1.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};errorConstants$1.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.serializeError=D.isValidCode=D.getMessageFromCode=D.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const E=errorConstants$1,W=classes$1,U=E.errorCodes.rpc.internal,Q="Unspecified error message. This is a bug, please report it.",G={code:U,message:J(U)};D.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function J(te,re=Q){if(Number.isInteger(te)){const ae=te.toString();if(oe(E.errorValues,ae))return E.errorValues[ae].message;if(Z(te))return D.JSON_RPC_SERVER_ERROR_MESSAGE}return re}D.getMessageFromCode=J;function Y(te){if(!Number.isInteger(te))return!1;const re=te.toString();return!!(E.errorValues[re]||Z(te))}D.isValidCode=Y;function X(te,{fallbackError:re=G,shouldIncludeStack:ae=!1}={}){var fe,de;if(!re||!Number.isInteger(re.code)||typeof re.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(te instanceof W.EthereumRpcError)return te.serialize();const se={};if(te&&typeof te=="object"&&!Array.isArray(te)&&oe(te,"code")&&Y(te.code)){const ce=te;se.code=ce.code,ce.message&&typeof ce.message=="string"?(se.message=ce.message,oe(ce,"data")&&(se.data=ce.data)):(se.message=J(se.code),se.data={originalError:ee(te)})}else{se.code=re.code;const ce=(fe=te)===null||fe===void 0?void 0:fe.message;se.message=ce&&typeof ce=="string"?ce:re.message,se.data={originalError:ee(te)}}const ue=(de=te)===null||de===void 0?void 0:de.stack;return ae&&te&&ue&&typeof ue=="string"&&(se.stack=ue),se}D.serializeError=X;function Z(te){return te>=-32099&&te<=-32e3}function ee(te){return te&&typeof te=="object"&&!Array.isArray(te)?Object.assign({},te):te}function oe(te,re){return Object.prototype.hasOwnProperty.call(te,re)}})(utils$4);var errors$1={};Object.defineProperty(errors$1,"__esModule",{value:!0});errors$1.ethErrors=void 0;const classes_1$1=classes$1,utils_1$1=utils$4,error_constants_1$1=errorConstants$1;errors$1.ethErrors={rpc:{parse:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.parse,D),invalidRequest:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.invalidRequest,D),invalidParams:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.invalidParams,D),methodNotFound:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.methodNotFound,D),internal:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.internal,D),server:D=>{if(!D||typeof D!="object"||Array.isArray(D))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:E}=D;if(!Number.isInteger(E)||E>-32005||E<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return getEthJsonRpcError$1(E,D)},invalidInput:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.invalidInput,D),resourceNotFound:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.resourceNotFound,D),resourceUnavailable:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.resourceUnavailable,D),transactionRejected:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.transactionRejected,D),methodNotSupported:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.methodNotSupported,D),limitExceeded:D=>getEthJsonRpcError$1(error_constants_1$1.errorCodes.rpc.limitExceeded,D)},provider:{userRejectedRequest:D=>getEthProviderError$1(error_constants_1$1.errorCodes.provider.userRejectedRequest,D),unauthorized:D=>getEthProviderError$1(error_constants_1$1.errorCodes.provider.unauthorized,D),unsupportedMethod:D=>getEthProviderError$1(error_constants_1$1.errorCodes.provider.unsupportedMethod,D),disconnected:D=>getEthProviderError$1(error_constants_1$1.errorCodes.provider.disconnected,D),chainDisconnected:D=>getEthProviderError$1(error_constants_1$1.errorCodes.provider.chainDisconnected,D),custom:D=>{if(!D||typeof D!="object"||Array.isArray(D))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:E,message:W,data:U}=D;if(!W||typeof W!="string")throw new Error('"message" must be a nonempty string');return new classes_1$1.EthereumProviderError(E,W,U)}}};function getEthJsonRpcError$1(D,E){const[W,U]=parseOpts$1(E);return new classes_1$1.EthereumRpcError(D,W||utils_1$1.getMessageFromCode(D),U)}function getEthProviderError$1(D,E){const[W,U]=parseOpts$1(E);return new classes_1$1.EthereumProviderError(D,W||utils_1$1.getMessageFromCode(D),U)}function parseOpts$1(D){if(D){if(typeof D=="string")return[D];if(typeof D=="object"&&!Array.isArray(D)){const{message:E,data:W}=D;if(E&&typeof E!="string")throw new Error("Must specify string message.");return[E||void 0,W]}}return[]}(function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.getMessageFromCode=D.serializeError=D.EthereumProviderError=D.EthereumRpcError=D.ethErrors=D.errorCodes=void 0;const E=classes$1;Object.defineProperty(D,"EthereumRpcError",{enumerable:!0,get:function(){return E.EthereumRpcError}}),Object.defineProperty(D,"EthereumProviderError",{enumerable:!0,get:function(){return E.EthereumProviderError}});const W=utils$4;Object.defineProperty(D,"serializeError",{enumerable:!0,get:function(){return W.serializeError}}),Object.defineProperty(D,"getMessageFromCode",{enumerable:!0,get:function(){return W.getMessageFromCode}});const U=errors$1;Object.defineProperty(D,"ethErrors",{enumerable:!0,get:function(){return U.ethErrors}});const Q=errorConstants$1;Object.defineProperty(D,"errorCodes",{enumerable:!0,get:function(){return Q.errorCodes}})})(dist$2);var EventListener={};Object.defineProperty(EventListener,"__esModule",{value:!0});EventListener.EVENTS=void 0;EventListener.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Session$1={},sha256={exports:{}};(function(module){(function(){var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof browser$1=="object"&&browser$1.versions&&browser$1.versions.node;NODE_JS?root=globalThis:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&!0&&module.exports,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(D){return Object.prototype.toString.call(D)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(D){return typeof D=="object"&&D.buffer&&D.buffer.constructor===ArrayBuffer});var createOutputMethod=function(D,E){return function(W){return new Sha256(E,!0).update(W)[D]()}},createMethod=function(D){var E=createOutputMethod("hex",D);NODE_JS&&(E=nodeWrap(E,D)),E.create=function(){return new Sha256(D)},E.update=function(Q){return E.create().update(Q)};for(var W=0;W<OUTPUT_TYPES.length;++W){var U=OUTPUT_TYPES[W];E[U]=createOutputMethod(U,D)}return E},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(D){if(typeof D=="string")return crypto.createHash(algorithm).update(D,"utf8").digest("hex");if(D==null)throw new Error(ERROR);return D.constructor===ArrayBuffer&&(D=new Uint8Array(D)),Array.isArray(D)||ArrayBuffer.isView(D)||D.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(D)).digest("hex"):method(D)};return nodeMethod},createHmacOutputMethod=function(D,E){return function(W,U){return new HmacSha256(W,E,!0).update(U)[D]()}},createHmacMethod=function(D){var E=createHmacOutputMethod("hex",D);E.create=function(Q){return new HmacSha256(Q,D)},E.update=function(Q,G){return E.create(Q).update(G)};for(var W=0;W<OUTPUT_TYPES.length;++W){var U=OUTPUT_TYPES[W];E[U]=createHmacOutputMethod(U,D)}return E};function Sha256(D,E){E?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],D?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=D}Sha256.prototype.update=function(D){if(!this.finalized){var E,W=typeof D;if(W!=="string"){if(W==="object"){if(D===null)throw new Error(ERROR);if(ARRAY_BUFFER&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(D)))throw new Error(ERROR)}else throw new Error(ERROR);E=!0}for(var U,Q=0,G,J=D.length,Y=this.blocks;Q<J;){if(this.hashed&&(this.hashed=!1,Y[0]=this.block,Y[16]=Y[1]=Y[2]=Y[3]=Y[4]=Y[5]=Y[6]=Y[7]=Y[8]=Y[9]=Y[10]=Y[11]=Y[12]=Y[13]=Y[14]=Y[15]=0),E)for(G=this.start;Q<J&&G<64;++Q)Y[G>>2]|=D[Q]<<SHIFT[G++&3];else for(G=this.start;Q<J&&G<64;++Q)U=D.charCodeAt(Q),U<128?Y[G>>2]|=U<<SHIFT[G++&3]:U<2048?(Y[G>>2]|=(192|U>>6)<<SHIFT[G++&3],Y[G>>2]|=(128|U&63)<<SHIFT[G++&3]):U<55296||U>=57344?(Y[G>>2]|=(224|U>>12)<<SHIFT[G++&3],Y[G>>2]|=(128|U>>6&63)<<SHIFT[G++&3],Y[G>>2]|=(128|U&63)<<SHIFT[G++&3]):(U=65536+((U&1023)<<10|D.charCodeAt(++Q)&1023),Y[G>>2]|=(240|U>>18)<<SHIFT[G++&3],Y[G>>2]|=(128|U>>12&63)<<SHIFT[G++&3],Y[G>>2]|=(128|U>>6&63)<<SHIFT[G++&3],Y[G>>2]|=(128|U&63)<<SHIFT[G++&3]);this.lastByteIndex=G,this.bytes+=G-this.start,G>=64?(this.block=Y[16],this.start=G-64,this.hash(),this.hashed=!0):this.start=G}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var D=this.blocks,E=this.lastByteIndex;D[16]=this.block,D[E>>2]|=EXTRA[E&3],this.block=D[16],E>=56&&(this.hashed||this.hash(),D[0]=this.block,D[16]=D[1]=D[2]=D[3]=D[4]=D[5]=D[6]=D[7]=D[8]=D[9]=D[10]=D[11]=D[12]=D[13]=D[14]=D[15]=0),D[14]=this.hBytes<<3|this.bytes>>>29,D[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var D=this.h0,E=this.h1,W=this.h2,U=this.h3,Q=this.h4,G=this.h5,J=this.h6,Y=this.h7,X=this.blocks,Z,ee,oe,te,re,ae,fe,de,se,ue,ce;for(Z=16;Z<64;++Z)re=X[Z-15],ee=(re>>>7|re<<25)^(re>>>18|re<<14)^re>>>3,re=X[Z-2],oe=(re>>>17|re<<15)^(re>>>19|re<<13)^re>>>10,X[Z]=X[Z-16]+ee+X[Z-7]+oe<<0;for(ce=E&W,Z=0;Z<64;Z+=4)this.first?(this.is224?(de=300032,re=X[0]-1413257819,Y=re-150054599<<0,U=re+24177077<<0):(de=704751109,re=X[0]-210244248,Y=re-1521486534<<0,U=re+143694565<<0),this.first=!1):(ee=(D>>>2|D<<30)^(D>>>13|D<<19)^(D>>>22|D<<10),oe=(Q>>>6|Q<<26)^(Q>>>11|Q<<21)^(Q>>>25|Q<<7),de=D&E,te=de^D&W^ce,fe=Q&G^~Q&J,re=Y+oe+fe+K[Z]+X[Z],ae=ee+te,Y=U+re<<0,U=re+ae<<0),ee=(U>>>2|U<<30)^(U>>>13|U<<19)^(U>>>22|U<<10),oe=(Y>>>6|Y<<26)^(Y>>>11|Y<<21)^(Y>>>25|Y<<7),se=U&D,te=se^U&E^de,fe=Y&Q^~Y&G,re=J+oe+fe+K[Z+1]+X[Z+1],ae=ee+te,J=W+re<<0,W=re+ae<<0,ee=(W>>>2|W<<30)^(W>>>13|W<<19)^(W>>>22|W<<10),oe=(J>>>6|J<<26)^(J>>>11|J<<21)^(J>>>25|J<<7),ue=W&U,te=ue^W&D^se,fe=J&Y^~J&Q,re=G+oe+fe+K[Z+2]+X[Z+2],ae=ee+te,G=E+re<<0,E=re+ae<<0,ee=(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10),oe=(G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7),ce=E&W,te=ce^E&U^ue,fe=G&J^~G&Y,re=Q+oe+fe+K[Z+3]+X[Z+3],ae=ee+te,Q=D+re<<0,D=re+ae<<0;this.h0=this.h0+D<<0,this.h1=this.h1+E<<0,this.h2=this.h2+W<<0,this.h3=this.h3+U<<0,this.h4=this.h4+Q<<0,this.h5=this.h5+G<<0,this.h6=this.h6+J<<0,this.h7=this.h7+Y<<0},Sha256.prototype.hex=function(){this.finalize();var D=this.h0,E=this.h1,W=this.h2,U=this.h3,Q=this.h4,G=this.h5,J=this.h6,Y=this.h7,X=HEX_CHARS[D>>28&15]+HEX_CHARS[D>>24&15]+HEX_CHARS[D>>20&15]+HEX_CHARS[D>>16&15]+HEX_CHARS[D>>12&15]+HEX_CHARS[D>>8&15]+HEX_CHARS[D>>4&15]+HEX_CHARS[D&15]+HEX_CHARS[E>>28&15]+HEX_CHARS[E>>24&15]+HEX_CHARS[E>>20&15]+HEX_CHARS[E>>16&15]+HEX_CHARS[E>>12&15]+HEX_CHARS[E>>8&15]+HEX_CHARS[E>>4&15]+HEX_CHARS[E&15]+HEX_CHARS[W>>28&15]+HEX_CHARS[W>>24&15]+HEX_CHARS[W>>20&15]+HEX_CHARS[W>>16&15]+HEX_CHARS[W>>12&15]+HEX_CHARS[W>>8&15]+HEX_CHARS[W>>4&15]+HEX_CHARS[W&15]+HEX_CHARS[U>>28&15]+HEX_CHARS[U>>24&15]+HEX_CHARS[U>>20&15]+HEX_CHARS[U>>16&15]+HEX_CHARS[U>>12&15]+HEX_CHARS[U>>8&15]+HEX_CHARS[U>>4&15]+HEX_CHARS[U&15]+HEX_CHARS[Q>>28&15]+HEX_CHARS[Q>>24&15]+HEX_CHARS[Q>>20&15]+HEX_CHARS[Q>>16&15]+HEX_CHARS[Q>>12&15]+HEX_CHARS[Q>>8&15]+HEX_CHARS[Q>>4&15]+HEX_CHARS[Q&15]+HEX_CHARS[G>>28&15]+HEX_CHARS[G>>24&15]+HEX_CHARS[G>>20&15]+HEX_CHARS[G>>16&15]+HEX_CHARS[G>>12&15]+HEX_CHARS[G>>8&15]+HEX_CHARS[G>>4&15]+HEX_CHARS[G&15]+HEX_CHARS[J>>28&15]+HEX_CHARS[J>>24&15]+HEX_CHARS[J>>20&15]+HEX_CHARS[J>>16&15]+HEX_CHARS[J>>12&15]+HEX_CHARS[J>>8&15]+HEX_CHARS[J>>4&15]+HEX_CHARS[J&15];return this.is224||(X+=HEX_CHARS[Y>>28&15]+HEX_CHARS[Y>>24&15]+HEX_CHARS[Y>>20&15]+HEX_CHARS[Y>>16&15]+HEX_CHARS[Y>>12&15]+HEX_CHARS[Y>>8&15]+HEX_CHARS[Y>>4&15]+HEX_CHARS[Y&15]),X},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var D=this.h0,E=this.h1,W=this.h2,U=this.h3,Q=this.h4,G=this.h5,J=this.h6,Y=this.h7,X=[D>>24&255,D>>16&255,D>>8&255,D&255,E>>24&255,E>>16&255,E>>8&255,E&255,W>>24&255,W>>16&255,W>>8&255,W&255,U>>24&255,U>>16&255,U>>8&255,U&255,Q>>24&255,Q>>16&255,Q>>8&255,Q&255,G>>24&255,G>>16&255,G>>8&255,G&255,J>>24&255,J>>16&255,J>>8&255,J&255];return this.is224||X.push(Y>>24&255,Y>>16&255,Y>>8&255,Y&255),X},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var D=new ArrayBuffer(this.is224?28:32),E=new DataView(D);return E.setUint32(0,this.h0),E.setUint32(4,this.h1),E.setUint32(8,this.h2),E.setUint32(12,this.h3),E.setUint32(16,this.h4),E.setUint32(20,this.h5),E.setUint32(24,this.h6),this.is224||E.setUint32(28,this.h7),D};function HmacSha256(D,E,W){var U,Q=typeof D;if(Q==="string"){var G=[],J=D.length,Y=0,X;for(U=0;U<J;++U)X=D.charCodeAt(U),X<128?G[Y++]=X:X<2048?(G[Y++]=192|X>>6,G[Y++]=128|X&63):X<55296||X>=57344?(G[Y++]=224|X>>12,G[Y++]=128|X>>6&63,G[Y++]=128|X&63):(X=65536+((X&1023)<<10|D.charCodeAt(++U)&1023),G[Y++]=240|X>>18,G[Y++]=128|X>>12&63,G[Y++]=128|X>>6&63,G[Y++]=128|X&63);D=G}else if(Q==="object"){if(D===null)throw new Error(ERROR);if(ARRAY_BUFFER&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(D)))throw new Error(ERROR)}else throw new Error(ERROR);D.length>64&&(D=new Sha256(E,!0).update(D).array());var Z=[],ee=[];for(U=0;U<64;++U){var oe=D[U]||0;Z[U]=92^oe,ee[U]=54^oe}Sha256.call(this,E,W),this.update(ee),this.oKeyPad=Z,this.inner=!0,this.sharedMemory=W}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var D=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(D),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)})()})(sha256);var sha256Exports=sha256.exports;function isFunction(D){return typeof D=="function"}var _enable_super_gross_mode_that_will_cause_bad_things=!1,config$1={Promise:void 0,set useDeprecatedSynchronousErrorHandling(D){if(D){var E=new Error;""+E.stack}_enable_super_gross_mode_that_will_cause_bad_things=D},get useDeprecatedSynchronousErrorHandling(){return _enable_super_gross_mode_that_will_cause_bad_things}};function hostReportError(D){setTimeout(function(){throw D},0)}var empty$1={closed:!0,next:function(D){},error:function(D){if(config$1.useDeprecatedSynchronousErrorHandling)throw D;hostReportError(D)},complete:function(){}},isArray$4=function(){return Array.isArray||function(D){return D&&typeof D.length=="number"}}();function isObject(D){return D!==null&&typeof D=="object"}var UnsubscriptionErrorImpl=function(){function D(E){return Error.call(this),this.message=E?E.length+` errors occurred during unsubscription:
2
2
  `+E.map(function(W,U){return U+1+") "+W.toString()}).join(`
3
3
  `):"",this.name="UnsubscriptionError",this.errors=E,this}return D.prototype=Object.create(Error.prototype),D}(),UnsubscriptionError=UnsubscriptionErrorImpl,Subscription=function(){function D(E){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,E&&(this._ctorUnsubscribe=!0,this._unsubscribe=E)}return D.prototype.unsubscribe=function(){var E;if(!this.closed){var W=this,U=W._parentOrParents,Q=W._ctorUnsubscribe,G=W._unsubscribe,J=W._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,U instanceof D)U.remove(this);else if(U!==null)for(var Y=0;Y<U.length;++Y){var X=U[Y];X.remove(this)}if(isFunction(G)){Q&&(this._unsubscribe=void 0);try{G.call(this)}catch(oe){E=oe instanceof UnsubscriptionError?flattenUnsubscriptionErrors(oe.errors):[oe]}}if(isArray$4(J))for(var Y=-1,Z=J.length;++Y<Z;){var ee=J[Y];if(isObject(ee))try{ee.unsubscribe()}catch(te){E=E||[],te instanceof UnsubscriptionError?E=E.concat(flattenUnsubscriptionErrors(te.errors)):E.push(te)}}if(E)throw new UnsubscriptionError(E)}},D.prototype.add=function(E){var W=E;if(!E)return D.EMPTY;switch(typeof E){case"function":W=new D(E);case"object":if(W===this||W.closed||typeof W.unsubscribe!="function")return W;if(this.closed)return W.unsubscribe(),W;if(!(W instanceof D)){var U=W;W=new D,W._subscriptions=[U]}break;default:throw new Error("unrecognized teardown "+E+" added to Subscription.")}var Q=W._parentOrParents;if(Q===null)W._parentOrParents=this;else if(Q instanceof D){if(Q===this)return W;W._parentOrParents=[Q,this]}else if(Q.indexOf(this)===-1)Q.push(this);else return W;var G=this._subscriptions;return G===null?this._subscriptions=[W]:G.push(W),W},D.prototype.remove=function(E){var W=this._subscriptions;if(W){var U=W.indexOf(E);U!==-1&&W.splice(U,1)}},D.EMPTY=function(E){return E.closed=!0,E}(new D),D}();function flattenUnsubscriptionErrors(D){return D.reduce(function(E,W){return E.concat(W instanceof UnsubscriptionError?W.errors:W)},[])}var rxSubscriber=function(){return typeof Symbol=="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),Subscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this)||this;switch(G.syncErrorValue=null,G.syncErrorThrown=!1,G.syncErrorThrowable=!1,G.isStopped=!1,arguments.length){case 0:G.destination=empty$1;break;case 1:if(!W){G.destination=empty$1;break}if(typeof W=="object"){W instanceof E?(G.syncErrorThrowable=W.syncErrorThrowable,G.destination=W,W.add(G)):(G.syncErrorThrowable=!0,G.destination=new SafeSubscriber(G,W));break}default:G.syncErrorThrowable=!0,G.destination=new SafeSubscriber(G,W,U,Q);break}return G}return E.prototype[rxSubscriber]=function(){return this},E.create=function(W,U,Q){var G=new E(W,U,Q);return G.syncErrorThrowable=!1,G},E.prototype.next=function(W){this.isStopped||this._next(W)},E.prototype.error=function(W){this.isStopped||(this.isStopped=!0,this._error(W))},E.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},E.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,D.prototype.unsubscribe.call(this))},E.prototype._next=function(W){this.destination.next(W)},E.prototype._error=function(W){this.destination.error(W),this.unsubscribe()},E.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},E.prototype._unsubscribeAndRecycle=function(){var W=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=W,this},E}(Subscription),SafeSubscriber=function(D){__extends$1(E,D);function E(W,U,Q,G){var J=D.call(this)||this;J._parentSubscriber=W;var Y,X=J;return isFunction(U)?Y=U:U&&(Y=U.next,Q=U.error,G=U.complete,U!==empty$1&&(X=Object.create(U),isFunction(X.unsubscribe)&&J.add(X.unsubscribe.bind(X)),X.unsubscribe=J.unsubscribe.bind(J))),J._context=X,J._next=Y,J._error=Q,J._complete=G,J}return E.prototype.next=function(W){if(!this.isStopped&&this._next){var U=this._parentSubscriber;!config$1.useDeprecatedSynchronousErrorHandling||!U.syncErrorThrowable?this.__tryOrUnsub(this._next,W):this.__tryOrSetError(U,this._next,W)&&this.unsubscribe()}},E.prototype.error=function(W){if(!this.isStopped){var U=this._parentSubscriber,Q=config$1.useDeprecatedSynchronousErrorHandling;if(this._error)!Q||!U.syncErrorThrowable?(this.__tryOrUnsub(this._error,W),this.unsubscribe()):(this.__tryOrSetError(U,this._error,W),this.unsubscribe());else if(U.syncErrorThrowable)Q?(U.syncErrorValue=W,U.syncErrorThrown=!0):hostReportError(W),this.unsubscribe();else{if(this.unsubscribe(),Q)throw W;hostReportError(W)}}},E.prototype.complete=function(){var W=this;if(!this.isStopped){var U=this._parentSubscriber;if(this._complete){var Q=function(){return W._complete.call(W._context)};!config$1.useDeprecatedSynchronousErrorHandling||!U.syncErrorThrowable?(this.__tryOrUnsub(Q),this.unsubscribe()):(this.__tryOrSetError(U,Q),this.unsubscribe())}else this.unsubscribe()}},E.prototype.__tryOrUnsub=function(W,U){try{W.call(this._context,U)}catch(Q){if(this.unsubscribe(),config$1.useDeprecatedSynchronousErrorHandling)throw Q;hostReportError(Q)}},E.prototype.__tryOrSetError=function(W,U,Q){if(!config$1.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{U.call(this._context,Q)}catch(G){return config$1.useDeprecatedSynchronousErrorHandling?(W.syncErrorValue=G,W.syncErrorThrown=!0,!0):(hostReportError(G),!0)}return!1},E.prototype._unsubscribe=function(){var W=this._parentSubscriber;this._context=null,this._parentSubscriber=null,W.unsubscribe()},E}(Subscriber);function canReportError(D){for(;D;){var E=D,W=E.closed,U=E.destination,Q=E.isStopped;if(W||Q)return!1;U&&U instanceof Subscriber?D=U:D=null}return!0}function toSubscriber(D,E,W){if(D){if(D instanceof Subscriber)return D;if(D[rxSubscriber])return D[rxSubscriber]()}return!D&&!E&&!W?new Subscriber(empty$1):new Subscriber(D,E,W)}var observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function identity(D){return D}function pipe$1(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];return pipeFromArray(D)}function pipeFromArray(D){return D.length===0?identity:D.length===1?D[0]:function(W){return D.reduce(function(U,Q){return Q(U)},W)}}var Observable=function(){function D(E){this._isScalar=!1,E&&(this._subscribe=E)}return D.prototype.lift=function(E){var W=new D;return W.source=this,W.operator=E,W},D.prototype.subscribe=function(E,W,U){var Q=this.operator,G=toSubscriber(E,W,U);if(Q?G.add(Q.call(G,this.source)):G.add(this.source||config$1.useDeprecatedSynchronousErrorHandling&&!G.syncErrorThrowable?this._subscribe(G):this._trySubscribe(G)),config$1.useDeprecatedSynchronousErrorHandling&&G.syncErrorThrowable&&(G.syncErrorThrowable=!1,G.syncErrorThrown))throw G.syncErrorValue;return G},D.prototype._trySubscribe=function(E){try{return this._subscribe(E)}catch(W){config$1.useDeprecatedSynchronousErrorHandling&&(E.syncErrorThrown=!0,E.syncErrorValue=W),canReportError(E)?E.error(W):console.warn(W)}},D.prototype.forEach=function(E,W){var U=this;return W=getPromiseCtor(W),new W(function(Q,G){var J;J=U.subscribe(function(Y){try{E(Y)}catch(X){G(X),J&&J.unsubscribe()}},G,Q)})},D.prototype._subscribe=function(E){var W=this.source;return W&&W.subscribe(E)},D.prototype[observable]=function(){return this},D.prototype.pipe=function(){for(var E=[],W=0;W<arguments.length;W++)E[W]=arguments[W];return E.length===0?this:pipeFromArray(E)(this)},D.prototype.toPromise=function(E){var W=this;return E=getPromiseCtor(E),new E(function(U,Q){var G;W.subscribe(function(J){return G=J},function(J){return Q(J)},function(){return U(G)})})},D.create=function(E){return new D(E)},D}();function getPromiseCtor(D){if(D||(D=config$1.Promise||Promise),!D)throw new Error("no Promise impl found");return D}var ObjectUnsubscribedErrorImpl=function(){function D(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return D.prototype=Object.create(Error.prototype),D}(),ObjectUnsubscribedError=ObjectUnsubscribedErrorImpl,SubjectSubscription=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this)||this;return Q.subject=W,Q.subscriber=U,Q.closed=!1,Q}return E.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var W=this.subject,U=W.observers;if(this.subject=null,!(!U||U.length===0||W.isStopped||W.closed)){var Q=U.indexOf(this.subscriber);Q!==-1&&U.splice(Q,1)}}},E}(Subscription),SubjectSubscriber=function(D){__extends$1(E,D);function E(W){var U=D.call(this,W)||this;return U.destination=W,U}return E}(Subscriber),Subject=function(D){__extends$1(E,D);function E(){var W=D.call(this)||this;return W.observers=[],W.closed=!1,W.isStopped=!1,W.hasError=!1,W.thrownError=null,W}return E.prototype[rxSubscriber]=function(){return new SubjectSubscriber(this)},E.prototype.lift=function(W){var U=new AnonymousSubject(this,this);return U.operator=W,U},E.prototype.next=function(W){if(this.closed)throw new ObjectUnsubscribedError;if(!this.isStopped)for(var U=this.observers,Q=U.length,G=U.slice(),J=0;J<Q;J++)G[J].next(W)},E.prototype.error=function(W){if(this.closed)throw new ObjectUnsubscribedError;this.hasError=!0,this.thrownError=W,this.isStopped=!0;for(var U=this.observers,Q=U.length,G=U.slice(),J=0;J<Q;J++)G[J].error(W);this.observers.length=0},E.prototype.complete=function(){if(this.closed)throw new ObjectUnsubscribedError;this.isStopped=!0;for(var W=this.observers,U=W.length,Q=W.slice(),G=0;G<U;G++)Q[G].complete();this.observers.length=0},E.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},E.prototype._trySubscribe=function(W){if(this.closed)throw new ObjectUnsubscribedError;return D.prototype._trySubscribe.call(this,W)},E.prototype._subscribe=function(W){if(this.closed)throw new ObjectUnsubscribedError;return this.hasError?(W.error(this.thrownError),Subscription.EMPTY):this.isStopped?(W.complete(),Subscription.EMPTY):(this.observers.push(W),new SubjectSubscription(this,W))},E.prototype.asObservable=function(){var W=new Observable;return W.source=this,W},E.create=function(W,U){return new AnonymousSubject(W,U)},E}(Observable),AnonymousSubject=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this)||this;return Q.destination=W,Q.source=U,Q}return E.prototype.next=function(W){var U=this.destination;U&&U.next&&U.next(W)},E.prototype.error=function(W){var U=this.destination;U&&U.error&&this.destination.error(W)},E.prototype.complete=function(){var W=this.destination;W&&W.complete&&this.destination.complete()},E.prototype._subscribe=function(W){var U=this.source;return U?this.source.subscribe(W):Subscription.EMPTY},E}(Subject);function refCount(){return function(E){return E.lift(new RefCountOperator(E))}}var RefCountOperator=function(){function D(E){this.connectable=E}return D.prototype.call=function(E,W){var U=this.connectable;U._refCount++;var Q=new RefCountSubscriber(E,U),G=W.subscribe(Q);return Q.closed||(Q.connection=U.connect()),G},D}(),RefCountSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.connectable=U,Q}return E.prototype._unsubscribe=function(){var W=this.connectable;if(!W){this.connection=null;return}this.connectable=null;var U=W._refCount;if(U<=0){this.connection=null;return}if(W._refCount=U-1,U>1){this.connection=null;return}var Q=this.connection,G=W._connection;this.connection=null,G&&(!Q||G===Q)&&G.unsubscribe()},E}(Subscriber),ConnectableObservable=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this)||this;return Q.source=W,Q.subjectFactory=U,Q._refCount=0,Q._isComplete=!1,Q}return E.prototype._subscribe=function(W){return this.getSubject().subscribe(W)},E.prototype.getSubject=function(){var W=this._subject;return(!W||W.isStopped)&&(this._subject=this.subjectFactory()),this._subject},E.prototype.connect=function(){var W=this._connection;return W||(this._isComplete=!1,W=this._connection=new Subscription,W.add(this.source.subscribe(new ConnectableSubscriber(this.getSubject(),this))),W.closed&&(this._connection=null,W=Subscription.EMPTY)),W},E.prototype.refCount=function(){return refCount()(this)},E}(Observable),connectableObservableDescriptor=function(){var D=ConnectableObservable.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:D._subscribe},_isComplete:{value:D._isComplete,writable:!0},getSubject:{value:D.getSubject},connect:{value:D.connect},refCount:{value:D.refCount}}}(),ConnectableSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.connectable=U,Q}return E.prototype._error=function(W){this._unsubscribe(),D.prototype._error.call(this,W)},E.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),D.prototype._complete.call(this)},E.prototype._unsubscribe=function(){var W=this.connectable;if(W){this.connectable=null;var U=W._connection;W._refCount=0,W._subject=null,W._connection=null,U&&U.unsubscribe()}},E}(SubjectSubscriber);function groupBy(D,E,W,U){return function(Q){return Q.lift(new GroupByOperator(D,E,W,U))}}var GroupByOperator=function(){function D(E,W,U,Q){this.keySelector=E,this.elementSelector=W,this.durationSelector=U,this.subjectSelector=Q}return D.prototype.call=function(E,W){return W.subscribe(new GroupBySubscriber(E,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},D}(),GroupBySubscriber=function(D){__extends$1(E,D);function E(W,U,Q,G,J){var Y=D.call(this,W)||this;return Y.keySelector=U,Y.elementSelector=Q,Y.durationSelector=G,Y.subjectSelector=J,Y.groups=null,Y.attemptedToUnsubscribe=!1,Y.count=0,Y}return E.prototype._next=function(W){var U;try{U=this.keySelector(W)}catch(Q){this.error(Q);return}this._group(W,U)},E.prototype._group=function(W,U){var Q=this.groups;Q||(Q=this.groups=new Map);var G=Q.get(U),J;if(this.elementSelector)try{J=this.elementSelector(W)}catch(Z){this.error(Z)}else J=W;if(!G){G=this.subjectSelector?this.subjectSelector():new Subject,Q.set(U,G);var Y=new GroupedObservable(U,G,this);if(this.destination.next(Y),this.durationSelector){var X=void 0;try{X=this.durationSelector(new GroupedObservable(U,G))}catch(Z){this.error(Z);return}this.add(X.subscribe(new GroupDurationSubscriber(U,G,this)))}}G.closed||G.next(J)},E.prototype._error=function(W){var U=this.groups;U&&(U.forEach(function(Q,G){Q.error(W)}),U.clear()),this.destination.error(W)},E.prototype._complete=function(){var W=this.groups;W&&(W.forEach(function(U,Q){U.complete()}),W.clear()),this.destination.complete()},E.prototype.removeGroup=function(W){this.groups.delete(W)},E.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,this.count===0&&D.prototype.unsubscribe.call(this))},E}(Subscriber),GroupDurationSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,U)||this;return G.key=W,G.group=U,G.parent=Q,G}return E.prototype._next=function(W){this.complete()},E.prototype._unsubscribe=function(){var W=this,U=W.parent,Q=W.key;this.key=this.parent=null,U&&U.removeGroup(Q)},E}(Subscriber),GroupedObservable=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this)||this;return G.key=W,G.groupSubject=U,G.refCountSubscription=Q,G}return E.prototype._subscribe=function(W){var U=new Subscription,Q=this,G=Q.refCountSubscription,J=Q.groupSubject;return G&&!G.closed&&U.add(new InnerRefCountSubscription(G)),U.add(J.subscribe(W)),U},E}(Observable),InnerRefCountSubscription=function(D){__extends$1(E,D);function E(W){var U=D.call(this)||this;return U.parent=W,W.count++,U}return E.prototype.unsubscribe=function(){var W=this.parent;!W.closed&&!this.closed&&(D.prototype.unsubscribe.call(this),W.count-=1,W.count===0&&W.attemptedToUnsubscribe&&W.unsubscribe())},E}(Subscription),BehaviorSubject=function(D){__extends$1(E,D);function E(W){var U=D.call(this)||this;return U._value=W,U}return Object.defineProperty(E.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),E.prototype._subscribe=function(W){var U=D.prototype._subscribe.call(this,W);return U&&!U.closed&&W.next(this._value),U},E.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new ObjectUnsubscribedError;return this._value},E.prototype.next=function(W){D.prototype.next.call(this,this._value=W)},E}(Subject),Action=function(D){__extends$1(E,D);function E(W,U){return D.call(this)||this}return E.prototype.schedule=function(W,U){return this},E}(Subscription),AsyncAction=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W,U)||this;return Q.scheduler=W,Q.work=U,Q.pending=!1,Q}return E.prototype.schedule=function(W,U){if(U===void 0&&(U=0),this.closed)return this;this.state=W;var Q=this.id,G=this.scheduler;return Q!=null&&(this.id=this.recycleAsyncId(G,Q,U)),this.pending=!0,this.delay=U,this.id=this.id||this.requestAsyncId(G,this.id,U),this},E.prototype.requestAsyncId=function(W,U,Q){return Q===void 0&&(Q=0),setInterval(W.flush.bind(W,this),Q)},E.prototype.recycleAsyncId=function(W,U,Q){if(Q===void 0&&(Q=0),Q!==null&&this.delay===Q&&this.pending===!1)return U;clearInterval(U)},E.prototype.execute=function(W,U){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var Q=this._execute(W,U);if(Q)return Q;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},E.prototype._execute=function(W,U){var Q=!1,G=void 0;try{this.work(W)}catch(J){Q=!0,G=!!J&&J||new Error(J)}if(Q)return this.unsubscribe(),G},E.prototype._unsubscribe=function(){var W=this.id,U=this.scheduler,Q=U.actions,G=Q.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,G!==-1&&Q.splice(G,1),W!=null&&(this.id=this.recycleAsyncId(U,W,null)),this.delay=null},E}(Action),QueueAction=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W,U)||this;return Q.scheduler=W,Q.work=U,Q}return E.prototype.schedule=function(W,U){return U===void 0&&(U=0),U>0?D.prototype.schedule.call(this,W,U):(this.delay=U,this.state=W,this.scheduler.flush(this),this)},E.prototype.execute=function(W,U){return U>0||this.closed?D.prototype.execute.call(this,W,U):this._execute(W,U)},E.prototype.requestAsyncId=function(W,U,Q){return Q===void 0&&(Q=0),Q!==null&&Q>0||Q===null&&this.delay>0?D.prototype.requestAsyncId.call(this,W,U,Q):W.flush(this)},E}(AsyncAction),Scheduler=function(){function D(E,W){W===void 0&&(W=D.now),this.SchedulerAction=E,this.now=W}return D.prototype.schedule=function(E,W,U){return W===void 0&&(W=0),new this.SchedulerAction(this,E).schedule(U,W)},D.now=function(){return Date.now()},D}(),AsyncScheduler=function(D){__extends$1(E,D);function E(W,U){U===void 0&&(U=Scheduler.now);var Q=D.call(this,W,function(){return E.delegate&&E.delegate!==Q?E.delegate.now():U()})||this;return Q.actions=[],Q.active=!1,Q.scheduled=void 0,Q}return E.prototype.schedule=function(W,U,Q){return U===void 0&&(U=0),E.delegate&&E.delegate!==this?E.delegate.schedule(W,U,Q):D.prototype.schedule.call(this,W,U,Q)},E.prototype.flush=function(W){var U=this.actions;if(this.active){U.push(W);return}var Q;this.active=!0;do if(Q=W.execute(W.state,W.delay))break;while(W=U.shift());if(this.active=!1,Q){for(;W=U.shift();)W.unsubscribe();throw Q}},E}(Scheduler),QueueScheduler=function(D){__extends$1(E,D);function E(){return D!==null&&D.apply(this,arguments)||this}return E}(AsyncScheduler),queueScheduler=new QueueScheduler(QueueAction),queue=queueScheduler,EMPTY=new Observable(function(D){return D.complete()});function empty(D){return D?emptyScheduled(D):EMPTY}function emptyScheduled(D){return new Observable(function(E){return D.schedule(function(){return E.complete()})})}function isScheduler(D){return D&&typeof D.schedule=="function"}var subscribeToArray=function(D){return function(E){for(var W=0,U=D.length;W<U&&!E.closed;W++)E.next(D[W]);E.complete()}};function scheduleArray(D,E){return new Observable(function(W){var U=new Subscription,Q=0;return U.add(E.schedule(function(){if(Q===D.length){W.complete();return}W.next(D[Q++]),W.closed||U.add(this.schedule())})),U})}function fromArray(D,E){return E?scheduleArray(D,E):new Observable(subscribeToArray(D))}function of(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];var W=D[D.length-1];return isScheduler(W)?(D.pop(),scheduleArray(D,W)):fromArray(D)}function throwError(D,E){return E?new Observable(function(W){return E.schedule(dispatch$7,0,{error:D,subscriber:W})}):new Observable(function(W){return W.error(D)})}function dispatch$7(D){var E=D.error,W=D.subscriber;W.error(E)}var NotificationKind;NotificationKind||(NotificationKind={});var Notification=function(){function D(E,W,U){this.kind=E,this.value=W,this.error=U,this.hasValue=E==="N"}return D.prototype.observe=function(E){switch(this.kind){case"N":return E.next&&E.next(this.value);case"E":return E.error&&E.error(this.error);case"C":return E.complete&&E.complete()}},D.prototype.do=function(E,W,U){var Q=this.kind;switch(Q){case"N":return E&&E(this.value);case"E":return W&&W(this.error);case"C":return U&&U()}},D.prototype.accept=function(E,W,U){return E&&typeof E.next=="function"?this.observe(E):this.do(E,W,U)},D.prototype.toObservable=function(){var E=this.kind;switch(E){case"N":return of(this.value);case"E":return throwError(this.error);case"C":return empty()}throw new Error("unexpected notification kind value")},D.createNext=function(E){return typeof E<"u"?new D("N",E):D.undefinedValueNotification},D.createError=function(E){return new D("E",void 0,E)},D.createComplete=function(){return D.completeNotification},D.completeNotification=new D("C"),D.undefinedValueNotification=new D("N",void 0),D}();function observeOn(D,E){return E===void 0&&(E=0),function(U){return U.lift(new ObserveOnOperator(D,E))}}var ObserveOnOperator=function(){function D(E,W){W===void 0&&(W=0),this.scheduler=E,this.delay=W}return D.prototype.call=function(E,W){return W.subscribe(new ObserveOnSubscriber(E,this.scheduler,this.delay))},D}(),ObserveOnSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){Q===void 0&&(Q=0);var G=D.call(this,W)||this;return G.scheduler=U,G.delay=Q,G}return E.dispatch=function(W){var U=W.notification,Q=W.destination;U.observe(Q),this.unsubscribe()},E.prototype.scheduleMessage=function(W){var U=this.destination;U.add(this.scheduler.schedule(E.dispatch,this.delay,new ObserveOnMessage(W,this.destination)))},E.prototype._next=function(W){this.scheduleMessage(Notification.createNext(W))},E.prototype._error=function(W){this.scheduleMessage(Notification.createError(W)),this.unsubscribe()},E.prototype._complete=function(){this.scheduleMessage(Notification.createComplete()),this.unsubscribe()},E}(Subscriber),ObserveOnMessage=function(){function D(E,W){this.notification=E,this.destination=W}return D}(),ReplaySubject=function(D){__extends$1(E,D);function E(W,U,Q){W===void 0&&(W=Number.POSITIVE_INFINITY),U===void 0&&(U=Number.POSITIVE_INFINITY);var G=D.call(this)||this;return G.scheduler=Q,G._events=[],G._infiniteTimeWindow=!1,G._bufferSize=W<1?1:W,G._windowTime=U<1?1:U,U===Number.POSITIVE_INFINITY?(G._infiniteTimeWindow=!0,G.next=G.nextInfiniteTimeWindow):G.next=G.nextTimeWindow,G}return E.prototype.nextInfiniteTimeWindow=function(W){if(!this.isStopped){var U=this._events;U.push(W),U.length>this._bufferSize&&U.shift()}D.prototype.next.call(this,W)},E.prototype.nextTimeWindow=function(W){this.isStopped||(this._events.push(new ReplayEvent(this._getNow(),W)),this._trimBufferThenGetEvents()),D.prototype.next.call(this,W)},E.prototype._subscribe=function(W){var U=this._infiniteTimeWindow,Q=U?this._events:this._trimBufferThenGetEvents(),G=this.scheduler,J=Q.length,Y;if(this.closed)throw new ObjectUnsubscribedError;if(this.isStopped||this.hasError?Y=Subscription.EMPTY:(this.observers.push(W),Y=new SubjectSubscription(this,W)),G&&W.add(W=new ObserveOnSubscriber(W,G)),U)for(var X=0;X<J&&!W.closed;X++)W.next(Q[X]);else for(var X=0;X<J&&!W.closed;X++)W.next(Q[X].value);return this.hasError?W.error(this.thrownError):this.isStopped&&W.complete(),Y},E.prototype._getNow=function(){return(this.scheduler||queue).now()},E.prototype._trimBufferThenGetEvents=function(){for(var W=this._getNow(),U=this._bufferSize,Q=this._windowTime,G=this._events,J=G.length,Y=0;Y<J&&!(W-G[Y].time<Q);)Y++;return J>U&&(Y=Math.max(Y,J-U)),Y>0&&G.splice(0,Y),G},E}(Subject),ReplayEvent=function(){function D(E,W){this.time=E,this.value=W}return D}(),AsyncSubject=function(D){__extends$1(E,D);function E(){var W=D!==null&&D.apply(this,arguments)||this;return W.value=null,W.hasNext=!1,W.hasCompleted=!1,W}return E.prototype._subscribe=function(W){return this.hasError?(W.error(this.thrownError),Subscription.EMPTY):this.hasCompleted&&this.hasNext?(W.next(this.value),W.complete(),Subscription.EMPTY):D.prototype._subscribe.call(this,W)},E.prototype.next=function(W){this.hasCompleted||(this.value=W,this.hasNext=!0)},E.prototype.error=function(W){this.hasCompleted||D.prototype.error.call(this,W)},E.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&D.prototype.next.call(this,this.value),D.prototype.complete.call(this)},E}(Subject),nextHandle=1,RESOLVED=function(){return Promise.resolve()}(),activeHandles={};function findAndClearHandle(D){return D in activeHandles?(delete activeHandles[D],!0):!1}var Immediate={setImmediate:function(D){var E=nextHandle++;return activeHandles[E]=!0,RESOLVED.then(function(){return findAndClearHandle(E)&&D()}),E},clearImmediate:function(D){findAndClearHandle(D)}},AsapAction=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W,U)||this;return Q.scheduler=W,Q.work=U,Q}return E.prototype.requestAsyncId=function(W,U,Q){return Q===void 0&&(Q=0),Q!==null&&Q>0?D.prototype.requestAsyncId.call(this,W,U,Q):(W.actions.push(this),W.scheduled||(W.scheduled=Immediate.setImmediate(W.flush.bind(W,null))))},E.prototype.recycleAsyncId=function(W,U,Q){if(Q===void 0&&(Q=0),Q!==null&&Q>0||Q===null&&this.delay>0)return D.prototype.recycleAsyncId.call(this,W,U,Q);W.actions.length===0&&(Immediate.clearImmediate(U),W.scheduled=void 0)},E}(AsyncAction),AsapScheduler=function(D){__extends$1(E,D);function E(){return D!==null&&D.apply(this,arguments)||this}return E.prototype.flush=function(W){this.active=!0,this.scheduled=void 0;var U=this.actions,Q,G=-1,J=U.length;W=W||U.shift();do if(Q=W.execute(W.state,W.delay))break;while(++G<J&&(W=U.shift()));if(this.active=!1,Q){for(;++G<J&&(W=U.shift());)W.unsubscribe();throw Q}},E}(AsyncScheduler),asapScheduler=new AsapScheduler(AsapAction),asap=asapScheduler,asyncScheduler=new AsyncScheduler(AsyncAction),async=asyncScheduler,AnimationFrameAction=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W,U)||this;return Q.scheduler=W,Q.work=U,Q}return E.prototype.requestAsyncId=function(W,U,Q){return Q===void 0&&(Q=0),Q!==null&&Q>0?D.prototype.requestAsyncId.call(this,W,U,Q):(W.actions.push(this),W.scheduled||(W.scheduled=requestAnimationFrame(function(){return W.flush(null)})))},E.prototype.recycleAsyncId=function(W,U,Q){if(Q===void 0&&(Q=0),Q!==null&&Q>0||Q===null&&this.delay>0)return D.prototype.recycleAsyncId.call(this,W,U,Q);W.actions.length===0&&(cancelAnimationFrame(U),W.scheduled=void 0)},E}(AsyncAction),AnimationFrameScheduler=function(D){__extends$1(E,D);function E(){return D!==null&&D.apply(this,arguments)||this}return E.prototype.flush=function(W){this.active=!0,this.scheduled=void 0;var U=this.actions,Q,G=-1,J=U.length;W=W||U.shift();do if(Q=W.execute(W.state,W.delay))break;while(++G<J&&(W=U.shift()));if(this.active=!1,Q){for(;++G<J&&(W=U.shift());)W.unsubscribe();throw Q}},E}(AsyncScheduler),animationFrameScheduler=new AnimationFrameScheduler(AnimationFrameAction),animationFrame=animationFrameScheduler,VirtualTimeScheduler=function(D){__extends$1(E,D);function E(W,U){W===void 0&&(W=VirtualAction),U===void 0&&(U=Number.POSITIVE_INFINITY);var Q=D.call(this,W,function(){return Q.frame})||this;return Q.maxFrames=U,Q.frame=0,Q.index=-1,Q}return E.prototype.flush=function(){for(var W=this,U=W.actions,Q=W.maxFrames,G,J;(J=U[0])&&J.delay<=Q&&(U.shift(),this.frame=J.delay,!(G=J.execute(J.state,J.delay))););if(G){for(;J=U.shift();)J.unsubscribe();throw G}},E.frameTimeFactor=10,E}(AsyncScheduler),VirtualAction=function(D){__extends$1(E,D);function E(W,U,Q){Q===void 0&&(Q=W.index+=1);var G=D.call(this,W,U)||this;return G.scheduler=W,G.work=U,G.index=Q,G.active=!0,G.index=W.index=Q,G}return E.prototype.schedule=function(W,U){if(U===void 0&&(U=0),!this.id)return D.prototype.schedule.call(this,W,U);this.active=!1;var Q=new E(this.scheduler,this.work);return this.add(Q),Q.schedule(W,U)},E.prototype.requestAsyncId=function(W,U,Q){Q===void 0&&(Q=0),this.delay=W.frame+Q;var G=W.actions;return G.push(this),G.sort(E.sortActions),!0},E.prototype.recycleAsyncId=function(W,U,Q){},E.prototype._execute=function(W,U){if(this.active===!0)return D.prototype._execute.call(this,W,U)},E.sortActions=function(W,U){return W.delay===U.delay?W.index===U.index?0:W.index>U.index?1:-1:W.delay>U.delay?1:-1},E}(AsyncAction);function noop$3(){}function isObservable(D){return!!D&&(D instanceof Observable||typeof D.lift=="function"&&typeof D.subscribe=="function")}var ArgumentOutOfRangeErrorImpl=function(){function D(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return D.prototype=Object.create(Error.prototype),D}(),ArgumentOutOfRangeError=ArgumentOutOfRangeErrorImpl,EmptyErrorImpl=function(){function D(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return D.prototype=Object.create(Error.prototype),D}(),EmptyError=EmptyErrorImpl,TimeoutErrorImpl=function(){function D(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return D.prototype=Object.create(Error.prototype),D}(),TimeoutError=TimeoutErrorImpl;function map(D,E){return function(U){if(typeof D!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return U.lift(new MapOperator(D,E))}}var MapOperator=function(){function D(E,W){this.project=E,this.thisArg=W}return D.prototype.call=function(E,W){return W.subscribe(new MapSubscriber(E,this.project,this.thisArg))},D}(),MapSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.project=U,G.count=0,G.thisArg=Q||G,G}return E.prototype._next=function(W){var U;try{U=this.project.call(this.thisArg,W,this.count++)}catch(Q){this.destination.error(Q);return}this.destination.next(U)},E}(Subscriber);function bindCallback(D,E,W){if(E)if(isScheduler(E))W=E;else return function(){for(var U=[],Q=0;Q<arguments.length;Q++)U[Q]=arguments[Q];return bindCallback(D,W).apply(void 0,U).pipe(map(function(G){return isArray$4(G)?E.apply(void 0,G):E(G)}))};return function(){for(var U=[],Q=0;Q<arguments.length;Q++)U[Q]=arguments[Q];var G=this,J,Y={context:G,subject:J,callbackFunc:D,scheduler:W};return new Observable(function(X){if(W){var ee={args:U,subscriber:X,params:Y};return W.schedule(dispatch$6,0,ee)}else{if(!J){J=new AsyncSubject;var Z=function(){for(var oe=[],te=0;te<arguments.length;te++)oe[te]=arguments[te];J.next(oe.length<=1?oe[0]:oe),J.complete()};try{D.apply(G,U.concat([Z]))}catch(oe){canReportError(J)?J.error(oe):console.warn(oe)}}return J.subscribe(X)}})}}function dispatch$6(D){var E=this,W=D.args,U=D.subscriber,Q=D.params,G=Q.callbackFunc,J=Q.context,Y=Q.scheduler,X=Q.subject;if(!X){X=Q.subject=new AsyncSubject;var Z=function(){for(var ee=[],oe=0;oe<arguments.length;oe++)ee[oe]=arguments[oe];var te=ee.length<=1?ee[0]:ee;E.add(Y.schedule(dispatchNext$3,0,{value:te,subject:X}))};try{G.apply(J,W.concat([Z]))}catch(ee){X.error(ee)}}this.add(X.subscribe(U))}function dispatchNext$3(D){var E=D.value,W=D.subject;W.next(E),W.complete()}function bindNodeCallback(D,E,W){if(E)if(isScheduler(E))W=E;else return function(){for(var U=[],Q=0;Q<arguments.length;Q++)U[Q]=arguments[Q];return bindNodeCallback(D,W).apply(void 0,U).pipe(map(function(G){return isArray$4(G)?E.apply(void 0,G):E(G)}))};return function(){for(var U=[],Q=0;Q<arguments.length;Q++)U[Q]=arguments[Q];var G={subject:void 0,args:U,callbackFunc:D,scheduler:W,context:this};return new Observable(function(J){var Y=G.context,X=G.subject;if(W)return W.schedule(dispatch$5,0,{params:G,subscriber:J,context:Y});if(!X){X=G.subject=new AsyncSubject;var Z=function(){for(var ee=[],oe=0;oe<arguments.length;oe++)ee[oe]=arguments[oe];var te=ee.shift();if(te){X.error(te);return}X.next(ee.length<=1?ee[0]:ee),X.complete()};try{D.apply(Y,U.concat([Z]))}catch(ee){canReportError(X)?X.error(ee):console.warn(ee)}}return X.subscribe(J)})}}function dispatch$5(D){var E=this,W=D.params,U=D.subscriber,Q=D.context,G=W.callbackFunc,J=W.args,Y=W.scheduler,X=W.subject;if(!X){X=W.subject=new AsyncSubject;var Z=function(){for(var ee=[],oe=0;oe<arguments.length;oe++)ee[oe]=arguments[oe];var te=ee.shift();if(te)E.add(Y.schedule(dispatchError,0,{err:te,subject:X}));else{var re=ee.length<=1?ee[0]:ee;E.add(Y.schedule(dispatchNext$2,0,{value:re,subject:X}))}};try{G.apply(Q,J.concat([Z]))}catch(ee){this.add(Y.schedule(dispatchError,0,{err:ee,subject:X}))}}this.add(X.subscribe(U))}function dispatchNext$2(D){var E=D.value,W=D.subject;W.next(E),W.complete()}function dispatchError(D){var E=D.err,W=D.subject;W.error(E)}var OuterSubscriber=function(D){__extends$1(E,D);function E(){return D!==null&&D.apply(this,arguments)||this}return E.prototype.notifyNext=function(W,U,Q,G,J){this.destination.next(U)},E.prototype.notifyError=function(W,U){this.destination.error(W)},E.prototype.notifyComplete=function(W){this.destination.complete()},E}(Subscriber),InnerSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this)||this;return G.parent=W,G.outerValue=U,G.outerIndex=Q,G.index=0,G}return E.prototype._next=function(W){this.parent.notifyNext(this.outerValue,W,this.outerIndex,this.index++,this)},E.prototype._error=function(W){this.parent.notifyError(W,this),this.unsubscribe()},E.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},E}(Subscriber),subscribeToPromise=function(D){return function(E){return D.then(function(W){E.closed||(E.next(W),E.complete())},function(W){return E.error(W)}).then(null,hostReportError),E}};function getSymbolIterator(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var iterator=getSymbolIterator(),subscribeToIterable=function(D){return function(E){var W=D[iterator]();do{var U=void 0;try{U=W.next()}catch(Q){return E.error(Q),E}if(U.done){E.complete();break}if(E.next(U.value),E.closed)break}while(!0);return typeof W.return=="function"&&E.add(function(){W.return&&W.return()}),E}},subscribeToObservable=function(D){return function(E){var W=D[observable]();if(typeof W.subscribe!="function")throw new TypeError("Provided object does not correctly implement Symbol.observable");return W.subscribe(E)}},isArrayLike=function(D){return D&&typeof D.length=="number"&&typeof D!="function"};function isPromise(D){return!!D&&typeof D.subscribe!="function"&&typeof D.then=="function"}var subscribeTo=function(D){if(D&&typeof D[observable]=="function")return subscribeToObservable(D);if(isArrayLike(D))return subscribeToArray(D);if(isPromise(D))return subscribeToPromise(D);if(D&&typeof D[iterator]=="function")return subscribeToIterable(D);var E=isObject(D)?"an invalid object":"'"+D+"'",W="You provided "+E+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(W)};function subscribeToResult(D,E,W,U,Q){if(Q===void 0&&(Q=new InnerSubscriber(D,W,U)),!Q.closed)return E instanceof Observable?E.subscribe(Q):subscribeTo(E)(Q)}var NONE={};function combineLatest$1(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];var W=void 0,U=void 0;return isScheduler(D[D.length-1])&&(U=D.pop()),typeof D[D.length-1]=="function"&&(W=D.pop()),D.length===1&&isArray$4(D[0])&&(D=D[0]),fromArray(D,U).lift(new CombineLatestOperator(W))}var CombineLatestOperator=function(){function D(E){this.resultSelector=E}return D.prototype.call=function(E,W){return W.subscribe(new CombineLatestSubscriber(E,this.resultSelector))},D}(),CombineLatestSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.resultSelector=U,Q.active=0,Q.values=[],Q.observables=[],Q}return E.prototype._next=function(W){this.values.push(NONE),this.observables.push(W)},E.prototype._complete=function(){var W=this.observables,U=W.length;if(U===0)this.destination.complete();else{this.active=U,this.toRespond=U;for(var Q=0;Q<U;Q++){var G=W[Q];this.add(subscribeToResult(this,G,void 0,Q))}}},E.prototype.notifyComplete=function(W){(this.active-=1)===0&&this.destination.complete()},E.prototype.notifyNext=function(W,U,Q){var G=this.values,J=G[Q],Y=this.toRespond?J===NONE?--this.toRespond:this.toRespond:0;G[Q]=U,Y===0&&(this.resultSelector?this._tryResultSelector(G):this.destination.next(G.slice()))},E.prototype._tryResultSelector=function(W){var U;try{U=this.resultSelector.apply(this,W)}catch(Q){this.destination.error(Q);return}this.destination.next(U)},E}(OuterSubscriber);function scheduleObservable(D,E){return new Observable(function(W){var U=new Subscription;return U.add(E.schedule(function(){var Q=D[observable]();U.add(Q.subscribe({next:function(G){U.add(E.schedule(function(){return W.next(G)}))},error:function(G){U.add(E.schedule(function(){return W.error(G)}))},complete:function(){U.add(E.schedule(function(){return W.complete()}))}}))})),U})}function schedulePromise(D,E){return new Observable(function(W){var U=new Subscription;return U.add(E.schedule(function(){return D.then(function(Q){U.add(E.schedule(function(){W.next(Q),U.add(E.schedule(function(){return W.complete()}))}))},function(Q){U.add(E.schedule(function(){return W.error(Q)}))})})),U})}function scheduleIterable(D,E){if(!D)throw new Error("Iterable cannot be null");return new Observable(function(W){var U=new Subscription,Q;return U.add(function(){Q&&typeof Q.return=="function"&&Q.return()}),U.add(E.schedule(function(){Q=D[iterator](),U.add(E.schedule(function(){if(!W.closed){var G,J;try{var Y=Q.next();G=Y.value,J=Y.done}catch(X){W.error(X);return}J?W.complete():(W.next(G),this.schedule())}}))})),U})}function isInteropObservable(D){return D&&typeof D[observable]=="function"}function isIterable(D){return D&&typeof D[iterator]=="function"}function scheduled(D,E){if(D!=null){if(isInteropObservable(D))return scheduleObservable(D,E);if(isPromise(D))return schedulePromise(D,E);if(isArrayLike(D))return scheduleArray(D,E);if(isIterable(D)||typeof D=="string")return scheduleIterable(D,E)}throw new TypeError((D!==null&&typeof D||D)+" is not observable")}function from(D,E){return E?scheduled(D,E):D instanceof Observable?D:new Observable(subscribeTo(D))}var SimpleInnerSubscriber=function(D){__extends$1(E,D);function E(W){var U=D.call(this)||this;return U.parent=W,U}return E.prototype._next=function(W){this.parent.notifyNext(W)},E.prototype._error=function(W){this.parent.notifyError(W),this.unsubscribe()},E.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},E}(Subscriber),SimpleOuterSubscriber=function(D){__extends$1(E,D);function E(){return D!==null&&D.apply(this,arguments)||this}return E.prototype.notifyNext=function(W){this.destination.next(W)},E.prototype.notifyError=function(W){this.destination.error(W)},E.prototype.notifyComplete=function(){this.destination.complete()},E}(Subscriber);function innerSubscribe(D,E){if(!E.closed){if(D instanceof Observable)return D.subscribe(E);var W;try{W=subscribeTo(D)(E)}catch(U){E.error(U)}return W}}function mergeMap(D,E,W){return W===void 0&&(W=Number.POSITIVE_INFINITY),typeof E=="function"?function(U){return U.pipe(mergeMap(function(Q,G){return from(D(Q,G)).pipe(map(function(J,Y){return E(Q,J,G,Y)}))},W))}:(typeof E=="number"&&(W=E),function(U){return U.lift(new MergeMapOperator(D,W))})}var MergeMapOperator=function(){function D(E,W){W===void 0&&(W=Number.POSITIVE_INFINITY),this.project=E,this.concurrent=W}return D.prototype.call=function(E,W){return W.subscribe(new MergeMapSubscriber(E,this.project,this.concurrent))},D}(),MergeMapSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){Q===void 0&&(Q=Number.POSITIVE_INFINITY);var G=D.call(this,W)||this;return G.project=U,G.concurrent=Q,G.hasCompleted=!1,G.buffer=[],G.active=0,G.index=0,G}return E.prototype._next=function(W){this.active<this.concurrent?this._tryNext(W):this.buffer.push(W)},E.prototype._tryNext=function(W){var U,Q=this.index++;try{U=this.project(W,Q)}catch(G){this.destination.error(G);return}this.active++,this._innerSub(U)},E.prototype._innerSub=function(W){var U=new SimpleInnerSubscriber(this),Q=this.destination;Q.add(U);var G=innerSubscribe(W,U);G!==U&&Q.add(G)},E.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&this.destination.complete(),this.unsubscribe()},E.prototype.notifyNext=function(W){this.destination.next(W)},E.prototype.notifyComplete=function(){var W=this.buffer;this.active--,W.length>0?this._next(W.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},E}(SimpleOuterSubscriber),flatMap=mergeMap;function mergeAll(D){return D===void 0&&(D=Number.POSITIVE_INFINITY),mergeMap(identity,D)}function concatAll(){return mergeAll(1)}function concat$1(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];return concatAll()(of.apply(void 0,D))}function defer(D){return new Observable(function(E){var W;try{W=D()}catch(Q){E.error(Q);return}var U=W?from(W):empty();return U.subscribe(E)})}function forkJoin(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];if(D.length===1){var W=D[0];if(isArray$4(W))return forkJoinInternal(W,null);if(isObject(W)&&Object.getPrototypeOf(W)===Object.prototype){var U=Object.keys(W);return forkJoinInternal(U.map(function(G){return W[G]}),U)}}if(typeof D[D.length-1]=="function"){var Q=D.pop();return D=D.length===1&&isArray$4(D[0])?D[0]:D,forkJoinInternal(D,null).pipe(map(function(G){return Q.apply(void 0,G)}))}return forkJoinInternal(D,null)}function forkJoinInternal(D,E){return new Observable(function(W){var U=D.length;if(U===0){W.complete();return}for(var Q=new Array(U),G=0,J=0,Y=function(Z){var ee=from(D[Z]),oe=!1;W.add(ee.subscribe({next:function(te){oe||(oe=!0,J++),Q[Z]=te},error:function(te){return W.error(te)},complete:function(){G++,(G===U||!oe)&&(J===U&&W.next(E?E.reduce(function(te,re,ae){return te[re]=Q[ae],te},{}):Q),W.complete())}}))},X=0;X<U;X++)Y(X)})}function fromEvent(D,E,W,U){return isFunction(W)&&(U=W,W=void 0),U?fromEvent(D,E,W).pipe(map(function(Q){return isArray$4(Q)?U.apply(void 0,Q):U(Q)})):new Observable(function(Q){function G(J){arguments.length>1?Q.next(Array.prototype.slice.call(arguments)):Q.next(J)}setupSubscription(D,E,G,Q,W)})}function setupSubscription(D,E,W,U,Q){var G;if(isEventTarget(D)){var J=D;D.addEventListener(E,W,Q),G=function(){return J.removeEventListener(E,W,Q)}}else if(isJQueryStyleEventEmitter(D)){var Y=D;D.on(E,W),G=function(){return Y.off(E,W)}}else if(isNodeStyleEventEmitter(D)){var X=D;D.addListener(E,W),G=function(){return X.removeListener(E,W)}}else if(D&&D.length)for(var Z=0,ee=D.length;Z<ee;Z++)setupSubscription(D[Z],E,W,U,Q);else throw new TypeError("Invalid event target");U.add(G)}function isNodeStyleEventEmitter(D){return D&&typeof D.addListener=="function"&&typeof D.removeListener=="function"}function isJQueryStyleEventEmitter(D){return D&&typeof D.on=="function"&&typeof D.off=="function"}function isEventTarget(D){return D&&typeof D.addEventListener=="function"&&typeof D.removeEventListener=="function"}function fromEventPattern(D,E,W){return W?fromEventPattern(D,E).pipe(map(function(U){return isArray$4(U)?W.apply(void 0,U):W(U)})):new Observable(function(U){var Q=function(){for(var J=[],Y=0;Y<arguments.length;Y++)J[Y]=arguments[Y];return U.next(J.length===1?J[0]:J)},G;try{G=D(Q)}catch(J){U.error(J);return}if(isFunction(E))return function(){return E(Q,G)}})}function generate(D,E,W,U,Q){var G,J;if(arguments.length==1){var Y=D;J=Y.initialState,E=Y.condition,W=Y.iterate,G=Y.resultSelector||identity,Q=Y.scheduler}else U===void 0||isScheduler(U)?(J=D,G=identity,Q=U):(J=D,G=U);return new Observable(function(X){var Z=J;if(Q)return Q.schedule(dispatch$4,0,{subscriber:X,iterate:W,condition:E,resultSelector:G,state:Z});do{if(E){var ee=void 0;try{ee=E(Z)}catch(te){X.error(te);return}if(!ee){X.complete();break}}var oe=void 0;try{oe=G(Z)}catch(te){X.error(te);return}if(X.next(oe),X.closed)break;try{Z=W(Z)}catch(te){X.error(te);return}}while(!0)})}function dispatch$4(D){var E=D.subscriber,W=D.condition;if(!E.closed){if(D.needIterate)try{D.state=D.iterate(D.state)}catch(G){E.error(G);return}else D.needIterate=!0;if(W){var U=void 0;try{U=W(D.state)}catch(G){E.error(G);return}if(!U){E.complete();return}if(E.closed)return}var Q;try{Q=D.resultSelector(D.state)}catch(G){E.error(G);return}if(!E.closed&&(E.next(Q),!E.closed))return this.schedule(D)}}function iif(D,E,W){return E===void 0&&(E=EMPTY),W===void 0&&(W=EMPTY),defer(function(){return D()?E:W})}function isNumeric(D){return!isArray$4(D)&&D-parseFloat(D)+1>=0}function interval(D,E){return D===void 0&&(D=0),E===void 0&&(E=async),(!isNumeric(D)||D<0)&&(D=0),(!E||typeof E.schedule!="function")&&(E=async),new Observable(function(W){return W.add(E.schedule(dispatch$3,D,{subscriber:W,counter:0,period:D})),W})}function dispatch$3(D){var E=D.subscriber,W=D.counter,U=D.period;E.next(W),this.schedule({subscriber:E,counter:W+1,period:U},U)}function merge$2(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];var W=Number.POSITIVE_INFINITY,U=null,Q=D[D.length-1];return isScheduler(Q)?(U=D.pop(),D.length>1&&typeof D[D.length-1]=="number"&&(W=D.pop())):typeof Q=="number"&&(W=D.pop()),U===null&&D.length===1&&D[0]instanceof Observable?D[0]:mergeAll(W)(fromArray(D,U))}var NEVER=new Observable(noop$3);function never(){return NEVER}function onErrorResumeNext$1(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];if(D.length===0)return EMPTY;var W=D[0],U=D.slice(1);return D.length===1&&isArray$4(W)?onErrorResumeNext$1.apply(void 0,W):new Observable(function(Q){var G=function(){return Q.add(onErrorResumeNext$1.apply(void 0,U).subscribe(Q))};return from(W).subscribe({next:function(J){Q.next(J)},error:G,complete:G})})}function pairs(D,E){return E?new Observable(function(W){var U=Object.keys(D),Q=new Subscription;return Q.add(E.schedule(dispatch$2,0,{keys:U,index:0,subscriber:W,subscription:Q,obj:D})),Q}):new Observable(function(W){for(var U=Object.keys(D),Q=0;Q<U.length&&!W.closed;Q++){var G=U[Q];D.hasOwnProperty(G)&&W.next([G,D[G]])}W.complete()})}function dispatch$2(D){var E=D.keys,W=D.index,U=D.subscriber,Q=D.subscription,G=D.obj;if(!U.closed)if(W<E.length){var J=E[W];U.next([J,G[J]]),Q.add(this.schedule({keys:E,index:W+1,subscriber:U,subscription:Q,obj:G}))}else U.complete()}function not(D,E){function W(){return!W.pred.apply(W.thisArg,arguments)}return W.pred=D,W.thisArg=E,W}function filter(D,E){return function(U){return U.lift(new FilterOperator(D,E))}}var FilterOperator=function(){function D(E,W){this.predicate=E,this.thisArg=W}return D.prototype.call=function(E,W){return W.subscribe(new FilterSubscriber(E,this.predicate,this.thisArg))},D}(),FilterSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.predicate=U,G.thisArg=Q,G.count=0,G}return E.prototype._next=function(W){var U;try{U=this.predicate.call(this.thisArg,W,this.count++)}catch(Q){this.destination.error(Q);return}U&&this.destination.next(W)},E}(Subscriber);function partition$1(D,E,W){return[filter(E,W)(new Observable(subscribeTo(D))),filter(not(E,W))(new Observable(subscribeTo(D)))]}function race$1(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];if(D.length===1)if(isArray$4(D[0]))D=D[0];else return D[0];return fromArray(D,void 0).lift(new RaceOperator)}var RaceOperator=function(){function D(){}return D.prototype.call=function(E,W){return W.subscribe(new RaceSubscriber(E))},D}(),RaceSubscriber=function(D){__extends$1(E,D);function E(W){var U=D.call(this,W)||this;return U.hasFirst=!1,U.observables=[],U.subscriptions=[],U}return E.prototype._next=function(W){this.observables.push(W)},E.prototype._complete=function(){var W=this.observables,U=W.length;if(U===0)this.destination.complete();else{for(var Q=0;Q<U&&!this.hasFirst;Q++){var G=W[Q],J=subscribeToResult(this,G,void 0,Q);this.subscriptions&&this.subscriptions.push(J),this.add(J)}this.observables=null}},E.prototype.notifyNext=function(W,U,Q){if(!this.hasFirst){this.hasFirst=!0;for(var G=0;G<this.subscriptions.length;G++)if(G!==Q){var J=this.subscriptions[G];J.unsubscribe(),this.remove(J)}this.subscriptions=null}this.destination.next(U)},E}(OuterSubscriber);function range$1(D,E,W){return D===void 0&&(D=0),new Observable(function(U){E===void 0&&(E=D,D=0);var Q=0,G=D;if(W)return W.schedule(dispatch$1,0,{index:Q,count:E,start:D,subscriber:U});do{if(Q++>=E){U.complete();break}if(U.next(G++),U.closed)break}while(!0)})}function dispatch$1(D){var E=D.start,W=D.index,U=D.count,Q=D.subscriber;if(W>=U){Q.complete();return}Q.next(E),!Q.closed&&(D.index=W+1,D.start=E+1,this.schedule(D))}function timer(D,E,W){D===void 0&&(D=0);var U=-1;return isNumeric(E)?U=Number(E)<1&&1||Number(E):isScheduler(E)&&(W=E),isScheduler(W)||(W=async),new Observable(function(Q){var G=isNumeric(D)?D:+D-W.now();return W.schedule(dispatch,G,{index:0,period:U,subscriber:Q})})}function dispatch(D){var E=D.index,W=D.period,U=D.subscriber;if(U.next(E),!U.closed){if(W===-1)return U.complete();D.index=E+1,this.schedule(D,W)}}function using(D,E){return new Observable(function(W){var U;try{U=D()}catch(Y){W.error(Y);return}var Q;try{Q=E(U)}catch(Y){W.error(Y);return}var G=Q?from(Q):EMPTY,J=G.subscribe(W);return function(){J.unsubscribe(),U&&U.unsubscribe()}})}function zip$1(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];var W=D[D.length-1];return typeof W=="function"&&D.pop(),fromArray(D,void 0).lift(new ZipOperator(W))}var ZipOperator=function(){function D(E){this.resultSelector=E}return D.prototype.call=function(E,W){return W.subscribe(new ZipSubscriber(E,this.resultSelector))},D}(),ZipSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.resultSelector=U,G.iterators=[],G.active=0,G.resultSelector=typeof U=="function"?U:void 0,G}return E.prototype._next=function(W){var U=this.iterators;isArray$4(W)?U.push(new StaticArrayIterator(W)):typeof W[iterator]=="function"?U.push(new StaticIterator(W[iterator]())):U.push(new ZipBufferIterator(this.destination,this,W))},E.prototype._complete=function(){var W=this.iterators,U=W.length;if(this.unsubscribe(),U===0){this.destination.complete();return}this.active=U;for(var Q=0;Q<U;Q++){var G=W[Q];if(G.stillUnsubscribed){var J=this.destination;J.add(G.subscribe())}else this.active--}},E.prototype.notifyInactive=function(){this.active--,this.active===0&&this.destination.complete()},E.prototype.checkIterators=function(){for(var W=this.iterators,U=W.length,Q=this.destination,G=0;G<U;G++){var J=W[G];if(typeof J.hasValue=="function"&&!J.hasValue())return}for(var Y=!1,X=[],G=0;G<U;G++){var J=W[G],Z=J.next();if(J.hasCompleted()&&(Y=!0),Z.done){Q.complete();return}X.push(Z.value)}this.resultSelector?this._tryresultSelector(X):Q.next(X),Y&&Q.complete()},E.prototype._tryresultSelector=function(W){var U;try{U=this.resultSelector.apply(this,W)}catch(Q){this.destination.error(Q);return}this.destination.next(U)},E}(Subscriber),StaticIterator=function(){function D(E){this.iterator=E,this.nextResult=E.next()}return D.prototype.hasValue=function(){return!0},D.prototype.next=function(){var E=this.nextResult;return this.nextResult=this.iterator.next(),E},D.prototype.hasCompleted=function(){var E=this.nextResult;return!!(E&&E.done)},D}(),StaticArrayIterator=function(){function D(E){this.array=E,this.index=0,this.length=0,this.length=E.length}return D.prototype[iterator]=function(){return this},D.prototype.next=function(E){var W=this.index++,U=this.array;return W<this.length?{value:U[W],done:!1}:{value:null,done:!0}},D.prototype.hasValue=function(){return this.array.length>this.index},D.prototype.hasCompleted=function(){return this.array.length===this.index},D}(),ZipBufferIterator=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.parent=U,G.observable=Q,G.stillUnsubscribed=!0,G.buffer=[],G.isComplete=!1,G}return E.prototype[iterator]=function(){return this},E.prototype.next=function(){var W=this.buffer;return W.length===0&&this.isComplete?{value:null,done:!0}:{value:W.shift(),done:!1}},E.prototype.hasValue=function(){return this.buffer.length>0},E.prototype.hasCompleted=function(){return this.buffer.length===0&&this.isComplete},E.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},E.prototype.notifyNext=function(W){this.buffer.push(W),this.parent.checkIterators()},E.prototype.subscribe=function(){return innerSubscribe(this.observable,new SimpleInnerSubscriber(this))},E}(SimpleOuterSubscriber);const _esm5=Object.freeze(Object.defineProperty({__proto__:null,ArgumentOutOfRangeError,AsyncSubject,BehaviorSubject,ConnectableObservable,EMPTY,EmptyError,GroupedObservable,NEVER,Notification,get NotificationKind(){return NotificationKind},ObjectUnsubscribedError,Observable,ReplaySubject,Scheduler,Subject,Subscriber,Subscription,TimeoutError,UnsubscriptionError,VirtualAction,VirtualTimeScheduler,animationFrame,animationFrameScheduler,asap,asapScheduler,async,asyncScheduler,bindCallback,bindNodeCallback,combineLatest:combineLatest$1,concat:concat$1,config:config$1,defer,empty,forkJoin,from,fromEvent,fromEventPattern,generate,identity,iif,interval,isObservable,merge:merge$2,never,noop:noop$3,observable,of,onErrorResumeNext:onErrorResumeNext$1,pairs,partition:partition$1,pipe:pipe$1,queue,queueScheduler,race:race$1,range:range$1,scheduled,throwError,timer,using,zip:zip$1},Symbol.toStringTag,{value:"Module"})),require$$2$1=getAugmentedNamespace(_esm5);function audit(D){return function(W){return W.lift(new AuditOperator(D))}}var AuditOperator=function(){function D(E){this.durationSelector=E}return D.prototype.call=function(E,W){return W.subscribe(new AuditSubscriber(E,this.durationSelector))},D}(),AuditSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.durationSelector=U,Q.hasValue=!1,Q}return E.prototype._next=function(W){if(this.value=W,this.hasValue=!0,!this.throttled){var U=void 0;try{var Q=this.durationSelector;U=Q(W)}catch(J){return this.destination.error(J)}var G=innerSubscribe(U,new SimpleInnerSubscriber(this));!G||G.closed?this.clearThrottle():this.add(this.throttled=G)}},E.prototype.clearThrottle=function(){var W=this,U=W.value,Q=W.hasValue,G=W.throttled;G&&(this.remove(G),this.throttled=void 0,G.unsubscribe()),Q&&(this.value=void 0,this.hasValue=!1,this.destination.next(U))},E.prototype.notifyNext=function(){this.clearThrottle()},E.prototype.notifyComplete=function(){this.clearThrottle()},E}(SimpleOuterSubscriber);function auditTime(D,E){return E===void 0&&(E=async),audit(function(){return timer(D,E)})}function buffer(D){return function(W){return W.lift(new BufferOperator(D))}}var BufferOperator=function(){function D(E){this.closingNotifier=E}return D.prototype.call=function(E,W){return W.subscribe(new BufferSubscriber(E,this.closingNotifier))},D}(),BufferSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.buffer=[],Q.add(innerSubscribe(U,new SimpleInnerSubscriber(Q))),Q}return E.prototype._next=function(W){this.buffer.push(W)},E.prototype.notifyNext=function(){var W=this.buffer;this.buffer=[],this.destination.next(W)},E}(SimpleOuterSubscriber);function bufferCount(D,E){return E===void 0&&(E=null),function(U){return U.lift(new BufferCountOperator(D,E))}}var BufferCountOperator=function(){function D(E,W){this.bufferSize=E,this.startBufferEvery=W,!W||E===W?this.subscriberClass=BufferCountSubscriber:this.subscriberClass=BufferSkipCountSubscriber}return D.prototype.call=function(E,W){return W.subscribe(new this.subscriberClass(E,this.bufferSize,this.startBufferEvery))},D}(),BufferCountSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.bufferSize=U,Q.buffer=[],Q}return E.prototype._next=function(W){var U=this.buffer;U.push(W),U.length==this.bufferSize&&(this.destination.next(U),this.buffer=[])},E.prototype._complete=function(){var W=this.buffer;W.length>0&&this.destination.next(W),D.prototype._complete.call(this)},E}(Subscriber),BufferSkipCountSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.bufferSize=U,G.startBufferEvery=Q,G.buffers=[],G.count=0,G}return E.prototype._next=function(W){var U=this,Q=U.bufferSize,G=U.startBufferEvery,J=U.buffers,Y=U.count;this.count++,Y%G===0&&J.push([]);for(var X=J.length;X--;){var Z=J[X];Z.push(W),Z.length===Q&&(J.splice(X,1),this.destination.next(Z))}},E.prototype._complete=function(){for(var W=this,U=W.buffers,Q=W.destination;U.length>0;){var G=U.shift();G.length>0&&Q.next(G)}D.prototype._complete.call(this)},E}(Subscriber);function bufferTime(D){var E=arguments.length,W=async;isScheduler(arguments[arguments.length-1])&&(W=arguments[arguments.length-1],E--);var U=null;E>=2&&(U=arguments[1]);var Q=Number.POSITIVE_INFINITY;return E>=3&&(Q=arguments[2]),function(J){return J.lift(new BufferTimeOperator(D,U,Q,W))}}var BufferTimeOperator=function(){function D(E,W,U,Q){this.bufferTimeSpan=E,this.bufferCreationInterval=W,this.maxBufferSize=U,this.scheduler=Q}return D.prototype.call=function(E,W){return W.subscribe(new BufferTimeSubscriber(E,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},D}(),Context=function(){function D(){this.buffer=[]}return D}(),BufferTimeSubscriber=function(D){__extends$1(E,D);function E(W,U,Q,G,J){var Y=D.call(this,W)||this;Y.bufferTimeSpan=U,Y.bufferCreationInterval=Q,Y.maxBufferSize=G,Y.scheduler=J,Y.contexts=[];var X=Y.openContext();if(Y.timespanOnly=Q==null||Q<0,Y.timespanOnly){var Z={subscriber:Y,context:X,bufferTimeSpan:U};Y.add(X.closeAction=J.schedule(dispatchBufferTimeSpanOnly,U,Z))}else{var ee={subscriber:Y,context:X},oe={bufferTimeSpan:U,bufferCreationInterval:Q,subscriber:Y,scheduler:J};Y.add(X.closeAction=J.schedule(dispatchBufferClose,U,ee)),Y.add(J.schedule(dispatchBufferCreation,Q,oe))}return Y}return E.prototype._next=function(W){for(var U=this.contexts,Q=U.length,G,J=0;J<Q;J++){var Y=U[J],X=Y.buffer;X.push(W),X.length==this.maxBufferSize&&(G=Y)}G&&this.onBufferFull(G)},E.prototype._error=function(W){this.contexts.length=0,D.prototype._error.call(this,W)},E.prototype._complete=function(){for(var W=this,U=W.contexts,Q=W.destination;U.length>0;){var G=U.shift();Q.next(G.buffer)}D.prototype._complete.call(this)},E.prototype._unsubscribe=function(){this.contexts=null},E.prototype.onBufferFull=function(W){this.closeContext(W);var U=W.closeAction;if(U.unsubscribe(),this.remove(U),!this.closed&&this.timespanOnly){W=this.openContext();var Q=this.bufferTimeSpan,G={subscriber:this,context:W,bufferTimeSpan:Q};this.add(W.closeAction=this.scheduler.schedule(dispatchBufferTimeSpanOnly,Q,G))}},E.prototype.openContext=function(){var W=new Context;return this.contexts.push(W),W},E.prototype.closeContext=function(W){this.destination.next(W.buffer);var U=this.contexts,Q=U?U.indexOf(W):-1;Q>=0&&U.splice(U.indexOf(W),1)},E}(Subscriber);function dispatchBufferTimeSpanOnly(D){var E=D.subscriber,W=D.context;W&&E.closeContext(W),E.closed||(D.context=E.openContext(),D.context.closeAction=this.schedule(D,D.bufferTimeSpan))}function dispatchBufferCreation(D){var E=D.bufferCreationInterval,W=D.bufferTimeSpan,U=D.subscriber,Q=D.scheduler,G=U.openContext(),J=this;U.closed||(U.add(G.closeAction=Q.schedule(dispatchBufferClose,W,{subscriber:U,context:G})),J.schedule(D,E))}function dispatchBufferClose(D){var E=D.subscriber,W=D.context;E.closeContext(W)}function bufferToggle(D,E){return function(U){return U.lift(new BufferToggleOperator(D,E))}}var BufferToggleOperator=function(){function D(E,W){this.openings=E,this.closingSelector=W}return D.prototype.call=function(E,W){return W.subscribe(new BufferToggleSubscriber(E,this.openings,this.closingSelector))},D}(),BufferToggleSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.closingSelector=Q,G.contexts=[],G.add(subscribeToResult(G,U)),G}return E.prototype._next=function(W){for(var U=this.contexts,Q=U.length,G=0;G<Q;G++)U[G].buffer.push(W)},E.prototype._error=function(W){for(var U=this.contexts;U.length>0;){var Q=U.shift();Q.subscription.unsubscribe(),Q.buffer=null,Q.subscription=null}this.contexts=null,D.prototype._error.call(this,W)},E.prototype._complete=function(){for(var W=this.contexts;W.length>0;){var U=W.shift();this.destination.next(U.buffer),U.subscription.unsubscribe(),U.buffer=null,U.subscription=null}this.contexts=null,D.prototype._complete.call(this)},E.prototype.notifyNext=function(W,U){W?this.closeBuffer(W):this.openBuffer(U)},E.prototype.notifyComplete=function(W){this.closeBuffer(W.context)},E.prototype.openBuffer=function(W){try{var U=this.closingSelector,Q=U.call(this,W);Q&&this.trySubscribe(Q)}catch(G){this._error(G)}},E.prototype.closeBuffer=function(W){var U=this.contexts;if(U&&W){var Q=W.buffer,G=W.subscription;this.destination.next(Q),U.splice(U.indexOf(W),1),this.remove(G),G.unsubscribe()}},E.prototype.trySubscribe=function(W){var U=this.contexts,Q=[],G=new Subscription,J={buffer:Q,subscription:G};U.push(J);var Y=subscribeToResult(this,W,J);!Y||Y.closed?this.closeBuffer(J):(Y.context=J,this.add(Y),G.add(Y))},E}(OuterSubscriber);function bufferWhen(D){return function(E){return E.lift(new BufferWhenOperator(D))}}var BufferWhenOperator=function(){function D(E){this.closingSelector=E}return D.prototype.call=function(E,W){return W.subscribe(new BufferWhenSubscriber(E,this.closingSelector))},D}(),BufferWhenSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.closingSelector=U,Q.subscribing=!1,Q.openBuffer(),Q}return E.prototype._next=function(W){this.buffer.push(W)},E.prototype._complete=function(){var W=this.buffer;W&&this.destination.next(W),D.prototype._complete.call(this)},E.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},E.prototype.notifyNext=function(){this.openBuffer()},E.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},E.prototype.openBuffer=function(){var W=this.closingSubscription;W&&(this.remove(W),W.unsubscribe());var U=this.buffer;this.buffer&&this.destination.next(U),this.buffer=[];var Q;try{var G=this.closingSelector;Q=G()}catch(J){return this.error(J)}W=new Subscription,this.closingSubscription=W,this.add(W),this.subscribing=!0,W.add(innerSubscribe(Q,new SimpleInnerSubscriber(this))),this.subscribing=!1},E}(SimpleOuterSubscriber);function catchError(D){return function(W){var U=new CatchOperator(D),Q=W.lift(U);return U.caught=Q}}var CatchOperator=function(){function D(E){this.selector=E}return D.prototype.call=function(E,W){return W.subscribe(new CatchSubscriber(E,this.selector,this.caught))},D}(),CatchSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.selector=U,G.caught=Q,G}return E.prototype.error=function(W){if(!this.isStopped){var U=void 0;try{U=this.selector(W,this.caught)}catch(J){D.prototype.error.call(this,J);return}this._unsubscribeAndRecycle();var Q=new SimpleInnerSubscriber(this);this.add(Q);var G=innerSubscribe(U,Q);G!==Q&&this.add(G)}},E}(SimpleOuterSubscriber);function combineAll(D){return function(E){return E.lift(new CombineLatestOperator(D))}}function combineLatest(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];var W=null;return typeof D[D.length-1]=="function"&&(W=D.pop()),D.length===1&&isArray$4(D[0])&&(D=D[0].slice()),function(U){return U.lift.call(from([U].concat(D)),new CombineLatestOperator(W))}}function concat(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];return function(W){return W.lift.call(concat$1.apply(void 0,[W].concat(D)))}}function concatMap(D,E){return mergeMap(D,E,1)}function concatMapTo(D,E){return concatMap(function(){return D},E)}function count(D){return function(E){return E.lift(new CountOperator(D,E))}}var CountOperator=function(){function D(E,W){this.predicate=E,this.source=W}return D.prototype.call=function(E,W){return W.subscribe(new CountSubscriber(E,this.predicate,this.source))},D}(),CountSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.predicate=U,G.source=Q,G.count=0,G.index=0,G}return E.prototype._next=function(W){this.predicate?this._tryPredicate(W):this.count++},E.prototype._tryPredicate=function(W){var U;try{U=this.predicate(W,this.index++,this.source)}catch(Q){this.destination.error(Q);return}U&&this.count++},E.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},E}(Subscriber);function debounce(D){return function(E){return E.lift(new DebounceOperator(D))}}var DebounceOperator=function(){function D(E){this.durationSelector=E}return D.prototype.call=function(E,W){return W.subscribe(new DebounceSubscriber(E,this.durationSelector))},D}(),DebounceSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.durationSelector=U,Q.hasValue=!1,Q}return E.prototype._next=function(W){try{var U=this.durationSelector.call(this,W);U&&this._tryNext(W,U)}catch(Q){this.destination.error(Q)}},E.prototype._complete=function(){this.emitValue(),this.destination.complete()},E.prototype._tryNext=function(W,U){var Q=this.durationSubscription;this.value=W,this.hasValue=!0,Q&&(Q.unsubscribe(),this.remove(Q)),Q=innerSubscribe(U,new SimpleInnerSubscriber(this)),Q&&!Q.closed&&this.add(this.durationSubscription=Q)},E.prototype.notifyNext=function(){this.emitValue()},E.prototype.notifyComplete=function(){this.emitValue()},E.prototype.emitValue=function(){if(this.hasValue){var W=this.value,U=this.durationSubscription;U&&(this.durationSubscription=void 0,U.unsubscribe(),this.remove(U)),this.value=void 0,this.hasValue=!1,D.prototype._next.call(this,W)}},E}(SimpleOuterSubscriber);function debounceTime(D,E){return E===void 0&&(E=async),function(W){return W.lift(new DebounceTimeOperator(D,E))}}var DebounceTimeOperator=function(){function D(E,W){this.dueTime=E,this.scheduler=W}return D.prototype.call=function(E,W){return W.subscribe(new DebounceTimeSubscriber(E,this.dueTime,this.scheduler))},D}(),DebounceTimeSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.dueTime=U,G.scheduler=Q,G.debouncedSubscription=null,G.lastValue=null,G.hasValue=!1,G}return E.prototype._next=function(W){this.clearDebounce(),this.lastValue=W,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(dispatchNext$1,this.dueTime,this))},E.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},E.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var W=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(W)}},E.prototype.clearDebounce=function(){var W=this.debouncedSubscription;W!==null&&(this.remove(W),W.unsubscribe(),this.debouncedSubscription=null)},E}(Subscriber);function dispatchNext$1(D){D.debouncedNext()}function defaultIfEmpty(D){return D===void 0&&(D=null),function(E){return E.lift(new DefaultIfEmptyOperator(D))}}var DefaultIfEmptyOperator=function(){function D(E){this.defaultValue=E}return D.prototype.call=function(E,W){return W.subscribe(new DefaultIfEmptySubscriber(E,this.defaultValue))},D}(),DefaultIfEmptySubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.defaultValue=U,Q.isEmpty=!0,Q}return E.prototype._next=function(W){this.isEmpty=!1,this.destination.next(W)},E.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},E}(Subscriber);function isDate(D){return D instanceof Date&&!isNaN(+D)}function delay(D,E){E===void 0&&(E=async);var W=isDate(D),U=W?+D-E.now():Math.abs(D);return function(Q){return Q.lift(new DelayOperator(U,E))}}var DelayOperator=function(){function D(E,W){this.delay=E,this.scheduler=W}return D.prototype.call=function(E,W){return W.subscribe(new DelaySubscriber(E,this.delay,this.scheduler))},D}(),DelaySubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.delay=U,G.scheduler=Q,G.queue=[],G.active=!1,G.errored=!1,G}return E.dispatch=function(W){for(var U=W.source,Q=U.queue,G=W.scheduler,J=W.destination;Q.length>0&&Q[0].time-G.now()<=0;)Q.shift().notification.observe(J);if(Q.length>0){var Y=Math.max(0,Q[0].time-G.now());this.schedule(W,Y)}else this.unsubscribe(),U.active=!1},E.prototype._schedule=function(W){this.active=!0;var U=this.destination;U.add(W.schedule(E.dispatch,this.delay,{source:this,destination:this.destination,scheduler:W}))},E.prototype.scheduleNotification=function(W){if(this.errored!==!0){var U=this.scheduler,Q=new DelayMessage(U.now()+this.delay,W);this.queue.push(Q),this.active===!1&&this._schedule(U)}},E.prototype._next=function(W){this.scheduleNotification(Notification.createNext(W))},E.prototype._error=function(W){this.errored=!0,this.queue=[],this.destination.error(W),this.unsubscribe()},E.prototype._complete=function(){this.scheduleNotification(Notification.createComplete()),this.unsubscribe()},E}(Subscriber),DelayMessage=function(){function D(E,W){this.time=E,this.notification=W}return D}();function delayWhen(D,E){return E?function(W){return new SubscriptionDelayObservable(W,E).lift(new DelayWhenOperator(D))}:function(W){return W.lift(new DelayWhenOperator(D))}}var DelayWhenOperator=function(){function D(E){this.delayDurationSelector=E}return D.prototype.call=function(E,W){return W.subscribe(new DelayWhenSubscriber(E,this.delayDurationSelector))},D}(),DelayWhenSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.delayDurationSelector=U,Q.completed=!1,Q.delayNotifierSubscriptions=[],Q.index=0,Q}return E.prototype.notifyNext=function(W,U,Q,G,J){this.destination.next(W),this.removeSubscription(J),this.tryComplete()},E.prototype.notifyError=function(W,U){this._error(W)},E.prototype.notifyComplete=function(W){var U=this.removeSubscription(W);U&&this.destination.next(U),this.tryComplete()},E.prototype._next=function(W){var U=this.index++;try{var Q=this.delayDurationSelector(W,U);Q&&this.tryDelay(Q,W)}catch(G){this.destination.error(G)}},E.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},E.prototype.removeSubscription=function(W){W.unsubscribe();var U=this.delayNotifierSubscriptions.indexOf(W);return U!==-1&&this.delayNotifierSubscriptions.splice(U,1),W.outerValue},E.prototype.tryDelay=function(W,U){var Q=subscribeToResult(this,W,U);if(Q&&!Q.closed){var G=this.destination;G.add(Q),this.delayNotifierSubscriptions.push(Q)}},E.prototype.tryComplete=function(){this.completed&&this.delayNotifierSubscriptions.length===0&&this.destination.complete()},E}(OuterSubscriber),SubscriptionDelayObservable=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this)||this;return Q.source=W,Q.subscriptionDelay=U,Q}return E.prototype._subscribe=function(W){this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(W,this.source))},E}(Observable),SubscriptionDelaySubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this)||this;return Q.parent=W,Q.source=U,Q.sourceSubscribed=!1,Q}return E.prototype._next=function(W){this.subscribeToSource()},E.prototype._error=function(W){this.unsubscribe(),this.parent.error(W)},E.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},E.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},E}(Subscriber);function dematerialize(){return function(E){return E.lift(new DeMaterializeOperator)}}var DeMaterializeOperator=function(){function D(){}return D.prototype.call=function(E,W){return W.subscribe(new DeMaterializeSubscriber(E))},D}(),DeMaterializeSubscriber=function(D){__extends$1(E,D);function E(W){return D.call(this,W)||this}return E.prototype._next=function(W){W.observe(this.destination)},E}(Subscriber);function distinct(D,E){return function(W){return W.lift(new DistinctOperator(D,E))}}var DistinctOperator=function(){function D(E,W){this.keySelector=E,this.flushes=W}return D.prototype.call=function(E,W){return W.subscribe(new DistinctSubscriber(E,this.keySelector,this.flushes))},D}(),DistinctSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.keySelector=U,G.values=new Set,Q&&G.add(innerSubscribe(Q,new SimpleInnerSubscriber(G))),G}return E.prototype.notifyNext=function(){this.values.clear()},E.prototype.notifyError=function(W){this._error(W)},E.prototype._next=function(W){this.keySelector?this._useKeySelector(W):this._finalizeNext(W,W)},E.prototype._useKeySelector=function(W){var U,Q=this.destination;try{U=this.keySelector(W)}catch(G){Q.error(G);return}this._finalizeNext(U,W)},E.prototype._finalizeNext=function(W,U){var Q=this.values;Q.has(W)||(Q.add(W),this.destination.next(U))},E}(SimpleOuterSubscriber);function distinctUntilChanged(D,E){return function(W){return W.lift(new DistinctUntilChangedOperator(D,E))}}var DistinctUntilChangedOperator=function(){function D(E,W){this.compare=E,this.keySelector=W}return D.prototype.call=function(E,W){return W.subscribe(new DistinctUntilChangedSubscriber(E,this.compare,this.keySelector))},D}(),DistinctUntilChangedSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.keySelector=Q,G.hasKey=!1,typeof U=="function"&&(G.compare=U),G}return E.prototype.compare=function(W,U){return W===U},E.prototype._next=function(W){var U;try{var Q=this.keySelector;U=Q?Q(W):W}catch(Y){return this.destination.error(Y)}var G=!1;if(this.hasKey)try{var J=this.compare;G=J(this.key,U)}catch(Y){return this.destination.error(Y)}else this.hasKey=!0;G||(this.key=U,this.destination.next(W))},E}(Subscriber);function distinctUntilKeyChanged(D,E){return distinctUntilChanged(function(W,U){return E?E(W[D],U[D]):W[D]===U[D]})}function throwIfEmpty(D){return D===void 0&&(D=defaultErrorFactory),function(E){return E.lift(new ThrowIfEmptyOperator(D))}}var ThrowIfEmptyOperator=function(){function D(E){this.errorFactory=E}return D.prototype.call=function(E,W){return W.subscribe(new ThrowIfEmptySubscriber(E,this.errorFactory))},D}(),ThrowIfEmptySubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.errorFactory=U,Q.hasValue=!1,Q}return E.prototype._next=function(W){this.hasValue=!0,this.destination.next(W)},E.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var W=void 0;try{W=this.errorFactory()}catch(U){W=U}this.destination.error(W)},E}(Subscriber);function defaultErrorFactory(){return new EmptyError}function take(D){return function(E){return D===0?empty():E.lift(new TakeOperator(D))}}var TakeOperator=function(){function D(E){if(this.total=E,this.total<0)throw new ArgumentOutOfRangeError}return D.prototype.call=function(E,W){return W.subscribe(new TakeSubscriber(E,this.total))},D}(),TakeSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.total=U,Q.count=0,Q}return E.prototype._next=function(W){var U=this.total,Q=++this.count;Q<=U&&(this.destination.next(W),Q===U&&(this.destination.complete(),this.unsubscribe()))},E}(Subscriber);function elementAt(D,E){if(D<0)throw new ArgumentOutOfRangeError;var W=arguments.length>=2;return function(U){return U.pipe(filter(function(Q,G){return G===D}),take(1),W?defaultIfEmpty(E):throwIfEmpty(function(){return new ArgumentOutOfRangeError}))}}function endWith(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];return function(W){return concat$1(W,of.apply(void 0,D))}}function every(D,E){return function(W){return W.lift(new EveryOperator(D,E,W))}}var EveryOperator=function(){function D(E,W,U){this.predicate=E,this.thisArg=W,this.source=U}return D.prototype.call=function(E,W){return W.subscribe(new EverySubscriber(E,this.predicate,this.thisArg,this.source))},D}(),EverySubscriber=function(D){__extends$1(E,D);function E(W,U,Q,G){var J=D.call(this,W)||this;return J.predicate=U,J.thisArg=Q,J.source=G,J.index=0,J.thisArg=Q||J,J}return E.prototype.notifyComplete=function(W){this.destination.next(W),this.destination.complete()},E.prototype._next=function(W){var U=!1;try{U=this.predicate.call(this.thisArg,W,this.index++,this.source)}catch(Q){this.destination.error(Q);return}U||this.notifyComplete(!1)},E.prototype._complete=function(){this.notifyComplete(!0)},E}(Subscriber);function exhaust(){return function(D){return D.lift(new SwitchFirstOperator)}}var SwitchFirstOperator=function(){function D(){}return D.prototype.call=function(E,W){return W.subscribe(new SwitchFirstSubscriber(E))},D}(),SwitchFirstSubscriber=function(D){__extends$1(E,D);function E(W){var U=D.call(this,W)||this;return U.hasCompleted=!1,U.hasSubscription=!1,U}return E.prototype._next=function(W){this.hasSubscription||(this.hasSubscription=!0,this.add(innerSubscribe(W,new SimpleInnerSubscriber(this))))},E.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},E.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},E}(SimpleOuterSubscriber);function exhaustMap(D,E){return E?function(W){return W.pipe(exhaustMap(function(U,Q){return from(D(U,Q)).pipe(map(function(G,J){return E(U,G,Q,J)}))}))}:function(W){return W.lift(new ExhaustMapOperator(D))}}var ExhaustMapOperator=function(){function D(E){this.project=E}return D.prototype.call=function(E,W){return W.subscribe(new ExhaustMapSubscriber(E,this.project))},D}(),ExhaustMapSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.project=U,Q.hasSubscription=!1,Q.hasCompleted=!1,Q.index=0,Q}return E.prototype._next=function(W){this.hasSubscription||this.tryNext(W)},E.prototype.tryNext=function(W){var U,Q=this.index++;try{U=this.project(W,Q)}catch(G){this.destination.error(G);return}this.hasSubscription=!0,this._innerSub(U)},E.prototype._innerSub=function(W){var U=new SimpleInnerSubscriber(this),Q=this.destination;Q.add(U);var G=innerSubscribe(W,U);G!==U&&Q.add(G)},E.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},E.prototype.notifyNext=function(W){this.destination.next(W)},E.prototype.notifyError=function(W){this.destination.error(W)},E.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},E}(SimpleOuterSubscriber);function expand(D,E,W){return E===void 0&&(E=Number.POSITIVE_INFINITY),E=(E||0)<1?Number.POSITIVE_INFINITY:E,function(U){return U.lift(new ExpandOperator(D,E,W))}}var ExpandOperator=function(){function D(E,W,U){this.project=E,this.concurrent=W,this.scheduler=U}return D.prototype.call=function(E,W){return W.subscribe(new ExpandSubscriber(E,this.project,this.concurrent,this.scheduler))},D}(),ExpandSubscriber=function(D){__extends$1(E,D);function E(W,U,Q,G){var J=D.call(this,W)||this;return J.project=U,J.concurrent=Q,J.scheduler=G,J.index=0,J.active=0,J.hasCompleted=!1,Q<Number.POSITIVE_INFINITY&&(J.buffer=[]),J}return E.dispatch=function(W){var U=W.subscriber,Q=W.result,G=W.value,J=W.index;U.subscribeToProjection(Q,G,J)},E.prototype._next=function(W){var U=this.destination;if(U.closed){this._complete();return}var Q=this.index++;if(this.active<this.concurrent){U.next(W);try{var G=this.project,J=G(W,Q);if(!this.scheduler)this.subscribeToProjection(J,W,Q);else{var Y={subscriber:this,result:J,value:W,index:Q},X=this.destination;X.add(this.scheduler.schedule(E.dispatch,0,Y))}}catch(Z){U.error(Z)}}else this.buffer.push(W)},E.prototype.subscribeToProjection=function(W,U,Q){this.active++;var G=this.destination;G.add(innerSubscribe(W,new SimpleInnerSubscriber(this)))},E.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&this.active===0&&this.destination.complete(),this.unsubscribe()},E.prototype.notifyNext=function(W){this._next(W)},E.prototype.notifyComplete=function(){var W=this.buffer;this.active--,W&&W.length>0&&this._next(W.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},E}(SimpleOuterSubscriber);function finalize(D){return function(E){return E.lift(new FinallyOperator(D))}}var FinallyOperator=function(){function D(E){this.callback=E}return D.prototype.call=function(E,W){return W.subscribe(new FinallySubscriber(E,this.callback))},D}(),FinallySubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.add(new Subscription(U)),Q}return E}(Subscriber);function find(D,E){if(typeof D!="function")throw new TypeError("predicate is not a function");return function(W){return W.lift(new FindValueOperator(D,W,!1,E))}}var FindValueOperator=function(){function D(E,W,U,Q){this.predicate=E,this.source=W,this.yieldIndex=U,this.thisArg=Q}return D.prototype.call=function(E,W){return W.subscribe(new FindValueSubscriber(E,this.predicate,this.source,this.yieldIndex,this.thisArg))},D}(),FindValueSubscriber=function(D){__extends$1(E,D);function E(W,U,Q,G,J){var Y=D.call(this,W)||this;return Y.predicate=U,Y.source=Q,Y.yieldIndex=G,Y.thisArg=J,Y.index=0,Y}return E.prototype.notifyComplete=function(W){var U=this.destination;U.next(W),U.complete(),this.unsubscribe()},E.prototype._next=function(W){var U=this,Q=U.predicate,G=U.thisArg,J=this.index++;try{var Y=Q.call(G||this,W,J,this.source);Y&&this.notifyComplete(this.yieldIndex?J:W)}catch(X){this.destination.error(X)}},E.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},E}(Subscriber);function findIndex(D,E){return function(W){return W.lift(new FindValueOperator(D,W,!0,E))}}function first(D,E){var W=arguments.length>=2;return function(U){return U.pipe(D?filter(function(Q,G){return D(Q,G,U)}):identity,take(1),W?defaultIfEmpty(E):throwIfEmpty(function(){return new EmptyError}))}}function ignoreElements(){return function(E){return E.lift(new IgnoreElementsOperator)}}var IgnoreElementsOperator=function(){function D(){}return D.prototype.call=function(E,W){return W.subscribe(new IgnoreElementsSubscriber(E))},D}(),IgnoreElementsSubscriber=function(D){__extends$1(E,D);function E(){return D!==null&&D.apply(this,arguments)||this}return E.prototype._next=function(W){},E}(Subscriber);function isEmpty(){return function(D){return D.lift(new IsEmptyOperator)}}var IsEmptyOperator=function(){function D(){}return D.prototype.call=function(E,W){return W.subscribe(new IsEmptySubscriber(E))},D}(),IsEmptySubscriber=function(D){__extends$1(E,D);function E(W){return D.call(this,W)||this}return E.prototype.notifyComplete=function(W){var U=this.destination;U.next(W),U.complete()},E.prototype._next=function(W){this.notifyComplete(!1)},E.prototype._complete=function(){this.notifyComplete(!0)},E}(Subscriber);function takeLast(D){return function(W){return D===0?empty():W.lift(new TakeLastOperator(D))}}var TakeLastOperator=function(){function D(E){if(this.total=E,this.total<0)throw new ArgumentOutOfRangeError}return D.prototype.call=function(E,W){return W.subscribe(new TakeLastSubscriber(E,this.total))},D}(),TakeLastSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.total=U,Q.ring=new Array,Q.count=0,Q}return E.prototype._next=function(W){var U=this.ring,Q=this.total,G=this.count++;if(U.length<Q)U.push(W);else{var J=G%Q;U[J]=W}},E.prototype._complete=function(){var W=this.destination,U=this.count;if(U>0)for(var Q=this.count>=this.total?this.total:this.count,G=this.ring,J=0;J<Q;J++){var Y=U++%Q;W.next(G[Y])}W.complete()},E}(Subscriber);function last(D,E){var W=arguments.length>=2;return function(U){return U.pipe(D?filter(function(Q,G){return D(Q,G,U)}):identity,takeLast(1),W?defaultIfEmpty(E):throwIfEmpty(function(){return new EmptyError}))}}function mapTo(D){return function(E){return E.lift(new MapToOperator(D))}}var MapToOperator=function(){function D(E){this.value=E}return D.prototype.call=function(E,W){return W.subscribe(new MapToSubscriber(E,this.value))},D}(),MapToSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.value=U,Q}return E.prototype._next=function(W){this.destination.next(this.value)},E}(Subscriber);function materialize(){return function(E){return E.lift(new MaterializeOperator)}}var MaterializeOperator=function(){function D(){}return D.prototype.call=function(E,W){return W.subscribe(new MaterializeSubscriber(E))},D}(),MaterializeSubscriber=function(D){__extends$1(E,D);function E(W){return D.call(this,W)||this}return E.prototype._next=function(W){this.destination.next(Notification.createNext(W))},E.prototype._error=function(W){var U=this.destination;U.next(Notification.createError(W)),U.complete()},E.prototype._complete=function(){var W=this.destination;W.next(Notification.createComplete()),W.complete()},E}(Subscriber);function scan(D,E){var W=!1;return arguments.length>=2&&(W=!0),function(Q){return Q.lift(new ScanOperator(D,E,W))}}var ScanOperator=function(){function D(E,W,U){U===void 0&&(U=!1),this.accumulator=E,this.seed=W,this.hasSeed=U}return D.prototype.call=function(E,W){return W.subscribe(new ScanSubscriber(E,this.accumulator,this.seed,this.hasSeed))},D}(),ScanSubscriber=function(D){__extends$1(E,D);function E(W,U,Q,G){var J=D.call(this,W)||this;return J.accumulator=U,J._seed=Q,J.hasSeed=G,J.index=0,J}return Object.defineProperty(E.prototype,"seed",{get:function(){return this._seed},set:function(W){this.hasSeed=!0,this._seed=W},enumerable:!0,configurable:!0}),E.prototype._next=function(W){if(!this.hasSeed)this.seed=W,this.destination.next(W);else return this._tryNext(W)},E.prototype._tryNext=function(W){var U=this.index++,Q;try{Q=this.accumulator(this.seed,W,U)}catch(G){this.destination.error(G)}this.seed=Q,this.destination.next(Q)},E}(Subscriber);function reduce(D,E){return arguments.length>=2?function(U){return pipe$1(scan(D,E),takeLast(1),defaultIfEmpty(E))(U)}:function(U){return pipe$1(scan(function(Q,G,J){return D(Q,G,J+1)}),takeLast(1))(U)}}function max(D){var E=typeof D=="function"?function(W,U){return D(W,U)>0?W:U}:function(W,U){return W>U?W:U};return reduce(E)}function merge$1(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];return function(W){return W.lift.call(merge$2.apply(void 0,[W].concat(D)))}}function mergeMapTo(D,E,W){return W===void 0&&(W=Number.POSITIVE_INFINITY),typeof E=="function"?mergeMap(function(){return D},E,W):(typeof E=="number"&&(W=E),mergeMap(function(){return D},W))}function mergeScan(D,E,W){return W===void 0&&(W=Number.POSITIVE_INFINITY),function(U){return U.lift(new MergeScanOperator(D,E,W))}}var MergeScanOperator=function(){function D(E,W,U){this.accumulator=E,this.seed=W,this.concurrent=U}return D.prototype.call=function(E,W){return W.subscribe(new MergeScanSubscriber(E,this.accumulator,this.seed,this.concurrent))},D}(),MergeScanSubscriber=function(D){__extends$1(E,D);function E(W,U,Q,G){var J=D.call(this,W)||this;return J.accumulator=U,J.acc=Q,J.concurrent=G,J.hasValue=!1,J.hasCompleted=!1,J.buffer=[],J.active=0,J.index=0,J}return E.prototype._next=function(W){if(this.active<this.concurrent){var U=this.index++,Q=this.destination,G=void 0;try{var J=this.accumulator;G=J(this.acc,W,U)}catch(Y){return Q.error(Y)}this.active++,this._innerSub(G)}else this.buffer.push(W)},E.prototype._innerSub=function(W){var U=new SimpleInnerSubscriber(this),Q=this.destination;Q.add(U);var G=innerSubscribe(W,U);G!==U&&Q.add(G)},E.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},E.prototype.notifyNext=function(W){var U=this.destination;this.acc=W,this.hasValue=!0,U.next(W)},E.prototype.notifyComplete=function(){var W=this.buffer;this.active--,W.length>0?this._next(W.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},E}(SimpleOuterSubscriber);function min(D){var E=typeof D=="function"?function(W,U){return D(W,U)<0?W:U}:function(W,U){return W<U?W:U};return reduce(E)}function multicast(D,E){return function(U){var Q;if(typeof D=="function"?Q=D:Q=function(){return D},typeof E=="function")return U.lift(new MulticastOperator(Q,E));var G=Object.create(U,connectableObservableDescriptor);return G.source=U,G.subjectFactory=Q,G}}var MulticastOperator=function(){function D(E,W){this.subjectFactory=E,this.selector=W}return D.prototype.call=function(E,W){var U=this.selector,Q=this.subjectFactory(),G=U(Q).subscribe(E);return G.add(W.subscribe(Q)),G},D}();function onErrorResumeNext(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];return D.length===1&&isArray$4(D[0])&&(D=D[0]),function(W){return W.lift(new OnErrorResumeNextOperator(D))}}var OnErrorResumeNextOperator=function(){function D(E){this.nextSources=E}return D.prototype.call=function(E,W){return W.subscribe(new OnErrorResumeNextSubscriber(E,this.nextSources))},D}(),OnErrorResumeNextSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.destination=W,Q.nextSources=U,Q}return E.prototype.notifyError=function(){this.subscribeToNextSource()},E.prototype.notifyComplete=function(){this.subscribeToNextSource()},E.prototype._error=function(W){this.subscribeToNextSource(),this.unsubscribe()},E.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},E.prototype.subscribeToNextSource=function(){var W=this.nextSources.shift();if(W){var U=new SimpleInnerSubscriber(this),Q=this.destination;Q.add(U);var G=innerSubscribe(W,U);G!==U&&Q.add(G)}else this.destination.complete()},E}(SimpleOuterSubscriber);function pairwise(){return function(D){return D.lift(new PairwiseOperator)}}var PairwiseOperator=function(){function D(){}return D.prototype.call=function(E,W){return W.subscribe(new PairwiseSubscriber(E))},D}(),PairwiseSubscriber=function(D){__extends$1(E,D);function E(W){var U=D.call(this,W)||this;return U.hasPrev=!1,U}return E.prototype._next=function(W){var U;this.hasPrev?U=[this.prev,W]:this.hasPrev=!0,this.prev=W,U&&this.destination.next(U)},E}(Subscriber);function partition(D,E){return function(W){return[filter(D,E)(W),filter(not(D,E))(W)]}}function pluck(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];var W=D.length;if(W===0)throw new Error("list of properties cannot be empty.");return function(U){return map(plucker(D,W))(U)}}function plucker(D,E){var W=function(U){for(var Q=U,G=0;G<E;G++){var J=Q!=null?Q[D[G]]:void 0;if(J!==void 0)Q=J;else return}return Q};return W}function publish(D){return D?multicast(function(){return new Subject},D):multicast(new Subject)}function publishBehavior(D){return function(E){return multicast(new BehaviorSubject(D))(E)}}function publishLast(){return function(D){return multicast(new AsyncSubject)(D)}}function publishReplay(D,E,W,U){W&&typeof W!="function"&&(U=W);var Q=typeof W=="function"?W:void 0,G=new ReplaySubject(D,E,U);return function(J){return multicast(function(){return G},Q)(J)}}function race(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];return function(U){return D.length===1&&isArray$4(D[0])&&(D=D[0]),U.lift.call(race$1.apply(void 0,[U].concat(D)))}}function repeat(D){return D===void 0&&(D=-1),function(E){return D===0?empty():D<0?E.lift(new RepeatOperator(-1,E)):E.lift(new RepeatOperator(D-1,E))}}var RepeatOperator=function(){function D(E,W){this.count=E,this.source=W}return D.prototype.call=function(E,W){return W.subscribe(new RepeatSubscriber(E,this.count,this.source))},D}(),RepeatSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.count=U,G.source=Q,G}return E.prototype.complete=function(){if(!this.isStopped){var W=this,U=W.source,Q=W.count;if(Q===0)return D.prototype.complete.call(this);Q>-1&&(this.count=Q-1),U.subscribe(this._unsubscribeAndRecycle())}},E}(Subscriber);function repeatWhen(D){return function(E){return E.lift(new RepeatWhenOperator(D))}}var RepeatWhenOperator=function(){function D(E){this.notifier=E}return D.prototype.call=function(E,W){return W.subscribe(new RepeatWhenSubscriber(E,this.notifier,W))},D}(),RepeatWhenSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.notifier=U,G.source=Q,G.sourceIsBeingSubscribedTo=!0,G}return E.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},E.prototype.notifyComplete=function(){if(this.sourceIsBeingSubscribedTo===!1)return D.prototype.complete.call(this)},E.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return D.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},E.prototype._unsubscribe=function(){var W=this,U=W.notifications,Q=W.retriesSubscription;U&&(U.unsubscribe(),this.notifications=void 0),Q&&(Q.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},E.prototype._unsubscribeAndRecycle=function(){var W=this._unsubscribe;return this._unsubscribe=null,D.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=W,this},E.prototype.subscribeToRetries=function(){this.notifications=new Subject;var W;try{var U=this.notifier;W=U(this.notifications)}catch{return D.prototype.complete.call(this)}this.retries=W,this.retriesSubscription=innerSubscribe(W,new SimpleInnerSubscriber(this))},E}(SimpleOuterSubscriber);function retry(D){return D===void 0&&(D=-1),function(E){return E.lift(new RetryOperator(D,E))}}var RetryOperator=function(){function D(E,W){this.count=E,this.source=W}return D.prototype.call=function(E,W){return W.subscribe(new RetrySubscriber(E,this.count,this.source))},D}(),RetrySubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.count=U,G.source=Q,G}return E.prototype.error=function(W){if(!this.isStopped){var U=this,Q=U.source,G=U.count;if(G===0)return D.prototype.error.call(this,W);G>-1&&(this.count=G-1),Q.subscribe(this._unsubscribeAndRecycle())}},E}(Subscriber);function retryWhen(D){return function(E){return E.lift(new RetryWhenOperator(D,E))}}var RetryWhenOperator=function(){function D(E,W){this.notifier=E,this.source=W}return D.prototype.call=function(E,W){return W.subscribe(new RetryWhenSubscriber(E,this.notifier,this.source))},D}(),RetryWhenSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.notifier=U,G.source=Q,G}return E.prototype.error=function(W){if(!this.isStopped){var U=this.errors,Q=this.retries,G=this.retriesSubscription;if(Q)this.errors=void 0,this.retriesSubscription=void 0;else{U=new Subject;try{var J=this.notifier;Q=J(U)}catch(Y){return D.prototype.error.call(this,Y)}G=innerSubscribe(Q,new SimpleInnerSubscriber(this))}this._unsubscribeAndRecycle(),this.errors=U,this.retries=Q,this.retriesSubscription=G,U.next(W)}},E.prototype._unsubscribe=function(){var W=this,U=W.errors,Q=W.retriesSubscription;U&&(U.unsubscribe(),this.errors=void 0),Q&&(Q.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},E.prototype.notifyNext=function(){var W=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=W,this.source.subscribe(this)},E}(SimpleOuterSubscriber);function sample(D){return function(E){return E.lift(new SampleOperator(D))}}var SampleOperator=function(){function D(E){this.notifier=E}return D.prototype.call=function(E,W){var U=new SampleSubscriber(E),Q=W.subscribe(U);return Q.add(innerSubscribe(this.notifier,new SimpleInnerSubscriber(U))),Q},D}(),SampleSubscriber=function(D){__extends$1(E,D);function E(){var W=D!==null&&D.apply(this,arguments)||this;return W.hasValue=!1,W}return E.prototype._next=function(W){this.value=W,this.hasValue=!0},E.prototype.notifyNext=function(){this.emitValue()},E.prototype.notifyComplete=function(){this.emitValue()},E.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},E}(SimpleOuterSubscriber);function sampleTime(D,E){return E===void 0&&(E=async),function(W){return W.lift(new SampleTimeOperator(D,E))}}var SampleTimeOperator=function(){function D(E,W){this.period=E,this.scheduler=W}return D.prototype.call=function(E,W){return W.subscribe(new SampleTimeSubscriber(E,this.period,this.scheduler))},D}(),SampleTimeSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.period=U,G.scheduler=Q,G.hasValue=!1,G.add(Q.schedule(dispatchNotification,U,{subscriber:G,period:U})),G}return E.prototype._next=function(W){this.lastValue=W,this.hasValue=!0},E.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},E}(Subscriber);function dispatchNotification(D){var E=D.subscriber,W=D.period;E.notifyNext(),this.schedule(D,W)}function sequenceEqual(D,E){return function(W){return W.lift(new SequenceEqualOperator(D,E))}}var SequenceEqualOperator=function(){function D(E,W){this.compareTo=E,this.comparator=W}return D.prototype.call=function(E,W){return W.subscribe(new SequenceEqualSubscriber(E,this.compareTo,this.comparator))},D}(),SequenceEqualSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.compareTo=U,G.comparator=Q,G._a=[],G._b=[],G._oneComplete=!1,G.destination.add(U.subscribe(new SequenceEqualCompareToSubscriber(W,G))),G}return E.prototype._next=function(W){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(W),this.checkValues())},E.prototype._complete=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0,this.unsubscribe()},E.prototype.checkValues=function(){for(var W=this,U=W._a,Q=W._b,G=W.comparator;U.length>0&&Q.length>0;){var J=U.shift(),Y=Q.shift(),X=!1;try{X=G?G(J,Y):J===Y}catch(Z){this.destination.error(Z)}X||this.emit(!1)}},E.prototype.emit=function(W){var U=this.destination;U.next(W),U.complete()},E.prototype.nextB=function(W){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(W),this.checkValues())},E.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},E}(Subscriber),SequenceEqualCompareToSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.parent=U,Q}return E.prototype._next=function(W){this.parent.nextB(W)},E.prototype._error=function(W){this.parent.error(W),this.unsubscribe()},E.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},E}(Subscriber);function shareSubjectFactory(){return new Subject}function share(){return function(D){return refCount()(multicast(shareSubjectFactory)(D))}}function shareReplay(D,E,W){var U;return D&&typeof D=="object"?U=D:U={bufferSize:D,windowTime:E,refCount:!1,scheduler:W},function(Q){return Q.lift(shareReplayOperator(U))}}function shareReplayOperator(D){var E=D.bufferSize,W=E===void 0?Number.POSITIVE_INFINITY:E,U=D.windowTime,Q=U===void 0?Number.POSITIVE_INFINITY:U,G=D.refCount,J=D.scheduler,Y,X=0,Z,ee=!1,oe=!1;return function(re){X++;var ae;!Y||ee?(ee=!1,Y=new ReplaySubject(W,Q,J),ae=Y.subscribe(this),Z=re.subscribe({next:function(fe){Y.next(fe)},error:function(fe){ee=!0,Y.error(fe)},complete:function(){oe=!0,Z=void 0,Y.complete()}}),oe&&(Z=void 0)):ae=Y.subscribe(this),this.add(function(){X--,ae.unsubscribe(),ae=void 0,Z&&!oe&&G&&X===0&&(Z.unsubscribe(),Z=void 0,Y=void 0)})}}function single(D){return function(E){return E.lift(new SingleOperator(D,E))}}var SingleOperator=function(){function D(E,W){this.predicate=E,this.source=W}return D.prototype.call=function(E,W){return W.subscribe(new SingleSubscriber(E,this.predicate,this.source))},D}(),SingleSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.predicate=U,G.source=Q,G.seenValue=!1,G.index=0,G}return E.prototype.applySingleValue=function(W){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=W)},E.prototype._next=function(W){var U=this.index++;this.predicate?this.tryNext(W,U):this.applySingleValue(W)},E.prototype.tryNext=function(W,U){try{this.predicate(W,U,this.source)&&this.applySingleValue(W)}catch(Q){this.destination.error(Q)}},E.prototype._complete=function(){var W=this.destination;this.index>0?(W.next(this.seenValue?this.singleValue:void 0),W.complete()):W.error(new EmptyError)},E}(Subscriber);function skip(D){return function(E){return E.lift(new SkipOperator(D))}}var SkipOperator=function(){function D(E){this.total=E}return D.prototype.call=function(E,W){return W.subscribe(new SkipSubscriber(E,this.total))},D}(),SkipSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.total=U,Q.count=0,Q}return E.prototype._next=function(W){++this.count>this.total&&this.destination.next(W)},E}(Subscriber);function skipLast(D){return function(E){return E.lift(new SkipLastOperator(D))}}var SkipLastOperator=function(){function D(E){if(this._skipCount=E,this._skipCount<0)throw new ArgumentOutOfRangeError}return D.prototype.call=function(E,W){return this._skipCount===0?W.subscribe(new Subscriber(E)):W.subscribe(new SkipLastSubscriber(E,this._skipCount))},D}(),SkipLastSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q._skipCount=U,Q._count=0,Q._ring=new Array(U),Q}return E.prototype._next=function(W){var U=this._skipCount,Q=this._count++;if(Q<U)this._ring[Q]=W;else{var G=Q%U,J=this._ring,Y=J[G];J[G]=W,this.destination.next(Y)}},E}(Subscriber);function skipUntil(D){return function(E){return E.lift(new SkipUntilOperator(D))}}var SkipUntilOperator=function(){function D(E){this.notifier=E}return D.prototype.call=function(E,W){return W.subscribe(new SkipUntilSubscriber(E,this.notifier))},D}(),SkipUntilSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;Q.hasValue=!1;var G=new SimpleInnerSubscriber(Q);Q.add(G),Q.innerSubscription=G;var J=innerSubscribe(U,G);return J!==G&&(Q.add(J),Q.innerSubscription=J),Q}return E.prototype._next=function(W){this.hasValue&&D.prototype._next.call(this,W)},E.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},E.prototype.notifyComplete=function(){},E}(SimpleOuterSubscriber);function skipWhile(D){return function(E){return E.lift(new SkipWhileOperator(D))}}var SkipWhileOperator=function(){function D(E){this.predicate=E}return D.prototype.call=function(E,W){return W.subscribe(new SkipWhileSubscriber(E,this.predicate))},D}(),SkipWhileSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.predicate=U,Q.skipping=!0,Q.index=0,Q}return E.prototype._next=function(W){var U=this.destination;this.skipping&&this.tryCallPredicate(W),this.skipping||U.next(W)},E.prototype.tryCallPredicate=function(W){try{var U=this.predicate(W,this.index++);this.skipping=!!U}catch(Q){this.destination.error(Q)}},E}(Subscriber);function startWith(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];var W=D[D.length-1];return isScheduler(W)?(D.pop(),function(U){return concat$1(D,U,W)}):function(U){return concat$1(D,U)}}var SubscribeOnObservable=function(D){__extends$1(E,D);function E(W,U,Q){U===void 0&&(U=0),Q===void 0&&(Q=asap);var G=D.call(this)||this;return G.source=W,G.delayTime=U,G.scheduler=Q,(!isNumeric(U)||U<0)&&(G.delayTime=0),(!Q||typeof Q.schedule!="function")&&(G.scheduler=asap),G}return E.create=function(W,U,Q){return U===void 0&&(U=0),Q===void 0&&(Q=asap),new E(W,U,Q)},E.dispatch=function(W){var U=W.source,Q=W.subscriber;return this.add(U.subscribe(Q))},E.prototype._subscribe=function(W){var U=this.delayTime,Q=this.source,G=this.scheduler;return G.schedule(E.dispatch,U,{source:Q,subscriber:W})},E}(Observable);function subscribeOn(D,E){return E===void 0&&(E=0),function(U){return U.lift(new SubscribeOnOperator(D,E))}}var SubscribeOnOperator=function(){function D(E,W){this.scheduler=E,this.delay=W}return D.prototype.call=function(E,W){return new SubscribeOnObservable(W,this.delay,this.scheduler).subscribe(E)},D}();function switchMap(D,E){return typeof E=="function"?function(W){return W.pipe(switchMap(function(U,Q){return from(D(U,Q)).pipe(map(function(G,J){return E(U,G,Q,J)}))}))}:function(W){return W.lift(new SwitchMapOperator(D))}}var SwitchMapOperator=function(){function D(E){this.project=E}return D.prototype.call=function(E,W){return W.subscribe(new SwitchMapSubscriber(E,this.project))},D}(),SwitchMapSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.project=U,Q.index=0,Q}return E.prototype._next=function(W){var U,Q=this.index++;try{U=this.project(W,Q)}catch(G){this.destination.error(G);return}this._innerSub(U)},E.prototype._innerSub=function(W){var U=this.innerSubscription;U&&U.unsubscribe();var Q=new SimpleInnerSubscriber(this),G=this.destination;G.add(Q),this.innerSubscription=innerSubscribe(W,Q),this.innerSubscription!==Q&&G.add(this.innerSubscription)},E.prototype._complete=function(){var W=this.innerSubscription;(!W||W.closed)&&D.prototype._complete.call(this),this.unsubscribe()},E.prototype._unsubscribe=function(){this.innerSubscription=void 0},E.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&D.prototype._complete.call(this)},E.prototype.notifyNext=function(W){this.destination.next(W)},E}(SimpleOuterSubscriber);function switchAll(){return switchMap(identity)}function switchMapTo(D,E){return E?switchMap(function(){return D},E):switchMap(function(){return D})}function takeUntil(D){return function(E){return E.lift(new TakeUntilOperator(D))}}var TakeUntilOperator=function(){function D(E){this.notifier=E}return D.prototype.call=function(E,W){var U=new TakeUntilSubscriber(E),Q=innerSubscribe(this.notifier,new SimpleInnerSubscriber(U));return Q&&!U.seenValue?(U.add(Q),W.subscribe(U)):U},D}(),TakeUntilSubscriber=function(D){__extends$1(E,D);function E(W){var U=D.call(this,W)||this;return U.seenValue=!1,U}return E.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},E.prototype.notifyComplete=function(){},E}(SimpleOuterSubscriber);function takeWhile(D,E){return E===void 0&&(E=!1),function(W){return W.lift(new TakeWhileOperator(D,E))}}var TakeWhileOperator=function(){function D(E,W){this.predicate=E,this.inclusive=W}return D.prototype.call=function(E,W){return W.subscribe(new TakeWhileSubscriber(E,this.predicate,this.inclusive))},D}(),TakeWhileSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.predicate=U,G.inclusive=Q,G.index=0,G}return E.prototype._next=function(W){var U=this.destination,Q;try{Q=this.predicate(W,this.index++)}catch(G){U.error(G);return}this.nextOrComplete(W,Q)},E.prototype.nextOrComplete=function(W,U){var Q=this.destination;U?Q.next(W):(this.inclusive&&Q.next(W),Q.complete())},E}(Subscriber);function tap(D,E,W){return function(Q){return Q.lift(new DoOperator(D,E,W))}}var DoOperator=function(){function D(E,W,U){this.nextOrObserver=E,this.error=W,this.complete=U}return D.prototype.call=function(E,W){return W.subscribe(new TapSubscriber(E,this.nextOrObserver,this.error,this.complete))},D}(),TapSubscriber=function(D){__extends$1(E,D);function E(W,U,Q,G){var J=D.call(this,W)||this;return J._tapNext=noop$3,J._tapError=noop$3,J._tapComplete=noop$3,J._tapError=Q||noop$3,J._tapComplete=G||noop$3,isFunction(U)?(J._context=J,J._tapNext=U):U&&(J._context=U,J._tapNext=U.next||noop$3,J._tapError=U.error||noop$3,J._tapComplete=U.complete||noop$3),J}return E.prototype._next=function(W){try{this._tapNext.call(this._context,W)}catch(U){this.destination.error(U);return}this.destination.next(W)},E.prototype._error=function(W){try{this._tapError.call(this._context,W)}catch(U){this.destination.error(U);return}this.destination.error(W)},E.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(W){this.destination.error(W);return}return this.destination.complete()},E}(Subscriber),defaultThrottleConfig={leading:!0,trailing:!1};function throttle(D,E){return E===void 0&&(E=defaultThrottleConfig),function(W){return W.lift(new ThrottleOperator(D,!!E.leading,!!E.trailing))}}var ThrottleOperator=function(){function D(E,W,U){this.durationSelector=E,this.leading=W,this.trailing=U}return D.prototype.call=function(E,W){return W.subscribe(new ThrottleSubscriber(E,this.durationSelector,this.leading,this.trailing))},D}(),ThrottleSubscriber=function(D){__extends$1(E,D);function E(W,U,Q,G){var J=D.call(this,W)||this;return J.destination=W,J.durationSelector=U,J._leading=Q,J._trailing=G,J._hasValue=!1,J}return E.prototype._next=function(W){this._hasValue=!0,this._sendValue=W,this._throttled||(this._leading?this.send():this.throttle(W))},E.prototype.send=function(){var W=this,U=W._hasValue,Q=W._sendValue;U&&(this.destination.next(Q),this.throttle(Q)),this._hasValue=!1,this._sendValue=void 0},E.prototype.throttle=function(W){var U=this.tryDurationSelector(W);U&&this.add(this._throttled=innerSubscribe(U,new SimpleInnerSubscriber(this)))},E.prototype.tryDurationSelector=function(W){try{return this.durationSelector(W)}catch(U){return this.destination.error(U),null}},E.prototype.throttlingDone=function(){var W=this,U=W._throttled,Q=W._trailing;U&&U.unsubscribe(),this._throttled=void 0,Q&&this.send()},E.prototype.notifyNext=function(){this.throttlingDone()},E.prototype.notifyComplete=function(){this.throttlingDone()},E}(SimpleOuterSubscriber);function throttleTime(D,E,W){return E===void 0&&(E=async),W===void 0&&(W=defaultThrottleConfig),function(U){return U.lift(new ThrottleTimeOperator(D,E,W.leading,W.trailing))}}var ThrottleTimeOperator=function(){function D(E,W,U,Q){this.duration=E,this.scheduler=W,this.leading=U,this.trailing=Q}return D.prototype.call=function(E,W){return W.subscribe(new ThrottleTimeSubscriber(E,this.duration,this.scheduler,this.leading,this.trailing))},D}(),ThrottleTimeSubscriber=function(D){__extends$1(E,D);function E(W,U,Q,G,J){var Y=D.call(this,W)||this;return Y.duration=U,Y.scheduler=Q,Y.leading=G,Y.trailing=J,Y._hasTrailingValue=!1,Y._trailingValue=null,Y}return E.prototype._next=function(W){this.throttled?this.trailing&&(this._trailingValue=W,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(dispatchNext,this.duration,{subscriber:this})),this.leading?this.destination.next(W):this.trailing&&(this._trailingValue=W,this._hasTrailingValue=!0))},E.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},E.prototype.clearThrottle=function(){var W=this.throttled;W&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),W.unsubscribe(),this.remove(W),this.throttled=null)},E}(Subscriber);function dispatchNext(D){var E=D.subscriber;E.clearThrottle()}function timeInterval(D){return D===void 0&&(D=async),function(E){return defer(function(){return E.pipe(scan(function(W,U){var Q=W.current;return{value:U,current:D.now(),last:Q}},{current:D.now(),value:void 0,last:void 0}),map(function(W){var U=W.current,Q=W.last,G=W.value;return new TimeInterval(G,U-Q)}))})}}var TimeInterval=function(){function D(E,W){this.value=E,this.interval=W}return D}();function timeoutWith(D,E,W){return W===void 0&&(W=async),function(U){var Q=isDate(D),G=Q?+D-W.now():Math.abs(D);return U.lift(new TimeoutWithOperator(G,Q,E,W))}}var TimeoutWithOperator=function(){function D(E,W,U,Q){this.waitFor=E,this.absoluteTimeout=W,this.withObservable=U,this.scheduler=Q}return D.prototype.call=function(E,W){return W.subscribe(new TimeoutWithSubscriber(E,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},D}(),TimeoutWithSubscriber=function(D){__extends$1(E,D);function E(W,U,Q,G,J){var Y=D.call(this,W)||this;return Y.absoluteTimeout=U,Y.waitFor=Q,Y.withObservable=G,Y.scheduler=J,Y.scheduleTimeout(),Y}return E.dispatchTimeout=function(W){var U=W.withObservable;W._unsubscribeAndRecycle(),W.add(innerSubscribe(U,new SimpleInnerSubscriber(W)))},E.prototype.scheduleTimeout=function(){var W=this.action;W?this.action=W.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(E.dispatchTimeout,this.waitFor,this))},E.prototype._next=function(W){this.absoluteTimeout||this.scheduleTimeout(),D.prototype._next.call(this,W)},E.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},E}(SimpleOuterSubscriber);function timeout$1(D,E){return E===void 0&&(E=async),timeoutWith(D,throwError(new TimeoutError),E)}function timestamp(D){return D===void 0&&(D=async),map(function(E){return new Timestamp(E,D.now())})}var Timestamp=function(){function D(E,W){this.value=E,this.timestamp=W}return D}();function toArrayReducer(D,E,W){return W===0?[E]:(D.push(E),D)}function toArray(){return reduce(toArrayReducer,[])}function window$1(D){return function(W){return W.lift(new WindowOperator$1(D))}}var WindowOperator$1=function(){function D(E){this.windowBoundaries=E}return D.prototype.call=function(E,W){var U=new WindowSubscriber$1(E),Q=W.subscribe(U);return Q.closed||U.add(innerSubscribe(this.windowBoundaries,new SimpleInnerSubscriber(U))),Q},D}(),WindowSubscriber$1=function(D){__extends$1(E,D);function E(W){var U=D.call(this,W)||this;return U.window=new Subject,W.next(U.window),U}return E.prototype.notifyNext=function(){this.openWindow()},E.prototype.notifyError=function(W){this._error(W)},E.prototype.notifyComplete=function(){this._complete()},E.prototype._next=function(W){this.window.next(W)},E.prototype._error=function(W){this.window.error(W),this.destination.error(W)},E.prototype._complete=function(){this.window.complete(),this.destination.complete()},E.prototype._unsubscribe=function(){this.window=null},E.prototype.openWindow=function(){var W=this.window;W&&W.complete();var U=this.destination,Q=this.window=new Subject;U.next(Q)},E}(SimpleOuterSubscriber);function windowCount(D,E){return E===void 0&&(E=0),function(U){return U.lift(new WindowCountOperator(D,E))}}var WindowCountOperator=function(){function D(E,W){this.windowSize=E,this.startWindowEvery=W}return D.prototype.call=function(E,W){return W.subscribe(new WindowCountSubscriber(E,this.windowSize,this.startWindowEvery))},D}(),WindowCountSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.destination=W,G.windowSize=U,G.startWindowEvery=Q,G.windows=[new Subject],G.count=0,W.next(G.windows[0]),G}return E.prototype._next=function(W){for(var U=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,Q=this.destination,G=this.windowSize,J=this.windows,Y=J.length,X=0;X<Y&&!this.closed;X++)J[X].next(W);var Z=this.count-G+1;if(Z>=0&&Z%U===0&&!this.closed&&J.shift().complete(),++this.count%U===0&&!this.closed){var ee=new Subject;J.push(ee),Q.next(ee)}},E.prototype._error=function(W){var U=this.windows;if(U)for(;U.length>0&&!this.closed;)U.shift().error(W);this.destination.error(W)},E.prototype._complete=function(){var W=this.windows;if(W)for(;W.length>0&&!this.closed;)W.shift().complete();this.destination.complete()},E.prototype._unsubscribe=function(){this.count=0,this.windows=null},E}(Subscriber);function windowTime(D){var E=async,W=null,U=Number.POSITIVE_INFINITY;return isScheduler(arguments[3])&&(E=arguments[3]),isScheduler(arguments[2])?E=arguments[2]:isNumeric(arguments[2])&&(U=Number(arguments[2])),isScheduler(arguments[1])?E=arguments[1]:isNumeric(arguments[1])&&(W=Number(arguments[1])),function(G){return G.lift(new WindowTimeOperator(D,W,U,E))}}var WindowTimeOperator=function(){function D(E,W,U,Q){this.windowTimeSpan=E,this.windowCreationInterval=W,this.maxWindowSize=U,this.scheduler=Q}return D.prototype.call=function(E,W){return W.subscribe(new WindowTimeSubscriber(E,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},D}(),CountedSubject=function(D){__extends$1(E,D);function E(){var W=D!==null&&D.apply(this,arguments)||this;return W._numberOfNextedValues=0,W}return E.prototype.next=function(W){this._numberOfNextedValues++,D.prototype.next.call(this,W)},Object.defineProperty(E.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),E}(Subject),WindowTimeSubscriber=function(D){__extends$1(E,D);function E(W,U,Q,G,J){var Y=D.call(this,W)||this;Y.destination=W,Y.windowTimeSpan=U,Y.windowCreationInterval=Q,Y.maxWindowSize=G,Y.scheduler=J,Y.windows=[];var X=Y.openWindow();if(Q!==null&&Q>=0){var Z={subscriber:Y,window:X,context:null},ee={windowTimeSpan:U,windowCreationInterval:Q,subscriber:Y,scheduler:J};Y.add(J.schedule(dispatchWindowClose,U,Z)),Y.add(J.schedule(dispatchWindowCreation,Q,ee))}else{var oe={subscriber:Y,window:X,windowTimeSpan:U};Y.add(J.schedule(dispatchWindowTimeSpanOnly,U,oe))}return Y}return E.prototype._next=function(W){for(var U=this.windows,Q=U.length,G=0;G<Q;G++){var J=U[G];J.closed||(J.next(W),J.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(J))}},E.prototype._error=function(W){for(var U=this.windows;U.length>0;)U.shift().error(W);this.destination.error(W)},E.prototype._complete=function(){for(var W=this.windows;W.length>0;){var U=W.shift();U.closed||U.complete()}this.destination.complete()},E.prototype.openWindow=function(){var W=new CountedSubject;this.windows.push(W);var U=this.destination;return U.next(W),W},E.prototype.closeWindow=function(W){W.complete();var U=this.windows;U.splice(U.indexOf(W),1)},E}(Subscriber);function dispatchWindowTimeSpanOnly(D){var E=D.subscriber,W=D.windowTimeSpan,U=D.window;U&&E.closeWindow(U),D.window=E.openWindow(),this.schedule(D,W)}function dispatchWindowCreation(D){var E=D.windowTimeSpan,W=D.subscriber,U=D.scheduler,Q=D.windowCreationInterval,G=W.openWindow(),J=this,Y={action:J,subscription:null},X={subscriber:W,window:G,context:Y};Y.subscription=U.schedule(dispatchWindowClose,E,X),J.add(Y.subscription),J.schedule(D,Q)}function dispatchWindowClose(D){var E=D.subscriber,W=D.window,U=D.context;U&&U.action&&U.subscription&&U.action.remove(U.subscription),E.closeWindow(W)}function windowToggle(D,E){return function(W){return W.lift(new WindowToggleOperator(D,E))}}var WindowToggleOperator=function(){function D(E,W){this.openings=E,this.closingSelector=W}return D.prototype.call=function(E,W){return W.subscribe(new WindowToggleSubscriber(E,this.openings,this.closingSelector))},D}(),WindowToggleSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;return G.openings=U,G.closingSelector=Q,G.contexts=[],G.add(G.openSubscription=subscribeToResult(G,U,U)),G}return E.prototype._next=function(W){var U=this.contexts;if(U)for(var Q=U.length,G=0;G<Q;G++)U[G].window.next(W)},E.prototype._error=function(W){var U=this.contexts;if(this.contexts=null,U)for(var Q=U.length,G=-1;++G<Q;){var J=U[G];J.window.error(W),J.subscription.unsubscribe()}D.prototype._error.call(this,W)},E.prototype._complete=function(){var W=this.contexts;if(this.contexts=null,W)for(var U=W.length,Q=-1;++Q<U;){var G=W[Q];G.window.complete(),G.subscription.unsubscribe()}D.prototype._complete.call(this)},E.prototype._unsubscribe=function(){var W=this.contexts;if(this.contexts=null,W)for(var U=W.length,Q=-1;++Q<U;){var G=W[Q];G.window.unsubscribe(),G.subscription.unsubscribe()}},E.prototype.notifyNext=function(W,U,Q,G,J){if(W===this.openings){var Y=void 0;try{var X=this.closingSelector;Y=X(U)}catch(re){return this.error(re)}var Z=new Subject,ee=new Subscription,oe={window:Z,subscription:ee};this.contexts.push(oe);var te=subscribeToResult(this,Y,oe);te.closed?this.closeWindow(this.contexts.length-1):(te.context=oe,ee.add(te)),this.destination.next(Z)}else this.closeWindow(this.contexts.indexOf(W))},E.prototype.notifyError=function(W){this.error(W)},E.prototype.notifyComplete=function(W){W!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(W.context))},E.prototype.closeWindow=function(W){if(W!==-1){var U=this.contexts,Q=U[W],G=Q.window,J=Q.subscription;U.splice(W,1),G.complete(),J.unsubscribe()}},E}(OuterSubscriber);function windowWhen(D){return function(W){return W.lift(new WindowOperator(D))}}var WindowOperator=function(){function D(E){this.closingSelector=E}return D.prototype.call=function(E,W){return W.subscribe(new WindowSubscriber(E,this.closingSelector))},D}(),WindowSubscriber=function(D){__extends$1(E,D);function E(W,U){var Q=D.call(this,W)||this;return Q.destination=W,Q.closingSelector=U,Q.openWindow(),Q}return E.prototype.notifyNext=function(W,U,Q,G,J){this.openWindow(J)},E.prototype.notifyError=function(W){this._error(W)},E.prototype.notifyComplete=function(W){this.openWindow(W)},E.prototype._next=function(W){this.window.next(W)},E.prototype._error=function(W){this.window.error(W),this.destination.error(W),this.unsubscribeClosingNotification()},E.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},E.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},E.prototype.openWindow=function(W){W===void 0&&(W=null),W&&(this.remove(W),W.unsubscribe());var U=this.window;U&&U.complete();var Q=this.window=new Subject;this.destination.next(Q);var G;try{var J=this.closingSelector;G=J()}catch(Y){this.destination.error(Y),this.window.error(Y);return}this.add(this.closingNotification=subscribeToResult(this,G))},E}(OuterSubscriber);function withLatestFrom(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];return function(W){var U;typeof D[D.length-1]=="function"&&(U=D.pop());var Q=D;return W.lift(new WithLatestFromOperator(Q,U))}}var WithLatestFromOperator=function(){function D(E,W){this.observables=E,this.project=W}return D.prototype.call=function(E,W){return W.subscribe(new WithLatestFromSubscriber(E,this.observables,this.project))},D}(),WithLatestFromSubscriber=function(D){__extends$1(E,D);function E(W,U,Q){var G=D.call(this,W)||this;G.observables=U,G.project=Q,G.toRespond=[];var J=U.length;G.values=new Array(J);for(var Y=0;Y<J;Y++)G.toRespond.push(Y);for(var Y=0;Y<J;Y++){var X=U[Y];G.add(subscribeToResult(G,X,void 0,Y))}return G}return E.prototype.notifyNext=function(W,U,Q){this.values[Q]=U;var G=this.toRespond;if(G.length>0){var J=G.indexOf(Q);J!==-1&&G.splice(J,1)}},E.prototype.notifyComplete=function(){},E.prototype._next=function(W){if(this.toRespond.length===0){var U=[W].concat(this.values);this.project?this._tryProject(U):this.destination.next(U)}},E.prototype._tryProject=function(W){var U;try{U=this.project.apply(this,W)}catch(Q){this.destination.error(Q);return}this.destination.next(U)},E}(OuterSubscriber);function zip(){for(var D=[],E=0;E<arguments.length;E++)D[E]=arguments[E];return function(U){return U.lift.call(zip$1.apply(void 0,[U].concat(D)))}}function zipAll(D){return function(E){return E.lift(new ZipOperator(D))}}const operators=Object.freeze(Object.defineProperty({__proto__:null,audit,auditTime,buffer,bufferCount,bufferTime,bufferToggle,bufferWhen,catchError,combineAll,combineLatest,concat,concatAll,concatMap,concatMapTo,count,debounce,debounceTime,defaultIfEmpty,delay,delayWhen,dematerialize,distinct,distinctUntilChanged,distinctUntilKeyChanged,elementAt,endWith,every,exhaust,exhaustMap,expand,filter,finalize,find,findIndex,first,flatMap,groupBy,ignoreElements,isEmpty,last,map,mapTo,materialize,max,merge:merge$1,mergeAll,mergeMap,mergeMapTo,mergeScan,min,multicast,observeOn,onErrorResumeNext,pairwise,partition,pluck,publish,publishBehavior,publishLast,publishReplay,race,reduce,refCount,repeat,repeatWhen,retry,retryWhen,sample,sampleTime,scan,sequenceEqual,share,shareReplay,single,skip,skipLast,skipUntil,skipWhile,startWith,subscribeOn,switchAll,switchMap,switchMapTo,take,takeLast,takeUntil,takeWhile,tap,throttle,throttleTime,throwIfEmpty,timeInterval,timeout:timeout$1,timeoutWith,timestamp,toArray,window:window$1,windowCount,windowTime,windowToggle,windowWhen,withLatestFrom,zip,zipAll},Symbol.toStringTag,{value:"Module"})),require$$3=getAugmentedNamespace(operators);var util$4={},replace=String.prototype.replace,percentTwenties=/%20/g,Format={RFC1738:"RFC1738",RFC3986:"RFC3986"},formats$3={default:Format.RFC3986,formatters:{RFC1738:function(D){return replace.call(D,percentTwenties,"+")},RFC3986:function(D){return String(D)}},RFC1738:Format.RFC1738,RFC3986:Format.RFC3986},formats$2=formats$3,has$2=Object.prototype.hasOwnProperty,isArray$3=Array.isArray,hexTable=function(){for(var D=[],E=0;E<256;++E)D.push("%"+((E<16?"0":"")+E.toString(16)).toUpperCase());return D}(),compactQueue=function D(E){for(;E.length>1;){var W=E.pop(),U=W.obj[W.prop];if(isArray$3(U)){for(var Q=[],G=0;G<U.length;++G)typeof U[G]<"u"&&Q.push(U[G]);W.obj[W.prop]=Q}}},arrayToObject=function D(E,W){for(var U=W&&W.plainObjects?Object.create(null):{},Q=0;Q<E.length;++Q)typeof E[Q]<"u"&&(U[Q]=E[Q]);return U},merge=function D(E,W,U){if(!W)return E;if(typeof W!="object"){if(isArray$3(E))E.push(W);else if(E&&typeof E=="object")(U&&(U.plainObjects||U.allowPrototypes)||!has$2.call(Object.prototype,W))&&(E[W]=!0);else return[E,W];return E}if(!E||typeof E!="object")return[E].concat(W);var Q=E;return isArray$3(E)&&!isArray$3(W)&&(Q=arrayToObject(E,U)),isArray$3(E)&&isArray$3(W)?(W.forEach(function(G,J){if(has$2.call(E,J)){var Y=E[J];Y&&typeof Y=="object"&&G&&typeof G=="object"?E[J]=D(Y,G,U):E.push(G)}else E[J]=G}),E):Object.keys(W).reduce(function(G,J){var Y=W[J];return has$2.call(G,J)?G[J]=D(G[J],Y,U):G[J]=Y,G},Q)},assign=function D(E,W){return Object.keys(W).reduce(function(U,Q){return U[Q]=W[Q],U},E)},decode=function(D,E,W){var U=D.replace(/\+/g," ");if(W==="iso-8859-1")return U.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(U)}catch{return U}},encode=function D(E,W,U,Q,G){if(E.length===0)return E;var J=E;if(typeof E=="symbol"?J=Symbol.prototype.toString.call(E):typeof E!="string"&&(J=String(E)),U==="iso-8859-1")return escape(J).replace(/%u[0-9a-f]{4}/gi,function(ee){return"%26%23"+parseInt(ee.slice(2),16)+"%3B"});for(var Y="",X=0;X<J.length;++X){var Z=J.charCodeAt(X);if(Z===45||Z===46||Z===95||Z===126||Z>=48&&Z<=57||Z>=65&&Z<=90||Z>=97&&Z<=122||G===formats$2.RFC1738&&(Z===40||Z===41)){Y+=J.charAt(X);continue}if(Z<128){Y=Y+hexTable[Z];continue}if(Z<2048){Y=Y+(hexTable[192|Z>>6]+hexTable[128|Z&63]);continue}if(Z<55296||Z>=57344){Y=Y+(hexTable[224|Z>>12]+hexTable[128|Z>>6&63]+hexTable[128|Z&63]);continue}X+=1,Z=65536+((Z&1023)<<10|J.charCodeAt(X)&1023),Y+=hexTable[240|Z>>18]+hexTable[128|Z>>12&63]+hexTable[128|Z>>6&63]+hexTable[128|Z&63]}return Y},compact=function D(E){for(var W=[{obj:{o:E},prop:"o"}],U=[],Q=0;Q<W.length;++Q)for(var G=W[Q],J=G.obj[G.prop],Y=Object.keys(J),X=0;X<Y.length;++X){var Z=Y[X],ee=J[Z];typeof ee=="object"&&ee!==null&&U.indexOf(ee)===-1&&(W.push({obj:J,prop:Z}),U.push(ee))}return compactQueue(W),E},isRegExp=function D(E){return Object.prototype.toString.call(E)==="[object RegExp]"},isBuffer=function D(E){return!E||typeof E!="object"?!1:!!(E.constructor&&E.constructor.isBuffer&&E.constructor.isBuffer(E))},combine=function D(E,W){return[].concat(E,W)},maybeMap=function D(E,W){if(isArray$3(E)){for(var U=[],Q=0;Q<E.length;Q+=1)U.push(W(E[Q]));return U}return W(E)},utils$3={arrayToObject,assign,combine,compact,decode,encode,isBuffer,isRegExp,maybeMap,merge},getSideChannel=sideChannel,utils$2=utils$3,formats$1=formats$3,has$1=Object.prototype.hasOwnProperty,arrayPrefixGenerators={brackets:function D(E){return E+"[]"},comma:"comma",indices:function D(E,W){return E+"["+W+"]"},repeat:function D(E){return E}},isArray$2=Array.isArray,split=String.prototype.split,push=Array.prototype.push,pushToArray=function(D,E){push.apply(D,isArray$2(E)?E:[E])},toISO=Date.prototype.toISOString,defaultFormat=formats$1.default,defaults$1={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:utils$2.encode,encodeValuesOnly:!1,format:defaultFormat,formatter:formats$1.formatters[defaultFormat],indices:!1,serializeDate:function D(E){return toISO.call(E)},skipNulls:!1,strictNullHandling:!1},isNonNullishPrimitive=function D(E){return typeof E=="string"||typeof E=="number"||typeof E=="boolean"||typeof E=="symbol"||typeof E=="bigint"},sentinel={},stringify$1=function D(E,W,U,Q,G,J,Y,X,Z,ee,oe,te,re,ae,fe,de){for(var se=E,ue=de,ce=0,be=!1;(ue=ue.get(sentinel))!==void 0&&!be;){var ye=ue.get(E);if(ce+=1,typeof ye<"u"){if(ye===ce)throw new RangeError("Cyclic object value");be=!0}typeof ue.get(sentinel)>"u"&&(ce=0)}if(typeof X=="function"?se=X(W,se):se instanceof Date?se=oe(se):U==="comma"&&isArray$2(se)&&(se=utils$2.maybeMap(se,function(Ne){return Ne instanceof Date?oe(Ne):Ne})),se===null){if(G)return Y&&!ae?Y(W,defaults$1.encoder,fe,"key",te):W;se=""}if(isNonNullishPrimitive(se)||utils$2.isBuffer(se)){if(Y){var we=ae?W:Y(W,defaults$1.encoder,fe,"key",te);if(U==="comma"&&ae){for(var Ee=split.call(String(se),","),ve="",me=0;me<Ee.length;++me)ve+=(me===0?"":",")+re(Y(Ee[me],defaults$1.encoder,fe,"value",te));return[re(we)+(Q&&isArray$2(se)&&Ee.length===1?"[]":"")+"="+ve]}return[re(we)+"="+re(Y(se,defaults$1.encoder,fe,"value",te))]}return[re(W)+"="+re(String(se))]}var Te=[];if(typeof se>"u")return Te;var ke;if(U==="comma"&&isArray$2(se))ke=[{value:se.length>0?se.join(",")||null:void 0}];else if(isArray$2(X))ke=X;else{var Ce=Object.keys(se);ke=Z?Ce.sort(Z):Ce}for(var Oe=Q&&isArray$2(se)&&se.length===1?W+"[]":W,Ie=0;Ie<ke.length;++Ie){var Ae=ke[Ie],Le=typeof Ae=="object"&&typeof Ae.value<"u"?Ae.value:se[Ae];if(!(J&&Le===null)){var De=isArray$2(se)?typeof U=="function"?U(Oe,Ae):Oe:Oe+(ee?"."+Ae:"["+Ae+"]");de.set(E,ce);var Pe=getSideChannel();Pe.set(sentinel,de),pushToArray(Te,D(Le,De,U,Q,G,J,Y,X,Z,ee,oe,te,re,ae,fe,Pe))}}return Te},normalizeStringifyOptions=function D(E){if(!E)return defaults$1;if(E.encoder!==null&&typeof E.encoder<"u"&&typeof E.encoder!="function")throw new TypeError("Encoder has to be a function.");var W=E.charset||defaults$1.charset;if(typeof E.charset<"u"&&E.charset!=="utf-8"&&E.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var U=formats$1.default;if(typeof E.format<"u"){if(!has$1.call(formats$1.formatters,E.format))throw new TypeError("Unknown format option provided.");U=E.format}var Q=formats$1.formatters[U],G=defaults$1.filter;return(typeof E.filter=="function"||isArray$2(E.filter))&&(G=E.filter),{addQueryPrefix:typeof E.addQueryPrefix=="boolean"?E.addQueryPrefix:defaults$1.addQueryPrefix,allowDots:typeof E.allowDots>"u"?defaults$1.allowDots:!!E.allowDots,charset:W,charsetSentinel:typeof E.charsetSentinel=="boolean"?E.charsetSentinel:defaults$1.charsetSentinel,delimiter:typeof E.delimiter>"u"?defaults$1.delimiter:E.delimiter,encode:typeof E.encode=="boolean"?E.encode:defaults$1.encode,encoder:typeof E.encoder=="function"?E.encoder:defaults$1.encoder,encodeValuesOnly:typeof E.encodeValuesOnly=="boolean"?E.encodeValuesOnly:defaults$1.encodeValuesOnly,filter:G,format:U,formatter:Q,serializeDate:typeof E.serializeDate=="function"?E.serializeDate:defaults$1.serializeDate,skipNulls:typeof E.skipNulls=="boolean"?E.skipNulls:defaults$1.skipNulls,sort:typeof E.sort=="function"?E.sort:null,strictNullHandling:typeof E.strictNullHandling=="boolean"?E.strictNullHandling:defaults$1.strictNullHandling}},stringify_1=function(D,E){var W=D,U=normalizeStringifyOptions(E),Q,G;typeof U.filter=="function"?(G=U.filter,W=G("",W)):isArray$2(U.filter)&&(G=U.filter,Q=G);var J=[];if(typeof W!="object"||W===null)return"";var Y;E&&E.arrayFormat in arrayPrefixGenerators?Y=E.arrayFormat:E&&"indices"in E?Y=E.indices?"indices":"repeat":Y="indices";var X=arrayPrefixGenerators[Y];if(E&&"commaRoundTrip"in E&&typeof E.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var Z=X==="comma"&&E&&E.commaRoundTrip;Q||(Q=Object.keys(W)),U.sort&&Q.sort(U.sort);for(var ee=getSideChannel(),oe=0;oe<Q.length;++oe){var te=Q[oe];U.skipNulls&&W[te]===null||pushToArray(J,stringify$1(W[te],te,X,Z,U.strictNullHandling,U.skipNulls,U.encode?U.encoder:null,U.filter,U.sort,U.allowDots,U.serializeDate,U.format,U.formatter,U.encodeValuesOnly,U.charset,ee))}var re=J.join(U.delimiter),ae=U.addQueryPrefix===!0?"?":"";return U.charsetSentinel&&(U.charset==="iso-8859-1"?ae+="utf8=%26%2310003%3B&":ae+="utf8=%E2%9C%93&"),re.length>0?ae+re:""},utils$1=utils$3,has=Object.prototype.hasOwnProperty,isArray$1=Array.isArray,defaults={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:utils$1.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},interpretNumericEntities=function(D){return D.replace(/&#(\d+);/g,function(E,W){return String.fromCharCode(parseInt(W,10))})},parseArrayValue=function(D,E){return D&&typeof D=="string"&&E.comma&&D.indexOf(",")>-1?D.split(","):D},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function D(E,W){var U={},Q=W.ignoreQueryPrefix?E.replace(/^\?/,""):E,G=W.parameterLimit===1/0?void 0:W.parameterLimit,J=Q.split(W.delimiter,G),Y=-1,X,Z=W.charset;if(W.charsetSentinel)for(X=0;X<J.length;++X)J[X].indexOf("utf8=")===0&&(J[X]===charsetSentinel?Z="utf-8":J[X]===isoSentinel&&(Z="iso-8859-1"),Y=X,X=J.length);for(X=0;X<J.length;++X)if(X!==Y){var ee=J[X],oe=ee.indexOf("]="),te=oe===-1?ee.indexOf("="):oe+1,re,ae;te===-1?(re=W.decoder(ee,defaults.decoder,Z,"key"),ae=W.strictNullHandling?null:""):(re=W.decoder(ee.slice(0,te),defaults.decoder,Z,"key"),ae=utils$1.maybeMap(parseArrayValue(ee.slice(te+1),W),function(fe){return W.decoder(fe,defaults.decoder,Z,"value")})),ae&&W.interpretNumericEntities&&Z==="iso-8859-1"&&(ae=interpretNumericEntities(ae)),ee.indexOf("[]=")>-1&&(ae=isArray$1(ae)?[ae]:ae),has.call(U,re)?U[re]=utils$1.combine(U[re],ae):U[re]=ae}return U},parseObject=function(D,E,W,U){for(var Q=U?E:parseArrayValue(E,W),G=D.length-1;G>=0;--G){var J,Y=D[G];if(Y==="[]"&&W.parseArrays)J=[].concat(Q);else{J=W.plainObjects?Object.create(null):{};var X=Y.charAt(0)==="["&&Y.charAt(Y.length-1)==="]"?Y.slice(1,-1):Y,Z=parseInt(X,10);!W.parseArrays&&X===""?J={0:Q}:!isNaN(Z)&&Y!==X&&String(Z)===X&&Z>=0&&W.parseArrays&&Z<=W.arrayLimit?(J=[],J[Z]=Q):X!=="__proto__"&&(J[X]=Q)}Q=J}return Q},parseKeys=function D(E,W,U,Q){if(E){var G=U.allowDots?E.replace(/\.([^.[]+)/g,"[$1]"):E,J=/(\[[^[\]]*])/,Y=/(\[[^[\]]*])/g,X=U.depth>0&&J.exec(G),Z=X?G.slice(0,X.index):G,ee=[];if(Z){if(!U.plainObjects&&has.call(Object.prototype,Z)&&!U.allowPrototypes)return;ee.push(Z)}for(var oe=0;U.depth>0&&(X=Y.exec(G))!==null&&oe<U.depth;){if(oe+=1,!U.plainObjects&&has.call(Object.prototype,X[1].slice(1,-1))&&!U.allowPrototypes)return;ee.push(X[1])}return X&&ee.push("["+G.slice(X.index)+"]"),parseObject(ee,W,U,Q)}},normalizeParseOptions=function D(E){if(!E)return defaults;if(E.decoder!==null&&E.decoder!==void 0&&typeof E.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof E.charset<"u"&&E.charset!=="utf-8"&&E.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var W=typeof E.charset>"u"?defaults.charset:E.charset;return{allowDots:typeof E.allowDots>"u"?defaults.allowDots:!!E.allowDots,allowPrototypes:typeof E.allowPrototypes=="boolean"?E.allowPrototypes:defaults.allowPrototypes,allowSparse:typeof E.allowSparse=="boolean"?E.allowSparse:defaults.allowSparse,arrayLimit:typeof E.arrayLimit=="number"?E.arrayLimit:defaults.arrayLimit,charset:W,charsetSentinel:typeof E.charsetSentinel=="boolean"?E.charsetSentinel:defaults.charsetSentinel,comma:typeof E.comma=="boolean"?E.comma:defaults.comma,decoder:typeof E.decoder=="function"?E.decoder:defaults.decoder,delimiter:typeof E.delimiter=="string"||utils$1.isRegExp(E.delimiter)?E.delimiter:defaults.delimiter,depth:typeof E.depth=="number"||E.depth===!1?+E.depth:defaults.depth,ignoreQueryPrefix:E.ignoreQueryPrefix===!0,interpretNumericEntities:typeof E.interpretNumericEntities=="boolean"?E.interpretNumericEntities:defaults.interpretNumericEntities,parameterLimit:typeof E.parameterLimit=="number"?E.parameterLimit:defaults.parameterLimit,parseArrays:E.parseArrays!==!1,plainObjects:typeof E.plainObjects=="boolean"?E.plainObjects:defaults.plainObjects,strictNullHandling:typeof E.strictNullHandling=="boolean"?E.strictNullHandling:defaults.strictNullHandling}},parse$1=function(D,E){var W=normalizeParseOptions(E);if(D===""||D===null||typeof D>"u")return W.plainObjects?Object.create(null):{};for(var U=typeof D=="string"?parseValues(D,W):D,Q=W.plainObjects?Object.create(null):{},G=Object.keys(U),J=0;J<G.length;++J){var Y=G[J],X=parseKeys(Y,U[Y],W,typeof D=="string");Q=utils$1.merge(Q,X,W)}return W.allowSparse===!0?Q:utils$1.compact(Q)},stringify=stringify_1,parse=parse$1,formats=formats$3,lib$1={formats,parse,stringify},types$1={};Object.defineProperty(types$1,"__esModule",{value:!0});types$1.RegExpString=types$1.IntNumber=types$1.BigIntString=types$1.AddressString=types$1.HexString=types$1.OpaqueType=void 0;function OpaqueType(){return D=>D}types$1.OpaqueType=OpaqueType;types$1.HexString=OpaqueType();types$1.AddressString=OpaqueType();types$1.BigIntString=OpaqueType();function IntNumber(D){return Math.floor(D)}types$1.IntNumber=IntNumber;types$1.RegExpString=OpaqueType();var __importDefault$8=commonjsGlobal&&commonjsGlobal.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(util$4,"__esModule",{value:!0});util$4.createQrUrl=util$4.getFavicon=util$4.range=util$4.isBigNumber=util$4.ensureParsedJSONObject=util$4.ensureBN=util$4.ensureRegExpString=util$4.ensureIntNumber=util$4.ensureBuffer=util$4.ensureAddressString=util$4.ensureEvenLengthHexString=util$4.ensureHexString=util$4.isHexString=util$4.prepend0x=util$4.strip0x=util$4.has0xPrefix=util$4.hexStringFromIntNumber=util$4.intNumberFromHexString=util$4.bigIntStringFromBN=util$4.hexStringFromBuffer=util$4.hexStringToUint8Array=util$4.uint8ArrayToHex=util$4.randomBytesHex=void 0;const bn_js_1$1=__importDefault$8(bnExports),qs_1=lib$1,types_1$2=types$1,INT_STRING_REGEX=/^[0-9]*$/,HEXADECIMAL_STRING_REGEX=/^[a-f0-9]*$/;function randomBytesHex(D){return uint8ArrayToHex(crypto.getRandomValues(new Uint8Array(D)))}util$4.randomBytesHex=randomBytesHex;function uint8ArrayToHex(D){return[...D].map(E=>E.toString(16).padStart(2,"0")).join("")}util$4.uint8ArrayToHex=uint8ArrayToHex;function hexStringToUint8Array(D){return new Uint8Array(D.match(/.{1,2}/g).map(E=>parseInt(E,16)))}util$4.hexStringToUint8Array=hexStringToUint8Array;function hexStringFromBuffer(D,E=!1){const W=D.toString("hex");return(0,types_1$2.HexString)(E?"0x"+W:W)}util$4.hexStringFromBuffer=hexStringFromBuffer;function bigIntStringFromBN(D){return(0,types_1$2.BigIntString)(D.toString(10))}util$4.bigIntStringFromBN=bigIntStringFromBN;function intNumberFromHexString(D){return(0,types_1$2.IntNumber)(new bn_js_1$1.default(ensureEvenLengthHexString(D,!1),16).toNumber())}util$4.intNumberFromHexString=intNumberFromHexString;function hexStringFromIntNumber(D){return(0,types_1$2.HexString)("0x"+new bn_js_1$1.default(D).toString(16))}util$4.hexStringFromIntNumber=hexStringFromIntNumber;function has0xPrefix(D){return D.startsWith("0x")||D.startsWith("0X")}util$4.has0xPrefix=has0xPrefix;function strip0x(D){return has0xPrefix(D)?D.slice(2):D}util$4.strip0x=strip0x;function prepend0x(D){return has0xPrefix(D)?"0x"+D.slice(2):"0x"+D}util$4.prepend0x=prepend0x;function isHexString$1(D){if(typeof D!="string")return!1;const E=strip0x(D).toLowerCase();return HEXADECIMAL_STRING_REGEX.test(E)}util$4.isHexString=isHexString$1;function ensureHexString(D,E=!1){if(typeof D=="string"){const W=strip0x(D).toLowerCase();if(HEXADECIMAL_STRING_REGEX.test(W))return(0,types_1$2.HexString)(E?"0x"+W:W)}throw new Error(`"${String(D)}" is not a hexadecimal string`)}util$4.ensureHexString=ensureHexString;function ensureEvenLengthHexString(D,E=!1){let W=ensureHexString(D,!1);return W.length%2===1&&(W=(0,types_1$2.HexString)("0"+W)),E?(0,types_1$2.HexString)("0x"+W):W}util$4.ensureEvenLengthHexString=ensureEvenLengthHexString;function ensureAddressString(D){if(typeof D=="string"){const E=strip0x(D).toLowerCase();if(isHexString$1(E)&&E.length===40)return(0,types_1$2.AddressString)(prepend0x(E))}throw new Error(`Invalid Ethereum address: ${String(D)}`)}util$4.ensureAddressString=ensureAddressString;function ensureBuffer(D){if(Buffer.isBuffer(D))return D;if(typeof D=="string")if(isHexString$1(D)){const E=ensureEvenLengthHexString(D,!1);return Buffer.from(E,"hex")}else return Buffer.from(D,"utf8");throw new Error(`Not binary data: ${String(D)}`)}util$4.ensureBuffer=ensureBuffer;function ensureIntNumber(D){if(typeof D=="number"&&Number.isInteger(D))return(0,types_1$2.IntNumber)(D);if(typeof D=="string"){if(INT_STRING_REGEX.test(D))return(0,types_1$2.IntNumber)(Number(D));if(isHexString$1(D))return(0,types_1$2.IntNumber)(new bn_js_1$1.default(ensureEvenLengthHexString(D,!1),16).toNumber())}throw new Error(`Not an integer: ${String(D)}`)}util$4.ensureIntNumber=ensureIntNumber;function ensureRegExpString(D){if(D instanceof RegExp)return(0,types_1$2.RegExpString)(D.toString());throw new Error(`Not a RegExp: ${String(D)}`)}util$4.ensureRegExpString=ensureRegExpString;function ensureBN(D){if(D!==null&&(bn_js_1$1.default.isBN(D)||isBigNumber(D)))return new bn_js_1$1.default(D.toString(10),10);if(typeof D=="number")return new bn_js_1$1.default(ensureIntNumber(D));if(typeof D=="string"){if(INT_STRING_REGEX.test(D))return new bn_js_1$1.default(D,10);if(isHexString$1(D))return new bn_js_1$1.default(ensureEvenLengthHexString(D,!1),16)}throw new Error(`Not an integer: ${String(D)}`)}util$4.ensureBN=ensureBN;function ensureParsedJSONObject(D){if(typeof D=="string")return JSON.parse(D);if(typeof D=="object")return D;throw new Error(`Not a JSON string or an object: ${String(D)}`)}util$4.ensureParsedJSONObject=ensureParsedJSONObject;function isBigNumber(D){if(D==null||typeof D.constructor!="function")return!1;const{constructor:E}=D;return typeof E.config=="function"&&typeof E.EUCLID=="number"}util$4.isBigNumber=isBigNumber;function range(D,E){return Array.from({length:E-D},(W,U)=>D+U)}util$4.range=range;function getFavicon(){const D=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:E,host:W}=document.location,U=D?D.getAttribute("href"):null;return!U||U.startsWith("javascript:")?null:U.startsWith("http://")||U.startsWith("https://")||U.startsWith("data:")?U:U.startsWith("//")?E+U:`${E}//${W}${U}`}util$4.getFavicon=getFavicon;function createQrUrl(D,E,W,U){const Q=U?"parent-id":"id",G=(0,qs_1.stringify)({[Q]:D,secret:E,server:W,v:"1"});return`${W}/#/link?${G}`}util$4.createQrUrl=createQrUrl;Object.defineProperty(Session$1,"__esModule",{value:!0});Session$1.Session=void 0;const js_sha256_1=sha256Exports,rxjs_1$4=require$$2$1,operators_1$2=require$$3,util_1$7=util$4,STORAGE_KEY_SESSION_ID="session:id",STORAGE_KEY_SESSION_SECRET="session:secret",STORAGE_KEY_SESSION_LINKED="session:linked";class Session{constructor(E,W,U,Q){this._storage=E,this._id=W||(0,util_1$7.randomBytesHex)(16),this._secret=U||(0,util_1$7.randomBytesHex)(32);const G=js_sha256_1.sha256.create();G.update(`${this._id}, ${this._secret} WalletLink`),this._key=G.hex(),this._linked=!!Q}static load(E){const W=E.getItem(STORAGE_KEY_SESSION_ID),U=E.getItem(STORAGE_KEY_SESSION_LINKED),Q=E.getItem(STORAGE_KEY_SESSION_SECRET);return W&&Q?new Session(E,W,Q,U==="1"):null}static get persistedSessionIdChange$(){return(0,rxjs_1$4.fromEvent)(window,"storage").pipe((0,operators_1$2.filter)(E=>E.key===STORAGE_KEY_SESSION_ID),(0,operators_1$2.map)(E=>({oldValue:E.oldValue||null,newValue:E.newValue||null})))}static hash(E){return js_sha256_1.sha256.create().update(E).hex()}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(E){this._linked=E,this.persistLinked()}save(){return this._storage.setItem(STORAGE_KEY_SESSION_ID,this._id),this._storage.setItem(STORAGE_KEY_SESSION_SECRET,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(STORAGE_KEY_SESSION_LINKED,this._linked?"1":"0")}}Session$1.Session=Session;var WalletSDKRelayAbstract$1={};Object.defineProperty(WalletSDKRelayAbstract$1,"__esModule",{value:!0});WalletSDKRelayAbstract$1.WalletSDKRelayAbstract=WalletSDKRelayAbstract$1.APP_VERSION_KEY=WalletSDKRelayAbstract$1.LOCAL_STORAGE_ADDRESSES_KEY=WalletSDKRelayAbstract$1.WALLET_USER_NAME_KEY=void 0;const eth_rpc_errors_1$3=dist$2;WalletSDKRelayAbstract$1.WALLET_USER_NAME_KEY="walletUsername";WalletSDKRelayAbstract$1.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";WalletSDKRelayAbstract$1.APP_VERSION_KEY="AppVersion";class WalletSDKRelayAbstract{async makeEthereumJSONRPCRequest(E,W){if(!W)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(W,{method:"POST",body:JSON.stringify(E),mode:"cors",headers:{"Content-Type":"application/json"}}).then(U=>U.json()).then(U=>{if(!U)throw eth_rpc_errors_1$3.ethErrors.rpc.parse({});const Q=U,{error:G}=Q;if(G)throw(0,eth_rpc_errors_1$3.serializeError)(G);return Q})}}WalletSDKRelayAbstract$1.WalletSDKRelayAbstract=WalletSDKRelayAbstract;var keccakStateUnroll={};const P1600_ROUND_CONSTANTS=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];keccakStateUnroll.p1600=function(D){for(let E=0;E<24;++E){const W=D[0]^D[10]^D[20]^D[30]^D[40],U=D[1]^D[11]^D[21]^D[31]^D[41],Q=D[2]^D[12]^D[22]^D[32]^D[42],G=D[3]^D[13]^D[23]^D[33]^D[43],J=D[4]^D[14]^D[24]^D[34]^D[44],Y=D[5]^D[15]^D[25]^D[35]^D[45],X=D[6]^D[16]^D[26]^D[36]^D[46],Z=D[7]^D[17]^D[27]^D[37]^D[47],ee=D[8]^D[18]^D[28]^D[38]^D[48],oe=D[9]^D[19]^D[29]^D[39]^D[49];let te=ee^(Q<<1|G>>>31),re=oe^(G<<1|Q>>>31);const ae=D[0]^te,fe=D[1]^re,de=D[10]^te,se=D[11]^re,ue=D[20]^te,ce=D[21]^re,be=D[30]^te,ye=D[31]^re,we=D[40]^te,Ee=D[41]^re;te=W^(J<<1|Y>>>31),re=U^(Y<<1|J>>>31);const ve=D[2]^te,me=D[3]^re,Te=D[12]^te,ke=D[13]^re,Ce=D[22]^te,Oe=D[23]^re,Ie=D[32]^te,Ae=D[33]^re,Le=D[42]^te,De=D[43]^re;te=Q^(X<<1|Z>>>31),re=G^(Z<<1|X>>>31);const Pe=D[4]^te,Ne=D[5]^re,Ue=D[14]^te,Ve=D[15]^re,qe=D[24]^te,je=D[25]^re,Qe=D[34]^te,Ge=D[35]^re,he=D[44]^te,le=D[45]^re;te=J^(ee<<1|oe>>>31),re=Y^(oe<<1|ee>>>31);const _e=D[6]^te,Se=D[7]^re,xe=D[16]^te,ne=D[17]^re,ie=D[26]^te,pe=D[27]^re,ge=D[36]^te,Me=D[37]^re,Re=D[46]^te,$e=D[47]^re;te=X^(W<<1|U>>>31),re=Z^(U<<1|W>>>31);const Be=D[8]^te,ze=D[9]^re,Xe=D[18]^te,et=D[19]^re,Ze=D[28]^te,Ke=D[29]^re,Je=D[38]^te,Ye=D[39]^re,He=D[48]^te,We=D[49]^re,Fe=ae,tt=fe,rt=se<<4|de>>>28,nt=de<<4|se>>>28,it=ue<<3|ce>>>29,st=ce<<3|ue>>>29,ot=ye<<9|be>>>23,at=be<<9|ye>>>23,ut=we<<18|Ee>>>14,ct=Ee<<18|we>>>14,lt=ve<<1|me>>>31,ht=me<<1|ve>>>31,ft=ke<<12|Te>>>20,dt=Te<<12|ke>>>20,pt=Ce<<10|Oe>>>22,bt=Oe<<10|Ce>>>22,_t=Ae<<13|Ie>>>19,gt=Ie<<13|Ae>>>19,yt=Le<<2|De>>>30,mt=De<<2|Le>>>30,vt=Ne<<30|Pe>>>2,St=Pe<<30|Ne>>>2,wt=Ue<<6|Ve>>>26,Et=Ve<<6|Ue>>>26,Rt=je<<11|qe>>>21,xt=qe<<11|je>>>21,$t=Qe<<15|Ge>>>17,Ct=Ge<<15|Qe>>>17,Mt=le<<29|he>>>3,kt=he<<29|le>>>3,Tt=_e<<28|Se>>>4,At=Se<<28|_e>>>4,Ot=ne<<23|xe>>>9,It=xe<<23|ne>>>9,Nt=ie<<25|pe>>>7,Dt=pe<<25|ie>>>7,Lt=ge<<21|Me>>>11,Pt=Me<<21|ge>>>11,jt=$e<<24|Re>>>8,Ft=Re<<24|$e>>>8,Bt=Be<<27|ze>>>5,Wt=ze<<27|Be>>>5,Ht=Xe<<20|et>>>12,Ut=et<<20|Xe>>>12,qt=Ke<<7|Ze>>>25,zt=Ze<<7|Ke>>>25,Vt=Je<<8|Ye>>>24,Qt=Ye<<8|Je>>>24,Gt=He<<14|We>>>18,Kt=We<<14|He>>>18;D[0]=Fe^~ft&Rt,D[1]=tt^~dt&xt,D[10]=Tt^~Ht&it,D[11]=At^~Ut&st,D[20]=lt^~wt&Nt,D[21]=ht^~Et&Dt,D[30]=Bt^~rt&pt,D[31]=Wt^~nt&bt,D[40]=vt^~Ot&qt,D[41]=St^~It&zt,D[2]=ft^~Rt&Lt,D[3]=dt^~xt&Pt,D[12]=Ht^~it&_t,D[13]=Ut^~st&gt,D[22]=wt^~Nt&Vt,D[23]=Et^~Dt&Qt,D[32]=rt^~pt&$t,D[33]=nt^~bt&Ct,D[42]=Ot^~qt&ot,D[43]=It^~zt&at,D[4]=Rt^~Lt&Gt,D[5]=xt^~Pt&Kt,D[14]=it^~_t&Mt,D[15]=st^~gt&kt,D[24]=Nt^~Vt&ut,D[25]=Dt^~Qt&ct,D[34]=pt^~$t&jt,D[35]=bt^~Ct&Ft,D[44]=qt^~ot&yt,D[45]=zt^~at&mt,D[6]=Lt^~Gt&Fe,D[7]=Pt^~Kt&tt,D[16]=_t^~Mt&Tt,D[17]=gt^~kt&At,D[26]=Vt^~ut&lt,D[27]=Qt^~ct&ht,D[36]=$t^~jt&Bt,D[37]=Ct^~Ft&Wt,D[46]=ot^~yt&vt,D[47]=at^~mt&St,D[8]=Gt^~Fe&ft,D[9]=Kt^~tt&dt,D[18]=Mt^~Tt&Ht,D[19]=kt^~At&Ut,D[28]=ut^~lt&wt,D[29]=ct^~ht&Et,D[38]=jt^~Bt&rt,D[39]=Ft^~Wt&nt,D[48]=yt^~vt&Ot,D[49]=mt^~St&It,D[0]^=P1600_ROUND_CONSTANTS[E*2],D[1]^=P1600_ROUND_CONSTANTS[E*2+1]}};const keccakState=keccakStateUnroll;function Keccak(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}Keccak.prototype.initialize=function(D,E){for(let W=0;W<50;++W)this.state[W]=0;this.blockSize=D/8,this.count=0,this.squeezing=!1};Keccak.prototype.absorb=function(D){for(let E=0;E<D.length;++E)this.state[~~(this.count/4)]^=D[E]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(keccakState.p1600(this.state),this.count=0)};Keccak.prototype.absorbLastFewBits=function(D){this.state[~~(this.count/4)]^=D<<8*(this.count%4),D&128&&this.count===this.blockSize-1&&keccakState.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),keccakState.p1600(this.state),this.count=0,this.squeezing=!0};Keccak.prototype.squeeze=function(D){this.squeezing||this.absorbLastFewBits(1);const E=Buffer.alloc(D);for(let W=0;W<D;++W)E[W]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(keccakState.p1600(this.state),this.count=0);return E};Keccak.prototype.copy=function(D){for(let E=0;E<50;++E)D.state[E]=this.state[E];D.blockSize=this.blockSize,D.count=this.count,D.squeezing=this.squeezing};var keccak$2=Keccak,readableBrowser={exports:{}},streamBrowser=eventsExports.EventEmitter,buffer_list,hasRequiredBuffer_list;function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;hasRequiredBuffer_list=1;function D(te,re){var ae=Object.keys(te);if(Object.getOwnPropertySymbols){var fe=Object.getOwnPropertySymbols(te);re&&(fe=fe.filter(function(de){return Object.getOwnPropertyDescriptor(te,de).enumerable})),ae.push.apply(ae,fe)}return ae}function E(te){for(var re=1;re<arguments.length;re++){var ae=arguments[re]!=null?arguments[re]:{};re%2?D(Object(ae),!0).forEach(function(fe){W(te,fe,ae[fe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(te,Object.getOwnPropertyDescriptors(ae)):D(Object(ae)).forEach(function(fe){Object.defineProperty(te,fe,Object.getOwnPropertyDescriptor(ae,fe))})}return te}function W(te,re,ae){return re in te?Object.defineProperty(te,re,{value:ae,enumerable:!0,configurable:!0,writable:!0}):te[re]=ae,te}function U(te,re){if(!(te instanceof re))throw new TypeError("Cannot call a class as a function")}function Q(te,re){for(var ae=0;ae<re.length;ae++){var fe=re[ae];fe.enumerable=fe.enumerable||!1,fe.configurable=!0,"value"in fe&&(fe.writable=!0),Object.defineProperty(te,fe.key,fe)}}function G(te,re,ae){return re&&Q(te.prototype,re),ae&&Q(te,ae),te}var J=require$$0$1,Y=J.Buffer,X=require$$0$1,Z=X.inspect,ee=Z&&Z.custom||"inspect";function oe(te,re,ae){Y.prototype.copy.call(te,re,ae)}return buffer_list=function(){function te(){U(this,te),this.head=null,this.tail=null,this.length=0}return G(te,[{key:"push",value:function(ae){var fe={data:ae,next:null};this.length>0?this.tail.next=fe:this.head=fe,this.tail=fe,++this.length}},{key:"unshift",value:function(ae){var fe={data:ae,next:this.head};this.length===0&&(this.tail=fe),this.head=fe,++this.length}},{key:"shift",value:function(){if(this.length!==0){var ae=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ae}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(ae){if(this.length===0)return"";for(var fe=this.head,de=""+fe.data;fe=fe.next;)de+=ae+fe.data;return de}},{key:"concat",value:function(ae){if(this.length===0)return Y.alloc(0);for(var fe=Y.allocUnsafe(ae>>>0),de=this.head,se=0;de;)oe(de.data,fe,se),se+=de.data.length,de=de.next;return fe}},{key:"consume",value:function(ae,fe){var de;return ae<this.head.data.length?(de=this.head.data.slice(0,ae),this.head.data=this.head.data.slice(ae)):ae===this.head.data.length?de=this.shift():de=fe?this._getString(ae):this._getBuffer(ae),de}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(ae){var fe=this.head,de=1,se=fe.data;for(ae-=se.length;fe=fe.next;){var ue=fe.data,ce=ae>ue.length?ue.length:ae;if(ce===ue.length?se+=ue:se+=ue.slice(0,ae),ae-=ce,ae===0){ce===ue.length?(++de,fe.next?this.head=fe.next:this.head=this.tail=null):(this.head=fe,fe.data=ue.slice(ce));break}++de}return this.length-=de,se}},{key:"_getBuffer",value:function(ae){var fe=Y.allocUnsafe(ae),de=this.head,se=1;for(de.data.copy(fe),ae-=de.data.length;de=de.next;){var ue=de.data,ce=ae>ue.length?ue.length:ae;if(ue.copy(fe,fe.length-ae,0,ce),ae-=ce,ae===0){ce===ue.length?(++se,de.next?this.head=de.next:this.head=this.tail=null):(this.head=de,de.data=ue.slice(ce));break}++se}return this.length-=se,fe}},{key:ee,value:function(ae,fe){return Z(this,E({},fe,{depth:0,customInspect:!1}))}}]),te}(),buffer_list}function destroy(D,E){var W=this,U=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;return U||Q?(E?E(D):D&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,browser$1.nextTick(emitErrorNT,this,D)):browser$1.nextTick(emitErrorNT,this,D)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(D||null,function(G){!E&&G?W._writableState?W._writableState.errorEmitted?browser$1.nextTick(emitCloseNT,W):(W._writableState.errorEmitted=!0,browser$1.nextTick(emitErrorAndCloseNT,W,G)):browser$1.nextTick(emitErrorAndCloseNT,W,G):E?(browser$1.nextTick(emitCloseNT,W),E(G)):browser$1.nextTick(emitCloseNT,W)}),this)}function emitErrorAndCloseNT(D,E){emitErrorNT(D,E),emitCloseNT(D)}function emitCloseNT(D){D._writableState&&!D._writableState.emitClose||D._readableState&&!D._readableState.emitClose||D.emit("close")}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(D,E){D.emit("error",E)}function errorOrDestroy(D,E){var W=D._readableState,U=D._writableState;W&&W.autoDestroy||U&&U.autoDestroy?D.destroy(E):D.emit("error",E)}var destroy_1={destroy,undestroy,errorOrDestroy},errorsBrowser={};function _inheritsLoose(D,E){D.prototype=Object.create(E.prototype),D.prototype.constructor=D,D.__proto__=E}var codes={};function createErrorType(D,E,W){W||(W=Error);function U(G,J,Y){return typeof E=="string"?E:E(G,J,Y)}var Q=function(G){_inheritsLoose(J,G);function J(Y,X,Z){return G.call(this,U(Y,X,Z))||this}return J}(W);Q.prototype.name=W.name,Q.prototype.code=D,codes[D]=Q}function oneOf(D,E){if(Array.isArray(D)){var W=D.length;return D=D.map(function(U){return String(U)}),W>2?"one of ".concat(E," ").concat(D.slice(0,W-1).join(", "),", or ")+D[W-1]:W===2?"one of ".concat(E," ").concat(D[0]," or ").concat(D[1]):"of ".concat(E," ").concat(D[0])}else return"of ".concat(E," ").concat(String(D))}function startsWith(D,E,W){return D.substr(!W||W<0?0:+W,E.length)===E}function endsWith(D,E,W){return(W===void 0||W>D.length)&&(W=D.length),D.substring(W-E.length,W)===E}function includes(D,E,W){return typeof W!="number"&&(W=0),W+E.length>D.length?!1:D.indexOf(E,W)!==-1}createErrorType("ERR_INVALID_OPT_VALUE",function(D,E){return'The value "'+E+'" is invalid for option "'+D+'"'},TypeError);createErrorType("ERR_INVALID_ARG_TYPE",function(D,E,W){var U;typeof E=="string"&&startsWith(E,"not ")?(U="must not be",E=E.replace(/^not /,"")):U="must be";var Q;if(endsWith(D," argument"))Q="The ".concat(D," ").concat(U," ").concat(oneOf(E,"type"));else{var G=includes(D,".")?"property":"argument";Q='The "'.concat(D,'" ').concat(G," ").concat(U," ").concat(oneOf(E,"type"))}return Q+=". Received type ".concat(typeof W),Q},TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",function(D){return"The "+D+" method is not implemented"});createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",function(D){return"Cannot call "+D+" after a stream was destroyed"});createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",function(D){return"Unknown encoding: "+D},TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");errorsBrowser.codes=codes;var ERR_INVALID_OPT_VALUE=errorsBrowser.codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(D,E,W){return D.highWaterMark!=null?D.highWaterMark:E?D[W]:null}function getHighWaterMark(D,E,W,U){var Q=highWaterMarkFrom(E,U,W);if(Q!=null){if(!(isFinite(Q)&&Math.floor(Q)===Q)||Q<0){var G=U?W:"highWaterMark";throw new ERR_INVALID_OPT_VALUE(G,Q)}return Math.floor(Q)}return D.objectMode?16:16*1024}var state={getHighWaterMark},browser=deprecate;function deprecate(D,E){if(config("noDeprecation"))return D;var W=!1;function U(){if(!W){if(config("throwDeprecation"))throw new Error(E);config("traceDeprecation")?console.trace(E):console.warn(E),W=!0}return D.apply(this,arguments)}return U}function config(D){try{if(!globalThis.localStorage)return!1}catch{return!1}var E=globalThis.localStorage[D];return E==null?!1:String(E).toLowerCase()==="true"}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1,_stream_writable=ve;function D(he){var le=this;this.next=null,this.entry=null,this.finish=function(){Ge(le,he)}}var E;ve.WritableState=we;var W={deprecate:browser},U=streamBrowser,Q=require$$0$1.Buffer,G=globalThis.Uint8Array||function(){};function J(he){return Q.from(he)}function Y(he){return Q.isBuffer(he)||he instanceof G}var X=destroy_1,Z=state,ee=Z.getHighWaterMark,oe=errorsBrowser.codes,te=oe.ERR_INVALID_ARG_TYPE,re=oe.ERR_METHOD_NOT_IMPLEMENTED,ae=oe.ERR_MULTIPLE_CALLBACK,fe=oe.ERR_STREAM_CANNOT_PIPE,de=oe.ERR_STREAM_DESTROYED,se=oe.ERR_STREAM_NULL_VALUES,ue=oe.ERR_STREAM_WRITE_AFTER_END,ce=oe.ERR_UNKNOWN_ENCODING,be=X.errorOrDestroy;inherits_browserExports(ve,U);function ye(){}function we(he,le,_e){E=E||require_stream_duplex(),he=he||{},typeof _e!="boolean"&&(_e=le instanceof E),this.objectMode=!!he.objectMode,_e&&(this.objectMode=this.objectMode||!!he.writableObjectMode),this.highWaterMark=ee(this,he,"writableHighWaterMark",_e),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Se=he.decodeStrings===!1;this.decodeStrings=!Se,this.defaultEncoding=he.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(xe){Le(le,xe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=he.emitClose!==!1,this.autoDestroy=!!he.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new D(this)}we.prototype.getBuffer=function(){for(var le=this.bufferedRequest,_e=[];le;)_e.push(le),le=le.next;return _e},function(){try{Object.defineProperty(we.prototype,"buffer",{get:W.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Ee;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Ee=Function.prototype[Symbol.hasInstance],Object.defineProperty(ve,Symbol.hasInstance,{value:function(le){return Ee.call(this,le)?!0:this!==ve?!1:le&&le._writableState instanceof we}})):Ee=function(le){return le instanceof this};function ve(he){E=E||require_stream_duplex();var le=this instanceof E;if(!le&&!Ee.call(ve,this))return new ve(he);this._writableState=new we(he,this,le),this.writable=!0,he&&(typeof he.write=="function"&&(this._write=he.write),typeof he.writev=="function"&&(this._writev=he.writev),typeof he.destroy=="function"&&(this._destroy=he.destroy),typeof he.final=="function"&&(this._final=he.final)),U.call(this)}ve.prototype.pipe=function(){be(this,new fe)};function me(he,le){var _e=new ue;be(he,_e),browser$1.nextTick(le,_e)}function Te(he,le,_e,Se){var xe;return _e===null?xe=new se:typeof _e!="string"&&!le.objectMode&&(xe=new te("chunk",["string","Buffer"],_e)),xe?(be(he,xe),browser$1.nextTick(Se,xe),!1):!0}ve.prototype.write=function(he,le,_e){var Se=this._writableState,xe=!1,ne=!Se.objectMode&&Y(he);return ne&&!Q.isBuffer(he)&&(he=J(he)),typeof le=="function"&&(_e=le,le=null),ne?le="buffer":le||(le=Se.defaultEncoding),typeof _e!="function"&&(_e=ye),Se.ending?me(this,_e):(ne||Te(this,Se,he,_e))&&(Se.pendingcb++,xe=Ce(this,Se,ne,he,le,_e)),xe},ve.prototype.cork=function(){this._writableState.corked++},ve.prototype.uncork=function(){var he=this._writableState;he.corked&&(he.corked--,!he.writing&&!he.corked&&!he.bufferProcessing&&he.bufferedRequest&&Ne(this,he))},ve.prototype.setDefaultEncoding=function(le){if(typeof le=="string"&&(le=le.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((le+"").toLowerCase())>-1))throw new ce(le);return this._writableState.defaultEncoding=le,this},Object.defineProperty(ve.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ke(he,le,_e){return!he.objectMode&&he.decodeStrings!==!1&&typeof le=="string"&&(le=Q.from(le,_e)),le}Object.defineProperty(ve.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Ce(he,le,_e,Se,xe,ne){if(!_e){var ie=ke(le,Se,xe);Se!==ie&&(_e=!0,xe="buffer",Se=ie)}var pe=le.objectMode?1:Se.length;le.length+=pe;var ge=le.length<le.highWaterMark;if(ge||(le.needDrain=!0),le.writing||le.corked){var Me=le.lastBufferedRequest;le.lastBufferedRequest={chunk:Se,encoding:xe,isBuf:_e,callback:ne,next:null},Me?Me.next=le.lastBufferedRequest:le.bufferedRequest=le.lastBufferedRequest,le.bufferedRequestCount+=1}else Oe(he,le,!1,pe,Se,xe,ne);return ge}function Oe(he,le,_e,Se,xe,ne,ie){le.writelen=Se,le.writecb=ie,le.writing=!0,le.sync=!0,le.destroyed?le.onwrite(new de("write")):_e?he._writev(xe,le.onwrite):he._write(xe,ne,le.onwrite),le.sync=!1}function Ie(he,le,_e,Se,xe){--le.pendingcb,_e?(browser$1.nextTick(xe,Se),browser$1.nextTick(je,he,le),he._writableState.errorEmitted=!0,be(he,Se)):(xe(Se),he._writableState.errorEmitted=!0,be(he,Se),je(he,le))}function Ae(he){he.writing=!1,he.writecb=null,he.length-=he.writelen,he.writelen=0}function Le(he,le){var _e=he._writableState,Se=_e.sync,xe=_e.writecb;if(typeof xe!="function")throw new ae;if(Ae(_e),le)Ie(he,_e,Se,le,xe);else{var ne=Ue(_e)||he.destroyed;!ne&&!_e.corked&&!_e.bufferProcessing&&_e.bufferedRequest&&Ne(he,_e),Se?browser$1.nextTick(De,he,_e,ne,xe):De(he,_e,ne,xe)}}function De(he,le,_e,Se){_e||Pe(he,le),le.pendingcb--,Se(),je(he,le)}function Pe(he,le){le.length===0&&le.needDrain&&(le.needDrain=!1,he.emit("drain"))}function Ne(he,le){le.bufferProcessing=!0;var _e=le.bufferedRequest;if(he._writev&&_e&&_e.next){var Se=le.bufferedRequestCount,xe=new Array(Se),ne=le.corkedRequestsFree;ne.entry=_e;for(var ie=0,pe=!0;_e;)xe[ie]=_e,_e.isBuf||(pe=!1),_e=_e.next,ie+=1;xe.allBuffers=pe,Oe(he,le,!0,le.length,xe,"",ne.finish),le.pendingcb++,le.lastBufferedRequest=null,ne.next?(le.corkedRequestsFree=ne.next,ne.next=null):le.corkedRequestsFree=new D(le),le.bufferedRequestCount=0}else{for(;_e;){var ge=_e.chunk,Me=_e.encoding,Re=_e.callback,$e=le.objectMode?1:ge.length;if(Oe(he,le,!1,$e,ge,Me,Re),_e=_e.next,le.bufferedRequestCount--,le.writing)break}_e===null&&(le.lastBufferedRequest=null)}le.bufferedRequest=_e,le.bufferProcessing=!1}ve.prototype._write=function(he,le,_e){_e(new re("_write()"))},ve.prototype._writev=null,ve.prototype.end=function(he,le,_e){var Se=this._writableState;return typeof he=="function"?(_e=he,he=null,le=null):typeof le=="function"&&(_e=le,le=null),he!=null&&this.write(he,le),Se.corked&&(Se.corked=1,this.uncork()),Se.ending||Qe(this,Se,_e),this},Object.defineProperty(ve.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Ue(he){return he.ending&&he.length===0&&he.bufferedRequest===null&&!he.finished&&!he.writing}function Ve(he,le){he._final(function(_e){le.pendingcb--,_e&&be(he,_e),le.prefinished=!0,he.emit("prefinish"),je(he,le)})}function qe(he,le){!le.prefinished&&!le.finalCalled&&(typeof he._final=="function"&&!le.destroyed?(le.pendingcb++,le.finalCalled=!0,browser$1.nextTick(Ve,he,le)):(le.prefinished=!0,he.emit("prefinish")))}function je(he,le){var _e=Ue(le);if(_e&&(qe(he,le),le.pendingcb===0&&(le.finished=!0,he.emit("finish"),le.autoDestroy))){var Se=he._readableState;(!Se||Se.autoDestroy&&Se.endEmitted)&&he.destroy()}return _e}function Qe(he,le,_e){le.ending=!0,je(he,le),_e&&(le.finished?browser$1.nextTick(_e):he.once("finish",_e)),le.ended=!0,he.writable=!1}function Ge(he,le,_e){var Se=he.entry;for(he.entry=null;Se;){var xe=Se.callback;le.pendingcb--,xe(_e),Se=Se.next}le.corkedRequestsFree.next=he}return Object.defineProperty(ve.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(le){this._writableState&&(this._writableState.destroyed=le)}}),ve.prototype.destroy=X.destroy,ve.prototype._undestroy=X.undestroy,ve.prototype._destroy=function(he,le){le(he)},_stream_writable}var _stream_duplex,hasRequired_stream_duplex;function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var D=Object.keys||function(Z){var ee=[];for(var oe in Z)ee.push(oe);return ee};_stream_duplex=J;var E=require_stream_readable(),W=require_stream_writable();inherits_browserExports(J,E);for(var U=D(W.prototype),Q=0;Q<U.length;Q++){var G=U[Q];J.prototype[G]||(J.prototype[G]=W.prototype[G])}function J(Z){if(!(this instanceof J))return new J(Z);E.call(this,Z),W.call(this,Z),this.allowHalfOpen=!0,Z&&(Z.readable===!1&&(this.readable=!1),Z.writable===!1&&(this.writable=!1),Z.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Y)))}Object.defineProperty(J.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(J.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(J.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Y(){this._writableState.ended||browser$1.nextTick(X,this)}function X(Z){Z.end()}return Object.defineProperty(J.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(ee){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=ee,this._writableState.destroyed=ee)}}),_stream_duplex}var string_decoder={},safeBuffer={exports:{}},hasRequiredSafeBuffer;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,function(D,E){var W=require$$0$1,U=W.Buffer;function Q(J,Y){for(var X in J)Y[X]=J[X]}U.from&&U.alloc&&U.allocUnsafe&&U.allocUnsafeSlow?D.exports=W:(Q(W,E),E.Buffer=G);function G(J,Y,X){return U(J,Y,X)}Q(U,G),G.from=function(J,Y,X){if(typeof J=="number")throw new TypeError("Argument must not be a number");return U(J,Y,X)},G.alloc=function(J,Y,X){if(typeof J!="number")throw new TypeError("Argument must be a number");var Z=U(J);return Y!==void 0?typeof X=="string"?Z.fill(Y,X):Z.fill(Y):Z.fill(0),Z},G.allocUnsafe=function(J){if(typeof J!="number")throw new TypeError("Argument must be a number");return U(J)},G.allocUnsafeSlow=function(J){if(typeof J!="number")throw new TypeError("Argument must be a number");return W.SlowBuffer(J)}}(safeBuffer,safeBuffer.exports)),safeBuffer.exports}var hasRequiredString_decoder;function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var D=requireSafeBuffer().Buffer,E=D.isEncoding||function(se){switch(se=""+se,se&&se.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 W(se){if(!se)return"utf8";for(var ue;;)switch(se){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 se;default:if(ue)return;se=(""+se).toLowerCase(),ue=!0}}function U(se){var ue=W(se);if(typeof ue!="string"&&(D.isEncoding===E||!E(se)))throw new Error("Unknown encoding: "+se);return ue||se}string_decoder.StringDecoder=Q;function Q(se){this.encoding=U(se);var ue;switch(this.encoding){case"utf16le":this.text=oe,this.end=te,ue=4;break;case"utf8":this.fillLast=X,ue=4;break;case"base64":this.text=re,this.end=ae,ue=3;break;default:this.write=fe,this.end=de;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=D.allocUnsafe(ue)}Q.prototype.write=function(se){if(se.length===0)return"";var ue,ce;if(this.lastNeed){if(ue=this.fillLast(se),ue===void 0)return"";ce=this.lastNeed,this.lastNeed=0}else ce=0;return ce<se.length?ue?ue+this.text(se,ce):this.text(se,ce):ue||""},Q.prototype.end=ee,Q.prototype.text=Z,Q.prototype.fillLast=function(se){if(this.lastNeed<=se.length)return se.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);se.copy(this.lastChar,this.lastTotal-this.lastNeed,0,se.length),this.lastNeed-=se.length};function G(se){return se<=127?0:se>>5===6?2:se>>4===14?3:se>>3===30?4:se>>6===2?-1:-2}function J(se,ue,ce){var be=ue.length-1;if(be<ce)return 0;var ye=G(ue[be]);return ye>=0?(ye>0&&(se.lastNeed=ye-1),ye):--be<ce||ye===-2?0:(ye=G(ue[be]),ye>=0?(ye>0&&(se.lastNeed=ye-2),ye):--be<ce||ye===-2?0:(ye=G(ue[be]),ye>=0?(ye>0&&(ye===2?ye=0:se.lastNeed=ye-3),ye):0))}function Y(se,ue,ce){if((ue[0]&192)!==128)return se.lastNeed=0,"�";if(se.lastNeed>1&&ue.length>1){if((ue[1]&192)!==128)return se.lastNeed=1,"�";if(se.lastNeed>2&&ue.length>2&&(ue[2]&192)!==128)return se.lastNeed=2,"�"}}function X(se){var ue=this.lastTotal-this.lastNeed,ce=Y(this,se);if(ce!==void 0)return ce;if(this.lastNeed<=se.length)return se.copy(this.lastChar,ue,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);se.copy(this.lastChar,ue,0,se.length),this.lastNeed-=se.length}function Z(se,ue){var ce=J(this,se,ue);if(!this.lastNeed)return se.toString("utf8",ue);this.lastTotal=ce;var be=se.length-(ce-this.lastNeed);return se.copy(this.lastChar,0,be),se.toString("utf8",ue,be)}function ee(se){var ue=se&&se.length?this.write(se):"";return this.lastNeed?ue+"�":ue}function oe(se,ue){if((se.length-ue)%2===0){var ce=se.toString("utf16le",ue);if(ce){var be=ce.charCodeAt(ce.length-1);if(be>=55296&&be<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=se[se.length-2],this.lastChar[1]=se[se.length-1],ce.slice(0,-1)}return ce}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=se[se.length-1],se.toString("utf16le",ue,se.length-1)}function te(se){var ue=se&&se.length?this.write(se):"";if(this.lastNeed){var ce=this.lastTotal-this.lastNeed;return ue+this.lastChar.toString("utf16le",0,ce)}return ue}function re(se,ue){var ce=(se.length-ue)%3;return ce===0?se.toString("base64",ue):(this.lastNeed=3-ce,this.lastTotal=3,ce===1?this.lastChar[0]=se[se.length-1]:(this.lastChar[0]=se[se.length-2],this.lastChar[1]=se[se.length-1]),se.toString("base64",ue,se.length-ce))}function ae(se){var ue=se&&se.length?this.write(se):"";return this.lastNeed?ue+this.lastChar.toString("base64",0,3-this.lastNeed):ue}function fe(se){return se.toString(this.encoding)}function de(se){return se&&se.length?this.write(se):""}return string_decoder}var ERR_STREAM_PREMATURE_CLOSE=errorsBrowser.codes.ERR_STREAM_PREMATURE_CLOSE;function once$1(D){var E=!1;return function(){if(!E){E=!0;for(var W=arguments.length,U=new Array(W),Q=0;Q<W;Q++)U[Q]=arguments[Q];D.apply(this,U)}}}function noop$2(){}function isRequest$1(D){return D.setHeader&&typeof D.abort=="function"}function eos$1(D,E,W){if(typeof E=="function")return eos$1(D,null,E);E||(E={}),W=once$1(W||noop$2);var U=E.readable||E.readable!==!1&&D.readable,Q=E.writable||E.writable!==!1&&D.writable,G=function(){D.writable||Y()},J=D._writableState&&D._writableState.finished,Y=function(){Q=!1,J=!0,U||W.call(D)},X=D._readableState&&D._readableState.endEmitted,Z=function(){U=!1,X=!0,Q||W.call(D)},ee=function(ae){W.call(D,ae)},oe=function(){var ae;if(U&&!X)return(!D._readableState||!D._readableState.ended)&&(ae=new ERR_STREAM_PREMATURE_CLOSE),W.call(D,ae);if(Q&&!J)return(!D._writableState||!D._writableState.ended)&&(ae=new ERR_STREAM_PREMATURE_CLOSE),W.call(D,ae)},te=function(){D.req.on("finish",Y)};return isRequest$1(D)?(D.on("complete",Y),D.on("abort",oe),D.req?te():D.on("request",te)):Q&&!D._writableState&&(D.on("end",G),D.on("close",G)),D.on("end",Z),D.on("finish",Y),E.error!==!1&&D.on("error",ee),D.on("close",oe),function(){D.removeListener("complete",Y),D.removeListener("abort",oe),D.removeListener("request",te),D.req&&D.req.removeListener("finish",Y),D.removeListener("end",G),D.removeListener("close",G),D.removeListener("finish",Y),D.removeListener("end",Z),D.removeListener("error",ee),D.removeListener("close",oe)}}var endOfStream=eos$1,async_iterator,hasRequiredAsync_iterator;function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;hasRequiredAsync_iterator=1;var D;function E(se,ue,ce){return ue in se?Object.defineProperty(se,ue,{value:ce,enumerable:!0,configurable:!0,writable:!0}):se[ue]=ce,se}var W=endOfStream,U=Symbol("lastResolve"),Q=Symbol("lastReject"),G=Symbol("error"),J=Symbol("ended"),Y=Symbol("lastPromise"),X=Symbol("handlePromise"),Z=Symbol("stream");function ee(se,ue){return{value:se,done:ue}}function oe(se){var ue=se[U];if(ue!==null){var ce=se[Z].read();ce!==null&&(se[Y]=null,se[U]=null,se[Q]=null,ue(ee(ce,!1)))}}function te(se){browser$1.nextTick(oe,se)}function re(se,ue){return function(ce,be){se.then(function(){if(ue[J]){ce(ee(void 0,!0));return}ue[X](ce,be)},be)}}var ae=Object.getPrototypeOf(function(){}),fe=Object.setPrototypeOf((D={get stream(){return this[Z]},next:function(){var ue=this,ce=this[G];if(ce!==null)return Promise.reject(ce);if(this[J])return Promise.resolve(ee(void 0,!0));if(this[Z].destroyed)return new Promise(function(Ee,ve){browser$1.nextTick(function(){ue[G]?ve(ue[G]):Ee(ee(void 0,!0))})});var be=this[Y],ye;if(be)ye=new Promise(re(be,this));else{var we=this[Z].read();if(we!==null)return Promise.resolve(ee(we,!1));ye=new Promise(this[X])}return this[Y]=ye,ye}},E(D,Symbol.asyncIterator,function(){return this}),E(D,"return",function(){var ue=this;return new Promise(function(ce,be){ue[Z].destroy(null,function(ye){if(ye){be(ye);return}ce(ee(void 0,!0))})})}),D),ae),de=function(ue){var ce,be=Object.create(fe,(ce={},E(ce,Z,{value:ue,writable:!0}),E(ce,U,{value:null,writable:!0}),E(ce,Q,{value:null,writable:!0}),E(ce,G,{value:null,writable:!0}),E(ce,J,{value:ue._readableState.endEmitted,writable:!0}),E(ce,X,{value:function(we,Ee){var ve=be[Z].read();ve?(be[Y]=null,be[U]=null,be[Q]=null,we(ee(ve,!1))):(be[U]=we,be[Q]=Ee)},writable:!0}),ce));return be[Y]=null,W(ue,function(ye){if(ye&&ye.code!=="ERR_STREAM_PREMATURE_CLOSE"){var we=be[Q];we!==null&&(be[Y]=null,be[U]=null,be[Q]=null,we(ye)),be[G]=ye;return}var Ee=be[U];Ee!==null&&(be[Y]=null,be[U]=null,be[Q]=null,Ee(ee(void 0,!0))),be[J]=!0}),ue.on("readable",te.bind(null,be)),be};return async_iterator=de,async_iterator}var fromBrowser,hasRequiredFromBrowser;function requireFromBrowser(){return hasRequiredFromBrowser||(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")}),fromBrowser}var _stream_readable,hasRequired_stream_readable;function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1,_stream_readable=me;var D;me.ReadableState=ve,eventsExports.EventEmitter;var E=function(ie,pe){return ie.listeners(pe).length},W=streamBrowser,U=require$$0$1.Buffer,Q=globalThis.Uint8Array||function(){};function G(ne){return U.from(ne)}function J(ne){return U.isBuffer(ne)||ne instanceof Q}var Y=require$$0$1,X;Y&&Y.debuglog?X=Y.debuglog("stream"):X=function(){};var Z=requireBuffer_list(),ee=destroy_1,oe=state,te=oe.getHighWaterMark,re=errorsBrowser.codes,ae=re.ERR_INVALID_ARG_TYPE,fe=re.ERR_STREAM_PUSH_AFTER_EOF,de=re.ERR_METHOD_NOT_IMPLEMENTED,se=re.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,ue,ce,be;inherits_browserExports(me,W);var ye=ee.errorOrDestroy,we=["error","close","destroy","pause","resume"];function Ee(ne,ie,pe){if(typeof ne.prependListener=="function")return ne.prependListener(ie,pe);!ne._events||!ne._events[ie]?ne.on(ie,pe):Array.isArray(ne._events[ie])?ne._events[ie].unshift(pe):ne._events[ie]=[pe,ne._events[ie]]}function ve(ne,ie,pe){D=D||require_stream_duplex(),ne=ne||{},typeof pe!="boolean"&&(pe=ie instanceof D),this.objectMode=!!ne.objectMode,pe&&(this.objectMode=this.objectMode||!!ne.readableObjectMode),this.highWaterMark=te(this,ne,"readableHighWaterMark",pe),this.buffer=new Z,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=ne.emitClose!==!1,this.autoDestroy=!!ne.autoDestroy,this.destroyed=!1,this.defaultEncoding=ne.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ne.encoding&&(ue||(ue=requireString_decoder().StringDecoder),this.decoder=new ue(ne.encoding),this.encoding=ne.encoding)}function me(ne){if(D=D||require_stream_duplex(),!(this instanceof me))return new me(ne);var ie=this instanceof D;this._readableState=new ve(ne,this,ie),this.readable=!0,ne&&(typeof ne.read=="function"&&(this._read=ne.read),typeof ne.destroy=="function"&&(this._destroy=ne.destroy)),W.call(this)}Object.defineProperty(me.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ie){this._readableState&&(this._readableState.destroyed=ie)}}),me.prototype.destroy=ee.destroy,me.prototype._undestroy=ee.undestroy,me.prototype._destroy=function(ne,ie){ie(ne)},me.prototype.push=function(ne,ie){var pe=this._readableState,ge;return pe.objectMode?ge=!0:typeof ne=="string"&&(ie=ie||pe.defaultEncoding,ie!==pe.encoding&&(ne=U.from(ne,ie),ie=""),ge=!0),Te(this,ne,ie,!1,ge)},me.prototype.unshift=function(ne){return Te(this,ne,null,!0,!1)};function Te(ne,ie,pe,ge,Me){X("readableAddChunk",ie);var Re=ne._readableState;if(ie===null)Re.reading=!1,Le(ne,Re);else{var $e;if(Me||($e=Ce(Re,ie)),$e)ye(ne,$e);else if(Re.objectMode||ie&&ie.length>0)if(typeof ie!="string"&&!Re.objectMode&&Object.getPrototypeOf(ie)!==U.prototype&&(ie=G(ie)),ge)Re.endEmitted?ye(ne,new se):ke(ne,Re,ie,!0);else if(Re.ended)ye(ne,new fe);else{if(Re.destroyed)return!1;Re.reading=!1,Re.decoder&&!pe?(ie=Re.decoder.write(ie),Re.objectMode||ie.length!==0?ke(ne,Re,ie,!1):Ne(ne,Re)):ke(ne,Re,ie,!1)}else ge||(Re.reading=!1,Ne(ne,Re))}return!Re.ended&&(Re.length<Re.highWaterMark||Re.length===0)}function ke(ne,ie,pe,ge){ie.flowing&&ie.length===0&&!ie.sync?(ie.awaitDrain=0,ne.emit("data",pe)):(ie.length+=ie.objectMode?1:pe.length,ge?ie.buffer.unshift(pe):ie.buffer.push(pe),ie.needReadable&&De(ne)),Ne(ne,ie)}function Ce(ne,ie){var pe;return!J(ie)&&typeof ie!="string"&&ie!==void 0&&!ne.objectMode&&(pe=new ae("chunk",["string","Buffer","Uint8Array"],ie)),pe}me.prototype.isPaused=function(){return this._readableState.flowing===!1},me.prototype.setEncoding=function(ne){ue||(ue=requireString_decoder().StringDecoder);var ie=new ue(ne);this._readableState.decoder=ie,this._readableState.encoding=this._readableState.decoder.encoding;for(var pe=this._readableState.buffer.head,ge="";pe!==null;)ge+=ie.write(pe.data),pe=pe.next;return this._readableState.buffer.clear(),ge!==""&&this._readableState.buffer.push(ge),this._readableState.length=ge.length,this};var Oe=1073741824;function Ie(ne){return ne>=Oe?ne=Oe:(ne--,ne|=ne>>>1,ne|=ne>>>2,ne|=ne>>>4,ne|=ne>>>8,ne|=ne>>>16,ne++),ne}function Ae(ne,ie){return ne<=0||ie.length===0&&ie.ended?0:ie.objectMode?1:ne!==ne?ie.flowing&&ie.length?ie.buffer.head.data.length:ie.length:(ne>ie.highWaterMark&&(ie.highWaterMark=Ie(ne)),ne<=ie.length?ne:ie.ended?ie.length:(ie.needReadable=!0,0))}me.prototype.read=function(ne){X("read",ne),ne=parseInt(ne,10);var ie=this._readableState,pe=ne;if(ne!==0&&(ie.emittedReadable=!1),ne===0&&ie.needReadable&&((ie.highWaterMark!==0?ie.length>=ie.highWaterMark:ie.length>0)||ie.ended))return X("read: emitReadable",ie.length,ie.ended),ie.length===0&&ie.ended?_e(this):De(this),null;if(ne=Ae(ne,ie),ne===0&&ie.ended)return ie.length===0&&_e(this),null;var ge=ie.needReadable;X("need readable",ge),(ie.length===0||ie.length-ne<ie.highWaterMark)&&(ge=!0,X("length less than watermark",ge)),ie.ended||ie.reading?(ge=!1,X("reading or ended",ge)):ge&&(X("do read"),ie.reading=!0,ie.sync=!0,ie.length===0&&(ie.needReadable=!0),this._read(ie.highWaterMark),ie.sync=!1,ie.reading||(ne=Ae(pe,ie)));var Me;return ne>0?Me=le(ne,ie):Me=null,Me===null?(ie.needReadable=ie.length<=ie.highWaterMark,ne=0):(ie.length-=ne,ie.awaitDrain=0),ie.length===0&&(ie.ended||(ie.needReadable=!0),pe!==ne&&ie.ended&&_e(this)),Me!==null&&this.emit("data",Me),Me};function Le(ne,ie){if(X("onEofChunk"),!ie.ended){if(ie.decoder){var pe=ie.decoder.end();pe&&pe.length&&(ie.buffer.push(pe),ie.length+=ie.objectMode?1:pe.length)}ie.ended=!0,ie.sync?De(ne):(ie.needReadable=!1,ie.emittedReadable||(ie.emittedReadable=!0,Pe(ne)))}}function De(ne){var ie=ne._readableState;X("emitReadable",ie.needReadable,ie.emittedReadable),ie.needReadable=!1,ie.emittedReadable||(X("emitReadable",ie.flowing),ie.emittedReadable=!0,browser$1.nextTick(Pe,ne))}function Pe(ne){var ie=ne._readableState;X("emitReadable_",ie.destroyed,ie.length,ie.ended),!ie.destroyed&&(ie.length||ie.ended)&&(ne.emit("readable"),ie.emittedReadable=!1),ie.needReadable=!ie.flowing&&!ie.ended&&ie.length<=ie.highWaterMark,he(ne)}function Ne(ne,ie){ie.readingMore||(ie.readingMore=!0,browser$1.nextTick(Ue,ne,ie))}function Ue(ne,ie){for(;!ie.reading&&!ie.ended&&(ie.length<ie.highWaterMark||ie.flowing&&ie.length===0);){var pe=ie.length;if(X("maybeReadMore read 0"),ne.read(0),pe===ie.length)break}ie.readingMore=!1}me.prototype._read=function(ne){ye(this,new de("_read()"))},me.prototype.pipe=function(ne,ie){var pe=this,ge=this._readableState;switch(ge.pipesCount){case 0:ge.pipes=ne;break;case 1:ge.pipes=[ge.pipes,ne];break;default:ge.pipes.push(ne);break}ge.pipesCount+=1,X("pipe count=%d opts=%j",ge.pipesCount,ie);var Me=(!ie||ie.end!==!1)&&ne!==browser$1.stdout&&ne!==browser$1.stderr,Re=Me?Be:He;ge.endEmitted?browser$1.nextTick(Re):pe.once("end",Re),ne.on("unpipe",$e);function $e(We,Fe){X("onunpipe"),We===pe&&Fe&&Fe.hasUnpiped===!1&&(Fe.hasUnpiped=!0,et())}function Be(){X("onend"),ne.end()}var ze=Ve(pe);ne.on("drain",ze);var Xe=!1;function et(){X("cleanup"),ne.removeListener("close",Je),ne.removeListener("finish",Ye),ne.removeListener("drain",ze),ne.removeListener("error",Ke),ne.removeListener("unpipe",$e),pe.removeListener("end",Be),pe.removeListener("end",He),pe.removeListener("data",Ze),Xe=!0,ge.awaitDrain&&(!ne._writableState||ne._writableState.needDrain)&&ze()}pe.on("data",Ze);function Ze(We){X("ondata");var Fe=ne.write(We);X("dest.write",Fe),Fe===!1&&((ge.pipesCount===1&&ge.pipes===ne||ge.pipesCount>1&&xe(ge.pipes,ne)!==-1)&&!Xe&&(X("false write response, pause",ge.awaitDrain),ge.awaitDrain++),pe.pause())}function Ke(We){X("onerror",We),He(),ne.removeListener("error",Ke),E(ne,"error")===0&&ye(ne,We)}Ee(ne,"error",Ke);function Je(){ne.removeListener("finish",Ye),He()}ne.once("close",Je);function Ye(){X("onfinish"),ne.removeListener("close",Je),He()}ne.once("finish",Ye);function He(){X("unpipe"),pe.unpipe(ne)}return ne.emit("pipe",pe),ge.flowing||(X("pipe resume"),pe.resume()),ne};function Ve(ne){return function(){var pe=ne._readableState;X("pipeOnDrain",pe.awaitDrain),pe.awaitDrain&&pe.awaitDrain--,pe.awaitDrain===0&&E(ne,"data")&&(pe.flowing=!0,he(ne))}}me.prototype.unpipe=function(ne){var ie=this._readableState,pe={hasUnpiped:!1};if(ie.pipesCount===0)return this;if(ie.pipesCount===1)return ne&&ne!==ie.pipes?this:(ne||(ne=ie.pipes),ie.pipes=null,ie.pipesCount=0,ie.flowing=!1,ne&&ne.emit("unpipe",this,pe),this);if(!ne){var ge=ie.pipes,Me=ie.pipesCount;ie.pipes=null,ie.pipesCount=0,ie.flowing=!1;for(var Re=0;Re<Me;Re++)ge[Re].emit("unpipe",this,{hasUnpiped:!1});return this}var $e=xe(ie.pipes,ne);return $e===-1?this:(ie.pipes.splice($e,1),ie.pipesCount-=1,ie.pipesCount===1&&(ie.pipes=ie.pipes[0]),ne.emit("unpipe",this,pe),this)},me.prototype.on=function(ne,ie){var pe=W.prototype.on.call(this,ne,ie),ge=this._readableState;return ne==="data"?(ge.readableListening=this.listenerCount("readable")>0,ge.flowing!==!1&&this.resume()):ne==="readable"&&!ge.endEmitted&&!ge.readableListening&&(ge.readableListening=ge.needReadable=!0,ge.flowing=!1,ge.emittedReadable=!1,X("on readable",ge.length,ge.reading),ge.length?De(this):ge.reading||browser$1.nextTick(je,this)),pe},me.prototype.addListener=me.prototype.on,me.prototype.removeListener=function(ne,ie){var pe=W.prototype.removeListener.call(this,ne,ie);return ne==="readable"&&browser$1.nextTick(qe,this),pe},me.prototype.removeAllListeners=function(ne){var ie=W.prototype.removeAllListeners.apply(this,arguments);return(ne==="readable"||ne===void 0)&&browser$1.nextTick(qe,this),ie};function qe(ne){var ie=ne._readableState;ie.readableListening=ne.listenerCount("readable")>0,ie.resumeScheduled&&!ie.paused?ie.flowing=!0:ne.listenerCount("data")>0&&ne.resume()}function je(ne){X("readable nexttick read 0"),ne.read(0)}me.prototype.resume=function(){var ne=this._readableState;return ne.flowing||(X("resume"),ne.flowing=!ne.readableListening,Qe(this,ne)),ne.paused=!1,this};function Qe(ne,ie){ie.resumeScheduled||(ie.resumeScheduled=!0,browser$1.nextTick(Ge,ne,ie))}function Ge(ne,ie){X("resume",ie.reading),ie.reading||ne.read(0),ie.resumeScheduled=!1,ne.emit("resume"),he(ne),ie.flowing&&!ie.reading&&ne.read(0)}me.prototype.pause=function(){return X("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(X("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function he(ne){var ie=ne._readableState;for(X("flow",ie.flowing);ie.flowing&&ne.read()!==null;);}me.prototype.wrap=function(ne){var ie=this,pe=this._readableState,ge=!1;ne.on("end",function(){if(X("wrapped end"),pe.decoder&&!pe.ended){var $e=pe.decoder.end();$e&&$e.length&&ie.push($e)}ie.push(null)}),ne.on("data",function($e){if(X("wrapped data"),pe.decoder&&($e=pe.decoder.write($e)),!(pe.objectMode&&$e==null)&&!(!pe.objectMode&&(!$e||!$e.length))){var Be=ie.push($e);Be||(ge=!0,ne.pause())}});for(var Me in ne)this[Me]===void 0&&typeof ne[Me]=="function"&&(this[Me]=function(Be){return function(){return ne[Be].apply(ne,arguments)}}(Me));for(var Re=0;Re<we.length;Re++)ne.on(we[Re],this.emit.bind(this,we[Re]));return this._read=function($e){X("wrapped _read",$e),ge&&(ge=!1,ne.resume())},this},typeof Symbol=="function"&&(me.prototype[Symbol.asyncIterator]=function(){return ce===void 0&&(ce=requireAsync_iterator()),ce(this)}),Object.defineProperty(me.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(me.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(me.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(ie){this._readableState&&(this._readableState.flowing=ie)}}),me._fromList=le,Object.defineProperty(me.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function le(ne,ie){if(ie.length===0)return null;var pe;return ie.objectMode?pe=ie.buffer.shift():!ne||ne>=ie.length?(ie.decoder?pe=ie.buffer.join(""):ie.buffer.length===1?pe=ie.buffer.first():pe=ie.buffer.concat(ie.length),ie.buffer.clear()):pe=ie.buffer.consume(ne,ie.decoder),pe}function _e(ne){var ie=ne._readableState;X("endReadable",ie.endEmitted),ie.endEmitted||(ie.ended=!0,browser$1.nextTick(Se,ie,ne))}function Se(ne,ie){if(X("endReadableNT",ne.endEmitted,ne.length),!ne.endEmitted&&ne.length===0&&(ne.endEmitted=!0,ie.readable=!1,ie.emit("end"),ne.autoDestroy)){var pe=ie._writableState;(!pe||pe.autoDestroy&&pe.finished)&&ie.destroy()}}typeof Symbol=="function"&&(me.from=function(ne,ie){return be===void 0&&(be=requireFromBrowser()),be(me,ne,ie)});function xe(ne,ie){for(var pe=0,ge=ne.length;pe<ge;pe++)if(ne[pe]===ie)return pe;return-1}return _stream_readable}var _stream_transform=Transform$3,_require$codes$1=errorsBrowser.codes,ERR_METHOD_NOT_IMPLEMENTED=_require$codes$1.ERR_METHOD_NOT_IMPLEMENTED,ERR_MULTIPLE_CALLBACK=_require$codes$1.ERR_MULTIPLE_CALLBACK,ERR_TRANSFORM_ALREADY_TRANSFORMING=_require$codes$1.ERR_TRANSFORM_ALREADY_TRANSFORMING,ERR_TRANSFORM_WITH_LENGTH_0=_require$codes$1.ERR_TRANSFORM_WITH_LENGTH_0,Duplex=require_stream_duplex();inherits_browserExports(Transform$3,Duplex);function afterTransform(D,E){var W=this._transformState;W.transforming=!1;var U=W.writecb;if(U===null)return this.emit("error",new ERR_MULTIPLE_CALLBACK);W.writechunk=null,W.writecb=null,E!=null&&this.push(E),U(D);var Q=this._readableState;Q.reading=!1,(Q.needReadable||Q.length<Q.highWaterMark)&&this._read(Q.highWaterMark)}function Transform$3(D){if(!(this instanceof Transform$3))return new Transform$3(D);Duplex.call(this,D),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,D&&(typeof D.transform=="function"&&(this._transform=D.transform),typeof D.flush=="function"&&(this._flush=D.flush)),this.on("prefinish",prefinish)}function prefinish(){var D=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(E,W){done(D,E,W)}):done(this,null,null)}Transform$3.prototype.push=function(D,E){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,D,E)};Transform$3.prototype._transform=function(D,E,W){W(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"))};Transform$3.prototype._write=function(D,E,W){var U=this._transformState;if(U.writecb=W,U.writechunk=D,U.writeencoding=E,!U.transforming){var Q=this._readableState;(U.needTransform||Q.needReadable||Q.length<Q.highWaterMark)&&this._read(Q.highWaterMark)}};Transform$3.prototype._read=function(D){var E=this._transformState;E.writechunk!==null&&!E.transforming?(E.transforming=!0,this._transform(E.writechunk,E.writeencoding,E.afterTransform)):E.needTransform=!0};Transform$3.prototype._destroy=function(D,E){Duplex.prototype._destroy.call(this,D,function(W){E(W)})};function done(D,E,W){if(E)return D.emit("error",E);if(W!=null&&D.push(W),D._writableState.length)throw new ERR_TRANSFORM_WITH_LENGTH_0;if(D._transformState.transforming)throw new ERR_TRANSFORM_ALREADY_TRANSFORMING;return D.push(null)}var _stream_passthrough=PassThrough,Transform$2=_stream_transform;inherits_browserExports(PassThrough,Transform$2);function PassThrough(D){if(!(this instanceof PassThrough))return new PassThrough(D);Transform$2.call(this,D)}PassThrough.prototype._transform=function(D,E,W){W(null,D)};var eos;function once(D){var E=!1;return function(){E||(E=!0,D.apply(void 0,arguments))}}var _require$codes=errorsBrowser.codes,ERR_MISSING_ARGS=_require$codes.ERR_MISSING_ARGS,ERR_STREAM_DESTROYED=_require$codes.ERR_STREAM_DESTROYED;function noop$1(D){if(D)throw D}function isRequest(D){return D.setHeader&&typeof D.abort=="function"}function destroyer(D,E,W,U){U=once(U);var Q=!1;D.on("close",function(){Q=!0}),eos===void 0&&(eos=endOfStream),eos(D,{readable:E,writable:W},function(J){if(J)return U(J);Q=!0,U()});var G=!1;return function(J){if(!Q&&!G){if(G=!0,isRequest(D))return D.abort();if(typeof D.destroy=="function")return D.destroy();U(J||new ERR_STREAM_DESTROYED("pipe"))}}}function call(D){D()}function pipe(D,E){return D.pipe(E)}function popCallback(D){return!D.length||typeof D[D.length-1]!="function"?noop$1:D.pop()}function pipeline(){for(var D=arguments.length,E=new Array(D),W=0;W<D;W++)E[W]=arguments[W];var U=popCallback(E);if(Array.isArray(E[0])&&(E=E[0]),E.length<2)throw new ERR_MISSING_ARGS("streams");var Q,G=E.map(function(J,Y){var X=Y<E.length-1,Z=Y>0;return destroyer(J,X,Z,function(ee){Q||(Q=ee),ee&&G.forEach(call),!X&&(G.forEach(call),U(Q))})});return E.reduce(pipe)}var pipeline_1=pipeline;(function(D,E){E=D.exports=require_stream_readable(),E.Stream=E,E.Readable=E,E.Writable=require_stream_writable(),E.Duplex=require_stream_duplex(),E.Transform=_stream_transform,E.PassThrough=_stream_passthrough,E.finished=endOfStream,E.pipeline=pipeline_1})(readableBrowser,readableBrowser.exports);var readableBrowserExports=readableBrowser.exports;const{Transform:Transform$1}=readableBrowserExports;var keccak$1=D=>class Jt extends Transform$1{constructor(W,U,Q,G,J){super(J),this._rate=W,this._capacity=U,this._delimitedSuffix=Q,this._hashBitLength=G,this._options=J,this._state=new D,this._state.initialize(W,U),this._finalized=!1}_transform(W,U,Q){let G=null;try{this.update(W,U)}catch(J){G=J}Q(G)}_flush(W){let U=null;try{this.push(this.digest())}catch(Q){U=Q}W(U)}update(W,U){if(!Buffer.isBuffer(W)&&typeof W!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(W)||(W=Buffer.from(W,U)),this._state.absorb(W),this}digest(W){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let U=this._state.squeeze(this._hashBitLength/8);return W!==void 0&&(U=U.toString(W)),this._resetState(),U}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const W=new Jt(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(W._state),W._finalized=this._finalized,W}};const{Transform}=readableBrowserExports;var shake=D=>class Yt extends Transform{constructor(W,U,Q,G){super(G),this._rate=W,this._capacity=U,this._delimitedSuffix=Q,this._options=G,this._state=new D,this._state.initialize(W,U),this._finalized=!1}_transform(W,U,Q){let G=null;try{this.update(W,U)}catch(J){G=J}Q(G)}_flush(){}_read(W){this.push(this.squeeze(W))}update(W,U){if(!Buffer.isBuffer(W)&&typeof W!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(W)||(W=Buffer.from(W,U)),this._state.absorb(W),this}squeeze(W,U){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let Q=this._state.squeeze(W);return U!==void 0&&(Q=Q.toString(U)),Q}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const W=new Yt(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(W._state),W._finalized=this._finalized,W}};const createKeccak=keccak$1,createShake=shake;var api=function(D){const E=createKeccak(D),W=createShake(D);return function(U,Q){switch(typeof U=="string"?U.toLowerCase():U){case"keccak224":return new E(1152,448,null,224,Q);case"keccak256":return new E(1088,512,null,256,Q);case"keccak384":return new E(832,768,null,384,Q);case"keccak512":return new E(576,1024,null,512,Q);case"sha3-224":return new E(1152,448,6,224,Q);case"sha3-256":return new E(1088,512,6,256,Q);case"sha3-384":return new E(832,768,6,384,Q);case"sha3-512":return new E(576,1024,6,512,Q);case"shake128":return new W(1344,256,31,Q);case"shake256":return new W(1088,512,31,Q);default:throw new Error("Invald algorithm: "+U)}}},js=api(keccak$2);const createKeccakHash=js,BN$1=bnExports;function zeros(D){return Buffer.allocUnsafe(D).fill(0)}function setLength(D,E,W){const U=zeros(E);return D=toBuffer(D),W?D.length<E?(D.copy(U),U):D.slice(0,E):D.length<E?(D.copy(U,E-D.length),U):D.slice(-E)}function setLengthRight(D,E){return setLength(D,E,!0)}function toBuffer(D){if(!Buffer.isBuffer(D))if(Array.isArray(D))D=Buffer.from(D);else if(typeof D=="string")isHexString(D)?D=Buffer.from(padToEven(stripHexPrefix(D)),"hex"):D=Buffer.from(D);else if(typeof D=="number")D=intToBuffer(D);else if(D==null)D=Buffer.allocUnsafe(0);else if(BN$1.isBN(D))D=D.toArrayLike(Buffer);else if(D.toArray)D=Buffer.from(D.toArray());else throw new Error("invalid type");return D}function bufferToHex(D){return D=toBuffer(D),"0x"+D.toString("hex")}function keccak(D,E){return D=toBuffer(D),E||(E=256),createKeccakHash("keccak"+E).update(D).digest()}function padToEven(D){return D.length%2?"0"+D:D}function isHexString(D){return typeof D=="string"&&D.match(/^0x[0-9A-Fa-f]*$/)}function stripHexPrefix(D){return typeof D=="string"&&D.startsWith("0x")?D.slice(2):D}var util$3={zeros,setLength,setLengthRight,isHexString,stripHexPrefix,toBuffer,bufferToHex,keccak};const util$2=util$3,BN=bnExports;function elementaryName(D){return D.startsWith("int[")?"int256"+D.slice(3):D==="int"?"int256":D.startsWith("uint[")?"uint256"+D.slice(4):D==="uint"?"uint256":D.startsWith("fixed[")?"fixed128x128"+D.slice(5):D==="fixed"?"fixed128x128":D.startsWith("ufixed[")?"ufixed128x128"+D.slice(6):D==="ufixed"?"ufixed128x128":D}function parseTypeN(D){return parseInt(/^\D+(\d+)$/.exec(D)[1],10)}function parseTypeNxM(D){var E=/^\D+(\d+)x(\d+)$/.exec(D);return[parseInt(E[1],10),parseInt(E[2],10)]}function parseTypeArray(D){var E=D.match(/(.*)\[(.*?)\]$/);return E?E[2]===""?"dynamic":parseInt(E[2],10):null}function parseNumber(D){var E=typeof D;if(E==="string")return util$2.isHexString(D)?new BN(util$2.stripHexPrefix(D),16):new BN(D,10);if(E==="number")return new BN(D);if(D.toArray)return D;throw new Error("Argument is not a number")}function encodeSingle(D,E){var W,U,Q,G;if(D==="address")return encodeSingle("uint160",parseNumber(E));if(D==="bool")return encodeSingle("uint8",E?1:0);if(D==="string")return encodeSingle("bytes",new Buffer(E,"utf8"));if(isArray(D)){if(typeof E.length>"u")throw new Error("Not an array?");if(W=parseTypeArray(D),W!=="dynamic"&&W!==0&&E.length>W)throw new Error("Elements exceed array size: "+W);Q=[],D=D.slice(0,D.lastIndexOf("[")),typeof E=="string"&&(E=JSON.parse(E));for(G in E)Q.push(encodeSingle(D,E[G]));if(W==="dynamic"){var J=encodeSingle("uint256",E.length);Q.unshift(J)}return Buffer.concat(Q)}else{if(D==="bytes")return E=new Buffer(E),Q=Buffer.concat([encodeSingle("uint256",E.length),E]),E.length%32!==0&&(Q=Buffer.concat([Q,util$2.zeros(32-E.length%32)])),Q;if(D.startsWith("bytes")){if(W=parseTypeN(D),W<1||W>32)throw new Error("Invalid bytes<N> width: "+W);return util$2.setLengthRight(E,32)}else if(D.startsWith("uint")){if(W=parseTypeN(D),W%8||W<8||W>256)throw new Error("Invalid uint<N> width: "+W);if(U=parseNumber(E),U.bitLength()>W)throw new Error("Supplied uint exceeds width: "+W+" vs "+U.bitLength());if(U<0)throw new Error("Supplied uint is negative");return U.toArrayLike(Buffer,"be",32)}else if(D.startsWith("int")){if(W=parseTypeN(D),W%8||W<8||W>256)throw new Error("Invalid int<N> width: "+W);if(U=parseNumber(E),U.bitLength()>W)throw new Error("Supplied int exceeds width: "+W+" vs "+U.bitLength());return U.toTwos(256).toArrayLike(Buffer,"be",32)}else if(D.startsWith("ufixed")){if(W=parseTypeNxM(D),U=parseNumber(E),U<0)throw new Error("Supplied ufixed is negative");return encodeSingle("uint256",U.mul(new BN(2).pow(new BN(W[1]))))}else if(D.startsWith("fixed"))return W=parseTypeNxM(D),encodeSingle("int256",parseNumber(E).mul(new BN(2).pow(new BN(W[1]))))}throw new Error("Unsupported or invalid type: "+D)}function isDynamic(D){return D==="string"||D==="bytes"||parseTypeArray(D)==="dynamic"}function isArray(D){return D.lastIndexOf("]")===D.length-1}function rawEncode(D,E){var W=[],U=[],Q=32*D.length;for(var G in D){var J=elementaryName(D[G]),Y=E[G],X=encodeSingle(J,Y);isDynamic(J)?(W.push(encodeSingle("uint256",Q)),U.push(X),Q+=X.length):W.push(X)}return Buffer.concat(W.concat(U))}function solidityPack(D,E){if(D.length!==E.length)throw new Error("Number of types are not matching the values");for(var W,U,Q=[],G=0;G<D.length;G++){var J=elementaryName(D[G]),Y=E[G];if(J==="bytes")Q.push(Y);else if(J==="string")Q.push(new Buffer(Y,"utf8"));else if(J==="bool")Q.push(new Buffer(Y?"01":"00","hex"));else if(J==="address")Q.push(util$2.setLength(Y,20));else if(J.startsWith("bytes")){if(W=parseTypeN(J),W<1||W>32)throw new Error("Invalid bytes<N> width: "+W);Q.push(util$2.setLengthRight(Y,W))}else if(J.startsWith("uint")){if(W=parseTypeN(J),W%8||W<8||W>256)throw new Error("Invalid uint<N> width: "+W);if(U=parseNumber(Y),U.bitLength()>W)throw new Error("Supplied uint exceeds width: "+W+" vs "+U.bitLength());Q.push(U.toArrayLike(Buffer,"be",W/8))}else if(J.startsWith("int")){if(W=parseTypeN(J),W%8||W<8||W>256)throw new Error("Invalid int<N> width: "+W);if(U=parseNumber(Y),U.bitLength()>W)throw new Error("Supplied int exceeds width: "+W+" vs "+U.bitLength());Q.push(U.toTwos(W).toArrayLike(Buffer,"be",W/8))}else throw new Error("Unsupported or invalid type: "+J)}return Buffer.concat(Q)}function soliditySHA3(D,E){return util$2.keccak(solidityPack(D,E))}var abi$1={rawEncode,solidityPack,soliditySHA3};const util$1=util$3,abi=abi$1,TYPED_MESSAGE_SCHEMA={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},TypedDataUtils={encodeData(D,E,W,U=!0){const Q=["bytes32"],G=[this.hashType(D,W)];if(U){const J=(Y,X,Z)=>{if(W[X]!==void 0)return["bytes32",Z==null?"0x0000000000000000000000000000000000000000000000000000000000000000":util$1.keccak(this.encodeData(X,Z,W,U))];if(Z===void 0)throw new Error(`missing value for field ${Y} of type ${X}`);if(X==="bytes")return["bytes32",util$1.keccak(Z)];if(X==="string")return typeof Z=="string"&&(Z=Buffer.from(Z,"utf8")),["bytes32",util$1.keccak(Z)];if(X.lastIndexOf("]")===X.length-1){const ee=X.slice(0,X.lastIndexOf("[")),oe=Z.map(te=>J(Y,ee,te));return["bytes32",util$1.keccak(abi.rawEncode(oe.map(([te])=>te),oe.map(([,te])=>te)))]}return[X,Z]};for(const Y of W[D]){const[X,Z]=J(Y.name,Y.type,E[Y.name]);Q.push(X),G.push(Z)}}else for(const J of W[D]){let Y=E[J.name];if(Y!==void 0)if(J.type==="bytes")Q.push("bytes32"),Y=util$1.keccak(Y),G.push(Y);else if(J.type==="string")Q.push("bytes32"),typeof Y=="string"&&(Y=Buffer.from(Y,"utf8")),Y=util$1.keccak(Y),G.push(Y);else if(W[J.type]!==void 0)Q.push("bytes32"),Y=util$1.keccak(this.encodeData(J.type,Y,W,U)),G.push(Y);else{if(J.type.lastIndexOf("]")===J.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");Q.push(J.type),G.push(Y)}}return abi.rawEncode(Q,G)},encodeType(D,E){let W="",U=this.findTypeDependencies(D,E).filter(Q=>Q!==D);U=[D].concat(U.sort());for(const Q of U){if(!E[Q])throw new Error("No type definition specified: "+Q);W+=Q+"("+E[Q].map(({name:J,type:Y})=>Y+" "+J).join(",")+")"}return W},findTypeDependencies(D,E,W=[]){if(D=D.match(/^\w*/)[0],W.includes(D)||E[D]===void 0)return W;W.push(D);for(const U of E[D])for(const Q of this.findTypeDependencies(U.type,E,W))!W.includes(Q)&&W.push(Q);return W},hashStruct(D,E,W,U=!0){return util$1.keccak(this.encodeData(D,E,W,U))},hashType(D,E){return util$1.keccak(this.encodeType(D,E))},sanitizeData(D){const E={};for(const W in TYPED_MESSAGE_SCHEMA.properties)D[W]&&(E[W]=D[W]);return E.types&&(E.types=Object.assign({EIP712Domain:[]},E.types)),E},hash(D,E=!0){const W=this.sanitizeData(D),U=[Buffer.from("1901","hex")];return U.push(this.hashStruct("EIP712Domain",W.domain,W.types,E)),W.primaryType!=="EIP712Domain"&&U.push(this.hashStruct(W.primaryType,W.message,W.types,E)),util$1.keccak(Buffer.concat(U))}};var ethEip712Util={TYPED_MESSAGE_SCHEMA,TypedDataUtils,hashForSignTypedDataLegacy:function(D){return typedSignatureHashLegacy(D.data)},hashForSignTypedData_v3:function(D){return TypedDataUtils.hash(D.data,!1)},hashForSignTypedData_v4:function(D){return TypedDataUtils.hash(D.data)}};function typedSignatureHashLegacy(D){const E=new Error("Expect argument to be non-empty array");if(typeof D!="object"||!D.length)throw E;const W=D.map(function(G){return G.type==="bytes"?util$1.toBuffer(G.value):G.value}),U=D.map(function(G){return G.type}),Q=D.map(function(G){if(!G.name)throw E;return G.type+" "+G.name});return abi.soliditySHA3(["bytes32","bytes32"],[abi.soliditySHA3(new Array(D.length).fill("string"),Q),abi.soliditySHA3(U,W)])}var FilterPolyfill$1={};Object.defineProperty(FilterPolyfill$1,"__esModule",{value:!0});FilterPolyfill$1.filterFromParam=FilterPolyfill$1.FilterPolyfill=void 0;const types_1$1=types$1,util_1$6=util$4,TIMEOUT=5*60*1e3,JSONRPC_TEMPLATE={jsonrpc:"2.0",id:0};class FilterPolyfill{constructor(E){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,types_1$1.IntNumber)(1),this.provider=E}async newFilter(E){const W=filterFromParam(E),U=this.makeFilterId(),Q=await this.setInitialCursorPosition(U,W.fromBlock);return console.log(`Installing new log filter(${U}):`,W,"initial cursor position:",Q),this.logFilters.set(U,W),this.setFilterTimeout(U),(0,util_1$6.hexStringFromIntNumber)(U)}async newBlockFilter(){const E=this.makeFilterId(),W=await this.setInitialCursorPosition(E,"latest");return console.log(`Installing new block filter (${E}) with initial cursor position:`,W),this.blockFilters.add(E),this.setFilterTimeout(E),(0,util_1$6.hexStringFromIntNumber)(E)}async newPendingTransactionFilter(){const E=this.makeFilterId(),W=await this.setInitialCursorPosition(E,"latest");return console.log(`Installing new block filter (${E}) with initial cursor position:`,W),this.pendingTransactionFilters.add(E),this.setFilterTimeout(E),(0,util_1$6.hexStringFromIntNumber)(E)}uninstallFilter(E){const W=(0,util_1$6.intNumberFromHexString)(E);return console.log(`Uninstalling filter (${W})`),this.deleteFilter(W),!0}getFilterChanges(E){const W=(0,util_1$6.intNumberFromHexString)(E);return this.timeouts.has(W)&&this.setFilterTimeout(W),this.logFilters.has(W)?this.getLogFilterChanges(W):this.blockFilters.has(W)?this.getBlockFilterChanges(W):this.pendingTransactionFilters.has(W)?this.getPendingTransactionFilterChanges(W):Promise.resolve(filterNotFoundError())}async getFilterLogs(E){const W=(0,util_1$6.intNumberFromHexString)(E),U=this.logFilters.get(W);return U?this.sendAsyncPromise(Object.assign(Object.assign({},JSONRPC_TEMPLATE),{method:"eth_getLogs",params:[paramFromFilter(U)]})):filterNotFoundError()}makeFilterId(){return(0,types_1$1.IntNumber)(++this.nextFilterId)}sendAsyncPromise(E){return new Promise((W,U)=>{this.provider.sendAsync(E,(Q,G)=>{if(Q)return U(Q);if(Array.isArray(G)||G==null)return U(new Error(`unexpected response received: ${JSON.stringify(G)}`));W(G)})})}deleteFilter(E){console.log(`Deleting filter (${E})`),this.logFilters.delete(E),this.blockFilters.delete(E),this.pendingTransactionFilters.delete(E),this.cursors.delete(E),this.timeouts.delete(E)}async getLogFilterChanges(E){const W=this.logFilters.get(E),U=this.cursors.get(E);if(!U||!W)return filterNotFoundError();const Q=await this.getCurrentBlockHeight(),G=W.toBlock==="latest"?Q:W.toBlock;if(U>Q||U>W.toBlock)return emptyResult();console.log(`Fetching logs from ${U} to ${G} for filter ${E}`);const J=await this.sendAsyncPromise(Object.assign(Object.assign({},JSONRPC_TEMPLATE),{method:"eth_getLogs",params:[paramFromFilter(Object.assign(Object.assign({},W),{fromBlock:U,toBlock:G}))]}));if(Array.isArray(J.result)){const Y=J.result.map(Z=>(0,util_1$6.intNumberFromHexString)(Z.blockNumber||"0x0")),X=Math.max(...Y);if(X&&X>U){const Z=(0,types_1$1.IntNumber)(X+1);console.log(`Moving cursor position for filter (${E}) from ${U} to ${Z}`),this.cursors.set(E,Z)}}return J}async getBlockFilterChanges(E){const W=this.cursors.get(E);if(!W)return filterNotFoundError();const U=await this.getCurrentBlockHeight();if(W>U)return emptyResult();console.log(`Fetching blocks from ${W} to ${U} for filter (${E})`);const Q=(await Promise.all((0,util_1$6.range)(W,U+1).map(J=>this.getBlockHashByNumber((0,types_1$1.IntNumber)(J))))).filter(J=>!!J),G=(0,types_1$1.IntNumber)(W+Q.length);return console.log(`Moving cursor position for filter (${E}) from ${W} to ${G}`),this.cursors.set(E,G),Object.assign(Object.assign({},JSONRPC_TEMPLATE),{result:Q})}async getPendingTransactionFilterChanges(E){return Promise.resolve(emptyResult())}async setInitialCursorPosition(E,W){const U=await this.getCurrentBlockHeight(),Q=typeof W=="number"&&W>U?W:U;return this.cursors.set(E,Q),Q}setFilterTimeout(E){const W=this.timeouts.get(E);W&&window.clearTimeout(W);const U=window.setTimeout(()=>{console.log(`Filter (${E}) timed out`),this.deleteFilter(E)},TIMEOUT);this.timeouts.set(E,U)}async getCurrentBlockHeight(){const{result:E}=await this.sendAsyncPromise(Object.assign(Object.assign({},JSONRPC_TEMPLATE),{method:"eth_blockNumber",params:[]}));return(0,util_1$6.intNumberFromHexString)((0,util_1$6.ensureHexString)(E))}async getBlockHashByNumber(E){const W=await this.sendAsyncPromise(Object.assign(Object.assign({},JSONRPC_TEMPLATE),{method:"eth_getBlockByNumber",params:[(0,util_1$6.hexStringFromIntNumber)(E),!1]}));return W.result&&typeof W.result.hash=="string"?(0,util_1$6.ensureHexString)(W.result.hash):null}}FilterPolyfill$1.FilterPolyfill=FilterPolyfill;function filterFromParam(D){return{fromBlock:intBlockHeightFromHexBlockHeight(D.fromBlock),toBlock:intBlockHeightFromHexBlockHeight(D.toBlock),addresses:D.address===void 0?null:Array.isArray(D.address)?D.address:[D.address],topics:D.topics||[]}}FilterPolyfill$1.filterFromParam=filterFromParam;function paramFromFilter(D){const E={fromBlock:hexBlockHeightFromIntBlockHeight(D.fromBlock),toBlock:hexBlockHeightFromIntBlockHeight(D.toBlock),topics:D.topics};return D.addresses!==null&&(E.address=D.addresses),E}function intBlockHeightFromHexBlockHeight(D){if(D===void 0||D==="latest"||D==="pending")return"latest";if(D==="earliest")return(0,types_1$1.IntNumber)(0);if((0,util_1$6.isHexString)(D))return(0,util_1$6.intNumberFromHexString)(D);throw new Error(`Invalid block option: ${String(D)}`)}function hexBlockHeightFromIntBlockHeight(D){return D==="latest"?D:(0,util_1$6.hexStringFromIntNumber)(D)}function filterNotFoundError(){return Object.assign(Object.assign({},JSONRPC_TEMPLATE),{error:{code:-32e3,message:"filter not found"}})}function emptyResult(){return Object.assign(Object.assign({},JSONRPC_TEMPLATE),{result:[]})}var JSONRPC={};(function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.JSONRPCMethod=void 0,function(E){E.eth_accounts="eth_accounts",E.eth_coinbase="eth_coinbase",E.net_version="net_version",E.eth_chainId="eth_chainId",E.eth_uninstallFilter="eth_uninstallFilter",E.eth_requestAccounts="eth_requestAccounts",E.eth_sign="eth_sign",E.eth_ecRecover="eth_ecRecover",E.personal_sign="personal_sign",E.personal_ecRecover="personal_ecRecover",E.eth_signTransaction="eth_signTransaction",E.eth_sendRawTransaction="eth_sendRawTransaction",E.eth_sendTransaction="eth_sendTransaction",E.eth_signTypedData_v1="eth_signTypedData_v1",E.eth_signTypedData_v2="eth_signTypedData_v2",E.eth_signTypedData_v3="eth_signTypedData_v3",E.eth_signTypedData_v4="eth_signTypedData_v4",E.eth_signTypedData="eth_signTypedData",E.cbWallet_arbitrary="walletlink_arbitrary",E.wallet_addEthereumChain="wallet_addEthereumChain",E.wallet_switchEthereumChain="wallet_switchEthereumChain",E.wallet_watchAsset="wallet_watchAsset",E.eth_subscribe="eth_subscribe",E.eth_unsubscribe="eth_unsubscribe",E.eth_newFilter="eth_newFilter",E.eth_newBlockFilter="eth_newBlockFilter",E.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",E.eth_getFilterChanges="eth_getFilterChanges",E.eth_getFilterLogs="eth_getFilterLogs"}(D.JSONRPCMethod||(D.JSONRPCMethod={}))})(JSONRPC);var SubscriptionManager$1={};const processFn$1=(D,E)=>function(){const W=E.promiseModule,U=new Array(arguments.length);for(let Q=0;Q<arguments.length;Q++)U[Q]=arguments[Q];return new W((Q,G)=>{E.errorFirst?U.push(function(J,Y){if(E.multiArgs){const X=new Array(arguments.length-1);for(let Z=1;Z<arguments.length;Z++)X[Z-1]=arguments[Z];J?(X.unshift(J),G(X)):Q(X)}else J?G(J):Q(Y)}):U.push(function(J){if(E.multiArgs){const Y=new Array(arguments.length-1);for(let X=0;X<arguments.length;X++)Y[X]=arguments[X];Q(Y)}else Q(J)}),D.apply(this,U)})};var pify$3=(D,E)=>{E=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},E);const W=Q=>{const G=J=>typeof J=="string"?Q===J:J.test(Q);return E.include?E.include.some(G):!E.exclude.some(G)};let U;typeof D=="function"?U=function(){return E.excludeMain?D.apply(this,arguments):processFn$1(D,E).apply(this,arguments)}:U=Object.create(Object.getPrototypeOf(D));for(const Q in D){const G=D[Q];U[Q]=typeof G=="function"&&W(Q)?processFn$1(G,E):G}return U},immutable=extend$1,hasOwnProperty=Object.prototype.hasOwnProperty;function extend$1(){for(var D={},E=0;E<arguments.length;E++){var W=arguments[E];for(var U in W)hasOwnProperty.call(W,U)&&(D[U]=W[U])}return D}var jsonRpcRandomId=IdIterator;function IdIterator(D){D=D||{};var E=D.max||Number.MAX_SAFE_INTEGER,W=typeof D.start<"u"?D.start:Math.floor(Math.random()*E);return function(){return W=W%E,W++}}const extend=immutable,createRandomId=jsonRpcRandomId();var ethQuery=EthQuery$1;function EthQuery$1(D){const E=this;E.currentProvider=D}EthQuery$1.prototype.getBalance=generateFnWithDefaultBlockFor(2,"eth_getBalance");EthQuery$1.prototype.getCode=generateFnWithDefaultBlockFor(2,"eth_getCode");EthQuery$1.prototype.getTransactionCount=generateFnWithDefaultBlockFor(2,"eth_getTransactionCount");EthQuery$1.prototype.getStorageAt=generateFnWithDefaultBlockFor(3,"eth_getStorageAt");EthQuery$1.prototype.call=generateFnWithDefaultBlockFor(2,"eth_call");EthQuery$1.prototype.protocolVersion=generateFnFor("eth_protocolVersion");EthQuery$1.prototype.syncing=generateFnFor("eth_syncing");EthQuery$1.prototype.coinbase=generateFnFor("eth_coinbase");EthQuery$1.prototype.mining=generateFnFor("eth_mining");EthQuery$1.prototype.hashrate=generateFnFor("eth_hashrate");EthQuery$1.prototype.gasPrice=generateFnFor("eth_gasPrice");EthQuery$1.prototype.accounts=generateFnFor("eth_accounts");EthQuery$1.prototype.blockNumber=generateFnFor("eth_blockNumber");EthQuery$1.prototype.getBlockTransactionCountByHash=generateFnFor("eth_getBlockTransactionCountByHash");EthQuery$1.prototype.getBlockTransactionCountByNumber=generateFnFor("eth_getBlockTransactionCountByNumber");EthQuery$1.prototype.getUncleCountByBlockHash=generateFnFor("eth_getUncleCountByBlockHash");EthQuery$1.prototype.getUncleCountByBlockNumber=generateFnFor("eth_getUncleCountByBlockNumber");EthQuery$1.prototype.sign=generateFnFor("eth_sign");EthQuery$1.prototype.sendTransaction=generateFnFor("eth_sendTransaction");EthQuery$1.prototype.sendRawTransaction=generateFnFor("eth_sendRawTransaction");EthQuery$1.prototype.estimateGas=generateFnFor("eth_estimateGas");EthQuery$1.prototype.getBlockByHash=generateFnFor("eth_getBlockByHash");EthQuery$1.prototype.getBlockByNumber=generateFnFor("eth_getBlockByNumber");EthQuery$1.prototype.getTransactionByHash=generateFnFor("eth_getTransactionByHash");EthQuery$1.prototype.getTransactionByBlockHashAndIndex=generateFnFor("eth_getTransactionByBlockHashAndIndex");EthQuery$1.prototype.getTransactionByBlockNumberAndIndex=generateFnFor("eth_getTransactionByBlockNumberAndIndex");EthQuery$1.prototype.getTransactionReceipt=generateFnFor("eth_getTransactionReceipt");EthQuery$1.prototype.getUncleByBlockHashAndIndex=generateFnFor("eth_getUncleByBlockHashAndIndex");EthQuery$1.prototype.getUncleByBlockNumberAndIndex=generateFnFor("eth_getUncleByBlockNumberAndIndex");EthQuery$1.prototype.getCompilers=generateFnFor("eth_getCompilers");EthQuery$1.prototype.compileLLL=generateFnFor("eth_compileLLL");EthQuery$1.prototype.compileSolidity=generateFnFor("eth_compileSolidity");EthQuery$1.prototype.compileSerpent=generateFnFor("eth_compileSerpent");EthQuery$1.prototype.newFilter=generateFnFor("eth_newFilter");EthQuery$1.prototype.newBlockFilter=generateFnFor("eth_newBlockFilter");EthQuery$1.prototype.newPendingTransactionFilter=generateFnFor("eth_newPendingTransactionFilter");EthQuery$1.prototype.uninstallFilter=generateFnFor("eth_uninstallFilter");EthQuery$1.prototype.getFilterChanges=generateFnFor("eth_getFilterChanges");EthQuery$1.prototype.getFilterLogs=generateFnFor("eth_getFilterLogs");EthQuery$1.prototype.getLogs=generateFnFor("eth_getLogs");EthQuery$1.prototype.getWork=generateFnFor("eth_getWork");EthQuery$1.prototype.submitWork=generateFnFor("eth_submitWork");EthQuery$1.prototype.submitHashrate=generateFnFor("eth_submitHashrate");EthQuery$1.prototype.sendAsync=function(D,E){this.currentProvider.sendAsync(createPayload(D),function(U,Q){if(!U&&Q.error&&(U=new Error("EthQuery - RPC Error - "+Q.error.message)),U)return E(U);E(null,Q.result)})};function generateFnFor(D){return function(){const E=this;var W=[].slice.call(arguments),U=W.pop();E.sendAsync({method:D,params:W},U)}}function generateFnWithDefaultBlockFor(D,E){return function(){const W=this;var U=[].slice.call(arguments),Q=U.pop();U.length<D&&U.push("latest"),W.sendAsync({method:E,params:U},Q)}}function createPayload(D){return extend({id:createRandomId(),jsonrpc:"2.0",params:[]},D)}const util=require$$0$1,EventEmitter=eventsExports;var R=typeof Reflect=="object"?Reflect:null,ReflectApply=R&&typeof R.apply=="function"?R.apply:function D(E,W,U){return Function.prototype.apply.call(E,W,U)},safeEventEmitter=SafeEventEmitter$3;function SafeEventEmitter$3(){EventEmitter.call(this)}util.inherits(SafeEventEmitter$3,EventEmitter);SafeEventEmitter$3.prototype.emit=function(D){for(var E=[],W=1;W<arguments.length;W++)E.push(arguments[W]);var U=D==="error",Q=this._events;if(Q!==void 0)U=U&&Q.error===void 0;else if(!U)return!1;if(U){var G;if(E.length>0&&(G=E[0]),G instanceof Error)throw G;var J=new Error("Unhandled error."+(G?" ("+G.message+")":""));throw J.context=G,J}var Y=Q[D];if(Y===void 0)return!1;if(typeof Y=="function")safeApply(Y,this,E);else for(var X=Y.length,Z=arrayClone(Y,X),W=0;W<X;++W)safeApply(Z[W],this,E);return!0};function safeApply(D,E,W){try{ReflectApply(D,E,W)}catch(U){setTimeout(()=>{throw U})}}function arrayClone(D,E){for(var W=new Array(E),U=0;U<E;++U)W[U]=D[U];return W}const SafeEventEmitter$2=safeEventEmitter,sec$1=1e3,calculateSum=(D,E)=>D+E,blockTrackerEvents=["sync","latest"];let BaseBlockTracker$1=class extends SafeEventEmitter$2{constructor(E={}){super(),this._blockResetDuration=E.blockResetDuration||20*sec$1,this._blockResetTimeout,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(W=>this.once("latest",W))}removeAllListeners(E){E?super.removeAllListeners(E):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener()}_start(){}_end(){}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(E,W){blockTrackerEvents.includes(E)&&this._maybeStart()}_onRemoveListener(E,W){this._getBlockTrackerEventCount()>0||this._maybeEnd()}_maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}_maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}_getBlockTrackerEventCount(){return blockTrackerEvents.map(E=>this.listenerCount(E)).reduce(calculateSum)}_newPotentialLatest(E){const W=this._currentBlock;W&&hexToInt$4(E)<=hexToInt$4(W)||this._setCurrentBlock(E)}_setCurrentBlock(E){const W=this._currentBlock;this._currentBlock=E,this.emit("latest",E),this.emit("sync",{oldBlock:W,newBlock:E})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}};var base=BaseBlockTracker$1;function hexToInt$4(D){return Number.parseInt(D,16)}const pify$2=pify$3,BaseBlockTracker=base,sec=1e3;let PollingBlockTracker$1=class extends BaseBlockTracker{constructor(E={}){if(!E.provider)throw new Error("PollingBlockTracker - no provider specified.");const W=E.pollingInterval||20*sec,U=E.retryTimeout||W/10,Q=E.keepEventLoopActive!==void 0?E.keepEventLoopActive:!0,G=E.setSkipCacheFlag||!1;super(Object.assign({blockResetDuration:W},E)),this._provider=E.provider,this._pollingInterval=W,this._retryTimeout=U,this._keepEventLoopActive=Q,this._setSkipCacheFlag=G}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}_start(){this._performSync().catch(E=>this.emit("error",E))}async _performSync(){for(;this._isRunning;)try{await this._updateLatestBlock(),await timeout(this._pollingInterval,!this._keepEventLoopActive)}catch(E){const W=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
4
4
  ${E.stack}`);try{this.emit("error",W)}catch{console.error(W)}await timeout(this._retryTimeout,!this._keepEventLoopActive)}}async _updateLatestBlock(){const E=await this._fetchLatestBlock();this._newPotentialLatest(E)}async _fetchLatestBlock(){const E={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(E.skipCache=!0);const W=await pify$2(U=>this._provider.sendAsync(E,U))();if(W.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
@@ -14,4 +14,4 @@ ${jsonify(E)}`,{request:E})}}JsonRpcEngine$1.JsonRpcEngine=JsonRpcEngine;functio
14
14
 
15
15
  `;var QRCode$2={};function QR8bitByte(D){this.mode=QRMode.MODE_8BIT_BYTE,this.data=D,this.parsedData=[];for(var E=0,W=this.data.length;E<W;E++){var U=[],Q=this.data.charCodeAt(E);Q>65536?(U[0]=240|(Q&1835008)>>>18,U[1]=128|(Q&258048)>>>12,U[2]=128|(Q&4032)>>>6,U[3]=128|Q&63):Q>2048?(U[0]=224|(Q&61440)>>>12,U[1]=128|(Q&4032)>>>6,U[2]=128|Q&63):Q>128?(U[0]=192|(Q&1984)>>>6,U[1]=128|Q&63):U[0]=Q,this.parsedData.push(U)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}QR8bitByte.prototype={getLength:function(D){return this.parsedData.length},write:function(D){for(var E=0,W=this.parsedData.length;E<W;E++)D.put(this.parsedData[E],8)}};function QRCodeModel(D,E){this.typeNumber=D,this.errorCorrectLevel=E,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}QRCodeModel.prototype={addData:function(D){var E=new QR8bitByte(D);this.dataList.push(E),this.dataCache=null},isDark:function(D,E){if(D<0||this.moduleCount<=D||E<0||this.moduleCount<=E)throw new Error(D+","+E);return this.modules[D][E]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(D,E){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var W=0;W<this.moduleCount;W++){this.modules[W]=new Array(this.moduleCount);for(var U=0;U<this.moduleCount;U++)this.modules[W][U]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(D,E),this.typeNumber>=7&&this.setupTypeNumber(D),this.dataCache==null&&(this.dataCache=QRCodeModel.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,E)},setupPositionProbePattern:function(D,E){for(var W=-1;W<=7;W++)if(!(D+W<=-1||this.moduleCount<=D+W))for(var U=-1;U<=7;U++)E+U<=-1||this.moduleCount<=E+U||(0<=W&&W<=6&&(U==0||U==6)||0<=U&&U<=6&&(W==0||W==6)||2<=W&&W<=4&&2<=U&&U<=4?this.modules[D+W][E+U]=!0:this.modules[D+W][E+U]=!1)},getBestMaskPattern:function(){for(var D=0,E=0,W=0;W<8;W++){this.makeImpl(!0,W);var U=QRUtil.getLostPoint(this);(W==0||D>U)&&(D=U,E=W)}return E},createMovieClip:function(D,E,W){var U=D.createEmptyMovieClip(E,W),Q=1;this.make();for(var G=0;G<this.modules.length;G++)for(var J=G*Q,Y=0;Y<this.modules[G].length;Y++){var X=Y*Q,Z=this.modules[G][Y];Z&&(U.beginFill(0,100),U.moveTo(X,J),U.lineTo(X+Q,J),U.lineTo(X+Q,J+Q),U.lineTo(X,J+Q),U.endFill())}return U},setupTimingPattern:function(){for(var D=8;D<this.moduleCount-8;D++)this.modules[D][6]==null&&(this.modules[D][6]=D%2==0);for(var E=8;E<this.moduleCount-8;E++)this.modules[6][E]==null&&(this.modules[6][E]=E%2==0)},setupPositionAdjustPattern:function(){for(var D=QRUtil.getPatternPosition(this.typeNumber),E=0;E<D.length;E++)for(var W=0;W<D.length;W++){var U=D[E],Q=D[W];if(this.modules[U][Q]==null)for(var G=-2;G<=2;G++)for(var J=-2;J<=2;J++)G==-2||G==2||J==-2||J==2||G==0&&J==0?this.modules[U+G][Q+J]=!0:this.modules[U+G][Q+J]=!1}},setupTypeNumber:function(D){for(var E=QRUtil.getBCHTypeNumber(this.typeNumber),W=0;W<18;W++){var U=!D&&(E>>W&1)==1;this.modules[Math.floor(W/3)][W%3+this.moduleCount-8-3]=U}for(var W=0;W<18;W++){var U=!D&&(E>>W&1)==1;this.modules[W%3+this.moduleCount-8-3][Math.floor(W/3)]=U}},setupTypeInfo:function(D,E){for(var W=this.errorCorrectLevel<<3|E,U=QRUtil.getBCHTypeInfo(W),Q=0;Q<15;Q++){var G=!D&&(U>>Q&1)==1;Q<6?this.modules[Q][8]=G:Q<8?this.modules[Q+1][8]=G:this.modules[this.moduleCount-15+Q][8]=G}for(var Q=0;Q<15;Q++){var G=!D&&(U>>Q&1)==1;Q<8?this.modules[8][this.moduleCount-Q-1]=G:Q<9?this.modules[8][15-Q-1+1]=G:this.modules[8][15-Q-1]=G}this.modules[this.moduleCount-8][8]=!D},mapData:function(D,E){for(var W=-1,U=this.moduleCount-1,Q=7,G=0,J=this.moduleCount-1;J>0;J-=2)for(J==6&&J--;;){for(var Y=0;Y<2;Y++)if(this.modules[U][J-Y]==null){var X=!1;G<D.length&&(X=(D[G]>>>Q&1)==1);var Z=QRUtil.getMask(E,U,J-Y);Z&&(X=!X),this.modules[U][J-Y]=X,Q--,Q==-1&&(G++,Q=7)}if(U+=W,U<0||this.moduleCount<=U){U-=W,W=-W;break}}}};QRCodeModel.PAD0=236;QRCodeModel.PAD1=17;QRCodeModel.createData=function(D,E,W){for(var U=QRRSBlock.getRSBlocks(D,E),Q=new QRBitBuffer,G=0;G<W.length;G++){var J=W[G];Q.put(J.mode,4),Q.put(J.getLength(),QRUtil.getLengthInBits(J.mode,D)),J.write(Q)}for(var Y=0,G=0;G<U.length;G++)Y+=U[G].dataCount;if(Q.getLengthInBits()>Y*8)throw new Error("code length overflow. ("+Q.getLengthInBits()+">"+Y*8+")");for(Q.getLengthInBits()+4<=Y*8&&Q.put(0,4);Q.getLengthInBits()%8!=0;)Q.putBit(!1);for(;!(Q.getLengthInBits()>=Y*8||(Q.put(QRCodeModel.PAD0,8),Q.getLengthInBits()>=Y*8));)Q.put(QRCodeModel.PAD1,8);return QRCodeModel.createBytes(Q,U)};QRCodeModel.createBytes=function(D,E){for(var W=0,U=0,Q=0,G=new Array(E.length),J=new Array(E.length),Y=0;Y<E.length;Y++){var X=E[Y].dataCount,Z=E[Y].totalCount-X;U=Math.max(U,X),Q=Math.max(Q,Z),G[Y]=new Array(X);for(var ee=0;ee<G[Y].length;ee++)G[Y][ee]=255&D.buffer[ee+W];W+=X;var oe=QRUtil.getErrorCorrectPolynomial(Z),te=new QRPolynomial(G[Y],oe.getLength()-1),re=te.mod(oe);J[Y]=new Array(oe.getLength()-1);for(var ee=0;ee<J[Y].length;ee++){var ae=ee+re.getLength()-J[Y].length;J[Y][ee]=ae>=0?re.get(ae):0}}for(var fe=0,ee=0;ee<E.length;ee++)fe+=E[ee].totalCount;for(var de=new Array(fe),se=0,ee=0;ee<U;ee++)for(var Y=0;Y<E.length;Y++)ee<G[Y].length&&(de[se++]=G[Y][ee]);for(var ee=0;ee<Q;ee++)for(var Y=0;Y<E.length;Y++)ee<J[Y].length&&(de[se++]=J[Y][ee]);return de};var QRMode={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},QRErrorCorrectLevel={L:1,M:0,Q:3,H:2},QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(D){for(var E=D<<10;QRUtil.getBCHDigit(E)-QRUtil.getBCHDigit(QRUtil.G15)>=0;)E^=QRUtil.G15<<QRUtil.getBCHDigit(E)-QRUtil.getBCHDigit(QRUtil.G15);return(D<<10|E)^QRUtil.G15_MASK},getBCHTypeNumber:function(D){for(var E=D<<12;QRUtil.getBCHDigit(E)-QRUtil.getBCHDigit(QRUtil.G18)>=0;)E^=QRUtil.G18<<QRUtil.getBCHDigit(E)-QRUtil.getBCHDigit(QRUtil.G18);return D<<12|E},getBCHDigit:function(D){for(var E=0;D!=0;)E++,D>>>=1;return E},getPatternPosition:function(D){return QRUtil.PATTERN_POSITION_TABLE[D-1]},getMask:function(D,E,W){switch(D){case QRMaskPattern.PATTERN000:return(E+W)%2==0;case QRMaskPattern.PATTERN001:return E%2==0;case QRMaskPattern.PATTERN010:return W%3==0;case QRMaskPattern.PATTERN011:return(E+W)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(E/2)+Math.floor(W/3))%2==0;case QRMaskPattern.PATTERN101:return E*W%2+E*W%3==0;case QRMaskPattern.PATTERN110:return(E*W%2+E*W%3)%2==0;case QRMaskPattern.PATTERN111:return(E*W%3+(E+W)%2)%2==0;default:throw new Error("bad maskPattern:"+D)}},getErrorCorrectPolynomial:function(D){for(var E=new QRPolynomial([1],0),W=0;W<D;W++)E=E.multiply(new QRPolynomial([1,QRMath.gexp(W)],0));return E},getLengthInBits:function(D,E){if(1<=E&&E<10)switch(D){case QRMode.MODE_NUMBER:return 10;case QRMode.MODE_ALPHA_NUM:return 9;case QRMode.MODE_8BIT_BYTE:return 8;case QRMode.MODE_KANJI:return 8;default:throw new Error("mode:"+D)}else if(E<27)switch(D){case QRMode.MODE_NUMBER:return 12;case QRMode.MODE_ALPHA_NUM:return 11;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 10;default:throw new Error("mode:"+D)}else if(E<41)switch(D){case QRMode.MODE_NUMBER:return 14;case QRMode.MODE_ALPHA_NUM:return 13;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 12;default:throw new Error("mode:"+D)}else throw new Error("type:"+E)},getLostPoint:function(D){for(var E=D.getModuleCount(),W=0,U=0;U<E;U++)for(var Q=0;Q<E;Q++){for(var G=0,J=D.isDark(U,Q),Y=-1;Y<=1;Y++)if(!(U+Y<0||E<=U+Y))for(var X=-1;X<=1;X++)Q+X<0||E<=Q+X||Y==0&&X==0||J==D.isDark(U+Y,Q+X)&&G++;G>5&&(W+=3+G-5)}for(var U=0;U<E-1;U++)for(var Q=0;Q<E-1;Q++){var Z=0;D.isDark(U,Q)&&Z++,D.isDark(U+1,Q)&&Z++,D.isDark(U,Q+1)&&Z++,D.isDark(U+1,Q+1)&&Z++,(Z==0||Z==4)&&(W+=3)}for(var U=0;U<E;U++)for(var Q=0;Q<E-6;Q++)D.isDark(U,Q)&&!D.isDark(U,Q+1)&&D.isDark(U,Q+2)&&D.isDark(U,Q+3)&&D.isDark(U,Q+4)&&!D.isDark(U,Q+5)&&D.isDark(U,Q+6)&&(W+=40);for(var Q=0;Q<E;Q++)for(var U=0;U<E-6;U++)D.isDark(U,Q)&&!D.isDark(U+1,Q)&&D.isDark(U+2,Q)&&D.isDark(U+3,Q)&&D.isDark(U+4,Q)&&!D.isDark(U+5,Q)&&D.isDark(U+6,Q)&&(W+=40);for(var ee=0,Q=0;Q<E;Q++)for(var U=0;U<E;U++)D.isDark(U,Q)&&ee++;var oe=Math.abs(100*ee/E/E-50)/5;return W+=oe*10,W}},QRMath={glog:function(D){if(D<1)throw new Error("glog("+D+")");return QRMath.LOG_TABLE[D]},gexp:function(D){for(;D<0;)D+=255;for(;D>=256;)D-=255;return QRMath.EXP_TABLE[D]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++)QRMath.EXP_TABLE[i]=1<<i;for(var i=8;i<256;i++)QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];for(var i=0;i<255;i++)QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;function QRPolynomial(D,E){if(D.length==null)throw new Error(D.length+"/"+E);for(var W=0;W<D.length&&D[W]==0;)W++;this.num=new Array(D.length-W+E);for(var U=0;U<D.length-W;U++)this.num[U]=D[U+W]}QRPolynomial.prototype={get:function(D){return this.num[D]},getLength:function(){return this.num.length},multiply:function(D){for(var E=new Array(this.getLength()+D.getLength()-1),W=0;W<this.getLength();W++)for(var U=0;U<D.getLength();U++)E[W+U]^=QRMath.gexp(QRMath.glog(this.get(W))+QRMath.glog(D.get(U)));return new QRPolynomial(E,0)},mod:function(D){if(this.getLength()-D.getLength()<0)return this;for(var E=QRMath.glog(this.get(0))-QRMath.glog(D.get(0)),W=new Array(this.getLength()),U=0;U<this.getLength();U++)W[U]=this.get(U);for(var U=0;U<D.getLength();U++)W[U]^=QRMath.gexp(QRMath.glog(D.get(U))+E);return new QRPolynomial(W,0).mod(D)}};function QRRSBlock(D,E){this.totalCount=D,this.dataCount=E}QRRSBlock.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];QRRSBlock.getRSBlocks=function(D,E){var W=QRRSBlock.getRsBlockTable(D,E);if(W==null)throw new Error("bad rs block @ typeNumber:"+D+"/errorCorrectLevel:"+E);for(var U=W.length/3,Q=[],G=0;G<U;G++)for(var J=W[G*3+0],Y=W[G*3+1],X=W[G*3+2],Z=0;Z<J;Z++)Q.push(new QRRSBlock(Y,X));return Q};QRRSBlock.getRsBlockTable=function(D,E){switch(E){case QRErrorCorrectLevel.L:return QRRSBlock.RS_BLOCK_TABLE[(D-1)*4+0];case QRErrorCorrectLevel.M:return QRRSBlock.RS_BLOCK_TABLE[(D-1)*4+1];case QRErrorCorrectLevel.Q:return QRRSBlock.RS_BLOCK_TABLE[(D-1)*4+2];case QRErrorCorrectLevel.H:return QRRSBlock.RS_BLOCK_TABLE[(D-1)*4+3];default:return}};function QRBitBuffer(){this.buffer=[],this.length=0}QRBitBuffer.prototype={get:function(D){var E=Math.floor(D/8);return(this.buffer[E]>>>7-D%8&1)==1},put:function(D,E){for(var W=0;W<E;W++)this.putBit((D>>>E-W-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(D){var E=Math.floor(this.length/8);this.buffer.length<=E&&this.buffer.push(0),D&&(this.buffer[E]|=128>>>this.length%8),this.length++}};var QRCodeLimitLength=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function QRCode$1(D){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof D=="string"&&(D={content:D}),D)for(var E in D)this.options[E]=D[E];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function W(X){switch(X){case"L":return QRErrorCorrectLevel.L;case"M":return QRErrorCorrectLevel.M;case"Q":return QRErrorCorrectLevel.Q;case"H":return QRErrorCorrectLevel.H;default:throw new Error("Unknwon error correction level: "+X)}}function U(X,Z){for(var ee=Q(X),oe=1,te=0,re=0,ae=QRCodeLimitLength.length;re<=ae;re++){var fe=QRCodeLimitLength[re];if(!fe)throw new Error("Content too long: expected "+te+" but got "+ee);switch(Z){case"L":te=fe[0];break;case"M":te=fe[1];break;case"Q":te=fe[2];break;case"H":te=fe[3];break;default:throw new Error("Unknwon error correction level: "+Z)}if(ee<=te)break;oe++}if(oe>QRCodeLimitLength.length)throw new Error("Content too long");return oe}function Q(X){var Z=encodeURI(X).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return Z.length+(Z.length!=X?3:0)}var G=this.options.content,J=U(G,this.options.ecl),Y=W(this.options.ecl);this.qrcode=new QRCodeModel(J,Y),this.qrcode.addData(G),this.qrcode.make()}QRCode$1.prototype.svg=function(D){var E=this.options||{},W=this.qrcode.modules;typeof D>"u"&&(D={container:E.container||"svg"});for(var U=typeof E.pretty<"u"?!!E.pretty:!0,Q=U?" ":"",G=U?`\r
16
16
  `:"",J=E.width,Y=E.height,X=W.length,Z=J/(X+2*E.padding),ee=Y/(X+2*E.padding),oe=typeof E.join<"u"?!!E.join:!1,te=typeof E.swap<"u"?!!E.swap:!1,re=typeof E.xmlDeclaration<"u"?!!E.xmlDeclaration:!0,ae=typeof E.predefined<"u"?!!E.predefined:!1,fe=ae?Q+'<defs><path id="qrmodule" d="M0 0 h'+ee+" v"+Z+' H0 z" style="fill:'+E.color+';shape-rendering:crispEdges;" /></defs>'+G:"",de=Q+'<rect x="0" y="0" width="'+J+'" height="'+Y+'" style="fill:'+E.background+';shape-rendering:crispEdges;"/>'+G,se="",ue="",ce=0;ce<X;ce++)for(var be=0;be<X;be++){var ye=W[be][ce];if(ye){var we=be*Z+E.padding*Z,Ee=ce*ee+E.padding*ee;if(te){var ve=we;we=Ee,Ee=ve}if(oe){var me=Z+we,Te=ee+Ee;we=Number.isInteger(we)?Number(we):we.toFixed(2),Ee=Number.isInteger(Ee)?Number(Ee):Ee.toFixed(2),me=Number.isInteger(me)?Number(me):me.toFixed(2),Te=Number.isInteger(Te)?Number(Te):Te.toFixed(2),ue+="M"+we+","+Ee+" V"+Te+" H"+me+" V"+Ee+" H"+we+" Z "}else ae?se+=Q+'<use x="'+we.toString()+'" y="'+Ee.toString()+'" href="#qrmodule" />'+G:se+=Q+'<rect x="'+we.toString()+'" y="'+Ee.toString()+'" width="'+Z+'" height="'+ee+'" style="fill:'+E.color+';shape-rendering:crispEdges;"/>'+G}}oe&&(se=Q+'<path x="0" y="0" style="fill:'+E.color+';shape-rendering:crispEdges;" d="'+ue+'" />');let ke="";if(this.options.image!==void 0&&this.options.image.svg){const Oe=J*this.options.image.width/100,Ie=Y*this.options.image.height/100,Ae=J/2-Oe/2,Le=Y/2-Ie/2;ke+=`<svg x="${Ae}" y="${Le}" width="${Oe}" height="${Ie}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,ke+=this.options.image.svg+G,ke+="</svg>"}var Ce="";switch(D.container){case"svg":re&&(Ce+='<?xml version="1.0" standalone="yes"?>'+G),Ce+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+J+'" height="'+Y+'">'+G,Ce+=fe+de+se,Ce+=ke,Ce+="</svg>";break;case"svg-viewbox":re&&(Ce+='<?xml version="1.0" standalone="yes"?>'+G),Ce+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+J+" "+Y+'">'+G,Ce+=fe+de+se,Ce+=ke,Ce+="</svg>";break;case"g":Ce+='<g width="'+J+'" height="'+Y+'">'+G,Ce+=fe+de+se,Ce+=ke,Ce+="</g>";break;default:Ce+=(fe+de+se+ke).replace(/^\s+/,"");break}return Ce};var qrcodeSvg=QRCode$1,__importDefault$4=commonjsGlobal&&commonjsGlobal.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(QRCode$2,"__esModule",{value:!0});QRCode$2.QRCode=void 0;const preact_1$3=require$$1,hooks_1$1=require$$2,qrcode_svg_1=__importDefault$4(qrcodeSvg),QRCode=D=>{const[E,W]=(0,hooks_1$1.useState)("");return(0,hooks_1$1.useEffect)(()=>{var U,Q;const G=new qrcode_svg_1.default({content:D.content,background:D.bgColor||"#ffffff",color:D.fgColor||"#000000",container:"svg",ecl:"M",width:(U=D.width)!==null&&U!==void 0?U:256,height:(Q=D.height)!==null&&Q!==void 0?Q:256,padding:0,image:D.image}),J=Buffer.from(G.svg(),"utf8").toString("base64");W(`data:image/svg+xml;base64,${J}`)}),E?(0,preact_1$3.h)("img",{src:E,alt:"QR Code"}):null};QRCode$2.QRCode=QRCode;var Spinner$1={},SpinnerCss={};Object.defineProperty(SpinnerCss,"__esModule",{value:!0});SpinnerCss.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var __importDefault$3=commonjsGlobal&&commonjsGlobal.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(Spinner$1,"__esModule",{value:!0});Spinner$1.Spinner=void 0;const preact_1$2=require$$1,Spinner_css_1=__importDefault$3(SpinnerCss),Spinner=D=>{var E;const W=(E=D.size)!==null&&E!==void 0?E:64,U=D.color||"#000";return(0,preact_1$2.h)("div",{class:"-cbwsdk-spinner"},(0,preact_1$2.h)("style",null,Spinner_css_1.default),(0,preact_1$2.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:W,height:W}},(0,preact_1$2.h)("circle",{style:{cx:50,cy:50,r:45,stroke:U}})))};Spinner$1.Spinner=Spinner;var TryExtensionLinkDialogCss={};Object.defineProperty(TryExtensionLinkDialogCss,"__esModule",{value:!0});TryExtensionLinkDialogCss.default='.-cbwsdk-css-reset .-cbwsdk-extension-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.5);transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box{display:flex;position:relative;max-width:500px;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top{display:flex;flex-direction:row;background-color:#fff;border-radius:8px;overflow:hidden;min-height:300px}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-subtext{margin-top:15px;font-size:12px;line-height:1.5}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-install-region{display:flex;flex-basis:50%;flex-direction:column;justify-content:center;padding:32px}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-install-region button{display:block;border-radius:8px;background-color:#1652f0;color:#fff;width:90%;min-width:fit-content;height:44px;margin-top:16px;font-size:16px;padding-left:16px;padding-right:16px;cursor:pointer;font-weight:500;text-align:center}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-info-region{display:flex;flex-basis:50%;flex-direction:column;justify-content:center;background-color:#fafbfc}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-description{display:flex;flex-direction:row;align-items:center;padding-top:14px;padding-bottom:14px;padding-left:24px;padding-right:32px}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-description-icon-wrapper{display:block;position:relative;width:40px;height:40px;flex-shrink:0;flex-grow:0;border-radius:20px;background-color:#fff;box-shadow:0px 0px 8px rgba(0,0,0,.04),0px 16px 24px rgba(0,0,0,.06)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-description-icon-wrapper img{position:absolute;top:0;bottom:0;left:0;right:0;margin:auto}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-description-text{margin-left:16px;flex-grow:1;font-size:13px;line-height:19px;color:#000;align-self:center}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom{display:flex;flex-direction:row;overflow:hidden;border-radius:8px;background-color:#fff;margin-top:8px}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-description-region{display:flex;flex-direction:column;justify-content:center;padding:32px;flex-grow:1}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-description{font-size:13px;line-height:19px;margin-top:12px;color:#aaa}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-description a{font-size:inherit;line-height:inherit;color:#1652f0;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-qr-region{position:relative;flex-shrink:0;display:flex;flex-direction:column;justify-content:center;padding-left:24px;padding-right:24px;padding-top:16px;padding-bottom:16px}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-qr-wrapper{position:relative;display:block;padding:8px;border-radius:8px;box-shadow:0px 4px 12px rgba(0,0,0,.1)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-qr-wrapper img{display:block}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-qr-connecting>p{font-size:12px;font-weight:bold;color:#000;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel{position:absolute;-webkit-appearance:none;display:flex;align-items:center;justify-content:center;top:16px;right:16px;width:24px;height:24px;border-radius:12px;background-color:#fafbfc;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x::before,.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x::after{content:"";position:absolute;display:block;top:-1px;left:-7px;width:14px;height:1px;background-color:#000;transition:background-color .2s}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x::before{transform:rotate(45deg)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x::after{transform:rotate(135deg)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel:hover .-cbwsdk-link-dialog-box-cancel-x-a,.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel:hover .-cbwsdk-link-dialog-box-cancel-x-b{background-color:#000}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-container-hidden{display:none}.-cbwsdk-css-reset .-cbwsdk-extension-dialog h2{display:block;text-align:left;font-size:22px;font-weight:600;line-height:28px;color:#000}';var __importDefault$2=commonjsGlobal&&commonjsGlobal.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(TryExtensionLinkDialog$1,"__esModule",{value:!0});TryExtensionLinkDialog$1.TryExtensionLinkDialog=void 0;const clsx_1=__importDefault$2(require$$0$2),preact_1$1=require$$1,hooks_1=require$$2,util_1$4=util$4,version_1=version$1,globe_icon_svg_1=__importDefault$2(globeIconSvg),link_icon_svg_1=__importDefault$2(linkIconSvg),lock_icon_svg_1=__importDefault$2(lockIconSvg),QRLogo_1=__importDefault$2(QRLogo),QRCode_1=QRCode$2,Spinner_1=Spinner$1,TryExtensionLinkDialog_css_1=__importDefault$2(TryExtensionLinkDialogCss),TryExtensionLinkDialog=D=>{const[E,W]=(0,hooks_1.useState)(!D.isOpen),[U,Q]=(0,hooks_1.useState)(!D.isOpen);return(0,hooks_1.useEffect)(()=>{const{isOpen:G}=D,J=[window.setTimeout(()=>{Q(!G)},10)];return G?W(!1):J.push(window.setTimeout(()=>{W(!0)},360)),()=>{J.forEach(window.clearTimeout)}},[D.isOpen]),(0,preact_1$1.h)("div",{class:(0,clsx_1.default)("-cbwsdk-extension-dialog-container",E&&"-cbwsdk-extension-dialog-container-hidden")},(0,preact_1$1.h)("style",null,TryExtensionLinkDialog_css_1.default),(0,preact_1$1.h)("div",{class:(0,clsx_1.default)("-cbwsdk-extension-dialog-backdrop",U&&"-cbwsdk-extension-dialog-backdrop-hidden")}),(0,preact_1$1.h)("div",{class:"-cbwsdk-extension-dialog"},(0,preact_1$1.h)("div",{class:(0,clsx_1.default)("-cbwsdk-extension-dialog-box",U&&"-cbwsdk-extension-dialog-box-hidden")},(0,preact_1$1.h)(TryExtensionBox,{onInstallClick:()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")}}),D.connectDisabled?null:(0,preact_1$1.h)(ScanQRBox,{darkMode:D.darkMode,version:D.version,sessionId:D.sessionId,sessionSecret:D.sessionSecret,linkAPIUrl:D.linkAPIUrl,isConnected:D.isConnected,isParentConnection:D.isParentConnection}),D.onCancel&&(0,preact_1$1.h)(CancelButton,{onClick:D.onCancel}))))};TryExtensionLinkDialog$1.TryExtensionLinkDialog=TryExtensionLinkDialog;const TryExtensionBox=({onInstallClick:D})=>{const[E,W]=(0,hooks_1.useState)(!1),U=(0,hooks_1.useCallback)(()=>{E?window.location.reload():(D(),W(!0))},[D,E]);return(0,preact_1$1.h)("div",{class:"-cbwsdk-extension-dialog-box-top"},(0,preact_1$1.h)("div",{class:"-cbwsdk-extension-dialog-box-top-install-region"},(0,preact_1$1.h)("h2",null,"Try the Coinbase Wallet extension"),E&&(0,preact_1$1.h)("div",{class:"-cbwsdk-extension-dialog-box-top-subtext"},"After installing Coinbase Wallet, refresh the page and connect again."),(0,preact_1$1.h)("button",{type:"button",onClick:U},E?"Refresh":"Install")),(0,preact_1$1.h)("div",{class:"-cbwsdk-extension-dialog-box-top-info-region"},(0,preact_1$1.h)(DescriptionItem,{icon:link_icon_svg_1.default,text:"Connect to crypto apps with one click"}),(0,preact_1$1.h)(DescriptionItem,{icon:lock_icon_svg_1.default,text:"Your private key is stored securely"}),(0,preact_1$1.h)(DescriptionItem,{icon:globe_icon_svg_1.default,text:"Works with Ethereum, Polygon, and more"})))},ScanQRBox=D=>{const E=(0,util_1$4.createQrUrl)(D.sessionId,D.sessionSecret,D.linkAPIUrl,D.isParentConnection);return(0,preact_1$1.h)("div",{"data-testid":"scan-qr-box",class:"-cbwsdk-extension-dialog-box-bottom"},(0,preact_1$1.h)("div",{class:"-cbwsdk-extension-dialog-box-bottom-description-region"},(0,preact_1$1.h)("h2",null,"Or scan to connect"),(0,preact_1$1.h)("body",{class:"-cbwsdk-extension-dialog-box-bottom-description"},"Open"," ",(0,preact_1$1.h)("a",{href:"https://wallet.coinbase.com/",target:"_blank",rel:"noopener noreferrer"},"Coinbase Wallet")," ","on your mobile phone and scan")),(0,preact_1$1.h)("div",{class:"-cbwsdk-extension-dialog-box-bottom-qr-region"},(0,preact_1$1.h)("div",{class:"-cbwsdk-extension-dialog-box-bottom-qr-wrapper"},(0,preact_1$1.h)(QRCode_1.QRCode,{content:E,width:150,height:150,fgColor:"#000",bgColor:"transparent",image:{svg:QRLogo_1.default,width:34,height:34}})),(0,preact_1$1.h)("input",{type:"hidden",name:"cbwsdk-version",value:version_1.LIB_VERSION}),(0,preact_1$1.h)("input",{type:"hidden",value:E}),!D.isConnected&&(0,preact_1$1.h)("div",{"data-testid":"connecting-spinner",class:"-cbwsdk-extension-dialog-box-bottom-qr-connecting"},(0,preact_1$1.h)(Spinner_1.Spinner,{size:36,color:"#000"}),(0,preact_1$1.h)("p",null,"Connecting..."))))},DescriptionItem=D=>(0,preact_1$1.h)("div",{class:"-cbwsdk-extension-dialog-box-top-description"},(0,preact_1$1.h)("div",{class:"-cbwsdk-extension-dialog-box-top-description-icon-wrapper"},(0,preact_1$1.h)("img",{src:D.icon})),(0,preact_1$1.h)("body",{class:"-cbwsdk-extension-dialog-box-top-description-text"},D.text)),CancelButton=D=>(0,preact_1$1.h)("button",{type:"button",class:"-cbwsdk-extension-dialog-box-cancel",onClick:D.onClick},(0,preact_1$1.h)("div",{class:"-cbwsdk-extension-dialog-box-cancel-x"}));Object.defineProperty(LinkFlow$1,"__esModule",{value:!0});LinkFlow$1.LinkFlow=void 0;const preact_1=require$$1,rxjs_1$3=require$$2$1,TryExtensionLinkDialog_1=TryExtensionLinkDialog$1;class LinkFlow{constructor(E){this.extensionUI$=new rxjs_1$3.BehaviorSubject({}),this.subscriptions=new rxjs_1$3.Subscription,this.isConnected=!1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=E.darkMode,this.version=E.version,this.sessionId=E.sessionId,this.sessionSecret=E.sessionSecret,this.linkAPIUrl=E.linkAPIUrl,this.isParentConnection=E.isParentConnection,this.connected$=E.connected$}attach(E){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",E.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe(W=>{this.isConnected!==W&&(this.isConnected=W,this.render())}))}detach(){var E;this.root&&(this.subscriptions.unsubscribe(),(0,preact_1.render)(null,this.root),(E=this.root.parentElement)===null||E===void 0||E.removeChild(this.root))}setConnectDisabled(E){this.connectDisabled=E}open(E){this.isOpen=!0,this.onCancel=E.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const E=this.extensionUI$.subscribe(()=>{this.root&&(0,preact_1.render)((0,preact_1.h)(TryExtensionLinkDialog_1.TryExtensionLinkDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)});this.subscriptions.add(E)}}LinkFlow$1.LinkFlow=LinkFlow;var Snackbar={},SnackbarCss={};Object.defineProperty(SnackbarCss,"__esModule",{value:!0});SnackbarCss.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(D){var E=commonjsGlobal&&commonjsGlobal.__importDefault||function(oe){return oe&&oe.__esModule?oe:{default:oe}};Object.defineProperty(D,"__esModule",{value:!0}),D.SnackbarInstance=D.SnackbarContainer=D.Snackbar=void 0;const W=E(require$$0$2),U=require$$1,Q=require$$2,G=E(SnackbarCss),J="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",Y="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class X{constructor(te){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=te.darkMode}attach(te){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",te.appendChild(this.root),this.render()}presentItem(te){const re=this.nextItemKey++;return this.items.set(re,te),this.render(),()=>{this.items.delete(re),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,U.render)((0,U.h)("div",null,(0,U.h)(D.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([te,re])=>(0,U.h)(D.SnackbarInstance,Object.assign({},re,{key:te}))))),this.root)}}D.Snackbar=X;const Z=oe=>(0,U.h)("div",{class:(0,W.default)("-cbwsdk-snackbar-container")},(0,U.h)("style",null,G.default),(0,U.h)("div",{class:"-cbwsdk-snackbar"},oe.children));D.SnackbarContainer=Z;const ee=({autoExpand:oe,message:te,menuItems:re})=>{const[ae,fe]=(0,Q.useState)(!0),[de,se]=(0,Q.useState)(oe??!1);(0,Q.useEffect)(()=>{const ce=[window.setTimeout(()=>{fe(!1)},1),window.setTimeout(()=>{se(!0)},1e4)];return()=>{ce.forEach(window.clearTimeout)}});const ue=()=>{se(!de)};return(0,U.h)("div",{class:(0,W.default)("-cbwsdk-snackbar-instance",ae&&"-cbwsdk-snackbar-instance-hidden",de&&"-cbwsdk-snackbar-instance-expanded")},(0,U.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:ue},(0,U.h)("img",{src:J,class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,U.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},te),(0,U.h)("div",{class:"-gear-container"},!de&&(0,U.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,U.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,U.h)("img",{src:Y,class:"-gear-icon",title:"Expand"}))),re&&re.length>0&&(0,U.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},re.map((ce,be)=>(0,U.h)("div",{class:(0,W.default)("-cbwsdk-snackbar-instance-menu-item",ce.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:ce.onClick,key:be},(0,U.h)("svg",{width:ce.svgWidth,height:ce.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,U.h)("path",{"fill-rule":ce.defaultFillRule,"clip-rule":ce.defaultClipRule,d:ce.path,fill:"#AAAAAA"})),(0,U.h)("span",{class:(0,W.default)("-cbwsdk-snackbar-instance-menu-item-info",ce.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},ce.info)))))};D.SnackbarInstance=ee})(Snackbar);var cssReset={},cssResetCss={};Object.defineProperty(cssResetCss,"__esModule",{value:!0});cssResetCss.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;bottom:auto;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;direction:ltr;display:block;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;left:auto;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";right:auto;tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;top:auto;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;width:auto;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset *{box-sizing:border-box;display:initial;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var __importDefault$1=commonjsGlobal&&commonjsGlobal.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(cssReset,"__esModule",{value:!0});cssReset.injectCssReset=void 0;const cssReset_css_1=__importDefault$1(cssResetCss);function injectCssReset(){const D=document.createElement("style");D.type="text/css",D.appendChild(document.createTextNode(cssReset_css_1.default)),document.documentElement.appendChild(D)}cssReset.injectCssReset=injectCssReset;Object.defineProperty(WalletSDKUI$1,"__esModule",{value:!0});WalletSDKUI$1.WalletSDKUI=void 0;const LinkFlow_1=LinkFlow$1,Snackbar_1=Snackbar,cssReset_1=cssReset;class WalletSDKUI{constructor(E){this.attached=!1,this.snackbar=new Snackbar_1.Snackbar({darkMode:E.darkMode}),this.linkFlow=new LinkFlow_1.LinkFlow({darkMode:E.darkMode,version:E.version,sessionId:E.session.id,sessionSecret:E.session.secret,linkAPIUrl:E.linkAPIUrl,connected$:E.connected$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const E=document.documentElement,W=document.createElement("div");W.className="-cbwsdk-css-reset",E.appendChild(W),this.linkFlow.attach(W),this.snackbar.attach(W),this.attached=!0,(0,cssReset_1.injectCssReset)()}setConnectDisabled(E){this.linkFlow.setConnectDisabled(E)}addEthereumChain(E){}watchAsset(E){}switchEthereumChain(E){}requestEthereumAccounts(E){this.linkFlow.open({onCancel:E.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(E){}signEthereumTransaction(E){}submitEthereumTransaction(E){}ethereumAddressFromSignedMessage(E){}showConnecting(E){let W;return E.isUnlinkedErrorState?W={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:E.onResetConnection}]}:W={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:E.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:E.onResetConnection}]},this.snackbar.presentItem(W)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(E){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}WalletSDKUI$1.WalletSDKUI=WalletSDKUI;var WalletSDKRelay$1={},bindDecorator={};Object.defineProperty(bindDecorator,"__esModule",{value:!0});var constants;(function(D){D.typeOfFunction="function",D.boolTrue=!0})(constants||(constants={}));function bind(D,E,W){if(!W||typeof W.value!==constants.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+E+"> is not a method!");return{configurable:constants.boolTrue,get:function(){var U=W.value.bind(this);return Object.defineProperty(this,E,{value:U,configurable:constants.boolTrue,writable:constants.boolTrue}),U}}}bindDecorator.bind=bind;bindDecorator.default=bind;var WalletSDKConnection$1={},ClientMessage={};Object.defineProperty(ClientMessage,"__esModule",{value:!0});ClientMessage.ClientMessagePublishEvent=ClientMessage.ClientMessageSetSessionConfig=ClientMessage.ClientMessageGetSessionConfig=ClientMessage.ClientMessageIsLinked=ClientMessage.ClientMessageHostSession=void 0;function ClientMessageHostSession(D){return Object.assign({type:"HostSession"},D)}ClientMessage.ClientMessageHostSession=ClientMessageHostSession;function ClientMessageIsLinked(D){return Object.assign({type:"IsLinked"},D)}ClientMessage.ClientMessageIsLinked=ClientMessageIsLinked;function ClientMessageGetSessionConfig(D){return Object.assign({type:"GetSessionConfig"},D)}ClientMessage.ClientMessageGetSessionConfig=ClientMessageGetSessionConfig;function ClientMessageSetSessionConfig(D){return Object.assign({type:"SetSessionConfig"},D)}ClientMessage.ClientMessageSetSessionConfig=ClientMessageSetSessionConfig;function ClientMessagePublishEvent(D){return Object.assign({type:"PublishEvent"},D)}ClientMessage.ClientMessagePublishEvent=ClientMessagePublishEvent;var RxWebSocket={};(function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.RxWebSocket=D.ConnectionState=void 0;const E=require$$2$1,W=require$$3;var U;(function(G){G[G.DISCONNECTED=0]="DISCONNECTED",G[G.CONNECTING=1]="CONNECTING",G[G.CONNECTED=2]="CONNECTED"})(U=D.ConnectionState||(D.ConnectionState={}));class Q{constructor(J,Y=WebSocket){this.WebSocketClass=Y,this.webSocket=null,this.connectionStateSubject=new E.BehaviorSubject(U.DISCONNECTED),this.incomingDataSubject=new E.Subject,this.url=J.replace(/^http/,"ws")}connect(){return this.webSocket?(0,E.throwError)(new Error("webSocket object is not null")):new E.Observable(J=>{let Y;try{this.webSocket=Y=new this.WebSocketClass(this.url)}catch(X){J.error(X);return}this.connectionStateSubject.next(U.CONNECTING),Y.onclose=X=>{this.clearWebSocket(),J.error(new Error(`websocket error ${X.code}: ${X.reason}`)),this.connectionStateSubject.next(U.DISCONNECTED)},Y.onopen=X=>{J.next(),J.complete(),this.connectionStateSubject.next(U.CONNECTED)},Y.onmessage=X=>{this.incomingDataSubject.next(X.data)}}).pipe((0,W.take)(1))}disconnect(){const{webSocket:J}=this;if(J){this.clearWebSocket(),this.connectionStateSubject.next(U.DISCONNECTED);try{J.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,W.flatMap)(J=>{let Y;try{Y=JSON.parse(J)}catch{return(0,E.empty)()}return(0,E.of)(Y)}))}sendData(J){const{webSocket:Y}=this;if(!Y)throw new Error("websocket is not connected");Y.send(J)}clearWebSocket(){const{webSocket:J}=this;J&&(this.webSocket=null,J.onclose=null,J.onerror=null,J.onmessage=null,J.onopen=null)}}D.RxWebSocket=Q})(RxWebSocket);var ServerMessage={};Object.defineProperty(ServerMessage,"__esModule",{value:!0});ServerMessage.isServerMessageFail=void 0;function isServerMessageFail(D){return D&&D.type==="Fail"&&typeof D.id=="number"&&typeof D.sessionId=="string"&&typeof D.error=="string"}ServerMessage.isServerMessageFail=isServerMessageFail;Object.defineProperty(WalletSDKConnection$1,"__esModule",{value:!0});WalletSDKConnection$1.WalletSDKConnection=void 0;const rxjs_1$2=require$$2$1,operators_1$1=require$$3,Session_1$1=Session$1,types_1=types$1,ClientMessage_1=ClientMessage,EventListener_1$1=EventListener,RxWebSocket_1=RxWebSocket,ServerMessage_1=ServerMessage,HEARTBEAT_INTERVAL=1e4,REQUEST_TIMEOUT=6e4;class WalletSDKConnection{constructor(E,W,U,Q,G=WebSocket){this.sessionId=E,this.sessionKey=W,this.eventListener=Q,this.subscriptions=new rxjs_1$2.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,types_1.IntNumber)(1),this.connectedSubject=new rxjs_1$2.BehaviorSubject(!1),this.linkedSubject=new rxjs_1$2.BehaviorSubject(!1),this.sessionConfigSubject=new rxjs_1$2.ReplaySubject(1);const J=new RxWebSocket_1.RxWebSocket(U+"/rpc",G);this.ws=J,this.subscriptions.add(J.connectionState$.pipe((0,operators_1$1.tap)(Y=>{var X;return(X=this.eventListener)===null||X===void 0?void 0:X.onEvent(EventListener_1$1.EVENTS.CONNECTED_STATE_CHANGE,{state:Y,sessionIdHash:Session_1$1.Session.hash(E)})}),(0,operators_1$1.skip)(1),(0,operators_1$1.filter)(Y=>Y===RxWebSocket_1.ConnectionState.DISCONNECTED&&!this.destroyed),(0,operators_1$1.delay)(5e3),(0,operators_1$1.filter)(Y=>!this.destroyed),(0,operators_1$1.flatMap)(Y=>J.connect()),(0,operators_1$1.retry)()).subscribe()),this.subscriptions.add(J.connectionState$.pipe((0,operators_1$1.skip)(2),(0,operators_1$1.switchMap)(Y=>(0,rxjs_1$2.iif)(()=>Y===RxWebSocket_1.ConnectionState.CONNECTED,this.authenticate().pipe((0,operators_1$1.tap)(X=>this.sendIsLinked()),(0,operators_1$1.tap)(X=>this.sendGetSessionConfig()),(0,operators_1$1.map)(X=>!0)),(0,rxjs_1$2.of)(!1))),(0,operators_1$1.distinctUntilChanged)(),(0,operators_1$1.catchError)(Y=>(0,rxjs_1$2.of)(!1))).subscribe(Y=>this.connectedSubject.next(Y))),this.subscriptions.add(J.connectionState$.pipe((0,operators_1$1.skip)(1),(0,operators_1$1.switchMap)(Y=>(0,rxjs_1$2.iif)(()=>Y===RxWebSocket_1.ConnectionState.CONNECTED,(0,rxjs_1$2.timer)(0,HEARTBEAT_INTERVAL)))).subscribe(Y=>Y===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(J.incomingData$.pipe((0,operators_1$1.filter)(Y=>Y==="h")).subscribe(Y=>this.updateLastHeartbeat())),this.subscriptions.add(J.incomingJSONData$.pipe((0,operators_1$1.filter)(Y=>["IsLinkedOK","Linked"].includes(Y.type))).subscribe(Y=>{var X;const Z=Y;(X=this.eventListener)===null||X===void 0||X.onEvent(EventListener_1$1.EVENTS.LINKED,{sessionIdHash:Session_1$1.Session.hash(E),linked:Z.linked,type:Y.type,onlineGuests:Z.onlineGuests}),this.linkedSubject.next(Z.linked||Z.onlineGuests>0)})),this.subscriptions.add(J.incomingJSONData$.pipe((0,operators_1$1.filter)(Y=>["GetSessionConfigOK","SessionConfigUpdated"].includes(Y.type))).subscribe(Y=>{var X;const Z=Y;(X=this.eventListener)===null||X===void 0||X.onEvent(EventListener_1$1.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Session_1$1.Session.hash(E),metadata_keys:Z&&Z.metadata?Object.keys(Z.metadata):void 0}),this.sessionConfigSubject.next({webhookId:Z.webhookId,webhookUrl:Z.webhookUrl,metadata:Z.metadata})}))}connect(){var E;if(this.destroyed)throw new Error("instance is destroyed");(E=this.eventListener)===null||E===void 0||E.onEvent(EventListener_1$1.EVENTS.STARTED_CONNECTING,{sessionIdHash:Session_1$1.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var E;this.subscriptions.unsubscribe(),this.ws.disconnect(),(E=this.eventListener)===null||E===void 0||E.onEvent(EventListener_1$1.EVENTS.DISCONNECTED,{sessionIdHash:Session_1$1.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,operators_1$1.filter)(E=>E),(0,operators_1$1.take)(1),(0,operators_1$1.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,operators_1$1.filter)(E=>E),(0,operators_1$1.take)(1),(0,operators_1$1.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,operators_1$1.filter)(E=>{if(E.type!=="Event")return!1;const W=E;return typeof W.sessionId=="string"&&typeof W.eventId=="string"&&typeof W.event=="string"&&typeof W.data=="string"}),(0,operators_1$1.map)(E=>E))}setSessionMetadata(E,W){const U=(0,ClientMessage_1.ClientMessageSetSessionConfig)({id:(0,types_1.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[E]:W}});return this.onceConnected$.pipe((0,operators_1$1.flatMap)(Q=>this.makeRequest(U)),(0,operators_1$1.map)(Q=>{if((0,ServerMessage_1.isServerMessageFail)(Q))throw new Error(Q.error||"failed to set session metadata")}))}publishEvent(E,W,U=!1){const Q=(0,ClientMessage_1.ClientMessagePublishEvent)({id:(0,types_1.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:E,data:W,callWebhook:U});return this.onceLinked$.pipe((0,operators_1$1.flatMap)(G=>this.makeRequest(Q)),(0,operators_1$1.map)(G=>{if((0,ServerMessage_1.isServerMessageFail)(G))throw new Error(G.error||"failed to publish event");return G.eventId}))}sendData(E){this.ws.sendData(JSON.stringify(E))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>HEARTBEAT_INTERVAL*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}makeRequest(E,W=REQUEST_TIMEOUT){const U=E.id;try{this.sendData(E)}catch(Q){return(0,rxjs_1$2.throwError)(Q)}return this.ws.incomingJSONData$.pipe((0,operators_1$1.timeoutWith)(W,(0,rxjs_1$2.throwError)(new Error(`request ${U} timed out`))),(0,operators_1$1.filter)(Q=>Q.id===U),(0,operators_1$1.take)(1))}authenticate(){const E=(0,ClientMessage_1.ClientMessageHostSession)({id:(0,types_1.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(E).pipe((0,operators_1$1.map)(W=>{if((0,ServerMessage_1.isServerMessageFail)(W))throw new Error(W.error||"failed to authentcate")}))}sendIsLinked(){const E=(0,ClientMessage_1.ClientMessageIsLinked)({id:(0,types_1.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(E)}sendGetSessionConfig(){const E=(0,ClientMessage_1.ClientMessageGetSessionConfig)({id:(0,types_1.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(E)}}WalletSDKConnection$1.WalletSDKConnection=WalletSDKConnection;var WalletUIError$1={};Object.defineProperty(WalletUIError$1,"__esModule",{value:!0});WalletUIError$1.WalletUIError=void 0;class WalletUIError extends Error{constructor(E,W){super(E),this.message=E,this.errorCode=W}}WalletUIError$1.WalletUIError=WalletUIError;WalletUIError.UserRejectedRequest=new WalletUIError("User rejected request");WalletUIError.SwitchEthereumChainUnsupportedChainId=new WalletUIError("Unsupported chainId",4902);var aes256gcm$1={};Object.defineProperty(aes256gcm$1,"__esModule",{value:!0});aes256gcm$1.decrypt=aes256gcm$1.encrypt=void 0;const rxjs_1$1=require$$2$1,util_1$3=util$4;async function encrypt(D,E){if(E.length!==64)throw Error("secret must be 256 bits");const W=crypto.getRandomValues(new Uint8Array(12)),U=await crypto.subtle.importKey("raw",(0,util_1$3.hexStringToUint8Array)(E),{name:"aes-gcm"},!1,["encrypt","decrypt"]),Q=new TextEncoder,G=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:W},U,Q.encode(D)),J=16,Y=G.slice(G.byteLength-J),X=G.slice(0,G.byteLength-J),Z=new Uint8Array(Y),ee=new Uint8Array(X),oe=new Uint8Array([...W,...Z,...ee]);return(0,util_1$3.uint8ArrayToHex)(oe)}aes256gcm$1.encrypt=encrypt;function decrypt(D,E){if(E.length!==64)throw Error("secret must be 256 bits");return new rxjs_1$1.Observable(W=>{(async function(){const U=await crypto.subtle.importKey("raw",(0,util_1$3.hexStringToUint8Array)(E),{name:"aes-gcm"},!1,["encrypt","decrypt"]),Q=(0,util_1$3.hexStringToUint8Array)(D),G=Q.slice(0,12),J=Q.slice(12,28),Y=Q.slice(28),X=new Uint8Array([...Y,...J]),Z={name:"AES-GCM",iv:new Uint8Array(G)};try{const ee=await window.crypto.subtle.decrypt(Z,U,X),oe=new TextDecoder;W.next(oe.decode(ee)),W.complete()}catch(ee){W.error(ee)}})()})}aes256gcm$1.decrypt=decrypt;var Web3Method={};(function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.Web3Method=void 0,function(E){E.requestEthereumAccounts="requestEthereumAccounts",E.signEthereumMessage="signEthereumMessage",E.signEthereumTransaction="signEthereumTransaction",E.submitEthereumTransaction="submitEthereumTransaction",E.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",E.scanQRCode="scanQRCode",E.generic="generic",E.childRequestEthereumAccounts="childRequestEthereumAccounts",E.addEthereumChain="addEthereumChain",E.switchEthereumChain="switchEthereumChain",E.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",E.watchAsset="watchAsset"}(D.Web3Method||(D.Web3Method={}))})(Web3Method);var Web3RequestCanceledMessage$1={},RelayMessage={};(function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.RelayMessageType=void 0,function(E){E.SESSION_ID_REQUEST="SESSION_ID_REQUEST",E.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",E.LINKED="LINKED",E.UNLINKED="UNLINKED",E.WEB3_REQUEST="WEB3_REQUEST",E.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",E.WEB3_RESPONSE="WEB3_RESPONSE"}(D.RelayMessageType||(D.RelayMessageType={}))})(RelayMessage);Object.defineProperty(Web3RequestCanceledMessage$1,"__esModule",{value:!0});Web3RequestCanceledMessage$1.Web3RequestCanceledMessage=void 0;const RelayMessage_1$2=RelayMessage;function Web3RequestCanceledMessage(D){return{type:RelayMessage_1$2.RelayMessageType.WEB3_REQUEST_CANCELED,id:D}}Web3RequestCanceledMessage$1.Web3RequestCanceledMessage=Web3RequestCanceledMessage;var Web3RequestMessage$1={};Object.defineProperty(Web3RequestMessage$1,"__esModule",{value:!0});Web3RequestMessage$1.Web3RequestMessage=void 0;const RelayMessage_1$1=RelayMessage;function Web3RequestMessage(D){return Object.assign({type:RelayMessage_1$1.RelayMessageType.WEB3_REQUEST},D)}Web3RequestMessage$1.Web3RequestMessage=Web3RequestMessage;var Web3Response={};Object.defineProperty(Web3Response,"__esModule",{value:!0});Web3Response.EthereumAddressFromSignedMessageResponse=Web3Response.SubmitEthereumTransactionResponse=Web3Response.SignEthereumTransactionResponse=Web3Response.SignEthereumMessageResponse=Web3Response.isRequestEthereumAccountsResponse=Web3Response.WatchAssetReponse=Web3Response.RequestEthereumAccountsResponse=Web3Response.SwitchEthereumChainResponse=Web3Response.AddEthereumChainResponse=Web3Response.ErrorResponse=void 0;const Web3Method_1$1=Web3Method;function ErrorResponse(D,E,W){return{method:D,errorMessage:E,errorCode:W}}Web3Response.ErrorResponse=ErrorResponse;function AddEthereumChainResponse(D){return{method:Web3Method_1$1.Web3Method.addEthereumChain,result:D}}Web3Response.AddEthereumChainResponse=AddEthereumChainResponse;function SwitchEthereumChainResponse(D){return{method:Web3Method_1$1.Web3Method.switchEthereumChain,result:D}}Web3Response.SwitchEthereumChainResponse=SwitchEthereumChainResponse;function RequestEthereumAccountsResponse(D){return{method:Web3Method_1$1.Web3Method.requestEthereumAccounts,result:D}}Web3Response.RequestEthereumAccountsResponse=RequestEthereumAccountsResponse;function WatchAssetReponse(D){return{method:Web3Method_1$1.Web3Method.watchAsset,result:D}}Web3Response.WatchAssetReponse=WatchAssetReponse;function isRequestEthereumAccountsResponse(D){return D&&D.method===Web3Method_1$1.Web3Method.requestEthereumAccounts}Web3Response.isRequestEthereumAccountsResponse=isRequestEthereumAccountsResponse;function SignEthereumMessageResponse(D){return{method:Web3Method_1$1.Web3Method.signEthereumMessage,result:D}}Web3Response.SignEthereumMessageResponse=SignEthereumMessageResponse;function SignEthereumTransactionResponse(D){return{method:Web3Method_1$1.Web3Method.signEthereumTransaction,result:D}}Web3Response.SignEthereumTransactionResponse=SignEthereumTransactionResponse;function SubmitEthereumTransactionResponse(D){return{method:Web3Method_1$1.Web3Method.submitEthereumTransaction,result:D}}Web3Response.SubmitEthereumTransactionResponse=SubmitEthereumTransactionResponse;function EthereumAddressFromSignedMessageResponse(D){return{method:Web3Method_1$1.Web3Method.ethereumAddressFromSignedMessage,result:D}}Web3Response.EthereumAddressFromSignedMessageResponse=EthereumAddressFromSignedMessageResponse;var Web3ResponseMessage$1={};Object.defineProperty(Web3ResponseMessage$1,"__esModule",{value:!0});Web3ResponseMessage$1.isWeb3ResponseMessage=Web3ResponseMessage$1.Web3ResponseMessage=void 0;const RelayMessage_1=RelayMessage;function Web3ResponseMessage(D){return Object.assign({type:RelayMessage_1.RelayMessageType.WEB3_RESPONSE},D)}Web3ResponseMessage$1.Web3ResponseMessage=Web3ResponseMessage;function isWeb3ResponseMessage(D){return D&&D.type===RelayMessage_1.RelayMessageType.WEB3_RESPONSE}Web3ResponseMessage$1.isWeb3ResponseMessage=isWeb3ResponseMessage;var __createBinding=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(D,E,W,U){U===void 0&&(U=W),Object.defineProperty(D,U,{enumerable:!0,get:function(){return E[W]}})}:function(D,E,W,U){U===void 0&&(U=W),D[U]=E[W]}),__setModuleDefault=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(D,E){Object.defineProperty(D,"default",{enumerable:!0,value:E})}:function(D,E){D.default=E}),__decorate=commonjsGlobal&&commonjsGlobal.__decorate||function(D,E,W,U){var Q=arguments.length,G=Q<3?E:U===null?U=Object.getOwnPropertyDescriptor(E,W):U,J;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(D,E,W,U);else for(var Y=D.length-1;Y>=0;Y--)(J=D[Y])&&(G=(Q<3?J(G):Q>3?J(E,W,G):J(E,W))||G);return Q>3&&G&&Object.defineProperty(E,W,G),G},__importStar=commonjsGlobal&&commonjsGlobal.__importStar||function(D){if(D&&D.__esModule)return D;var E={};if(D!=null)for(var W in D)W!=="default"&&Object.prototype.hasOwnProperty.call(D,W)&&__createBinding(E,D,W);return __setModuleDefault(E,D),E},__importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(WalletSDKRelay$1,"__esModule",{value:!0});WalletSDKRelay$1.WalletSDKRelay=void 0;const bind_decorator_1=__importDefault(bindDecorator),eth_rpc_errors_1=dist$2,rxjs_1=require$$2$1,operators_1=require$$3,EventListener_1=EventListener,WalletSDKConnection_1=WalletSDKConnection$1,WalletUIError_1=WalletUIError$1,util_1$2=util$4,aes256gcm=__importStar(aes256gcm$1),Session_1=Session$1,WalletSDKRelayAbstract_1=WalletSDKRelayAbstract$1,Web3Method_1=Web3Method,Web3RequestCanceledMessage_1=Web3RequestCanceledMessage$1,Web3RequestMessage_1=Web3RequestMessage$1,Web3Response_1=Web3Response,Web3ResponseMessage_1=Web3ResponseMessage$1;class WalletSDKRelay extends WalletSDKRelayAbstract_1.WalletSDKRelayAbstract{constructor(E){super(),this.accountsCallback=null,this.chainCallback=null,this.appName="",this.appLogoUrl=null,this.subscriptions=new rxjs_1.Subscription,this.linkAPIUrl=E.linkAPIUrl,this.storage=E.storage,this._session=Session_1.Session.load(E.storage)||new Session_1.Session(E.storage).save(),this.relayEventManager=E.relayEventManager,this.eventListener=E.eventListener,this.connection=new WalletSDKConnection_1.WalletSDKConnection(this._session.id,this._session.key,this.linkAPIUrl,this.eventListener),this.subscriptions.add(this.connection.sessionConfig$.subscribe({next:W=>{this.onSessionConfigChanged(W)},error:()=>{var W;(W=this.eventListener)===null||W===void 0||W.onEvent(EventListener_1.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(this.connection.incomingEvent$.pipe((0,operators_1.filter)(W=>W.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(this.connection.linked$.pipe((0,operators_1.skip)(1),(0,operators_1.tap)(W=>{var U;this.isLinked=W;const Q=this.storage.getItem(WalletSDKRelayAbstract_1.LOCAL_STORAGE_ADDRESSES_KEY);if(W&&(this.session.linked=W),this.isUnlinkedErrorState=!1,Q){const G=Q.split(" "),J=this.storage.getItem("IsStandaloneSigning")==="true";if(G[0]!==""&&!W&&this.session.linked&&!J){this.isUnlinkedErrorState=!0;const Y=this.getSessionIdHash();(U=this.eventListener)===null||U===void 0||U.onEvent(EventListener_1.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:Y})}}})).subscribe()),this.subscriptions.add(this.connection.sessionConfig$.pipe((0,operators_1.filter)(W=>!!W.metadata&&W.metadata.__destroyed==="1")).subscribe(()=>{var W;const U=this.connection.isDestroyed;return(W=this.eventListener)===null||W===void 0||W.onEvent(EventListener_1.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:U,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(this.connection.sessionConfig$.pipe((0,operators_1.filter)(W=>W.metadata&&W.metadata.WalletUsername!==void 0)).pipe((0,operators_1.mergeMap)(W=>aes256gcm.decrypt(W.metadata.WalletUsername,this._session.secret))).subscribe({next:W=>{this.storage.setItem(WalletSDKRelayAbstract_1.WALLET_USER_NAME_KEY,W)},error:()=>{var W;(W=this.eventListener)===null||W===void 0||W.onEvent(EventListener_1.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(this.connection.sessionConfig$.pipe((0,operators_1.filter)(W=>W.metadata&&W.metadata.AppVersion!==void 0)).pipe((0,operators_1.mergeMap)(W=>aes256gcm.decrypt(W.metadata.AppVersion,this._session.secret))).subscribe({next:W=>{this.storage.setItem(WalletSDKRelayAbstract_1.APP_VERSION_KEY,W)},error:()=>{var W;(W=this.eventListener)===null||W===void 0||W.onEvent(EventListener_1.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(this.connection.sessionConfig$.pipe((0,operators_1.filter)(W=>W.metadata&&W.metadata.ChainId!==void 0&&W.metadata.JsonRpcUrl!==void 0)).pipe((0,operators_1.mergeMap)(W=>(0,rxjs_1.zip)(aes256gcm.decrypt(W.metadata.ChainId,this._session.secret),aes256gcm.decrypt(W.metadata.JsonRpcUrl,this._session.secret)))).pipe((0,operators_1.distinctUntilChanged)()).subscribe({next:([W,U])=>{this.chainCallback&&this.chainCallback(W,U)},error:()=>{var W;(W=this.eventListener)===null||W===void 0||W.onEvent(EventListener_1.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(this.connection.sessionConfig$.pipe((0,operators_1.filter)(W=>W.metadata&&W.metadata.EthereumAddress!==void 0)).pipe((0,operators_1.mergeMap)(W=>aes256gcm.decrypt(W.metadata.EthereumAddress,this._session.secret))).subscribe({next:W=>{this.accountsCallback&&this.accountsCallback([W]),WalletSDKRelay.accountRequestCallbackIds.size>0&&(Array.from(WalletSDKRelay.accountRequestCallbackIds.values()).forEach(U=>{const Q=(0,Web3ResponseMessage_1.Web3ResponseMessage)({id:U,response:(0,Web3Response_1.RequestEthereumAccountsResponse)([W])});this.invokeCallback(Object.assign(Object.assign({},Q),{id:U}))}),WalletSDKRelay.accountRequestCallbackIds.clear())},error:()=>{var W;(W=this.eventListener)===null||W===void 0||W.onEvent(EventListener_1.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.ui=E.uiConstructor({linkAPIUrl:E.linkAPIUrl,version:E.version,darkMode:E.darkMode,session:this._session,connected$:this.connection.connected$}),this.connection.connect()}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,operators_1.timeout)(1e3),(0,operators_1.catchError)(E=>(0,rxjs_1.of)(null))).subscribe(E=>{var W,U,Q;try{this.subscriptions.unsubscribe()}catch{(W=this.eventListener)===null||W===void 0||W.onEvent(EventListener_1.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(U=this.eventListener)===null||U===void 0||U.onEvent(EventListener_1.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const G=Session_1.Session.load(this.storage);(G==null?void 0:G.id)===this._session.id?this.storage.clear():G&&((Q=this.eventListener)===null||Q===void 0||Q.onEvent(EventListener_1.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Session_1.Session.hash(G.id)})),this.ui.reloadUI()},E=>{var W;(W=this.eventListener)===null||W===void 0||W.onEvent(EventListener_1.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${E}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(E,W){this.appName=E,this.appLogoUrl=W}getStorageItem(E){return this.storage.getItem(E)}get session(){return this._session}setStorageItem(E,W){this.storage.setItem(E,W)}signEthereumMessage(E,W,U,Q){return this.sendRequest({method:Web3Method_1.Web3Method.signEthereumMessage,params:{message:(0,util_1$2.hexStringFromBuffer)(E,!0),address:W,addPrefix:U,typedDataJson:Q||null}})}ethereumAddressFromSignedMessage(E,W,U){return this.sendRequest({method:Web3Method_1.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,util_1$2.hexStringFromBuffer)(E,!0),signature:(0,util_1$2.hexStringFromBuffer)(W,!0),addPrefix:U}})}signEthereumTransaction(E){return this.sendRequest({method:Web3Method_1.Web3Method.signEthereumTransaction,params:{fromAddress:E.fromAddress,toAddress:E.toAddress,weiValue:(0,util_1$2.bigIntStringFromBN)(E.weiValue),data:(0,util_1$2.hexStringFromBuffer)(E.data,!0),nonce:E.nonce,gasPriceInWei:E.gasPriceInWei?(0,util_1$2.bigIntStringFromBN)(E.gasPriceInWei):null,maxFeePerGas:E.gasPriceInWei?(0,util_1$2.bigIntStringFromBN)(E.gasPriceInWei):null,maxPriorityFeePerGas:E.gasPriceInWei?(0,util_1$2.bigIntStringFromBN)(E.gasPriceInWei):null,gasLimit:E.gasLimit?(0,util_1$2.bigIntStringFromBN)(E.gasLimit):null,chainId:E.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(E){return this.sendRequest({method:Web3Method_1.Web3Method.signEthereumTransaction,params:{fromAddress:E.fromAddress,toAddress:E.toAddress,weiValue:(0,util_1$2.bigIntStringFromBN)(E.weiValue),data:(0,util_1$2.hexStringFromBuffer)(E.data,!0),nonce:E.nonce,gasPriceInWei:E.gasPriceInWei?(0,util_1$2.bigIntStringFromBN)(E.gasPriceInWei):null,maxFeePerGas:E.maxFeePerGas?(0,util_1$2.bigIntStringFromBN)(E.maxFeePerGas):null,maxPriorityFeePerGas:E.maxPriorityFeePerGas?(0,util_1$2.bigIntStringFromBN)(E.maxPriorityFeePerGas):null,gasLimit:E.gasLimit?(0,util_1$2.bigIntStringFromBN)(E.gasLimit):null,chainId:E.chainId,shouldSubmit:!0}})}submitEthereumTransaction(E,W){return this.sendRequest({method:Web3Method_1.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,util_1$2.hexStringFromBuffer)(E,!0),chainId:W}})}scanQRCode(E){return this.sendRequest({method:Web3Method_1.Web3Method.scanQRCode,params:{regExp:E}})}getQRCodeUrl(){return(0,util_1$2.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1)}genericRequest(E,W){return this.sendRequest({method:Web3Method_1.Web3Method.generic,params:{action:W,data:E}})}sendGenericMessage(E){return this.sendRequest(E)}sendRequest(E){let W=null;const U=(0,util_1$2.randomBytesHex)(8),Q=J=>{this.publishWeb3RequestCanceledEvent(U),this.handleErrorResponse(U,E.method,J),W==null||W()};return{promise:new Promise((J,Y)=>{this.ui.isStandalone()||(W=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:Q,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(U,X=>{if(W==null||W(),X.errorMessage)return Y(new Error(X.errorMessage));J(X)}),this.ui.isStandalone()?this.sendRequestStandalone(U,E):this.publishWeb3RequestEvent(U,E)}),cancel:Q}}setConnectDisabled(E){this.ui.setConnectDisabled(E)}setAccountsCallback(E){this.accountsCallback=E}setChainCallback(E){this.chainCallback=E}publishWeb3RequestEvent(E,W){var U;const Q=(0,Web3RequestMessage_1.Web3RequestMessage)({id:E,request:W}),G=Session_1.Session.load(this.storage);(U=this.eventListener)===null||U===void 0||U.onEvent(EventListener_1.EVENTS.WEB3_REQUEST,{eventId:Q.id,method:`relay::${Q.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:G?Session_1.Session.hash(G.id):"",isSessionMismatched:((G==null?void 0:G.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",Q,!0).subscribe({next:J=>{var Y;(Y=this.eventListener)===null||Y===void 0||Y.onEvent(EventListener_1.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:Q.id,method:`relay::${Q.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:G?Session_1.Session.hash(G.id):"",isSessionMismatched:((G==null?void 0:G.id)!==this._session.id).toString()})},error:J=>{this.handleWeb3ResponseMessage((0,Web3ResponseMessage_1.Web3ResponseMessage)({id:Q.id,response:{method:Q.request.method,errorMessage:J.message}}))}}))}publishWeb3RequestCanceledEvent(E){const W=(0,Web3RequestCanceledMessage_1.Web3RequestCanceledMessage)(E);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",W,!1).subscribe())}publishEvent(E,W,U){const Q=this.session.secret;return new rxjs_1.Observable(G=>{aes256gcm.encrypt(JSON.stringify(Object.assign(Object.assign({},W),{origin:location.origin})),Q).then(J=>{G.next(J),G.complete()})}).pipe((0,operators_1.mergeMap)(G=>this.connection.publishEvent(E,G,U)))}handleIncomingEvent(E){try{this.subscriptions.add(aes256gcm.decrypt(E.data,this.session.secret).pipe((0,operators_1.map)(W=>JSON.parse(W))).subscribe({next:W=>{const U=(0,Web3ResponseMessage_1.isWeb3ResponseMessage)(W)?W:null;U&&this.handleWeb3ResponseMessage(U)},error:()=>{var W;(W=this.eventListener)===null||W===void 0||W.onEvent(EventListener_1.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(E){var W;const{response:U}=E;if((W=this.eventListener)===null||W===void 0||W.onEvent(EventListener_1.EVENTS.WEB3_RESPONSE,{eventId:E.id,method:`relay::${U.method}`,sessionIdHash:this.getSessionIdHash()}),(0,Web3Response_1.isRequestEthereumAccountsResponse)(U)){WalletSDKRelay.accountRequestCallbackIds.forEach(Q=>this.invokeCallback(Object.assign(Object.assign({},E),{id:Q}))),WalletSDKRelay.accountRequestCallbackIds.clear();return}this.invokeCallback(E)}handleErrorResponse(E,W,U,Q){this.handleWeb3ResponseMessage((0,Web3ResponseMessage_1.Web3ResponseMessage)({id:E,response:(0,Web3Response_1.ErrorResponse)(W,(U??WalletUIError_1.WalletUIError.UserRejectedRequest).message,Q)}))}invokeCallback(E){const W=this.relayEventManager.callbacks.get(E.id);W&&(W(E.response),this.relayEventManager.callbacks.delete(E.id))}requestEthereumAccounts(){const E={method:Web3Method_1.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},W=(0,util_1$2.randomBytesHex)(8),U=G=>{this.publishWeb3RequestCanceledEvent(W),this.handleErrorResponse(W,E.method,G)};return{promise:new Promise((G,J)=>{var Y;this.relayEventManager.callbacks.set(W,Z=>{if(this.ui.hideRequestEthereumAccounts(),Z.errorMessage)return J(new Error(Z.errorMessage));G(Z)});const X=((Y=window==null?void 0:window.navigator)===null||Y===void 0?void 0:Y.userAgent)||null;if(X&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(X)){window.location.href=`https://go.cb-w.com/xoXnYwQimhb?cb_url=${encodeURIComponent(window.location.href)}`;return}if(this.ui.inlineAccountsResponse()){const Z=ee=>{this.handleWeb3ResponseMessage((0,Web3ResponseMessage_1.Web3ResponseMessage)({id:W,response:(0,Web3Response_1.RequestEthereumAccountsResponse)(ee)}))};this.ui.requestEthereumAccounts({onCancel:U,onAccounts:Z})}else this.ui.requestEthereumAccounts({onCancel:U});WalletSDKRelay.accountRequestCallbackIds.add(W),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(W,E)}),cancel:U}}watchAsset(E,W,U,Q,G,J){const Y={method:Web3Method_1.Web3Method.watchAsset,params:{type:E,options:{address:W,symbol:U,decimals:Q,image:G},chainId:J}};let X=null;const Z=(0,util_1$2.randomBytesHex)(8),ee=te=>{this.publishWeb3RequestCanceledEvent(Z),this.handleErrorResponse(Z,Y.method,te),X==null||X()};this.ui.inlineWatchAsset()||(X=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:ee,onResetConnection:this.resetAndReload}));const oe=new Promise((te,re)=>{this.relayEventManager.callbacks.set(Z,de=>{if(X==null||X(),de.errorMessage)return re(new Error(de.errorMessage));te(de)});const ae=de=>{this.handleWeb3ResponseMessage((0,Web3ResponseMessage_1.Web3ResponseMessage)({id:Z,response:(0,Web3Response_1.WatchAssetReponse)(!1)}))},fe=()=>{this.handleWeb3ResponseMessage((0,Web3ResponseMessage_1.Web3ResponseMessage)({id:Z,response:(0,Web3Response_1.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:fe,onCancel:ae,type:E,address:W,symbol:U,decimals:Q,image:G,chainId:J}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(Z,Y)});return{cancel:ee,promise:oe}}addEthereumChain(E,W,U,Q,G,J){const Y={method:Web3Method_1.Web3Method.addEthereumChain,params:{chainId:E,rpcUrls:W,blockExplorerUrls:Q,chainName:G,iconUrls:U,nativeCurrency:J}};let X=null;const Z=(0,util_1$2.randomBytesHex)(8),ee=te=>{this.publishWeb3RequestCanceledEvent(Z),this.handleErrorResponse(Z,Y.method,te),X==null||X()};return this.ui.inlineAddEthereumChain(E)||(X=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:ee,onResetConnection:this.resetAndReload})),{promise:new Promise((te,re)=>{this.relayEventManager.callbacks.set(Z,de=>{if(X==null||X(),de.errorMessage)return re(new Error(de.errorMessage));te(de)});const ae=de=>{this.handleWeb3ResponseMessage((0,Web3ResponseMessage_1.Web3ResponseMessage)({id:Z,response:(0,Web3Response_1.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},fe=de=>{this.handleWeb3ResponseMessage((0,Web3ResponseMessage_1.Web3ResponseMessage)({id:Z,response:(0,Web3Response_1.AddEthereumChainResponse)({isApproved:!0,rpcUrl:de})}))};this.ui.inlineAddEthereumChain(E)&&this.ui.addEthereumChain({onCancel:ae,onApprove:fe,chainId:Y.params.chainId,rpcUrls:Y.params.rpcUrls,blockExplorerUrls:Y.params.blockExplorerUrls,chainName:Y.params.chainName,iconUrls:Y.params.iconUrls,nativeCurrency:Y.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(E)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(Z,Y)}),cancel:ee}}switchEthereumChain(E){const W={method:Web3Method_1.Web3Method.switchEthereumChain,params:{chainId:E}};let U=null;const Q=(0,util_1$2.randomBytesHex)(8),G=Y=>{this.publishWeb3RequestCanceledEvent(Q),this.handleErrorResponse(Q,W.method,Y),U==null||U()};return this.ui.inlineSwitchEthereumChain()||(U=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:G,onResetConnection:this.resetAndReload})),{promise:new Promise((Y,X)=>{this.relayEventManager.callbacks.set(Q,oe=>{if(U==null||U(),oe.errorMessage&&oe.errorCode)return X(eth_rpc_errors_1.ethErrors.provider.custom({code:oe.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(oe.errorMessage)return X(new Error(oe.errorMessage));Y(oe)});const Z=oe=>{if(typeof oe=="number"){const te=oe;this.handleWeb3ResponseMessage((0,Web3ResponseMessage_1.Web3ResponseMessage)({id:Q,response:(0,Web3Response_1.ErrorResponse)(Web3Method_1.Web3Method.switchEthereumChain,WalletUIError_1.WalletUIError.SwitchEthereumChainUnsupportedChainId.message,te)}))}else oe instanceof WalletUIError_1.WalletUIError?this.handleErrorResponse(Q,Web3Method_1.Web3Method.switchEthereumChain,oe,oe.errorCode):this.handleWeb3ResponseMessage((0,Web3ResponseMessage_1.Web3ResponseMessage)({id:Q,response:(0,Web3Response_1.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},ee=oe=>{this.handleWeb3ResponseMessage((0,Web3ResponseMessage_1.Web3ResponseMessage)({id:Q,response:(0,Web3Response_1.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:oe})}))};this.ui.switchEthereumChain({onCancel:Z,onApprove:ee,chainId:W.params.chainId}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(Q,W)}),cancel:G}}inlineAddEthereumChain(E){return this.ui.inlineAddEthereumChain(E)}getSessionIdHash(){return Session_1.Session.hash(this._session.id)}sendRequestStandalone(E,W){const U=G=>{this.handleErrorResponse(E,W.method,G)},Q=G=>{this.handleWeb3ResponseMessage((0,Web3ResponseMessage_1.Web3ResponseMessage)({id:E,response:G}))};switch(W.method){case Web3Method_1.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:W,onSuccess:Q,onCancel:U});break;case Web3Method_1.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:W,onSuccess:Q,onCancel:U});break;case Web3Method_1.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:W,onSuccess:Q,onCancel:U});break;case Web3Method_1.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:W,onSuccess:Q});break;default:U();break}}onSessionConfigChanged(E){}}WalletSDKRelay.accountRequestCallbackIds=new Set;__decorate([bind_decorator_1.default],WalletSDKRelay.prototype,"resetAndReload",null);__decorate([bind_decorator_1.default],WalletSDKRelay.prototype,"handleIncomingEvent",null);WalletSDKRelay$1.WalletSDKRelay=WalletSDKRelay;var WalletSDKRelayEventManager$1={};Object.defineProperty(WalletSDKRelayEventManager$1,"__esModule",{value:!0});WalletSDKRelayEventManager$1.WalletSDKRelayEventManager=void 0;const util_1$1=util$4;class WalletSDKRelayEventManager{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const E=this._nextRequestId,W=(0,util_1$1.prepend0x)(E.toString(16));return this.callbacks.get(W)&&this.callbacks.delete(W),E}}WalletSDKRelayEventManager$1.WalletSDKRelayEventManager=WalletSDKRelayEventManager;const name="@coinbase/wallet-sdk",version="3.1.0",description="Coinbase Wallet JavaScript SDK",keywords=["cipher","cipherbrowser","coinbase","coinbasewallet","eth","ether","ethereum","etherium","injection","toshi","wallet","walletlink","web3"],main="dist/index.js",types="dist/index.d.ts",repository="https://github.com/coinbase/coinbase-wallet-sdk.git",author="Coinbase, Inc.",license="Apache-2.0",scripts={"pretest:unit":"node compile-assets.js","test:unit":"jest","test:unit:coverage":"yarn test:unit && open coverage/lcov-report/index.html","test:karma":"yarn build-npm && karma start",prebuild:`node -p "'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'" > src/version.ts`,build:"node compile-assets.js && webpack --config webpack.config.js","build-npm":"tsc -p ./tsconfig.build.json","build:dev":"export LINK_API_URL='http://localhost:3000'; yarn build","build:dev:watch":"nodemon -e 'ts,tsx,js,json,css,scss,svg' --ignore 'src/**/*-css.ts' --ignore 'src/**/*-svg.ts' --watch src/ --exec 'yarn build:dev'","build:prod":`yarn prebuild && yarn build && yarn build-npm && cp ./package.json ./README.md ./LICENSE build/npm && cp -a src/vendor-js build/npm/dist && sed -i.bak 's| "private": true,||g' build/npm/package.json && rm -f build/npm/package.json.bak`,"lint:types":"tsc --noEmit","lint:prettier":'prettier --check "{src,__tests__}/**/*.(js|ts|tsx)"',"lint:eslint":"eslint ./src --ext .ts,.tsx","fix:eslint":"yarn lint:eslint --fix","fix:prettier":"prettier . --write",release:"./scripts/release.sh"},dependencies={"@metamask/safe-event-emitter":"2.0.0","bind-decorator":"^1.0.11","bn.js":"^5.1.1",clsx:"^1.1.0","eth-block-tracker":"4.4.3","eth-json-rpc-filters":"4.2.2","eth-rpc-errors":"4.0.2","js-sha256":"0.9.0","json-rpc-engine":"6.1.0",keccak:"^3.0.1",preact:"^10.5.9",qs:"^6.10.3",rxjs:"^6.6.3","stream-browserify":"^3.0.0"},devDependencies={"@babel/core":"^7.17.9","@babel/plugin-proposal-decorators":"^7.17.9","@babel/plugin-transform-react-jsx":"^7.17.3","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@peculiar/webcrypto":"^1.3.3","@testing-library/jest-dom":"^5.16.4","@testing-library/preact":"^2.0.1","@types/bn.js":"^4.11.6","@types/jest":"^27.4.1","@types/node":"^14.14.20","@types/qs":"^6.9.7","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/eslint-plugin-tslint":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.5.1",browserify:"17.0.0","copy-webpack-plugin":"^6.4.1","core-js":"^3.8.2",eslint:"^8.4.1","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.25.3","eslint-plugin-preact":"^0.1.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-simple-import-sort":"^7.0.0",jasmine:"3.8.0",jest:"^27.5.1","jest-chrome":"^0.7.2",karma:"^6.3.15","karma-browserify":"8.1.0","karma-chrome-launcher":"^3.1.0","karma-jasmine":"^4.0.1",nodemon:"^2.0.6",prettier:"^2.5.1","raw-loader":"^4.0.2","regenerator-runtime":"^0.13.7",sass:"^1.50.0",svgo:"^2.8.0","ts-jest":"^27.1.4","ts-loader":"^8.0.13","ts-node":"^10.7.0",tslib:"^2.0.3",typescript:"^4.1.3",watchify:"4.0.0",webpack:"^5.72.0","webpack-cli":"^4.9.2","whatwg-fetch":"^3.5.0"},engines={node:">= 10.0.0"},require$$6={name,version,description,keywords,main,types,repository,author,license,scripts,dependencies,devDependencies,engines};var define_process_env_default={};Object.defineProperty(CoinbaseWalletSDK$1,"__esModule",{value:!0});CoinbaseWalletSDK$1.CoinbaseWalletSDK=void 0;const ScopedLocalStorage_1=ScopedLocalStorage$1,CoinbaseWalletProvider_1=CoinbaseWalletProvider$1,WalletSDKUI_1=WalletSDKUI$1,WalletSDKRelay_1=WalletSDKRelay$1,WalletSDKRelayEventManager_1=WalletSDKRelayEventManager$1,util_1=util$4,LINK_API_URL=define_process_env_default.LINK_API_URL||"https://www.walletlink.org",SDK_VERSION=define_process_env_default.SDK_VERSION||require$$6.version||"unknown";class CoinbaseWalletSDK{constructor(E){var W,U;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const Q=E.linkAPIUrl||LINK_API_URL;let G;E.uiConstructor?G=E.uiConstructor:G=X=>new WalletSDKUI_1.WalletSDKUI(X),typeof E.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=E.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(W=E.overrideIsCoinbaseWallet)!==null&&W!==void 0?W:!0,this._overrideIsCoinbaseBrowser=(U=E.overrideIsCoinbaseBrowser)!==null&&U!==void 0?U:!1,this._eventListener=E.eventListener;const J=new URL(Q),Y=`${J.protocol}//${J.host}`;this._storage=new ScopedLocalStorage_1.ScopedLocalStorage(`-walletlink:${Y}`),this._storage.setItem("version",CoinbaseWalletSDK.VERSION),!this.walletExtension&&(this._relayEventManager=new WalletSDKRelayEventManager_1.WalletSDKRelayEventManager,this._relay=new WalletSDKRelay_1.WalletSDKRelay({linkAPIUrl:Q,version:SDK_VERSION,darkMode:!!E.darkMode,uiConstructor:G,storage:this._storage,relayEventManager:this._relayEventManager,eventListener:this._eventListener}),this.setAppInfo(E.appName,E.appLogoUrl),!E.headlessMode&&this._relay.attachUI())}makeWeb3Provider(E="",W=1){const U=this.walletExtension;if(U)return this.isCipherProvider(U)||U.setProviderInfo(E,W),U;const Q=this._relay;if(!Q||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return E||Q.setConnectDisabled(!0),new CoinbaseWalletProvider_1.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(Q),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:E,chainId:W,qrUrl:this.getQrUrl(),eventListener:this._eventListener,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(E,W){var U;this._appName=E||"DApp",this._appLogoUrl=W||(0,util_1.getFavicon)();const Q=this.walletExtension;Q?this.isCipherProvider(Q)||Q.setAppInfo(this._appName,this._appLogoUrl):(U=this._relay)===null||U===void 0||U.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var E;const W=this.walletExtension;W?W.close():(E=this._relay)===null||E===void 0||E.resetAndReload()}getQrUrl(){var E,W;return(W=(E=this._relay)===null||E===void 0?void 0:E.getQRCodeUrl())!==null&&W!==void 0?W:null}get walletExtension(){var E;return(E=window.coinbaseWalletExtension)!==null&&E!==void 0?E:window.walletLinkExtension}isCipherProvider(E){return typeof E.isCipher=="boolean"&&E.isCipher}}CoinbaseWalletSDK$1.CoinbaseWalletSDK=CoinbaseWalletSDK;CoinbaseWalletSDK.VERSION=SDK_VERSION;(function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.CoinbaseWalletProvider=D.CoinbaseWalletSDK=void 0;const E=CoinbaseWalletSDK$1,W=CoinbaseWalletProvider$1;var U=CoinbaseWalletSDK$1;Object.defineProperty(D,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return U.CoinbaseWalletSDK}});var Q=CoinbaseWalletProvider$1;Object.defineProperty(D,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return Q.CoinbaseWalletProvider}}),D.default=E.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=E.CoinbaseWalletSDK,window.CoinbaseWalletProvider=W.CoinbaseWalletProvider,window.WalletLink=E.CoinbaseWalletSDK,window.WalletLinkProvider=W.CoinbaseWalletProvider)})(dist$3);const index=getDefaultExportFromCjs(dist$3),index$1=_mergeNamespaces({__proto__:null,default:index},[dist$3]);export{index$1 as i};
17
- //# sourceMappingURL=index-TBN7x3b8.js.map
17
+ //# sourceMappingURL=index-OSjJBNJa.js.map