1import{e as nc,b as qi,i as dt,r as ic,c as B,d as Gi,g as wr,t as mp,f as wp,a as _p}from"./index-345b6be1.js";import{p as Sp,h as Ep}from"./hooks.module-a59256f8.js";function Cp(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var sc={},Pn={},Ji={};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.walletLogo=void 0;const xp=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3
1V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7
1h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Ji.walletLogo=xp;var Qi={};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.ScopedLocalStorage=void 0;class Ip{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(e)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}Qi.ScopedLocalStorage=Ip;var Gr={},_r={};Object.defineProperty(_r,"__esModule",{value:!0});const Rp=nc;function du(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function Ap(t){const e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}let Mp=class extends Rp.EventEmitter{emit(e,...r){let n=e==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")du(s,this,r);else{const o=s.length,a=Ap(s);for(let c=0;c<o;c+=1)du(a[c],this,r)}return!0}};_r.default=Mp;var cn={};Object.defineProperty(cn,"__esModule",{value:!0});cn.EVENTS=void 0;cn.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Hn={},oc={},Qt={},kp=Dn;Dn.default=Dn;Dn.stable=If;Dn.stableStringify=If;var Ni="[...]",Cf="[Circular]",br=[],lr=[];function xf(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Dn(t,e,r,n){typeof n>"u"&&(n=xf()),La(t,"",0,[],void 0,0,n);var i;try{lr.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Rf(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;br.length!==0;){var s=br.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Wr(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),br.push([n,r,e,i])):lr.push([e,r,t]):(n[r]=t,br.push([n,r,e]))}function La(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){Wr(Cf,t,e,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){Wr(Ni,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Wr(Ni,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)La(t[a],a,a,n,t,s,o);else{var c=Object.keys(t);for(a=0;a<c.length;a++){var u=c[a];La(t[u],u,a,n,t,s,o)}}n.pop()}}function Tp(t,e){return t<e?-1:t>e?1:0}function If(t,e,r,n){typeof n>"u"&&(n=xf());var i=Pa(t,"",0,[],void 0,0,n)||t,s;try{lr.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Rf(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;br.length!==0;){var o=br.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function Pa(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){Wr(Cf,t,e,i);return}try{if(typeof t.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){Wr(Ni,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Wr(Ni,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Pa(t[a],a,a,n,t,s,o);else{var c={},u=Object.keys(t).sort(Tp);for(a=0;a<u.length;a++){var l=u[a];Pa(t[l],l,a,n,t,s,o),c[l]=t[l]}if(typeof i<"u")br.push([i,e,t]),i[e]=c;else return c}n.pop()}}function Rf(t){return t=typeof t<"u"?t:function(e,r){return r},function(e,r){if(lr.length>0)for(var n=0;n<lr.length;n++){var i=lr[n];if(i[1]===e&&i[0]===r){r=i[2],lr.splice(n,1);break}}return t.call(this,e,r)}}
1Object.defineProperty(Qt,"__esModule",{value:!0});Qt.EthereumProviderError=Qt.EthereumRpcError=void 0;const Op=kp;class Af extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}serialize(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return Op.default(this.serialize(),Pp,2)}}Qt.EthereumRpcError=Af;class Np extends Af{constructor(e,r,n){if(!Lp(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}}Qt.EthereumProviderError=Np;function Lp(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function Pp(t,e){if(e!=="[Circular]")return e}var ac={},Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.errorValues=Zt.errorCodes=void 0;Zt.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Zt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Zt,r=Qt,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(h,g=i){if(Number.isInteger(h)){const v=h.toString();if(f(e.errorValues,v))return e.errorValues[v].message;if(u(h))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return g}t.getMessageFromCode=o;function a(h){if(!Number.isInteger(h))return!1;const g=h.toString();return!!(e.errorValues[g]||u(h))}t.isValidCode=a;function c(h,{fallbackError:g=s,shouldIncludeStack:v=!1}={}){var C,S;if(!g||!Number.isInteger(g.code)||typeof g.message!="string")throw new Error("Mu
1st provide fallback error with integer number code and string message.");if(h instanceof r.EthereumRpcError)return h.serialize();const b={};if(h&&typeof h=="object"&&!Array.isArray(h)&&f(h,"code")&&a(h.code)){const _=h;b.code=_.code,_.message&&typeof _.message=="string"?(b.message=_.message,f(_,"data")&&(b.data=_.data)):(b.message=o(b.code),b.data={originalError:l(h)})}else{b.code=g.code;const _=(C=h)===null||C===void 0?void 0:C.message;b.message=_&&typeof _=="string"?_:g.message,b.data={originalError:l(h)}}const y=(S=h)===null||S===void 0?void 0:S.stack;return v&&h&&y&&typeof y=="string"&&(b.stack=y),b}t.serializeError=c;function u(h){return h>=-32099&&h<=-32e3}function l(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function f(h,g){return Object.prototype.hasOwnProperty.call(h,g)}})(ac);var Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.ethErrors=void 0;const cc=Qt,Mf=ac,Pe=Zt;Zi.ethErrors={rpc:{parse:t=>Ye(Pe.errorCodes.rpc.parse,t),invalidRequest:t=>Ye(Pe.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Ye(Pe.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Ye(Pe.errorCodes.rpc.methodNotFound,t),internal:t=>Ye(Pe.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code
1<= -32005');return Ye(e,t)},invalidInput:t=>Ye(Pe.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Ye(Pe.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Ye(Pe.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Ye(Pe.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Ye(Pe.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Ye(Pe.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Sn(Pe.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Sn(Pe.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Sn(Pe.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Sn(Pe.errorCodes.provider.disconnected,t),chainDisconnected:t=>Sn(Pe.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new cc.EthereumProviderError(e,r,n)}}};function Ye(t,e){const[r,n]=kf(e);return new cc.EthereumRpcError(t,r||Mf.getMessageFromCode(t),n)}function Sn(t,e){const[r,n]=kf(e);return new cc.EthereumProviderError(t,r||Mf.getMessageFromCode(t),n)}function kf(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;
1if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=Qt;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=ac;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Zi;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Zt;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(oc);var de={},Yi={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(Yi);Object.defineProperty(de,"__esModule",{value:!0});de.EthereumAddressFromSignedMessageResponse=de.SubmitEthereumTransactionResponse=de.SignEthereumTransactionResponse=de.SignEthereumMessageResponse=de.isRequestEthereumAccountsResponse=de.SelectProviderResponse=de.WatchAssetReponse=de.RequestEthereumAccountsResponse=de.SwitchEthereumChainResponse=de.AddEthereumChainResponse=de.isErrorResponse=void 0;const Mt=Yi;function Dp(t){var e,r;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((r=t)===null||r===void 0?void 0:r.errorMessage)!==void 0}de.isErrorResponse=Dp;function $p(t){return{method:Mt.Web3Method.addEthereumChain,result:t}}de.AddEthereumChainResponse=$p;function jp(t){return{method:Mt.Web3Method.switchEthereumChain,result:t}}de.SwitchEthereumChainResponse=jp;function Bp(t){return{method:Mt.Web3Method.requestEthereumAccounts,result:t}}de.RequestEthereumAccountsResponse=Bp;function Fp(t){return{method:Mt.Web3Method.watchAsset,result:t}}de.WatchAssetReponse=Fp;function Wp(t){return{method:Mt.Web3Method.selectProvider,result:t}}de.SelectProviderResponse=Wp;function Hp(t){return t&&t.method===Mt.Web3Method.requestEthereumAccounts}de.isRequestEthereumAccountsResponse=Hp;function Vp(t){return{method:Mt.Web3Method.signEthereumMessage,result:t}}de.SignEthereumMessageResponse=Vp;function Up(t){return{method:Mt.Web3Method.signEthereumTransaction,result:t}}de.SignEthereumTransactionResponse=Up;function zp(t){return{method:Mt.Web3Method.submitEthereumTransaction,result:t}}de.SubmitEthereumTransactionResponse=zp;function qp(t){return{method:Mt.Web3Method.ethereumAddressFromSignedMessage,result:t}}de.EthereumAddressFromSignedMessageResponse=qp;var Vn={};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.LIB_VERSION=void 0;Vn.LIB_VERSION="3.7.1";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=oc,r=de,n=Vn;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(l){return l!==void 0?(0,e.getMessageFromCode)(l):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(l="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${l}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(l,f){const h=(0,e.serializeError)(o(l),{shouldIncludeStack:!0}),g=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");g.searchParams.set("version",n.LIB_VERSION),g.searchParams.set("co
1de",h.code.toString());const v=a(h.data,f);return v&&g.searchParams.set("method",v),g.searchParams.set("message",h.message),Object.assign(Object.assign({},h),{docUrl:g.href})}t.serializeError=s;function o(l){return typeof l=="string"?{message:l,code:t.standardErrorCodes.rpc.internal}:(0,r.isErrorResponse)(l)?Object.assign(Object.assign({},l),{message:l.errorMessage,code:l.errorCode,data:{method:l.method,result:l.result}}):l}function a(l,f){var h;const g=(h=l)===null||h===void 0?void 0:h.method;if(g)return g;if(f!==void 0)return typeof f=="string"?f:Array.isArray(f)?f.length>0?f[0].method:void 0:f.method}function c(l){var f;if(typeof l=="number")return l;if(u(l))return(f=l.code)!==null&&f!==void 0?f:l.errorCode}t.getErrorCode=c;function u(l){return typeof l=="object"&&l!==null&&(typeof l.code=="number"||typeof l.errorCode=="number")}})(Hn);var un={},Tf={exports:{}},Da={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(t,e){var r=qi,n=r.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,a,c){return n(o,a,c)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var u=n(o);return a!==void 0?typeof c=="string"?u.fill(a,c):u.fill(a):u.fill(0),u},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(Da,Da.exports);var er=Da.exports,Of=er.Buffer;function Ki(t,e){this._block=Of.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}Ki.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=Of.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,s=this._len,o=0;o<i;){for(var a=s%n,c=Math.min(i-o,n-a),u=0;u<c;u++)r[a+u]=t[o+u];s+=c,o+=c,s%n===0&&this._update(r)}return this._len+=i,this};Ki.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s};Ki.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var ln=Ki,Gp=dt,Nf=ln,Jp=er.Buffer,Qp=[1518500249,1859775393,-1894007588,-899497514],Zp=new Array(80);function Un(){this.init(),this._w=Zp,Nf.call(this,64,56)}Gp(Un,Nf);Un.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Yp(t){return t<<5|t>>>27}function Kp(t){return t<<30|t>>>2}function Xp(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Un.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var c=0;c<80;++c){var u=~~(c/20),l=Yp(r)+Xp(u,n,i,s)+o+e[c]+Qp[u]|0;o=s,s=i,i=Kp(n),n=r,r=l}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Un.prototype._hash=function(){var t=Jp.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var e0=Un,t0=dt,Lf=ln,r0=er.Buffer,n0=[1518500249,1859775393,-1894007588,-899497514],i0=new Array(80);function zn(){this.init(),this._w=i0,Lf.call(this,64,56)}t0(zn,Lf);zn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function s0(t){return t<<1|t>>>31}function o0(t){return t<<5|t>>>27}function a0(t){return t<<30|t>>>2}function c0(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}zn.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=s0(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var c=0;c<80;++c){var u=~~(c/20),l=o0(r)+c0(u,n,i,s)+o+e[c]+n0[u]|0;o=s,s=i,i=a0(n),n=r,r=l}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};zn.prototype._hash=function(){var t=r0.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var u0=zn,l0=dt,Pf=ln,f0=er.Buffer,h0=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
1734187,3204031479,3329325298],d0=new Array(64);function qn(){this.init(),this._w=d0,Pf.call(this,64,56)}l0(qn,Pf);qn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function p0(t,e,r){return r^t&(e^r)}function b0(t,e,r){return t&e|r&(t|e)}function g0(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function y0(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function v0(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function m0(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}qn.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,u=this._h|0,l=0;l<16;++l)e[l]=t.readInt32BE(l*4);for(;l<64;++l)e[l]=m0(e[l-2])+e[l-7]+v0(e[l-15])+e[l-16]|0;for(var f=0;f<64;++f){var h=u+y0(o)+p0(o,a,c)+h0[f]+e[f]|0,g=g0(r)+b0(r,n,i)|0;u=c,c=a,a=o,o=s+h|0,s=i,i=n,n=r,r=h+g|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=u+this._h|0};qn.prototype._hash=function(){var t=f0.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var Df=qn,w0=dt,_0=Df,S0=ln,E0=er.Buffer,C0=new Array(64);function Xi(){this.init(),this._w=C0,S0.call(this,64,56)}w0(Xi,_0);Xi.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Xi.prototype._hash=function(){var t=E0.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var x0=Xi,I0=dt,$f=ln,R0=er.Buffer,pu=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,
11126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],A0=new Array(160);function Gn(){this.init(),this._w=A0,$f.call(this,128,112)}I0(Gn,$f);Gn.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function bu(t,e,r){return r^t&(e^r)}function gu(t,e,r){return t&e|r&(t|e)}function yu(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function vu(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function M0(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function k0(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function T0(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function O0(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Ie(t,e){return t>>>0<e>>>0?1:0}Gn.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,u=this._hh|0,l=this._al|0,f=this._bl|0,h=this._cl|0,g=this._dl|0,v=this._el|0,C=this._fl|0,S=this._gl|0,b=this._hl|0,y=0;y<32;y+=2)e[y]=t.readInt32BE(y*4),e[y+1]=t.readInt32BE(y*4+4);for(;y<160;y+=2){var _=e[y-30],x=e[y-15*2+1],E=M0(_,x),k=k0(x,_);_=e[y-2*2],x=e[y-2*2+1];var F=T0(_,x),$=O0(x,_),O=e[y-7*2],q=e[y-7*2+1],ae=e[y-16*2],Q=e[y-16*2+1],R=k+q|0,A=E+O+Ie(R,k)|0;R=R+$|0,A=A+F+Ie(R,$)|0,R=R+Q|0,A=A+ae+Ie(R,Q)|0,e[y]=A,e[y+1]=R}for(var N=0;N<160;N+=2){A=e[N],R=e[N+1];var L=gu(r,n,i),j=gu(l,f,h),D=yu(r,l),H=yu(l,r),Z=vu(o,v),G=vu(v,o),ie=pu[N],fe=pu[N+1],ue=bu(o,a,c),Be=bu(v,C,S),m=b+G|0,w=u+Z+Ie(m,b)|0;m=m+Be|0,w=w+ue+Ie(m,Be)|0,m=m+fe|0,w=w+ie+Ie(m,fe)|0,m=m+R|0,w=w+A+Ie(m,R)|0;var T=H+j|0,U=D+L+Ie(T,H)|0;u=c,b=S,c=a,S=C,a=o,C=v,v=g+m|0,o=s+w+Ie(v,g)|0,s=i,g=h,i=n,h=f,n=r,f=l,l=m+T|0,r=w+U+Ie(l,m)|0}this._al=this._al+l|0,this._bl=this._bl+f|0,this._cl=this._cl+h|0,this._dl=this._dl+g|0,this._el=this._el+v|0,this._fl=this._fl+C|0,this._gl=this._gl+S|0,this._hl=this._hl+b|0,this._ah=this._ah+r+Ie(this._al,l)|0,this._bh=this._bh+n+Ie(this._bl,f)|0,this._ch=this._ch+i+Ie(this._cl,h)|0,this._dh=this._dh+s+Ie(this._dl,g)|0,this._eh=this._eh+o+Ie(this._el,v)|0,this._fh=this._fh+a+Ie(this._fl,C)|0,this._gh=this._gh+c+Ie(this._gl,S)|0,this._hh=this._hh+u+Ie(this._hl,b)|0};Gn.prototype._hash=function(){var t=R0.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var jf=Gn,N0=dt,L0=jf,P0=ln,D0=er.Buffer,$0=new Array(160);function es(){this.init(),this._w=$0,P0.call(this,128,112)}N0(es,L0);es.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};es.prototype._hash=function(){var t=D0.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var j0=es,Sr=Tf.exports=function(e){e=e.toLowerCase();var r=Sr[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};Sr.sha=e0;Sr.sha1=u0;Sr.sha224=x0;Sr.sha256=Df;Sr.sha384=j0;Sr.sha512=jf;var B0=Tf.exports,W={},F0=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0},mu=typeof Symbol<"u"&&Symbol,W0=F0,H0=function(){return typeof mu!="function"||typeof Symbol!="function"||typeof mu("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:W0()},wu={foo:{}},V0=Object,U0=function(){return{__proto__:wu}.foo===wu.foo&&!({__proto__:null}instanceof V0)},z0="Function.prototype.bind called on incompatible ",zo=Array.prototype.slice,q0=Object.prototype.toString,G0="[object Function]",J0=function(e){var r=this;if(typeof r!="function"||q0.call(r)!==G0)throw new TypeError(z0+r);
1for(var n=zo.call(arguments,1),i,s=function(){if(this instanceof i){var l=r.apply(this,n.concat(zo.call(arguments)));return Object(l)===l?l:this}else return r.apply(e,n.concat(zo.call(arguments)))},o=Math.max(0,r.length-n.length),a=[],c=0;c<o;c++)a.push("$"+c);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var u=function(){};u.prototype=r.prototype,i.prototype=new u,u.prototype=null}return i},Q0=J0,uc=Function.prototype.bind||Q0,Z0=uc,Y0=Z0.call(Function.call,Object.prototype.hasOwnProperty),re,Jr=SyntaxError,Bf=Function,Hr=TypeError,qo=function(t){try{return Bf('"use strict"; return ('+t+").constructor;")()}catch{}},dr=Object.getOwnPropertyDescriptor;if(dr)try{dr({},"")}catch{dr=null}var Go=function(){throw new Hr},K0=dr?function(){try{return arguments.callee,Go}catch{try{return dr(arguments,"callee").get}catch{return Go}}}():Go,Tr=H0(),X0=U0(),Me=Object.getPrototypeOf||(X0?function(t){return t.__proto__}:null),$r={},eb=typeof Uint8Array>"u"||!Me?re:Me(Uint8Array),pr={"%AggregateError%":typeof AggregateError>"u"?re:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?re:ArrayBuffer,"%ArrayIteratorPrototype%":Tr&&Me?Me([][Symbol.iterator]()):re,"%AsyncFromSyncIteratorPrototype%":re,"%AsyncFunction%":$r,"%AsyncGenerator%":$r,"%AsyncGeneratorFunction%":$r,"%AsyncIteratorPrototype%":$r,"%Atomics%":typeof Atomics>"u"?re:Atomics,"%BigInt%":typeof BigInt>"u"?re:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?re:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?re:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?re:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?re:Float32Array,"%Float64Array%":typeof Float64Array>"u"?re:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?re:FinalizationRegistry,"%Function%":Bf,"%GeneratorFunction%":$r,"%Int8Array%":typeof Int8Array>"u"?re:Int8Array,"%Int16Array%":typeof Int16Array>"u"?re:Int16Array,"%Int32Array%":typeof Int32Array>
vendor: 4,741 bytes, line 1
1"u"?re:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Tr&&Me?Me(Me([][Symbol.iterator]())):re,"%JSON%":typeof JSON=="object"?JSON:re,"%Map%":typeof Map>"u"?re:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Tr||!Me?re:Me(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?re:Promise,"%Proxy%":typeof Proxy>"u"?re:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?re:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?re:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Tr||!Me?re:Me(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?re:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Tr&&Me?Me(""[Symbol.iterator]()):re,"%Symbol%":Tr?Symbol:re,"%SyntaxError%":Jr,"%ThrowTypeError%":K0,"%TypedArray%":eb,"%TypeError%":Hr,"%Uint8Array%":typeof Uint8Array>"u"?re:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?re:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?re:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?re:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?re:WeakMap,"%WeakRef%":typeof WeakRef>"u"?re:WeakRef,"%WeakSet%":typeof WeakSet>"u"?re:WeakSet};if(Me)try{null.error}catch(t){var tb=Me(Me(t));pr["%Error.prototype%"]=tb}var rb=function t(e){var r;if(e==="%AsyncFunction%")r=qo("async function () {}");else if(e==="%GeneratorFunction%")r=qo("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=qo("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Me&&(r=Me(i.prototype))}return pr[e]=r,r},_u={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Jn=uc,Li=Y0,nb=Jn.call(Function.call,Array.prototype.concat),ib=Jn.call(Function.apply,Array.prototype.splice),Su=Jn.call(Function.call,String.prototype.replace),Pi=Jn.call(Function.call,String.prototype.slice),sb=Jn.call(Function.call,RegExp.prototype.exec),ob=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ab=/\\(\\)?/g,cb=function(e){var r=Pi(e,0,1),n=Pi(e,-1);
1if(r==="%"&&n!=="%")throw new Jr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Jr("invalid intrinsic syntax, expected opening `%`");var i=[];return Su(e,ob,function(s,o,a,c){i[i.length]=a?Su(c,ab,"$1"):o||s}),i},ub=function(e,r){var n=e,i;if(Li(_u,n)&&(i=_u[n],n="%"+i[0]+"%"),Li(pr,n)){var s=pr[n];if(s===$r&&(s=rb(n)),typeof s>"u"&&!r)throw new Hr("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Jr("intrinsic "+e+" does not exist!")},lc=function(e,r){if(typeof e!="string"||e.length===0)throw new Hr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Hr('"allowMissing" argument must be a boolean');if(sb(/^%?[^%]*%?$/,e)===null)throw new Jr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=cb(e),i=n.length>0?n[0]:"",s=ub("%"+i+"%",r),o=s.name,a=s.value,c=!1,u=s.alias;u&&(i=u[0],ib(n,nb([0,1],u)));for(var l=1,f=!0;l<n.length;l+=1){var h=n[l],g=Pi(h,0,1),v=Pi(h,-1);if((g==='"'||g==="'"||g==="`"||v==='"'||v==="'"||v==="`")&&g!==v)throw new Jr("property names with quotes must have matching quotes");if((h==="constructor"||!f)&&(c=!0),i+="."+h,o="%"+i+"%",Li(pr,o))a=pr[o];else if(a!=null){if(!(h in a)){if(!r)throw new Hr("base intrinsic for "+e+" exists, but the property is not available.");return}if(dr&&l+1>=n.length){var C=dr(a,h);f=!!C,f&&"get"in C&&!("originalValue"in C.get)?a=C.get:a=a[h]}else f=Li(a,h),a=a[h];f&&!c&&(pr[o]=a)}}return a},Ff={exports:{}};(function(t){var e=uc,r=lc,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||e.call(i,n),o=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}t.exports=function(f){var h=s(e,i,arguments);if(o&&a){var g=o(h,"length");g.configurable&&a(h,"length",{value:1+c(0,f.length-(arguments.length-1))})}return h};var u=function(){return s(e,n,arguments)};a?a(t.exports,"apply",{value:u}):t.exports.apply=u})(Ff);var lb=Ff.exports,Wf=lc,Hf=lb,fb=Hf(Wf("String.prototype.indexOf")),hb=function(e,r){var n=Wf(e,!!r);return typeof n=="function"&&fb(e,".prototype.")>-1?Hf(n):n},fc=typeof Map=="function"&&Map.prototype,Jo=Object.getOwnPropertyDescriptor&&fc?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Di=fc&&Jo&&typeof Jo.get=="function"?Jo.get:null,Eu=fc&&Map.prototype.forEach,hc=typeof Set=="function"&&Set.prototype,Qo=Object.getOwnPropertyDescriptor&&hc?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,$i=hc&&Qo&&typeof Qo.get=="function"?Qo.get:null,Cu=hc&&Set.prototype.forEach,db=typeof WeakMap=="function"&&WeakMap.prototype,Mn=db?WeakMap.prototype.has:null,pb=typeof WeakSet=="function"&&WeakSet.prototype,kn=pb?WeakSet.prototype.has:null,bb=typeof WeakRef=="function"&&WeakRef.prototype,xu=bb?WeakRef.prototype.deref:null,gb=Boolean.prototype.valueOf,yb=Object.prototype.toString,vb=Function.prototype.toString,mb=String.prototype.match,dc=String.prototype.slice,Gt=String.prototype.replace,wb=String.prototype.toUpperCase,Iu=String.prototype.toLowerCase,Vf=RegExp.prototype.test,Ru=Array.prototype.concat,Et=Array.prototype.join,_b=Array.prototype.slice,Au=Math.floor,$a=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Zo=Object.getOwnPropertySymbols,ja=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Qr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",je=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Qr||"symbol")?Symbol.toStringTag:null,Uf=Object.prototype.propertyIsEnumerable,Mu=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function ku(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Vf.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Au(-t):Au(t);if(n!==t){var i=String(n),s=dc.call(e,i.length+1);return Gt.call(i,r,"$&_")+"."+Gt.call(Gt.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Gt.call(e,r,"$&_")}var Ba=ic,Tu=Ba.custom,Ou=qf(Tu)?Tu:null,Sb=function t(e,r,n,i){var s=r||{};if(Ut(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ut(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Ut(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
vendor: 9,038 bytes, lines 1-4
1if(Ut(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ut(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Jf(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return a?ku(e,c):c}if(typeof e=="bigint"){var u=String(e)+"n";return a?ku(e,u):u}var l=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return Fa(e)?"[Array]":"[Object]";var f=Fb(s,n);if(typeof i>"u")i=[];else if(Gf(i,e)>=0)return"[Circular]";function h(R,A,N){if(A&&(i=_b.call(i),i.push(A)),N){var L={depth:s.depth};return Ut(s,"quoteStyle")&&(L.quoteStyle=s.quoteStyle),t(R,L,n+1,i)}return t(R,s,n+1,i)}if(typeof e=="function"&&!Nu(e)){var g=Tb(e),v=pi(e,h);return"[Function"+(g?": "+g:" (anonymous)")+"]"+(v.length>0?" { "+Et.call(v,", ")+" }":"")}if(qf(e)){var C=Qr?Gt.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):ja.call(e);return typeof e=="object"&&!Qr?En(C):C}if($b(e)){for(var S="<"+Iu.call(String(e.nodeName)),b=e.attributes||[],y=0;y<b.length;y++)S+=" "+b[y].name+"="+zf(Eb(b[y].value),"double",s);return S+=">",e.childNodes&&e.childNodes.length&&(S+="..."),S+="</"+Iu.call(String(e.nodeName))+">",S}if(Fa(e)){if(e.length===0)return"[]";var _=pi(e,h);return f&&!Bb(_)?"["+Wa(_,f)+"]":"[ "+Et.call(_,", ")+" ]"}if(xb(e)){var x=pi(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!Uf.call(e,"cause")?"{ ["+String(e)+"] "+Et.call(Ru.call("[cause]: "+h(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Et.call(x,", ")+" }"}if(typeof e=="object"&&o){if(Ou&&typeof e[Ou]=="function"&&Ba)return Ba(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Ob(e)){var E=[];return Eu&&Eu.call(e,function(R,A){E.push(h(A,e,!0)+" => "+h(R,e))}),Lu("Map",Di.call(e),E,f)}if(Pb(e)){var k=[];return Cu&&Cu.call(e,function(R){k.push(h(R,e))}),Lu("Set",$i.call(e),k,f)}if(Nb(e))return Yo("WeakMap");if(Db(e))return Yo("WeakSet");if(Lb(e))return Yo("WeakRef");if(Rb(e))return En(h(Number(e)));if(Mb(e))return En(h($a.call(e)));if(Ab(e))return En(gb.call(e));if(Ib(e))return En(h(String(e)));if(!Cb(e)&&!Nu(e)){var F=pi(e,h),$=Mu?Mu(e)===Object.prototype:e instanceof Object||e.constructor===Object,O=e instanceof Object?"":"null prototype",q=!$&&je&&Object(e)===e&&je in e?dc.call(tr(e),8,-1):O?"Object":"",ae=$||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Q=ae+(q||O?"["+Et.call(Ru.call([],q||[],O||[]),": ")+"] ":"");return F.length===0?Q+"{}":f?Q+"{"+Wa(F,f)+"}":Q+"{ "+Et.call(F,", ")+" }"}return String(e)};function zf(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Eb(t){return Gt.call(String(t),/"/g,""")}function Fa(t){return tr(t)==="[object Array]"&&(!je||!(typeof t=="object"&&je in t))}function Cb(t){return tr(t)==="[object Date]"&&(!je||!(typeof t=="object"&&je in t))}function Nu(t){return tr(t)==="[object RegExp]"&&(!je||!(typeof t=="object"&&je in t))}function xb(t){return tr(t)==="[object Error]"&&(!je||!(typeof t=="object"&&je in t))}function Ib(t){return tr(t)==="[object String]"&&(!je||!(typeof t=="object"&&je in t))}function Rb(t){return tr(t)==="[object Number]"&&(!je||!(typeof t=="object"&&je in t))}function Ab(t){return tr(t)==="[object Boolean]"&&(!je||!(typeof t=="object"&&je in t))}function qf(t){if(Qr)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!ja)return!1;try{return ja.call(t),!0}catch{}return!1}function Mb(t){if(!t||typeof t!="object"||!$a)return!1;try{return $a.call(t),!0}catch{}return!1}var kb=Object.prototype.hasOwnProperty||function(t){return t in this};function Ut(t,e){return kb.call(t,e)}function tr(t){return yb.call(t)}function Tb(t){if(t.name)return t.name;var e=mb.call(vb.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Gf(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function Ob(t){if(!Di||!t||typeof t!="object")return!1;try{Di.call(t);try{$i.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function Nb(t){if(!Mn||!t||typeof t!="object")return!1;try{Mn.call(t,Mn);try{kn.call(t,kn)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function Lb(t){if(!xu||!t||typeof t!="object")return!1;try{return xu.call(t),!0}catch{}return!1}function Pb(t){if(!$i||!t||typeof t!="object")return!1;try{$i.call(t);try{Di.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function Db(t){if(!kn||!t||typeof t!="object")return!1;try{kn.call(t,kn);try{Mn.call(t,Mn)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function $b(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Jf(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Jf(dc.call(t,0,e.maxStringLength),e)+n}var i=Gt.call(Gt.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,jb);return zf(i,"single",e)}function jb(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+wb.call(e.toString(16))}function En(t){return"Object("+t+")"}function Yo(t){return t+" { ? }"}function Lu(t,e,r,n){var i=n?Wa(r,n):Et.call(r,", ");return t+" ("+e+") {"+i+"}"}function Bb(t){for(var e=0;e<t.length;e++)if(Gf(t[e],` 2`)>=0)return!1;return!0}function Fb(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Et.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Et.call(Array(e+1),r)}}function Wa(t,e){if(t.length===0)return"";var r=` 3`+e.prev+e.base;return r+Et.call(t,","+r)+` 4`+e.prev}function pi(t,e){var r=Fa(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=Ut(t,i)?e(t[i],t):""}var s=typeof Zo=="function"?Zo(t):[],o;if(Qr){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var c in t)Ut(t,c)&&(r&&String(Number(c))===c&&c<t.length||Qr&&o["$"+c]instanceof Symbol||(Vf.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t))));if(typeof Zo=="function")for(var u=0;u<s.length;u++)Uf.call(t,s[u])&&n.push("["+e(s[u])+"]: "+e(t[s[u]],t));return n}var pc=lc,fn=hb,Wb=Sb,Hb=pc("%TypeError%"),bi=pc("%WeakMap%",!0),gi=pc("%Map%",!0),Vb=fn("WeakMap.prototype.get",!0),Ub=fn("WeakMap.prototype.set",!0),zb=fn("WeakMap.prototype.has",!0),qb=fn("Map.prototype.get",!0),Gb=fn("Map.prototype.set",!0),Jb=fn("Map.prototype.has",!0),bc=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},Qb=function(t,e){var r=bc(t,e);return r&&r.value},Zb=function(t,e,r){var n=bc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},Yb=function(t,e){return!!bc(t,e)},Kb=function(){var e,r,n,i={assert:function(s){if(!i.has(s))throw new Hb("Side channel does not contain "+Wb(s))},get:function(s){if(bi&&s&&(typeof s=="object"||typeof s=="function")){if(e)return Vb(e,s)}else if(gi){if(r)return qb(r,s)}else if(n)return Qb(n,s)},has:function(s){if(bi&&s&&(typeof s=="object"||typeof s=="function")){if(e)return zb(e,s)}else if(gi){if(r)return Jb(r,s)}else if(n)return Yb(n,s);return!1},set:function(s,o){bi&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new bi),Ub(e,s,o)):gi?(r||(r=new gi),Gb(r,s,o)):(n||(n={key:{},next:null}),Zb(n,s,o))}};return i},Xb=String.prototype.replace,eg=/%20/g,Ko={RFC1738:"RFC1738",RFC3986:"RFC3986"},gc={default:Ko.RFC3986,formatters:{RFC1738:function(t){return Xb.call(t,eg,"+")},RFC3986:function(t){return String(t)}},RFC1738:Ko.RFC1738,RFC3986:Ko.RFC3986},tg=gc,Xo=Object.prototype.hasOwnProperty,or=Array.isArray,yt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),rg=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(or(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&i.push(n[s]);r.obj[r.prop]=i}}},Qf=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},ng=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(or(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Xo.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var i=e;return or(e)&&!or(r)&&(i=Qf(e,n)),or(e)&&or(r)?(r.forEach(function(s,o){if(Xo.call(e,o)){var a=e[o];a&&typeof a=="object"&&s&&typeof s=="object"?e[o]=t(a,s,n):e.push(s)}else e[o]=s}),e):Object.keys(r).reduce(function(s,o){var a=r[o];return Xo.call(s,o)?s[o]=t(s[o],a,n):s[o]=a,s},i)},ig=function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},sg=function(t,e,r){var n=t.replace(/\+/g," ");
4if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},og=function(e,r,n,i,s){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var a="",c=0;c<o.length;++c){var u=o.charCodeAt(c);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||s===tg.RFC1738&&(u===40||u===41)){a+=o.charAt(c);continue}if(u<128){a=a+yt[u];continue}if(u<2048){a=a+(yt[192|u>>6]+yt[128|u&63]);continue}if(u<55296||u>=57344){a=a+(yt[224|u>>12]+yt[128|u>>6&63]+yt[128|u&63]);continue}c+=1,u=65536+((u&1023)<<10|o.charCodeAt(c)&1023),a+=yt[240|u>>18]+yt[128|u>>12&63]+yt[128|u>>6&63]+yt[128|u&63]}return a},ag=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],o=s.obj[s.prop],a=Object.keys(o),c=0;c<a.length;++c){var u=a[c],l=o[u];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(r.push({obj:o,prop:u}),n.push(l))}return rg(r),e},cg=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},ug=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},lg=function(e,r){return[].concat(e,r)},fg=function(e,r){if(or(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(r(e[i]));return n}return r(e)},Zf={arrayToObject:Qf,assign:ig,combine:lg,compact:ag,decode:sg,encode:og,isBuffer:ug,isRegExp:cg,maybeMap:fg,merge:ng},Yf=Kb,Mi=Zf,Tn=gc,hg=Object.prototype.hasOwnProperty,Pu={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},Lt=Array.isArray,dg=Array.prototype.push,Kf=function(t,e){dg.apply(t,Lt(e)?e:[e])},pg=Date.prototype.toISOString,Du=Tn.default,$e={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Mi.encode,encodeValuesOnly:!1,format:Du,formatter:Tn.formatters[Du],indices:!1,serializeDate:function(e){return pg.call(e)},skipNulls:!1,strictNullHandling:!1},bg=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},ea={},gg=function t(e,r,n,i,s,o,a,c,u,l,f,h,g,v,C,S){for(var b=e,y=S,_=0,x=!1;(y=y.get(ea))!==void 0&&!x;){var E=y.get(e);if(_+=1,typeof E<"u"){if(E===_)throw new RangeError("Cyclic object value");x=!0}typeof y.get(ea)>"u"&&(_=0)}if(typeof c=="function"?b=c(r,b):b instanceof Date?b=f(b):n==="comma"&&Lt(b)&&(b=Mi.maybeMap(b,function(L){return L instanceof Date?f(L):L})),b===null){if(s)return a&&!v?a(r,$e.encoder,C,"key",h):r;b=""}if(bg(b)||Mi.isBuffer(b)){if(a){var k=v?r:a(r,$e.encoder,C,"key",h);return[g(k)+"="+g(a(b,$e.encoder,C,"value",h))]}return[g(r)+"="+g(String(b))]}var F=[];if(typeof b>"u")return F;var $;if(n==="comma"&&Lt(b))v&&a&&(b=Mi.maybeMap(b,a)),$=[{value:b.length>0?b.join(",")||null:void 0}];else if(Lt(c))$=c;else{var O=Object.keys(b);$=u?O.sort(u):O}for(var q=i&&Lt(b)&&b.length===1?r+"[]":r,ae=0;ae<$.length;++ae){var Q=$[ae],R=typeof Q=="object"&&typeof Q.value<"u"?Q.value:b[Q];if(!(o&&R===null)){var A=Lt(b)?typeof n=="function"?n(q,Q):q:q+(l?"."+Q:"["+Q+"]");S.set(e,_);var N=Yf();N.set(ea,S),Kf(F,t(R,A,n,i,s,o,n==="comma"&&v&&Lt(b)?null:a,c,u,l,f,h,g,v,C,N))}}return F},yg=function(e){if(!e)return $e;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||$e.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Tn.default;if(typeof e.format<"u"){if(!hg.call(Tn.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Tn.formatters[n],s=$e.filter;return(typeof e.filter=="function"||Lt(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:$e.addQueryPrefix,allowDots:typeof e.allowDots>"u"?$e.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:$e.charsetSentinel,delimiter:typeof e.delimiter>"u"?$e.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:$e.encode,encoder:typeof e.encoder=="function"?e.encoder:$e.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:$e.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:$e.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:$e.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:$e.strictNullHandling}},vg=function(t,e){var r=t,n=yg(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Lt(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in Pu?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";
4var c=Pu[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=c==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var l=Yf(),f=0;f<i.length;++f){var h=i[f];n.skipNulls&&r[h]===null||Kf(o,gg(r[h],h,c,u,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}var g=o.join(n.delimiter),v=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),g.length>0?v+g:""},Zr=Zf,Ha=Object.prototype.hasOwnProperty,mg=Array.isArray,Re={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Zr.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},wg=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},Xf=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},_g="utf8=%26%2310003%3B",Sg="utf8=%E2%9C%93",Eg=function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,s),a=-1,c,u=r.charset;if(r.charsetSentinel)for(c=0;c<o.length;++c)o[c].indexOf("utf8=")===0&&(o[c]===Sg?u="utf-8":o[c]===_g&&(u="iso-8859-1"),a=c,c=o.length);for(c=0;c<o.length;++c)if(c!==a){var l=o[c],f=l.indexOf("]="),h=f===-1?l.indexOf("="):f+1,g,v;h===-1?(g=r.decoder(l,Re.decoder,u,"key"),v=r.strictNullHandling?null:""):(g=r.decoder(l.slice(0,h),Re.decoder,u,"key"),v=Zr.maybeMap(Xf(l.slice(h+1),r),function(C){return r.decoder(C,Re.decoder,u,"value")})),v&&r.interpretNumericEntities&&u==="iso-8859-1"&&(v=wg(v)),l.indexOf("[]=")>-1&&(v=mg(v)?[v]:v),Ha.call(n,g)?n[g]=Zr.combine(n[g],v):n[g]=v}return n},Cg=function(t,e,r,n){for(var i=n?e:Xf(e,r),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,u=parseInt(c,10);!r.parseArrays&&c===""?o={0:i}:!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(o=[],o[u]=i):c!=="__proto__"&&(o[c]=i)}i=o}return i},xg=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=n.depth>0&&o.exec(s),u=c?s.slice(0,c.index):s,l=[];if(u){if(!n.plainObjects&&Ha.call(Object.prototype,u)&&!n.allowPrototypes)return;l.push(u)}for(var f=0;n.depth>0&&(c=a.exec(s))!==null&&f<n.depth;){if(f+=1,!n.plainObjects&&Ha.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(c[1])}return c&&l.push("["+s.slice(c.index)+"]"),Cg(l,r,n,i)}},Ig=function(e){if(!e)return Re;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?Re.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?Re.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Re.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Re.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Re.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Re.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Re.comma,decoder:typeof e.decoder=="function"?e.decoder:Re.decoder,delimiter:typeof e.delimiter=="string"||Zr.isRegExp(e.delimiter)?e.delimiter:Re.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Re.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Re.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Re.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Re.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Re.strictNullHandling}},Rg=function(t,e){var r=Ig(e);
4if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?Eg(t,r):t,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),o=0;o<s.length;++o){var a=s[o],c=xg(a,n[a],r,typeof t=="string");i=Zr.merge(i,c,r)}return r.allowSparse===!0?i:Zr.compact(i)},Ag=vg,Mg=Rg,kg=gc,Tg={formats:kg,parse:Mg,stringify:Ag},Qn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0;function e(){return n=>n}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function r(n){return Math.floor(n)}t.IntNumber=r,t.RegExpString=e(),function(n){n.CoinbaseWallet="CoinbaseWallet",n.MetaMask="MetaMask",n.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(Qn);var Og=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(W,"__esModule",{value:!0});W.isInIFrame=W.createQrUrl=W.getFavicon=W.range=W.isBigNumber=W.ensureParsedJSONObject=W.ensureBN=W.ensureRegExpString=W.ensureIntNumber=W.ensureBuffer=W.ensureAddressString=W.ensureEvenLengthHexString=W.ensureHexString=W.isHexString=W.prepend0x=W.strip0x=W.has0xPrefix=W.hexStringFromIntNumber=W.intNumberFromHexString=W.bigIntStringFromBN=W.hexStringFromBuffer=W.hexStringToUint8Array=W.uint8ArrayToHex=W.randomBytesHex=void 0;const zt=Og(Gi),Ng=Tg,Er=Hn,nt=Qn,eh=/^[0-9]*$/,th=/^[a-f0-9]*$/;function Lg(t){return rh(crypto.getRandomValues(new Uint8Array(t)))}W.randomBytesHex=Lg;function rh(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}W.uint8ArrayToHex=rh;function Pg(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}W.hexStringToUint8Array=Pg;function Dg(t,e=!1){const r=t.toString("hex");return(0,nt.HexString)(e?"0x"+r:r)}W.hexStringFromBuffer=Dg;function $g(t){return(0,nt.BigIntString)(t.toString(10))}W.bigIntStringFromBN=$g;function jg(t){return(0,nt.IntNumber)(new zt.default(Yn(t,!1),16).toNumber())}W.intNumberFromHexString=jg;function Bg(t){return(0,nt.HexString)("0x"+new zt.default(t).toString(16))}W.hexStringFromIntNumber=Bg;function yc(t){return t.startsWith("0x")||t.startsWith("0X")}W.has0xPrefix=yc;function ts(t){return yc(t)?t.slice(2):t}W.strip0x=ts;function nh(t){return yc(t)?"0x"+t.slice(2):"0x"+t}W.prepend0x=nh;function Zn(t){if(typeof t!="string")return!1;const e=ts(t).toLowerCase();return th.test(e)}W.isHexString=Zn;function ih(t,e=!1){if(typeof t=="string"){const r=ts(t).toLowerCase();if(th.test(r))return(0,nt.HexString)(e?"0x"+r:r)}throw Er.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}W.ensureHexString=ih;function Yn(t,e=!1){let r=ih(t,!1);return r.length%2===1&&(r=(0,nt.HexString)("0"+r)),e?(0,nt.HexString)("0x"+r):r}W.ensureEvenLengthHexString=Yn;function Fg(t){if(typeof t=="string"){const e=ts(t).toLowerCase();if(Zn(e)&&e.length===40)return(0,nt.AddressString)(nh(e))}throw Er.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}W.ensureAddressString=Fg;function Wg(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string")if(Zn(t)){const e=Yn(t,!1);return Buffer.from(e,"hex")}else return Buffer.from(t,"utf8");throw Er.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}W.ensureBuffer=Wg;function sh(t){if(typeof t=="number"&&Number.isInteger(t))return(0,nt.IntNumber)(t);if(typeof t=="string"){if(eh.test(t))return(0,nt.IntNumber)(Number(t));if(Zn(t))return(0,nt.IntNumber)(new zt.default(Yn(t,!1),16).toNumber())}throw Er.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}W.ensureIntNumber=sh;function Hg(t){if(t instanceof RegExp)return(0,nt.RegExpString)(t.toString());throw Er.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}W.ensureRegExpString=Hg;function Vg(t){if(t!==null&&(zt.default.isBN(t)||oh(t)))return new zt.default(t.toString(10),10);if(typeof t=="number")return new zt.default(sh(t));if(typeof t=="string"){if(eh.test(t))return new zt.default(t,10);if(Zn(t))return new zt.default(Yn(t,!1),16)}throw Er.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}W.ensureBN=Vg;function Ug(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Er.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}W.ensureParsedJSONObject=Ug;function oh(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}W.isBigNumber=oh;function zg(t,e){return Array.from({length:e-t},(r,n)=>t+n)}W.range=zg;function qg(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}W.getFavicon=qg;function Gg(t,e,r,n,i,s){const o=n?"parent-id":"id",a=(0,Ng.stringify)({[o]:t,secret:e,server:r,v:i,chainId:s});return`${r}/#/link?${a}`}W.createQrUrl=Gg;function Jg(){try{return window.frameElement!==null}catch{return!1}}W.isInIFrame=Jg;Object.defineProperty(un,"__esModule",{value:!0});un.Session=void 0;const $u=B0,ju=W,Bu="session:id",Fu="session:secret",Wu="session:linked";class vc{constructor(e,r,n,i){this._storage=e,this._id=r||(0,ju.randomBytesHex)(16),this._secret=n||(0,ju.randomBytesHex)(32),this._key=new $u.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(Bu),n=e.getItem(Wu),i=e.getItem(Fu);return r&&i?new vc(e,r,i,n==="1"):null}static hash(e){return new $u.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(Bu,this._id),this._storage.setItem(Fu,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Wu,this._linked?"1":"0")}}un.Session=vc;var ht={};
4Object.defineProperty(ht,"__esModule",{value:!0});ht.WalletSDKRelayAbstract=ht.APP_VERSION_KEY=ht.LOCAL_STORAGE_ADDRESSES_KEY=ht.WALLET_USER_NAME_KEY=void 0;const Hu=Hn;ht.WALLET_USER_NAME_KEY="walletUsername";ht.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";ht.APP_VERSION_KEY="AppVersion";class Qg{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Hu.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Hu.serializeError)(s,e.method);return i})}}ht.WalletSDKRelayAbstract=Qg;var Va={exports:{}},ah=nc.EventEmitter,ta,Vu;function Zg(){if(Vu)return ta;Vu=1;function t(v,C){var S=Object.keys(v);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(v);C&&(b=b.filter(function(y){return Object.getOwnPropertyDescriptor(v,y).enumerable})),S.push.apply(S,b)}return S}function e(v){for(var C=1;C<arguments.length;C++){var S=arguments[C]!=null?arguments[C]:{};C%2?t(Object(S),!0).forEach(function(b){r(v,b,S[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(S)):t(Object(S)).forEach(function(b){Object.defineProperty(v,b,Object.getOwnPropertyDescriptor(S,b))})}return v}function r(v,C,S){return C=o(C),C in v?Object.defineProperty(v,C,{value:S,enumerable:!0,configurable:!0,writable:!0}):v[C]=S,v}function n(v,C){if(!(v instanceof C))throw new TypeError("Cannot call a class as a function")}function i(v,C){for(var S=0;S<C.length;S++){var b=C[S];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,o(b.key),b)}}function s(v,C,S){return C&&i(v.prototype,C),S&&i(v,S),Object.defineProperty(v,"prototype",{writable:!1}),v}function o(v){var C=a(v,"string");return typeof C=="symbol"?C:String(C)}function a(v,C){if(typeof v!="object"||v===null)return v;var S=v[Symbol.toPrimitive];if(S!==void 0){var b=S.call(v,C||"default");if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(v)}var c=qi,u=c.Buffer,l=ic,f=l.inspect,h=f&&f.custom||"inspect";function g(v,C,S){u.prototype.copy.call(v,C,S)}return ta=function(){function v(){n(this,v),this.head=null,this.tail=null,this.length=0}return s(v,[{key:"push",value:function(S){var b={data:S,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length}},{key:"unshift",value:function(S){var b={data:S,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length}},{key:"shift",value:function(){if(this.length!==0){var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(S){if(this.length===0)return"";for(var b=this.head,y=""+b.data;b=b.next;)y+=S+b.data;return y}},{key:"concat",value:function(S){if(this.length===0)return u.alloc(0);for(var b=u.allocUnsafe(S>>>0),y=this.head,_=0;y;)g(y.data,b,_),_+=y.data.length,y=y.next;return b}},{key:"consume",value:function(S,b){var y;return S<this.head.data.length?(y=this.head.data.slice(0,S),this.head.data=this.head.data.slice(S)):S===this.head.data.length?y=this.shift():y=b?this._getString(S):this._getBuffer(S),y}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(S){var b=this.head,y=1,_=b.data;for(S-=_.length;b=b.next;){var x=b.data,E=S>x.length?x.length:S;if(E===x.length?_+=x:_+=x.slice(0,S),S-=E,S===0){E===x.length?(++y,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=x.slice(E));break}++y}return this.length-=y,_}},{key:"_getBuffer",value:function(S){var b=u.allocUnsafe(S),y=this.head,_=1;for(y.data.copy(b),S-=y.data.length;y=y.next;){var x=y.data,E=S>x.length?x.length:S;if(x.copy(b,b.length-S,0,E),S-=E,S===0){E===x.length?(++_,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=x.slice(E));break}++_}return this.length-=_,b}},{key:h,value:function(S,b){return f(this,e(e({},b),{},{depth:0,customInspect:!1}))}}]),v}(),ta}function Yg(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Ua,this,t)):process.nextTick(Ua,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(ki,r):(r._writableState.errorEmitted=!0,process.nextTick(Uu,r,s)):process.nextTick(Uu,r,s):e?(process.nextTick(ki,r),e(s)):process.nextTick(ki,r)}),this)}function Uu(t,e){Ua(t,e),ki(t)}function ki(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Kg(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Ua(t,e){t.emit("error",e)}function Xg(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var ch={destroy:Yg,undestroy:Kg,errorOrDestroy:Xg},Cr={};function ey(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var uh={};function st(t,e,r){r||(r=Error);function n(s,o,a){return typeof e=="string"?e:e(s,o,a)}var i=function(s){ey(o,s);function o(a,c,u){return s.call(this,n(a,c,u))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=t,uh[t]=i}function zu(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function ty(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function ry(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function ny(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}st("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invali
4d for option "'+t+'"'},TypeError);st("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&ty(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(ry(t," argument"))i="The ".concat(t," ").concat(n," ").concat(zu(e,"type"));else{var s=ny(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(zu(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);st("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");st("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});st("ERR_STREAM_PREMATURE_CLOSE","Premature close");st("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});st("ERR_MULTIPLE_CALLBACK","Callback called multiple times");st("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");st("ERR_STREAM_WRITE_AFTER_END","write after end");st("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);st("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);st("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Cr.codes=uh;var iy=Cr.codes.ERR_INVALID_OPT_VALUE;function sy(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function oy(t,e,r,n){var i=sy(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new iy(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var lh={getHighWaterMark:oy},ay=cy;function cy(t,e){if(ra("noDeprecation"))return t;var r=!1;function n(){if(!r){if(ra("throwDeprecation"))throw new Error(e);ra("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function ra(t){try{if(!B.localStorage)return!1}catch{return!1}var e=B.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var na,qu;function fh(){if(qu)return na;qu=1,na=$;function t(m){var w=this;this.next=null,this.entry=null,this.finish=function(){Be(w,m)}}var e;$.WritableState=k;var r={deprecate:ay},n=ah,i=qi.Buffer,s=(typeof B<"u"?B:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(m){return i.from(m)}function a(m){return i.isBuffer(m)||m instanceof s}var c=ch,u=lh,l=u.getHighWaterMark,f=Cr.codes,h=f.ERR_INVALID_ARG_TYPE,g=f.ERR_METHOD_NOT_IMPLEMENTED,v=f.ERR_MULTIPLE_CALLBACK,C=f.ERR_STREAM_CANNOT_PIPE,S=f.ERR_STREAM_DESTROYED,b=f.ERR_STREAM_NULL_VALUES,y=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,x=c.errorOrDestroy;dt($,n);function E(){}function k(m,w,T){e=e||Yr(),m=m||{},typeof T!="boolean"&&(T=w instanceof e),this.objectMode=!!m.objectMode,T&&(this.objectMode=this.objectMode||!!m.writableObjectMode),this.highWaterMark=l(this,m,"writableHighWaterMark",T),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var U=m.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=m.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ee){L(w,ee)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=m.emitClose!==!1,this.autoDestroy=!!m.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}k.prototype.getBuffer=function(){for(var w=this.bufferedRequest,T=[];w;)T.push(w),w=w.next;return T},function(){try{Object.defineProperty(k.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var F;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(F=Function.prototype[Symbol.hasInstance],Object.defineProperty($,Symbol.hasInstance,{value:function(w){return F.call(this,w)?!0:this!==$?!1:w&&w._writableState instanceof k}})):F=function(w){return w instanceof this};function $(m){e=e||Yr();var w=this instanceof e;if(!w&&!F.call($,this))return new $(m);this._writableState=new k(m,this,w),this.writable=!0,m&&(typeof m.write=="function"&&(this._write=m.write),typeof m.writev=="function"&&(this._writev=m.writev),typeof m.destroy=="function"&&(this._destroy=m.destroy),typeof m.final=="function"&&(this._final=m.final)),n.call(this)}$.prototype.pipe=function(){x(this,new C)};function O(m,w){var T=new y;x(m,T),process.nextTick(w,T)}function q(m,w,T,U){var ee;return T===null?ee=new b:typeof T!="string"&&!w.objectMode&&(ee=new h("chunk",["string","Buffer"],T)),ee?(x(m,ee),process.nextTick(U,ee),!1):!0}$.prototype.write=function(m,w,T){var U=this._writableState,ee=!1,d=!U.objectMode&&a(m);return d&&!i.isBuffer(m)&&(m=o(m)),typeof w=="function"&&(T=w,w=null),d?w="buffer":w||(w=U.defaultEncoding),typeof T!="function"&&(T=E),U.ending?O(this,T):(d||q(this,U,m,T))&&(U.pendingcb++,ee=Q(this,U,d,m,w,T)),ee},$.prototype.cork=function(){this._writableState.corked++},$.prototype.uncork=function(){var m=this._writableState;m.corked&&(m.corked--,!m.writing&&!m.corked&&!m.bufferProcessing&&m.bufferedRequest&&H(this,m))},$.prototype.setDefaultEncoding=function(w){if(typeof w=="string"&&(w=w.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((w+"").toLowerCase())>-1))throw new _(w);return this._writableState.defaultEncoding=w,this},Object.defineProperty($.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ae(m,w,T){return!m.objectMode&&m.decodeStrings!==!1&&typeof w=="string"&&(w=i.from(w,T)),w}Object.defineProperty($.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Q(m,w,T,U,ee,d){if(!T){var p=ae(w,U,ee);
vendor: 9,427 bytes, line 4
4U!==p&&(T=!0,ee="buffer",U=p)}var M=w.objectMode?1:U.length;w.length+=M;var P=w.length<w.highWaterMark;if(P||(w.needDrain=!0),w.writing||w.corked){var pe=w.lastBufferedRequest;w.lastBufferedRequest={chunk:U,encoding:ee,isBuf:T,callback:d,next:null},pe?pe.next=w.lastBufferedRequest:w.bufferedRequest=w.lastBufferedRequest,w.bufferedRequestCount+=1}else R(m,w,!1,M,U,ee,d);return P}function R(m,w,T,U,ee,d,p){w.writelen=U,w.writecb=p,w.writing=!0,w.sync=!0,w.destroyed?w.onwrite(new S("write")):T?m._writev(ee,w.onwrite):m._write(ee,d,w.onwrite),w.sync=!1}function A(m,w,T,U,ee){--w.pendingcb,T?(process.nextTick(ee,U),process.nextTick(fe,m,w),m._writableState.errorEmitted=!0,x(m,U)):(ee(U),m._writableState.errorEmitted=!0,x(m,U),fe(m,w))}function N(m){m.writing=!1,m.writecb=null,m.length-=m.writelen,m.writelen=0}function L(m,w){var T=m._writableState,U=T.sync,ee=T.writecb;if(typeof ee!="function")throw new v;if(N(T),w)A(m,T,U,w,ee);else{var d=Z(T)||m.destroyed;!d&&!T.corked&&!T.bufferProcessing&&T.bufferedRequest&&H(m,T),U?process.nextTick(j,m,T,d,ee):j(m,T,d,ee)}}function j(m,w,T,U){T||D(m,w),w.pendingcb--,U(),fe(m,w)}function D(m,w){w.length===0&&w.needDrain&&(w.needDrain=!1,m.emit("drain"))}function H(m,w){w.bufferProcessing=!0;var T=w.bufferedRequest;if(m._writev&&T&&T.next){var U=w.bufferedRequestCount,ee=new Array(U),d=w.corkedRequestsFree;d.entry=T;for(var p=0,M=!0;T;)ee[p]=T,T.isBuf||(M=!1),T=T.next,p+=1;ee.allBuffers=M,R(m,w,!0,w.length,ee,"",d.finish),w.pendingcb++,w.lastBufferedRequest=null,d.next?(w.corkedRequestsFree=d.next,d.next=null):w.corkedRequestsFree=new t(w),w.bufferedRequestCount=0}else{for(;T;){var P=T.chunk,pe=T.encoding,Y=T.callback,le=w.objectMode?1:P.length;if(R(m,w,!1,le,P,pe,Y),T=T.next,w.bufferedRequestCount--,w.writing)break}T===null&&(w.lastBufferedRequest=null)}w.bufferedRequest=T,w.bufferProcessing=!1}$.prototype._write=function(m,w,T){T(new g("_write()"))},$.prototype._writev=null,$.prototype.end=function(m,w,T){var U=this._writableState;return typeof m=="function"?(T=m,m=null,w=null):typeof w=="function"&&(T=w,w=null),m!=null&&this.write(m,w),U.corked&&(U.corked=1,this.uncork()),U.ending||ue(this,U,T),this},Object.defineProperty($.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Z(m){return m.ending&&m.length===0&&m.bufferedRequest===null&&!m.finished&&!m.writing}function G(m,w){m._final(function(T){w.pendingcb--,T&&x(m,T),w.prefinished=!0,m.emit("prefinish"),fe(m,w)})}function ie(m,w){!w.prefinished&&!w.finalCalled&&(typeof m._final=="function"&&!w.destroyed?(w.pendingcb++,w.finalCalled=!0,process.nextTick(G,m,w)):(w.prefinished=!0,m.emit("prefinish")))}function fe(m,w){var T=Z(w);if(T&&(ie(m,w),w.pendingcb===0&&(w.finished=!0,m.emit("finish"),w.autoDestroy))){var U=m._readableState;(!U||U.autoDestroy&&U.endEmitted)&&m.destroy()}return T}function ue(m,w,T){w.ending=!0,fe(m,w),T&&(w.finished?process.nextTick(T):m.once("finish",T)),w.ended=!0,m.writable=!1}function Be(m,w,T){var U=m.entry;for(m.entry=null;U;){var ee=U.callback;w.pendingcb--,ee(T),U=U.next}w.corkedRequestsFree.next=m}return Object.defineProperty($.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(w){this._writableState&&(this._writableState.destroyed=w)}}),$.prototype.destroy=c.destroy,$.prototype._undestroy=c.undestroy,$.prototype._destroy=function(m,w){w(m)},na}var ia,Gu;function Yr(){if(Gu)return ia;Gu=1;var t=Object.keys||function(u){var l=[];for(var f in u)l.push(f);return l};ia=o;var e=dh(),r=fh();dt(o,e);for(var n=t(r.prototype),i=0;i<n.length;i++){var s=n[i];o.prototype[s]||(o.prototype[s]=r.prototype[s])}function o(u){if(!(this instanceof o))return new o(u);e.call(this,u),r.call(this,u),this.allowHalfOpen=!0,u&&(u.readable===!1&&(this.readable=!1),u.writable===!1&&(this.writable=!1),u.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||process.nextTick(c,this)}function c(u){u.end()}return Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(l){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=l,this._writableState.destroyed=l)}}),ia}var sa={},Ju;function Qu(){if(Ju)return sa;Ju=1;var t=er.Buffer,e=t.isEncoding||function(b){switch(b=""+b,b&&b.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(b){if(!b)return"utf8";for(var y;;)switch(b){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return b;default:if(y)return;b=(""+b).toLowerCase(),y=!0}}function n(b){var y=r(b);if(typeof y!="string"&&(t.isEncoding===e||!e(b)))throw new Error("Unknown encoding: "+b);return y||b}sa.StringDecoder=i;function i(b){this.encoding=n(b);var y;switch(this.encoding){case"utf16le":this.text=f,this.end=h,y=4;break;case"utf8":this.fillLast=c,y=4;break;case"base64":this.text=g,this.end=v,y=3;break;default:this.write=C,this.end=S;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(y)}i.prototype.write=function(b){if(b.length===0)return"";var y,_;if(this.lastNeed){if(y=this.fillLast(b),y===void 0)return"";_=this.lastNeed,this.lastNeed=0}else _=0;return _<b.length?y?y+this.text(b,_):this.text(b,_):y||""},i.prototype.end=l,i.prototype.text=u,i.prototype.fillLast=function(b){if(this.lastNeed<=b.length)return b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,b.length),this.lastNeed-=b.length};function s(b){return b<=127?0:b>>5===6?2:b>>4===14?3:b>>3===30?4:b>>6===2?-1:-2}function o(b,y,_){var x=y.length-1;if(x<_)return 0;var E=s(y[x]);return E>=0?(E>0&&(b.lastNeed=E-1),E):--x<_||E===-2?0:(E=s(y[x]),E>=0?(E>0&&(b.lastNeed=E-2),E):--x<_||E===-2?0:(E=s(y[x]),E>=0?(E>0&&(E===2?E=0:b.lastNeed=E-3),E):0))}function a(b,y,_){if((y[0]&192)!==128)return b.lastNeed=0,"�";if(b.lastNeed>1&&y.length>1){if((y[1]&192)!==128)return b.lastNeed=1,"�";if(b.lastNeed>2&&y.length>2&&(y[2]&192)!==128)return b.lastNeed=2,"�"}}function c(b){var y=this.lastTotal-this.lastNeed,_=a(this,b);if(_!==void 0)return _;if(this.lastNeed<=b.length)return b.copy(this.lastChar,y,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,y,0,b.length),this.lastNeed-=b.length}function u(b,y){var _=o(this,b,y);if(!this.lastNeed)return b.toString("utf8",y);this.lastTotal=_;var x=b.length-(_-this.lastNeed);return b.copy(this.lastChar,0,x),b.toString("utf8",y,x)}function l(b){var y=b&&b.length?this.write(b):"";return this.lastNeed?y+"�":y}function f(b,y){if((b.length-y)%2===0){var _=b.toString("utf16le",y);if(_){var x=_.charCodeAt(_.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",y,b.length-1)}function h(b){var y=b&&b.length?this.write(b):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return y+this.lastChar.toString("utf16le",0,_)}return y}function g(b,y){var _=(b.length-y)%3;return _===0?b.toString("base64",y):(this.lastNeed=3-_,this.lastTotal=3,_===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",y,b.length-_))}function v(b){var y=b&&b.length?this.write(b):"";return this.lastNeed?y+this.lastChar.toString("base64",0,3-this.lastNeed):y}function C(b){return b.toString(this.encoding)}function S(b){return b&&b.length?this.write(b):""}return sa}var Zu=Cr.codes.ERR_STREAM_PREMATURE_CLOSE;function uy(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function ly(){}function fy(t){return t.setHeader&&typeof t.abort=="function"}function hh(t,e,r){if(typeof e=="function")return hh(t,null,e);e||(e={}),r=uy(r||ly);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,s=function(){t.writable||a()},o=t._writableState&&t._writableState.finished,a=function(){i=!1,o=!0,n||r.call(t)},c=t._readableState&&t._readableState.endEmitted,u=function(){n=!1,c=!0,i||r.call(t)},l=function(v){r.call(t,v)},f=function(){var v;if(n&&!c)return(!t._readableState||!t._readableState.ended)&&(v=new Zu),r.call(t,v);if(i&&!o)return(!t._writableState||!t._writableState.ended)&&(v=new Zu),r.call(t,v)},h=function(){t.req.on("finish",a)};return fy(t)?(t.on("complete",a),t.on("abort",f),t.req?h():t.on("request",h)):i&&!t._writableState&&(t.on("end",s),t.on("close",s
4)),t.on("end",u),t.on("finish",a),e.error!==!1&&t.on("error",l),t.on("close",f),function(){t.removeListener("complete",a),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",a),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",a),t.removeListener("end",u),t.removeListener("error",l),t.removeListener("close",f)}}var mc=hh,oa,Yu;function hy(){if(Yu)return oa;Yu=1;var t;function e(_,x,E){return x=r(x),x in _?Object.defineProperty(_,x,{value:E,enumerable:!0,configurable:!0,writable:!0}):_[x]=E,_}function r(_){var x=n(_,"string");return typeof x=="symbol"?x:String(x)}function n(_,x){if(typeof _!="object"||_===null)return _;var E=_[Symbol.toPrimitive];if(E!==void 0){var k=E.call(_,x||"default");if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(_)}var i=mc,s=Symbol("lastResolve"),o=Symbol("lastReject"),a=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),l=Symbol("handlePromise"),f=Symbol("stream");function h(_,x){return{value:_,done:x}}function g(_){var x=_[s];if(x!==null){var E=_[f].read();E!==null&&(_[u]=null,_[s]=null,_[o]=null,x(h(E,!1)))}}function v(_){process.nextTick(g,_)}function C(_,x){return function(E,k){_.then(function(){if(x[c]){E(h(void 0,!0));return}x[l](E,k)},k)}}var S=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((t={get stream(){return this[f]},next:function(){var x=this,E=this[a];if(E!==null)return Promise.reject(E);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(O,q){process.nextTick(function(){x[a]?q(x[a]):O(h(void 0,!0))})});var k=this[u],F;if(k)F=new Promise(C(k,this));else{var $=this[f].read();if($!==null)return Promise.resolve(h($,!1));F=new Promise(this[l])}return this[u]=F,F}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var x=this;return new Promise(function(E,k){x[f].destroy(null,function(F){if(F){k(F);return}E(h(void 0,!0))})})}),t),S),y=function(x){var E,k=Object.create(b,(E={},e(E,f,{value:x,writable:!0}),e(E,s,{value:null,writable:!0}),e(E,o,{value:null,writable:!0}),e(E,a,{value:null,writable:!0}),e(E,c,{value:x._readableState.endEmitted,writable:!0}),e(E,l,{value:function($,O){var q=k[f].read();q?(k[u]=null,k[s]=null,k[o]=null,$(h(q,!1))):(k[s]=$,k[o]=O)},writable:!0}),E));return k[u]=null,i(x,function(F){if(F&&F.code!=="ERR_STREAM_PREMATURE_CLOSE"){var $=k[o];$!==null&&(k[u]=null,k[s]=null,k[o]=null,$(F)),k[a]=F;return}var O=k[s];O!==null&&(k[u]=null,k[s]=null,k[o]=null,O(h(void 0,!0))),k[c]=!0}),x.on("readable",v.bind(null,k)),k};return oa=y,oa}var aa,Ku;function dy(){return Ku||(Ku=1,aa=function(){throw new Error("Readable.from is not available in the browser")}),aa}var ca,Xu;function dh(){if(Xu)return ca;Xu=1,ca=O;var t;O.ReadableState=$,nc.EventEmitter;var e=function(p,M){return p.listeners(M).length},r=ah,n=qi.Buffer,i=(typeof B<"u"?B:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(d){return n.from(d)}function o(d){return n.isBuffer(d)||d instanceof i}var a=ic,c;a&&a.debuglog?c=a.debuglog("stream"):c=function(){};var u=Zg(),l=ch,f=lh,h=f.getHighWaterMark,g=Cr.codes,v=g.ERR_INVALID_ARG_TYPE,C=g.ERR_STREAM_PUSH_AFTER_EOF,S=g.ERR_METHOD_NOT_IMPLEMENTED,b=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,y,_,x;dt(O,r);var E=l.errorOrDestroy,k=["error","close","destroy","pause","resume"];function F(d,p,M){if(typeof d.prependListener=="function")return d.prependListener(p,M);!d._events||!d._events[p]?d.on(p,M):Array.isArray(d._events[p])?d._events[p].unshift(M):d._events[p]=[M,d._events[p]]}function $(d,p,M){t=t||Yr(),d=d||{},typeof M!="boolean"&&(M=p instanceof t),this.objectMode=!!d.objectMode,M&&(this.objectMode=this.objectMode||!!d.readableObjectMode),this.highWaterMark=h(this,d,"readableHighWaterMark",M),this.buffer=new u,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=d.emitClose!==!1,this.autoDestroy=!!d.autoDestroy,this.destroyed=!1,this.defaultEncoding=d.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,d.encoding&&(y||(y=Qu().StringDecoder),this.decoder=new y(d.encoding),this.encoding=d.encoding)}function O(d){if(t=t||Yr(),!(this instanceof O))return new O(d);var p=this instanceof t;this._readableState=new $(d,this,p),this.readable=!0,d&&(typeof d.read=="function"&&(this._read=d.read),typeof d.destroy=="function"&&(this._destroy=d.destroy)),r.call(this)}Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(p){this._readableState&&(this._readableState.destroyed=p)}}),O.prototype.destroy=l.destroy,O.prototype._undestroy=l.undestroy,O.prototype._destroy=function(d,p){p(d)},O.prototype.push=function(d,p){var M=this._readableState,P;
vendor: 5,727 bytes, line 4
4return M.objectMode?P=!0:typeof d=="string"&&(p=p||M.defaultEncoding,p!==M.encoding&&(d=n.from(d,p),p=""),P=!0),q(this,d,p,!1,P)},O.prototype.unshift=function(d){return q(this,d,null,!0,!1)};function q(d,p,M,P,pe){c("readableAddChunk",p);var Y=d._readableState;if(p===null)Y.reading=!1,L(d,Y);else{var le;if(pe||(le=Q(Y,p)),le)E(d,le);else if(Y.objectMode||p&&p.length>0)if(typeof p!="string"&&!Y.objectMode&&Object.getPrototypeOf(p)!==n.prototype&&(p=s(p)),P)Y.endEmitted?E(d,new b):ae(d,Y,p,!0);else if(Y.ended)E(d,new C);else{if(Y.destroyed)return!1;Y.reading=!1,Y.decoder&&!M?(p=Y.decoder.write(p),Y.objectMode||p.length!==0?ae(d,Y,p,!1):H(d,Y)):ae(d,Y,p,!1)}else P||(Y.reading=!1,H(d,Y))}return!Y.ended&&(Y.length<Y.highWaterMark||Y.length===0)}function ae(d,p,M,P){p.flowing&&p.length===0&&!p.sync?(p.awaitDrain=0,d.emit("data",M)):(p.length+=p.objectMode?1:M.length,P?p.buffer.unshift(M):p.buffer.push(M),p.needReadable&&j(d)),H(d,p)}function Q(d,p){var M;return!o(p)&&typeof p!="string"&&p!==void 0&&!d.objectMode&&(M=new v("chunk",["string","Buffer","Uint8Array"],p)),M}O.prototype.isPaused=function(){return this._readableState.flowing===!1},O.prototype.setEncoding=function(d){y||(y=Qu().StringDecoder);var p=new y(d);this._readableState.decoder=p,this._readableState.encoding=this._readableState.decoder.encoding;for(var M=this._readableState.buffer.head,P="";M!==null;)P+=p.write(M.data),M=M.next;return this._readableState.buffer.clear(),P!==""&&this._readableState.buffer.push(P),this._readableState.length=P.length,this};var R=1073741824;function A(d){return d>=R?d=R:(d--,d|=d>>>1,d|=d>>>2,d|=d>>>4,d|=d>>>8,d|=d>>>16,d++),d}function N(d,p){return d<=0||p.length===0&&p.ended?0:p.objectMode?1:d!==d?p.flowing&&p.length?p.buffer.head.data.length:p.length:(d>p.highWaterMark&&(p.highWaterMark=A(d)),d<=p.length?d:p.ended?p.length:(p.needReadable=!0,0))}O.prototype.read=function(d){c("read",d),d=parseInt(d,10);var p=this._readableState,M=d;if(d!==0&&(p.emittedReadable=!1),d===0&&p.needReadable&&((p.highWaterMark!==0?p.length>=p.highWaterMark:p.length>0)||p.ended))return c("read: emitReadable",p.length,p.ended),p.length===0&&p.ended?T(this):j(this),null;if(d=N(d,p),d===0&&p.ended)return p.length===0&&T(this),null;var P=p.needReadable;c("need readable",P),(p.length===0||p.length-d<p.highWaterMark)&&(P=!0,c("length less than watermark",P)),p.ended||p.reading?(P=!1,c("reading or ended",P)):P&&(c("do read"),p.reading=!0,p.sync=!0,p.length===0&&(p.needReadable=!0),this._read(p.highWaterMark),p.sync=!1,p.reading||(d=N(M,p)));var pe;return d>0?pe=w(d,p):pe=null,pe===null?(p.needReadable=p.length<=p.highWaterMark,d=0):(p.length-=d,p.awaitDrain=0),p.length===0&&(p.ended||(p.needReadable=!0),M!==d&&p.ended&&T(this)),pe!==null&&this.emit("data",pe),pe};function L(d,p){if(c("onEofChunk"),!p.ended){if(p.decoder){var M=p.decoder.end();M&&M.length&&(p.buffer.push(M),p.length+=p.objectMode?1:M.length)}p.ended=!0,p.sync?j(d):(p.needReadable=!1,p.emittedReadable||(p.emittedReadable=!0,D(d)))}}function j(d){var p=d._readableState;c("emitReadable",p.needReadable,p.emittedReadable),p.needReadable=!1,p.emittedReadable||(c("emitReadable",p.flowing),p.emittedReadable=!0,process.nextTick(D,d))}function D(d){var p=d._readableState;c("emitReadable_",p.destroyed,p.length,p.ended),!p.destroyed&&(p.length||p.ended)&&(d.emit("readable"),p.emittedReadable=!1),p.needReadable=!p.flowing&&!p.ended&&p.length<=p.highWaterMark,m(d)}function H(d,p){p.readingMore||(p.readingMore=!0,process.nextTick(Z,d,p))}function Z(d,p){for(;!p.reading&&!p.ended&&(p.length<p.highWaterMark||p.flowing&&p.length===0);){var M=p.length;if(c("maybeReadMore read 0"),d.read(0),M===p.length)break}p.readingMore=!1}O.prototype._read=function(d){E(this,new S("_read()"))},O.prototype.pipe=function(d,p){var M=this,P=this._readableState;switch(P.pipesCount){case 0:P.pipes=d;break;case 1:P.pipes=[P.pipes,d];break;default:P.pipes.push(d);break}P.pipesCount+=1,c("pipe count=%d opts=%j",P.pipesCount,p);var pe=(!p||p.end!==!1)&&d!==process.stdout&&d!==process.stderr,Y=pe?kt:Ft;P.endEmitted?process.nextTick(Y):M.once("end",Y),d.on("unpipe",le);function le(Tt,gt){c("onunpipe"),Tt===M&>&>.hasUnpiped===!1&&(gt.hasUnpiped=!0,di())}function kt(){c("onend"),d.end()}var rr=G(M);d.on("drain",rr);var wn=!1;function di(){c("cleanup"),d.removeListener("close",Mr),d.removeListener("finish",kr),d.removeListener("drain",rr),d.removeListener("error",Ar),d.removeListener("unpipe",le),M.removeListener("end",kt),M.removeListener("end",Ft),M.removeListener("data",_n),wn=!0,P.awaitDrain&&(!d._writableState||d._writableState.needDrain)&&rr()}M.on("data",_n);function _n(Tt){c("ondata");var gt=d.write(Tt);c("dest.write",gt),gt===!1&&((P.pipesCount===1&&P.pipes===d||P.pipesCount>1&&ee(P.pipes,d)!==-1)&&!wn&&(c("false write response, pause",P.awaitDrain),P.awaitDrain++),M.pause())}function Ar(Tt){c("onerror",Tt),Ft(),d.removeListener("error",Ar),e(d,"error")===0&&E(d,Tt)}F(d,"error",Ar);function Mr(){d.removeListener("finish",kr),Ft()}d.once("close",Mr);function kr(){c("onfinish"),d.removeListener("close",Mr),Ft()}d.once("finish",kr);function Ft(){c("unpipe"),M.unpipe(d)}return d.emit("pipe",M),P.flowing||(c("pipe resume"),M.resume()),d};function G(d){return function(){var M=d._readableState;c("pipeOnDrain",M.awaitDrain),M.awaitDrain&&M.awaitDrain--,M.awaitDrain===0&&e(d,"data")&&(M.flowing=!0,m(d))}}O.prototype.unpipe=function(d){var p=this._readableState,M={hasUnpiped:!1};if(p.pipesCount===0)return this;if(p.pipesCount===1)return d&&d!==p.pipes?this:(d||(d=p.pipes),p.pipes=null,p.pipesCount=0,p.flowing=!1,d&&d.emit("unpipe",this,M),this);if(!d){var P=p.pipes,pe=p.pipesCount;p.pipes=null,p.pipesCount=0,p.flowing=!1;for(var Y=0;Y<pe;
vendor: 4,263 bytes, line 4
4Y++)P[Y].emit("unpipe",this,{hasUnpiped:!1});return this}var le=ee(p.pipes,d);return le===-1?this:(p.pipes.splice(le,1),p.pipesCount-=1,p.pipesCount===1&&(p.pipes=p.pipes[0]),d.emit("unpipe",this,M),this)},O.prototype.on=function(d,p){var M=r.prototype.on.call(this,d,p),P=this._readableState;return d==="data"?(P.readableListening=this.listenerCount("readable")>0,P.flowing!==!1&&this.resume()):d==="readable"&&!P.endEmitted&&!P.readableListening&&(P.readableListening=P.needReadable=!0,P.flowing=!1,P.emittedReadable=!1,c("on readable",P.length,P.reading),P.length?j(this):P.reading||process.nextTick(fe,this)),M},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(d,p){var M=r.prototype.removeListener.call(this,d,p);return d==="readable"&&process.nextTick(ie,this),M},O.prototype.removeAllListeners=function(d){var p=r.prototype.removeAllListeners.apply(this,arguments);return(d==="readable"||d===void 0)&&process.nextTick(ie,this),p};function ie(d){var p=d._readableState;p.readableListening=d.listenerCount("readable")>0,p.resumeScheduled&&!p.paused?p.flowing=!0:d.listenerCount("data")>0&&d.resume()}function fe(d){c("readable nexttick read 0"),d.read(0)}O.prototype.resume=function(){var d=this._readableState;return d.flowing||(c("resume"),d.flowing=!d.readableListening,ue(this,d)),d.paused=!1,this};function ue(d,p){p.resumeScheduled||(p.resumeScheduled=!0,process.nextTick(Be,d,p))}function Be(d,p){c("resume",p.reading),p.reading||d.read(0),p.resumeScheduled=!1,d.emit("resume"),m(d),p.flowing&&!p.reading&&d.read(0)}O.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function m(d){var p=d._readableState;for(c("flow",p.flowing);p.flowing&&d.read()!==null;);}O.prototype.wrap=function(d){var p=this,M=this._readableState,P=!1;d.on("end",function(){if(c("wrapped end"),M.decoder&&!M.ended){var le=M.decoder.end();le&&le.length&&p.push(le)}p.push(null)}),d.on("data",function(le){if(c("wrapped data"),M.decoder&&(le=M.decoder.write(le)),!(M.objectMode&&le==null)&&!(!M.objectMode&&(!le||!le.length))){var kt=p.push(le);kt||(P=!0,d.pause())}});for(var pe in d)this[pe]===void 0&&typeof d[pe]=="function"&&(this[pe]=function(kt){return function(){return d[kt].apply(d,arguments)}}(pe));for(var Y=0;Y<k.length;Y++)d.on(k[Y],this.emit.bind(this,k[Y]));return this._read=function(le){c("wrapped _read",le),P&&(P=!1,d.resume())},this},typeof Symbol=="function"&&(O.prototype[Symbol.asyncIterator]=function(){return _===void 0&&(_=hy()),_(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(p){this._readableState&&(this._readableState.flowing=p)}}),O._fromList=w,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function w(d,p){if(p.length===0)return null;var M;return p.objectMode?M=p.buffer.shift():!d||d>=p.length?(p.decoder?M=p.buffer.join(""):p.buffer.length===1?M=p.buffer.first():M=p.buffer.concat(p.length),p.buffer.clear()):M=p.buffer.consume(d,p.decoder),M}function T(d){var p=d._readableState;c("endReadable",p.endEmitted),p.endEmitted||(p.ended=!0,process.nextTick(U,p,d))}function U(d,p){if(c("endReadableNT",d.endEmitted,d.length),!d.endEmitted&&d.length===0&&(d.endEmitted=!0,p.readable=!1,p.emit("end"),d.autoDestroy)){var M=p._writableState;(!M||M.autoDestroy&&M.finished)&&p.destroy()}}typeof Symbol=="function"&&(O.from=function(d,p){return x===void 0&&(x=dy()),x(O,d,p)});function ee(d,p){for(var M=0,P=d.length;M<P;M++)if(d[M]===p)return M;return-1}return ca}var ph=$t,rs=Cr.codes,py=rs.ERR_METHOD_NOT_IMPLEMENTED,by=rs.ERR_MULTIPLE_CALLBACK,gy=rs.ERR_TRANSFORM_ALREADY_TRANSFORMING,yy=rs.ERR_TRANSFORM_WITH_LENGTH_0,ns=Yr();dt($t,ns);function vy(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;
4if(n===null)return this.emit("error",new by);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function $t(t){if(!(this instanceof $t))return new $t(t);ns.call(this,t),this._transformState={afterTransform:vy.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",my)}function my(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){el(t,e,r)}):el(this,null,null)}$t.prototype.push=function(t,e){return this._transformState.needTransform=!1,ns.prototype.push.call(this,t,e)};$t.prototype._transform=function(t,e,r){r(new py("_transform()"))};$t.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};$t.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};$t.prototype._destroy=function(t,e){ns.prototype._destroy.call(this,t,function(r){e(r)})};function el(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new yy;if(t._transformState.transforming)throw new gy;return t.push(null)}var wy=$n,bh=ph;dt($n,bh);function $n(t){if(!(this instanceof $n))return new $n(t);bh.call(this,t)}$n.prototype._transform=function(t,e,r){r(null,t)};var ua;function _y(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var gh=Cr.codes,Sy=gh.ERR_MISSING_ARGS,Ey=gh.ERR_STREAM_DESTROYED;function tl(t){if(t)throw t}function Cy(t){return t.setHeader&&typeof t.abort=="function"}function xy(t,e,r,n){n=_y(n);var i=!1;t.on("close",function(){i=!0}),ua===void 0&&(ua=mc),ua(t,{readable:e,writable:r},function(o){if(o)return n(o);i=!0,n()});var s=!1;return function(o){if(!i&&!s){if(s=!0,Cy(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(o||new Ey("pipe"))}}}function rl(t){t()}function Iy(t,e){return t.pipe(e)}function Ry(t){return!t.length||typeof t[t.length-1]!="function"?tl:t.pop()}function Ay(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=Ry(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Sy("streams");var i,s=e.map(function(o,a){var c=a<e.length-1,u=a>0;return xy(o,c,u,function(l){i||(i=l),l&&s.forEach(rl),!c&&(s.forEach(rl),n(i))})});return e.reduce(Iy)}var My=Ay;(function(t,e){e=t.exports=dh(),e.Stream=e,e.Readable=e,e.Writable=fh(),e.Duplex=Yr(),e.Transform=ph,e.PassThrough=wy,e.finished=mc,e.pipeline=My})(Va,Va.exports);var yh=Va.exports;const{Transform:ky}=yh;var Ty=t=>class vh extends ky{constructor(r,n,i,s,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new vh(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:Oy}=yh;var Ny=t=>class mh extends Oy{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new mh(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const Ly=Ty,Py=Ny;var Dy=function(t){const e=Ly(t),r=Py(t);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},wh={};const nl=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];wh.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[3
46]^t[46],u=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],f=t[9]^t[19]^t[29]^t[39]^t[49];let h=l^(i<<1|s>>>31),g=f^(s<<1|i>>>31);const v=t[0]^h,C=t[1]^g,S=t[10]^h,b=t[11]^g,y=t[20]^h,_=t[21]^g,x=t[30]^h,E=t[31]^g,k=t[40]^h,F=t[41]^g;h=r^(o<<1|a>>>31),g=n^(a<<1|o>>>31);const $=t[2]^h,O=t[3]^g,q=t[12]^h,ae=t[13]^g,Q=t[22]^h,R=t[23]^g,A=t[32]^h,N=t[33]^g,L=t[42]^h,j=t[43]^g;h=i^(c<<1|u>>>31),g=s^(u<<1|c>>>31);const D=t[4]^h,H=t[5]^g,Z=t[14]^h,G=t[15]^g,ie=t[24]^h,fe=t[25]^g,ue=t[34]^h,Be=t[35]^g,m=t[44]^h,w=t[45]^g;h=o^(l<<1|f>>>31),g=a^(f<<1|l>>>31);const T=t[6]^h,U=t[7]^g,ee=t[16]^h,d=t[17]^g,p=t[26]^h,M=t[27]^g,P=t[36]^h,pe=t[37]^g,Y=t[46]^h,le=t[47]^g;h=c^(r<<1|n>>>31),g=u^(n<<1|r>>>31);const kt=t[8]^h,rr=t[9]^g,wn=t[18]^h,di=t[19]^g,_n=t[28]^h,Ar=t[29]^g,Mr=t[38]^h,kr=t[39]^g,Ft=t[48]^h,Tt=t[49]^g,gt=v,Qs=C,Zs=b<<4|S>>>28,Ys=S<<4|b>>>28,Ks=y<<3|_>>>29,Xs=_<<3|y>>>29,eo=E<<9|x>>>23,to=x<<9|E>>>23,ro=k<<18|F>>>14,no=F<<18|k>>>14,io=$<<1|O>>>31,so=O<<1|$>>>31,oo=ae<<12|q>>>20,ao=q<<12|ae>>>20,co=Q<<10|R>>>22,uo=R<<10|Q>>>22,lo=N<<13|A>>>19,fo=A<<13|N>>>19,ho=L<<2|j>>>30,po=j<<2|L>>>30,bo=H<<30|D>>>2,go=D<<30|H>>>2,yo=Z<<6|G>>>26,vo=G<<6|Z>>>26,mo=fe<<11|ie>>>21,wo=ie<<11|fe>>>21,_o=ue<<15|Be>>>17,So=Be<<15|ue>>>17,Eo=w<<29|m>>>3,Co=m<<29|w>>>3,xo=T<<28|U>>>4,Io=U<<28|T>>>4,Ro=d<<23|ee>>>9,Ao=ee<<23|d>>>9,Mo=p<<25|M>>>7,ko=M<<25|p>>>7,To=P<<21|pe>>>11,Oo=pe<<21|P>>>11,No=le<<24|Y>>>8,Lo=Y<<24|le>>>8,Po=kt<<27|rr>>>5,Do=rr<<27|kt>>>5,$o=wn<<20|di>>>12,jo=di<<20|wn>>>12,Bo=Ar<<7|_n>>>25,Fo=_n<<7|Ar>>>25,Wo=Mr<<8|kr>>>24,Ho=kr<<8|Mr>>>24,Vo=Ft<<14|Tt>>>18,Uo=Tt<<14|Ft>>>18;t[0]=gt^~oo&mo,t[1]=Qs^~ao&wo,t[10]=xo^~$o&Ks,t[11]=Io^~jo&Xs,t[20]=io^~yo&Mo,t[21]=so^~vo&ko,t[30]=Po^~Zs&co,t[31]=Do^~Ys&uo,t[40]=bo^~Ro&Bo,t[41]=go^~Ao&Fo,t[2]=oo^~mo&To,t[3]=ao^~wo&Oo,t[12]=$o^~Ks&lo,t[13]=jo^~Xs&fo,t[22]=yo^~Mo&Wo,t[23]=vo^~ko&Ho,t[32]=Zs^~co&_o,t[33]=Ys^~uo&So,t[42]=Ro^~Bo&eo,t[43]=Ao^~Fo&to,t[4]=mo^~To&Vo,t[5]=wo^~Oo&Uo,t[14]=Ks^~lo&Eo,t[15]=Xs^~fo&Co,t[24]=Mo^~Wo&ro,t[25]=ko^~Ho&no,t[34]=co^~_o&No,t[35]=uo^~So&Lo,t[44]=Bo^~eo&ho,t[45]=Fo^~to&po,t[6]=To^~Vo>,t[7]=Oo^~Uo&Qs,t[16]=lo^~Eo&xo,t[17]=fo^~Co&Io,t[26]=Wo^~ro&io,t[27]=Ho^~no&so,t[36]=_o^~No&Po,t[37]=So^~Lo&Do,t[46]=eo^~ho&bo,t[47]=to^~po&go,t[8]=Vo^~gt&oo,t[9]=Uo^~Qs&ao,t[18]=Eo^~xo&$o,t[19]=Co^~Io&jo,t[28]=ro^~io&yo,t[29]=no^~so&vo,t[38]=No^~Po&Zs,t[39]=Lo^~Do&Ys,t[48]=ho^~bo&Ro,t[49]=po^~go&Ao,t[0]^=nl[e*2],t[1]^=nl[e*2+1]}};const ji=wh;function hn(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}hn.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};hn.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(ji.p1600(this.state),this.count=0)};hn.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<8*(this.count%4),t&128&&this.count===this.blockSize-1&&ji.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),ji.p1600(this.state),this.count=0,this.squeezing=!0};hn.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=Buffer.alloc(t);for(let r=0;r<t;++r)e[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(ji.p1600(this.state),this.count=0);return e};hn.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var $y=hn,jy=Dy($y);const By=jy,Fy=Gi;function _h(t){return Buffer.allocUnsafe(t).fill(0)}function Sh(t,e,r){const n=_h(e);return t=is(t),r?t.length<e?(t.copy(n),n):t.slice(0,e):t.length<e?(t.copy(n,e-t.length),n):t.slice(-e)}function Wy(t,e){return Sh(t,e,!0)}function is(t){if(!Buffer.isBuffer(t))if(Array.isArray(t))t=Buffer.from(t);else if(typeof t=="string")Eh(t)?t=Buffer.from(Uy(Ch(t)),"hex"):t=Buffer.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=Buffer.allocUnsafe(0);else if(Fy.isBN(t))t=t.toArrayLike(Buffer);else if(t.toArray)t=Buffer.from(t.toArray());else throw new Error("invalid type");return t}function Hy(t){return t=is(t),"0x"+t.toString("hex")}function Vy(t,e){return t=is(t),e||(e=256),By("keccak"+e).update(t).digest()}function Uy(t){return t.length%2?"0"+t:t}function Eh(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function Ch(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}var xh={zeros:_h,setLength:Sh,setLengthRight:Wy,isHexString:Eh,stripHexPrefix:Ch,toBuffer:is,bufferToHex:Hy,keccak:Vy};const gr=xh,fr=Gi;function Ih(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function Vr(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function il(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function Rh(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function ar(t){var e=typeof t;if(e==="string")return gr.isHexString(t)?new fr(gr.stripHexPrefix(t),16):new fr(t,10);if(e==="number")return new fr(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function _t(t,e){var r,n,i,s;if(t==="address")return _t("uint160",ar(e));if(t==="bool")return _t("uint8",e?1:0);if(t==="string")return _t("bytes",new Buffer(e,"utf8"));if(qy(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(r=Rh(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(_t(t,e[s]));if(r==="dynamic"){var o=_t("uint256",e.length);i.unshift(o)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([_t("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,gr.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=Vr(t),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return gr.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=Vr(t),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=ar(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(t.startsWith("int")){if(r=Vr(t),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=ar(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=il(t),n=ar(e),n<0)throw new Error("Supplied ufixed is negative");return _t("uint256",n.mul(new fr(2).pow(new fr(r[1]))))}else if(t.startsWith("fixed"))return r=il(t),_t("int256",ar(e).mul(new fr(2).pow(new fr(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function zy(t){return t==="string"||t==="bytes"||Rh(t)==="dynamic"}function qy(t){return t.lastIndexOf("]")===t.length-1}function Gy(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var o=Ih(t[s]),a=e[s],c=_t(o,a);zy(o)?(r.push(_t("uint256",i)),n.push(c),i+=c.length):r.push(c)}return Buffer.concat(r.concat(n))}function Ah(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s<t.length;s++){var o=Ih(t[s]),a=e[s];if(o==="bytes")i.push(a);
4else if(o==="string")i.push(new Buffer(a,"utf8"));else if(o==="bool")i.push(new Buffer(a?"01":"00","hex"));else if(o==="address")i.push(gr.setLength(a,20));else if(o.startsWith("bytes")){if(r=Vr(o),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(gr.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=Vr(o),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=ar(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(o.startsWith("int")){if(r=Vr(o),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=ar(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return Buffer.concat(i)}function Jy(t,e){return gr.keccak(Ah(t,e))}var Qy={rawEncode:Gy,solidityPack:Ah,soliditySHA3:Jy};const ut=xh,On=Qy,Mh={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"]},la={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const o=(a,c,u)=>{if(r[c]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":ut.keccak(this.encodeData(c,u,r,n))];if(u===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",ut.keccak(u)];if(c==="string")return typeof u=="string"&&(u=Buffer.from(u,"utf8")),["bytes32",ut.keccak(u)];if(c.lastIndexOf("]")===c.length-1){const l=c.slice(0,c.lastIndexOf("[")),f=u.map(h=>o(a,l,h));return["bytes32",ut.keccak(On.rawEncode(f.map(([h])=>h),f.map(([,h])=>h)))]}return[c,u]};
4for(const a of r[t]){const[c,u]=o(a.name,a.type,e[a.name]);i.push(c),s.push(u)}}else for(const o of r[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=ut.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=ut.keccak(a),s.push(a);else if(r[o.type]!==void 0)i.push("bytes32"),a=ut.keccak(this.encodeData(o.type,a,r,n)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return On.rawEncode(i,s)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return ut.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return ut.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in Mh.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),ut.keccak(Buffer.concat(n))}};var Zy={TYPED_MESSAGE_SCHEMA:Mh,TypedDataUtils:la,hashForSignTypedDataLegacy:function(t){return Yy(t.data)},hashForSignTypedData_v3:function(t){return la.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return la.hash(t.data)}};function Yy(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(s){return s.type==="bytes"?ut.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return On.soliditySHA3(["bytes32","bytes32"],[On.soliditySHA3(new Array(t.length).fill("string"),i),On.soliditySHA3(n,r)])}var Kr={};
4Object.defineProperty(Kr,"__esModule",{value:!0});Kr.filterFromParam=Kr.FilterPolyfill=void 0;const jr=Qn,Fe=W,Ky=5*60*1e3,cr={jsonrpc:"2.0",id:0};class Xy{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,jr.IntNumber)(1),this.provider=e}async newFilter(e){const r=kh(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.log(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Fe.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Fe.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Fe.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,Fe.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,Fe.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(yi())}async getFilterLogs(e){const r=(0,Fe.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},cr),{method:"eth_getLogs",params:[sl(n)]})):yi()}makeFilterId(){return(0,jr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return yi();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>r.toBlock)return vi();console.log(`Fetching logs from ${n} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},cr),{method:"eth_getLogs",params:[sl(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(u=>(0,Fe.intNumberFromHexString)(u.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>n){const u=(0,jr.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${n} to ${u}`),this.cursors.set(e,u)}}return o}async getBlockFilterChanges(e){const r=this.cursors.get(e);if(!r)return yi();const n=await this.getCurrentBlockHeight();if(r>n)return vi();console.log(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,Fe.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,jr.IntNumber)(o))))).filter(o=>!!o),s=(0,jr.IntNumber)(r+i.length);return console.log(`Moving cursor position for filter (${e}) from ${r} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},cr),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(vi())}async setInitialCursorPosition(e,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){const r=this.timeouts.get(e);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},Ky);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},cr),{method:"eth_blockNumber",params:[]}));return(0,Fe.intNumberFromHexString)((0,Fe.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},cr),{method:"eth_getBlockByNumber",params:[(0,Fe.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Fe.ensureHexString)(r.result.hash):null}}Kr.FilterPolyfill=Xy;function kh(t){return{fromBlock:ol(t.fromBlock),toBlock:ol(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}Kr.filterFromParam=kh;function sl(t){const e={fromBlock:al(t.fromBlock),toBlock:al(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function ol(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,jr.IntNumber)(0);if((0,Fe.isHexString)(t))return(0,Fe.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function al(t){return t==="latest"?t:(0,Fe.hexStringFromIntNumber)(t)}function yi(){return Object.assign(Object.assign({},cr),{error:{code:-32e3,message:"filter not found"}})}function vi(){return Object.assign(Object.assign({},cr),{result:[]})}var Th={};
4(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))})(Th);var ss={},Oh={},os={},wc=ev;function ev(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}const cl=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,s)=>{e.errorFirst?n.push(function(o,a){if(e.multiArgs){const c=new Array(arguments.length-1);for(let u=1;u<arguments.length;u++)c[u-1]=arguments[u];o?(c.unshift(o),s(c)):i(c)}else o?s(o):i(a)}):n.push(function(o){if(e.multiArgs){const a=new Array(arguments.length-1);for(let c=0;c<arguments.length;c++)a[c]=arguments[c];i(a)}else i(o)}),t.apply(this,n)})};var tv=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):cl(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];n[i]=typeof s=="function"&&r(i)?cl(s,e):s}return n},Kn={},rv=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.BaseBlockTracker=void 0;const nv=rv(_r),iv=1e3,sv=(t,e)=>t+e,ul=["sync","latest"];class ov extends nv.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*iv,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){ul.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}
4_getBlockTrackerEventCount(){return ul.map(e=>this.listenerCount(e)).reduce(sv)}_newPotentialLatest(e){const r=this._currentBlock;r&&ll(e)<=ll(r)||this._setCurrentBlock(e)}_setCurrentBlock(e){const r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Kn.BaseBlockTracker=ov;function ll(t){return Number.parseInt(t,16)}var Nh={},Lh={},Le={};class Ph extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function av(t){return it(t)&&typeof t[Symbol.iterator]=="function"}function it(t){return typeof t=="object"&&t!=null}function fl(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function xe(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function cv(t){const{done:e,value:r}=t.next();return e?void 0:r}function uv(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${xe(n)}\``}=t;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*za(t,e,r,n){av(t)||(t=[t]);for(const i of t){const s=uv(i,e,r,n);s&&(yield s)}}function*_c(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&it(e.schema)&&it(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,a))u.explanation=r.message,c="not_valid",yield[u,void 0];for(let[u,l,f]of e.entries(t,a)){const h=_c(l,f,{path:u===void 0?n:[...n,u],branch:u===void 0?i:[...i,l],coerce:s,mask:o,message:r.message});for(const g of h)g[0]?(c=g[0].refinement!=null?"not_refined":"not_valid",yield[g[0],void 0]):s&&(l=g[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):it(t)&&(l!==void 0||u in t)&&(t[u]=l))}
4if(c!=="not_valid")for(const u of e.refiner(t,a))u.explanation=r.message,c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class Se{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const l=i(c,u);return za(l,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const l=s(c,u);return za(l,u,this,c)}:this.refiner=()=>[]}assert(e,r){return Dh(e,this,r)}create(e,r){return $h(e,this,r)}is(e){return Sc(e,this)}mask(e,r){return jh(e,this,r)}validate(e,r={}){return dn(e,this,r)}}function Dh(t,e,r){const n=dn(t,e,{message:r});if(n[0])throw n[0]}function $h(t,e,r){const n=dn(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function jh(t,e,r){const n=dn(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Sc(t,e){return!dn(t,e)[0]}function dn(t,e,r={}){const n=_c(t,e,r),i=cv(n);return i[0]?[new Ph(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function lv(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Cc(n):Xn(n)}function qe(t,e){return new Se({type:t,schema:null,validator:e})}function fv(t,e){return new Se({...t,refiner:(r,n)=>r===void 0||t.refiner(r,n),validator(r,n){return r===void 0?!0:(e(r,n),t.validator(r,n))}})}function hv(t){return new Se({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function dv(t){let e;return new Se({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator(r,n){return e??(e=t()),e.validator(r,n)},coercer(r,n){return e??(e=t()),e.coercer(r,n)},refiner(r,n){return e??(e=t()),e.refiner(r,n)}})}function pv(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return Cc(n);default:return Xn(n)}}function bv(t){const e=t instanceof Se?{...t.schema}:{...t};for(const r in e)e[r]=Bh(e[r]);return Xn(e)}function gv(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];return Xn(n)}function yv(t,e){return console.warn("[email protected] - The `struct` helper has been renamed to `define`."),qe(t,e)}function vv(){return qe("any",()=>!0)}function mv(t){return new Se({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${xe(e)}`}})}function wv(){return qe("bigint",t=>typeof t=="bigint")}function _v(){return qe("boolean",t=>typeof t=="boolean")}function Sv(){return qe("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${xe(t)}`)}function Ev(t){const e={},r=t.map(n=>xe(n)).join();for(const n of t)e[n]=n;return new Se({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${xe(n)}`}})}function Cv(){return qe("func",t=>typeof t=="function"||`Expected a function, but received: ${xe(t)}`)}function xv(t){return qe("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${xe(e)}`)}function Iv(){return qe("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${xe(t)}`)}function Rv(t){return new Se({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})}function Av(t){const e=xe(t),r=typeof t;return new Se({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${xe(n)}`}})}function Mv(t,e){return new Se({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${xe(r)}`}})}function Ec(){return qe("never",()=>!1)}function kv(t){return new Se({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function Tv(){return qe("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${xe(t)}`)}function Xn(t){const e=t?Object.keys(t):[],r=Ec();return new Se({type:"object",schema:t||null,*entries(n){if(t&&it(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return it(n)||`Expected an object, but received: ${xe(n)}`},coercer(n){return it(n)?{...n}:n}})}function Bh(t){return new Se({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Ov(t,e){return new Se({type:"record",schema:null,*entries(r){if(it(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return it(r)||`Expected an object, but received: ${xe(r)}`}})}function Nv(){return qe("regexp",t=>t instanceof RegExp)}function Lv(t){return new Se({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${xe(e)}`}})}function Fh(){return qe("string",t=>typeof t=="string"||`Expected a string, but received: ${xe(t)}`)}function Pv(t){const e=Ec();return new Se({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${xe(r)}`}})}function Cc(t){const e=Object.keys(t);return new Se({type:"type",schema:t,*entries(r){if(it(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return it(r)||`Expected an object, but received: ${xe(r)}`},coercer(r){return it(r)?{...r}:r}})}function Dv(t){const e=t.map(r=>r.type).join(" | ");return new Se({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...o]=_c(r,s,n),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${xe(r)}`,...i]}})}function Wh(){return qe("unknown",()=>!0)}function xc(t,e,r){return new Se({...t,coercer:(n,i)=>Sc(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function $v(t,e,r={}){return xc(t,Wh(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&fl(n)&&fl(i)){const s={...n};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return n})}function jv(t){return xc(t,Fh(),e=>e.trim())}function Bv(t){return xr(t,"empty",e=>{const r=Hh(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function Hh(t){return t instanceof Map||t instanceof Set?t.size:t.length}function Fv(t,e,r={}){const{exclusive:n}=r;return xr(t,"max",i=>n?i<e:i<=e||`Expected a ${t.type} less than ${n?"":"or equal to "}${e} but received \`${i}\``)}function Wv(t,e,r={}){const{exclusive:n}=r;return xr(t,"min",i=>n?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function Hv(t){return xr(t,"nonempty",e=>Hh(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function Vv(t,e){return xr(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function Uv(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return xr(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function xr(t,e,r){return new Se({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),o=za(s,i,t,n);for(const a of o)yield{...a,refinement:e}}})}const zv=Object.freeze(Object.defineProperty({__proto__:null,Struct:Se,StructError:Ph,any:vv,array:mv,assert:Dh,assign:lv,bigint:wv,boolean:_v,coerce:xc,create:$h,date:Sv,defaulted:$v,define:qe,deprecated:fv,dynamic:hv,empty:Bv,enums:Ev,func:Cv,instance:xv,integer:Iv,intersection:Rv,is:Sc,lazy:dv,literal:Av,map:Mv,mask:jh,max:Fv,min:Wv,never:Ec,nonempty:Hv,nullable:kv,number:Tv,object:Xn,omit:pv,optional:Bh,partial:bv,pattern:Vv,pick:gv,record:Ov,refine:xr,regexp:Nv,set:Lv,size:Uv,string:Fh,struct:yv,trimmed:jv,tuple:Pv,type:Cc,union:Dv,unknown:Wh,validate:dn},Symbol.toStringTag,{value:"Module"})),Ir=wr(zv);
4Object.defineProperty(Le,"__esModule",{value:!0});Le.assertExhaustive=Le.assertStruct=Le.assert=Le.AssertionError=void 0;const qv=Ir;function Gv(t){return typeof t=="object"&&t!==null&&"message"in t}function Jv(t){var e,r;return typeof((r=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function Qv(t){const e=Gv(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Vh(t,e){return Jv(t)?new t({message:e}):t({message:e})}class Ic extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}Le.AssertionError=Ic;function Zv(t,e="Assertion failed.",r=Ic){if(!t)throw e instanceof Error?e:Vh(r,e)}Le.assert=Zv;function Yv(t,e,r="Assertion failed",n=Ic){try{(0,qv.assert)(t,e)}catch(i){throw Vh(n,`${r}: ${Qv(i)}.`)}}Le.assertStruct=Yv;function Kv(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}Le.assertExhaustive=Kv;var ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.base64=void 0;const Xv=Ir,e1=Le,t1=(t,e={})=>{var r,n;const i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=e.characterSet)!==null&&n!==void 0?n:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,e1.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,Xv.pattern)(t,a)};ei.base64=t1;var se={},ti={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Ir,r=Le;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function n(u){return(0,e.is)(u,t.HexStruct)}t.isHexString=n;function i(u){return(0,e.is)(u,t.StrictHexStruct)}t.isStrictHexString=i;function s(u){(0,r.assert)(n(u),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(u){(0,r.assert)(i(u),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(u){return u.startsWith("0x")?u:u.startsWith("0X")?`0x${u.substring(2)}`:`0x${u}`}t.add0x=a;function c(u){return u.startsWith("0x")||u.startsWith("0X")?u.substring(2):u}t.remove0x=c})(ti);Object.defineProperty(se,"__esModule",{value:!0});se.createDataView=se.concatBytes=se.valueToBytes=se.stringToBytes=se.numberToBytes=se.signedBigIntToBytes=se.bigIntToBytes=se.hexToBytes=se.bytesToString=se.bytesToNumber=se.bytesToSignedBigInt=se.bytesToBigInt=se.bytesToHex=se.assertIsBytes=se.isBytes=void 0;const Je=Le,qa=ti,hl=48,dl=58,pl=87;function r1(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const n1=r1();function Rc(t){return t instanceof Uint8Array}se.isBytes=Rc;function pn(t){(0,Je.assert)(Rc(t),"Value must be a Uint8Array.")}se.assertIsBytes=pn;function Uh(t){if(pn(t),t.length===0)return"0x";const e=n1(),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=e[t[n]];return(0,qa.add0x)(r.join(""))}se.bytesToHex=Uh;function zh(t){pn(t);const e=Uh(t);return BigInt(e)}se.bytesToBigInt=zh;function i1(t){pn(t);let e=BigInt(0);for(const r of t)e=(e<<BigInt(8))+BigInt(r);return BigInt.asIntN(t.length*8,e)}se.bytesToSignedBigInt=i1;function s1(t){pn(t);const e=zh(t);return(0,Je.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}se.bytesToNumber=s1;function o1(t){return pn(t),new TextDecoder().decode(t)}se.bytesToString=o1;function as(t){var e;if(((e=t==null?void 0:t.toLowerCase)===null||e===void 0?void 0:e.call(t))==="0x")return new Uint8Array;(0,qa.assertIsHexString)(t);const r=(0,qa.remove0x)(t).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const o=n.charCodeAt(s*2),a=n.charCodeAt(s*2+1),c=o-(o<dl?hl:pl),u=a-(a<dl?hl:pl);i[s]=c*16+u}return i}se.hexToBytes=as;function qh(t){(0,Je.assert)(typeof t=="bigint","Value must be a bigint."),(0,Je.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return as(e)}se.bigIntToBytes=qh;function a1(t,e){(0,Je.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function c1(t,e){(0,Je.assert)(typeof t=="bigint","Value must be a bigint."),(0,Je.assert)(typeof e=="number","Byte length must be a number."),(0,Je.assert)(e>0,"Byte length must be greater than 0."),(0,Je.assert)(a1(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}se.signedBigIntToBytes=c1;function Gh(t){(0,Je.assert)(typeof t=="number","Value must be a number."),(0,Je.assert)(t>=0,"Value must be a non-negative number."),(0,Je.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return as(e)}se.numberToBytes=Gh;function Jh(t){return(0,Je.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}se.stringToBytes=Jh;function Qh(t){if(typeof t=="bigint")return qh(t);if(typeof t=="number")return Gh(t);if(typeof t=="string")return t.startsWith("0x")?as(t):Jh(t);
4if(Rc(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}se.valueToBytes=Qh;function u1(t){const e=new Array(t.length);let r=0;for(let i=0;i<t.length;i++){const s=Qh(t[i]);e[i]=s,r+=s.length}const n=new Uint8Array(r);for(let i=0,s=0;i<e.length;i++)n.set(e[i],s),s+=e[i].length;return n}se.concatBytes=u1;function l1(t){if(typeof Buffer<"u"&&t instanceof Buffer){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}se.createDataView=l1;var cs={};Object.defineProperty(cs,"__esModule",{value:!0});cs.ChecksumStruct=void 0;const bl=Ir,f1=ei;cs.ChecksumStruct=(0,bl.size)((0,f1.base64)((0,bl.string)(),{paddingRequired:!0}),44,44);var xt={};Object.defineProperty(xt,"__esModule",{value:!0});xt.createHex=xt.createBytes=xt.createBigInt=xt.createNumber=void 0;const ye=Ir,h1=Le,Zh=se,us=ti,Yh=(0,ye.union)([(0,ye.number)(),(0,ye.bigint)(),(0,ye.string)(),us.StrictHexStruct]),d1=(0,ye.coerce)((0,ye.number)(),Yh,Number),p1=(0,ye.coerce)((0,ye.bigint)(),Yh,BigInt);(0,ye.union)([us.StrictHexStruct,(0,ye.instance)(Uint8Array)]);const b1=(0,ye.coerce)((0,ye.instance)(Uint8Array),(0,ye.union)([us.StrictHexStruct]),Zh.hexToBytes),g1=(0,ye.coerce)(us.StrictHexStruct,(0,ye.instance)(Uint8Array),Zh.bytesToHex);function y1(t){try{const e=(0,ye.create)(t,d1);return(0,h1.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){throw e instanceof ye.StructError?new Error(`Expected a number-like value, got "${t}".`):e}}xt.createNumber=y1;function v1(t){try{return(0,ye.create)(t,p1)}catch(e){throw e instanceof ye.StructError?new Error(`Expected a number-like value, got "${String(e.value)}".`):e}}xt.createBigInt=v1;function m1(t){if(typeof t=="string"&&t.toLowerCase()==="0x")return new Uint8Array;try{return(0,ye.create)(t,b1)}catch(e){throw e instanceof ye.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}xt.createBytes=m1;function w1(t){if(t instanceof Uint8Array&&t.length===0||typeof t=="string"&&t.toLowerCase()==="0x")return"0x";try{return(0,ye.create)(t,g1)}catch(e){throw e instanceof ye.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}xt.createHex=w1;var Xr={},Kh=B&&B.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},We=B&&B.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},at,vt;Object.defineProperty(Xr,"__esModule",{value:!0});Xr.FrozenSet=Xr.FrozenMap=void 0;class Ac{constructor(e){at.set(this,void 0),Kh(this,at,new Map(e),"f"),Object.freeze(this)}get size(){return We(this,at,"f").size}[(at=new WeakMap,Symbol.iterator)](){return We(this,at,"f")[Symbol.iterator]()}entries(){return We(this,at,"f").entries()}forEach(e,r){return We(this,at,"f").forEach((n,i,s)=>e.call(r,n,i,this))}get(e){return We(this,at,"f").get(e)}has(e){return We(this,at,"f").has(e)}keys(){return We(this,at,"f").keys()}values(){return We(this,at,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}Xr.FrozenMap=Ac;class Mc{constructor(e){vt.set(this,void 0),Kh(this,vt,new Set(e),"f"),Object.freeze(this)}get size(){return We(this,vt,"f").size}[(vt=new WeakMap,Symbol.iterator)](){return We(this,vt,"f")[Symbol.iterator]()}entries(){return We(this,vt,"f").entries()}forEach(e,r){return We(this,vt,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return We(this,vt,"f").has(e)}keys(){return We(this,vt,"f").keys()}values(){return We(this,vt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}
4Xr.FrozenSet=Mc;Object.freeze(Ac);Object.freeze(Ac.prototype);Object.freeze(Mc);Object.freeze(Mc.prototype);var Xh={},kc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(u){return Array.isArray(u)&&u.length>0}t.isNonEmptyArray=e;function r(u){return u==null}t.isNullOrUndefined=r;function n(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}t.isObject=n;const i=(u,l)=>Object.hasOwnProperty.call(u,l);t.hasProperty=i,function(u){u[u.Null=4]="Null",u[u.Comma=1]="Comma",u[u.Wrapper=1]="Wrapper",u[u.True=4]="True",u[u.False=5]="False",u[u.Quote=1]="Quote",u[u.Colon=1]="Colon",u[u.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(u){if(typeof u!="object"||u===null)return!1;try{let l=u;for(;Object.getPrototypeOf(l)!==null;)l=Object.getPrototypeOf(l);return Object.getPrototypeOf(u)===l}catch{return!1}}t.isPlainObject=s;function o(u){return u.charCodeAt(0)<=127}t.isASCII=o;function a(u){var l;return u.split("").reduce((h,g)=>o(g)?h+1:h+2,0)+((l=u.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&l!==void 0?l:[]).length}t.calculateStringSize=a;function c(u){return u.toString().length}t.calculateNumberSize=c})(kc);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=Ir,r=Le,n=kc;t.JsonStruct=(0,e.define)("Json",E=>{const[k]=x(E,!0);return k?!0:"Expected a valid JSON-serializable value"});function i(E){return(0,e.is)(E,t.JsonStruct)}t.isValidJson=i,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function s(E){return(0,e.is)(E,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(E,k){(0,r.assertStruct)(E,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",k)}t.assertIsJsonRpcNotification=o;function a(E){return(0,e.is)(E,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function c(E,k){(0,r.assertStruct)(E,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",k)}t.assertIsJsonRpcRequest=c,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function u(E){return(0,e.is)(E,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=u;function l(E,k){(0,r.assertStruct)(E,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",k)}t.assertIsPendingJsonRpcResponse=l;function f(E){return(0,e.is)(E,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=f;function h(E,k){(0,r.assertStruct)(E,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",k)}t.assertIsJsonRpcResponse=h;function g(E){return(0,e.is)(E,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=g;function v(E,k){(0,r.assertStruct)(E,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",k)}t.assertIsJsonRpcSuccess=v;function C(E){return(0,e.is)(E,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=C;function S(E,k){(0,r.assertStruct)(E,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",k)}t.assertIsJsonRpcFailure=S;function b(E){return(0,e.is)(E,t.JsonRpcErrorStruct)}t.isJsonRpcError=b;function y(E,k){(0,r.assertStruct)(E,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",k)}t.assertIsJsonRpcError=y;function _(E){const{permitEmptyString:k,permitFractions:F,permitNull:$}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},E);return q=>!!(typeof q=="number"&&(F||Number.isInteger(q))||typeof q=="string"&&(k||q.length>0)||$&&q===null)}t.getJsonRpcIdValidator=_;function x(E,k=!1){const F=new Set;function $(O,q){if(O===void 0)return[!1,0];if(O===null)return[!0,q?0:n.JsonSize.Null];const ae=typeof O;try{if(ae==="function")return[!1,0];if(ae==="string"||O instanceof String)return[!0,q?0:(0,n.calculateStringSize)(O)+n.JsonSize.Quote*2];if(ae==="boolean"||O instanceof Boolean)return q?[!0,0]:[!0,O==!0?n.JsonSize.True:n.JsonSize.False];if(ae==="number"||O instanceof Number)return q?[!0,0]:[!0,(0,n.calculateNumberSize)(O)];if(O instanceof Date)return q?[!0,0]:[!0,isNaN(O.getDate())?n.JsonSize.Null:n.JsonSize.Date+n.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,n.isPlainObject)(O)&&!Array.isArray(O))return[!1,0];if(F.has(O))return[!1,0];F.add(O);try{return[!0,Object.entries(O).reduce((Q,[R,A],N,L)=>{let[j,D]=$(A,q);
4if(!j)throw new Error("JSON validation did not pass. Validation process stopped.");if(F.delete(O),q)return 0;const H=Array.isArray(O)?0:R.length+n.JsonSize.Comma+n.JsonSize.Colon*2,Z=N<L.length-1?n.JsonSize.Comma:0;return Q+H+D+Z},q?0:n.JsonSize.Wrapper*2)]}catch{return[!1,0]}}return $(E,k)}t.validateJsonAndGetSize=x})(Xh);var en={},Ga={exports:{}},fa,gl;function _1(){if(gl)return fa;gl=1;var t=1e3,e=t*60,r=e*60,n=r*24,i=n*7,s=n*365.25;fa=function(l,f){f=f||{};var h=typeof l;if(h==="string"&&l.length>0)return o(l);if(h==="number"&&isFinite(l))return f.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function o(l){if(l=String(l),!(l.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(f){var h=parseFloat(f[1]),g=(f[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return h*s;case"weeks":case"week":case"w":return h*i;case"days":case"day":case"d":return h*n;case"hours":case"hour":case"hrs":case"hr":case"h":return h*r;case"minutes":case"minute":case"mins":case"min":case"m":return h*e;case"seconds":case"second":case"secs":case"sec":case"s":return h*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(l){var f=Math.abs(l);return f>=n?Math.round(l/n)+"d":f>=r?Math.round(l/r)+"h":f>=e?Math.round(l/e)+"m":f>=t?Math.round(l/t)+"s":l+"ms"}function c(l){var f=Math.abs(l);return f>=n?u(l,f,n,"day"):f>=r?u(l,f,r,"hour"):f>=e?u(l,f,e,"minute"):f>=t?u(l,f,t,"second"):l+" ms"}function u(l,f,h,g){var v=f>=h*1.5;return Math.round(l/h)+" "+g+(v?"s":"")}return fa}function S1(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=_1(),r.destroy=u,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,g,v;function C(...S){if(!C.enabled)return;const b=C,y=Number(new Date),_=y-(f||y);b.diff=_,b.prev=f,b.curr=y,f=y,S[0]=r.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let x=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(k,F)=>{if(k==="%%")return"%";x++;const $=r.formatters[F];if(typeof $=="function"){const O=S[x];k=$.call(b,O),S.splice(x,1),x--}return k}),r.formatArgs.call(b,S),(b.log||r.log).apply(b,S)}return C.namespace=l,C.useColors=r.useColors(),C.color=r.selectColor(l),C.extend=n,C.destroy=r.destroy,Object.defineProperty(C,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,v=r.enabled(l)),v),set:S=>{h=S}}),typeof r.init=="function"&&r.init(C),C}function n(l,f){const h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f;const h=(typeof l=="string"?l:"").split(/[\s,]+/),g=h.length;for(f=0;f<g;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function s(){const l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function o(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var E1=S1;(function(t,e){e.formatArgs=n,e.save=i,e.load=s,e.useColors=r,e.storage=o(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33
4CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;c.splice(1,0,u,"color: inherit");let l=0,f=0;c[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(l++,h==="%c"&&(f=l))}),c.splice(f,0,u)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function s(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=E1(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(Ga,Ga.exports);var C1=Ga.exports,x1=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(en,"__esModule",{value:!0});en.createModuleLogger=en.createProjectLogger=void 0;const I1=x1(C1),R1=(0,I1.default)("metamask");function A1(t){return R1.extend(t)}en.createProjectLogger=A1;function M1(t,e){return t.extend(e)}en.createModuleLogger=M1;var It={};Object.defineProperty(It,"__esModule",{value:!0});It.hexToBigInt=It.hexToNumber=It.bigIntToHex=It.numberToHex=void 0;const Ur=Le,jn=ti,k1=t=>((0,Ur.assert)(typeof t=="number","Value must be a number."),(0,Ur.assert)(t>=0,"Value must be a non-negative number."),(0,Ur.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,jn.add0x)(t.toString(16)));It.numberToHex=k1;const T1=t=>((0,Ur.assert)(typeof t=="bigint","Value must be a bigint."),(0,Ur.assert)(t>=0,"Value must be a non-negative bigint."),(0,jn.add0x)(t.toString(16)));It.bigIntToHex=T1;const O1=t=>{(0,jn.assertIsHexString)(t);const e=parseInt(t,16);return(0,Ur.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};It.hexToNumber=O1;const N1=t=>((0,jn.assertIsHexString)(t),BigInt((0,jn.add0x)(t)));It.hexToBigInt=N1;var ed={};Object.defineProperty(ed,"__esModule",{value:!0});var td={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,r=(s,o)=>
4{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function n(s,o){return r(s,"count"),s*o}t.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}t.timeSince=i})(td);var rd={},Ja={exports:{}};const L1="2.0.0",nd=256,P1=Number.MAX_SAFE_INTEGER||9007199254740991,D1=16,$1=nd-6,j1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var ls={MAX_LENGTH:nd,MAX_SAFE_COMPONENT_LENGTH:D1,MAX_SAFE_BUILD_LENGTH:$1,MAX_SAFE_INTEGER:P1,RELEASE_TYPES:j1,SEMVER_SPEC_VERSION:L1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const B1=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var fs=B1;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=ls,s=fs;e=t.exports={};const o=e.re=[],a=e.safeRe=[],c=e.src=[],u=e.t={};let l=0;const f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,n]],g=C=>{for(const[S,b]of h)C=C.split(`${S}*`).join(`${S}{0,${b}}`).split(`${S}+`).join(`${S}{1,${b}}`);return C},v=(C,S,b)=>{const y=g(S),_=l++;s(C,_,S),u[C]=_,c[_]=S,o[_]=new RegExp(S,b?"g":void 0),a[_]=new RegExp(y,b?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),v("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),v("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${f}+`),v("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),v("FULL",`^${c[u.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),v("LOOSE",`^${c[u.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),v("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),v("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),v("COERCERTL",c[u.COERCE],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",v("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",v("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}
vendor: 9,523 bytes, line 4
4)(Ja,Ja.exports);var ri=Ja.exports;const F1=Object.freeze({loose:!0}),W1=Object.freeze({}),H1=t=>t?typeof t!="object"?F1:t:W1;var Tc=H1;const yl=/^[0-9]+$/,id=(t,e)=>{const r=yl.test(t),n=yl.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},V1=(t,e)=>id(e,t);var sd={compareIdentifiers:id,rcompareIdentifiers:V1};const mi=fs,{MAX_LENGTH:vl,MAX_SAFE_INTEGER:wi}=ls,{safeRe:ml,t:wl}=ri,U1=Tc,{compareIdentifiers:Or}=sd;let z1=class wt{constructor(e,r){if(r=U1(r),e instanceof wt){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>vl)throw new TypeError(`version is longer than ${vl} characters`);mi("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?ml[wl.LOOSE]:ml[wl.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>wi||this.major<0)throw new TypeError("Invalid major version");if(this.minor>wi||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>wi||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<wi)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(mi("SemVer.compare",this.version,this.options,e),!(e instanceof wt)){if(typeof e=="string"&&e===this.version)return 0;e=new wt(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof wt||(e=new wt(e,this.options)),Or(this.major,e.major)||Or(this.minor,e.minor)||Or(this.patch,e.patch)}comparePre(e){if(e instanceof wt||(e=new wt(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=e.prerelease[r];if(mi("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Or(n,i)}while(++r)}compareBuild(e){e instanceof wt||(e=new wt(e,this.options));let r=0;do{const n=this.build[r],i=e.build[r];if(mi("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Or(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Or(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Ue=z1;const _l=Ue,q1=(t,e,r=!1)=>{if(t instanceof _l)return t;try{return new _l(t,e)}catch(n){if(!r)return null;throw n}};var bn=q1;const G1=bn,J1=(t,e)=>{const r=G1(t,e);return r?r.version:null};var Q1=J1;const Z1=bn,Y1=(t,e)=>{const r=Z1(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var K1=Y1;const Sl=Ue,X1=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Sl(t instanceof Sl?t.version:t,r).inc(e,n,i).version}catch{return null}};var em=X1;const El=bn,tm=(t,e)=>{const r=El(t,null,!0),n=El(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};var rm=tm;const nm=Ue,im=(t,e)=>new nm(t,e).major;var sm=im;const om=Ue,am=(t,e)=>new om(t,e).minor;var cm=am;const um=Ue,lm=(t,e)=>new um(t,e).patch;var fm=lm;const hm=bn,dm=(t,e)=>{const r=hm(t,e);return r&&r.prerelease.length?r.prerelease:null};var pm=dm;const Cl=Ue,bm=(t,e,r)=>new Cl(t,r).compare(new Cl(e,r));var pt=bm;const gm=pt,ym=(t,e,r)=>gm(e,t,r);var vm=ym;const mm=pt,wm=(t,e)=>mm(t,e,!0);var _m=wm;const xl=Ue,Sm=(t,e,r)=>{const n=new xl(t,r),i=new xl(e,r);return n.compare(i)||n.compareBuild(i)};var Oc=Sm;const Em=Oc,Cm=(t,e)=>t.sort((r,n)=>Em(r,n,e));var xm=Cm;const Im=Oc,Rm=(t,e)=>t.sort((r,n)=>Im(n,r,e));var Am=Rm;const Mm=pt,km=(t,e,r)=>Mm(t,e,r)>0;var hs=km;const Tm=pt,Om=(t,e,r)=>Tm(t,e,r)<0;var Nc=Om;const Nm=pt,Lm=(t,e,r)=>Nm(t,e,r)===0;var od=Lm;const Pm=pt,Dm=(t,e,r)=>Pm(t,e,r)!==0;var ad=Dm;const $m=pt,jm=(t,e,r)=>$m(t,e,r)>=0;var Lc=jm;const Bm=pt,Fm=(t,e,r)=>Bm(t,e,r)<=0;var Pc=Fm;const Wm=od,Hm=ad,Vm=hs,Um=Lc,zm=Nc,qm=Pc,Gm=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Wm(t,r,n);case"!=":return Hm(t,r,n);case">":return Vm(t,r,n);case">=":return Um(t,r,n);case"<":return zm(t,r,n);case"<=":return qm(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var cd=Gm;const Jm=Ue,Qm=bn,{safeRe:_i,t:Si}=ri,Zm=(t,e)=>{if(t instanceof Jm)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(_i[Si.COERCE]);else{let n;for(;(n=_i[Si.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),_i[Si.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;_i[Si.COERCERTL].lastIndex=-1}return r===null?null:Qm(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};var Ym=Zm,ha,Il;function Km(){return Il||(Il=1,ha=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),ha}var Xm=oe;oe.Node=yr;oe.create=oe;function oe(t){var e=this;if(e instanceof oe||(e=new oe),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)e.push(arguments[r]);return e}oe.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};oe.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};oe.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};oe.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)tw(this,arguments[t]);return this.length};oe.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)rw(this,arguments[t]);return this.length};oe.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};oe.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};oe.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,n=0;r!==null;n++)t.call(e,r.value,n,this),r=r.next};oe.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,n=this.length-1;r!==null;n--)t.call(e,r.value,n,this),r=r.prev};oe.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};oe.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};oe.prototype.map=function(t,e){e=e||this;for(var r=new oe,n=this.head;n!==null;)r.push(t.call(e,n.value,this)),n=n.next;return r};oe.prototype.mapReverse=function(t,e){e=e||this;for(var r=new oe,n=this.tail;n!==null;)r.push(t.call(e,n.value,this)),n=n.prev;return r};oe.prototype.reduce=function(t,e){var r,n=this.head;if(arguments.length>1)r=e;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;
vendor: 9,004 bytes, line 4
4i++)r=t(r,n.value,i),n=n.next;return r};oe.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=t(r,n.value,i),n=n.prev;return r};oe.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};oe.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};oe.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new oe;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(;i!==null&&n<e;n++,i=i.next)r.push(i.value);return r};oe.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new oe;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=this.length,i=this.tail;i!==null&&n>e;n--)i=i.prev;for(;i!==null&&n>t;n--,i=i.prev)r.push(i.value);return r};oe.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(var s=[],n=0;i&&n<e;n++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var n=0;n<r.length;n++)i=ew(this,i,r[n]);return s};oe.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=e,this.tail=t,this};function ew(t,e,r){var n=e===t.head?new yr(r,null,e,t):new yr(r,e,e.next,t);return n.next===null&&(t.tail=n),n.prev===null&&(t.head=n),t.length++,n}function tw(t,e){t.tail=new yr(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function rw(t,e){t.head=new yr(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function yr(t,e,r,n){if(!(this instanceof yr))return new yr(t,e,r,n);this.list=n,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{Km()(oe)}catch{}const nw=Xm,ur=Symbol("max"),Pt=Symbol("length"),Nr=Symbol("lengthCalculator"),Nn=Symbol("allowStale"),hr=Symbol("maxAge"),Ot=Symbol("dispose"),Rl=Symbol("noDisposeOnSet"),Ae=Symbol("lruList"),lt=Symbol("cache"),ud=Symbol("updateAgeOnGet"),da=()=>1;class iw{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[ur]=e.max||1/0;const r=e.length||da;if(this[Nr]=typeof r!="function"?da:r,this[Nn]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[hr]=e.maxAge||0,this[Ot]=e.dispose,this[Rl]=e.noDisposeOnSet||!1,this[ud]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[ur]=e||1/0,Cn(this)}get max(){return this[ur]}set allowStale(e){this[Nn]=!!e}get allowStale(){return this[Nn]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[hr]=e,Cn(this)}get maxAge(){return this[hr]}set lengthCalculator(e){typeof e!="function"&&(e=da),e!==this[Nr]&&(this[Nr]=e,this[Pt]=0,this[Ae].forEach(r=>{r.length=this[Nr](r.value,r.key),this[Pt]+=r.length})),Cn(this)}get lengthCalculator(){return this[Nr]}get length(){return this[Pt]}get itemCount(){return this[Ae].length}rforEach(e,r){r=r||this;for(let n=this[Ae].tail;n!==null;){const i=n.prev;Al(this,e,n,r),n=i}}forEach(e,r){r=r||this;for(let n=this[Ae].head;n!==null;){const i=n.next;Al(this,e,n,r),n=i}}keys(){return this[Ae].toArray().map(e=>e.key)}values(){return this[Ae].toArray().map(e=>e.value)}reset(){this[Ot]&&this[Ae]&&this[Ae].length&&this[Ae].forEach(e=>this[Ot](e.key,e.value)),this[lt]=new Map,this[Ae]=new nw,this[Pt]=0}dump(){return this[Ae].map(e=>Bi(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[Ae]}set(e,r,n){if(n=n||this[hr],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,s=this[Nr](r,e);if(this[lt].has(e)){if(s>this[ur])return zr(this,this[lt].get(e)),!1;const c=this[lt].get(e).value;return this[Ot]&&(this[Rl]||this[Ot](e,c.value)),c.now=i,c.maxAge=n,c.value=r,this[Pt]+=s-c.length,c.length=s,this.get(e),Cn(this),!0}const o=new sw(e,r,s,i,n);return o.length>this[ur]?(this[Ot]&&this[Ot](e,r),!1):(this[Pt]+=o.length,this[Ae].unshift(o),this[lt].set(e,this[Ae].head),Cn(this),!0)}has(e){if(!this[lt].has(e))return!1;const r=this[lt].get(e).value;return!Bi(this,r)}get(e){return pa(this,e,!0)}peek(e){return pa(this,e,!1)}pop(){const e=this[Ae].tail;return e?(zr(this,e),e.value):null}del(e){zr(this,this[lt].get(e))}load(e){this.reset();const r=Date.now();for(let n=e.length-1;n>=0;n--){const i=e[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[lt].forEach((e,r)=>pa(this,r,!1))}}const pa=(t,e,r)=>{const n=t[lt].get(e);if(n){const i=n.value;if(Bi(t,i)){if(zr(t,n),!t[Nn])return}else r&&(t[ud]&&(n.value.now=Date.now()),t[Ae].unshiftNode(n));return i.value}},Bi=(t,e)=>{if(!e||!e.maxAge&&!t[hr])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[hr]&&r>t[hr]},Cn=t=>{if(t[Pt]>t[ur])for(let e=t[Ae].tail;t[Pt]>t[ur]&&e!==null;){const r=e.prev;zr(t,e),e=r}},zr=(t,e)=>{if(e){const r=e.value;t[Ot]&&t[Ot](r.key,r.value),t[Pt]-=r.length,t[lt].delete(r.key),t[Ae].removeNode(e)}};class sw{constructor(e,r,n,i,s){this.key=e,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}}const Al=(t,e,r,n)=>{let i=r.value;Bi(t,i)&&(zr(t,r),t[Nn]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};var ow=iw,ba,Ml;function bt(){if(Ml)return ba;Ml=1;class t{constructor(A,N){if(N=n(N),A instanceof t)return A.loose===!!N.loose&&A.includePrerelease===!!N.includePrerelease?A:new t(A.raw,N);if(A instanceof i)return this.raw=A.value,this.set=[[A]],this.format(),this;if(this.options=N,this.loose=!!N.loose,this.includePrerelease=!!N.includePrerelease,this.raw=A.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(L=>this.parseRange(L.trim())).filter(L=>L.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const L=this.set[0];if(this.set=this.set.filter(j=>!v(j[0])),this.set.length===0)this.set=[L];else if(this.set.length>1){for(const j of this.set)if(j.length===1&&C(j[0])){this.set=[j];break}}}this.format()}format(){return this.range=this.set.map(A=>A.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(A){const L=((this.options.includePrerelease&&h)|(this.options.loose&&g))+":"+A,j=r.get(L);if(j)return j;const D=this.options.loose,H=D?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];A=A.replace(H,ae(this.options.includePrerelease)),s("hyphen replace",A),A=A.replace(a[c.COMPARATORTRIM],u),s("comparator trim",A),A=A.replace(a[c.TILDETRIM],l),s("tilde trim",A),A=A.replace(a[c.CARETTRIM],f),s("caret trim",A);let Z=A.split(" ").map(ue=>b(ue,this.options)).join(" ").split(/\s+/).map(ue=>q(ue,this.options));D&&(Z=Z.filter(ue=>(s("loose invalid filter",ue,this.options),!!ue.match(a[c.COMPARATORLOOSE])))),s("range list",Z);const G=new Map,ie=Z.map(ue=>new i(ue,this.options));for(const ue of ie){if(v(ue))return[ue];G.set(ue.value,ue)}G.size>1&&G.has("")&&G.delete("");const fe=[...G.values()];return r.set(L,fe),fe}intersects(A,N){if(!(A instanceof t))throw new TypeError("a Range is required");return this.set.some(L=>S(L,N)&&A.set.some(j=>S(j,N)&&L.every(D=>j.every(H=>D.intersects(H,N)))))}test(A){if(!A)return!1;if(typeof A=="string")try{A=new o(A,this.options)}catch{return!1}for(let N=0;N<this.set.length;N++)if(Q(this.set[N],A,this.options))return!0;return!1}}ba=t;const e=ow,r=new e({max:1e3}),n=Tc,i=ds(),s=fs,o=Ue,{safeRe:a,t:c,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:f}=ri,{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=ls,v=R=>R.value==="<0.0.0-0",C=R=>R.value==="",S=(R,A)=>{let N=!0;const L=R.slice();let j=L.pop();for(;N&&L.length;)N=L.every(D=>j.intersects(D,A)),j=L.pop();return N},b=(R,A)=>(s("comp",R,A),R=E(R,A),s("caret",R),R=_(R,A),s("tildes",R),R=F(R,A),s("xrange",R),R=O(R,A),s("stars",R),R),y=R=>!R||R.toLowerCase()==="x"||R==="*",_=(R,A)=>R.trim().split(/\s+/).map(N=>x(N,A)).join(" "),x=(R,A)=>{const N=A.loose?a[c.TILDELOOSE]:a[c.TILDE];return R.replace(N,(L,j,D,H,Z)=>{s("tilde",R,L,j,D,H,Z);let G;return y(j)?G="":y(D)?G=`>=${j}.0.0 <${+j+1}.0.0-0`:y(H)?G=`>=${j}.${D}.0 <${j}.${+D+1}.0-0`:Z?(s("replaceTilde pr",Z),G=`>=${j}.${D}.${H}-${Z} <${j}.${+D+1}.0-0`):G=`>=${j}.${D}.${H} <${j}.${+D+1}.0-0`,s("tilde return",G),G})},E=(R,A)=>R.trim().split(/\s+/).map(N=>k(N,A)).join(" "),k=(R,A)=>{s("caret",R,A);const N=A.loose?a[c.CARETLOOSE]:a[c.CARET],L=A.includePrerelease?"-0":"";return R.replace(N,(j,D,H,Z,G)=>{s("caret",R,j,D,H,Z,G);let ie;return y(D)?ie="":y(H)?ie=`>=${D}.0.0${L} <${+D+1}
4.0.0-0`:y(Z)?D==="0"?ie=`>=${D}.${H}.0${L} <${D}.${+H+1}.0-0`:ie=`>=${D}.${H}.0${L} <${+D+1}.0.0-0`:G?(s("replaceCaret pr",G),D==="0"?H==="0"?ie=`>=${D}.${H}.${Z}-${G} <${D}.${H}.${+Z+1}-0`:ie=`>=${D}.${H}.${Z}-${G} <${D}.${+H+1}.0-0`:ie=`>=${D}.${H}.${Z}-${G} <${+D+1}.0.0-0`):(s("no pr"),D==="0"?H==="0"?ie=`>=${D}.${H}.${Z}${L} <${D}.${H}.${+Z+1}-0`:ie=`>=${D}.${H}.${Z}${L} <${D}.${+H+1}.0-0`:ie=`>=${D}.${H}.${Z} <${+D+1}.0.0-0`),s("caret return",ie),ie})},F=(R,A)=>(s("replaceXRanges",R,A),R.split(/\s+/).map(N=>$(N,A)).join(" ")),$=(R,A)=>{R=R.trim();const N=A.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return R.replace(N,(L,j,D,H,Z,G)=>{s("xRange",R,L,j,D,H,Z,G);const ie=y(D),fe=ie||y(H),ue=fe||y(Z),Be=ue;return j==="="&&Be&&(j=""),G=A.includePrerelease?"-0":"",ie?j===">"||j==="<"?L="<0.0.0-0":L="*":j&&Be?(fe&&(H=0),Z=0,j===">"?(j=">=",fe?(D=+D+1,H=0,Z=0):(H=+H+1,Z=0)):j==="<="&&(j="<",fe?D=+D+1:H=+H+1),j==="<"&&(G="-0"),L=`${j+D}.${H}.${Z}${G}`):fe?L=`>=${D}.0.0${G} <${+D+1}.0.0-0`:ue&&(L=`>=${D}.${H}.0${G} <${D}.${+H+1}.0-0`),s("xRange return",L),L})},O=(R,A)=>(s("replaceStars",R,A),R.trim().replace(a[c.STAR],"")),q=(R,A)=>(s("replaceGTE0",R,A),R.trim().replace(a[A.includePrerelease?c.GTE0PRE:c.GTE0],"")),ae=R=>(A,N,L,j,D,H,Z,G,ie,fe,ue,Be,m)=>(y(L)?N="":y(j)?N=`>=${L}.0.0${R?"-0":""}`:y(D)?N=`>=${L}.${j}.0${R?"-0":""}`:H?N=`>=${N}`:N=`>=${N}${R?"-0":""}`,y(ie)?G="":y(fe)?G=`<${+ie+1}.0.0-0`:y(ue)?G=`<${ie}.${+fe+1}.0-0`:Be?G=`<=${ie}.${fe}.${ue}-${Be}`:R?G=`<${ie}.${fe}.${+ue+1}-0`:G=`<=${G}`,`${N} ${G}`.trim()),Q=(R,A,N)=>{for(let L=0;L<R.length;L++)if(!R[L].test(A))return!1;if(A.prerelease.length&&!N.includePrerelease){for(let L=0;L<R.length;L++)if(s(R[L].semver),R[L].semver!==i.ANY&&R[L].semver.prerelease.length>0){const j=R[L].semver;if(j.major===A.major&&j.minor===A.minor&&j.patch===A.patch)return!0}return!1}return!0};return ba}var ga,kl;function ds(){if(kl)return ga;kl=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(l,f){if(f=r(f),l instanceof e){if(l.loose===!!f.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),o("comparator",l,f),this.options=f,this.loose=!!f.loose,this.parse(l),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(l){const f=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],h=l.match(f);if(!h)throw new TypeError(`Invalid comparator: ${l}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=t}toString(){return this.value}test(l){if(o("Comparator.test",l,this.options.loose),this.semver===t||l===t)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return s(l,this.operator,this.semver,this.options)}intersects(l,f){if(!(l instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,f).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,f).test(l.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||s(this.semver,"<",l.semver,f)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||s(this.semver,">",l.semver,f)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}ga=e;const r=Tc,{safeRe:n,t:i}=ri,s=cd,o=fs,a=Ue,c=bt();return ga}const aw=bt(),cw=(t,e,r)=>{try{e=new aw(e,r)}catch{return!1}return e.test(t)};var ps=cw;const uw=bt(),lw=(t,e)=>new uw(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var fw=lw;const hw=Ue,dw=bt(),pw=(t,e,r)=>{let n=null,i=null,s=null;try{s=new dw(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new hw(n,r))}),n};var bw=pw;const gw=Ue,yw=bt(),vw=(t,e,r)=>{let n=null,i=null,s=null;try{s=new yw(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new gw(n,r))}),n};
vendor: 4,141 bytes, line 4
4var mw=vw;const ya=Ue,ww=bt(),Tl=hs,_w=(t,e)=>{t=new ww(t,e);let r=new ya("0.0.0");if(t.test(r)||(r=new ya("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){const i=t.set[n];let s=null;i.forEach(o=>{const a=new ya(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Tl(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Tl(r,s))&&(r=s)}return r&&t.test(r)?r:null};var Sw=_w;const Ew=bt(),Cw=(t,e)=>{try{return new Ew(t,e).range||"*"}catch{return null}};var xw=Cw;const Iw=Ue,ld=ds(),{ANY:Rw}=ld,Aw=bt(),Mw=ps,Ol=hs,Nl=Nc,kw=Pc,Tw=Lc,Ow=(t,e,r,n)=>{t=new Iw(t,n),e=new Aw(e,n);let i,s,o,a,c;switch(r){case">":i=Ol,s=kw,o=Nl,a=">",c=">=";break;case"<":i=Nl,s=Tw,o=Ol,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Mw(t,e,n))return!1;for(let u=0;u<e.set.length;++u){const l=e.set[u];let f=null,h=null;if(l.forEach(g=>{g.semver===Rw&&(g=new ld(">=0.0.0")),f=f||g,h=h||g,i(g.semver,f.semver,n)?f=g:o(g.semver,h.semver,n)&&(h=g)}),f.operator===a||f.operator===c||(!h.operator||h.operator===a)&&s(t,h.semver))return!1;if(h.operator===c&&o(t,h.semver))return!1}return!0};var Dc=Ow;const Nw=Dc,Lw=(t,e,r)=>Nw(t,e,">",r);var Pw=Lw;const Dw=Dc,$w=(t,e,r)=>Dw(t,e,"<",r);var jw=$w;const Ll=bt(),Bw=(t,e,r)=>(t=new Ll(t,r),e=new Ll(e,r),t.intersects(e,r));var Fw=Bw;const Ww=ps,Hw=pt;var Vw=(t,e,r)=>{const n=[];let i=null,s=null;const o=t.sort((l,f)=>Hw(l,f,r));for(const l of o)Ww(l,e,r)?(s=l,i||(i=l)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[l,f]of n)l===f?a.push(l):!f&&l===o[0]?a.push("*"):f?l===o[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);const c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e};const Pl=bt(),$c=ds(),{ANY:va}=$c,xn=ps,jc=pt,Uw=(t,e,r={})=>{if(t===e)return!0;t=new Pl(t,r),e=new Pl(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const o=qw(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},zw=[new $c(">=0.0.0-0")],Dl=[new $c(">=0.0.0")],qw=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===va){if(e.length===1&&e[0].semver===va)return!0;r.includePrerelease?t=zw:t=Dl}if(e.length===1&&e[0].semver===va){if(r.includePrerelease)return!0;e=Dl}const n=new Set;let i,s;for(const g of t)g.operator===">"||g.operator===">="?i=$l(i,g,r):g.operator==="<"||g.operator==="<="?s=jl(s,g,r):n.add(g.semver);if(n.size>1)return null;let o;if(i&&s){if(o=jc(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const g of n){if(i&&!xn(g,String(i),r)||s&&!xn(g,String(s),r))return null;for(const v of e)if(!xn(g,String(v),r))return!1;return!0}let a,c,u,l,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(const g of e){if(l=l||g.operator===">"||g.operator===">=",u=u||g.operator==="<"||g.operator==="<=",i){if(h&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===h.major&&g.semver.minor===h.minor&&g.semver.patch===h.patch&&(h=!1),g.operator===">"||g.operator===">="){if(a=$l(i,g,r),a===g&&a!==i)return!1}else if(i.operator===">="&&!xn(i.semver,String(g),r))return!1}if(s){if(f&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===f.major&&g.semver.minor===f.minor&&g.semver.patch===f.patch&&(f=!1),g.operator==="<"||g.operator==="<="){if(c=jl(s,g,r),c===g&&c!==s)return!1}else if(s.operator==="<="&&!xn(s.semver,String(g),r))return!1}if(!g.operator&&(s||i)&&o!==0)return!1}return!(i&&u&&!s&&o!==0||s&&l&&!i&&o!==0||h||f)},$l=(t,e,r)=>{if(!t)return e;const n=jc(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},jl=(t,e,r)=>{if(!t)return e;const n=jc(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var Gw=Uw;const ma=ri,Bl=ls,Jw=Ue,Fl=sd,Qw=bn,Zw=Q1,Yw=K1,Kw=em,Xw=rm,e_=sm,t_=cm,r_=fm,n_=pm,i_=pt,s_=vm,o_=_m,a_
4=Oc,c_=xm,u_=Am,l_=hs,f_=Nc,h_=od,d_=ad,p_=Lc,b_=Pc,g_=cd,y_=Ym,v_=ds(),m_=bt(),w_=ps,__=fw,S_=bw,E_=mw,C_=Sw,x_=xw,I_=Dc,R_=Pw,A_=jw,M_=Fw,k_=Vw,T_=Gw;var O_={parse:Qw,valid:Zw,clean:Yw,inc:Kw,diff:Xw,major:e_,minor:t_,patch:r_,prerelease:n_,compare:i_,rcompare:s_,compareLoose:o_,compareBuild:a_,sort:c_,rsort:u_,gt:l_,lt:f_,eq:h_,neq:d_,gte:p_,lte:b_,cmp:g_,coerce:y_,Comparator:v_,Range:m_,satisfies:w_,toComparators:__,maxSatisfying:S_,minSatisfying:E_,minVersion:C_,validRange:x_,outside:I_,gtr:R_,ltr:A_,intersects:M_,simplifyRange:k_,subset:T_,SemVer:Jw,re:ma.re,src:ma.src,tokens:ma.t,SEMVER_SPEC_VERSION:Bl.SEMVER_SPEC_VERSION,RELEASE_TYPES:Bl.RELEASE_TYPES,compareIdentifiers:Fl.compareIdentifiers,rcompareIdentifiers:Fl.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=O_,r=Ir,n=Le;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",f=>(0,e.valid)(f)===null?`Expected SemVer version, got "${f}"`:!0),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",f=>(0,e.validRange)(f)===null?`Expected SemVer range, got "${f}"`:!0);function i(f){return(0,r.is)(f,t.VersionStruct)}t.isValidSemVerVersion=i;function s(f){return(0,r.is)(f,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(f){(0,n.assertStruct)(f,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(f){(0,n.assertStruct)(f,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(f,h){return(0,e.gt)(f,h)}t.gtVersion=c;function u(f,h){return(0,e.gtr)(f,h)}t.gtRange=u;function l(f,h){return(0,e.satisfies)(f,h,{includePrerelease:!0})}t.satisfiesVersionRange=l})(rd);(function(t){var e=B&&B.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=B&&B.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Le,t),r(ei,t),r(se,t),r(cs,t),r(xt,t),r(Xr,t),r(ti,t),r(Xh,t),r(en,t),r(kc,t),r(It,t),r(ed,t),r(td,t),r(rd,t)})(Lh);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=Lh;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(Nh);var fd=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(os,"__esModule",{value:!0});os.PollingBlockTracker=void 0;const N_=fd(wc),L_=fd(tv),P_=Kn,Wl=Nh,Hl=(0,Wl.createModuleLogger)(Wl.projectLogger,"polling-block-tracker"),D_=(0,N_.default)(),$_=1e3;class j_ extends P_.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*$_,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const r=Vl(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: 5${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=Vl(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:D_(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),Hl("Making request",e);const r=await(0,L_.default)(n=>this._provider.sendAsync(e,n))();if(Hl("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: 6${r.error.message}`);return r.result}}os.PollingBlockTracker=j_;function Vl(t,e){return new Promise(r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()})}var bs={},B_=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bs,"__esModule",{value:!0});bs.SubscribeBlockTracker=void 0;const F_=B_(wc),W_=Kn,H_=(0,F_.default)();class V_ extends W_.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}
6async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:H_(),method:e,params:r,jsonrpc:"2.0"},(s,o)=>{s?i(s):n(o.result)})})}_handleSubData(e,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}bs.SubscribeBlockTracker=V_;var hd={};Object.defineProperty(hd,"__esModule",{value:!0});(function(t){var e=B&&B.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=B&&B.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(os,t),r(bs,t),r(hd,t)})(Oh);var Bc={},gs={},ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.getUniqueId=void 0;const dd=4294967295;let wa=Math.floor(Math.random()*dd);function U_(){return wa=(wa+1)%dd,wa}ni.getUniqueId=U_;Object.defineProperty(gs,"__esModule",{value:!0});gs.createIdRemapMiddleware=void 0;const z_=ni;function q_(){return(t,e,r,n)=>{const i=t.id,s=z_.getUniqueId();t.id=s,e.id=s,r(o=>{t.id=i,e.id=i,o()})}}gs.createIdRemapMiddleware=q_;var ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.createAsyncMiddleware=void 0;function G_(t){return async(e,r,n,i)=>{let s;const o=new Promise(l=>{s=l});let a=null,c=!1;const u=async()=>{c=!0,n(l=>{a=l,s()}),await o};try{await t(e,r,u),c?(await o,a(null)):i(null)}catch(l){a?a(l):i(l)}}}ys.createAsyncMiddleware=G_;var vs={};Object.defineProperty(vs,"__esModule",{value:!0});vs.createScaffoldMiddleware=void 0;function J_(t){return(e,r,n,i)=>{const s=t[e.method];return s===void 0?n():typeof s=="function"?s(e,r,n,i):(r.result=s,i())}}vs.createScaffoldMiddleware=J_;var ii={},Q_=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ii,"__esModule",{value:!0});ii.JsonRpcEngine=void 0;const Z_=Q_(_r),Ke=oc;class Nt extends Z_.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{const[s,o,a]=await Nt._runAllMiddleware(e,r,this._middleware);return o?(await Nt._runReturnHandlers(a),i(s)):n(async c=>{try{await Nt._runReturnHandlers(a)}catch(u){return c(u)}return c()})}catch(s){return i(s)}}}async _handleBatch(e,r){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){const o=new Ke.EthereumRpcError(Ke.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof e.method!="string"){const o=new Ke.EthereumRpcError(Ke.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(o,{id:e.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(o){s=o}return s&&(delete i.result,i.error||(i.error=Ke.serializeError(s))),r(s,i)}async _processRequest(e,r){const[n,i,s]=await Nt._runAllMiddleware(e,r,this._middleware);if(Nt._checkForCompletion(e,r,i),await Nt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(e,r,n){const i=[];let s=null,o=!1;for(const a of n)if([s,o]=await Nt._runMiddleware(e,r,a,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(s=>{const o=c=>{const u=c||r.error;u&&(r.error=Ke.serializeError(u)),s([u,!0])},a=c=>{r.error?o(r.error):(c&&(typeof c!="function"&&o(new Ke.EthereumRpcError(Ke.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request: 7${_a(e)}`,{request:e})),i.push(c)),s([null,!1]))};try{n(e,r,a,o)}catch(c){o(c)}})}static async _runReturnHandlers(e){for(const r of e)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new Ke.EthereumRpcError(Ke.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: 8${_a(e)}`,{request:e});if(!n)throw new Ke.EthereumRpcError(Ke.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: 9${_a(e)}`,{request:e})}}ii.JsonRpcEngine=Nt;function _a(t){return JSON.stringify(t,null,2)}var ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.mergeMiddleware=void 0;const Y_=ii;function K_(t){const e=new Y_.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}ms.mergeMiddleware=K_;(function(t){var e=B&&B.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}
9),r=B&&B.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(gs,t),r(ys,t),r(vs,t),r(ni,t),r(ii,t),r(ms,t)})(Bc);var pd={},Fc={};const Wc=wr(mp);var ws={};Object.defineProperty(ws,"__esModule",{value:!0});var Ul=Wc,X_=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return Ul.__awaiter(this,void 0,void 0,function(){var r,n,i;return Ul.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();ws.default=X_;Object.defineProperty(Fc,"__esModule",{value:!0});var zl=Wc,e2=ws,t2=function(){function t(){this._semaphore=new e2.default(1)}return t.prototype.acquire=function(){return zl.__awaiter(this,void 0,void 0,function(){var e,r;return zl.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();Fc.default=t2;var _s={};Object.defineProperty(_s,"__esModule",{value:!0});_s.withTimeout=void 0;var Ei=Wc;function r2(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return Ei.__awaiter(n,void 0,void 0,function(){var o,a,c;return Ei.__generator(this,function(u){switch(u.label){case 0:return o=!1,setTimeout(function(){o=!0,s(r)},e),[4,t.acquire()];case 1:return a=u.sent(),o?(c=Array.isArray(a)?a[1]:a,c()):i(a),[2]}})})})},runExclusive:function(i){return Ei.__awaiter(this,void 0,void 0,function(){var s,o;return Ei.__generator(this,function(a){switch(a.label){case 0:s=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=a.sent(),Array.isArray(o)?(s=o[1],[4,i(o[0])]):[3,4];case 3:return[2,a.sent()];case 4:return s=o,[4,i()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}_s.withTimeout=r2;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=Fc;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=ws;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=_s;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(pd);var n2=s2,i2=Object.prototype.hasOwnProperty;function s2(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var n in r)i2.call(r,n)&&(t[n]=r[n])}return t}const o2=n2,a2=wc();var c2=J;function J(t){const e=this;e.currentProvider=t}J.prototype.getBalance=si(2,"eth_getBalance");J.prototype.getCode=si(2,"eth_getCode");J.prototype.getTransactionCount=si(2,"eth_getTransactionCount");J.prototype.getStorageAt=si(3,"eth_getStorageAt");J.prototype.call=si(2,"eth_call");J.prototype.protocolVersion=te("eth_protocolVersion");J.prototype.syncing=te("eth_syncing");J.prototype.coinbase=te("eth_coinbase");J.prototype.mining=te("eth_mining");J.prototype.hashrate=te("eth_hashrate");J.prototype.gasPrice=te("eth_gasPrice");J.prototype.accounts=te("eth_accounts");J.prototype.blockNumber=te("eth_blockNumber");J.prototype.getBlockTransactionCountByHash=te("eth_getBlockTransactionCountByHash");J.prototype.getBlockTransactionCountByNumber=te("eth_getBlockTransactionCountByNumber");J.prototype.getUncleCountByBlockHash=te("eth_getUncleCountByBlockHash");J.prototype.getUncleCountByBlockNumber=te("eth_getUncleCountByBlockNumber");J.prototype.sign=te("eth_sign");J.prototype.sendTransaction=te("eth_sendTransaction");J.prototype.sendRawTransaction=te("eth_sendRawTransaction");J.prototype.estimateGas=te("eth_estimateGas");J.prototype.getBlockByHash=te("eth_getBlockByHash");J.prototype.getBlockByNumber=te("eth_getBlockByNumber");J.prototype.getTransactionByHash=te("eth_getTransactionByHash");J.prototype.getTransactionByBlockHashAndIndex=te("eth_getTransactionByBlockHashAndIndex");J.prototype.getTransactionByBlockNumberAndIndex=te("eth_getTransactionByBlockNumberAndIndex");J.prototype.getTransactionReceipt=te("eth_getTransactionReceipt");J.prototype.getUncleByBlockHashAndIndex=te("eth_getUncleByBlockHashAndIndex");J.prototype.getUncleByBlockNumberAndIndex=te("eth_getUncleByBlockNumberAndIndex");J.prototype.getCompilers=te("eth_getCompilers");J.prototype.compileLLL=te("eth_compileLLL");J.prototype.compileSolidity=te("eth_compileSolidity");J.prototype.compileSerpent=te("eth_compileSerpent");J.prototype.newFilter=te("eth_newFilter");J.prototype.newBlockFilter=te("eth_newBlockFilter");J.prototype.newPendingTransactionFilter=te("eth_newPendingTransactionFilter");J.prototype.uninstallFilter=te("eth_uninstallFilter");J.prototype.getFilterChanges=te("eth_getFilterChanges");J.prototype.getFilterLogs=te("eth_getFilterLogs");J.prototype.getLogs=te("eth_getLogs");J.prototype.getWork=te("eth_getWork");J.prototype.submitWork=te("eth_submitWork");J.prototype.submitHashrate=te("eth_submitHashrate");J.prototype.sendAsync=function(t,e){this.currentProvider.sendAsync(u2(t),function(n,i){if
9(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return e(n);e(null,i.result)})};function te(t){return function(){const e=this;var r=[].slice.call(arguments),n=r.pop();e.sendAsync({method:t,params:r},n)}}function si(t,e){return function(){const r=this;var n=[].slice.call(arguments),i=n.pop();n.length<t&&n.push("latest"),r.sendAsync({method:e,params:n},i)}}function u2(t){return o2({id:a2(),jsonrpc:"2.0",params:[]},t)}const ql=(t,e,r,n)=>function(...i){const s=e.promiseModule;return new s((o,a)=>{e.multiArgs?i.push((...u)=>{e.errorFirst?u[0]?a(u):(u.shift(),o(u)):o(u)}):e.errorFirst?i.push((u,l)=>{u?a(u):o(l)}):i.push(o),Reflect.apply(t,this===r?n:this,i)})},Gl=new WeakMap;var l2=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);const n=(o,a)=>{let c=Gl.get(o);if(c||(c={},Gl.set(o,c)),a in c)return c[a];const u=v=>typeof v=="string"||typeof a=="symbol"?a===v:v.test(a),l=Reflect.getOwnPropertyDescriptor(o,a),f=l===void 0||l.writable||l.configurable,g=(e.include?e.include.some(u):!e.exclude.some(u))&&f;return c[a]=g,g},i=new WeakMap,s=new Proxy(t,{apply(o,a,c){const u=i.get(o);if(u)return Reflect.apply(u,a,c);const l=e.excludeMain?o:ql(o,e,s,o);return i.set(o,l),Reflect.apply(l,a,c)},get(o,a){const c=o[a];if(!n(o,a)||c===Function.prototype[a])return c;const u=i.get(c);if(u)return u;if(typeof c=="function"){const l=ql(c,e,s,o);return i.set(c,l),l}return c}});return s};const f2=_r.default;let h2=class extends f2{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(r=>this.emit("update",r))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var Hc=h2;const d2=Hc;let p2=class extends d2{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var b2=p2,oi={minBlockRef:g2,maxBlockRef:y2,sortBlockRefs:Vc,bnToHex:v2,blockRefIsNumber:m2,hexToInt:Fi,incrementHexInt:w2,intToHex:bd,unsafeRandomBytes:_2};function g2(...t){return Vc(t)[0]}function y2(...t){const e=Vc(t);return e[e.length-1]}function Vc(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:Fi(e)-Fi(r))}function v2(t){return"0x"+t.toString(16)}function m2(t){return t&&!["earliest","latest","pending"].includes(t)}function Fi(t){return t==null?t:Number.parseInt(t,16)}function w2(t){if(t==null)return t;const e=Fi(t);return bd(e+1)}function bd(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function _2(t){let e="0x";for(let r=0;r<t;r++)e+=Jl(),e+=Jl();return e}function Jl(){return Math.floor(Math.random()*16).toString(16)}const S2=c2,E2=l2,C2=b2,{bnToHex:jI,hexToInt:Ci,incrementHexInt:x2,minBlockRef:I2,blockRefIsNumber:R2}=oi;let A2=class extends C2{constructor({provider:e,params:r}){super(),this.type="log",this.ethQuery=new S2(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:e}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=e),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=I2(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:r}){const n=r;let i;e?i=x2(e):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),a=(await this._fetchLogs(s)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(e){return await E2(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(Ci(this.params.fromBlock)>=Ci(e.blockNumber)||R2(this.params.toBlock)&&Ci(this.params.toBlock)<=Ci(e.blockNumber))return!1;const r=e.address&&e.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let o=e.topics[s];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(i)?i:[i];
9return a.includes(null)?!0:(a=a.map(l=>l.toLowerCase()),a.includes(o))})}};var M2=A2,Uc=k2;async function k2({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=Ql(e),s=Ql(r)-n+1,o=Array(s).fill().map((c,u)=>n+u).map(T2);return await Promise.all(o.map(c=>N2(t,"eth_getBlockByNumber",[c,!1])))}function Ql(t){return t==null?t:Number.parseInt(t,16)}function T2(t){return t==null?t:"0x"+t.toString(16)}function O2(t,e){return new Promise((r,n)=>{t.sendAsync(e,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function N2(t,e,r){for(let n=0;n<3;n++)try{return await O2(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}throw new Error(`Block not found for params: ${JSON.stringify(r)}`)}const L2=Hc,P2=Uc,{incrementHexInt:D2}=oi;let $2=class extends L2{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){const n=r,i=D2(e),o=(await P2({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(o)}};var j2=$2;const B2=Hc,F2=Uc,{incrementHexInt:W2}=oi;let H2=class extends B2{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const r=e,n=W2(e),i=await F2({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var V2=H2;const U2=pd.Mutex,{createAsyncMiddleware:z2,createScaffoldMiddleware:q2}=Bc,G2=M2,J2=j2,Q2=V2,{intToHex:gd,hexToInt:Sa}=oi;var Z2=Y2;function Y2({blockTracker:t,provider:e}){let r=0,n={};const i=new U2,s=K2({mutex:i}),o=q2({eth_newFilter:s(Ea(c)),eth_newBlockFilter:s(Ea(u)),eth_newPendingTransactionFilter:s(Ea(l)),eth_uninstallFilter:s(Ti(g)),eth_getFilterChanges:s(Ti(f)),eth_getFilterLogs:s(Ti(h))}),a=async({oldBlock:y,newBlock:_})=>{if(n.length===0)return;const x=await i.acquire();try{await Promise.all(Lr(n).map(async E=>{try{await E.update({oldBlock:y,newBlock:_})}catch(k){console.error(k)}}))}catch(E){console.error(E)}x()};return o.newLogFilter=c,o.newBlockFilter=u,o.newPendingTransactionFilter=l,o.uninstallFilter=g,o.getFilterChanges=f,o.getFilterLogs=h,o.destroy=()=>{S()},o;async function c(y){const _=new G2({provider:e,params:y});return await v(_),_}async function u(){const y=new J2({provider:e});return await v(y),y}async function l(){const y=new Q2({provider:e});return await v(y),y}async function f(y){const _=Sa(y),x=n[_];if(!x)throw new Error(`No filter for index "${_}"`);return x.getChangesAndClear()}async function h(y){const _=Sa(y),x=n[_];if(!x)throw new Error(`No filter for index "${_}"`);let E=[];return x.type==="log"&&(E=x.getAllResults()),E}async function g(y){const _=Sa(y),E=!!n[_];return E&&await C(_),E}async function v(y){const _=Lr(n).length,x=await t.getLatestBlock();await y.initialize({currentBlock:x}),r++,n[r]=y,y.id=r,y.idHex=gd(r);const E=Lr(n).length;return b({prevFilterCount:_,newFilterCount:E}),r}async function C(y){const _=Lr(n).length;delete n[y];const x=Lr(n).length;b({prevFilterCount:_,newFilterCount:x})}async function S(){const y=Lr(n).length;n={},b({prevFilterCount:y,newFilterCount:0})}function b({prevFilterCount:y,newFilterCount:_}){if(y===0&&_>0){t.on("sync",a);return}if(y>0&&_===0){t.removeListener("sync",a);return}}}function Ea(t){return Ti(async(...e)=>{const r=await t(...e);return gd(r.id)})}function Ti(t){return z2(async(e,r)=>{const n=await t.apply(null,e.params);r.result=n})}function K2({mutex:t}){return e=>async(r,n,i,s)=>{(await t.acquire())(),e(r,n,i,s)}}function Lr(t,e){const r=[];for(let n in t)r.push(t[n]);return r}const X2=_r.default,{createAsyncMiddleware:Zl,createScaffoldMiddleware:eS}=Bc,tS=Z2,{unsafeRandomBytes:rS,incrementHexInt:nS}=oi,iS=Uc;var sS=oS;function oS({blockTracker:t,provider:e}){const r={},n=tS({blockTracker:t,provider:e});let i=!1;const s=new X2,o=eS({eth_subscribe:Zl(a),eth_unsubscribe:Zl(c)});return o.destroy=l,{events:s,middleware:o};async function a(f,h){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const g=f.params[0],v=rS(16);let C;switch(g){case"newHeads":C=S({subId:v});break;case"logs":const y=f.params[1],_=await n.newLogFilter(y);C=b({subId:v,filter:_});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${g}"`)}r[v]=C,h.result=v;return;function S({subId:y}){const _={type:g,destroy:async()=>{t.removeListener("sync",_.update)},update:async({oldBlock:x,newBlock:E})=>{const k=E,F=nS(x);(await iS({provider:e,fromBlock:F,toBlock:k})).map(aS).filter(q=>q!==null).forEach(q=>{u(y,q)})}};return t.on("sync",_.update),_}function b({subId:y,filter:_}){return _.on("update",E=>u(y,E)),{type:g,destroy:async()=>await n.uninstallFilter(_.idHex)}}}async function c(f,h){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const g=f.params[0],v=r[g];if(!v){h.result=!1;return}delete r[g],await v.destroy(),h.result=!0}function u(f,h){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:f,result:h}})}function l(){s.removeAllListeners();for(const f in r)r[f].destroy(),delete r[f];i=!0}}function aS(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLim
9it:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(ss,"__esModule",{value:!0});ss.SubscriptionManager=void 0;const cS=Oh,uS=sS,Yl=()=>{};class lS{constructor(e){const r=new cS.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=uS({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){const r={};return await this.subscriptionMiddleware(e,r,Yl,Yl),r}destroy(){this.subscriptionMiddleware.destroy()}}ss.SubscriptionManager=lS;var zc=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.CoinbaseWalletProvider=void 0;const fS=zc(_r),hS=zc(Gi),Ca=cn,he=Hn,Kl=un,Xl=ht,xa=Yi,dS=de,K=W,Ia=zc(Zy),pS=Kr,ce=Th,bS=ss,ef="DefaultChainId",tf="DefaultJsonRpcUrl";class gS extends fS.default{constructor(e){var r,n;super(),this._filterPolyfill=new pS.FilterPolyfill(this),this._subscriptionManager=new bS.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=e.qrUrl,this.supportsAddressSwitching=e.supportsAddressSwitching,this.isLedger=e.isLedger;const i=this.getChainId(),s=(0,K.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(Xl.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,K.ensureAddressString)(c)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",a=>{var c;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"){if(a.data.data.action==="defaultChainChanged"||a.data.data.action==="dappChainSwitched"){const u=a.data.data.chainId,l=(c=a.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;this.updateProviderInfo(l,Number(u))}a.data.data.action==="addressChanged"&&this._setAddresses([a.data.data.address])}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,K.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(tf))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(tf,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,r){this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(ef,r.toString(10)),((0,K.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,s,o){return!!(await(await this.initializeRelay()).watchAsset(e,r,n,i,s,o==null?void 0:o.toString()).promise).result}async addEthereumChain(e,r,n,i,s,o){var a,c;if((0,K.ensureIntNumber)(e)===this.getChainId())return!1;const u=await this.initializeRelay(),l=u.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!l&&await u.requestEthereumAccounts().promise;const f=await u.addEthereumChain(e.toString(),r,s,n,i,o).promise;return((a=f.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],e),((c=f.result)===null||c===void 0?void 0:c.isApproved)===!0}async switchEthereumChain(e){const n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,dS.isErrorResponse)(n)&&n.errorCode)throw n.errorCode===he.standardErrorCodes.provider.unsupportedChain?he.standardErrors.provider.unsupportedChain(e):he.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode});const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,r){this.initializeRelay().then(n=>n.setAppInfo(e,r))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(Ca.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?Kl.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this.send(ce.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(e,r){try{const n=this._send(e,r);if(n instanceof Promise)return n.catch(i=>{throw(0,he.serializeError)(i,e)})}catch(n){throw(0,he.serializeError)(n,e)}}_send(e,r){if(typeof e=="string"){const i=e,s=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof r=="function"){const i=e,s=r;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const n=e;return this._sendRequest(n)}async sendAsync(e,r){try{return this._sendAsync(e,r).catch(n=>{throw(0,he.serializeError)(n,e)})}catch(n){return Promise.reject((0,he.serializeError)(n,e))}}async _sendAsync(e,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=r;this._sendMultipleRequestsAsync(e).then(s=>
9i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(e).then(i=>n(null,i)).catch(i=>n(i,null))}async request(e){try{return this._request(e).catch(r=>{throw(0,he.serializeError)(r,e.method)})}catch(r){return Promise.reject((0,he.serializeError)(r,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw he.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw he.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw he.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){var r;const i=await(await this.initializeRelay()).scanQRCode((0,K.ensureRegExpString)(e)).promise;if(typeof i.result!="string")throw(0,he.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",xa.Web3Method.scanQRCode);return i.result}async genericRequest(e,r){var n;const s=await(await this.initializeRelay()).genericRequest(e,r).promise;if(typeof s.result!="string")throw(0,he.serializeError)((n=s.errorMessage)!==null&&n!==void 0?n:"result was not a string",xa.Web3Method.generic);return s.result}async selectProvider(e){var r;const i=await(await this.initializeRelay()).selectProvider(e).promise;if(typeof i.result!="string")throw(0,he.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",xa.Web3Method.selectProvider);return i.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const r={jsonrpc:"2.0",id:e.id},{method:n}=e;if(r.result=this._handleSynchronousMethods(e),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(e,r){if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map(i=>(0,K.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&this.supportsAddressSwitching===!1&&!r||(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Xl.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" "))))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(a=>r(Object.assign(Object.assign({},a),{id:e.id}))).catch(a=>n(a));return}const o=this._handleSubscriptionMethods(e);if(o!==void 0){o.then(a=>r({jsonrpc:"2.0",id:e.id,result:a.result})).catch(a=>n(a));return}}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case ce.JSONRPCMethod.eth_accounts:return this._eth_accounts();case ce.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case ce.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case ce.JSONRPCMethod.net_version:return this._net_version();case ce.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case ce.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case ce.JSONRPCMethod.eth_sign:return this._eth_sign(n);case ce.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case ce.JSONRPCMethod.personal_sign:return this._personal_sign(n);case ce.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case ce.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case ce.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case ce.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case ce.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case ce.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case ce.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case ce.JSONRPCMethod.eth_signTypedData_v4:case ce.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case ce.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(n);case ce.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(n);case ce.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(n);case ce.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(e){const{method:r}=e,n=e.params||[];switch(r){case ce.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case ce.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case ce.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case ce.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case ce.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case ce.JSONRPCMethod.eth_subscribe:case ce.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const r=(0,K.ensureAddressString)(e);return this._addresses.map(i=>(0,K.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){var r;if(!this._isKnownAddress(e))throw(r=this.diagnostic)===null||r===void 0||r.log(Ca.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,K.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,K.ensureAddressString)(e.to):null,i=e.value!=null?(0,K.ensureBN)(e.value):new hS.default(0),s=e.data?(0,K.ensureBuffer)(e.data):Buffer.alloc(0),o=e.nonce!=null?(0,K.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,K.ensureBN)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,K.ensureBN)(e.maxFeePerGas):null,u=e.maxPriorityFeePerGas!=null?(0,K.ensureBN)(e.maxPriorityFeePerGas):null,l=e.gas!=null?(0,K.ensureBN)(e.gas):null,f=this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:u,gasLim
9it:l,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw he.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw he.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumMessage(e,r,n,i).promise).result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?he.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,r,n){return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,r,n).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,K.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(ef);if(!e)return(0,K.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(e,10);return(0,K.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(Ca.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?Kl.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{r=await(await this.initializeRelay()).requestEthereumAccounts().promise}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?he.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,K.ensureAddressString)(e[0]),n=(0,K.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,K.ensureBuffer)(e[0]),n=(0,K.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,K.ensureBuffer)(e[0]),n=(0,K.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,K.ensureBuffer)(e[0]),n=(0,K.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumTransaction(r).promise).result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?he.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,K.ensureBuffer)(e[0]);return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise).result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise).result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?he.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,K.ensureParsedJSONObject)(e[0]),n=(0,K.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=Ia.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,K.ensureAddressString)(e[0]),n=(0,K.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=Ia.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,K.ensureAddressString)(e[0]),n=(0,K.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=Ia.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(e){const r=e[0],n=e[1];
9if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(e){var r,n,i,s;const o=e[0];if(((r=o.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw he.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw he.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(i=o.blockExplorerUrls)!==null&&i!==void 0?i:[],o.chainName,(s=o.iconUrls)!==null&&s!==void 0?s:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw he.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw he.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw he.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw he.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,a,o,n)}}_eth_uninstallFilter(e){const r=(0,K.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(e){const r=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const r=(0,K.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){const r=(0,K.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}Gr.CoinbaseWalletProvider=gS;var Ss={},Es={};const Ze=wr(Sp);/*! ***************************************************************************** 10Copyright (c) Microsoft Corporation. 11 12Permission to use, copy, modify, and/or distribute this software for any 13purpose with or without fee is hereby granted. 14 15THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 16REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 17AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 18INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 19LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 20OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 21PERFORMANCE OF THIS SOFTWARE. 22***************************************************************************** */var Qa=function(t,e){return Qa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Qa(t,e)};function I(t,e){Qa(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function tn(t){return typeof t=="function"}var rf=!1,et={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;""+e.stack}rf=t},get useDeprecatedSynchronousErrorHandling(){return rf}};function Br(t){setTimeout(function(){throw t},0)}var Wi={closed:!0,next:function(t){},error:function(t){if(et.useDeprecatedSynchronousErrorHandling)throw t;Br(t)},complete:function(){}},He=function(){return Array.isArray||function(t){return t&&typeof t.length=="number"}}();function qc(t){return t!==null&&typeof t=="object"}var yS=function(){function t(e){return Error.call(this),this.message=e?e.length+` errors occurred during unsubscription: 23`+e.map(function(r,n){return n+1+") "+r.toString()}).join(` 24 `):"",this.name="UnsubscriptionError",this.errors=e,this}return t.prototype=Object.create(Error.prototype),t}(),Ln=yS,ve=function(){function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,n=r._parentOrParents,i=r._ctorUnsubscribe,s=r._unsubscribe,o=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(n!==null)for(var a=0;a<n.length;++a){var c=n[a];c.remove(this)}if(tn(s)){i&&(this._unsubscribe=void 0);try{s.call(this)}
24catch(f){e=f instanceof Ln?nf(f.errors):[f]}}if(He(o))for(var a=-1,u=o.length;++a<u;){var l=o[a];if(qc(l))try{l.unsubscribe()}catch(h){e=e||[],h instanceof Ln?e=e.concat(nf(h.errors)):e.push(h)}}if(e)throw new Ln(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||typeof r.unsubscribe!="function")return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;r=new t,r._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=r._parentOrParents;if(i===null)r._parentOrParents=this;else if(i instanceof t){if(i===this)return r;r._parentOrParents=[i,this]}else if(i.indexOf(this)===-1)i.push(this);else return r;var s=this._subscriptions;return s===null?this._subscriptions=[r]:s.push(r),r},t.prototype.remove=function(e){var r=this._subscriptions;if(r){var n=r.indexOf(e);n!==-1&&r.splice(n,1)}},t.EMPTY=function(e){return e.closed=!0,e}(new t),t}();function nf(t){return t.reduce(function(e,r){return e.concat(r instanceof Ln?r.errors:r)},[])}var Hi=function(){return typeof Symbol=="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),V=function(t){I(e,t);function e(r,n,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=Wi;break;case 1:if(!r){s.destination=Wi;break}if(typeof r=="object"){r instanceof e?(s.syncErrorThrowable=r.syncErrorThrowable,s.destination=r,r.add(s)):(s.syncErrorThrowable=!0,s.destination=new sf(s,r));break}default:s.syncErrorThrowable=!0,s.destination=new sf(s,r,n,i);break}return s}return e.prototype[Hi]=function(){return this},e.create=function(r,n,i){var s=new e(r,n,i);return s.syncErrorThrowable=!1,s},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var r=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=r,this},e}(ve),sf=function(t){I(e,t);function e(r,n,i,s){var o=t.call(this)||this;o._parentSubscriber=r;var a,c=o;return tn(n)?a=n:n&&(a=n.next,i=n.error,s=n.complete,n!==Wi&&(c=Object.create(n),tn(c.unsubscribe)&&o.add(c.unsubscribe.bind(c)),c.unsubscribe=o.unsubscribe.bind(o))),o._context=c,o._next=a,o._error=i,o._complete=s,o}return e.prototype.next=function(r){if(!this.isStopped&&this._next){var n=this._parentSubscriber;!et.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?this.__tryOrUnsub(this._next,r):this.__tryOrSetError(n,this._next,r)&&this.unsubscribe()}},e.prototype.error=function(r){if(!this.isStopped){var n=this._parentSubscriber,i=et.useDeprecatedSynchronousErrorHandling;if(this._error)!i||!n.syncErrorThrowable?(this.__tryOrUnsub(this._error,r),this.unsubscribe()):(this.__tryOrSetError(n,this._error,r),this.unsubscribe());else if(n.syncErrorThrowable)i?(n.syncErrorValue=r,n.syncErrorThrown=!0):Br(r),this.unsubscribe();else{if(this.unsubscribe(),i)throw r;Br(r)}}},e.prototype.complete=function(){var r=this;if(!this.isStopped){var n=this._parentSubscriber;if(this._complete){var i=function(){return r._complete.call(r._context)};!et.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?(this.__tryOrUnsub(i),this.unsubscribe()):(this.__tryOrSetError(n,i),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(r,n){try{r.call(this._context,n)}catch(i){if(this.unsubscribe(),et.useDeprecatedSynchronousErrorHandling)throw i;Br(i)}},e.prototype.__tryOrSetError=function(r,n,i){if(!et.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,i)}catch(s){return et.useDeprecatedSynchronousErrorHandling?(r.syncErrorValue=s,r.syncErrorThrown=!0,!0):(Br(s),!0)}return!1},e.prototype._unsubscribe=function(){var r=this._parentSubscriber;this._context=null,this._parentSubscriber=null,r.unsubscribe()},e}(V);function Gc(t){for(;t;){var e=t,r=e.closed,n=e.destination,i=e.isStopped;
24if(r||i)return!1;n&&n instanceof V?t=n:t=null}return!0}function vS(t,e,r){if(t){if(t instanceof V)return t;if(t[Hi])return t[Hi]()}return!t&&!e&&!r?new V(Wi):new V(t,e,r)}var gn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Yt(t){return t}function Za(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return yd(t)}function yd(t){return t.length===0?Yt:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}var X=function(){function t(e){this._isScalar=!1,e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this.operator,s=vS(e,r,n);if(i?s.add(i.call(s,this.source)):s.add(this.source||et.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),et.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){et.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=r),Gc(e)?e.error(r):console.warn(r)}},t.prototype.forEach=function(e,r){var n=this;return r=of(r),new r(function(i,s){var o;o=n.subscribe(function(a){try{e(a)}catch(c){s(c),o&&o.unsubscribe()}},s,i)})},t.prototype._subscribe=function(e){var r=this.source;return r&&r.subscribe(e)},t.prototype[gn]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.length===0?this:yd(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=of(e),new e(function(n,i){var s;r.subscribe(function(o){return s=o},function(o){return i(o)},function(){return n(s)})})},t.create=function(e){return new t(e)},t}();function of(t){if(t||(t=et.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var mS=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),qt=mS,vd=function(t){I(e,t);function e(r,n){var i=t.call(this)||this;return i.subject=r,i.subscriber=n,i.closed=!1,i}return e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var r=this.subject,n=r.observers;if(this.subject=null,!(!n||n.length===0||r.isStopped||r.closed)){var i=n.indexOf(this.subscriber);i!==-1&&n.splice(i,1)}}},e}(ve),md=function(t){I(e,t);function e(r){var n=t.call(this,r)||this;return n.destination=r,n}return e}(V),Te=function(t){I(e,t);function e(){var r=t.call(this)||this;return r.observers=[],r.closed=!1,r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype[Hi]=function(){return new md(this)},e.prototype.lift=function(r){var n=new af(this,this);return n.operator=r,n},e.prototype.next=function(r){if(this.closed)throw new qt;if(!this.isStopped)for(var n=this.observers,i=n.length,s=n.slice(),o=0;o<i;o++)s[o].next(r)},e.prototype.error=function(r){if(this.closed)throw new qt;this.hasError=!0,this.thrownError=r,this.isStopped=!0;for(var n=this.observers,i=n.length,s=n.slice(),o=0;o<i;o++)s[o].error(r);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new qt;this.isStopped=!0;for(var r=this.observers,n=r.length,i=r.slice(),s=0;s<n;s++)i[s].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(r){if(this.closed)throw new qt;return t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){if(this.closed)throw new qt;return this.hasError?(r.error(this.thrownError),ve.EMPTY):this.isStopped?(r.complete(),ve.EMPTY):(this.observers.push(r),new vd(this,r))},e.prototype.asObservable=function(){var r=new X;return r.source=this,r},e.create=function(r,n){return new af(r,n)},e}(X),af=function(t){I(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n=this.destination;n&&n.next&&n.next(r)},e.prototype.error=function(r){var n=this.destination;n&&n.error&&this.destination.error(r)},e.prototype.complete=function(){var r=this.destination;r&&r.complete&&this.destination.complete()},e.prototype._subscribe=function(r){var n=this.source;return n?this.source.subscribe(r):ve.EMPTY},e}(Te);
24function Jc(){return function(e){return e.lift(new wS(e))}}var wS=function(){function t(e){this.connectable=e}return t.prototype.call=function(e,r){var n=this.connectable;n._refCount++;var i=new _S(e,n),s=r.subscribe(i);return i.closed||(i.connection=n.connect()),s},t}(),_S=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.connectable=n,i}return e.prototype._unsubscribe=function(){var r=this.connectable;if(!r){this.connection=null;return}this.connectable=null;var n=r._refCount;if(n<=0){this.connection=null;return}if(r._refCount=n-1,n>1){this.connection=null;return}var i=this.connection,s=r._connection;this.connection=null,s&&(!i||s===i)&&s.unsubscribe()},e}(V),wd=function(t){I(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subjectFactory=n,i._refCount=0,i._isComplete=!1,i}return e.prototype._subscribe=function(r){return this.getSubject().subscribe(r)},e.prototype.getSubject=function(){var r=this._subject;return(!r||r.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var r=this._connection;return r||(this._isComplete=!1,r=this._connection=new ve,r.add(this.source.subscribe(new ES(this.getSubject(),this))),r.closed&&(this._connection=null,r=ve.EMPTY)),r},e.prototype.refCount=function(){return Jc()(this)},e}(X),SS=function(){var t=wd.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),ES=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.connectable=n,i}return e.prototype._error=function(r){this._unsubscribe(),t.prototype._error.call(this,r)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var r=this.connectable;if(r){this.connectable=null;var n=r._connection;r._refCount=0,r._subject=null,r._connection=null,n&&n.unsubscribe()}},e}(md);function CS(t,e,r,n){return function(i){return i.lift(new xS(t,e,r,n))}}var xS=function(){function t(e,r,n,i){this.keySelector=e,this.elementSelector=r,this.durationSelector=n,this.subjectSelector=i}return t.prototype.call=function(e,r){return r.subscribe(new IS(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),IS=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.keySelector=n,a.elementSelector=i,a.durationSelector=s,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return e.prototype._next=function(r){var n;try{n=this.keySelector(r)}catch(i){this.error(i);return}this._group(r,n)},e.prototype._group=function(r,n){var i=this.groups;i||(i=this.groups=new Map);var s=i.get(n),o;if(this.elementSelector)try{o=this.elementSelector(r)}catch(u){this.error(u)}else o=r;if(!s){s=this.subjectSelector?this.subjectSelector():new Te,i.set(n,s);var a=new Ya(n,s,this);if(this.destination.next(a),this.durationSelector){var c=void 0;try{c=this.durationSelector(new Ya(n,s))}catch(u){this.error(u);return}this.add(c.subscribe(new RS(n,s,this)))}}s.closed||s.next(o)},e.prototype._error=function(r){var n=this.groups;n&&(n.forEach(function(i,s){i.error(r)}),n.clear()),this.destination.error(r)},e.prototype._complete=function(){var r=this.groups;r&&(r.forEach(function(n,i){n.complete()}),r.clear()),this.destination.complete()},e.prototype.removeGroup=function(r){this.groups.delete(r)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,this.count===0&&t.prototype.unsubscribe.call(this))},e}(V),RS=function(t){I(e,t);function e(r,n,i){var s=t.call(this,n)||this;return s.key=r,s.group=n,s.parent=i,s}return e.prototype._next=function(r){this.complete()},e.prototype._unsubscribe=function(){var r=this,n=r.parent,i=r.key;this.key=this.parent=null,n&&n.removeGroup(i)},e}(V),Ya=function(t){I(e,t);function e(r,n,i){var s=t.call(this)||this;return s.key=r,s.groupSubject=n,s.refCountSubscription=i,s}return e.prototype._subscribe=function(r){var n=new ve,i=this,s=i.refCountSubscription,o=i.groupSubject;return s&&!s.closed&&n.add(new AS(s)),n.add(o.subscribe(r)),n},e}(X),AS=function(t){I(e,t);function e(r){var n=t.call(this)||this;return n.parent=r,r.count++,n}return e.prototype.unsubscribe=function(){var r=this.parent;!r.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),r.count-=1,r.count===0&&r.attemptedToUnsubscribe&&r.unsubscribe())},e}(ve),_d=function(t){I(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return n&&!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new qt;return this._value},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(Te),MS=function(t){I(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return this},e}(ve),ai=function(t){I(e,t);function e(r,n){var i=t.call(this,r,n)||this;
24return i.scheduler=r,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),this.closed)return this;this.state=r;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&this.delay===i&&this.pending===!1)return n;clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,s=void 0;try{this.work(r)}catch(o){i=!0,s=!!o&&o||new Error(o)}if(i)return this.unsubscribe(),s},e.prototype._unsubscribe=function(){var r=this.id,n=this.scheduler,i=n.actions,s=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,s!==-1&&i.splice(s,1),r!=null&&(this.id=this.recycleAsyncId(n,r,null)),this.delay=null},e}(MS),kS=function(t){I(e,t);function e(r,n){var i=t.call(this,r,n)||this;
24return i.scheduler=r,i.work=n,i}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?t.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},e.prototype.execute=function(r,n){return n>0||this.closed?t.prototype.execute.call(this,r,n):this._execute(r,n)},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0?t.prototype.requestAsyncId.call(this,r,n,i):r.flush(this)},e}(ai),Ka=function(){function t(e,r){r===void 0&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.SchedulerAction(this,e).schedule(n,r)},t.now=function(){return Date.now()},t}(),ci=function(t){I(e,t);function e(r,n){n===void 0&&(n=Ka.now);var i=t.call(this,r,function(){return e.delegate&&e.delegate!==i?e.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return e.prototype.schedule=function(r,n,i){return n===void 0&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,i):t.prototype.schedule.call(this,r,n,i)},e.prototype.flush=function(r){var n=this.actions;if(this.active){n.push(r);return}var i;this.active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this.active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(Ka),TS=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(ci),Sd=new TS(kS),Ed=Sd,rn=new X(function(t){return t.complete()});function yn(t){return t?OS(t):rn}function OS(t){return new X(function(e){return t.schedule(function(){return e.complete()})})}function Qe(t){return t&&typeof t.schedule=="function"}var Cd=function(t){return function(e){for(var r=0,n=t.length;r<n&&!e.closed;r++)e.next(t[r]);e.complete()}};function Qc(t,e){return new X(function(r){var n=new ve,i=0;return n.add(e.schedule(function(){if(i===t.length){r.complete();return}r.next(t[i++]),r.closed||n.add(this.schedule())})),n})}function ui(t,e){return e?Qc(t,e):new X(Cd(t))}function Cs(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Qe(r)?(t.pop(),Qc(t,r)):ui(t)}function Zc(t,e){return e?new X(function(r){return e.schedule(NS,0,{error:t,subscriber:r})}):new X(function(r){return r.error(t)})}function NS(t){var e=t.error,r=t.subscriber;r.error(e)}var Xa;Xa||(Xa={});var Dt=function(){function t(e,r,n){this.kind=e,this.value=r,this.error=n,this.hasValue=e==="N"}return t.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},t.prototype.do=function(e,r,n){var i=this.kind;switch(i){case"N":return e&&e(this.value);case"E":return r&&r(this.error);case"C":return n&&n()}},t.prototype.accept=function(e,r,n){return e&&typeof e.next=="function"?this.observe(e):this.do(e,r,n)},t.prototype.toObservable=function(){var e=this.kind;switch(e){case"N":return Cs(this.value);case"E":return Zc(this.error);case"C":return yn()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return typeof e<"u"?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();function LS(t,e){return e===void 0&&(e=0),function(n){return n.lift(new PS(t,e))}}var PS=function(){function t(e,r){r===void 0&&(r=0),this.scheduler=e,this.delay=r}return t.prototype.call=function(e,r){return r.subscribe(new xd(e,this.scheduler,this.delay))},t}(),xd=function(t){I(e,t);function e(r,n,i){i===void 0&&(i=0);var s=t.call(this,r)||this;
24return s.scheduler=n,s.delay=i,s}return e.dispatch=function(r){var n=r.notification,i=r.destination;n.observe(i),this.unsubscribe()},e.prototype.scheduleMessage=function(r){var n=this.destination;n.add(this.scheduler.schedule(e.dispatch,this.delay,new DS(r,this.destination)))},e.prototype._next=function(r){this.scheduleMessage(Dt.createNext(r))},e.prototype._error=function(r){this.scheduleMessage(Dt.createError(r)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(Dt.createComplete()),this.unsubscribe()},e}(V),DS=function(){function t(e,r){this.notification=e,this.destination=r}return t}(),Yc=function(t){I(e,t);function e(r,n,i){r===void 0&&(r=Number.POSITIVE_INFINITY),n===void 0&&(n=Number.POSITIVE_INFINITY);var s=t.call(this)||this;return s.scheduler=i,s._events=[],s._infiniteTimeWindow=!1,s._bufferSize=r<1?1:r,s._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(s._infiniteTimeWindow=!0,s.next=s.nextInfiniteTimeWindow):s.next=s.nextTimeWindow,s}return e.prototype.nextInfiniteTimeWindow=function(r){if(!this.isStopped){var n=this._events;n.push(r),n.length>this._bufferSize&&n.shift()}t.prototype.next.call(this,r)},e.prototype.nextTimeWindow=function(r){this.isStopped||(this._events.push(new $S(this._getNow(),r)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){var n=this._infiniteTimeWindow,i=n?this._events:this._trimBufferThenGetEvents(),s=this.scheduler,o=i.length,a;if(this.closed)throw new qt;if(this.isStopped||this.hasError?a=ve.EMPTY:(this.observers.push(r),a=new vd(this,r)),s&&r.add(r=new xd(r,s)),n)for(var c=0;c<o&&!r.closed;c++)r.next(i[c]);else for(var c=0;c<o&&!r.closed;c++)r.next(i[c].value);return this.hasError?r.error(this.thrownError):this.isStopped&&r.complete(),a},e.prototype._getNow=function(){return(this.scheduler||Ed).now()},e.prototype._trimBufferThenGetEvents=function(){for(var r=this._getNow(),n=this._bufferSize,i=this._windowTime,s=this._events,o=s.length,a=0;a<o&&!(r-s[a].time<i);)a++;return o>n&&(a=Math.max(a,o-n)),a>0&&s.splice(0,a),s},e}(Te),$S=function(){function t(e,r){this.time=e,this.value=r}return t}(),vn=function(t){I(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.value=null,r.hasNext=!1,r.hasCompleted=!1,r}return e.prototype._subscribe=function(r){return this.hasError?(r.error(this.thrownError),ve.EMPTY):this.hasCompleted&&this.hasNext?(r.next(this.value),r.complete(),ve.EMPTY):t.prototype._subscribe.call(this,r)},e.prototype.next=function(r){this.hasCompleted||(this.value=r,this.hasNext=!0)},e.prototype.error=function(r){this.hasCompleted||t.prototype.error.call(this,r)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(Te),jS=1,BS=function(){return Promise.resolve()}(),ec={};function cf(t){return t in ec?(delete ec[t],!0):!1}var uf={setImmediate:function(t){var e=jS++;return ec[e]=!0,BS.then(function(){return cf(e)&&t()}),e},clearImmediate:function(t){cf(t)}},FS=function(t){I(e,t);function e(r,n){var i=t.call(this,r,n)||this;
24return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=uf.setImmediate(r.flush.bind(r,null))))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(uf.clearImmediate(n),r.scheduled=void 0)},e}(ai),WS=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,s=-1,o=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++s<o&&(r=n.shift()));if(this.active=!1,i){for(;++s<o&&(r=n.shift());)r.unsubscribe();throw i}},e}(ci),Id=new WS(FS),Oi=Id,Rd=new ci(ai),Ve=Rd,HS=function(t){I(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=requestAnimationFrame(function(){return r.flush(null)})))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(cancelAnimationFrame(n),r.scheduled=void 0)},e}(ai),VS=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,s=-1,o=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++s<o&&(r=n.shift()));if(this.active=!1,i){for(;++s<o&&(r=n.shift());)r.unsubscribe();throw i}},e}(ci),Ad=new VS(HS),US=Ad,zS=function(t){I(e,t);function e(r,n){r===void 0&&(r=Md),n===void 0&&(n=Number.POSITIVE_INFINITY);var i=t.call(this,r,function(){return i.frame})||this;return i.maxFrames=n,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var r=this,n=r.actions,i=r.maxFrames,s,o;(o=n[0])&&o.delay<=i&&(n.shift(),this.frame=o.delay,!(s=o.execute(o.state,o.delay))););if(s){for(;o=n.shift();)o.unsubscribe();throw s}},e.frameTimeFactor=10,e}(ci),Md=function(t){I(e,t);function e(r,n,i){i===void 0&&(i=r.index+=1);var s=t.call(this,r,n)||this;
24return s.scheduler=r,s.work=n,s.index=i,s.active=!0,s.index=r.index=i,s}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),!this.id)return t.prototype.schedule.call(this,r,n);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(r,n)},e.prototype.requestAsyncId=function(r,n,i){i===void 0&&(i=0),this.delay=r.frame+i;var s=r.actions;return s.push(this),s.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(r,n,i){},e.prototype._execute=function(r,n){if(this.active===!0)return t.prototype._execute.call(this,r,n)},e.sortActions=function(r,n){return r.delay===n.delay?r.index===n.index?0:r.index>n.index?1:-1:r.delay>n.delay?1:-1},e}(ai);function St(){}function qS(t){return!!t&&(t instanceof X||typeof t.lift=="function"&&typeof t.subscribe=="function")}var GS=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),nn=GS,JS=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),li=JS,QS=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}(),kd=QS;function ot(t,e){return function(n){if(typeof t!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new ZS(t,e))}}var ZS=function(){function t(e,r){this.project=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new YS(e,this.project,this.thisArg))},t}(),YS=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.project=n,s.count=0,s.thisArg=i||s,s}return e.prototype._next=function(r){var n;try{n=this.project.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(V);function Td(t,e,r){if(e)if(Qe(e))r=e;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return Td(t,r).apply(void 0,n).pipe(ot(function(s){return He(s)?e.apply(void 0,s):e(s)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var s=this,o,a={context:s,subject:o,callbackFunc:t,scheduler:r};return new X(function(c){if(r){var l={args:n,subscriber:c,params:a};return r.schedule(KS,0,l)}else{if(!o){o=new vn;var u=function(){for(var f=[],h=0;h<arguments.length;h++)f[h]=arguments[h];o.next(f.length<=1?f[0]:f),o.complete()};try{t.apply(s,n.concat([u]))}catch(f){Gc(o)?o.error(f):console.warn(f)}}return o.subscribe(c)}})}}function KS(t){var e=this,r=t.args,n=t.subscriber,i=t.params,s=i.callbackFunc,o=i.context,a=i.scheduler,c=i.subject;if(!c){c=i.subject=new vn;var u=function(){for(var l=[],f=0;f<arguments.length;f++)l[f]=arguments[f];var h=l.length<=1?l[0]:l;e.add(a.schedule(XS,0,{value:h,subject:c}))};try{s.apply(o,r.concat([u]))}catch(l){c.error(l)}}this.add(c.subscribe(n))}function XS(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function Od(t,e,r){if(e)if(Qe(e))r=e;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return Od(t,r).apply(void 0,n).pipe(ot(function(s){return He(s)?e.apply(void 0,s):e(s)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var s={subject:void 0,args:n,callbackFunc:t,scheduler:r,context:this};return new X(function(o){var a=s.context,c=s.subject;if(r)return r.schedule(eE,0,{params:s,subscriber:o,context:a});if(!c){c=s.subject=new vn;var u=function(){for(var l=[],f=0;f<arguments.length;f++)l[f]=arguments[f];var h=l.shift();if(h){c.error(h);return}c.next(l.length<=1?l[0]:l),c.complete()};try{t.apply(a,n.concat([u]))}catch(l){Gc(c)?c.error(l):console.warn(l)}}return c.subscribe(o)})}}function eE(t){var e=this,r=t.params,n=t.subscriber,i=t.context,s=r.callbackFunc,o=r.args,a=r.scheduler,c=r.subject;if(!c){c=r.subject=new vn;var u=function(){for(var l=[],f=0;f<arguments.length;f++)l[f]=arguments[f];var h=l.shift();if(h)e.add(a.schedule(lf,0,{err:h,subject:c}));else{var g=l.length<=1?l[0]:l;e.add(a.schedule(tE,0,{value:g,subject:c}))}};try{s.apply(i,o.concat([u]))}catch(l){this.add(a.schedule(lf,0,{err:l,subject:c}))}}this.add(c.subscribe(n))}function tE(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function lf(t){var e=t.err,r=t.subject;r.error(e)}var Rr=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(r,n,i,s,o){this.destination.next(n)},e.prototype.notifyError=function(r,n){this.destination.error(r)},e.prototype.notifyComplete=function(r){this.destination.complete()},e}(V),rE=function(t){I(e,t);function e(r,n,i){var s=t.call(this)||this;return s.parent=r,s.outerValue=n,s.outerIndex=i,s.index=0,s}return e.prototype._next=function(r){this.parent.notifyNext(this.outerValue,r,this.outerIndex,this.index++,this)},e.prototype._error=function(r){this.parent.notifyError(r,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(V),nE=function(t){return function(e){return t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,Br),e}};function iE(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Kt=iE(),sE=function(t){return function(e){var r=t[Kt]();do{var n=void 0;try{n=r.next()}catch(i){return e.error(i),e}if(n.done){e.complete();break}if(e.next(n.value),e.closed)break}while(!0);return typeof r.return=="function"&&e.add(function(){r.return&&r.return()}),e}},oE=function(t){return function(e){var r=t[gn]();if(typeof r.subscribe!="function")throw new TypeError("Provided object does not correctly implement Symbol.observable");return r.subscribe(e)}},Nd=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Ld(t){return!!t&&typeof t.subscribe!="function"&&typeof t.then=="function"}var Bn=function(t){if(t&&typeof t[gn]=="function")return oE(t);if(Nd(t))return Cd(t);if(Ld(t))return nE(t);if(t&&typeof t[Kt]=="function")return sE(t);
24var e=qc(t)?"an invalid object":"'"+t+"'",r="You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(r)};function jt(t,e,r,n,i){if(i===void 0&&(i=new rE(t,r,n)),!i.closed)return e instanceof X?e.subscribe(i):Bn(e)(i)}var ff={};function aE(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=void 0,n=void 0;return Qe(t[t.length-1])&&(n=t.pop()),typeof t[t.length-1]=="function"&&(r=t.pop()),t.length===1&&He(t[0])&&(t=t[0]),ui(t,n).lift(new Kc(r))}var Kc=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new cE(e,this.resultSelector))},t}(),cE=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.resultSelector=n,i.active=0,i.values=[],i.observables=[],i}return e.prototype._next=function(r){this.values.push(ff),this.observables.push(r)},e.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{this.active=n,this.toRespond=n;for(var i=0;i<n;i++){var s=r[i];this.add(jt(this,s,void 0,i))}}},e.prototype.notifyComplete=function(r){(this.active-=1)===0&&this.destination.complete()},e.prototype.notifyNext=function(r,n,i){var s=this.values,o=s[i],a=this.toRespond?o===ff?--this.toRespond:this.toRespond:0;s[i]=n,a===0&&(this.resultSelector?this._tryResultSelector(s):this.destination.next(s.slice()))},e.prototype._tryResultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(Rr);function uE(t,e){return new X(function(r){var n=new ve;return n.add(e.schedule(function(){var i=t[gn]();n.add(i.subscribe({next:function(s){n.add(e.schedule(function(){return r.next(s)}))},error:function(s){n.add(e.schedule(function(){return r.error(s)}))},complete:function(){n.add(e.schedule(function(){return r.complete()}))}}))})),n})}function lE(t,e){return new X(function(r){var n=new ve;return n.add(e.schedule(function(){return t.then(function(i){n.add(e.schedule(function(){r.next(i),n.add(e.schedule(function(){return r.complete()}))}))},function(i){n.add(e.schedule(function(){return r.error(i)}))})})),n})}function fE(t,e){if(!t)throw new Error("Iterable cannot be null");return new X(function(r){var n=new ve,i;return n.add(function(){i&&typeof i.return=="function"&&i.return()}),n.add(e.schedule(function(){i=t[Kt](),n.add(e.schedule(function(){if(!r.closed){var s,o;try{var a=i.next();s=a.value,o=a.done}catch(c){r.error(c);return}o?r.complete():(r.next(s),this.schedule())}}))})),n})}function hE(t){return t&&typeof t[gn]=="function"}function dE(t){return t&&typeof t[Kt]=="function"}function Pd(t,e){if(t!=null){if(hE(t))return uE(t,e);if(Ld(t))return lE(t,e);if(Nd(t))return Qc(t,e);if(dE(t)||typeof t=="string")return fE(t,e)}throw new TypeError((t!==null&&typeof t||t)+" is not observable")}function Bt(t,e){return e?Pd(t,e):t instanceof X?t:new X(Bn(t))}var me=function(t){I(e,t);function e(r){var n=t.call(this)||this;return n.parent=r,n}return e.prototype._next=function(r){this.parent.notifyNext(r)},e.prototype._error=function(r){this.parent.notifyError(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(V),we=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyError=function(r){this.destination.error(r)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(V);function _e(t,e){if(!e.closed){if(t instanceof X)return t.subscribe(e);var r;try{r=Bn(t)(e)}catch(n){e.error(n)}return r}}function vr(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof e=="function"?function(n){return n.pipe(vr(function(i,s){return Bt(t(i,s)).pipe(ot(function(o,a){return e(i,o,s,a)}))},r))}:(typeof e=="number"&&(r=e),function(n){return n.lift(new pE(t,r))})}var pE=function(){function t(e,r){r===void 0&&(r=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=r}return t.prototype.call=function(e,r){return r.subscribe(new bE(e,this.project,this.concurrent))},t}(),bE=function(t){I(e,t);function e(r,n,i){i===void 0&&(i=Number.POSITIVE_INFINITY);var s=t.call(this,r)||this;return s.project=n,s.concurrent=i,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return e.prototype._next=function(r){this.active<this.concurrent?this._tryNext(r):this.buffer.push(r)},e.prototype._tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this.active++,this._innerSub(n)},e.prototype._innerSub=function(r){var n=new me(this),i=this.destination;i.add(n);var s=_e(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},e}(we),gE=vr;function Xc(t){return t===void 0&&(t=Number.POSITIVE_INFINITY),vr(Yt,t)}function Dd(){return Xc(1)}function Fn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Dd()(Cs.apply(void 0,t))}function eu(t){return new X(function(e){var r;try{r=t()}catch(i){e.error(i);return}var n=r?Bt(r):yn();return n.subscribe(e)})}function yE(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1){var r=t[0];if(He(r))return xi(r,null);if(qc(r)&&Object.getPrototypeOf(r)===Object.prototype){var n=Object.keys(r);return xi(n.map(function(s){return r[s]}),n)}}if(typeof t[t.length-1]=="function"){var i=t.pop();return t=t.length===1&&He(t[0])?t[0]:t,xi(t,null).pipe(ot(function(s){return i.apply(void 0,s)}))}return xi(t,null)}function xi(t,e){return new X(function(r){var n=t.length;if(n===0){r.complete();return}for(var i=new Array(n),s=0,o=0,a=function(u){var l=Bt(t[u]),f=!1;r.add(l.subscribe({next:function(h){f||(f=!0,o++),i[u]=h},error:function(h){return r.error(h)},complete:function(){s++,(s===n||!f)&&(o===n&&r.next(e?e.reduce(function(h,g,v){return h[g]=i[v],h},{}):i),r.complete())}}))},c=0;c<n;c++)a(c)})}function $d(t,e,r,n){return tn(r)&&(n=r,r=void 0),n?$d(t,e,r).pipe(ot(function(i){return He(i)?n.apply(void 0,i):n(i)})):new X(function(i){function s(o){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(o)}jd(t,e,s,i,r)})}
24function jd(t,e,r,n,i){var s;if(wE(t)){var o=t;t.addEventListener(e,r,i),s=function(){return o.removeEventListener(e,r,i)}}else if(mE(t)){var a=t;t.on(e,r),s=function(){return a.off(e,r)}}else if(vE(t)){var c=t;t.addListener(e,r),s=function(){return c.removeListener(e,r)}}else if(t&&t.length)for(var u=0,l=t.length;u<l;u++)jd(t[u],e,r,n,i);else throw new TypeError("Invalid event target");n.add(s)}function vE(t){return t&&typeof t.addListener=="function"&&typeof t.removeListener=="function"}function mE(t){return t&&typeof t.on=="function"&&typeof t.off=="function"}function wE(t){return t&&typeof t.addEventListener=="function"&&typeof t.removeEventListener=="function"}function Bd(t,e,r){return r?Bd(t,e).pipe(ot(function(n){return He(n)?r.apply(void 0,n):r(n)})):new X(function(n){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return n.next(o.length===1?o[0]:o)},s;try{s=t(i)}catch(o){n.error(o);return}if(tn(e))return function(){return e(i,s)}})}function _E(t,e,r,n,i){var s,o;if(arguments.length==1){var a=t;o=a.initialState,e=a.condition,r=a.iterate,s=a.resultSelector||Yt,i=a.scheduler}else n===void 0||Qe(n)?(o=t,s=Yt,i=n):(o=t,s=n);return new X(function(c){var u=o;if(i)return i.schedule(SE,0,{subscriber:c,iterate:r,condition:e,resultSelector:s,state:u});do{if(e){var l=void 0;try{l=e(u)}catch(h){c.error(h);return}if(!l){c.complete();break}}var f=void 0;try{f=s(u)}catch(h){c.error(h);return}if(c.next(f),c.closed)break;try{u=r(u)}catch(h){c.error(h);return}}while(!0)})}function SE(t){var e=t.subscriber,r=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(s){e.error(s);return}else t.needIterate=!0;if(r){var n=void 0;try{n=r(t.state)}catch(s){e.error(s);return}if(!n){e.complete();return}if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(s){e.error(s);return}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function EE(t,e,r){return e===void 0&&(e=rn),r===void 0&&(r=rn),eu(function(){return t()?e:r})}function sn(t){return!He(t)&&t-parseFloat(t)+1>=0}function CE(t,e){return t===void 0&&(t=0),e===void 0&&(e=Ve),(!sn(t)||t<0)&&(t=0),(!e||typeof e.schedule!="function")&&(e=Ve),new X(function(r){return r.add(e.schedule(xE,t,{subscriber:r,counter:0,period:t})),r})}function xE(t){var e=t.subscriber,r=t.counter,n=t.period;e.next(r),this.schedule({subscriber:e,counter:r+1,period:n},n)}function Fd(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return Qe(i)?(n=t.pop(),t.length>1&&typeof t[t.length-1]=="number"&&(r=t.pop())):typeof i=="number"&&(r=t.pop()),n===null&&t.length===1&&t[0]instanceof X?t[0]:Xc(r)(ui(t,n))}var Wd=new X(St);function IE(){return Wd}function tc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===0)return rn;var r=t[0],n=t.slice(1);return t.length===1&&He(r)?tc.apply(void 0,r):new X(function(i){var s=function(){return i.add(tc.apply(void 0,n).subscribe(i))};return Bt(r).subscribe({next:function(o){i.next(o)},error:s,complete:s})})}function RE(t,e){return e?new X(function(r){var n=Object.keys(t),i=new ve;return i.add(e.schedule(AE,0,{keys:n,index:0,subscriber:r,subscription:i,obj:t})),i}):new X(function(r){for(var n=Object.keys(t),i=0;i<n.length&&!r.closed;i++){var s=n[i];t.hasOwnProperty(s)&&r.next([s,t[s]])}r.complete()})}function AE(t){var e=t.keys,r=t.index,n=t.subscriber,i=t.subscription,s=t.obj;if(!n.closed)if(r<e.length){var o=e[r];n.next([o,s[o]]),i.add(this.schedule({keys:e,index:r+1,subscriber:n,subscription:i,obj:s}))}else n.complete()}function Hd(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}function Xt(t,e){return function(n){return n.lift(new ME(t,e))}}var ME=function(){function t(e,r){this.predicate=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new kE(e,this.predicate,this.thisArg))},t}(),kE=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.thisArg=i,s.count=0,s}return e.prototype._next=function(r){var n;try{n=this.predicate.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}n&&this.destination.next(r)},e}(V);
24function TE(t,e,r){return[Xt(e,r)(new X(Bn(t))),Xt(Hd(e,r))(new X(Bn(t)))]}function Vd(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1)if(He(t[0]))t=t[0];else return t[0];return ui(t,void 0).lift(new OE)}var OE=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new NE(e))},t}(),NE=function(t){I(e,t);function e(r){var n=t.call(this,r)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return e.prototype._next=function(r){this.observables.push(r)},e.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{for(var i=0;i<n&&!this.hasFirst;i++){var s=r[i],o=jt(this,s,void 0,i);this.subscriptions&&this.subscriptions.push(o),this.add(o)}this.observables=null}},e.prototype.notifyNext=function(r,n,i){if(!this.hasFirst){this.hasFirst=!0;for(var s=0;s<this.subscriptions.length;s++)if(s!==i){var o=this.subscriptions[s];o.unsubscribe(),this.remove(o)}this.subscriptions=null}this.destination.next(n)},e}(Rr);function LE(t,e,r){return t===void 0&&(t=0),new X(function(n){e===void 0&&(e=t,t=0);var i=0,s=t;if(r)return r.schedule(PE,0,{index:i,count:e,start:t,subscriber:n});do{if(i++>=e){n.complete();break}if(n.next(s++),n.closed)break}while(!0)})}function PE(t){var e=t.start,r=t.index,n=t.count,i=t.subscriber;if(r>=n){i.complete();return}i.next(e),!i.closed&&(t.index=r+1,t.start=e+1,this.schedule(t))}function Ud(t,e,r){t===void 0&&(t=0);var n=-1;return sn(e)?n=Number(e)<1&&1||Number(e):Qe(e)&&(r=e),Qe(r)||(r=Ve),new X(function(i){var s=sn(t)?t:+t-r.now();return r.schedule(DE,s,{index:0,period:n,subscriber:i})})}function DE(t){var e=t.index,r=t.period,n=t.subscriber;if(n.next(e),!n.closed){if(r===-1)return n.complete();t.index=e+1,this.schedule(t,r)}}function $E(t,e){return new X(function(r){var n;try{n=t()}catch(a){r.error(a);return}var i;try{i=e(n)}catch(a){r.error(a);return}var s=i?Bt(i):rn,o=s.subscribe(r);return function(){o.unsubscribe(),n&&n.unsubscribe()}})}function zd(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return typeof r=="function"&&t.pop(),ui(t,void 0).lift(new qd(r))}var qd=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new jE(e,this.resultSelector))},t}(),jE=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.resultSelector=n,s.iterators=[],s.active=0,s.resultSelector=typeof n=="function"?n:void 0,s}return e.prototype._next=function(r){var n=this.iterators;He(r)?n.push(new FE(r)):typeof r[Kt]=="function"?n.push(new BE(r[Kt]())):n.push(new WE(this.destination,this,r))},e.prototype._complete=function(){var r=this.iterators,n=r.length;if(this.unsubscribe(),n===0){this.destination.complete();return}this.active=n;for(var i=0;i<n;i++){var s=r[i];if(s.stillUnsubscribed){var o=this.destination;o.add(s.subscribe())}else this.active--}},e.prototype.notifyInactive=function(){this.active--,this.active===0&&this.destination.complete()},e.prototype.checkIterators=function(){for(var r=this.iterators,n=r.length,i=this.destination,s=0;s<n;s++){var o=r[s];if(typeof o.hasValue=="function"&&!o.hasValue())return}for(var a=!1,c=[],s=0;s<n;s++){var o=r[s],u=o.next();if(o.hasCompleted()&&(a=!0),u.done){i.complete();return}c.push(u.value)}this.resultSelector?this._tryresultSelector(c):i.next(c),a&&i.complete()},e.prototype._tryresultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(V),BE=function(){function t(e){this.iterator=e,this.nextResult=e.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},t.prototype.hasCompleted=function(){var e=this.nextResult;return!!(e&&e.done)},t}(),FE=function(){function t(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return t.prototype[Kt]=function(){return this},t.prototype.next=function(e){var r=this.index++,n=this.array;return r<this.length?{value:n[r],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),WE=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.parent=n,s.observable=i,s.stillUnsubscribed=!0,s.buffer=[],s.isComplete=!1,s}return e.prototype[Kt]=function(){return this},e.prototype.next=function(){var r=this.buffer;return r.length===0&&this.isComplete?{value:null,done:!0}:{value:r.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return this.buffer.length===0&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(r){this.buffer.push(r),this.parent.checkIterators()},e.prototype.subscribe=function(){return _e(this.observable,new me(this))},e}(we);const HE=Object.freeze(Object.defineProperty({__proto__:null,ArgumentOutOfRangeError:nn,AsyncSubject:vn,BehaviorSubject:_d,ConnectableObservable:wd,EMPTY:rn,EmptyError:li,GroupedObservable:Ya,NEVER:Wd,Notification:Dt,get NotificationKind(){return Xa}
24,ObjectUnsubscribedError:qt,Observable:X,ReplaySubject:Yc,Scheduler:Ka,Subject:Te,Subscriber:V,Subscription:ve,TimeoutError:kd,UnsubscriptionError:Ln,VirtualAction:Md,VirtualTimeScheduler:zS,animationFrame:US,animationFrameScheduler:Ad,asap:Oi,asapScheduler:Id,async:Ve,asyncScheduler:Rd,bindCallback:Td,bindNodeCallback:Od,combineLatest:aE,concat:Fn,config:et,defer:eu,empty:yn,forkJoin:yE,from:Bt,fromEvent:$d,fromEventPattern:Bd,generate:_E,identity:Yt,iif:EE,interval:CE,isObservable:qS,merge:Fd,never:IE,noop:St,observable:gn,of:Cs,onErrorResumeNext:tc,pairs:RE,partition:TE,pipe:Za,queue:Ed,queueScheduler:Sd,race:Vd,range:LE,scheduled:Pd,throwError:Zc,timer:Ud,using:$E,zip:zd},Symbol.toStringTag,{value:"Module"})),xs=wr(HE);var Is={};const Rs=wr(wp),fi=wr(Ep);var Rt={},As={};Object.defineProperty(As,"__esModule",{value:!0});As.CloseIcon=void 0;const hf=Ze;function VE(t){return(0,hf.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,hf.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}As.CloseIcon=VE;var tu={};Object.defineProperty(tu,"__esModule",{value:!0});tu.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var ru={};Object.defineProperty(ru,"__esModule",{value:!0});ru.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var Ms={};Object.defineProperty(Ms,"__esModule",{value:!0});Ms.QRCodeIcon=void 0;const mt=Ze;function UE(t){return(0,mt.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,mt.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,mt.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,mt.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,mt.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,mt.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,mt.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,mt.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,mt.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,mt.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}
24Ms.QRCodeIcon=UE;var nu={};Object.defineProperty(nu,"__esModule",{value:!0});const zE=` 25 <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"> 26 <path d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100Z" fill="white"/> 27 <path d="M50.512 94C74.2907 94 93.5673 74.5244 93.5673 50.5C93.5673 26.4756 74.2907 7 50.512 7C26.7332 7 7.45667 26.4756 7.45667 50.5C7.45667 74.5244 26.7332 94 50.512 94Z" fill="#0052FF"/> 28 <path d="M50.6248 65.4335C42.3697 65.4335 35.8996 58.7469 35.8996 50.5C35.8996 42.2531 42.5928 35.5664 50.6248 35.5664C57.9873 35.5664 64.0111 40.9157 65.1267 48.0481H80.0749C78.7363 32.6688 66.0191 20.6328 50.6248 20.6328C34.3379 20.6328 20.9514 34.0062 20.9514 50.5C20.9514 66.9936 34.1148 80.3671 50.6248 80.3671C66.2422 80.3671 78.7363 68.331 80.0749 52.9516H65.1267C64.0111 60.0841 57.9873 65.4335 50.6248 65.4335Z" fill="white"/> 29 </svg> 30`;nu.default=zE;var iu={};Object.defineProperty(iu,"__esModule",{value:!0});iu.default=` 31 <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"> 32 <circle cx="50" cy="50" r="50" fill="white"/> 33 <circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/> 34 <circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/> 35 <path fill-rule="evenodd" clip-rule="evenodd" d="M19.3379 49.9484C19.3379 66.8508 33.04 80.553 49.9425 80.553C66.8449 80.553 80.5471 66.8508 80.5471 49.9484C80.5471 33.0459 66.8449 19.3438 49.9425 19.3438C33.04 19.3438 19.3379 33.0459 19.3379 49.9484ZM44.0817 40.0799C41.8725 40.0799 40.0817 41.8708 40.0817 44.0799V55.8029C40.0817 58.012 41.8725 59.8029 44.0817 59.8029H55.8046C58.0138 59.8029 59.8046 58.012 59.8046 55.8029V44.0799C59.8046 41.8708 58.0138 40.0799 55.8046 40.0799H44.0817Z" fill="white"/> 36 </svg> 37`;var ks={};Object.defineProperty(ks,"__esModule",{value:!0});ks.StatusDotIcon=void 0;const df=Ze;function qE(t){return(0,df.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,df.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}ks.StatusDotIcon=qE;var Ts={};function Gd(t){this.mode=Ge.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e<r;e++){var n=[],i=this.data.charCodeAt(e);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Gd.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e<r;e++)t.put(this.parsedData[e],8)}};function At(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}At.prototype={addData:function(t){var e=new Gd(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=At.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=ge.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var o=s*i,a=0;a<this.modules[s].length;a++){var c=a*i,u=this.modules[s][a];u&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+i,o),n.lineTo(c+i,o+i),n.lineTo(c,o+i),n.endFill())}return n},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=ge.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var r=0;r<t.length;r++){var n=t[e],i=t[r];
vendor: 10,913 bytes, line 37
37if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var o=-2;o<=2;o++)s==-2||s==2||o==-2||o==2||s==0&&o==0?this.modules[n+s][i+o]=!0:this.modules[n+s][i+o]=!1}},setupTypeNumber:function(t){for(var e=ge.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=ge.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;s<t.length&&(c=(t[s]>>>i&1)==1);var u=ge.getMask(e,n,o-a);u&&(c=!c),this.modules[n][o-a]=c,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};At.PAD0=236;At.PAD1=17;At.createData=function(t,e,r){for(var n=Ct.getRSBlocks(t,e),i=new Jd,s=0;s<r.length;s++){var o=r[s];i.put(o.mode,4),i.put(o.getLength(),ge.getLengthInBits(o.mode,t)),o.write(i)}for(var a=0,s=0;s<n.length;s++)a+=n[s].dataCount;if(i.getLengthInBits()>a*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(At.PAD0,8),i.getLengthInBits()>=a*8));)i.put(At.PAD1,8);return At.createBytes(i,n)};At.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),o=new Array(e.length),a=0;a<e.length;a++){var c=e[a].dataCount,u=e[a].totalCount-c;n=Math.max(n,c),i=Math.max(i,u),s[a]=new Array(c);for(var l=0;l<s[a].length;l++)s[a][l]=255&t.buffer[l+r];r+=c;var f=ge.getErrorCorrectPolynomial(u),h=new qr(s[a],f.getLength()-1),g=h.mod(f);o[a]=new Array(f.getLength()-1);for(var l=0;l<o[a].length;l++){var v=l+g.getLength()-o[a].length;o[a][l]=v>=0?g.get(v):0}}for(var C=0,l=0;l<e.length;l++)C+=e[l].totalCount;for(var S=new Array(C),b=0,l=0;l<n;l++)for(var a=0;a<e.length;a++)l<s[a].length&&(S[b++]=s[a][l]);for(var l=0;l<i;l++)for(var a=0;a<e.length;a++)l<o[a].length&&(S[b++]=o[a][l]);return S};var Ge={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Jt={L:1,M:0,Q:3,H:2},Wt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},ge={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;ge.getBCHDigit(e)-ge.getBCHDigit(ge.G15)>=0;)e^=ge.G15<<ge.getBCHDigit(e)-ge.getBCHDigit(ge.G15);return(t<<10|e)^ge.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;ge.getBCHDigit(e)-ge.getBCHDigit(ge.G18)>=0;)e^=ge.G18<<ge.getBCHDigit(e)-ge.getBCHDigit(ge.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return ge.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case Wt.PATTERN000:return(e+r)%2==0;case Wt.PATTERN001:return e%2==0;case Wt.PATTERN010:return r%3==0;case Wt.PATTERN011:return(e+r)%3==0;case Wt.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case Wt.PATTERN101:return e*r%2+e*r%3==0;case Wt.PATTERN110:return(e*r%2+e*r%3)%2==0;case Wt.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new qr([1],0),r=0;r<t;r++)e=e.multiply(new qr([1,ke.gexp(r)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Ge.MODE_NUMBER:return 10;case Ge.MODE_ALPHA_NUM:return 9;case Ge.MODE_8BIT_BYTE:return 8;case Ge.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Ge.MODE_NUMBER:return 12;case Ge.MODE_ALPHA_NUM:return 11;case Ge.MODE_8BIT_BYTE:return 16;case Ge.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case Ge.MODE_NUMBER:return 14;case Ge.MODE_ALPHA_NUM:return 13;case Ge.MODE_8BIT_BYTE:return 16;case Ge.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+e)},getLostPoint:function(t){for(var e=t.getModuleCount(),r=0,n=0;n<e;n++)for(var i=0;i<e;i++){for(var s=0,o=t.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||e<=n+a))for(var c=-1;c<=1;c++)i+c<0||e<=i+c||a==0&&c==0||o==t.isDark(n+a,i+c)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<e-1;n++)for(var i=0;i<e-1;i++){var u=0;t.isDark(n,i)&&u++,t.isDark(n+1,i)&&u++,t.isDark(n,i+1)&&u++,t.isDark(n+1,i+1)&&u++,(u==0||u==4)&&(r+=3)}for(var n=0;n<e;n++)for(var i=0;i<e-6;i++)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(r+=40);for(var i=0;i<e;i++)for(var n=0;n<e-6;n++)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(r+=40);for(var l=0,i=0;i<e;i++)for(var n=0;n<e;n++)t.isDark(n,i)&&l++;var f=Math.abs(100*l/e/e-50)/5;return r+=f*10,r}},ke={glog:function(t){if(t<1)throw new Error("glog("+t+")");return ke.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return ke.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Ne=0;Ne<8;Ne++)ke.EXP_TABLE[Ne]=1<<Ne;for(var Ne=8;Ne<256;Ne++)ke.EXP_TABLE[Ne]=ke.EXP_TABLE[Ne-4]^ke.EXP_TABLE[Ne-5]^ke.EXP_TABLE[Ne-6]^ke.EXP_TABLE[Ne-8];for(var Ne=0;Ne<255;Ne++)ke.LOG_TABLE[ke.EXP_TABLE[Ne]]=Ne;function qr(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var r=0;r<t.length&&t[r]==0;)r++;this.num=new Array(t.length-r+e);for(var n=0;n<t.length-r;n++)this.num[n]=t[n+r]}qr.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<t.getLength();n++)e[r+n]^=ke.gexp(ke.glog(this.get(r))+ke.glog(t.get(n)));return new qr(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=ke.glog(this.get(0))-ke.glog(t.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<t.getLength();n++)r[n]^=ke.gexp(ke.glog(t.get(n))+e);return new qr(r,0).mod(t)}};function Ct(t,e){this.totalCount=t,this.dataCount=e}Ct.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];Ct.getRSBlocks=function(t,e){var r=Ct.getRsBlockTable(t,e);if(r==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var o=r[s*3+0],a=r[s*3+1],c=r[s*3+2],u=0;u<o;u++)i.push(new Ct(a,c));return i};Ct.getRsBlockTable=function(t,e){switch(e){case Jt.L:return Ct.RS_BLOCK_TABLE[(t-1)*4+0];case Jt.M:return Ct.RS_BLOCK_TABLE[(t-1)*4+1];case Jt.Q:return Ct.RS_BLOCK_TABLE[(t-1)*4+2];case Jt.H:return Ct.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};function Jd(){this.buffer=[],this.length=0}Jd.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Ra=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,8
376,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Qd(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return Jt.L;case"M":return Jt.M;case"Q":return Jt.Q;case"H":return Jt.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,u){for(var l=i(c),f=1,h=0,g=0,v=Ra.length;g<=v;g++){var C=Ra[g];if(!C)throw new Error("Content too long: expected "+h+" but got "+l);switch(u){case"L":h=C[0];break;case"M":h=C[1];break;case"Q":h=C[2];break;case"H":h=C[3];break;default:throw new Error("Unknwon error correction level: "+u)}if(l<=h)break;f++}if(f>Ra.length)throw new Error("Content too long");return f}function i(c){var u=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return u.length+(u.length!=c?3:0)}var s=this.options.content,o=n(s,this.options.ecl),a=r(this.options.ecl);this.qrcode=new At(o,a),this.qrcode.addData(s),this.qrcode.make()}Qd.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r 38`:"",o=e.width,a=e.height,c=r.length,u=o/(c+2*e.padding),l=a/(c+2*e.padding),f=typeof e.join<"u"?!!e.join:!1,h=typeof e.swap<"u"?!!e.swap:!1,g=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,v=typeof e.predefined<"u"?!!e.predefined:!1,C=v?i+'<defs><path id="qrmodule" d="M0 0 h'+l+" v"+u+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+s:"",S=i+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+s,b="",y="",_=0;_<c;_++)for(var x=0;x<c;x++){var E=r[x][_];if(E){var k=x*u+e.padding*u,F=_*l+e.padding*l;if(h){var $=k;k=F,F=$}if(f){var O=u+k,q=l+F;k=Number.isInteger(k)?Number(k):k.toFixed(2),F=Number.isInteger(F)?Number(F):F.toFixed(2),O=Number.isInteger(O)?Number(O):O.toFixed(2),q=Number.isInteger(q)?Number(q):q.toFixed(2),y+="M"+k+","+F+" V"+q+" H"+O+" V"+F+" H"+k+" Z "}else v?b+=i+'<use x="'+k.toString()+'" y="'+F.toString()+'" href="#qrmodule" />'+s:b+=i+'<rect x="'+k.toString()+'" y="'+F.toString()+'" width="'+u+'" height="'+l+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+s}}f&&(b=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+y+'" />');let ae="";if(this.options.image!==void 0&&this.options.image.svg){const R=o*this.options.image.width/100,A=a*this.options.image.height/100,N=o/2-R/2,L=a/2-A/2;ae+=`<svg x="${N}" y="${L}" width="${R}" height="${A}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,ae+=this.options.image.svg+s,ae+="</svg>"}var Q="";switch(t.container){case"svg":g&&(Q+='<?xml version="1.0" standalone="yes"?>'+s),Q+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+s,Q+=C+S+b,Q+=ae,Q+="</svg>";break;case"svg-viewbox":g&&(Q+='<?xml version="1.0" standalone="yes"?>'+s),Q+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+s,Q+=C+S+b,Q+=ae,Q+="</svg>";break;case"g":Q+='<g width="'+o+'" height="'+a+'">'+s,Q+=C+S+b,Q+=ae,Q+="</g>";break;default:Q+=(C+S+b+ae).replace(/^\s+/,"");break}return Q};var GE=Qd,JE=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.QRCode=void 0;const QE=Ze,pf=fi,ZE=JE(GE),YE=t=>{const[e,r]=(0,pf.useState)("");return(0,pf.useEffect)(()=>{var n,i;const s=new ZE.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),o=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)}),e?(0,QE.h)("img",{src:e,alt:"QR Code"}):null};Ts.QRCode=YE;var Os={},su={};
38Object.defineProperty(su,"__esModule",{value:!0});su.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var KE=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Os,"__esModule",{value:!0});Os.Spinner=void 0;const Ii=Ze,XE=KE(su),e3=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,Ii.h)("div",{class:"-cbwsdk-spinner"},(0,Ii.h)("style",null,XE.default),(0,Ii.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Ii.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Os.Spinner=e3;var ou={};Object.defineProperty(ou,"__esModule",{value:!0});ou.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;
38color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var mn=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.CoinbaseAppSteps=Rt.CoinbaseWalletSteps=Rt.ConnectItem=Rt.ConnectContent=void 0;const rt=mn(Rs),z=Ze,bf=fi,t3=W,r3=Vn,n3=As,i3=mn(tu),s3=mn(ru),Zd=Ms,o3=mn(nu),a3=mn(iu),c3=ks,u3=Ts,l3=Os,f3=mn(ou),gf={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:s3.default,steps:Kd},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:i3.default,steps:Xd}},h3=t=>{switch(t){case"coinbase-app":return o3.default;case"coinbase-wallet-app":default:return a3.default}},rc=t=>t==="light"?"#FFFFFF":"#0A0B0D";function d3(t){const{theme:e}=t,[r,n]=(0,bf.useState)("coinbase-wallet-app"),i=(0,bf.useCallback)(u=>{n(u)},[]),s=(0,t3.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),o=gf[r];if(!r)return null;const a=o.steps,c=r==="coinbase-app";return(0,z.h)("div",{"data-testid":"connect-content",class:(0,rt.default)("-cbwsdk-connect-content",e)},(0,z.h)("style",null,f3.default),(0,z.h)("div",{class:"-cbwsdk-connect-content-header"},(0,z.h)("h2",{class:(0,rt.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,z.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,z.h)(n3.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,z.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,z.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,z.h)("div",null,Object.entries(gf).map(([u,l])=>(0,z.h)(Yd,{key:u,title:l.title,description:l.description,icon:l.icon,selected:r===u,onClick:()=>i(u),theme:e}))),c&&(0,z.h)("div",{class:(0,rt.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,z.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,z.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,z.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,z.h)(u3.QRCode,{content:s,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:h3(r),width:25,height:25}}),(0,z.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:r3.LIB_VERSION}),(0,z.h)("input",{type:"hidden",value:s})),(0,z.h)(a,{theme:e}),!t.isConnected&&(0,z.h)("div",{"data-testid":"connecting-spinner",class:(0,rt.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,z.h)(l3.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,z.h)("p",null,"Connecting...")))))}Rt.ConnectContent=d3;function Yd({title:t,description:e,icon:r,selected:n,theme:i,onClick:s}){return(0,z.h)("div",{onClick:s,class:(0,rt.default)("-cbwsdk-connect-item",i,{selected:n})},(0,z.h)("div",null,(0,z.h)("img",{src:r,alt:t})),(0,z.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,z.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,z.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}Rt.ConnectItem=Yd;function Kd({theme:t}){return(0,z.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,z.h)("li",{class:(0,rt.default)("-cbwsdk-wallet-steps-item",t)},(0,z.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,z.h)("li",{class:(0,rt.default)("-cbwsdk-wallet-steps-item",t)},(0,z.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,z.h)("span",null,"Tap ",(0,z.h)("strong",null,"Scan")," "),(0,z.h)("span",{class:(0,rt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,z.h)(Zd.QRCodeIcon,{fill:rc(t)})))))}Rt.CoinbaseWalletSteps=Kd;function Xd({theme:t}){return(0,z.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,z.h)("li",{class:(0,rt.default)("-cbwsdk-wallet-steps-item",t)},(0,z.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,z.h)("li",{class:(0,rt.default)("-cbwsdk-wallet-steps-item",t)},(0,z.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,z.h)("span",null,"Tap ",(0,z.h)("strong",null,"More")),(0,z.h)("span",{class:(0,rt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,z.h)(c3.StatusDotIcon,{fill:rc(t)})),(0,z.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,z.h)("strong",null,"Scan")),(0,z.h)("span",{class:(0,rt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,z.h)(Zd.QRCodeIcon,{fill:rc(t)})))))}Rt.CoinbaseAppSteps=Xd;var Ns={},Ls={};Object.defineProperty(Ls,"__esModule",{value:!0});Ls.ArrowLeftIcon=void 0;const yf=Ze;function p3(t){return(0,yf.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"}
38,t),(0,yf.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}Ls.ArrowLeftIcon=p3;var Ps={};Object.defineProperty(Ps,"__esModule",{value:!0});Ps.LaptopIcon=void 0;const Aa=Ze;function b3(t){return(0,Aa.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Aa.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Aa.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}Ps.LaptopIcon=b3;var Ds={};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.SafeIcon=void 0;const vf=Ze;function g3(t){return(0,vf.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,vf.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}Ds.SafeIcon=g3;var au={};Object.defineProperty(au,"__esModule",{value:!0});au.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var ep=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ns,"__esModule",{value:!0});Ns.TryExtensionContent=void 0;const nr=ep(Rs),Ee=Ze,Ma=fi,y3=Ls,v3=Ps,m3=Ds,w3=ep(au);function _3({theme:t}){const[e,r]=(0,Ma.useState)(!1),n=(0,Ma.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Ma.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,Ee.h)("div",{class:(0,nr.default)("-cbwsdk-try-extension",t)},(0,Ee.h)("style",null,w3.default),(0,Ee.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ee.h)("h3",{class:(0,nr.default)("-cbwsdk-try-extension-heading",t)}
vendor: 1,962 bytes, line 38
38,"Or try the Coinbase Wallet browser extension"),(0,Ee.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Ee.h)("button",{class:(0,nr.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,Ee.h)("div",null,!e&&(0,Ee.h)(y3.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,Ee.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ee.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Ee.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ee.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ee.h)("span",{class:(0,nr.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Ee.h)(v3.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ee.h)("div",{class:(0,nr.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,Ee.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ee.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ee.h)("span",{class:(0,nr.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Ee.h)(m3.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ee.h)("div",{class:(0,nr.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Ns.TryExtensionContent=_3;var cu={};Object.defineProperty(cu,"__esModule",{value:!0});cu.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}
38.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var tp=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Is,"__esModule",{value:!0});Is.ConnectDialog=void 0;const ka=tp(Rs),ir=Ze,Ta=fi,S3=Rt,E3=Ns,C3=tp(cu),x3=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,Ta.useState)(!e),[s,o]=(0,Ta.useState)(!e);(0,Ta.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!e)},10)];return e?i(!1):c.push(window.setTimeout(()=>{i(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t.isOpen]);const a=r?"dark":"light";return(0,ir.h)("div",{class:(0,ka.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,ir.h)("style",null,C3.default),(0,ir.h)("div",{class:(0,ka.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,ir.h)("div",{class:"-cbwsdk-connect-dialog"},(0,ir.h)("div",{class:(0,ka.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,ir.h)(S3.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,ir.h)(E3.TryExtensionContent,{theme:a}))))};Is.ConnectDialog=x3;Object.defineProperty(Es,"__esModule",{value:!0});Es.LinkFlow=void 0;const Oa=Ze,mf=xs,I3=Is;class R3{constructor(e){this.extensionUI$=new mf.BehaviorSubject({}),this.subscriptions=new mf.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection,this.connected$=e.connected$,this.chainId$=e.chainId$}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe(r=>{this.isConnected!==r&&(this.isConnected=r,this.render())})),this.subscriptions.add(this.chainId$.subscribe(r=>{this.chainId!==r&&(this.chainId=r,this.render())}))}detach(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,Oa.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const e=this.extensionUI$.subscribe(()=>{this.root&&(0,Oa.render)((0,Oa.h)(I3.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)});this.subscriptions.add(e)}}Es.LinkFlow=R3;var rp={},uu={};Object.defineProperty(uu,"__esModule",{value:!0});uu.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;
38cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=B&&B.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(Rs),n=Ze,i=fi,s=e(uu),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function a(f){switch(f){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyA
38wLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}class c{constructor(h){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=h.darkMode}attach(h){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",h.appendChild(this.root),this.render()}presentItem(h){const g=this.nextItemKey++;return this.items.set(g,h),this.render(),()=>{this.items.delete(g),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([h,g])=>(0,n.h)(t.SnackbarInstance,Object.assign({},g,{key:h}))))),this.root)}}t.Snackbar=c;const u=f=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},f.children));t.SnackbarContainer=u;const l=({autoExpand:f,message:h,menuItems:g,appSrc:v})=>{const[C,S]=(0,i.useState)(!0),[b,y]=(0,i.useState)(f??!1);(0,i.useEffect)(()=>{const x=[window.setTimeout(()=>{S(!1)},1),window.setTimeout(()=>{y(!0)},1e4)];return()=>{x.forEach(window.clearTimeout)}});const _=()=>{y(!b)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",C&&"-cbwsdk-snackbar-instance-hidden",b&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:_},(0,n.h)("img",{src:a(v),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},h),(0,n.h)("div",{class:"-gear-container"},!b&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),g&&g.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},g.map((x,E)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",x.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:x.onClick,key:E},(0,n.h)("svg",{width:x.svgWidth,height:x.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":x.defaultFillRule,"clip-rule":x.defaultClipRule,d:x.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",x.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},x.info)))))};t.SnackbarInstance=l})(rp);var $s={},lu={};
38Object.defineProperty(lu,"__esModule",{value:!0});lu.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;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}';var A3=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($s,"__esModule",{value:!0});$s.injectCssReset=void 0;const M3=A3(lu);function k3(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(M3.default)),document.documentElement.appendChild(t)}$s.injectCssReset=k3;Object.defineProperty(Ss,"__esModule",{value:!0});Ss.WalletSDKUI=void 0;const T3=Es,O3=rp,N3=$s;class L3{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new O3.Snackbar({darkMode:e.darkMode}),this.linkFlow=new T3.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,connected$:e.connected$,chainId$:e.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,N3.injectCssReset)()}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(e){}watchAsset(e){}switchEthereumChain(e){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(e){}signEthereumTransaction(e){}submitEthereumTransaction(e){}ethereumAddressFromSignedMessage(e){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.9687
385C6.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}]}:r={message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}setAppSrc(e){this.appSrc=e}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(e){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}Ss.WalletSDKUI=L3;var js={},Bs={};Object.defineProperty(Bs,"__esModule",{value:!0});var Fr;(function(t){t.typeOfFunction="function",t.boolTrue=!0})(Fr||(Fr={}));function np(t,e,r){if(!r||typeof r.value!==Fr.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:Fr.boolTrue,get:function(){var n=r.value.bind(this);return Object.defineProperty(this,e,{value:n,configurable:Fr.boolTrue,writable:Fr.boolTrue}),n}}}Bs.bind=np;Bs.default=np;function ip(t){return function(r){return r.lift(new P3(t))}}var P3=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new D3(e,this.durationSelector))},t}(),D3=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){if(this.value=r,this.hasValue=!0,!this.throttled){var n=void 0;try{var i=this.durationSelector;n=i(r)}catch(o){return this.destination.error(o)}var s=_e(n,new me(this));!s||s.closed?this.clearThrottle():this.add(this.throttled=s)}},e.prototype.clearThrottle=function(){var r=this,n=r.value,i=r.hasValue,s=r.throttled;s&&(this.remove(s),this.throttled=void 0,s.unsubscribe()),i&&(this.value=void 0,this.hasValue=!1,this.destination.next(n))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(we);function $3(t,e){return e===void 0&&(e=Ve),ip(function(){return Ud(t,e)})}function j3(t){return function(r){return r.lift(new B3(t))}}var B3=function(){function t(e){this.closingNotifier=e}return t.prototype.call=function(e,r){return r.subscribe(new F3(e,this.closingNotifier))},t}(),F3=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.buffer=[],i.add(_e(n,new me(i))),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype.notifyNext=function(){var r=this.buffer;this.buffer=[],this.destination.next(r)},e}(we);function W3(t,e){return e===void 0&&(e=null),function(n){return n.lift(new H3(t,e))}}var H3=function(){function t(e,r){this.bufferSize=e,this.startBufferEvery=r,!r||e===r?this.subscriberClass=V3:this.subscriberClass=U3}return t.prototype.call=function(e,r){return r.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},t}(),V3=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.bufferSize=n,i.buffer=[],i}return e.prototype._next=function(r){var n=this.buffer;n.push(r),n.length==this.bufferSize&&(this.destination.next(n),this.buffer=[])},e.prototype._complete=function(){var r=this.buffer;r.length>0&&this.destination.next(r),t.prototype._complete.call(this)},e}(V),U3=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.bufferSize=n,s.startBufferEvery=i,s.buffers=[],s.count=0,s}return e.prototype._next=function(r){var n=this,i=n.bufferSize,s=n.startBufferEvery,o=n.buffers,a=n.count;this.count++,a%s===0&&o.push([]);for(var c=o.length;c--;){var u=o[c];u.push(r),u.length===i&&(o.splice(c,1),this.destination.next(u))}},e.prototype._complete=function(){for(var r=this,n=r.buffers,i=r.destination;n.length>0;){var s=n.shift();s.length>0&&i.next(s)}t.prototype._complete.call(this)},e}(V);function z3(t){var e=arguments.length,r=Ve;Qe(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],e--);var n=null;e>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(o){return o.lift(new q3(t,n,i,r))}}var q3=function(){function t(e,r,n,i){this.bufferTimeSpan=e,this.bufferCreationInterval=r,this.maxBufferSize=n,this.scheduler
38=i}return t.prototype.call=function(e,r){return r.subscribe(new J3(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),G3=function(){function t(){this.buffer=[]}return t}(),J3=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.bufferTimeSpan=n,a.bufferCreationInterval=i,a.maxBufferSize=s,a.scheduler=o,a.contexts=[];var c=a.openContext();if(a.timespanOnly=i==null||i<0,a.timespanOnly){var u={subscriber:a,context:c,bufferTimeSpan:n};a.add(c.closeAction=o.schedule(wf,n,u))}else{var l={subscriber:a,context:c},f={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:a,scheduler:o};a.add(c.closeAction=o.schedule(sp,n,l)),a.add(o.schedule(Q3,i,f))}return a}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s,o=0;o<i;o++){var a=n[o],c=a.buffer;c.push(r),c.length==this.maxBufferSize&&(s=a)}s&&this.onBufferFull(s)},e.prototype._error=function(r){this.contexts.length=0,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this,n=r.contexts,i=r.destination;n.length>0;){var s=n.shift();i.next(s.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(r){this.closeContext(r);var n=r.closeAction;if(n.unsubscribe(),this.remove(n),!this.closed&&this.timespanOnly){r=this.openContext();var i=this.bufferTimeSpan,s={subscriber:this,context:r,bufferTimeSpan:i};this.add(r.closeAction=this.scheduler.schedule(wf,i,s))}},e.prototype.openContext=function(){var r=new G3;return this.contexts.push(r),r},e.prototype.closeContext=function(r){this.destination.next(r.buffer);var n=this.contexts,i=n?n.indexOf(r):-1;i>=0&&n.splice(n.indexOf(r),1)},e}(V);function wf(t){var e=t.subscriber,r=t.context;r&&e.closeContext(r),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function Q3(t){var e=t.bufferCreationInterval,r=t.bufferTimeSpan,n=t.subscriber,i=t.scheduler,s=n.openContext(),o=this;n.closed||(n.add(s.closeAction=i.schedule(sp,r,{subscriber:n,context:s})),o.schedule(t,e))}function sp(t){var e=t.subscriber,r=t.context;e.closeContext(r)}function Z3(t,e){return function(n){return n.lift(new Y3(t,e))}}var Y3=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new K3(e,this.openings,this.closingSelector))},t}(),K3=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.closingSelector=i,s.contexts=[],s.add(jt(s,n)),s}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s=0;s<i;s++)n[s].buffer.push(r)},e.prototype._error=function(r){for(var n=this.contexts;n.length>0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this.contexts;r.length>0;){var n=r.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(r,n){r?this.closeBuffer(r):this.openBuffer(n)},e.prototype.notifyComplete=function(r){this.closeBuffer(r.context)},e.prototype.openBuffer=function(r){try{var n=this.closingSelector,i=n.call(this,r);i&&this.trySubscribe(i)}catch(s){this._error(s)}},e.prototype.closeBuffer=function(r){var n=this.contexts;if(n&&r){var i=r.buffer,s=r.subscription;this.destination.next(i),n.splice(n.indexOf(r),1),this.remove(s),s.unsubscribe()}},e.prototype.trySubscribe=function(r){var n=this.contexts,i=[],s=new ve,o={buffer:i,subscription:s};n.push(o);var a=jt(this,r,o);!a||a.closed?this.closeBuffer(o):(a.context=o,this.add(a),s.add(a))},e}(Rr);function X3(t){return function(e){return e.lift(new e4(t))}}var e4=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new t4(e,this.closingSelector))},t}(),t4=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.closingSelector=n,i.subscribing=!1,i.openBuffer(),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype._complete=function(){var r=this.buffer;r&&this.destination.next(r),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var r=this.closingSubscription;r&&(this.remove(r),r.unsubscribe());var n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];var i;try{var s=this.closingSelector;i=s()}catch(o){return this.error(o)}r=new ve,this.closingSubscription=r,this.add(r),this.subscribing=!0,r.add(_e
38(i,new me(this))),this.subscribing=!1},e}(we);function r4(t){return function(r){var n=new n4(t),i=r.lift(n);return n.caught=i}}var n4=function(){function t(e){this.selector=e}return t.prototype.call=function(e,r){return r.subscribe(new i4(e,this.selector,this.caught))},t}(),i4=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.selector=n,s.caught=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=void 0;try{n=this.selector(r,this.caught)}catch(o){t.prototype.error.call(this,o);return}this._unsubscribeAndRecycle();var i=new me(this);this.add(i);var s=_e(n,i);s!==i&&this.add(s)}},e}(we);function s4(t){return function(e){return e.lift(new Kc(t))}}function o4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=null;return typeof t[t.length-1]=="function"&&(r=t.pop()),t.length===1&&He(t[0])&&(t=t[0].slice()),function(n){return n.lift.call(Bt([n].concat(t)),new Kc(r))}}function a4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(Fn.apply(void 0,[r].concat(t)))}}function op(t,e){return vr(t,e,1)}function c4(t,e){return op(function(){return t},e)}function u4(t){return function(e){return e.lift(new l4(t,e))}}var l4=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new f4(e,this.predicate,this.source))},t}(),f4=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.source=i,s.count=0,s.index=0,s}return e.prototype._next=function(r){this.predicate?this._tryPredicate(r):this.count++},e.prototype._tryPredicate=function(r){var n;try{n=this.predicate(r,this.index++,this.source)}catch(i){this.destination.error(i);return}n&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(V);function h4(t){return function(e){return e.lift(new d4(t))}}var d4=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new p4(e,this.durationSelector))},t}(),p4=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){try{var n=this.durationSelector.call(this,r);
38n&&this._tryNext(r,n)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(r,n){var i=this.durationSubscription;this.value=r,this.hasValue=!0,i&&(i.unsubscribe(),this.remove(i)),i=_e(n,new me(this)),i&&!i.closed&&this.add(this.durationSubscription=i)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var r=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,r)}},e}(we);function b4(t,e){return e===void 0&&(e=Ve),function(r){return r.lift(new g4(t,e))}}var g4=function(){function t(e,r){this.dueTime=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new y4(e,this.dueTime,this.scheduler))},t}(),y4=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.dueTime=n,s.scheduler=i,s.debouncedSubscription=null,s.lastValue=null,s.hasValue=!1,s}return e.prototype._next=function(r){this.clearDebounce(),this.lastValue=r,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(v4,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var r=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(r)}},e.prototype.clearDebounce=function(){var r=this.debouncedSubscription;r!==null&&(this.remove(r),r.unsubscribe(),this.debouncedSubscription=null)},e}(V);function v4(t){t.debouncedNext()}function hi(t){return t===void 0&&(t=null),function(e){return e.lift(new m4(t))}}var m4=function(){function t(e){this.defaultValue=e}return t.prototype.call=function(e,r){return r.subscribe(new w4(e,this.defaultValue))},t}(),w4=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.defaultValue=n,i.isEmpty=!0,i}return e.prototype._next=function(r){this.isEmpty=!1,this.destination.next(r)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(V);function ap(t){return t instanceof Date&&!isNaN(+t)}function _4(t,e){e===void 0&&(e=Ve);var r=ap(t),n=r?+t-e.now():Math.abs(t);return function(i){return i.lift(new S4(n,e))}}var S4=function(){function t(e,r){this.delay=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new E4(e,this.delay,this.scheduler))},t}(),E4=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.delay=n,s.scheduler=i,s.queue=[],s.active=!1,s.errored=!1,s}return e.dispatch=function(r){for(var n=r.source,i=n.queue,s=r.scheduler,o=r.destination;i.length>0&&i[0].time-s.now()<=0;)i.shift().notification.observe(o);if(i.length>0){var a=Math.max(0,i[0].time-s.now());this.schedule(r,a)}else this.unsubscribe(),n.active=!1},e.prototype._schedule=function(r){this.active=!0;var n=this.destination;n.add(r.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:r}))},e.prototype.scheduleNotification=function(r){if(this.errored!==!0){var n=this.scheduler,i=new C4(n.now()+this.delay,r);this.queue.push(i),this.active===!1&&this._schedule(n)}},e.prototype._next=function(r){this.scheduleNotification(Dt.createNext(r))},e.prototype._error=function(r){this.errored=!0,this.queue=[],this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(Dt.createComplete()),this.unsubscribe()},e}(V),C4=function(){function t(e,r){this.time=e,this.notification=r}return t}();function x4(t,e){return e?function(r){return new R4(r,e).lift(new _f(t))}:function(r){return r.lift(new _f(t))}}var _f=function(){function t(e){this.delayDurationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new I4(e,this.delayDurationSelector))},t}(),I4=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.delayDurationSelector=n,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return e.prototype.notifyNext=function(r,n,i,s,o){this.destination.next(r),this.removeSubscription(o),this.tryComplete()},e.prototype.notifyError=function(r,n){this._error(r)},e.prototype.notifyComplete=function(r){var n=this.removeSubscription(r);n&&this.destination.next(n),this.tryComplete()},e.prototype._next=function(r){var n=this.index++;try{var i=this.delayDurationSelector(r,n);i&&this.tryDelay(i,r)}catch(s){this.destination.error(s)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(r){r.unsubscribe();var n=this.delayNotifierSubscriptions.indexOf(r);return n!==-1&&this.delayNotifierSubscriptions.splice(n,1),r.outerValue},e.prototype.tryDelay=function(r,n){var i=jt(this,r,n);if(i&&!i.closed){var s=this.destination;s.add(i),this.delayNotifierSubscriptions.push(i)}},e.prototype.tryComplete=function(){this.completed&&this.delayNotifierSubscriptions.length===0&&this.destination.complete()},e}(Rr),R4=function(t){I(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subscriptionDelay=n,i}return e.prototype._subscribe=function(r){this.subscriptionDelay.subscribe(new A4(r,this.source))},e}(X),A4=function(t){I(e,t);function e(r,n){var i=t.call(this)||this;return i.parent=r,i.source=n,i.sourceSubscribed=!1,i}return e.prototype._next=function(r){this.subscribeToSource()},e.prototype._error=function(r){this.unsubscribe(),this.parent.error(r)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(V);function M4(){return function(e){return e.lift(new k4)}}var k4=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new T4(e))},t}(),T4=function(t){I(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){r.observe(this.destination)},e}(V);function O4(t,e){return function(r){return r.lift(new N4(t,e))}}var N4=function(){function t(e,r){this.keySelector=e,this.flushes=r}return t.prototype.call=function(e,r){return r.subscribe(new L4(e,this.keySelector,this.flushes))},t}(),L4=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=n,s.values=new Set,i&&s.add(_e(i,new me(s))),s}return e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(r){this._error(r)},e.prototype._next=function(r){this.keySelector?this._useKeySelector(r):this._finalizeNext(r,r)},e.prototype._useKeySelector=function(r){var n,i=this.destination;try{n=this.keySelector(r)}catch(s){i.error(s);return}this._finalizeNext(n,r)},e.prototype._finalizeNext=function(r,n){var i=this.values;i.has(r)||(i.add(r),this.destination.next(n))},e}(we);function cp(t,e){return function(r){return r.lift(new P4(t,e))}}var P4=function(){function t(e,r){this.compare=e,this.keySelector=r}return t.prototype.call=function(e,r){return r.subscribe(new D4(e,this.compare,this.keySelector))},t}(),D4=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=i,s.hasKey=!1,typeof n=="function"&&(s.compare=n),s}return e.prototype.compare=function(r,n){return r===n},e.prototype._next=function(r){var n;try{var i=this.keySelector;n=i?i(r):r}catch(a){return this.destination.error(a)}var s=!1;if(this.hasKey)try{var o=this.compare;s=o(this.key,n)}catch(a){return this.destination.error(a)}else this.hasKey=!0;s||(this.key=n,this.destination.next(r))},e}(V);function $4(t,e){return cp(function(r,n){return e?e(r[t],n[t]):r[t]===n[t]})}function Fs(t){return t===void 0&&(t=F4),function(e){return e.lift(new j4(t))}}var j4=function(){function t(e){this.errorFactory=e}return t.prototype.call=function(e,r){return r.subscribe(new B4(e,this.errorFactory)
38)},t}(),B4=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.errorFactory=n,i.hasValue=!1,i}return e.prototype._next=function(r){this.hasValue=!0,this.destination.next(r)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var r=void 0;try{r=this.errorFactory()}catch(n){r=n}this.destination.error(r)},e}(V);function F4(){return new li}function fu(t){return function(e){return t===0?yn():e.lift(new W4(t))}}var W4=function(){function t(e){if(this.total=e,this.total<0)throw new nn}return t.prototype.call=function(e,r){return r.subscribe(new H4(e,this.total))},t}(),H4=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){var n=this.total,i=++this.count;i<=n&&(this.destination.next(r),i===n&&(this.destination.complete(),this.unsubscribe()))},e}(V);function V4(t,e){if(t<0)throw new nn;var r=arguments.length>=2;return function(n){return n.pipe(Xt(function(i,s){return s===t}),fu(1),r?hi(e):Fs(function(){return new nn}))}}function U4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return Fn(r,Cs.apply(void 0,t))}}function z4(t,e){return function(r){return r.lift(new q4(t,e,r))}}var q4=function(){function t(e,r,n){this.predicate=e,this.thisArg=r,this.source=n}return t.prototype.call=function(e,r){return r.subscribe(new G4(e,this.predicate,this.thisArg,this.source))},t}(),G4=function(t){I(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.predicate=n,o.thisArg=i,o.source=s,o.index=0,o.thisArg=i||o,o}return e.prototype.notifyComplete=function(r){this.destination.next(r),this.destination.complete()},e.prototype._next=function(r){var n=!1;try{n=this.predicate.call(this.thisArg,r,this.index++,this.source)}catch(i){this.destination.error(i);return}n||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(V);function J4(){return function(t){return t.lift(new Q4)}}var Q4=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new Z4(e))},t}(),Z4=function(t){I(e,t);function e(r){var n=t.call(this,r)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return e.prototype._next=function(r){this.hasSubscription||(this.hasSubscription=!0,this.add(_e(r,new me(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(we);function up(t,e){return e?function(r){return r.pipe(up(function(n,i){return Bt(t(n,i)).pipe(ot(function(s,o){return e(n,s,i,o)}))}))}:function(r){return r.lift(new Y4(t))}}var Y4=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new K4(e,this.project))},t}(),K4=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.project=n,i.hasSubscription=!1,i.hasCompleted=!1,i.index=0,i}return e.prototype._next=function(r){this.hasSubscription||this.tryNext(r)},e.prototype.tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this.hasSubscription=!0,this._innerSub(n)},e.prototype._innerSub=function(r){var n=new me(this),i=this.destination;i.add(n);var s=_e(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyError=function(r){this.destination.error(r)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(we);function X4(t,e,r){return e===void 0&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(n){return n.lift(new e5(t,e,r))}}var e5=function(){function t(e,r,n){this.project=e,this.concurrent=r,this.scheduler=n}return t.prototype.call=function(e,r){return r.subscribe(new t5(e,this.project,this.concurrent,this.scheduler))},t}(),t5=function(t){I(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;
38return o.project=n,o.concurrent=i,o.scheduler=s,o.index=0,o.active=0,o.hasCompleted=!1,i<Number.POSITIVE_INFINITY&&(o.buffer=[]),o}return e.dispatch=function(r){var n=r.subscriber,i=r.result,s=r.value,o=r.index;n.subscribeToProjection(i,s,o)},e.prototype._next=function(r){var n=this.destination;if(n.closed){this._complete();return}var i=this.index++;if(this.active<this.concurrent){n.next(r);try{var s=this.project,o=s(r,i);if(!this.scheduler)this.subscribeToProjection(o,r,i);else{var a={subscriber:this,result:o,value:r,index:i},c=this.destination;c.add(this.scheduler.schedule(e.dispatch,0,a))}}catch(u){n.error(u)}}else this.buffer.push(r)},e.prototype.subscribeToProjection=function(r,n,i){this.active++;var s=this.destination;s.add(_e(r,new me(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&this.active===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this._next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r&&r.length>0&&this._next(r.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},e}(we);function r5(t){return function(e){return e.lift(new n5(t))}}var n5=function(){function t(e){this.callback=e}return t.prototype.call=function(e,r){return r.subscribe(new i5(e,this.callback))},t}(),i5=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.add(new ve(n)),i}return e}(V);function s5(t,e){if(typeof t!="function")throw new TypeError("predicate is not a function");return function(r){return r.lift(new lp(t,r,!1,e))}}var lp=function(){function t(e,r,n,i){this.predicate=e,this.source=r,this.yieldIndex=n,this.thisArg=i}return t.prototype.call=function(e,r){return r.subscribe(new o5(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),o5=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.predicate=n,a.source=i,a.yieldIndex=s,a.thisArg=o,a.index=0,a}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete(),this.unsubscribe()},e.prototype._next=function(r){var n=this,i=n.predicate,s=n.thisArg,o=this.index++;try{var a=i.call(s||this,r,o,this.source);a&&this.notifyComplete(this.yieldIndex?o:r)}catch(c){this.destination.error(c)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(V);function a5(t,e){return function(r){return r.lift(new lp(t,r,!0,e))}}function c5(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?Xt(function(i,s){return t(i,s,n)}):Yt,fu(1),r?hi(e):Fs(function(){return new li}))}}function u5(){return function(e){return e.lift(new l5)}}var l5=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new f5(e))},t}(),f5=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._next=function(r){},e}(V);function h5(){return function(t){return t.lift(new d5)}}var d5=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new p5(e))},t}(),p5=function(t){I(e,t);function e(r){return t.call(this,r)||this}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype._next=function(r){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(V);function Vi(t){return function(r){return t===0?yn():r.lift(new b5(t))}}var b5=function(){function t(e){if(this.total=e,this.total<0)throw new nn}return t.prototype.call=function(e,r){return r.subscribe(new g5(e,this.total))},t}(),g5=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.ring=new Array,i.count=0,i}return e.prototype._next=function(r){var n=this.ring,i=this.total,s=this.count++;if(n.length<i)n.push(r);else{var o=s%i;n[o]=r}},e.prototype._complete=function(){var r=this.destination,n=this.count;if(n>0)for(var i=this.count>=this.total?this.total:this.count,s=this.ring,o=0;o<i;o++){var a=n++%i;r.next(s[a])}r.complete()},e}(V);function y5(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?Xt(function(i,s){return t(i,s,n)}):Yt,Vi(1),r?hi(e):Fs(function(){return new li}))}}function v5(t){return function(e){return e.lift(new m5(t))}}var m5=function(){function t(e){this.value=e}return t.prototype.call=function(e,r){return r.subscribe(new w5(e,this.value))},t}(),w5=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.value=n,i}return e.prototype._next=function(r){this.destination.next(this.value)},e}(V);function _5(){return function(e){return e.lift(new S5)}}var S5=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new E5(e))},t}(),E5=function(t){I(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){this.destination.next(Dt.createNext(r))},e.prototype._error=function(r){var n=this.destination;n.next(Dt.createError(r)),n.complete()},e.prototype._complete=function(){var r=this.destination;r.next(Dt.createComplete()),r.complete()},e}(V);function Ui(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(i){return i.lift(new C5(t,e,r))}}var C5=function(){function t(e,r,n){n===void 0&&(n=!1),this.accumulator=e,this.seed=r,this.hasSeed=n}return t.prototype.call=function(e,r){return r.subscribe(new x5(e,this.accumulator,this.seed,this.hasSeed))},t}(),x5=function(t){I(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.accumulator=n,o._seed=i,o.hasSeed=s,o.index=0,o}return Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(r){this.hasSeed=!0,this._seed=r},enumerable:!0,configurable:!0}),e.prototype._next=function(r){if(!this.hasSeed)this.seed=r,this.destination.next(r);else return this._tryNext(r)},e.prototype._tryNext=function(r){var n=this.index++,i;try{i=this.accumulator(this.seed,r,n)}catch(s){this.destination.error(s)}this.seed=i,this.destination.next(i)},e}(V);function Ws(t,e){return arguments.length>=2?function(n){return Za(Ui(t,e),Vi(1),hi(e))(n)}:function(n){return Za(Ui(function(i,s,o){return t(i,s,o+1)}),Vi(1))(n)}}function I5(t){var e=typeof t=="function"?function(r,n){return t(r,n)>0?r:n}:function(r,n){return r>n?r:n};return Ws(e)}function R5(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(Fd.apply(void 0,[r].concat(t)))}}function A5(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof e=="function"?vr(function(){return t},e,r):(typeof e=="number"&&(r=e),vr(function(){return t},r))}function M5(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),function(n){return n.lift(new k5(t,e,r))}}var k5=function(){function t(e,r,n){this.accumulator=e,this.seed=r,this.concurrent=n}return t.prototype.call=function(e,r){return r.subscribe(new T5(e,this.accumulator,this.seed,this.concurrent))},t}(),T5=function(t){I(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.accumulator=n,o.acc=i,o.concurrent=s,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return e.prototype._next=function(r){if(this.active<this.concurrent){var n=this.index++,i=this.destination,s=void 0;try{var o=this.accumulator;s=o(this.acc,r,n)}catch(a){return i.error(a)}this.active++,this._innerSub(s)}else this.buffer.push(r)},e.prototype._innerSub=function(r){var n=new me(this),i=this.destination;i.add(n);var s=_e(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(r){var n=this.destination;this.acc=r,this.hasValue=!0,n.next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},e}(we);function O5(t){var e=typeof t=="function"?function(r,n){return t(r,n)<0?r:n}:function(r,n){return r<n?r:n};return Ws(e)}function mr(t,e){return function(n){var i;if(typeof t=="function"?i=t:i=function(){return t},typeof e=="function")return n.lift(new N5(i,e));var s=Object.create(n,SS);return s.source=n,s.subjectFactory=i,s}}var N5=function(){function t(e,r){this.subjectFactory=e,this.selector=r}return t.prototype.call=function(e,r){var n=this.selector,i=this.subjectFactory(),s=n(i).subscribe(e);return s.add(r.subscribe(i)),s},t}();function L5(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1&&He(t[0])&&(t=t[0]),function(r){return r.lift(new P5(t))}}var P5=function(){function t(e){this.nextSources=e}return t.prototype.call=function(e,r){return r.subscribe(new D5(e,this.nextSources))},t}(),D5=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.destination=r,i.nextSources=n,i}return e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(r){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var r=this.nextSources.shift();if(r){var n=new me(this),i=this.destination;i.add(n);var s=_e(r,n);s!==n&&i.add(s)}else this.destination.complete()},e}(we);function $5(){return function(t){return t.lift(new j5)}}var j5=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new B5(e))},t}(),B5=function(t){I(e,t);function e(r){var n=t.call(this,r)||this;return n.hasPrev=!1,n}return e.prototype._next=function(r){var n;this.hasPrev?n=[this.prev,r]:this.hasPrev=!0,this.prev=r,n&&this.destination.next(n)},e}(V);
38function F5(t,e){return function(r){return[Xt(t,e)(r),Xt(Hd(t,e))(r)]}}function W5(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.length;if(r===0)throw new Error("list of properties cannot be empty.");return function(n){return ot(H5(t,r))(n)}}function H5(t,e){var r=function(n){for(var i=n,s=0;s<e;s++){var o=i!=null?i[t[s]]:void 0;if(o!==void 0)i=o;else return}return i};return r}function V5(t){return t?mr(function(){return new Te},t):mr(new Te)}function U5(t){return function(e){return mr(new _d(t))(e)}}function z5(){return function(t){return mr(new vn)(t)}}function q5(t,e,r,n){r&&typeof r!="function"&&(n=r);var i=typeof r=="function"?r:void 0,s=new Yc(t,e,n);return function(o){return mr(function(){return s},i)(o)}}function G5(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return t.length===1&&He(t[0])&&(t=t[0]),n.lift.call(Vd.apply(void 0,[n].concat(t)))}}function J5(t){return t===void 0&&(t=-1),function(e){return t===0?yn():t<0?e.lift(new Sf(-1,e)):e.lift(new Sf(t-1,e))}}var Sf=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new Q5(e,this.count,this.source))},t}(),Q5=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.count=n,s.source=i,s}return e.prototype.complete=function(){if(!this.isStopped){var r=this,n=r.source,i=r.count;if(i===0)return t.prototype.complete.call(this);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(V);function Z5(t){return function(e){return e.lift(new Y5(t))}}var Y5=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new K5(e,this.notifier,r))},t}(),K5=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s.sourceIsBeingSubscribedTo=!0,s}return e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(this.sourceIsBeingSubscribedTo===!1)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var r=this,n=r.notifications,i=r.retriesSubscription;n&&(n.unsubscribe(),this.notifications=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var r=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=r,this},e.prototype.subscribeToRetries=function(){this.notifications=new Te;var r;try{var n=this.notifier;r=n(this.notifications)}catch{return t.prototype.complete.call(this)}this.retries=r,this.retriesSubscription=_e(r,new me(this))},e}(we);function X5(t){return t===void 0&&(t=-1),function(e){return e.lift(new eC(t,e))}}var eC=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new tC(e,this.count,this.source))},t}(),tC=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.count=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this,i=n.source,s=n.count;if(s===0)return t.prototype.error.call(this,r);s>-1&&(this.count=s-1),i.subscribe(this._unsubscribeAndRecycle())}},e}(V);function rC(t){return function(e){return e.lift(new nC(t,e))}}var nC=function(){function t(e,r){this.notifier=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new iC(e,this.notifier,this.source))},t}(),iC=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{n=new Te;try{var o=this.notifier;i=o(n)}catch(a){return t.prototype.error.call(this,a)}s=_e(i,new me(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=s,n.next(r)}},e.prototype._unsubscribe=function(){var r=this,n=r.errors,i=r.retriesSubscription;n&&(n.unsubscribe(),this.errors=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var r=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=r,this.source.subscribe(this)},e}(we);function sC(t){return function(e){return e.lift(new oC(t))}}var oC=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new aC(e),i=r.subscribe(n);return i.add(_e(this.notifier,new me(n))),i},t}(),aC=function(t){I(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.hasValue=!1,r}return e.prototype._next=function(r){this.value=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(we);function cC(t,e){return e===void 0&&(e=Ve),function(r){return r.lift(new uC(t,e))}}
38var uC=function(){function t(e,r){this.period=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new lC(e,this.period,this.scheduler))},t}(),lC=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.period=n,s.scheduler=i,s.hasValue=!1,s.add(i.schedule(fC,n,{subscriber:s,period:n})),s}return e.prototype._next=function(r){this.lastValue=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(V);function fC(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}function hC(t,e){return function(r){return r.lift(new dC(t,e))}}var dC=function(){function t(e,r){this.compareTo=e,this.comparator=r}return t.prototype.call=function(e,r){return r.subscribe(new pC(e,this.compareTo,this.comparator))},t}(),pC=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.compareTo=n,s.comparator=i,s._a=[],s._b=[],s._oneComplete=!1,s.destination.add(n.subscribe(new bC(r,s))),s}return e.prototype._next=function(r){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(r),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var r=this,n=r._a,i=r._b,s=r.comparator;n.length>0&&i.length>0;){var o=n.shift(),a=i.shift(),c=!1;try{c=s?s(o,a):o===a}catch(u){this.destination.error(u)}c||this.emit(!1)}},e.prototype.emit=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype.nextB=function(r){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(r),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},e}(V),bC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.parent=n,i}return e.prototype._next=function(r){this.parent.nextB(r)},e.prototype._error=function(r){this.parent.error(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(V);function gC(){return new Te}function yC(){return function(t){return Jc()(mr(gC)(t))}}function vC(t,e,r){var n;return t&&typeof t=="object"?n=t:n={bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(i){return i.lift(mC(n))}}function mC(t){var e=t.bufferSize,r=e===void 0?Number.POSITIVE_INFINITY:e,n=t.windowTime,i=n===void 0?Number.POSITIVE_INFINITY:n,s=t.refCount,o=t.scheduler,a,c=0,u,l=!1,f=!1;return function(g){c++;var v;!a||l?(l=!1,a=new Yc(r,i,o),v=a.subscribe(this),u=g.subscribe({next:function(C){a.next(C)},error:function(C){l=!0,a.error(C)},complete:function(){f=!0,u=void 0,a.complete()}}),f&&(u=void 0)):v=a.subscribe(this),this.add(function(){c--,v.unsubscribe(),v=void 0,u&&!f&&s&&c===0&&(u.unsubscribe(),u=void 0,a=void 0)})}}function wC(t){return function(e){return e.lift(new _C(t,e))}}var _C=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new SC(e,this.predicate,this.source))},t}(),SC=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.source=i,s.seenValue=!1,s.index=0,s}return e.prototype.applySingleValue=function(r){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=r)},e.prototype._next=function(r){var n=this.index++;this.predicate?this.tryNext(r,n):this.applySingleValue(r)},e.prototype.tryNext=function(r,n){try{this.predicate(r,n,this.source)&&this.applySingleValue(r)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){var r=this.destination;this.index>0?(r.next(this.seenValue?this.singleValue:void 0),r.complete()):r.error(new li)},e}(V);function EC(t){return function(e){return e.lift(new CC(t))}}var CC=function(){function t(e){this.total=e}return t.prototype.call=function(e,r){return r.subscribe(new xC(e,this.total))},t}(),xC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){++this.count>this.total&&this.destination.next(r)},e}(V);function IC(t){return function(e){return e.lift(new RC(t))}}var RC=function(){function t(e){if(this._skipCount=e,this._skipCount<0)throw new nn}return t.prototype.call=function(e,r){return this._skipCount===0?r.subscribe(new V(e)):r.subscribe(new AC(e,this._skipCount))},t}(),AC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i._skipCount=n,i._count=0,i._ring=new Array(n),i}return e.prototype._next=function(r){var n=this._skipCount,i=this._count++;
38if(i<n)this._ring[i]=r;else{var s=i%n,o=this._ring,a=o[s];o[s]=r,this.destination.next(a)}},e}(V);function MC(t){return function(e){return e.lift(new kC(t))}}var kC=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new TC(e,this.notifier))},t}(),TC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;i.hasValue=!1;var s=new me(i);i.add(s),i.innerSubscription=s;var o=_e(n,s);return o!==s&&(i.add(o),i.innerSubscription=o),i}return e.prototype._next=function(r){this.hasValue&&t.prototype._next.call(this,r)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(we);function OC(t){return function(e){return e.lift(new NC(t))}}var NC=function(){function t(e){this.predicate=e}return t.prototype.call=function(e,r){return r.subscribe(new LC(e,this.predicate))},t}(),LC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.predicate=n,i.skipping=!0,i.index=0,i}return e.prototype._next=function(r){var n=this.destination;this.skipping&&this.tryCallPredicate(r),this.skipping||n.next(r)},e.prototype.tryCallPredicate=function(r){try{var n=this.predicate(r,this.index++);this.skipping=!!n}catch(i){this.destination.error(i)}},e}(V);function PC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Qe(r)?(t.pop(),function(n){return Fn(t,n,r)}):function(n){return Fn(t,n)}}var DC=function(t){I(e,t);function e(r,n,i){n===void 0&&(n=0),i===void 0&&(i=Oi);var s=t.call(this)||this;return s.source=r,s.delayTime=n,s.scheduler=i,(!sn(n)||n<0)&&(s.delayTime=0),(!i||typeof i.schedule!="function")&&(s.scheduler=Oi),s}return e.create=function(r,n,i){return n===void 0&&(n=0),i===void 0&&(i=Oi),new e(r,n,i)},e.dispatch=function(r){var n=r.source,i=r.subscriber;return this.add(n.subscribe(i))},e.prototype._subscribe=function(r){var n=this.delayTime,i=this.source,s=this.scheduler;return s.schedule(e.dispatch,n,{source:i,subscriber:r})},e}(X);function $C(t,e){return e===void 0&&(e=0),function(n){return n.lift(new jC(t,e))}}var jC=function(){function t(e,r){this.scheduler=e,this.delay=r}return t.prototype.call=function(e,r){return new DC(r,this.delay,this.scheduler).subscribe(e)},t}();function Wn(t,e){return typeof e=="function"?function(r){return r.pipe(Wn(function(n,i){return Bt(t(n,i)).pipe(ot(function(s,o){return e(n,s,i,o)}))}))}:function(r){return r.lift(new BC(t))}}var BC=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new FC(e,this.project))},t}(),FC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.project=n,i.index=0,i}return e.prototype._next=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this._innerSub(n)},e.prototype._innerSub=function(r){var n=this.innerSubscription;n&&n.unsubscribe();var i=new me(this),s=this.destination;s.add(i),this.innerSubscription=_e(r,i),this.innerSubscription!==i&&s.add(this.innerSubscription)},e.prototype._complete=function(){var r=this.innerSubscription;(!r||r.closed)&&t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(r){this.destination.next(r)},e}(we);function WC(){return Wn(Yt)}function HC(t,e){return e?Wn(function(){return t},e):Wn(function(){return t})}function VC(t){return function(e){return e.lift(new UC(t))}}var UC=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new zC(e),i=_e(this.notifier,new me(n));return i&&!n.seenValue?(n.add(i),r.subscribe(n)):n},t}(),zC=function(t){I(e,t);function e(r){var n=t.call(this,r)||this;return n.seenValue=!1,n}return e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(we);function qC(t,e){return e===void 0&&(e=!1),function(r){return r.lift(new GC(t,e))}}var GC=function(){function t(e,r){this.predicate=e,this.inclusive=r}return t.prototype.call=function(e,r){return r.subscribe(new JC(e,this.predicate,this.inclusive))},t}(),JC=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.inclusive=i,s.index=0,s}return e.prototype._next=function(r){var n=this.destination,i;try{i=this.predicate(r,this.index++)}catch(s){n.error(s);return}this.nextOrComplete(r,i)},e.prototype.nextOrComplete=function(r,n){var i=this.destination;n?i.next(r):(this.inclusive&&i.next(r),i.complete())},e}(V);function QC(t,e,r){return function(i){return i.lift(new ZC(t,e,r))}}var ZC=function(){function t(e,r,n){this.nextOrObserver=e,this.error=r,this.complete=n}return t.prototype.call=function(e,r){return r.subscribe(new YC(e,this.nextOrObserver,this.error,this.complete))},t}(),YC=function(t){I(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o._tapNext=St,o._tapError=St,o._tapComplete=St,o._tapError=i||St,o._tapComplete=s||St,tn(n)?(o._context=o,o._tapNext=n):n&&(o._context=n,o._tapNext=n.next||St,o._tapError=n.error||St,o._tapComplete=n.complete||St),o}return e.prototype._next=function(r){try{this._tapNext.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.next(r)},e.prototype._error=function(r){try{this._tapError.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.error(r)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(r){this.destination.error(r);return}return this.destination.complete()},e}(V),fp={leading:!0,trailing:!1};function KC(t,e){return e===void 0&&(e=fp),function(r){return r.lift(new XC(t,!!e.leading,!!e.trailing))}}var XC=function(){function t(e,r,n){this.durationSelector=e,this.leading=r,this.trailing=n}return t.prototype.call=function(e,r){return r.subscribe(new ex(e,this.durationSelector,this.leading,this.trailing))},t}(),ex=function(t){I(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.destination=r,o.durationSelector=n,o._leading=i,o._trailing=s,o._hasValue=!1,o}return e.prototype._next=function(r){this._hasValue=!0,this._sendValue=r,this._throttled||(this._leading?this.send():this.throttle(r))},e.prototype.send=function(){var r=this,n=r._hasValue,i=r._sendValue;n&&(this.destination.next(i),this.throttle(i)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(r){var n=this.tryDurationSelector(r);n&&this.add(this._throttled=_e(n,new me(this)))},e.prototype.tryDurationSelector=function(r){try{return this.durationSelector(r)}catch(n){return this.destination.error(n),null}},e.prototype.throttlingDone=function(){var r=this,n=r._throttled,i=r._trailing;n&&n.unsubscribe(),this._throttled=void 0,i&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(we);function tx(t,e,r){return e===void 0&&(e=Ve),r===void 0&&(r=fp),function(n){return n.lift(new rx(t,e,r.leading,r.trailing))}}var rx=function(){function t(e,r,n,i){this.duration=e,this.scheduler
38=r,this.leading=n,this.trailing=i}return t.prototype.call=function(e,r){return r.subscribe(new nx(e,this.duration,this.scheduler,this.leading,this.trailing))},t}(),nx=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.duration=n,a.scheduler=i,a.leading=s,a.trailing=o,a._hasTrailingValue=!1,a._trailingValue=null,a}return e.prototype._next=function(r){this.throttled?this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(ix,this.duration,{subscriber:this})),this.leading?this.destination.next(r):this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var r=this.throttled;r&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),r.unsubscribe(),this.remove(r),this.throttled=null)},e}(V);function ix(t){var e=t.subscriber;e.clearThrottle()}function sx(t){return t===void 0&&(t=Ve),function(e){return eu(function(){return e.pipe(Ui(function(r,n){var i=r.current;return{value:n,current:t.now(),last:i}},{current:t.now(),value:void 0,last:void 0}),ot(function(r){var n=r.current,i=r.last,s=r.value;return new ox(s,n-i)}))})}}var ox=function(){function t(e,r){this.value=e,this.interval=r}return t}();function hp(t,e,r){return r===void 0&&(r=Ve),function(n){var i=ap(t),s=i?+t-r.now():Math.abs(t);return n.lift(new ax(s,i,e,r))}}var ax=function(){function t(e,r,n,i){this.waitFor=e,this.absoluteTimeout=r,this.withObservable=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new cx(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),cx=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.absoluteTimeout=n,a.waitFor=i,a.withObservable=s,a.scheduler=o,a.scheduleTimeout(),a}return e.dispatchTimeout=function(r){var n=r.withObservable;
38r._unsubscribeAndRecycle(),r.add(_e(n,new me(r)))},e.prototype.scheduleTimeout=function(){var r=this.action;r?this.action=r.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(r){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,r)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(we);function ux(t,e){return e===void 0&&(e=Ve),hp(t,Zc(new kd),e)}function lx(t){return t===void 0&&(t=Ve),ot(function(e){return new fx(e,t.now())})}var fx=function(){function t(e,r){this.value=e,this.timestamp=r}return t}();function hx(t,e,r){return r===0?[e]:(t.push(e),t)}function dx(){return Ws(hx,[])}function px(t){return function(r){return r.lift(new bx(t))}}var bx=function(){function t(e){this.windowBoundaries=e}return t.prototype.call=function(e,r){var n=new gx(e),i=r.subscribe(n);return i.closed||n.add(_e(this.windowBoundaries,new me(n))),i},t}(),gx=function(t){I(e,t);function e(r){var n=t.call(this,r)||this;return n.window=new Te,r.next(n.window),n}return e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(r){this._error(r)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(r){this.window.next(r)},e.prototype._error=function(r){this.window.error(r),this.destination.error(r)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var r=this.window;r&&r.complete();var n=this.destination,i=this.window=new Te;n.next(i)},e}(we);function yx(t,e){return e===void 0&&(e=0),function(n){return n.lift(new vx(t,e))}}var vx=function(){function t(e,r){this.windowSize=e,this.startWindowEvery=r}return t.prototype.call=function(e,r){return r.subscribe(new mx(e,this.windowSize,this.startWindowEvery))},t}(),mx=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.destination=r,s.windowSize=n,s.startWindowEvery=i,s.windows=[new Te],s.count=0,r.next(s.windows[0]),s}return e.prototype._next=function(r){for(var n=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,i=this.destination,s=this.windowSize,o=this.windows,a=o.length,c=0;c<a&&!this.closed;c++)o[c].next(r);var u=this.count-s+1;if(u>=0&&u%n===0&&!this.closed&&o.shift().complete(),++this.count%n===0&&!this.closed){var l=new Te;o.push(l),i.next(l)}},e.prototype._error=function(r){var n=this.windows;if(n)for(;n.length>0&&!this.closed;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){var r=this.windows;if(r)for(;r.length>0&&!this.closed;)r.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(V);function wx(t){var e=Ve,r=null,n=Number.POSITIVE_INFINITY;return Qe(arguments[3])&&(e=arguments[3]),Qe(arguments[2])?e=arguments[2]:sn(arguments[2])&&(n=Number(arguments[2])),Qe(arguments[1])?e=arguments[1]:sn(arguments[1])&&(r=Number(arguments[1])),function(s){return s.lift(new _x(t,r,n,e))}}var _x=function(){function t(e,r,n,i){this.windowTimeSpan=e,this.windowCreationInterval=r,this.maxWindowSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new Ex(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),Sx=function(t){I(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._numberOfNextedValues=0,r}return e.prototype.next=function(r){this._numberOfNextedValues++,t.prototype.next.call(this,r)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(Te),Ex=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.destination=r,a.windowTimeSpan=n,a.windowCreationInterval=i,a.maxWindowSize=s,a.scheduler=o,a.windows=[];var c=a.openWindow();if(i!==null&&i>=0){var u={subscriber:a,window:c,context:null},l={windowTimeSpan:n,windowCreationInterval:i,subscriber:a,scheduler:o};a.add(o.schedule(dp,n,u)),a.add(o.schedule(xx,i,l))}else{var f={subscriber:a,window:c,windowTimeSpan:n};a.add(o.schedule(Cx,n,f))}return a}return e.prototype._next=function(r){for(var n=this.windows,i=n.length,s=0;s<i;s++){var o=n[s];o.closed||(o.next(r),o.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(o))}},e.prototype._error=function(r){for(var n=this.windows;n.length>0;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){for(var r=this.windows;r.length>0;){var n=r.shift();n.closed||n.complete()}this.destination.complete()},e.prototype.openWindow=function(){var r=new Sx;this.windows.push(r);var n=this.destination;return n.next(r),r},e.prototype.closeWindow=function(r){r.complete();var n=this.windows;n.splice(n.indexOf(r),1)},e}(V);function Cx(t){var e=t.subscriber,r=t.windowTimeSpan,n=t.window;n&&e.closeWindow(n),t.window=e.openWindow(),this.schedule(t,r)}function xx(t){var e=t.windowTimeSpan,r=t.subscriber,n=t.scheduler,i=t.windowCreationInterval,s=r.openWindow(),o=this,a={action:o,subscription:null},c={subscriber:r,window:s,context:a};a.subscription=n.schedule(dp,e,c),o.add(a.subscription),o.schedule(t,i)}function dp(t){var e=t.subscriber,r=t.window,n=t.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),e.closeWindow(r)}function Ix(t,e){return function(r){return r.lift(new Rx(t,e))}}var Rx=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new Ax(e,this.openings,this.closingSelector))},t}(),Ax=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;
38return s.openings=n,s.closingSelector=i,s.contexts=[],s.add(s.openSubscription=jt(s,n,n)),s}return e.prototype._next=function(r){var n=this.contexts;if(n)for(var i=n.length,s=0;s<i;s++)n[s].window.next(r)},e.prototype._error=function(r){var n=this.contexts;if(this.contexts=null,n)for(var i=n.length,s=-1;++s<i;){var o=n[s];o.window.error(r),o.subscription.unsubscribe()}t.prototype._error.call(this,r)},e.prototype._complete=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var s=r[i];s.window.complete(),s.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var s=r[i];s.window.unsubscribe(),s.subscription.unsubscribe()}},e.prototype.notifyNext=function(r,n,i,s,o){if(r===this.openings){var a=void 0;try{var c=this.closingSelector;a=c(n)}catch(g){return this.error(g)}var u=new Te,l=new ve,f={window:u,subscription:l};this.contexts.push(f);var h=jt(this,a,f);h.closed?this.closeWindow(this.contexts.length-1):(h.context=f,l.add(h)),this.destination.next(u)}else this.closeWindow(this.contexts.indexOf(r))},e.prototype.notifyError=function(r){this.error(r)},e.prototype.notifyComplete=function(r){r!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(r.context))},e.prototype.closeWindow=function(r){if(r!==-1){var n=this.contexts,i=n[r],s=i.window,o=i.subscription;n.splice(r,1),s.complete(),o.unsubscribe()}},e}(Rr);function Mx(t){return function(r){return r.lift(new kx(t))}}var kx=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new Tx(e,this.closingSelector))},t}(),Tx=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.destination=r,i.closingSelector=n,i.openWindow(),i}return e.prototype.notifyNext=function(r,n,i,s,o){this.openWindow(o)},e.prototype.notifyError=function(r){this._error(r)},e.prototype.notifyComplete=function(r){this.openWindow(r)},e.prototype._next=function(r){this.window.next(r)},e.prototype._error=function(r){this.window.error(r),this.destination.error(r),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(r){r===void 0&&(r=null),r&&(this.remove(r),r.unsubscribe());var n=this.window;n&&n.complete();var i=this.window=new Te;this.destination.next(i);var s;try{var o=this.closingSelector;s=o()}catch(a){this.destination.error(a),this.window.error(a);return}this.add(this.closingNotification=jt(this,s))},e}(Rr);function Ox(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){var n;typeof t[t.length-1]=="function"&&(n=t.pop());var i=t;return r.lift(new Nx(i,n))}}var Nx=function(){function t(e,r){this.observables=e,this.project=r}return t.prototype.call=function(e,r){return r.subscribe(new Lx(e,this.observables,this.project))},t}(),Lx=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;s.observables=n,s.project=i,s.toRespond=[];var o=n.length;s.values=new Array(o);for(var a=0;a<o;a++)s.toRespond.push(a);for(var a=0;a<o;a++){var c=n[a];s.add(jt(s,c,void 0,a))}return s}return e.prototype.notifyNext=function(r,n,i){this.values[i]=n;var s=this.toRespond;if(s.length>0){var o=s.indexOf(i);o!==-1&&s.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(r){if(this.toRespond.length===0){var n=[r].concat(this.values);this.project?this._tryProject(n):this.destination.next(n)}},e.prototype._tryProject=function(r){var n;try{n=this.project.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(Rr);function Px(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return n.lift.call(zd.apply(void 0,[n].concat(t)))}}function Dx(t){return function(e){return e.lift(new qd(t))}}const $x=Object.freeze(Object.defineProperty({__proto__:null,audit:ip,auditTime:$3,buffer:j3,bufferCount:W3,bufferTime:z3,bufferToggle:Z3,bufferWhen:X3,catchError:r4,combineAll:s4,combineLatest:o4,concat:a4,concatAll:Dd,concatMap:op,concatMapTo:c4,count:u4,debounce:h4,debounceTime:b4,defaultIfEmpty:hi,delay:_4,delayWhen:x4,dematerialize:M4,distinct:O4,distinctUntilChanged:cp,distinctUntilKeyChanged:$4,elementAt:V4,endWith:U4,every:z4,exhaust:J4,exhaustMap:up,expand:X4,filter:Xt,finalize:r5,find:s5,findIndex:a5,first:c5,flatMap:gE,groupBy:CS,ignoreElements:u5,isEmpty:h5,last:y5,map:ot,mapTo:v5,materialize:_5,max:I5,merge:R5,mergeAll:Xc,mergeMap:vr,mergeMapTo:A5,mergeScan:M5,min:O5,multicast:mr,observeOn:LS,onErrorResumeNext:L5,pairwise:$5,partition:F5,pluck:W5,publish:V5,publishBehavior:U5,publishLast:z5,publishReplay:q5,race:G5,reduce:Ws,refCount:Jc,repeat:J5,repeatWhen:Z5,retry:X5,retryWhen:rC,sample:sC,sampleTime:cC,scan:Ui,sequenceEqual:hC,share:yC,shareReplay:vC,single:wC,skip:EC,skipLast:IC,skipUntil:MC,skipWhile:OC,startWith:PC,subscribeOn:$C,switchAll:WC,switchMap:Wn,switchMapTo:HC,take:fu,takeLast:Vi,takeUntil:VC,takeWhile:qC,tap:QC,throttle:KC,throttleTime:tx,throwIfEmpty:Fs,timeInterval:sx,timeout:ux,timeoutWith:hp,timestamp:lx,toArray:dx,window:px,windowCount:yx,windowTime:wx,windowToggle:Ix,windowWhen:Mx,withLatestFrom:Ox,zip:Px,zipAll:Dx},Symbol.toStringTag,{value:"Module"})),hu=wr($x);var Hs={},tt={};
38Object.defineProperty(tt,"__esModule",{value:!0});tt.ClientMessagePublishEvent=tt.ClientMessageSetSessionConfig=tt.ClientMessageGetSessionConfig=tt.ClientMessageIsLinked=tt.ClientMessageHostSession=void 0;function jx(t){return Object.assign({type:"HostSession"},t)}tt.ClientMessageHostSession=jx;function Bx(t){return Object.assign({type:"IsLinked"},t)}tt.ClientMessageIsLinked=Bx;function Fx(t){return Object.assign({type:"GetSessionConfig"},t)}tt.ClientMessageGetSessionConfig=Fx;function Wx(t){return Object.assign({type:"SetSessionConfig"},t)}tt.ClientMessageSetSessionConfig=Wx;function Hx(t){return Object.assign({type:"PublishEvent"},t)}tt.ClientMessagePublishEvent=Hx;var pp={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;const e=xs,r=hu;var n;(function(s){s[s.DISCONNECTED=0]="DISCONNECTED",s[s.CONNECTING=1]="CONNECTING",s[s.CONNECTED=2]="CONNECTED"})(n=t.ConnectionState||(t.ConnectionState={}));class i{constructor(o,a=WebSocket){this.WebSocketClass=a,this.webSocket=null,this.connectionStateSubject=new e.BehaviorSubject(n.DISCONNECTED),this.incomingDataSubject=ne
38w e.Subject,this.url=o.replace(/^http/,"ws")}connect(){return this.webSocket?(0,e.throwError)(new Error("webSocket object is not null")):new e.Observable(o=>{let a;try{this.webSocket=a=new this.WebSocketClass(this.url)}catch(c){o.error(c);return}this.connectionStateSubject.next(n.CONNECTING),a.onclose=c=>{this.clearWebSocket(),o.error(new Error(`websocket error ${c.code}: ${c.reason}`)),this.connectionStateSubject.next(n.DISCONNECTED)},a.onopen=c=>{o.next(),o.complete(),this.connectionStateSubject.next(n.CONNECTED)},a.onmessage=c=>{this.incomingDataSubject.next(c.data)}}).pipe((0,r.take)(1))}disconnect(){const{webSocket:o}=this;if(o){this.clearWebSocket(),this.connectionStateSubject.next(n.DISCONNECTED);try{o.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,r.flatMap)(o=>{let a;try{a=JSON.parse(o)}catch{return(0,e.empty)()}return(0,e.of)(a)}))}sendData(o){const{webSocket:a}=this;if(!a)throw new Error("websocket is not connected");a.send(o)}clearWebSocket(){const{webSocket:o}=this;o&&(this.webSocket=null,o.onclose=null,o.onerror=null,o.onmessage=null,o.onopen=null)}}t.RxWebSocket=i})(pp);var Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.isServerMessageFail=void 0;function Vx(t){return t&&t.type==="Fail"&&typeof t.id=="number"&&typeof t.sessionId=="string"&&typeof t.error=="string"}Vs.isServerMessageFail=Vx;Object.defineProperty(Hs,"__esModule",{value:!0});Hs.WalletSDKConnection=void 0;const ct=xs,ne=hu,In=un,Pr=Qn,Rn=tt,An=cn,Ri=pp,Na=Vs,Ef=1e4,Ux=6e4;class zx{constructor(e,r,n,i,s=WebSocket){this.sessionId=e,this.sessionKey=r,this.diagnostic=i,this.subscriptions=new ct.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Pr.IntNumber)(1),this.connectedSubject=ne
38w ct.BehaviorSubject(!1),this.linkedSubject=new ct.BehaviorSubject(!1),this.sessionConfigSubject=new ct.ReplaySubject(1);const o=new Ri.RxWebSocket(n+"/rpc",s);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,ne.tap)(a=>{var c;return(c=this.diagnostic)===null||c===void 0?void 0:c.log(An.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:In.Session.hash(e)})}),(0,ne.skip)(1),(0,ne.filter)(a=>a===Ri.ConnectionState.DISCONNECTED&&!this.destroyed),(0,ne.delay)(5e3),(0,ne.filter)(a=>!this.destroyed),(0,ne.flatMap)(a=>o.connect()),(0,ne.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,ne.skip)(2),(0,ne.switchMap)(a=>(0,ct.iif)(()=>a===Ri.ConnectionState.CONNECTED,this.authenticate().pipe((0,ne.tap)(c=>this.sendIsLinked()),(0,ne.tap)(c=>this.sendGetSessionConfig()),(0,ne.map)(c=>!0)),(0,ct.of)(!1))),(0,ne.distinctUntilChanged)(),(0,ne.catchError)(a=>(0,ct.of)(!1))).subscribe(a=>this.connectedSubject.next(a))),this.subscriptions.add(o.connectionState$.pipe((0,ne.skip)(1),(0,ne.switchMap)(a=>(0,ct.iif)(()=>a===Ri.ConnectionState.CONNECTED,(0,ct.timer)(0,Ef)))).subscribe(a=>a===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(o.incomingData$.pipe((0,ne.filter)(a=>a==="h")).subscribe(a=>this.updateLastHeartbeat())),this.subscriptions.add(o.incomingJSONData$.pipe((0,ne.filter)(a=>["IsLinkedOK","Linked"].includes(a.type))).subscribe(a=>{var c;const u=a;(c=this.diagnostic)===null||c===void 0||c.log(An.EVENTS.LINKED,{sessionIdHash:In.Session.hash(e),linked:u.linked,type:a.type,onlineGuests:u.onlineGuests}),this.linkedSubject.next(u.linked||u.onlineGuests>0)})),this.subscriptions.add(o.incomingJSONData$.pipe((0,ne.filter)(a=>["GetSessionConfigOK","SessionConfigUpdated"].includes(a.type))).subscribe(a=>{var c;const u=a;(c=this.diagnostic)===null||c===void 0||c.log(An.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:In.Session.hash(e),metadata_keys:u&&u.metadata?Object.keys(u.metadata):void 0}),this.sessionConfigSubject.next({webhookId:u.webhookId,webhookUrl:u.webhookUrl,metadata:u.metadata})}))}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(An.EVENTS.STARTED_CONNECTING,{sessionIdHash:In.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(An.EVENTS.DISCONNECTED,{sessionIdHash:In.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,ne.filter)(e=>e),(0,ne.take)(1),(0,ne.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,ne.filter)(e=>e),(0,ne.take)(1),(0,ne.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,ne.filter)(e=>{if(e.type!=="Event")return!1;const r=e;return typeof r.sessionId=="string"&&typeof r.eventId=="string"&&typeof r.event=="string"&&typeof r.data=="string"}),(0,ne.map)(e=>e))}setSessionMetadata(e,r){const n=(0,Rn.ClientMessageSetSessionConfig)({id:(0,Pr.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[e]:r}});return this.onceConnected$.pipe((0,ne.flatMap)(i=>this.makeRequest(n)),(0,ne.map)(i=>{if((0,Na.isServerMessageFail)(i))throw new Error(i.error||"failed to set session metadata")}))}publishEvent(e,r,n=!1){const i=(0,Rn.ClientMessagePublishEvent)({id:(0,Pr.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:r,callWebhook:n});return this.onceLinked$.pipe((0,ne.flatMap)(s=>this.makeRequest(i)),(0,ne.map)(s=>{if((0,Na.isServerMessageFail)(s))throw new Error(s.error||"failed to publish event");return s.eventId}))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Ef*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}
38makeRequest(e,r=Ux){const n=e.id;try{this.sendData(e)}catch(i){return(0,ct.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,ne.timeoutWith)(r,(0,ct.throwError)(new Error(`request ${n} timed out`))),(0,ne.filter)(i=>i.id===n),(0,ne.take)(1))}authenticate(){const e=(0,Rn.ClientMessageHostSession)({id:(0,Pr.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,ne.map)(r=>{if((0,Na.isServerMessageFail)(r))throw new Error(r.error||"failed to authentcate")}))}sendIsLinked(){const e=(0,Rn.ClientMessageIsLinked)({id:(0,Pr.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}sendGetSessionConfig(){const e=(0,Rn.ClientMessageGetSessionConfig)({id:(0,Pr.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}Hs.WalletSDKConnection=zx;var on={};Object.defineProperty(on,"__esModule",{value:!0});on.decrypt=on.encrypt=void 0;const zi=W;async function qx(t,e){if(e.length!==64)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,zi.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(t)),o=16,a=s.slice(s.byteLength-o),c=s.slice(0,s.byteLength-o),u=new Uint8Array(a),l=new Uint8Array(c),f=new Uint8Array([...r,...u,...l]);return(0,zi.uint8ArrayToHex)(f)}on.encrypt=qx;function Gx(t,e){if(e.length!==64)throw Error("secret must be 256 bits");return new Promise((r,n)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,zi.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,zi.hexStringToUint8Array)(t),o=s.slice(0,12),a=s.slice(12,28),c=s.slice(28),u=new Uint8Array([...c,...a]),l={name:"AES-GCM",iv:new Uint8Array(o)};try{const f=await window.crypto.subtle.decrypt(l,i,u),h=new TextDecoder;r(h.decode(f))}catch(f){n(f)}})()})}on.decrypt=Gx;var Us={},zs={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(t.RelayMessageType||(t.RelayMessageType={}))})(zs);Object.defineProperty(Us,"__esModule",{value:!0});Us.Web3RequestCanceledMessage=void 0;const Jx=zs;function Qx(t){return{type:Jx.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}}Us.Web3RequestCanceledMessage=Qx;var qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.Web3RequestMessage=void 0;const Zx=zs;function Yx(t){return Object.assign({type:Zx.RelayMessageType.WEB3_REQUEST},t)}qs.Web3RequestMessage=Yx;var an={};Object.defineProperty(an,"__esModule",{value:!0});an.isWeb3ResponseMessage=an.Web3ResponseMessage=void 0;const bp=zs;function Kx(t){return Object.assign({type:bp.RelayMessageType.WEB3_RESPONSE},t)}an.Web3ResponseMessage=Kx;function Xx(t){return t&&t.type===bp.RelayMessageType.WEB3_RESPONSE}an.isWeb3ResponseMessage=Xx;var eI=B&&B.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tI=B&&B.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),gp=B&&B.__decorate||function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},rI=B&&B.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&eI(e,t,r);return tI(e,t),e},nI=B&&B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(js,"__esModule",{value:!0});js.WalletSDKRelay=void 0;const yp=nI(Bs),sr=xs,Ce=hu,De=cn,iI=Hs,Dr=Hn,sI=Qn,be=W,Ht=rI(on),Vt=un,Ai=ht,Oe=Yi,oI=Us,aI=qs,Xe=de,ze=an;class ft extends Ai.WalletSDKRelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=ne
38w sr.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new sr.Subscription,this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:i,connection:s}=this.subscribe();if(this._session=n,this.connection=s,this.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this.diagnostic={log:e.eventListener.onEvent}:this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe(i=>{this.dappDefaultChain!==i&&(this.dappDefaultChain=i)}));const e=Vt.Session.load(this.storage)||new Vt.Session(this.storage).save(),r=new iI.WalletSDKConnection(e.id,e.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(r.sessionConfig$.subscribe({next:i=>{this.onSessionConfigChanged(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(De.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(r.incomingEvent$.pipe((0,Ce.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(r.linked$.pipe((0,Ce.skip)(1),(0,Ce.tap)(i=>{var s;this.isLinked=i;const o=this.storage.getItem(Ai.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this.session.linked=i),this.isUnlinkedErrorState=!1,o){const a=o.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";if(a[0]!==""&&!i&&this.session.linked&&!c){this.isUnlinkedErrorState=!0;const u=this.getSessionIdHash();(s=this.diagnostic)===null||s===void 0||s.log(De.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:u})}}})).subscribe()),this.subscriptions.add(r.sessionConfig$.pipe((0,Ce.filter)(i=>!!i.metadata&&i.metadata.__destroyed==="1")).subscribe(()=>{var i;const s=r.isDestroyed;return(i=this.diagnostic)===null||i===void 0||i.log(De.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:s,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ce.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,Ce.mergeMap)(i=>Ht.decrypt(i.metadata.WalletUsername,e.secret))).subscribe({next:i=>{this.storage.setItem(Ai.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(De.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ce.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,Ce.mergeMap)(i=>Ht.decrypt(i.metadata.AppVersion,e.secret))).subscribe({next:i=>{this.storage.setItem(Ai.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(De.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ce.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,Ce.mergeMap)(i=>(0,sr.zip)(Ht.decrypt(i.metadata.ChainId,e.secret),Ht.decrypt(i.metadata.JsonRpcUrl,e.secret)))).pipe((0,Ce.distinctUntilChanged)()).subscribe({next:([i,s])=>{this.chainCallback&&this.chainCallback(i,s)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(De.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ce.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,Ce.mergeMap)(i=>Ht.decrypt(i.metadata.EthereumAddress,e.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),ft.accountRequestCallbackIds.size>0&&(Array.from(ft.accountRequestCallbackIds.values()).forEach(s=>{const o=(0,ze.Web3ResponseMessage)({id:s,response:(0,Xe.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),ft.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(De.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ce.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,Ce.mergeMap)(i=>Ht.decrypt(i.metadata.AppSrc,e.secret))).subscribe({next:i=>{this.ui.setAppSrc(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(De.EVENTS.GENERAL_ER
38ROR,{message:"Had error decrypting",value:"appSrc"})}}));const n=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:e,connected$:r.connected$,chainId$:this.dappDefaultChainSubject});return r.connect(),{session:e,ui:n,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,Ce.timeout)(1e3),(0,Ce.catchError)(e=>(0,sr.of)(null))).subscribe(e=>{var r,n,i;const s=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch{(r=this.diagnostic)===null||r===void 0||r.log(De.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(n=this.diagnostic)===null||n===void 0||n.log(De.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=Vt.Session.load(this.storage);if((o==null?void 0:o.id)===this._session.id?this.storage.clear():o&&((i=this.diagnostic)===null||i===void 0||i.log(De.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Vt.Session.hash(o.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new sr.Subscription;const{session:a,ui:c,connection:u}=this.subscribe();this._session=a,this.connection=u,this.ui=c,s&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()},e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(De.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:Oe.Web3Method.signEthereumMessage,params:{message:(0,be.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:Oe.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,be.hexStringFromBuffer)(e,!0),signature:(0,be.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:Oe.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,be.bigIntStringFromBN)(e.weiValue),data:(0,be.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,be.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,be.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,be.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,be.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:Oe.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,be.bigIntStringFromBN)(e.weiValue),data:(0,be.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,be.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,be.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,be.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,be.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:Oe.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,be.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:Oe.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,be.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:Oe.Web3Method.generic,params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,be.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r==null||r(),c.errorMessage)return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChainSubject.next(e)}publishWeb3RequestEvent(e,r){var n;const i=(0,aI.Web3RequestMessage)({id:e,request:r}),s=Vt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(De.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Vt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(De.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Vt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})},error:o=>{this.handleWeb3ResponseMessage((0,ze.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:o.message}}))}}))}publishWeb3RequestCanceledEvent(e){const r=(0,oI.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",r,!1).subscribe())}publishEvent(e,r,n){const i=this.session.secret;return new sr.Observable(s=>{Ht.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin})),i).then(o=>{s.next(o),s.complete()})}).pipe((0,Ce.mergeMap)(s=>this.connection.publishEvent(e,s,n)))}handleIncomingEvent(e){try{this.subscriptions.add((0,sr.from)(Ht.decrypt(e.data,this.session.secret)).pipe((0,Ce.map)(r=>JSON.parse(r))).subscribe({next:r=>{const n=(0,ze.isWeb3ResponseMessage)(r)?r:null;n&&this.handleWeb3ResponseMessage(n)},error:()=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(De.EVENTS.GENERAL_ER
38ROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(e){var r;const{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(De.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,Xe.isRequestEthereumAccountsResponse)(n)){ft.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),ft.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var s;const o=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Dr.standardErrorMessage)(i);this.handleWeb3ResponseMessage((0,ze.Web3ResponseMessage)({id:e,response:{method:r,errorMessage:o,errorCode:i}}))}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:Oe.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,be.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s)};return{promise:new Promise((s,o)=>{var a;this.relayEventManager.callbacks.set(r,u=>{if(this.ui.hideRequestEthereumAccounts(),u.errorMessage)return o(new Error(u.errorMessage));s(u)});const c=((a=window==null?void 0:window.navigator)===null||a===void 0?void 0:a.userAgent)||null;if(c&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(c)){let u;try{(0,be.isInIFrame)()&&window.top?u=window.top.location:u=window.location}catch{u=window.location}u.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(u.href)}`;return}if(this.ui.inlineAccountsResponse()){const u=l=>{this.handleWeb3ResponseMessage((0,ze.Web3ResponseMessage)({id:r,response:(0,Xe.RequestEthereumAccountsResponse)(l)}))};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:u})}else{const u=Dr.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(u)})}ft.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:Oe.Web3Method.selectProvider,params:{providerOptions:e}},n=(0,be.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},s=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,l=>{if(l.errorMessage)return a(new Error(l.errorMessage));o(l)});const c=l=>{this.handleWeb3ResponseMessage((0,ze.Web3ResponseMessage)({id:n,response:(0,Xe.SelectProviderResponse)(sI.ProviderType.Unselected)}))},u=l=>{this.handleWeb3ResponseMessage((0,ze.Web3ResponseMessage)({id:n,response:(0,Xe.SelectProviderResponse)(l)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:u,onCancel:c,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,o){const a={method:Oe.Web3Method.watchAsset,params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let c=null;const u=(0,be.randomBytesHex)(8),l=h=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,h),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}));const f=new Promise((h,g)=>{this.relayEventManager.callbacks.set(u,S=>{if(c==null||c(),S.errorMessage)return g(new Error(S.errorMessage));h(S)});const v=S=>{this.handleWeb3ResponseMessage((0,ze.Web3ResponseMessage)({id:u,response:(0,Xe.WatchAssetReponse)(!1)}))},C=()=>{this.handleWeb3ResponseMessage((0,ze.Web3ResponseMessage)({id:u,response:(0,Xe.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:C,onCancel:v,type:e,address:r,symbol:n,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,a)});return{cancel:l,promise:f}}addEthereumChain(e,r,n,i,s,o){const a={method:Oe.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let c=null;const u=(0,be.randomBytesHex)(8),l=h=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,h),c==null||c()};return this.ui.inlineAddEthereumChain(e)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload})),{promise:new Promise((h,g)=>{this.relayEventManager.callbacks.set(u,S=>{if(c==null||c(),S.errorMessage)return g(new Error(S.errorMessage));h(S)});const v=S=>{this.handleWeb3ResponseMessage((0,ze.Web3ResponseMessage)({id:u,response:(0,Xe.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},C=S=>{this.handleWeb3ResponseMessage((0,ze.Web3ResponseMessage)({id:u,response:(0,Xe.AddEthereumChainResponse)({isApproved:!0,rpcUrl:S})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:v,onApprove:C,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,a)}),cancel:l}}switchEthereumChain(e,r){const n={method:Oe.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:r})},i=(0,be.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(i,f=>{if((0,Xe.isErrorResponse)(f)&&f.errorCode)return c(Dr.standardErrors.provider.custom({code:f.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(f.errorMessage)return c(new Error(f.errorMessage));a(f)});const u=f=>{var h;if(f){const g=(h=(0,Dr.getErrorCode)(f))!==null&&h!==void 0?h:Dr.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,Oe.Web3Method.switchEthereumChain,f instanceof Error?f:Dr.standardErrors.provider.unsupportedChain(e),g)}else this.handleWeb3ResponseMessage((0,ze.Web3ResponseMessage)({id:i,response:(0,Xe.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},l=f=>{this.handleWeb3ResponseMessage((0,ze.Web3ResponseMessage)({id:i,response:(0,Xe.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:f})}))};this.ui.switchEthereumChain({onCancel:u,onApprove:l,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return Vt.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage((0,ze.Web3ResponseMessage)({id:e,response:s}))};switch(r.method){case Oe.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case Oe.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Oe.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Oe.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}onSessionConfigChanged(e){}}ft.accountRequestCallbackIds=new Set;gp([yp.default],ft.prototype,"resetAndReload",null);gp([yp.default],ft.prototype,"handleIncomingEvent",null);js.WalletSDKRelay=ft;var Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.WalletSDKRelayEventManager=void 0;const cI=W;class uI{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,cI.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}Gs.WalletSDKRelayEventManager=uI;const lI="@coinbase/wallet-sdk",fI="3.7.1",hI="Coinbase Wallet JavaScript SDK",dI=["cipher","cipherbrowser","coinbase","coinbasewallet","eth","ether","ethereum","etherium","injection","toshi","wallet","walletlink","web3"],pI="dist/index.js",bI="dist/index.d.ts",gI="https://github.com/coinbase/coinbase-wallet-sdk.git",yI="Coinbase, Inc.",vI="Apache-2.0",mI={"pretest:unit":"node compile-assets.js","test:unit":"jest","test:unit:coverage":"yarn test:unit && open coverage/lcov-report/index.html","test:karma":"yarn build-npm && karma start",prebuild:`rm -rf ./build && node -p "'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'" > src/version.ts`,build:"node compile-assets.js && webpack --config webpack.config.js","build-npm":"tsc -p ./tsconfig.build.json","build:dev":"export LINK_API_URL='http://localhost:3000'; yarn build","build:dev:watch":"nodemon -e 'ts,tsx,js,json,css,scss,svg' --ignore 'src/**/*-css.ts' --ignore 'src/**/*-svg.ts' --watch src/ --exec 'yarn build:dev'","build:prod":`yarn prebuild && yarn build && yarn build-npm && cp ./package.json ../../README.md ./LICENSE build/npm && cp -a src/vendor-js build/npm/dist && sed -i.bak 's| "private": true,||g' build/npm/package.json && rm -f build/npm/package.json.bak`,"lint:types":"tsc --noEmit","lint:prettier":'prettier --check "{src,__tests__}/**/*.(js|ts|tsx)"',"lint:eslint":"eslint ./src --ext .ts,.tsx",lint:"yarn lint:eslint && yarn lint:types && yarn lint:prettier","fix:eslint":"yarn lint:eslint --fix","fix:prettier":"prettier . --write",release:"./scripts/release.sh"},wI={"@metamask/safe-event-emitter":"2.0.0","@solana/web3.js":"^1.70.1","bind-decorator":"^1.0.11","bn.js":"^5.1.1",buffer:"^6.0.3",clsx:"^1.1.0","eth-block-tracker":"6.1.0","eth-json-rpc-filters":"5.1.0","eth-rpc-errors":"4.0.2","json-rpc-engine":"6.1.0",keccak:"^3.0.1",preact:"^10.5.9",qs:"^6.10.3",rxjs:"^6.6.3","sha.js":"^2.4.11","stream-browserify":"^3.0.0",util:"^0.12.4"},_I={"@babel/core":"^7.17.9","@babel/plugin-proposal-decorators":"^7.17.9","@babel/plugin-transform-react-jsx":"^7.17.3","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@peculiar/webcrypto":"^1.3.3","@testing-library/jest-dom":"^5.16.4","@testing-library/preact":"^2.0.1","@types/bn.js":"^4.11.6","@types/jest":"^27.4.1","@types/node":"^14.14.20","@types/qs":"^6.9.7","@types/sha.js":"^2.4.0","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/eslint-plugin-tslint":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.5.1",browserify:"17.0.0","copy-webpack-plugin":"^6.4.1","core-js":"^3.8.2",eslint:"^8.4.1","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.25.3","eslint-plugin-
38preact":"^0.1.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-simple-import-sort":"^7.0.0",jasmine:"3.8.0",jest:"^27.5.1","jest-chrome":"^0.7.2","jest-websocket-mock":"^2.3.0",karma:"^6.4.0","karma-browserify":"8.1.0","karma-chrome-launcher":"^3.1.0","karma-jasmine":"^4.0.1",nodemon:"^2.0.6",prettier:"^2.5.1","raw-loader":"^4.0.2","regenerator-runtime":"^0.13.7",sass:"^1.50.0",svgo:"^2.8.0","ts-jest":"^27.1.4","ts-loader":"^8.0.13","ts-node":"^10.7.0",tslib:"^2.0.3",typescript:"^4.1.3",watchify:"4.0.0",webpack:"^5.76.0","webpack-cli":"^4.9.2","whatwg-fetch":"^3.5.0"},SI={node:">= 10.0.0"},EI={name:lI,version:fI,description:hI,keywords:dI,main:pI,types:bI,repository:gI,author:yI,license:vI,scripts:mI,dependencies:wI,devDependencies:_I,engines:SI};Object.defineProperty(Pn,"__esModule",{value:!0});Pn.CoinbaseWalletSDK=void 0;const CI=Ji,xI=Qi,II=Gr,RI=Ss,AI=js,MI=Gs,kI=W,TI={}.LINK_API_URL||"https://www.walletlink.org",vp={}.SDK_VERSION||EI.version||"unknown";class Js{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||TI;let o;if(e.uiConstructor?o=e.uiConstructor:o=u=>new RI.WalletSDKUI(u),typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this._diagnosticLogger={log:e.eventListener.onEvent}:this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),c=`${a.protocol}//${a.host}`;this._storage=new xI.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",Js.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new MI.WalletSDKRelayEventManager,this._relay=new AI.WalletSDKRelay({linkAPIUrl:s,version:vp,darkMode:!!e.darkMode,uiConstructor:o,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI())}makeWeb3Provider(e="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||s.setConnectDisabled(!0),new II.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,kI.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const r=this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,CI.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{const n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}Pn.CoinbaseWalletSDK=Js;Js.VERSION=vp;
38(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=Pn,r=Gr;var n=Pn;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=Gr;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(sc);const OI=_p(sc),HI=Cp({__proto__:null,default:OI},[sc]);export{HI as i};
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.