1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[696],{3155:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},4660:(e,t,n)=>{"use strict";n.d(t,{h:()=>r});var s=n(13051),i=n(5944);function r(e,t){if(!(0,i.P)(e,{strict:!1}))throw new s.M({address:e});if(!(0,i.P)(t,{strict:!1}))throw new s.M({address:t});return e.toLowerCase()===t.toLowerCase()}},17924:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toBig=t.shrSL=t.shrSH=t.rotrSL=t.rotrSH=t.rotrBL=t.rotrBH=t.rotr32L=t.rotr32H=t.rotlSL=t.rotlSH=t.rotlBL=t.rotlBH=t.add5L=t.add5H=t.add4L=t.add4H=t.add3L=t.add3H=void 0,t.add=b,t.fromBig=i,t.split=r;let n=BigInt(0x100000000-1),s=BigInt(32);function i(e,t=!1){return t?{h:Number(e&n),l:Number(e>>s&n)}:{h:0|Number(e>>s&n),l:0|Number(e&n)}}function r(e,t=!1){let n=e.length,s=new Uint32Array(n),a=new Uint32Array(n);for(let r=0;r<n;r++){let{h:n,l:o}=i(e[r],t);[s[r],a[r]]=[n,o]}return[s,a]}let a=(e,t)=>BigInt(e>>>0)<<s|BigInt(t>>>0);t.toBig=a;let o=(e,t,n)=>e>>>n;t.shrSH=o;let c=(e,t,n)=>e<<32-n|t>>>n;t.shrSL=c;let l=(e,t,n)=>e>>>n|t<<32-n;t.rotrSH=l;let h=(e,t,n)=>e<<32-n|t>>>n;t.rotrSL=h;let d=(e,t,n)=>e<<64-n|t>>>n-32;t.rotrBH=d;let u=(e,t,n)=>e>>>n-32|t<<64-n;t.rotrBL=u;let p=(e,t)=>t;t.rotr32H=p;let f=(e,t)=>e;t.rotr32L=f;let g=(e,t,n)=>e<<n|t>>>32-n;t.rotlSH=g;let m=(e,t,n)=>t<<n|e>>>32-n;t.rotlSL=m;let y=(e,t,n)=>t<<n-32|e>>>64-n;t.rotlBH=y;let _=(e,t,n)=>e<<n-32|t>>>64-n;function b(e,t,n,s){let i=(t>>>0)+(s>>>0);return{h:e+n+(i/0x100000000|0)|0,l:0|i}}t.rotlBL=_;let w=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);t.add3L=w;let v=(e,t,n,s)=>t+n+s+(e/0x100000000|0)|0;t.add3H=v;let k=(e,t,n,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0);t.add4L=k;let I=(e,t,n,s,i)=>t+n+s+i+(e/0x100000000|0)|0;t.add4H=I;let E=(e,t,n,s,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0)+(i>>>0);t.add5L=E;let C=(e,t,n,s,i,r)=>t+n+s+i+r+(e/0x100000000|0)|0;t.add5H=C,t.default={fromBig:i,split:r,toBig:a,shrSH:o,shrSL:c,rotrSH:l,rotrSL:h,rotrBH:d,rotrBL:u,rotr32H:p,rotr32L:f,rotlSH:g,rotlSL:m,rotlBH:y,rotlBL:_,add:b,add3L:w,add3H:v,add4L:k,add4H:I,add5H:C,add5L:E}},20577:(e,t,n)=>{var s=n(86141).hp;let i=n(37569),r=n(91663),a={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"]},o={encodeData(e,t,n,a=!0){let o=["bytes32"],c=[this.hashType(e,n)];if(a){let l=(e,t,o)=>{if(void 0!==n[t])return["bytes32",null==o?"0x0000000000000000000000000000000000000000000000000000000000000000":i.keccak(this.encodeData(t,o,n,a))];if(void 0===o)throw Error(`missing value for field ${e} of type ${t}`);if("bytes"===t)return["bytes32",i.keccak(o)];if("string"===t)return"string"==typeof o&&(o=s.from(o,"utf8")),["bytes32",i.keccak(o)];if(t.lastIndexOf("]")===t.length-1){let n=t.slice(0,t.lastIndexOf("[")),s=o.map(t=>l(e,n,t));return["bytes32",i.keccak(r.rawEncode(s.map(([e])=>e),s.map(([,e])=>e)))]}return[t,o]};for(let s of n[e]){let[e,n]=l(s.name,s.type,t[s.name]);o.push(e),c.push(n)}}else for(let r of n[e]){let e=t[r.name];if(void 0!==e)if("bytes"===r.type)o.push("bytes32"),e=i.keccak(e),c.push(e);else if("string"===r.type)o.push("bytes32"),"string"==typeof e&&(e=s.from(e,"utf8")),e=i.keccak(e),c.push(e);else if(void 0!==n[r.type])o.push("bytes32"),e=i.keccak(this.encodeData(r.type,e,n,a)),c.push(e);else if(r.type.lastIndexOf("]")===r.type.length-1)throw Error("Arrays currently unimplemented in encodeData");else o.push(r.type),c.push(e)}return r.rawEncode(o,c)},encodeType(e,t){let n="",s=this.findTypeDependencies(e,t).filter(t=>t!==e);for(let i of s=[e].concat(s.sort())){if(!t[i])throw Error("No type definition specified: "+i);n+=i+"("+t[i].map(({name:e,type:t})=>t+" "+e).join(",")+")"}return n},findTypeDependencies(e,t,n=[]){if(e=e.match(/^\w*/)[0],n.includes(e)||void 0===t[e])return n;for(let s of(n.push(e),t[e]))for(let e of this.findTypeDependencies(s.t
vendor: 12,329 bytes, line 1
1ype,t,n))n.includes(e)||n.push(e);return n},hashStruct(e,t,n,s=!0){return i.keccak(this.encodeData(e,t,n,s))},hashType(e,t){return i.keccak(this.encodeType(e,t))},sanitizeData(e){let t={};for(let n in a.properties)e[n]&&(t[n]=e[n]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){let n=this.sanitizeData(e),r=[s.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,t)),"EIP712Domain"!==n.primaryType&&r.push(this.hashStruct(n.primaryType,n.message,n.types,t)),i.keccak(s.concat(r))}};e.exports={TYPED_MESSAGE_SCHEMA:a,TypedDataUtils:o,hashForSignTypedDataLegacy:function(e){return function(e){let t=Error("Expect argument to be non-empty array");if("object"!=typeof e||!e.length)throw t;let n=e.map(function(e){return"bytes"===e.type?i.toBuffer(e.value):e.value}),s=e.map(function(e){return e.type}),a=e.map(function(e){if(!e.name)throw t;return e.type+" "+e.name});return r.soliditySHA3(["bytes32","bytes32"],[r.soliditySHA3(Array(e.length).fill("string"),a),r.soliditySHA3(s,n)])}(e.data)},hashForSignTypedData_v3:function(e){return o.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return o.hash(e.data)}}},37569:(e,t,n)=>{var s=n(86141).hp;let{keccak_256:i}=n(97813);function r(e){return s.allocUnsafe(e).fill(0)}function a(e,t){let n=e.toString(16);n.length%2!=0&&(n="0"+n);let i=n.match(/.{1,2}/g).map(e=>parseInt(e,16));for(;i.length<t;)i.unshift(0);return s.from(i)}function o(e,t,n){let s=r(t);return(e=c(e),n)?e.length<t?(e.copy(s),s):e.slice(0,t):e.length<t?(e.copy(s,t-e.length),s):e.slice(-t)}function c(e){if(!s.isBuffer(e))if(Array.isArray(e))e=s.from(e);else if("string"==typeof e){var t;e=l(e)?s.from((t=h(e)).length%2?"0"+t:t,"hex"):s.from(e)}else if("number"==typeof e)e=intToBuffer(e);else if(null==e)e=s.allocUnsafe(0);else if("bigint"==typeof e)e=a(e);else if(e.toArray)e=s.from(e.toArray());else throw Error("invalid type");return e}function l(e){return"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]*$/)}function h(e){return"string"==typeof e&&e.startsWith("0x")?e.slice(2):e}e.exports={zeros:r,setLength:o,setLengthRight:function(e,t){return o(e,t,!0)},isHexString:l,stripHexPrefix:h,toBuffer:c,bufferToHex:function(e){return"0x"+(e=c(e)).toString("hex")},keccak:function(e,t){if(e=c(e),t||(t=256),256!==t)throw Error("unsupported");return s.from(i(new Uint8Array(e)))},bitLengthFromBigInt:function(e){return e.toString(2).length},bufferBEFromBigInt:a,twosFromBigInt:function(e,t){return(e<0n?(~e&(1n<<BigInt(t))-1n)+1n:e)&(1n<<BigInt(t))-1n}}},44696:(e,t,n)=>{"use strict";let s;n.d(t,{createCoinbaseWalletSDK:()=>t1});var i=n(4660),r=n(33842);class a{constructor(e,t){this.scope=e,this.module=t}storeObject(e,t){this.setItem(e,JSON.stringify(t))}loadObject(e){let t=this.getItem(e);return t?JSON.parse(t):void 0}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){let e=this.scopedKey(""),t=[];for(let n=0;n<localStorage.length;n++){let s=localStorage.key(n);"string"==typeof s&&s.startsWith(e)&&t.push(s)}t.forEach(e=>localStorage.removeItem(e))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new a("CBWSDK").clear(),new a("walletlink").clear()}}let o=-32602,c=-32603,l=4001,h=4100,d=4200,u=4900,p={"-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."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}},f="Unspecified error message.";function g(e,t=f){if(e&&Number.isInteger(e)){var n;let t=e.toString();if(y(p,t))return p[t].message;if((n=e)>=-32099&&n<=-32e3)return"Unspecified server error."}return t}function m(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t){return"object"==typeof e&&null!==e&&t in e&&"string"==typeof e[t]}let b=e=>S(o,e),w=e=>S(c,e),v=e=>x(l,e),k=e=>x(h,e),I=e=>x(d,e),E=e=>x(u,e),C=e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:n,data:s}=e;if(!n||"string"!=typeof n)throw Error('"message" must be a nonempty string');return new L(t,n,s)};function S(e,t){let[n,s]=M(t);return new A(e,n||g(e),s)}function x(e,t){let[n,s]=M(t);return new L(e,n||g(e),s)}function M(e){if(e){if("string"==typeof e)return[e];else if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:n}=e;if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t||void 0,n]}}return[]}class A extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==n&&(this.data=n)}}class L extends A{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}}function D(e){return Math.floor(e)}var T=n(86141).hp;let N=/^[0-9]*$/,P=/^[a-f0-9]*$/;function O(e){return R(crypto.getRandomValues(new Uint8Array(e)))}function R(e){return[...e].map(e=>e.toString(16).padStart(2,"0")).join("")}function j(e){return new Uint8Array(e.match(/.{1,2}/g).map(e=>Number.parseInt(e,16)))}function U(e,t=!1){let n=e.toString("hex");return t?`0x${n}`:n}function W(e){return U(J(e),!0)}function H(e){return e.toString(10)}function q(e){return`0x${BigInt(e).toString(16)}`}function B(e){return e.startsWith("0x")||e.startsWith("0X")}function K(e){return B(e)?e.slice(2):e}function z(e){return B(e)?`0x${e.slice(2)}`:`0x${e}`}function F(e){if("string"!=typeof e)return!1;let t=K(e).toLowerCase();return P.test(t)}function G(e,t=!1){let n=function(e,t=!1){if("string"==typeof e){let n=K(e).toLowerCase();if(P.test(n))return t?`0x${n}`:n}throw b(`"${String(e)}" is not a hexadecimal string`)}(e,!1);return n.length%2==1&&(n=`0${n}`),t?`0x${n}`:n}function $(e){if("string"==typeof e){let t=K(e).toLowerCase();if(F(t)&&40===t.length)return z(t)}throw b(`Invalid Ethereum address: ${String(e)}`)}function J(e){if(T.isBuffer(e))return e;if("string"==typeof e){if(F(e)){let t=G(e,!1);return T.from(t,"hex")}return T.from(e,"utf8")}throw b(`Not binary data: ${String(e)}`)}function Y(e){if("number"==typeof e&&Number.isInteger(e))return D(e);if("string"==typeof e){if(N.test(e))return D(Number(e));if(F(e))return D(Number(BigInt(G(e,!0))))}throw b(`Not an integer: ${String(e)}`)}function V(e){if(null!==e&&("bigint"==typeof e||function(e){if(null==e||"function"!=typeof e.constructor)return!1;let{constructor:t}=e;return"function"==typeof t.config&&"number"==typeof t.EUCLID}(e)))return BigInt(e.toString(10));if("number"==typeof e)return BigInt(Y(e));if("string"==typeof e){if(N.test(e))return BigInt(e);if(F(e))return BigInt(G(e,!0))}throw b(`Not an integer: ${String(e)}`)}async function Q(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}async function Z(e,t){return crypto.subtle.deriveKey({name:"ECDH",public:t},e,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function X(e,t){let n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,new TextEncoder().encode(t));return{iv:n,cipherText:s}}async function ee(e,{iv:t,cipherText:n}){let s=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},e,n);return new TextDecoder().decode(s)}function et(e){switch(e){case"public":return"spki";case"private":return"pkcs8"}}async function en(e,t){let n=et(e);return R(new Uint8Array(await crypto.subtle.exportKey(n,t)))}async function es(e,t){let n=et(e),s=j(t).buffer;return await crypto.subtle.importKey(n,new Uint8Array(s),{name:"ECDH",namedCurve:"P-256"},!0,"private"===e?["deriveKey"]:[])}async function ei(e,t){return X(t,JSON.stringify(e,(e,t)=>t instanceof Error?Object.assign(Object.assign({},t.code?{code:t.code}:{}),{message:t.message}):t))}async function er(e,t){return JSON.parse(await ee(t,e))}let ea={storageKey:"ownPrivateKey",keyType:"private"},eo={storageKey:"ownPublicKey",keyType:"public"},ec={storageKey:"peerPublicKey",keyType:"public"};class el{constructor(){this.storage=new a("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(ec,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(eo.storageKey),this.storage.removeItem(ea.storageKey),this.storage.removeItem(ec.storageKey)}async generateKeyPair(){let e=await Q();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(ea,e.privateKey),await this.storeKey(eo,e.publicKey)}async loadKeysIfNeeded(){null===this.ownPrivateKey&&(this.ownPrivateKey=await this.loadKey(ea)),null===this.ownPublicKey&&(this.ownPublicKey=await this.loadKey(eo)),(null===this.ownPrivateKey||null===this.ownPublicKey)&&await this.generateKeyPair(),null===this.peerPublicKey&&(this.peerPublicKey=await this.loadKey(ec)),null===this.sharedSecret&&null!==this.ownPrivateKey&&null!==this.peerPublicKey&&(this.sharedSecret=await Z(this.ownPrivateKey,this.peerPublicKey))}async loadKey(e){let t=this.storage.getItem(e.storageKey);return t?es(e.keyType,t):null}async storeKey(e,t){let n=await en(e.keyType,t);this.storage.setItem(e.storageKey,n)}}var eh=n(5944);let ed="4.3.7",eu="@coinbase/wallet-sdk";async function ep(e,t){let n=Object.assign(Object.assign({},e),{jsonrpc:"2.0",id:crypto.randomUUID()}),s=await window.fetch(t,{method:"POST",body:JSON.stringify(n),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":ed,"X-Cbw-Sdk-Platform":eu}}),{result:i,error:r}=await s.json();if(r)throw r;return i}let ef="accounts",eg="activeChain",em="availableChains",ey="walletCapabilities";class e_{constructor(e){var t,n,s;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new el,this.storage=new a("CBWSDK","SCWStateManager"),this.accounts=null!=(t=this.storage.loadObject(ef))?t:[],this.chain=this.storage.loadObject(eg)||{id:null!=(s=null==(n=e.metadata.appChainIds)?void 0:n[0])?s:1},this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(e){var t,n,s,i;await (null==(n=(t=this.communicator).waitForPopupLoaded)?void 0:n.call(t));let r=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,null!=(s=e.params)?s:{})}}),a=await this.communicator.postRequestAndWaitForResponse(r);if("failure"in a.content)throw a.content.failure;let o=await es("public",a.sender);await this.keyManager.setPeerPublicKey(o);
vendor: 11,647 bytes, line 1
1let c=(await this.decryptResponseMessage(a)).result;if("error"in c)throw c.error;if("eth_requestAccounts"===e.method){let e=c.value;this.accounts=e,this.storage.storeObject(ef,e),null==(i=this.callback)||i.call(this,"accountsChanged",e)}}async request(e){var t;if(0===this.accounts.length)if("wallet_sendCalls"===e.method)return this.sendRequestToPopup(e);else throw k();switch(e.method){case"eth_requestAccounts":return null==(t=this.callback)||t.call(this,"connect",{chainId:q(this.chain.id)}),this.accounts;case"eth_accounts":return this.accounts;case"eth_coinbase":return this.accounts[0];case"net_version":return this.chain.id;case"eth_chainId":return q(this.chain.id);case"wallet_getCapabilities":return this.handleGetCapabilitiesRequest(e);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_sign":case"wallet_sign":case"personal_ecRecover":case"eth_signTransaction":case"eth_sendTransaction":case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"wallet_sendCalls":case"wallet_showCallsStatus":case"wallet_grantPermissions":return this.sendRequestToPopup(e);default:if(!this.chain.rpcUrl)throw w("No RPC URL set for chain");return ep(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var t,n;await (null==(n=(t=this.communicator).waitForPopupLoaded)?void 0:n.call(t));let s=await this.sendEncryptedRequest(e),i=(await this.decryptResponseMessage(s)).result;if("error"in i)throw i.error;return i.value}async cleanup(){var e,t;this.storage.clear(),await this.keyManager.clear(),this.accounts=[],this.chain={id:null!=(t=null==(e=this.metadata.appChainIds)?void 0:e[0])?t:1}}async handleSwitchChainRequest(e){var t;let n=e.params;if(!n||!(null==(t=n[0])?void 0:t.chainId))throw b();let s=Y(n[0].chainId);if(this.updateChain(s))return null;let i=await this.sendRequestToPopup(e);return null===i&&this.updateChain(s),i}async handleGetCapabilitiesRequest(e){var t=e.params;if(!t||!Array.isArray(t)||1!==t.length&&2!==t.length||"string"!=typeof t[0]||!(0,eh.P)(t[0]))throw b();if(2===t.length){if(!Array.isArray(t[1]))throw b();for(let e of t[1])if("string"!=typeof e||!e.startsWith("0x"))throw b()}let n=e.params[0],s=e.params[1];if(!this.accounts.some(e=>(0,i.h)(e,n)))throw k("no active account found");let a=this.storage.loadObject(ey);if(!a)return{};if(!s||0===s.length)return a;let o=new Set(s.map(e=>(0,r.ME)(e)));return Object.fromEntries(Object.entries(a).filter(([e])=>{try{let t=(0,r.ME)(e);return o.has(t)}catch(e){return!1}}))}async sendEncryptedRequest(e){let t=await this.keyManager.getSharedSecret();if(!t)throw k("No valid session found, try requestAccounts before other methods");let n=await ei({action:e,chainId:this.chain.id},t),s=await this.createRequestMessage({encrypted:n});return this.communicator.postRequestAndWaitForResponse(s)}async createRequestMessage(e){let t=await en("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:t,content:e,timestamp:new Date}}async decryptResponseMessage(e){var t,n;let s=e.content;if("failure"in s)throw s.failure;let i=await this.keyManager.getSharedSecret();if(!i)throw k("Invalid session");let r=await er(s.encrypted,i),a=null==(t=r.data)?void 0:t.chains;if(a){let e=Object.entries(a).map(([e,t])=>({id:Number(e),rpcUrl:t}));this.storage.storeObject(em,e),this.updateChain(this.chain.id,e)}let o=null==(n=r.data)?void 0:n.capabilities;return o&&this.storage.storeObject(ey,o),r}updateChain(e,t){var n;let s=null!=t?t:this.storage.loadObject(em),i=null==s?void 0:s.find(t=>t.id===e);return!!i&&(i!==this.chain&&(this.chain=i,this.storage.storeObject(eg,i),null==(n=this.callback)||n.call(this,"chainChanged",q(i.id))),!0)}}var eb=n(20577);let ew="Addresses";function ev(e){return void 0!==e.errorMessage}class ek{constructor(e){this.secret=e}async encrypt(e){let t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");let n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",j(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,r=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,i.encode(e)),a=r.slice(r.byteLength-16),o=r.slice(0,r.byteLength-16),c=new Uint8Array(a),l=new Uint8Array(o);return R(new Uint8Array([...n,...c,...l]))}async decrypt(e){let t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");return new Promise((n,s)=>{!async function(){let i=await crypto.subtle.importKey("raw",j(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),r=j(e),a=r.slice(0,12),o=r.slice(12,28),c=new Uint8Array([...r.slice(28),...o]),l={name:"AES-GCM",iv:new Uint8Array(a)};try{let e=await window.crypto.subtle.decrypt(l,i,c),t=new TextDecoder;n(t.decode(e))}catch(e){s(e)}}()})}}class eI{constructor(e,t,n){this.linkAPIUrl=e,this.sessionId=t;const s=`${t}:${n}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(e=>fetch(`${this.linkAPIUrl}/events/${e.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(e=>console.error("Unabled to mark event as failed:",e))}async fetchUnseenEvents(){var e;let t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){let{events:n,error:s}=await t.json();if(s)throw Error(`Check unseen events failed: ${s}`);let i=null!=(e=null==n?void 0:n.filter(e=>"Web3Response"===e.event).map(e=>({type:"Event",sessionId:this.sessionId,eventId:e.id,event:e.event,data:e.data})))?e:[];return this.markUnseenEventsAsSeen(i),i}throw Error(`Check unseen events failed: ${t.status}`)}}(eR=ej||(ej={}))[eR.DISCONNECTED=0]="DISCONNECTED",eR[eR.CONNECTING=1]="CONNECTING",eR[eR.CONNECTED=2]="CONNECTED";class eE{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.isDisconnecting=!1,this.url=e.replace(/^http/,"ws"),this.instanceId=eE.instanceCounter++,eE.activeInstances.add(this.instanceId)}async connect(){if(this.webSocket)throw Error("webSocket object is not null");if(this.isDisconnecting)throw Error("WebSocket is disconnecting, cannot reconnect on same instance");return new Promise((e,t)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(e){t(e);return}null==(n=this.connectionStateListener)||n.call(this,ej.CONNECTING),s.onclose=e=>{var n;this.clearWebSocket(),s.readyState!==WebSocket.OPEN&&t(Error(`websocket error ${e.code}: ${e.reason}`)),null==(n=this.connectionStateListener)||n.call(this,ej.DISCONNECTED)},s.onopen=t=>{var n;e(),null==(n=this.connectionStateListener)||n.call(this,ej.CONNECTED),eE.pendingData.length>0&&([...eE.pendingData].forEach(e=>this.sendData(e)),eE.pendingData=[])},s.onmessage=e=>{var t,n;if("h"===e.data)null==(t=this.incomingDataListener)||t.call(this,{type:"Heartbeat"});else try{let t=JSON.parse(e.data);null==(n=this.incomingDataListener)||n.call(this,t)}catch(e){}}})}disconnect(){var e;let{webSocket:t}=this;if(t){this.isDisconnecting=!0,this.clearWebSocket(),null==(e=this.connectionStateListener)||e.call(this,ej.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch(e){}}}sendData(e){let{webSocket:t}=this;if(!t){eE.pendingData.push(e),this.isDisconnecting||this.connect();return}t.readyState!==WebSocket.OPEN?eE.pendingData.push(e):t.send(e)}clearWebSocket(){let{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}cleanup(){eE.activeInstances.delete(this.instanceId)}}eE.instanceCounter=0,eE.activeInstances=new Set,eE.pendingData=[];class eC{constructor({session:e,linkAPIUrl:t,listener:n}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=D(1),this.reconnectAttempts=0,this.isReconnecting=!1,this._connected=!1,this._linked=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=e=>{e&&new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",t=>e.JsonRpcUrl&&this.handleChainUpdated(t,e.JsonRpcUrl)]]).forEach((t,n)=>{let s=e[n];void 0!==s&&t(s)})},this.handleDestroyed=e=>{var t;"1"===e&&(null==(t=this.listener)||t.resetAndReload())},this.handleAccountUpdated=async e=>{var t;try{let n=await this.cipher.decrypt(e);null==(t=this.listener)||t.accountUpdated(n)}catch(e){}},this.handleMetadataUpdated=async(e,t)=>{var n;try{let s=await this.cipher.decrypt(t);null==(n=this.listener)||n.metadataUpdated(e,s)}catch(e){}},this.handleWalletUsernameUpdated=async e=>{this.handleMetadataUpdated("walletUsername",e)},this.handleAppVersionUpdated=async e=>{this.handleMetadataUpdated("AppVersion",e)},this.handleChainUpdated=async(e,t)=>{var n;try{let s=await this.cipher.decrypt(e),i=await this.cipher.decrypt(t);null==(n=this.listener)||n.chainUpdated(s,i)}catch(e){}},this.session=e,this.cipher=new ek(e.secret),this.listener=n,this.linkAPIUrl=t,this.WebSocketClass=WebSocket;const s=this.createWebSocket();this.ws=s,this.http=new eI(t,e.id,e.key),this.setupVisibilityChangeHandler()}createWebSocket(){let e=new eE(`${this.linkAPIUrl}/rpc`,this.WebSocketClass);return this.activeWsInstance=e,e.setConnectionStateListener(async t=>{if(e!==this.activeWsInstance)return;let n=!1;switch(t){case ej.DISCONNECTED:this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=void 0),this.lastHeartbeatResponse=0,n=!1,this.destroyed||(async()=>{if(this.isReconnecting)return;this.isReconnecting=!0;let t=3e3*(0!==this.reconnectAttempts);await new Promise(e=>setTimeout(e,t)),this.destroyed||e!==this.activeWsInstance?this.isReconnecting=!1:(this.reconnectAttempts++,"cleanup"in this.ws&&"function"==typeof this.ws.cleanup&&this.ws.cleanup(),this.ws=this.createWebSocket(),this.ws.connect().catch(()=>{}).finally(()=>{this.isReconnecting=!1}))})();break;case ej.CONNECTED:this.reconnectAttempts=0;try{n=await this.handleConnected(),this.fetchUnseenEventsAPI().catch(()=>{})}catch(e){break}this.connected=n,this.updateLastHeartbeat(),this.heartbeatIntervalId&&clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=window.setInterval(()=>{this.heartbeat()},1e4),setTimeout(()=>{this.heartbeat()},100);case ej.CONNECTING:}t!==ej.CONNECTED&&(this.connected=n)}),e.setIncomingDataListener(e=>{var t;switch(e.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{let t="IsLinkedOK"===e.type?e.linked:void 0;this.linked=t||e.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":this.handleSessionMetadataUpdated(e.metadata);break;case"Event":this.handleIncomingEvent(e)}void 0!==e.id&&(null==(t=this.requestResolutions.get(e.id))||t(e))}),e}setupVisibilityChangeHandler(){this.visibilityChangeHandler=()=>{document.hidden||this.destroyed||(this.connected?this.heartbeat():this.reconnectWithFreshWebSocket())},this.focusHandler=()=>{this.destroyed||this.connected||this.reconnectWithFreshWebSocket()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),window.addEventListener("focus",this.focusHandler),window.addEventListener("pageshow",e=>{e.persisted&&this.focusHandler&&this.focusHandler()})}reconnectWithFreshWebSocket(){if(this.destroyed)return;let e=this.ws;this.activeWsInstance=void 0,e.disconnect(),"cleanup"in e&&"function"==typeof e.cleanup&&e.cleanup(),this.ws=this.createWebSocket(),this.ws.connect().catch(()=>{})}connect(){if(this.destroyed)throw Error("instance is destroyed");this.ws.connect()}
vendor: 9,331 bytes, line 1
1async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:D(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.activeWsInstance=void 0,this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=void 0),this.visibilityChangeHandler&&document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.focusHandler&&window.removeEventListener("focus",this.focusHandler),this.ws.disconnect(),"cleanup"in this.ws&&"function"==typeof this.ws.cleanup&&this.ws.cleanup(),this.listener=void 0)}get connected(){return this._connected}set connected(e){this._connected=e}get linked(){return this._linked}set linked(e){var t,n;this._linked=e,e&&(null==(t=this.onceLinked)||t.call(this)),null==(n=this.listener)||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}})}async handleIncomingEvent(e){var t;if("Event"===e.type&&"Web3Response"===e.event)try{let n=await this.cipher.decrypt(e.data),s=JSON.parse(n);if("WEB3_RESPONSE"!==s.type)return;null==(t=this.listener)||t.handleWeb3ResponseMessage(s.id,s.response)}catch(e){}}async checkUnseenEvents(){await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){try{(await this.http.fetchUnseenEvents()).forEach(e=>{this.handleIncomingEvent(e)})}catch(e){}}async publishEvent(e,t,n=!1){let s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin,location:location.href,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:D(this.nextReqId++),sessionId:this.session.id,event:e,data:s,callWebhook:n};return this.setOnceLinked(async()=>{let e=await this.makeRequest(i);if("Fail"===e.type)throw Error(e.error||"failed to publish event");return e.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4)return void this.ws.disconnect();if(this.connected)try{this.ws.sendData("h")}catch(e){}}async makeRequest(e,t={timeout:6e4}){let n,s=e.id;return this.sendData(e),Promise.race([new Promise((e,i)=>{n=window.setTimeout(()=>{i(Error(`request ${s} timed out`))},t.timeout)}),new Promise(e=>{this.requestResolutions.set(s,t=>{clearTimeout(n),e(t),this.requestResolutions.delete(s)})})])}async handleConnected(){return"Fail"!==(await this.makeRequest({type:"HostSession",id:D(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type&&(this.sendData({type:"IsLinked",id:D(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:D(this.nextReqId++),sessionId:this.session.id}),!0)}}class eS{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%0x7fffffff;let e=this._nextRequestId,t=z(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}var ex=n(17883),eM=n(13496);let eA="session:id",eL="session:secret",eD="session:linked";class eT{constructor(e,t,n,s=!1){this.storage=e,this.id=t,this.secret=n,this.key=(0,eM.My)((0,ex.sc)(`${t}, ${n} WalletLink`)),this._linked=!!s}static create(e){return new eT(e,O(16),O(32)).save()}static load(e){let t=e.getItem(eA),n=e.getItem(eD),s=e.getItem(eL);return t&&s?new eT(e,t,s,"1"===n):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(eA,this.id),this.storage.setItem(eL,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(eD,this._linked?"1":"0")}}function eN(){var e,t;return null!=(t=null==(e=null==window?void 0:window.matchMedia)?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)&&t}function eP(){let e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode('@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;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;counter-increment:none;counter-reset:none;direction:ltr;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;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;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";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;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;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;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}')),document.documentElement.appendChild(e)}function eO(){for(var e,t,n=0,s="";n<arguments.length;)(e=arguments[n++])&&(t=function e(t){var n,s,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(s=e(t[n]))&&(i&&(i+=" "),i+=s);else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}(e))&&(s&&(s+=" "),s+=t);return s}var eR,ej,eU,eW,eH,eq,eB,eK,ez,eF,eG,e$,eJ={},eY=[],eV=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,eQ=Array.isArray;function eZ(e,t){for(var n in t)e[n]=t[n];return e}function eX(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function e0(e,t,n){var s,i,r,a={};for(r in t)"key"==r?s=t[r]:"ref"==r?i=t[r]:a[r]=t[r];if(arguments.length>2&&(a.children=arguments.length>3?eU.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(r in e.defaultProps)void 0===a[r]&&(a[r]=e.defaultProps[r]);return e1(e,a,s,i,null)}function e1(e,t,n,s,i){var r={type:e,props:t,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++eH:i,__i:-1,__u:0};return null==i&&null!=eW.vnode&&eW.vnode(r),r}function e2(e){return e.children}function e3(e,t){this.props=e,this.context=t}function e5(e,t){if(null==t)return e.__?e5(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?e5(e):null}function e4(e){(!e.__d&&(e.__d=!0)&&eq.push(e)&&!e8.__r++||eB!==eW.debounceRendering)&&((eB=eW.debounceRendering)||eK)(e8)}function e8(){var e,t,n,s,i,r,a,o;for(eq.sort(ez);e=eq.shift();)e.__d&&(t=eq.length,s=void 0,r=(i=(n=e).__v).__e,a=[],o=[],n.__P&&((s=eZ({},i)).__v=i.__v+1,eW.vnode&&eW.vnode(s),tt(n.__P,s,i,n.__n,n.__P.namespaceURI,32&i.__u?[r]:null,a,null==r?e5(i):r,!!(32&i.__u),o),s.__v=i.__v,s.__.__k[s.__i]=s,tn(a,s,o),s.__e!=r&&function e(t){var n,s;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,n=0;n<t.__k.length;n++)if(null!=(s=t.__k[n])&&null!=s.__e){t.__e=t.__c.base=s.__e;break}return e(t)}}(s)),eq.length>t&&eq.sort(ez));
vendor: 8,492 bytes, line 1
1e8.__r=0}function e6(e,t,n,s,i,r,a,o,c,l,h){var d,u,p,f,g,m=s&&s.__k||eY,y=t.length;for(n.__d=c,function(e,t,n){var s,i,r,a,o,c=t.length,l=n.length,h=l,d=0;for(e.__k=[],s=0;s<c;s++)null!=(i=t[s])&&"boolean"!=typeof i&&"function"!=typeof i?(a=s+d,(i=e.__k[s]="string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?e1(null,i,null,null,null):eQ(i)?e1(e2,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?e1(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=e,i.__b=e.__b+1,r=null,-1!==(o=i.__i=function(e,t,n,s){var i=e.key,r=e.type,a=n-1,o=n+1,c=t[n];if(null===c||c&&i==c.key&&r===c.type&&0==(131072&c.__u))return n;if(s>+(null!=c&&0==(131072&c.__u)))for(;a>=0||o<t.length;){if(a>=0){if((c=t[a])&&0==(131072&c.__u)&&i==c.key&&r===c.type)return a;a--}if(o<t.length){if((c=t[o])&&0==(131072&c.__u)&&i==c.key&&r===c.type)return o;o++}}return -1}(i,n,a,h))&&(h--,(r=n[o])&&(r.__u|=131072)),null==r||null===r.__v?(-1==o&&d--,"function"!=typeof i.type&&(i.__u|=65536)):o!==a&&(o==a-1?d--:o==a+1?d++:(o>a?d--:d++,i.__u|=65536))):i=e.__k[s]=null;if(h)for(s=0;s<l;s++)null!=(r=n[s])&&0==(131072&r.__u)&&(r.__e==e.__d&&(e.__d=e5(r)),function e(t,n,s){var i,r;if(eW.unmount&&eW.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||ts(i,null,n)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){eW.__e(e,n)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&e(i[r],n,s||"function"!=typeof t.type);s||eX(t.__e),t.__c=t.__=t.__e=t.__d=void 0}(r,r))}(n,t,m),c=n.__d,d=0;d<y;d++)null!=(p=n.__k[d])&&(u=-1===p.__i?eJ:m[p.__i]||eJ,p.__i=d,tt(e,p,u,i,r,a,o,c,l,h),f=p.__e,p.ref&&u.ref!=p.ref&&(u.ref&&ts(u.ref,null,p),h.push(p.ref,p.__c||f,p)),null==g&&null!=f&&(g=f),65536&p.__u||u.__k===p.__k?c=function e(t,n,s){var i,r;if("function"==typeof t.type){for(i=t.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=t,n=e(i[r],n,s));return n}t.__e!=n&&(n&&t.type&&!s.contains(n)&&(n=e5(t)),s.insertBefore(t.__e,n||null),n=t.__e);do n=n&&n.nextSibling;while(null!=n&&8===n.nodeType);return n}(p,c,e):"function"==typeof p.type&&void 0!==p.__d?c=p.__d:f&&(c=f.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=c,n.__e=g}function e7(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||eV.test(t)?n:n+"px"}function e9(e,t,n,s,i){var r;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof s&&(e.style.cssText=s=""),s)for(t in s)n&&t in n||e7(e.style,t,"");if(n)for(t in n)s&&n[t]===s[t]||e7(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])r=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?s?n.u=s.u:(n.u=eF,e.addEventListener(t,r?e$:eG,r)):e.removeEventListener(t,r?e$:eG,r);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function te(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=eF++;else if(t.t<n.u)return;return n(eW.event?eW.event(t):t)}}}function tt(e,t,n,s,i,r,a,o,c,l){var h,d,u,p,f,g,m,y,_,b,w,v,k,I,E,C,S=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),r=[o=t.__e=n.__e]),(h=eW.__b)&&h(t);e:if("function"==typeof S)try{if(y=t.props,_="prototype"in S&&S.prototype.render,b=(h=S.contextType)&&s[h.__c],w=h?b?b.props.value:h.__:s,n.__c?m=(d=t.__c=n.__c).__=d.__E:(_?t.__c=d=new S(y,w):(t.__c=d=new e3(y,w),d.constructor=S,d.render=ti),b&&b.sub(d),d.props=y,d.state||(d.state={}),d.context=w,d.__n=s,u=d.__d=!0,d.__h=[],d._sb=[]),_&&null==d.__s&&(d.__s=d.state),_&&null!=S.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=eZ({},d.__s)),eZ(d.__s,S.getDerivedStateFromProps(y,d.__s))),p=d.props,f=d.state,d.__v=t,u)_&&null==S.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),_&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(_&&null==S.getDerivedStateFromProps&&y!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,w),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),v=0;v<d._sb.length;v++)d.__h.push(d._sb[v]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,w),_&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(p,f,g)})}if(d.context=w,d.props=y,d.__P=e,d.__e=!1,k=eW.__r,I=0,_){for(d.state=d.__s,d.__d=!1,k&&k(t),h=d.render(d.props,d.state,d.context),E=0;E<d._sb.length;E++)d.__h.push(d._sb[E]);d._sb=[]}else do d.__d=!1,k&&k(t),h=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(s=eZ(eZ({},s),d.getChildContext())),_&&!u&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(p,f)),e6(e,eQ(C=null!=h&&h.type===e2&&null==h.key?h.props.children:h)?C:[C],t,n,s,i,r,a,o,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(e){if(t.__v=null,c||null!=r){for(t.__u|=c?160:32;o&&8===o.nodeType&&o.nextSibling;)o=o.nextSibling;r[r.indexOf(o)]=null,t.__e=o}else t.__e=n.__e,t.__k=n.__k;eW.__e(e,t,n)}else null==r&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,s,i,r,a,o,c){var l,h,d,u,p,f,g,m=n.props,y=t.props,_=t.type;if("svg"===_?i="http://www.w3.org/2000/svg":"math"===_?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=r){for(l=0;l<r.length;l++)if((p=r[l])&&"setAttribute"in p==!!_&&(_?p.localName===_:3===p.nodeType)){e=p,r[l]=null;break}}if(null==e){if(null===_)return document.createTextNode(y);e=document.createElementNS(i,_,y.is&&y),o&&(eW.__m&&eW.__m(t,r),o=!1),r=null}if(null===_)m===y||o&&e.data===y||(e.data=y);else{if(r=r&&eU.call(e.childNodes),m=n.props||eJ,!o&&null!=r)for(m={},l=0;l<e.attributes.length;l++)m[(p=e.attributes[l]).name]=p.value;for(l in m)if(p=m[l],"children"==l);else if("dangerouslySetInnerHTML"==l)d=p;else if(!(l in y)){if("value"==l&&"defaultValue"in y||"checked"==l&&"defaultChecked"in y)continue;e9(e,l,null,p,i)}for(l in y)p=y[l],"children"==l?u=p:"dangerouslySetInnerHTML"==l?h=p:"value"==l?f=p:"checked"==l?g=p:o&&"function"!=typeof p||m[l]===p||e9(e,l,p,m[l],i);if(h)o||d&&(h.__html===d.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(d&&(e.innerHTML=""),e6(e,eQ(u)?u:[u],t,n,s,"foreignObject"===_?"http://www.w3.org/1999/xhtml":i,r,a,r?r[0]:n.__k&&e5(n,0),o,c),null!=r)for(l=r.length;l--;)eX(r[l]);o||(l="value","progress"===_&&null==f?e.removeAttribute("value"):void 0===f||f===e[l]&&("progress"!==_||f)&&("option"!==_||f===m[l])||e9(e,l,f,m[l],i),l="checked",void 0!==g&&g!==e[l]&&e9(e,l,g,m[l],i))}return e}(n.__e,t,n,s,i,r,a,c,l);(h=eW.diffed)&&h(t)}function tn(e,t,n){t.__d=void 0;for(var s=0;s<n.length;s++)ts(n[s],n[++s],n[++s]);eW.__c&&eW.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){eW.__e(e,t.__v)}})}function ts(e,t,n){try{if("function"==typeof e){var s="function"==typeof e.__u;s&&e.__u(),s&&null==t||(e.__u=e(t))}else e.current=t}catch(e){eW.__e(e,n)}}function ti(e,t,n){return this.constructor(e,n)}function tr(e,t,n){var s,i,r,a;eW.__&&eW.__(e,t),i=(s="function"==typeof n)?null:n&&n.__k||t.__k,r=[],a=[],tt(t,e=(!s&&n||t).__k=e0(e2,null,[e]),i||eJ,eJ,t.namespaceURI,!s&&n?[n]:i?null:t.firstChild?eU.call(t.childNodes):null,r,!s&&n?n:i?i.__e:t.firstChild,s,a),tn(r,e,a)}eU=eY.slice,eW={__e:function(e,t,n,s){for(var i,r,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,s||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},eH=0,e3.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=eZ({},this.state),"function"==typeof e&&(e=e(eZ({},n),this.props)),e&&eZ(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),e4(this))},e3.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),e4(this))},e3.prototype.render=e2,eq=[],eK="function"==typeof Promise?Promise.prototype.then.bind(Prom
vendor: 4,175 bytes, line 1
1ise.resolve()):setTimeout,ez=function(e,t){return e.__v.__b-t.__v.__b},e8.__r=0,eF=0,eG=te(!1),e$=te(!0);var ta,to,tc,tl,th=0,td=[],tu=eW,tp=tu.__b,tf=tu.__r,tg=tu.diffed,tm=tu.__c,ty=tu.unmount,t_=tu.__;function tb(e,t){tu.__h&&tu.__h(to,e,th||t),th=0;var n=to.__H||(to.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function tw(e,t,n){var s=tb(ta++,2);if(s.t=e,!s.__c&&(s.__=[n?n(t):tC(void 0,t),function(e){var t=s.__N?s.__N[0]:s.__[0],n=s.t(t,e);t!==n&&(s.__N=[n,s.__[1]],s.__c.setState({}))}],s.__c=to,!to.u)){var i=function(e,t,n){if(!s.__c.__H)return!0;var i=s.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!r||r.call(this,e,t,n);var a=!1;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}}),!(!a&&s.__c.props===e)&&(!r||r.call(this,e,t,n))};to.u=!0;var r=to.shouldComponentUpdate,a=to.componentWillUpdate;to.componentWillUpdate=function(e,t,n){if(this.__e){var s=r;r=void 0,i(e,t,n),r=s}a&&a.call(this,e,t,n)},to.shouldComponentUpdate=i}return s.__N||s.__}function tv(){for(var e;e=td.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(tI),e.__H.__h.forEach(tE),e.__H.__h=[]}catch(t){e.__H.__h=[],tu.__e(t,e.__v)}}tu.__b=function(e){to=null,tp&&tp(e)},tu.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),t_&&t_(e,t)},tu.__r=function(e){tf&&tf(e),ta=0;var t=(to=e.__c).__H;t&&(tc===to?(t.__h=[],to.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(t.__h.forEach(tI),t.__h.forEach(tE),t.__h=[],ta=0)),tc=to},tu.diffed=function(e){tg&&tg(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==td.push(t)&&tl===tu.requestAnimationFrame||((tl=tu.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(s),tk&&cancelAnimationFrame(t),setTimeout(e)},s=setTimeout(n,100);tk&&(t=requestAnimationFrame(n))})(tv)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),tc=to=null},tu.__c=function(e,t){t.some(function(e){try{e.__h.forEach(tI),e.__h=e.__h.filter(function(e){return!e.__||tE(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],tu.__e(n,e.__v)}}),tm&&tm(e,t)},tu.unmount=function(e){ty&&ty(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{tI(e)}catch(e){t=e}}),n.__H=void 0,t&&tu.__e(t,n.__v))};var tk="function"==typeof requestAnimationFrame;function tI(e){var t=to,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),to=t}function tE(e){var t=to;e.__c=e.__(),to=t}function tC(e,t){return"function"==typeof t?t(e):t}class tS{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=eN()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){let t=this.nextItemKey++;return this.items.set(t,e),this.render(),()=>{this.items.delete(t),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&tr(e0("div",null,e0(tx,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,t])=>e0(tM,Object.assign({},t,{key:e}))))),this.root)}}let tx=e=>e0("div",{class:eO("-cbwsdk-snackbar-container")},e0("style",null,".-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;
1cursor: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}"),e0("div",{class:"-cbwsdk-snackbar"},e.children)),tM=({autoExpand:e,message:t,menuItems:n})=>{var s,i,r,a;let[o,c]=(th=1,tw(tC,!0)),[l,h]=(th=1,tw(tC,null!=e&&e));return s=()=>{let e=[window.setTimeout(()=>{c(!1)},1),window.setTimeout(()=>{h(!0)},1e4)];return()=>{e.forEach(window.clearTimeout)}},i=tb(ta++,3),!tu.__s&&(r=i.__H,a=void 0,!r||r.length!==a.length||a.some(function(e,t){return e!==r[t]}))&&(i.__=s,i.i=void 0,to.__H.__h.push(i)),e0("div",{class:eO("-cbwsdk-snackbar-instance",o&&"-cbwsdk-snackbar-instance-hidden",l&&"-cbwsdk-snackbar-instance-expanded")},e0("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{h(!l)}},e0("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",e0("div",{class:"-cbwsdk-snackbar-instance-header-message"},t),e0("div",{class:"-gear-container"},!l&&e0("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e0("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),e0("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwu
1NTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),n&&n.length>0&&e0("div",{class:"-cbwsdk-snackbar-instance-menu"},n.map((e,t)=>e0("div",{class:eO("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},e0("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e0("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),e0("span",{class:eO("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info)))))},tA="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";class tL{constructor(){this.attached=!1,this.snackbar=new tS}attach(){if(this.attached)throw Error("Coinbase Wallet SDK UI is already attached");let e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.snackbar.attach(t),this.attached=!0,eP()}showConnecting(e){let t;return t=e.isUnlinkedErrorState?{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}]}:{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:tA,defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}}class tD{constructor(){this.root=null,this.darkMode=eN()}attach(){let e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),eP()}present(e){this.render(e)}clear(){this.render(null)}render(e){!this.root||(tr(null,this.root),e&&tr(e0(tT,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}let tT=({title:e,buttonText:t,darkMode:n,onButtonClick:s,onDismiss:i})=>e0(tx,{darkMode:n},e0("div",{class:"-cbwsdk-redirect-dialog"},e0("style",null,".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}
1.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}"),e0("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),e0("div",{class:eO("-cbwsdk-redirect-dialog-box",n?"dark":"light")},e0("p",null,e),e0("button",{onClick:s},t)))),tN="https://www.walletlink.org";class tP{constructor(){this.attached=!1,this.redirectDialog=new tD}attach(){if(this.attached)throw Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){let t=new URL("https://go.cb-w.com/walletlink");t.searchParams.append("redirect_url",function(){try{if(function(){try{return null!==window.frameElement}catch(e){return!1}}()&&window.top)return window.top.location;return window.location}catch(e){return window.location}}().href),e&&t.searchParams.append("wl_url",e);let n=document.createElement("a");n.target="cbw-opener",n.href=t.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectToCoinbaseWallet(e),setTimeout(()=>{this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}})},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class tO{constructor(e){this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.isMobileWeb=function(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(null==(e=null==window?void 0:window.navigator)?void 0:e.userAgent)}(),this.linkedUpdated=e=>{this.isLinked=e;let t=this.storage.getItem(ew);if(e&&(this._session.linked=e),this.isUnlinkedErrorState=!1,t){let n=t.split(" "),s="true"===this.storage.getItem("IsStandaloneSigning");""===n[0]||e||!this._session.linked||s||(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(e,t)=>{this.storage.setItem(e,t)},this.chainUpdated=(e,t)=>{(this.chainCallbackParams.chainId!==e||this.chainCallbackParams.jsonRpcUrl!==t)&&(this.chainCallbackParams={chainId:e,jsonRpcUrl:t},this.chainCallback&&this.chainCallback(t,Number.parseInt(e,10)))},this.accountUpdated=e=>{this.accountsCallback&&this.accountsCallback([e]),tO.accountRequestCallbackIds.size>0&&(Array.from(tO.accountRequestCallbackIds.values()).forEach(t=>{this.invokeCallback(t,{method:"requestEthereumAccounts",result:[e]})}),tO.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.metadata=e.metadata,this.accountsCallback=e.accountsCallback,this.chainCallback=e.chainCallback;const{session:t,ui:n,connection:s}=this.subscribe();this._session=t,this.connection=s,this.relayEventManager=new eS,this.ui=n,this.ui.attach()}subscribe(){let e=eT.load(this.storage)||eT.create(this.storage),{linkAPIUrl:t}=this,n=new eC({session:e,linkAPIUrl:t,listener:this}),s=this.isMobileWeb?new tP:new tL;return n.connect(),{session:e,ui:s,connection:n}}resetAndReload(){this.connection.destroy().then(()=>{let e=eT.load(this.storage);(null==e?void 0:e.id)===this._session.id&&a.clearAll(),document.location.reload()}).catch(e=>{})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:H(e.weiValue),data:U(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?H(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?H(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?H(e.gasPriceInWei):null,gasLimit:e.gasLim
vendor: 12,609 bytes, lines 1-3
1it?H(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:H(e.weiValue),data:U(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?H(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?H(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?H(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?H(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:U(e,!0),chainId:t}})}getWalletLinkSession(){return this._session}sendRequest(e){let t=null,n=O(8),s=s=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,s),null==t||t()};return new Promise((i,r)=>{t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,e=>{if(null==t||t(),ev(e))return r(Error(e.errorMessage));i(e)}),this.publishWeb3RequestEvent(n,e)})}publishWeb3RequestEvent(e,t){let n={type:"WEB3_REQUEST",id:e,request:t};this.publishEvent("Web3Request",n,!0).then(e=>{}).catch(e=>{this.handleWeb3ResponseMessage(n.id,{method:t.method,errorMessage:e.message})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(t.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof tP)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink()}}publishWeb3RequestCanceledEvent(e){this.publishEvent("Web3RequestCanceled",{type:"WEB3_REQUEST_CANCELED",id:e},!1).then()}publishEvent(e,t,n){return this.connection.publishEvent(e,t,n)}handleWeb3ResponseMessage(e,t){if("requestEthereumAccounts"===t.method){tO.accountRequestCallbackIds.forEach(e=>this.invokeCallback(e,t)),tO.accountRequestCallbackIds.clear();return}this.invokeCallback(e,t)}handleErrorResponse(e,t,n){var s;let i=null!=(s=null==n?void 0:n.message)?s:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:t,errorMessage:i})}invokeCallback(e,t){let n=this.relayEventManager.callbacks.get(e);n&&(n(t),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){let{appName:e,appLogoUrl:t}=this.metadata,n={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:t}},s=O(8);return new Promise((e,t)=>{this.relayEventManager.callbacks.set(s,n=>{if(ev(n))return t(Error(n.errorMessage));e(n)}),tO.accountRequestCallbackIds.add(s),this.publishWeb3RequestEvent(s,n)})}watchAsset(e,t,n,s,i,r){let a={method:"watchAsset",params:{type:e,options:{address:t,symbol:n,decimals:s,image:i},chainId:r}},o=null,c=O(8),l=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,a.method,e),null==o||o()};return o=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}),new Promise((e,t)=>{this.relayEventManager.callbacks.set(c,n=>{if(null==o||o(),ev(n))return t(Error(n.errorMessage));e(n)}),this.publishWeb3RequestEvent(c,a)})}addEthereumChain(e,t,n,s,i,r){let a={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:s,chainName:i,iconUrls:n,nativeCurrency:r}},o=null,c=O(8),l=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,a.method,e),null==o||o()};return o=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}),new Promise((e,t)=>{this.relayEventManager.callbacks.set(c,n=>{if(null==o||o(),ev(n))return t(Error(n.errorMessage));e(n)}),this.publishWeb3RequestEvent(c,a)})}switchEthereumChain(e,t){let n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})},s=null,i=O(8),r=e=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,e),null==s||s()};return s=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:r,onResetConnection:this.resetAndReload}),new Promise((e,t)=>{this.relayEventManager.callbacks.set(i,n=>(null==s||s(),ev(n)&&n.errorCode)?t(C({code:n.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):ev(n)?t(Error(n.errorMessage)):void e(n)),this.publishWeb3RequestEvent(i,n)})}}tO.accountRequestCallbackIds=new Set;var tR=n(86141).hp;let tj="DefaultChainId",tU="DefaultJsonRpcUrl";class tW{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new a("walletlink",tN),this.callback=e.callback||null;const t=this._storage.getItem(ew);if(t){const e=t.split(" ");""!==e[0]&&(this._addresses=e.map(e=>$(e)))}this.initializeRelay()}getSession(){let{id:e,secret:t}=this.initializeRelay().getWalletLinkSession();return{id:e,secret:t}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return null!=(e=this._storage.getItem(tU))?e:void 0}set jsonRpcUrl(e){this._storage.setItem(tU,e)}updateProviderInfo(e,t){var n;this.jsonRpcUrl=e;let s=this.getChainId();this._storage.setItem(tj,t.toString(10)),Y(t)!==s&&(null==(n=this.callback)||n.call(this,"chainChanged",q(t)))}async watchAsset(e){let t=Array.isArray(e)?e[0]:e;if(!t.type)throw b("Type is required");if((null==t?void 0:t.type)!=="ERC20")throw b(`Asset of type '${t.type}' is not supported`);if(!(null==t?void 0:t.options))throw b("Options are required");if(!(null==t?void 0:t.options.address))throw b("Address is required");let n=this.getChainId(),{address:s,symbol:i,image:r,decimals:a}=t.options,o=this.initializeRelay(),c=await o.watchAsset(t.type,s,i,a,r,null==n?void 0:n.toString());return!ev(c)&&!!c.result}async addEthereumChain(e){var t,n;let s=e[0];if((null==(t=s.rpcUrls)?void 0:t.length)===0)throw b("please pass in at least 1 rpcUrl");if(!s.chainName||""===s.chainName.trim())throw b("chainName is a required field");if(!s.nativeCurrency)throw b("nativeCurrency is a required field");let i=Number.parseInt(s.chainId,16);if(i===this.getChainId())return!1;let r=this.initializeRelay(),{rpcUrls:a=[],blockExplorerUrls:o=[],chainName:c,iconUrls:l=[],nativeCurrency:h}=s,d=await r.addEthereumChain(i.toString(),a,l,o,c,h);if(ev(d))return!1;if((null==(n=d.result)?void 0:n.isApproved)===!0)return this.updateProviderInfo(a[0],i),null;throw w("unable to add ethereum chain")}async switchEthereumChain(e){let t=Number.parseInt(e[0].chainId,16),n=this.initializeRelay(),s=await n.switchEthereumChain(t.toString(10),this.selectedAddress||void 0);if(ev(s))throw s;let i=s.result;return i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,t),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,t){var n;if(!Array.isArray(e))throw Error("addresses is not an array");let s=e.map(e=>$(e));JSON.stringify(s)!==JSON.stringify(this._addresses)&&(this._addresses=s,null==(n=this.callback)||n.call(this,"accountsChanged",s),this._storage.setItem(ew,s.join(" ")))}async request(e){let t=e.params||[];switch(e.method){case"eth_accounts":return[...this._addresses];case"eth_coinbase":return this.selectedAddress||null;case"net_version":return this.getChainId().toString(10);case"eth_chainId":return q(this.getChainId());case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_ecRecover":case"personal_ecRecover":return this.ecRecover(e);case"personal_sign":return this.personalSign(e);case"eth_signTransaction":return this._eth_signTransaction(t);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(t);case"eth_sendTransaction":return this._eth_sendTransaction(t);case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":return this.signTypedData(e);case"wallet_addEthereumChain":return this.addEthereumChain(t);case"wallet_switchEthereumChain":return this.switchEthereumChain(t);case"wallet_watchAsset":return this.watchAsset(t);default:if(!this.jsonRpcUrl)throw w("No RPC URL set for chain");return ep(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){let t=$(e);if(!this._addresses.map(e=>$(e)).includes(t))throw Error("Unknown Ethereum address")}_prepareTransactionParams(e){let t=e.from?$(e.from):this.selectedAddress;if(!t)throw Error("Ethereum address is unavailable");this._ensureKnownAddress(t);let n=e.to?$(e.to):null,s=null!=e.value?V(e.value):BigInt(0),i=e.data?J(e.data):tR.alloc(0),r=null!=e.nonce?Y(e.nonce):null,a=null!=e.gasPrice?V(e.gasPrice):null,o=null!=e.maxFeePerGas?V(e.maxFeePerGas):null,c=null!=e.maxPriorityFeePerGas?V(e.maxPriorityFeePerGas):null;return{fromAddress:t,toAddress:n,weiValue:s,data:i,nonce:r,gasPriceInWei:a,maxFeePerGas:o,maxPriorityFeePerGas:c,gasLimit:null!=e.gas?V(e.gas):null,chainId:e.chainId?Y(e.chainId):this.getChainId()}}async ecRecover(e){let{method:t,params:n}=e;if(!Array.isArray(n))throw b();let s=this.initializeRelay(),i=await s.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:W(n[0]),signature:W(n[1]),addPrefix:"personal_ecRecover"===t}});if(ev(i))throw i;return i.result}getChainId(){var e;return Number.parseInt(null!=(e=this._storage.getItem(tj))?e:"1",10)}async _eth_requestAccounts(){var e,t;if(this._addresses.length>0)return null==(e=this.callback)||e.call(this,"connect",{chainId:q(this.getChainId())}),this._addresses;let n=this.initializeRelay(),s=await n.requestEthereumAccounts();if(ev(s))throw s;if(!s.result)throw Error("accounts received is empty");return this._setAddresses(s.result),null==(t=this.callback)||t.call(this,"connect",{chainId:q(this.getChainId())}),this._addresses}async personalSign({params:e}){if(!Array.isArray(e))throw b();let t=e[1],n=e[0];this._ensureKnownAddress(t);let s=this.initializeRelay(),i=await s.sendRequest({method:"signEthereumMessage",params:{address:$(t),message:W(n),addPrefix:!0,typedDataJson:null}});if(ev(i))throw i;return i.result}async _eth_signTransaction(e){let t=this._prepareTransactionParams(e[0]||{}),n=this.initializeRelay(),s=await n.signEthereumTransaction(t);if(ev(s))throw s;return s.result}async _eth_sendRawTransaction(e){let t=J(e[0]),n=this.initializeRelay(),s=await n.submitEthereumTransaction(t,this.getChainId());if(ev(s))throw s;return s.result}async _eth_sendTransaction(e){let t=this._prepareTransactionParams(e[0]||{}),n=this.initializeRelay(),s=await n.signAndSubmitEthereumTransaction(t);if(ev(s))throw s;return s.result}async signTypedData(e){let{method:t,params:n}=e;if(!Array.isArray(n))throw b();let s=n[+("eth_signTypedData_v1"===t)],i=n[+("eth_signTypedData_v1"!==t)];this._ensureKnownAddress(s);let r=this.initializeRelay(),a=await r.sendRequest({method:"signEthereumMessage",params:{address:$(s),message:U(({eth_signTypedData_v1:eb.hashForSignTypedDataLegacy,eth_signTypedData_v3:eb.hashForSignTypedData_v3,eth_signTypedData_v4:eb.hashForSignTypedData_v4,eth_signTypedData:eb.hashForSignTypedData_v4})[t]({data:function(e){if("string"==typeof e)return JSON.parse(e);if("object"==typeof e)return e;throw b(`Not a JSON string or an object: ${String(e)}`)}(i)}),!0),typedDataJson:JSON.stringify(i,null,2),addPrefix:!1}});if(ev(a))throw a;return a.result}initializeRelay(){return this._relay||(this._relay=new tO({linkAPIUrl:tN,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}let tH="SignerType",tq=new a("CBWSDK","SignerConfigurator");async function tB(e){let{communicator:t,metadata:n,handshakeRequest:s,callback:i}=e;tK(t,n,i).catch(()=>{});let r={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},e.preference),{handshakeRequest:s})},{data:a}=await t.postRequestAndWaitForResponse(r);return a}async function tK(e,t,n){await e.onMessage(({event:e})=>"WalletLinkSessionRequest"===e);let s=new tW({metadata:t,callback:n});e.postMessage({event:"WalletLinkUpdate",data:{session:s.getSession()}}),await s.handshake(),e.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}let tz=`Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app. 2 3Please see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.`,{checkCrossOriginOpenerPolicy:tF,getCrossOriginOpenerPolicy:tG}={getCrossOriginOpenerPolicy:()=>void 0===s?"undefined":s,checkCrossOriginOpenerPolicy:async()=>
vendor: 5,216 bytes, line 3
3{if("undefined"==typeof window){s="non-browser-env";return}try{let e=`${window.location.origin}${window.location.pathname}`,t=await fetch(e,{method:"HEAD"});if(!t.ok)throw Error(`HTTP error! status: ${t.status}`);let n=t.headers.get("Cross-Origin-Opener-Policy");s=null!=n?n:"null","same-origin"===s&&console.error(tz)}catch(e){console.error("Error checking Cross-Origin-Opener-Policy:",e.message),s="error"}}},t$={isRed:!1,info:"Retry",svgWidth:"10",svgHeight:"11",path:tA,defaultFillRule:"evenodd",defaultClipRule:"evenodd"},tJ=null;class tY{constructor({url:e="https://keys.coinbase.com/connect",metadata:t,preference:n}){this.popup=null,this.listeners=new Map,this.postMessage=async e=>{(await this.waitForPopupLoaded()).postMessage(e,this.url.origin)},this.postRequestAndWaitForResponse=async e=>{let t=this.onMessage(({requestId:t})=>t===e.id);return this.postMessage(e),await t},this.onMessage=async e=>new Promise((t,n)=>{let s=n=>{if(n.origin!==this.url.origin)return;let i=n.data;e(i)&&(t(i),window.removeEventListener("message",s),this.listeners.delete(s))};window.addEventListener("message",s),this.listeners.set(s,{reject:n})}),this.disconnect=()=>{var e;(e=this.popup)&&!e.closed&&e.close(),this.popup=null,this.listeners.forEach(({reject:e},t)=>{e(v("Request rejected")),window.removeEventListener("message",t)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=await function(e){let t=(window.innerWidth-420)/2+window.screenX,n=(window.innerHeight-540)/2+window.screenY;function s(){let s=`wallet_${crypto.randomUUID()}`,i=window.open(e,s,`width=420, height=540, left=${t}, top=${n}`);return(null==i||i.focus(),i)?i:null}var i=e;for(let[e,t]of Object.entries({sdkName:eu,sdkVersion:ed,origin:window.location.origin,coop:tG()}))i.searchParams.append(e,t.toString());let r=s();if(!r){let e=function(){if(!tJ){let e=document.createElement("div");e.className="-cbwsdk-css-reset",document.body.appendChild(e),(tJ=new tS).attach(e)}return tJ}();return new Promise((t,n)=>{e.presentItem({autoExpand:!0,message:"Popup was blocked. Try again.",menuItems:[Object.assign(Object.assign({},t$),{onClick:()=>{(r=s())?t(r):n(w("Popup window was blocked")),e.clear()}})]})})}return Promise.resolve(r)}(this.url),this.onMessage(({event:e})=>"PopupUnload"===e).then(this.disconnect).catch(()=>{}),this.onMessage(({event:e})=>"PopupLoaded"===e).then(e=>{this.postMessage({requestId:e.id,data:{version:ed,metadata:this.metadata,preference:this.preference,location:window.location.toString()}})}).then(()=>{if(!this.popup)throw w();return this.popup})),this.url=new URL(e),this.metadata=t,this.preference=n}}var tV=n(4215);class tQ extends tV.b{}var tZ=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&0>t.indexOf(s)&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)0>t.indexOf(s[i])&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]]);return n};class tX extends tQ{constructor(e){var{metadata:t}=e,n=e.preference,{keysUrl:s}=n,i=tZ(n,["keysUrl"]);super(),this.signer=null,this.isCoinbaseWallet=!0,this.metadata=t,this.preference=i,this.communicator=new tY({url:s,metadata:t,preference:i});const r=tq.getItem(tH);r&&(this.signer=this.initSigner(r))}async request(e){try{if(!function(e){if(!e||"object"!=typeof e||Array.isArray(e))throw b({message:"Expected a single, non-array, object argument.",data:e});let{method:t,params:n}=e;if("string"!=typeof t||0===t.length)throw b({message:"'args.method' must be a non-empty string.",data:e});if(void 0!==n&&!Array.isArray(n)&&("object"!=typeof n||null===n))throw b({message:"'args.params' must be an object or array if provided.",data:e});switch(t){case"eth_sign":case"eth_signTypedData_v2":case"eth_subscribe":case"eth_unsubscribe":throw I()}}(e),!this.signer)switch(e.method){case"eth_requestAccounts":{let t=await this.requestSignerSelection(e),n=this.initSigner(t);await n.handshake(e),this.signer=n,tq.setItem(tH,t);break}case"wallet_sendCalls":{let t=this.initSigner("scw");await t.handshake({method:"handshake"});let n=await t.request(e);return await t.cleanup(),n}case"wallet_getCallsStatus":return ep(e,"https://rpc.wallet.coinbase.com");case"net_version":return 1;case"eth_chainId":return q(1);default:throw k("Must call 'eth_requestAccounts' before other methods")}return await this.signer.request(e)}catch(s){let e,t,{code:n}=s;return n===h&&this.disconnect(),Promise.reject((e=function(e,{shouldIncludeStack:t=!1}={}){var n,s;let i={};if(e&&"object"==typeof e&&!Array.isArray(e)&&y(e,"code")&&Number.isInteger(n=e.code)&&(p[n.toString()]||(s=n)>=-32099&&s<=-32e3))i.code=e.code,e.message&&"string"==typeof e.message?(i.message=e.message,y(e,"data")&&(i.data=e.data)):(i.message=g(i.code),i.data={originalError:m(e)});else i.code=c,i.message=_(e,"message")?e.message:f,i.data={originalError:m(e)};return t&&(i.stack=_(e,"stack")?e.stack:void 0),i}(function(e){var t;if("string"==typeof e)return{message:e,code:c};if(ev(e)){let n=e.errorMessage,s=null!=(t=e.errorCode)?t:n.match(/(denied|rejected)/i)?l:void 0;return Object.assign(Object.assign({}
3,e),{message:n,code:s,data:{method:e.method}})}return e}(s),{shouldIncludeStack:!0}),(t=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors")).searchParams.set("version",ed),t.searchParams.set("code",e.code.toString()),t.searchParams.set("message",e.message),Object.assign(Object.assign({},e),{docUrl:t.href})))}}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){var e;await (null==(e=this.signer)?void 0:e.cleanup()),this.signer=null,a.clearAll(),this.emit("disconnect",E("User initiated disconnection"))}requestSignerSelection(e){return tB({communicator:this.communicator,preference:this.preference,metadata:this.metadata,handshakeRequest:e,callback:this.emit.bind(this)})}initSigner(e){return function(e){let{signerType:t,metadata:n,communicator:s,callback:i}=e;switch(t){case"scw":return new e_({metadata:n,callback:i,communicator:s});case"walletlink":return new tW({metadata:n,callback:i})}}({signerType:e,metadata:this.metadata,communicator:this.communicator,callback:this.emit.bind(this)})}}let t0={options:"all"};function t1(e){new a("CBWSDK").setItem("VERSION",ed),tF();let t={metadata:{appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||"",appChainIds:e.appChainIds||[]},preference:Object.assign(t0,null!=(n=e.preference)?n:{})};var n,s=t.preference;if(s){if(!["all","smartWalletOnly","eoaOnly"].includes(s.options))throw Error(`Invalid options: ${s.options}`);if(s.attribution&&void 0!==s.attribution.auto&&void 0!==s.attribution.dataSuffix)throw Error("Attribution cannot contain both auto and dataSuffix properties")}let i=null;return{getProvider:()=>{var e;let n;return i||(i=null!=(e=function({metadata:e,preference:t}){var n,s;let{appName:i,appLogoUrl:r,appChainIds:a}=e;if("smartWalletOnly"!==t.options){let e=globalThis.coinbaseWalletExtension;if(e)return null==(n=e.setAppInfo)||n.call(e,i,r,a,t),e}let o=function(){var e,t;try{let n=globalThis;return null!=(t=null==(e=n.top)?void 0:e.ethereum)?t:n.ethereum}catch(e){return}}();if(null==o?void 0:o.isCoinbaseBrowser)return null==(s=o.setAppInfo)||s.call(o,i,r,a,t),o}(n={metadata:t.metadata,preference:t.preference}))?e:new tX(n)),i}}}},46807:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.Hash=t.nextTick=t.swap32IfBE=t.byteSwapIfBE=t.swap8IfBE=t.isLE=void 0,t.isBytes=i,t.anumber=r,t.abytes=a,t.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");r(e.outputLen),r(e.blockLen)},t.aexists=function(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")},t.aoutput=function(e,t){a(e);let n=t.outputLen;if(e.length<n)throw Error("digestInto() expects output buffer of length at least "+n)},t.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},t.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},t.clean=function(...e){for(let t=0;t<e.length;t++)e[t].fill(0)},t.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},t.rotr=function(e,t){return e<<32-t|e>>>t},t.rotl=function(e,t){return e<<t|e>>>32-t>>>0},t.byteSwap=o,t.byteSwap32=c,t.bytesToHex=function(e){if(a(e),l)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=h[e[n]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(l)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let s=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=d(e.charCodeAt(i)),r=d(e.charCodeAt(i+1));if(void 0===n||void 0===r)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);s[t]=16*n+r}return s},t.asyncLoop=u,t.utf8ToBytes=p,t.bytesToUtf8=function(e){return new TextDecoder().decode(e)},t.toBytes=f,t.kdfInputToBytes=function(e){return"string"==typeof e&&(e=p(e)),a(e),e},t.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){let s=e[n];a(s),t+=s.length}let n=new Uint8Array(t);for(let t=0,s=0;t<e.length;t++){let i=e[t];n.set(i,s),s+=i.length}return n},t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==({}).toString.call(t))throw Error("options should be object or undefined");return Object.assign(e,t)},t.createHasher=m,t.createOptHasher=y,t.createXOFer=_,t.randomBytes=function(e=32){if(s.crypto&&"function"==typeof s.crypto.getRandomValues)return s.crypto.getRandomValues(new Uint8Array(e));if(s.crypto&&"function"==typeof s.crypto.randomBytes)return Uint8Array.from(s.crypto.randomBytes(e));throw Error("crypto.getRandomValues must be defined")};let s=n(3155);function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function a(e,...t){if(!i(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function o(e){return e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}function c(e){for(let t=0;t<e.length;t++)e[t]=o(e[t]);return e}t.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],t.swap8IfBE=t.isLE?e=>e:e=>o(e),t.byteSwapIfBE=t.swap8IfBE,t.swap32IfBE=t.isLE?e=>e:c;let l="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,h=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function d(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}async function u(e,n,s){let i=Date.now();for(let r=0;r<e;r++){s(r);let e=Date.now()-i;e>=0&&e<n||(await (0,t.nextTick)(),i+=e)}}function p(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function f(e){return"string"==typeof e&&(e=p(e)),a(e),e}t.nextTick=async()=>{};class g{}function m(e){let t=t=>e().update(f(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function y(e){let t=(t,n)=>e(n).update(f(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}function _(e){let t=(t,n)=>e(n).update(f(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}t.Hash=g,t.wrapConstructor=m,t.wrapConstructorWithOpts=y,t.wrapXOFConstructorWithOpts=_},91663:(e,t,n)=>{var s=n(86141).hp;let i=n(37569);function r(e){if(e.startsWith("int["))return"int256"+e.slice(3);if("int"===e)return"int256";if(e.startsWith("uint["))return"uint256"+e.slice(4);if("uint"===e)return"uint256";if(e.startsWith("fixed["))return"fixed128x128"+e.slice(5);else if("fixed"===e)return"fixed128x128";else if(e.startsWith("ufixed["))return"ufixed128x128"+e.slice(6);else if("ufixed"===e)return"ufixed128x128";return e}function a(e){return Number.parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function o(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[Number.parseInt(t[1],10),Number.parseInt(t[2],10)]}function c(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":Number.parseInt(t[2],10):null}function l(e){var t=typeof e;if("string"===t||"number"===t)return BigInt(e);if("bigint"===t)return e;throw Error("Argument is not a number")}function h(e,t){if("address"===e)return h("uint160",l(t));if("bool"===e)return h("uint8",+!!t);if("string"===e)return h("bytes",new s(t,"utf8"));if((p=e).lastIndexOf("]")===p.length-1){if(void 0===t.length)throw Error("Not an array?");if("dynamic"!==(n=c(e))&&0!==n&&t.length>n)throw Error("Elements exceed array size: "+n);for(u in d=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)d.push(h(e,t[u]));if("dynamic"===n){var n,r,d,u,p,f=h("uint256",t.length);d.unshift(f)}return s.concat(d)}else if("bytes"===e)return t=new s(t),d=s.concat([h("uint256",t.length),t]),t.length%32!=0&&(d=s.
vendor: 5,417 bytes, line 3
3concat([d,i.zeros(32-t.length%32)])),d;else if(e.startsWith("bytes")){if((n=a(e))<1||n>32)throw Error("Invalid bytes<N> width: "+n);return i.setLengthRight(t,32)}else if(e.startsWith("uint")){if((n=a(e))%8||n<8||n>256)throw Error("Invalid uint<N> width: "+n);r=l(t);let s=i.bitLengthFromBigInt(r);if(s>n)throw Error("Supplied uint exceeds width: "+n+" vs "+s);if(r<0)throw Error("Supplied uint is negative");return i.bufferBEFromBigInt(r,32)}else if(e.startsWith("int")){if((n=a(e))%8||n<8||n>256)throw Error("Invalid int<N> width: "+n);r=l(t);let s=i.bitLengthFromBigInt(r);if(s>n)throw Error("Supplied int exceeds width: "+n+" vs "+s);let o=i.twosFromBigInt(r,256);return i.bufferBEFromBigInt(o,32)}else if(e.startsWith("ufixed")){if(n=o(e),(r=l(t))<0)throw Error("Supplied ufixed is negative");return h("uint256",r*BigInt(2)**BigInt(n[1]))}else if(e.startsWith("fixed"))return n=o(e),h("int256",l(t)*BigInt(2)**BigInt(n[1]));throw Error("Unsupported or invalid type: "+e)}function d(e,t){if(e.length!==t.length)throw Error("Number of types are not matching the values");for(var n,o,c=[],h=0;h<e.length;h++){var d=r(e[h]),u=t[h];if("bytes"===d)c.push(u);else if("string"===d)c.push(new s(u,"utf8"));else if("bool"===d)c.push(new s(u?"01":"00","hex"));else if("address"===d)c.push(i.setLength(u,20));else if(d.startsWith("bytes")){if((n=a(d))<1||n>32)throw Error("Invalid bytes<N> width: "+n);c.push(i.setLengthRight(u,n))}else if(d.startsWith("uint")){if((n=a(d))%8||n<8||n>256)throw Error("Invalid uint<N> width: "+n);o=l(u);let e=i.bitLengthFromBigInt(o);if(e>n)throw Error("Supplied uint exceeds width: "+n+" vs "+e);c.push(i.bufferBEFromBigInt(o,n/8))}else if(d.startsWith("int")){if((n=a(d))%8||n<8||n>256)throw Error("Invalid int<N> width: "+n);o=l(u);let e=i.bitLengthFromBigInt(o);if(e>n)throw Error("Supplied int exceeds width: "+n+" vs "+e);let t=i.twosFromBigInt(o,n);c.push(i.bufferBEFromBigInt(t,n/8))}else throw Error("Unsupported or invalid type: "+d)}return s.concat(c)}e.exports={rawEncode:function(e,t){var n=[],i=[],a=32*e.length;for(var o in e){var l=r(e[o]),d=h(l,t[o]);"string"===l||"bytes"===l||"dynamic"===c(l)?(n.push(h("uint256",a)),i.push(d),a+=d.length):n.push(d)}return s.concat(n.concat(i))},solidityPack:d,soliditySHA3:function(e,t){return i.keccak(d(e,t))}}},97813:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=void 0,t.keccakP=b;let s=n(17924),i=n(46807),r=BigInt(0),a=BigInt(1),o=BigInt(2),c=BigInt(7),l=BigInt(256),h=BigInt(113),d=[],u=[],p=[];for(let e=0,t=a,n=1,s=0;e<24;e++){[n,s]=[s,(2*n+3*s)%5],d.push(2*(5*s+n)),u.push((e+1)*(e+2)/2%64);let i=r;for(let e=0;e<7;e++)(t=(t<<a^(t>>c)*h)%l)&o&&(i^=a<<(a<<BigInt(e))-a);p.push(i)}let f=(0,s.split)(p,!0),g=f[0],m=f[1],y=(e,t,n)=>n>32?(0,s.rotlBH)(e,t,n):(0,s.rotlSH)(e,t,n),_=(e,t,n)=>n>32?(0,s.rotlBL)(e,t,n):(0,s.rotlSL)(e,t,n);function b(e,t=24){let n=new Uint32Array(10);for(let s=24-t;s<24;s++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let s=(t+8)%10,i=(t+2)%10,r=n[i],a=n[i+1],o=y(r,a,1)^n[s],c=_(r,a,1)^n[s+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){let s=u[n],r=y(t,i,s),a=_(t,i,s),o=d[n];t=e[o],i=e[o+1],e[o]=r,e[o+1]=a}for(let t=0;t<50;t+=10){for(let s=0;s<10;s++)n[s]=e[t+s];for(let s=0;s<10;s++)e[t+s]^=~n[(s+2)%10]&n[(s+4)%10]}e[0]^=g[s],e[1]^=m[s]}(0,i.clean)(n)}class w extends i.Hash{constructor(e,t,n,s=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=r,(0,i.anumber)(n),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,i.swap32IfBE)(this.state32),b(this.state32,this.rounds),(0,i.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(e){(0,i.aexists)(this),e=(0,i.toBytes)(e),(0,i.abytes)(e);let{blockLen:t,state:n}=this,s=e.length;for(let i=0;i<s;){let r=Math.min(t-this.pos,s-i);for(let t=0;t<r;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(128&t)!=0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){(0,i.aexists)(this,!1),(0,i.abytes)(e),this.finish();let t=this.state,{blockLen:n}=this;for(let s=0,i=e.length;s<i;){this.posOut>=n&&this.keccak();let r=Math.min(n-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+r),s),this.posOut+=r,s+=r}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,i.anumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,i.aoutput)(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,i.clean)(this.state)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:s,rounds:i,enableXOF:r}=this;return e||(e=new w(t,n,s,r,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=r,e.destroyed=this.destroyed,e}}t.Keccak=w;
3let v=(e,t,n)=>(0,i.createHasher)(()=>new w(t,e,n));t.sha3_224=v(6,144,28),t.sha3_256=v(6,136,32),t.sha3_384=v(6,104,48),t.sha3_512=v(6,72,64),t.keccak_224=v(1,144,28),t.keccak_256=v(1,136,32),t.keccak_384=v(1,104,48),t.keccak_512=v(1,72,64);let k=(e,t,n)=>(0,i.createXOFer)((s={})=>new w(t,e,void 0===s.dkLen?n:s.dkLen,!0));t.shake128=k(31,168,16),t.shake256=k(31,136,32)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.