@dcl/vesting-dashboard 3.0.5 → 3.0.6-9213391407.commit-101c1e4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{fortmatic-959eeaaa.js → fortmatic-809bce1e.js} +1 -1
- package/assets/{index-d67429f9.js → index-0608a65f.js} +1 -1
- package/assets/{index-92525cc1.js → index-25febcc8.js} +77 -77
- package/assets/{index-937baffd.css → index-2dd288f5.css} +7 -7
- package/assets/{index-003f45b4.js → index-73f8fcd6.js} +1 -1
- package/assets/{index-0d59a051.js → index-77c810ca.js} +1 -1
- package/assets/{index-83620b46.js → index-9839993e.js} +1 -1
- package/assets/index-a159a892.js +7 -0
- package/assets/{index-221cce4e.js → index-d8755eab.js} +1 -1
- package/assets/index.es-840d3bdb.js +56 -0
- package/index.html +4 -4
- package/package.json +3 -3
- package/assets/index-c9b157fa.js +0 -22
- package/assets/index.es-058cab8b.js +0 -43
- package/assets/tslib.es6-c2094241.js +0 -14
package/assets/index-c9b157fa.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{e as bd,h as gd,d as A,i as ti,B,j as md,k as sl,g as xn,p as ko,l as ni,b as yd}from"./index-92525cc1.js";import{_ as g}from"./tslib.es6-c2094241.js";function vd(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Go={},Qn={},ri={};Object.defineProperty(ri,"__esModule",{value:!0});ri.walletLogo=void 0;const _d=(t,e)=>{let n;switch(t){case"standard":return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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.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.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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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.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"textWithLogoLight":return n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 `}};ri.walletLogo=_d;var ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.ScopedLocalStorage=void 0;class wd{constructor(e){this.scope=e}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);typeof i=="string"&&i.startsWith(e)&&n.push(i)}n.forEach(r=>localStorage.removeItem(r))}scopedKey(e){return`${this.scope}:${e}`}}ii.ScopedLocalStorage=wd;var dn={},Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});const Sd=bd;function yc(t,e,n){try{Reflect.apply(t,e,n)}catch(r){setTimeout(()=>{throw r})}}function Ed(t){const e=t.length,n=new Array(e);for(let r=0;r<e;r+=1)n[r]=t[r];return n}let Cd=class extends Sd.EventEmitter{emit(e,...n){let r=e==="error";const i=this._events;if(i!==void 0)r=r&&i.error===void 0;else if(!r)return!1;if(r){let o;if(n.length>0&&([o]=n),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")yc(s,this,n);else{const o=s.length,a=Ed(s);for(let c=0;c<o;c+=1)yc(a[c],this,n)}return!0}};Qt.default=Cd;var rr={},Rt={},Id=Zn;Zn.default=Zn;Zn.stable=cl;Zn.stableStringify=cl;var Vr="[...]",ol="[Circular]",Ut=[],Vt=[];function al(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Zn(t,e,n,r){typeof r>"u"&&(r=al()),Ro(t,"",0,[],void 0,0,r);var i;try{Vt.length===0?i=JSON.stringify(t,e,n):i=JSON.stringify(t,ul(e),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ut.length!==0;){var s=Ut.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function cn(t,e,n,r){var i=Object.getOwnPropertyDescriptor(r,n);i.get!==void 0?i.configurable?(Object.defineProperty(r,n,{value:t}),Ut.push([r,n,e,i])):Vt.push([e,n,t]):(r[n]=t,Ut.push([r,n,e]))}function Ro(t,e,n,r,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<r.length;a++)if(r[a]===t){cn(ol,t,e,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){cn(Vr,t,e,i);return}if(typeof o.edgesLimit<"u"&&n+1>o.edgesLimit){cn(Vr,t,e,i);return}if(r.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Ro(t[a],a,a,r,t,s,o);else{var c=Object.keys(t);for(a=0;a<c.length;a++){var u=c[a];Ro(t[u],u,a,r,t,s,o)}}r.pop()}}function xd(t,e){return t<e?-1:t>e?1:0}function cl(t,e,n,r){typeof r>"u"&&(r=al());var i=Mo(t,"",0,[],void 0,0,r)||t,s;try{Vt.length===0?s=JSON.stringify(i,e,n):s=JSON.stringify(i,ul(e),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ut.length!==0;){var o=Ut.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function Mo(t,e,n,r,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<r.length;a++)if(r[a]===t){cn(ol,t,e,i);return}try{if(typeof t.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){cn(Vr,t,e,i);return}if(typeof o.edgesLimit<"u"&&n+1>o.edgesLimit){cn(Vr,t,e,i);return}if(r.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Mo(t[a],a,a,r,t,s,o);else{var c={},u=Object.keys(t).sort(xd);for(a=0;a<u.length;a++){var l=u[a];Mo(t[l],l,a,r,t,s,o),c[l]=t[l]}if(typeof i<"u")Ut.push([i,e,t]),i[e]=c;else return c}r.pop()}}function ul(t){return t=typeof t<"u"?t:function(e,n){return n},function(e,n){if(Vt.length>0)for(var r=0;r<Vt.length;r++){var i=Vt[r];if(i[1]===e&&i[0]===n){n=i[2],Vt.splice(r,1);break}}return t.call(this,e,n)}}Object.defineProperty(Rt,"__esModule",{value:!0});Rt.EthereumProviderError=Rt.EthereumRpcError=void 0;const kd=Id;class ll extends Error{constructor(e,n,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string.');super(n),this.code=e,r!==void 0&&(this.data=r)}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 kd.default(this.serialize(),Ad,2)}}Rt.EthereumRpcError=ll;class Rd extends ll{constructor(e,n,r){if(!Md(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,n,r)}}Rt.EthereumProviderError=Rd;function Md(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function Ad(t,e){if(e!=="[Circular]")return e}var Jo={},Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.errorValues=Mt.errorCodes=void 0;Mt.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}};Mt.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=Mt,n=Rt,r=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:r,message:o(r)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(f,d=i){if(Number.isInteger(f)){const p=f.toString();if(h(e.errorValues,p))return e.errorValues[p].message;if(u(f))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return d}t.getMessageFromCode=o;function a(f){if(!Number.isInteger(f))return!1;const d=f.toString();return!!(e.errorValues[d]||u(f))}t.isValidCode=a;function c(f,{fallbackError:d=s,shouldIncludeStack:p=!1}={}){var _,m;if(!d||!Number.isInteger(d.code)||typeof d.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(f instanceof n.EthereumRpcError)return f.serialize();const b={};if(f&&typeof f=="object"&&!Array.isArray(f)&&h(f,"code")&&a(f.code)){const S=f;b.code=S.code,S.message&&typeof S.message=="string"?(b.message=S.message,h(S,"data")&&(b.data=S.data)):(b.message=o(b.code),b.data={originalError:l(f)})}else{b.code=d.code;const S=(_=f)===null||_===void 0?void 0:_.message;b.message=S&&typeof S=="string"?S:d.message,b.data={originalError:l(f)}}const y=(m=f)===null||m===void 0?void 0:m.stack;return p&&f&&y&&typeof y=="string"&&(b.stack=y),b}t.serializeError=c;function u(f){return f>=-32099&&f<=-32e3}function l(f){return f&&typeof f=="object"&&!Array.isArray(f)?Object.assign({},f):f}function h(f,d){return Object.prototype.hasOwnProperty.call(f,d)}})(Jo);var si={};Object.defineProperty(si,"__esModule",{value:!0});si.ethErrors=void 0;const Qo=Rt,hl=Jo,Se=Mt;si.ethErrors={rpc:{parse:t=>De(Se.errorCodes.rpc.parse,t),invalidRequest:t=>De(Se.errorCodes.rpc.invalidRequest,t),invalidParams:t=>De(Se.errorCodes.rpc.invalidParams,t),methodNotFound:t=>De(Se.errorCodes.rpc.methodNotFound,t),internal:t=>De(Se.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 <= -32005');return De(e,t)},invalidInput:t=>De(Se.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>De(Se.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>De(Se.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>De(Se.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>De(Se.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>De(Se.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Pn(Se.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Pn(Se.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Pn(Se.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Pn(Se.errorCodes.provider.disconnected,t),chainDisconnected:t=>Pn(Se.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:n,data:r}=t;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new Qo.EthereumProviderError(e,n,r)}}};function De(t,e){const[n,r]=fl(e);return new Qo.EthereumRpcError(t,n||hl.getMessageFromCode(t),r)}function Pn(t,e){const[n,r]=fl(e);return new Qo.EthereumProviderError(t,n||hl.getMessageFromCode(t),r)}function fl(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:n}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,n]}}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=Rt;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const n=Jo;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const r=si;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return r.ethErrors}});const i=Mt;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(rr);var kn={};Object.defineProperty(kn,"__esModule",{value:!0});kn.EVENTS=void 0;kn.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 Rn={},x={},Td=String.prototype.replace,Nd=/%20/g,Ks={RFC1738:"RFC1738",RFC3986:"RFC3986"},Zo={default:Ks.RFC3986,formatters:{RFC1738:function(t){return Td.call(t,Nd,"+")},RFC3986:function(t){return String(t)}},RFC1738:Ks.RFC1738,RFC3986:Ks.RFC3986},Od=Zo,Xs=Object.prototype.hasOwnProperty,$t=Array.isArray,et=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Ld=function(e){for(;e.length>1;){var n=e.pop(),r=n.obj[n.prop];if($t(r)){for(var i=[],s=0;s<r.length;++s)typeof r[s]<"u"&&i.push(r[s]);n.obj[n.prop]=i}}},dl=function(e,n){for(var r=n&&n.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(r[i]=e[i]);return r},jd=function t(e,n,r){if(!n)return e;if(typeof n!="object"){if($t(e))e.push(n);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!Xs.call(Object.prototype,n))&&(e[n]=!0);else return[e,n];return e}if(!e||typeof e!="object")return[e].concat(n);var i=e;return $t(e)&&!$t(n)&&(i=dl(e,r)),$t(e)&&$t(n)?(n.forEach(function(s,o){if(Xs.call(e,o)){var a=e[o];a&&typeof a=="object"&&s&&typeof s=="object"?e[o]=t(a,s,r):e.push(s)}else e[o]=s}),e):Object.keys(n).reduce(function(s,o){var a=n[o];return Xs.call(s,o)?s[o]=t(s[o],a,r):s[o]=a,s},i)},$d=function(e,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},e)},Pd=function(t,e,n){var r=t.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},Dd=function(e,n,r,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)),r==="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===Od.RFC1738&&(u===40||u===41)){a+=o.charAt(c);continue}if(u<128){a=a+et[u];continue}if(u<2048){a=a+(et[192|u>>6]+et[128|u&63]);continue}if(u<55296||u>=57344){a=a+(et[224|u>>12]+et[128|u>>6&63]+et[128|u&63]);continue}c+=1,u=65536+((u&1023)<<10|o.charCodeAt(c)&1023),a+=et[240|u>>18]+et[128|u>>12&63]+et[128|u>>6&63]+et[128|u&63]}return a},Fd=function(e){for(var n=[{obj:{o:e},prop:"o"}],r=[],i=0;i<n.length;++i)for(var s=n[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&&r.indexOf(l)===-1&&(n.push({obj:o,prop:u}),r.push(l))}return Ld(n),e},Bd=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Vd=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Hd=function(e,n){return[].concat(e,n)},Wd=function(e,n){if($t(e)){for(var r=[],i=0;i<e.length;i+=1)r.push(n(e[i]));return r}return n(e)},pl={arrayToObject:dl,assign:$d,combine:Hd,compact:Fd,decode:Pd,encode:Dd,isBuffer:Vd,isRegExp:Bd,maybeMap:Wd,merge:jd},bl=gd,$r=pl,Wn=Zo,Ud=Object.prototype.hasOwnProperty,vc={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},pt=Array.isArray,zd=Array.prototype.push,gl=function(t,e){zd.apply(t,pt(e)?e:[e])},qd=Date.prototype.toISOString,_c=Wn.default,Ie={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:$r.encode,encodeValuesOnly:!1,format:_c,formatter:Wn.formatters[_c],indices:!1,serializeDate:function(e){return qd.call(e)},skipNulls:!1,strictNullHandling:!1},Gd=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},eo={},Jd=function t(e,n,r,i,s,o,a,c,u,l,h,f,d,p,_,m){for(var b=e,y=m,S=0,k=!1;(y=y.get(eo))!==void 0&&!k;){var E=y.get(e);if(S+=1,typeof E<"u"){if(E===S)throw new RangeError("Cyclic object value");k=!0}typeof y.get(eo)>"u"&&(S=0)}if(typeof c=="function"?b=c(n,b):b instanceof Date?b=h(b):r==="comma"&&pt(b)&&(b=$r.maybeMap(b,function(C){return C instanceof Date?h(C):C})),b===null){if(s)return a&&!p?a(n,Ie.encoder,_,"key",f):n;b=""}if(Gd(b)||$r.isBuffer(b)){if(a){var N=p?n:a(n,Ie.encoder,_,"key",f);return[d(N)+"="+d(a(b,Ie.encoder,_,"value",f))]}return[d(n)+"="+d(String(b))]}var U=[];if(typeof b>"u")return U;var z;if(r==="comma"&&pt(b))p&&a&&(b=$r.maybeMap(b,a)),z=[{value:b.length>0?b.join(",")||null:void 0}];else if(pt(c))z=c;else{var P=Object.keys(b);z=u?P.sort(u):P}for(var q=i&&pt(b)&&b.length===1?n+"[]":n,ue=0;ue<z.length;++ue){var G=z[ue],w=typeof G=="object"&&typeof G.value<"u"?G.value:b[G];if(!(o&&w===null)){var v=pt(b)?typeof r=="function"?r(q,G):q:q+(l?"."+G:"["+G+"]");m.set(e,S);var R=bl();R.set(eo,m),gl(U,t(w,v,r,i,s,o,r==="comma"&&p&&pt(b)?null:a,c,u,l,h,f,d,p,_,R))}}return U},Qd=function(e){if(!e)return Ie;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=e.charset||Ie.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 r=Wn.default;if(typeof e.format<"u"){if(!Ud.call(Wn.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=Wn.formatters[r],s=Ie.filter;return(typeof e.filter=="function"||pt(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Ie.addQueryPrefix,allowDots:typeof e.allowDots>"u"?Ie.allowDots:!!e.allowDots,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Ie.charsetSentinel,delimiter:typeof e.delimiter>"u"?Ie.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Ie.encode,encoder:typeof e.encoder=="function"?e.encoder:Ie.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Ie.encodeValuesOnly,filter:s,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Ie.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Ie.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Ie.strictNullHandling}},Zd=function(t,e){var n=t,r=Qd(e),i,s;typeof r.filter=="function"?(s=r.filter,n=s("",n)):pt(r.filter)&&(s=r.filter,i=s);var o=[];if(typeof n!="object"||n===null)return"";var a;e&&e.arrayFormat in vc?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=vc[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(n)),r.sort&&i.sort(r.sort);for(var l=bl(),h=0;h<i.length;++h){var f=i[h];r.skipNulls&&n[f]===null||gl(o,Jd(n[f],f,c,u,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,l))}var d=o.join(r.delimiter),p=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),d.length>0?p+d:""},pn=pl,Ao=Object.prototype.hasOwnProperty,Yd=Array.isArray,be={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:pn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Kd=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},ml=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Xd="utf8=%26%2310003%3B",ep="utf8=%E2%9C%93",tp=function(e,n){var r={__proto__:null},i=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=n.parameterLimit===1/0?void 0:n.parameterLimit,o=i.split(n.delimiter,s),a=-1,c,u=n.charset;if(n.charsetSentinel)for(c=0;c<o.length;++c)o[c].indexOf("utf8=")===0&&(o[c]===ep?u="utf-8":o[c]===Xd&&(u="iso-8859-1"),a=c,c=o.length);for(c=0;c<o.length;++c)if(c!==a){var l=o[c],h=l.indexOf("]="),f=h===-1?l.indexOf("="):h+1,d,p;f===-1?(d=n.decoder(l,be.decoder,u,"key"),p=n.strictNullHandling?null:""):(d=n.decoder(l.slice(0,f),be.decoder,u,"key"),p=pn.maybeMap(ml(l.slice(f+1),n),function(_){return n.decoder(_,be.decoder,u,"value")})),p&&n.interpretNumericEntities&&u==="iso-8859-1"&&(p=Kd(p)),l.indexOf("[]=")>-1&&(p=Yd(p)?[p]:p),Ao.call(r,d)?r[d]=pn.combine(r[d],p):r[d]=p}return r},np=function(t,e,n,r){for(var i=r?e:ml(e,n),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&n.parseArrays)o=[].concat(i);else{o=n.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,u=parseInt(c,10);!n.parseArrays&&c===""?o={0:i}:!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(o=[],o[u]=i):c!=="__proto__"&&(o[c]=i)}i=o}return i},rp=function(e,n,r,i){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=r.depth>0&&o.exec(s),u=c?s.slice(0,c.index):s,l=[];if(u){if(!r.plainObjects&&Ao.call(Object.prototype,u)&&!r.allowPrototypes)return;l.push(u)}for(var h=0;r.depth>0&&(c=a.exec(s))!==null&&h<r.depth;){if(h+=1,!r.plainObjects&&Ao.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;l.push(c[1])}return c&&l.push("["+s.slice(c.index)+"]"),np(l,n,r,i)}},ip=function(e){if(!e)return be;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 n=typeof e.charset>"u"?be.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?be.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:be.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:be.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:be.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:be.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:be.comma,decoder:typeof e.decoder=="function"?e.decoder:be.decoder,delimiter:typeof e.delimiter=="string"||pn.isRegExp(e.delimiter)?e.delimiter:be.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:be.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:be.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:be.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:be.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:be.strictNullHandling}},sp=function(t,e){var n=ip(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof t=="string"?tp(t,n):t,i=n.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var a=s[o],c=rp(a,r[a],n,typeof t=="string");i=pn.merge(i,c,n)}return n.allowSparse===!0?i:pn.compact(i)},op=Zd,ap=sp,cp=Zo,up={formats:cp,parse:ap,stringify:op},ir={};(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 r=>r}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function n(r){return Math.floor(r)}t.IntNumber=n,t.RegExpString=e(),function(r){r.CoinbaseWallet="CoinbaseWallet",r.MetaMask="MetaMask",r.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(ir);var lp=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(x,"__esModule",{value:!0});x.isInIFrame=x.createQrUrl=x.getFavicon=x.range=x.isBigNumber=x.ensureParsedJSONObject=x.ensureBN=x.ensureRegExpString=x.ensureIntNumber=x.ensureBuffer=x.ensureAddressString=x.ensureEvenLengthHexString=x.ensureHexString=x.isHexString=x.prepend0x=x.strip0x=x.has0xPrefix=x.hexStringFromIntNumber=x.intNumberFromHexString=x.bigIntStringFromBN=x.hexStringFromBuffer=x.hexStringToUint8Array=x.uint8ArrayToHex=x.randomBytesHex=void 0;const It=lp(ti),hp=up,We=ir,yl=/^[0-9]*$/,vl=/^[a-f0-9]*$/;function fp(t){return _l(crypto.getRandomValues(new Uint8Array(t)))}x.randomBytesHex=fp;function _l(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}x.uint8ArrayToHex=_l;function dp(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}x.hexStringToUint8Array=dp;function pp(t,e=!1){const n=t.toString("hex");return(0,We.HexString)(e?"0x"+n:n)}x.hexStringFromBuffer=pp;function bp(t){return(0,We.BigIntString)(t.toString(10))}x.bigIntStringFromBN=bp;function gp(t){return(0,We.IntNumber)(new It.default(or(t,!1),16).toNumber())}x.intNumberFromHexString=gp;function mp(t){return(0,We.HexString)("0x"+new It.default(t).toString(16))}x.hexStringFromIntNumber=mp;function Yo(t){return t.startsWith("0x")||t.startsWith("0X")}x.has0xPrefix=Yo;function oi(t){return Yo(t)?t.slice(2):t}x.strip0x=oi;function wl(t){return Yo(t)?"0x"+t.slice(2):"0x"+t}x.prepend0x=wl;function sr(t){if(typeof t!="string")return!1;const e=oi(t).toLowerCase();return vl.test(e)}x.isHexString=sr;function Sl(t,e=!1){if(typeof t=="string"){const n=oi(t).toLowerCase();if(vl.test(n))return(0,We.HexString)(e?"0x"+n:n)}throw new Error(`"${String(t)}" is not a hexadecimal string`)}x.ensureHexString=Sl;function or(t,e=!1){let n=Sl(t,!1);return n.length%2===1&&(n=(0,We.HexString)("0"+n)),e?(0,We.HexString)("0x"+n):n}x.ensureEvenLengthHexString=or;function yp(t){if(typeof t=="string"){const e=oi(t).toLowerCase();if(sr(e)&&e.length===40)return(0,We.AddressString)(wl(e))}throw new Error(`Invalid Ethereum address: ${String(t)}`)}x.ensureAddressString=yp;function vp(t){if(B.isBuffer(t))return t;if(typeof t=="string")if(sr(t)){const e=or(t,!1);return B.from(e,"hex")}else return B.from(t,"utf8");throw new Error(`Not binary data: ${String(t)}`)}x.ensureBuffer=vp;function El(t){if(typeof t=="number"&&Number.isInteger(t))return(0,We.IntNumber)(t);if(typeof t=="string"){if(yl.test(t))return(0,We.IntNumber)(Number(t));if(sr(t))return(0,We.IntNumber)(new It.default(or(t,!1),16).toNumber())}throw new Error(`Not an integer: ${String(t)}`)}x.ensureIntNumber=El;function _p(t){if(t instanceof RegExp)return(0,We.RegExpString)(t.toString());throw new Error(`Not a RegExp: ${String(t)}`)}x.ensureRegExpString=_p;function wp(t){if(t!==null&&(It.default.isBN(t)||Cl(t)))return new It.default(t.toString(10),10);if(typeof t=="number")return new It.default(El(t));if(typeof t=="string"){if(yl.test(t))return new It.default(t,10);if(sr(t))return new It.default(or(t,!1),16)}throw new Error(`Not an integer: ${String(t)}`)}x.ensureBN=wp;function Sp(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw new Error(`Not a JSON string or an object: ${String(t)}`)}x.ensureParsedJSONObject=Sp;function Cl(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}x.isBigNumber=Cl;function Ep(t,e){return Array.from({length:e-t},(n,r)=>t+r)}x.range=Ep;function Cp(){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:n}=document.location,r=t?t.getAttribute("href"):null;return!r||r.startsWith("javascript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?e+r:`${e}//${n}${r}`}x.getFavicon=Cp;function Ip(t,e,n,r,i,s){const o=r?"parent-id":"id",a=(0,hp.stringify)({[o]:t,secret:e,server:n,v:i,chainId:s});return`${n}/#/link?${a}`}x.createQrUrl=Ip;function xp(){try{return window.frameElement!==null}catch{return!1}}x.isInIFrame=xp;Object.defineProperty(Rn,"__esModule",{value:!0});Rn.Session=void 0;const wc=md,Sc=x,Ec="session:id",Cc="session:secret",Ic="session:linked";class Ko{constructor(e,n,r,i){this._storage=e,this._id=n||(0,Sc.randomBytesHex)(16),this._secret=r||(0,Sc.randomBytesHex)(32),this._key=new wc.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const n=e.getItem(Ec),r=e.getItem(Ic),i=e.getItem(Cc);return n&&i?new Ko(e,n,i,r==="1"):null}static hash(e){return new wc.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(Ec,this._id),this._storage.setItem(Cc,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Ic,this._linked?"1":"0")}}Rn.Session=Ko;var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.WalletSDKRelayAbstract=Ye.APP_VERSION_KEY=Ye.LOCAL_STORAGE_ADDRESSES_KEY=Ye.WALLET_USER_NAME_KEY=void 0;const xc=rr;Ye.WALLET_USER_NAME_KEY="walletUsername";Ye.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Ye.APP_VERSION_KEY="AppVersion";class kp{async makeEthereumJSONRPCRequest(e,n){if(!n)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(n,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(r=>r.json()).then(r=>{if(!r)throw xc.ethErrors.rpc.parse({});const i=r,{error:s}=i;if(s)throw(0,xc.serializeError)(s);return i})}}Ye.WalletSDKRelayAbstract=kp;const{Transform:Rp}=sl;var Mp=t=>class Il extends Rp{constructor(n,r,i,s,o){super(o),this._rate=n,this._capacity=r,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new t,this._state.initialize(n,r),this._finalized=!1}_transform(n,r,i){let s=null;try{this.update(n,r)}catch(o){s=o}i(s)}_flush(n){let r=null;try{this.push(this.digest())}catch(i){r=i}n(r)}update(n,r){if(!B.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return B.isBuffer(n)||(n=B.from(n,r)),this._state.absorb(n),this}digest(n){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let r=this._state.squeeze(this._hashBitLength/8);return n!==void 0&&(r=r.toString(n)),this._resetState(),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new Il(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}};const{Transform:Ap}=sl;var Tp=t=>class xl extends Ap{constructor(n,r,i,s){super(s),this._rate=n,this._capacity=r,this._delimitedSuffix=i,this._options=s,this._state=new t,this._state.initialize(n,r),this._finalized=!1}_transform(n,r,i){let s=null;try{this.update(n,r)}catch(o){s=o}i(s)}_flush(){}_read(n){this.push(this.squeeze(n))}update(n,r){if(!B.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return B.isBuffer(n)||(n=B.from(n,r)),this._state.absorb(n),this}squeeze(n,r){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(n);return r!==void 0&&(i=i.toString(r)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new xl(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}};const Np=Mp,Op=Tp;var Lp=function(t){const e=Np(t),n=Op(t);return function(r,i){switch(typeof r=="string"?r.toLowerCase():r){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 n(1344,256,31,i);case"shake256":return new n(1088,512,31,i);default:throw new Error("Invald algorithm: "+r)}}},kl={};const kc=[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];kl.p1600=function(t){for(let e=0;e<24;++e){const n=t[0]^t[10]^t[20]^t[30]^t[40],r=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[36]^t[46],u=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49];let f=l^(i<<1|s>>>31),d=h^(s<<1|i>>>31);const p=t[0]^f,_=t[1]^d,m=t[10]^f,b=t[11]^d,y=t[20]^f,S=t[21]^d,k=t[30]^f,E=t[31]^d,N=t[40]^f,U=t[41]^d;f=n^(o<<1|a>>>31),d=r^(a<<1|o>>>31);const z=t[2]^f,P=t[3]^d,q=t[12]^f,ue=t[13]^d,G=t[22]^f,w=t[23]^d,v=t[32]^f,R=t[33]^d,C=t[42]^f,T=t[43]^d;f=i^(c<<1|u>>>31),d=s^(u<<1|c>>>31);const I=t[4]^f,L=t[5]^d,J=t[14]^f,D=t[15]^d,X=t[24]^f,we=t[25]^d,ne=t[34]^f,wt=t[35]^d,ts=t[44]^f,Ya=t[45]^d;f=o^(l<<1|h>>>31),d=a^(h<<1|l>>>31);const Ka=t[6]^f,Xa=t[7]^d,ec=t[16]^f,tc=t[17]^d,nc=t[26]^f,rc=t[27]^d,ic=t[36]^f,sc=t[37]^d,oc=t[46]^f,ac=t[47]^d;f=c^(n<<1|r>>>31),d=u^(r<<1|n>>>31);const cc=t[8]^f,uc=t[9]^d,lc=t[18]^f,hc=t[19]^d,fc=t[28]^f,dc=t[29]^d,pc=t[38]^f,bc=t[39]^d,gc=t[48]^f,mc=t[49]^d,ns=p,rs=_,is=b<<4|m>>>28,ss=m<<4|b>>>28,os=y<<3|S>>>29,as=S<<3|y>>>29,cs=E<<9|k>>>23,us=k<<9|E>>>23,ls=N<<18|U>>>14,hs=U<<18|N>>>14,fs=z<<1|P>>>31,ds=P<<1|z>>>31,ps=ue<<12|q>>>20,bs=q<<12|ue>>>20,gs=G<<10|w>>>22,ms=w<<10|G>>>22,ys=R<<13|v>>>19,vs=v<<13|R>>>19,_s=C<<2|T>>>30,ws=T<<2|C>>>30,Ss=L<<30|I>>>2,Es=I<<30|L>>>2,Cs=J<<6|D>>>26,Is=D<<6|J>>>26,xs=we<<11|X>>>21,ks=X<<11|we>>>21,Rs=ne<<15|wt>>>17,Ms=wt<<15|ne>>>17,As=Ya<<29|ts>>>3,Ts=ts<<29|Ya>>>3,Ns=Ka<<28|Xa>>>4,Os=Xa<<28|Ka>>>4,Ls=tc<<23|ec>>>9,js=ec<<23|tc>>>9,$s=nc<<25|rc>>>7,Ps=rc<<25|nc>>>7,Ds=ic<<21|sc>>>11,Fs=sc<<21|ic>>>11,Bs=ac<<24|oc>>>8,Vs=oc<<24|ac>>>8,Hs=cc<<27|uc>>>5,Ws=uc<<27|cc>>>5,Us=lc<<20|hc>>>12,zs=hc<<20|lc>>>12,qs=dc<<7|fc>>>25,Gs=fc<<7|dc>>>25,Js=pc<<8|bc>>>24,Qs=bc<<8|pc>>>24,Zs=gc<<14|mc>>>18,Ys=mc<<14|gc>>>18;t[0]=ns^~ps&xs,t[1]=rs^~bs&ks,t[10]=Ns^~Us&os,t[11]=Os^~zs&as,t[20]=fs^~Cs&$s,t[21]=ds^~Is&Ps,t[30]=Hs^~is&gs,t[31]=Ws^~ss&ms,t[40]=Ss^~Ls&qs,t[41]=Es^~js&Gs,t[2]=ps^~xs&Ds,t[3]=bs^~ks&Fs,t[12]=Us^~os&ys,t[13]=zs^~as&vs,t[22]=Cs^~$s&Js,t[23]=Is^~Ps&Qs,t[32]=is^~gs&Rs,t[33]=ss^~ms&Ms,t[42]=Ls^~qs&cs,t[43]=js^~Gs&us,t[4]=xs^~Ds&Zs,t[5]=ks^~Fs&Ys,t[14]=os^~ys&As,t[15]=as^~vs&Ts,t[24]=$s^~Js&ls,t[25]=Ps^~Qs&hs,t[34]=gs^~Rs&Bs,t[35]=ms^~Ms&Vs,t[44]=qs^~cs&_s,t[45]=Gs^~us&ws,t[6]=Ds^~Zs&ns,t[7]=Fs^~Ys&rs,t[16]=ys^~As&Ns,t[17]=vs^~Ts&Os,t[26]=Js^~ls&fs,t[27]=Qs^~hs&ds,t[36]=Rs^~Bs&Hs,t[37]=Ms^~Vs&Ws,t[46]=cs^~_s&Ss,t[47]=us^~ws&Es,t[8]=Zs^~ns&ps,t[9]=Ys^~rs&bs,t[18]=As^~Ns&Us,t[19]=Ts^~Os&zs,t[28]=ls^~fs&Cs,t[29]=hs^~ds&Is,t[38]=Bs^~Hs&is,t[39]=Vs^~Ws&ss,t[48]=_s^~Ss&Ls,t[49]=ws^~Es&js,t[0]^=kc[e*2],t[1]^=kc[e*2+1]}};const Hr=kl;function Mn(){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}Mn.prototype.initialize=function(t,e){for(let n=0;n<50;++n)this.state[n]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};Mn.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&&(Hr.p1600(this.state),this.count=0)};Mn.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<8*(this.count%4),t&128&&this.count===this.blockSize-1&&Hr.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Hr.p1600(this.state),this.count=0,this.squeezing=!0};Mn.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=B.alloc(t);for(let n=0;n<t;++n)e[n]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Hr.p1600(this.state),this.count=0);return e};Mn.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 jp=Mn,$p=Lp(jp);const Pp=$p,Dp=ti;function Rl(t){return B.allocUnsafe(t).fill(0)}function Ml(t,e,n){const r=Rl(e);return t=ai(t),n?t.length<e?(t.copy(r),r):t.slice(0,e):t.length<e?(t.copy(r,e-t.length),r):t.slice(-e)}function Fp(t,e){return Ml(t,e,!0)}function ai(t){if(!B.isBuffer(t))if(Array.isArray(t))t=B.from(t);else if(typeof t=="string")Al(t)?t=B.from(Hp(Tl(t)),"hex"):t=B.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=B.allocUnsafe(0);else if(Dp.isBN(t))t=t.toArrayLike(B);else if(t.toArray)t=B.from(t.toArray());else throw new Error("invalid type");return t}function Bp(t){return t=ai(t),"0x"+t.toString("hex")}function Vp(t,e){return t=ai(t),e||(e=256),Pp("keccak"+e).update(t).digest()}function Hp(t){return t.length%2?"0"+t:t}function Al(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function Tl(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}var Nl={zeros:Rl,setLength:Ml,setLengthRight:Fp,isHexString:Al,stripHexPrefix:Tl,toBuffer:ai,bufferToHex:Bp,keccak:Vp};const zt=Nl,Ht=ti;function Ol(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 un(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function Rc(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function Ll(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function Pt(t){var e=typeof t;if(e==="string")return zt.isHexString(t)?new Ht(zt.stripHexPrefix(t),16):new Ht(t,10);if(e==="number")return new Ht(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function it(t,e){var n,r,i,s;if(t==="address")return it("uint160",Pt(e));if(t==="bool")return it("uint8",e?1:0);if(t==="string")return it("bytes",new B(e,"utf8"));if(Up(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(n=Ll(t),n!=="dynamic"&&n!==0&&e.length>n)throw new Error("Elements exceed array size: "+n);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(it(t,e[s]));if(n==="dynamic"){var o=it("uint256",e.length);i.unshift(o)}return B.concat(i)}else{if(t==="bytes")return e=new B(e),i=B.concat([it("uint256",e.length),e]),e.length%32!==0&&(i=B.concat([i,zt.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(n=un(t),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return zt.setLengthRight(e,32)}else if(t.startsWith("uint")){if(n=un(t),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Pt(e),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());if(r<0)throw new Error("Supplied uint is negative");return r.toArrayLike(B,"be",32)}else if(t.startsWith("int")){if(n=un(t),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Pt(e),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());return r.toTwos(256).toArrayLike(B,"be",32)}else if(t.startsWith("ufixed")){if(n=Rc(t),r=Pt(e),r<0)throw new Error("Supplied ufixed is negative");return it("uint256",r.mul(new Ht(2).pow(new Ht(n[1]))))}else if(t.startsWith("fixed"))return n=Rc(t),it("int256",Pt(e).mul(new Ht(2).pow(new Ht(n[1]))))}throw new Error("Unsupported or invalid type: "+t)}function Wp(t){return t==="string"||t==="bytes"||Ll(t)==="dynamic"}function Up(t){return t.lastIndexOf("]")===t.length-1}function zp(t,e){var n=[],r=[],i=32*t.length;for(var s in t){var o=Ol(t[s]),a=e[s],c=it(o,a);Wp(o)?(n.push(it("uint256",i)),r.push(c),i+=c.length):n.push(c)}return B.concat(n.concat(r))}function jl(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var n,r,i=[],s=0;s<t.length;s++){var o=Ol(t[s]),a=e[s];if(o==="bytes")i.push(a);else if(o==="string")i.push(new B(a,"utf8"));else if(o==="bool")i.push(new B(a?"01":"00","hex"));else if(o==="address")i.push(zt.setLength(a,20));else if(o.startsWith("bytes")){if(n=un(o),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);i.push(zt.setLengthRight(a,n))}else if(o.startsWith("uint")){if(n=un(o),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Pt(a),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());i.push(r.toArrayLike(B,"be",n/8))}else if(o.startsWith("int")){if(n=un(o),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Pt(a),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());i.push(r.toTwos(n).toArrayLike(B,"be",n/8))}else throw new Error("Unsupported or invalid type: "+o)}return B.concat(i)}function qp(t,e){return zt.keccak(jl(t,e))}var Gp={rawEncode:zp,solidityPack:jl,soliditySHA3:qp};const Je=Nl,Un=Gp,$l={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"]},to={encodeData(t,e,n,r=!0){const i=["bytes32"],s=[this.hashType(t,n)];if(r){const o=(a,c,u)=>{if(n[c]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Je.keccak(this.encodeData(c,u,n,r))];if(u===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",Je.keccak(u)];if(c==="string")return typeof u=="string"&&(u=B.from(u,"utf8")),["bytes32",Je.keccak(u)];if(c.lastIndexOf("]")===c.length-1){const l=c.slice(0,c.lastIndexOf("[")),h=u.map(f=>o(a,l,f));return["bytes32",Je.keccak(Un.rawEncode(h.map(([f])=>f),h.map(([,f])=>f)))]}return[c,u]};for(const a of n[t]){const[c,u]=o(a.name,a.type,e[a.name]);i.push(c),s.push(u)}}else for(const o of n[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=Je.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=B.from(a,"utf8")),a=Je.keccak(a),s.push(a);else if(n[o.type]!==void 0)i.push("bytes32"),a=Je.keccak(this.encodeData(o.type,a,n,r)),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 Un.rawEncode(i,s)},encodeType(t,e){let n="",r=this.findTypeDependencies(t,e).filter(i=>i!==t);r=[t].concat(r.sort());for(const i of r){if(!e[i])throw new Error("No type definition specified: "+i);n+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return n},findTypeDependencies(t,e,n=[]){if(t=t.match(/^\w*/)[0],n.includes(t)||e[t]===void 0)return n;n.push(t);for(const r of e[t])for(const i of this.findTypeDependencies(r.type,e,n))!n.includes(i)&&n.push(i);return n},hashStruct(t,e,n,r=!0){return Je.keccak(this.encodeData(t,e,n,r))},hashType(t,e){return Je.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const n in $l.properties)t[n]&&(e[n]=t[n]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const n=this.sanitizeData(t),r=[B.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,e)),n.primaryType!=="EIP712Domain"&&r.push(this.hashStruct(n.primaryType,n.message,n.types,e)),Je.keccak(B.concat(r))}};var Jp={TYPED_MESSAGE_SCHEMA:$l,TypedDataUtils:to,hashForSignTypedDataLegacy:function(t){return Qp(t.data)},hashForSignTypedData_v3:function(t){return to.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return to.hash(t.data)}};function Qp(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const n=t.map(function(s){return s.type==="bytes"?Je.toBuffer(s.value):s.value}),r=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return Un.soliditySHA3(["bytes32","bytes32"],[Un.soliditySHA3(new Array(t.length).fill("string"),i),Un.soliditySHA3(r,n)])}var bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.filterFromParam=bn.FilterPolyfill=void 0;const sn=ir,ke=x,Zp=5*60*1e3,Dt={jsonrpc:"2.0",id:0};class Yp{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,sn.IntNumber)(1),this.provider=e}async newFilter(e){const n=Pl(e),r=this.makeFilterId(),i=await this.setInitialCursorPosition(r,n.fromBlock);return console.log(`Installing new log filter(${r}):`,n,"initial cursor position:",i),this.logFilters.set(r,n),this.setFilterTimeout(r),(0,ke.hexStringFromIntNumber)(r)}async newBlockFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.blockFilters.add(e),this.setFilterTimeout(e),(0,ke.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,ke.hexStringFromIntNumber)(e)}uninstallFilter(e){const n=(0,ke.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${n})`),this.deleteFilter(n),!0}getFilterChanges(e){const n=(0,ke.intNumberFromHexString)(e);return this.timeouts.has(n)&&this.setFilterTimeout(n),this.logFilters.has(n)?this.getLogFilterChanges(n):this.blockFilters.has(n)?this.getBlockFilterChanges(n):this.pendingTransactionFilters.has(n)?this.getPendingTransactionFilterChanges(n):Promise.resolve(Cr())}async getFilterLogs(e){const n=(0,ke.intNumberFromHexString)(e),r=this.logFilters.get(n);return r?this.sendAsyncPromise(Object.assign(Object.assign({},Dt),{method:"eth_getLogs",params:[Mc(r)]})):Cr()}makeFilterId(){return(0,sn.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((n,r)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return r(i);if(Array.isArray(s)||s==null)return r(new Error(`unexpected response received: ${JSON.stringify(s)}`));n(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 n=this.logFilters.get(e),r=this.cursors.get(e);if(!r||!n)return Cr();const i=await this.getCurrentBlockHeight(),s=n.toBlock==="latest"?i:n.toBlock;if(r>i||r>n.toBlock)return Ir();console.log(`Fetching logs from ${r} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},Dt),{method:"eth_getLogs",params:[Mc(Object.assign(Object.assign({},n),{fromBlock:r,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(u=>(0,ke.intNumberFromHexString)(u.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>r){const u=(0,sn.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${r} to ${u}`),this.cursors.set(e,u)}}return o}async getBlockFilterChanges(e){const n=this.cursors.get(e);if(!n)return Cr();const r=await this.getCurrentBlockHeight();if(n>r)return Ir();console.log(`Fetching blocks from ${n} to ${r} for filter (${e})`);const i=(await Promise.all((0,ke.range)(n,r+1).map(o=>this.getBlockHashByNumber((0,sn.IntNumber)(o))))).filter(o=>!!o),s=(0,sn.IntNumber)(n+i.length);return console.log(`Moving cursor position for filter (${e}) from ${n} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},Dt),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(Ir())}async setInitialCursorPosition(e,n){const r=await this.getCurrentBlockHeight(),i=typeof n=="number"&&n>r?n:r;return this.cursors.set(e,i),i}setFilterTimeout(e){const n=this.timeouts.get(e);n&&window.clearTimeout(n);const r=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},Zp);this.timeouts.set(e,r)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},Dt),{method:"eth_blockNumber",params:[]}));return(0,ke.intNumberFromHexString)((0,ke.ensureHexString)(e))}async getBlockHashByNumber(e){const n=await this.sendAsyncPromise(Object.assign(Object.assign({},Dt),{method:"eth_getBlockByNumber",params:[(0,ke.hexStringFromIntNumber)(e),!1]}));return n.result&&typeof n.result.hash=="string"?(0,ke.ensureHexString)(n.result.hash):null}}bn.FilterPolyfill=Yp;function Pl(t){return{fromBlock:Ac(t.fromBlock),toBlock:Ac(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}bn.filterFromParam=Pl;function Mc(t){const e={fromBlock:Tc(t.fromBlock),toBlock:Tc(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function Ac(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,sn.IntNumber)(0);if((0,ke.isHexString)(t))return(0,ke.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function Tc(t){return t==="latest"?t:(0,ke.hexStringFromIntNumber)(t)}function Cr(){return Object.assign(Object.assign({},Dt),{error:{code:-32e3,message:"filter not found"}})}function Ir(){return Object.assign(Object.assign({},Dt),{result:[]})}var Dl={};(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={}))})(Dl);var ci={},Fl={},ui={},Xo=Kp;function Kp(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,n=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return n=n%e,n++}}const Nc=(t,e)=>function(){const n=e.promiseModule,r=new Array(arguments.length);for(let i=0;i<arguments.length;i++)r[i]=arguments[i];return new n((i,s)=>{e.errorFirst?r.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)}):r.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,r)})};var Xp=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const n=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let r;typeof t=="function"?r=function(){return e.excludeMain?t.apply(this,arguments):Nc(t,e).apply(this,arguments)}:r=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];r[i]=typeof s=="function"&&n(i)?Nc(s,e):s}return r},ar={},e0=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ar,"__esModule",{value:!0});ar.BaseBlockTracker=void 0;const t0=e0(Qt),n0=1e3,r0=(t,e)=>t+e,Oc=["sync","latest"];class i0 extends t0.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*n0,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(n=>this.once("latest",n))}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){Oc.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"))}_getBlockTrackerEventCount(){return Oc.map(e=>this.listenerCount(e)).reduce(r0)}_newPotentialLatest(e){const n=this._currentBlock;n&&Lc(e)<=Lc(n)||this._setCurrentBlock(e)}_setCurrentBlock(e){const n=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:n,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}}ar.BaseBlockTracker=i0;function Lc(t){return Number.parseInt(t,16)}var Bl={},Vl={},_e={};class Hl extends TypeError{constructor(e,n){let r;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=()=>r??(r=[e,...n()])}}function s0(t){return Ue(t)&&typeof t[Symbol.iterator]=="function"}function Ue(t){return typeof t=="object"&&t!=null}function jc(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function de(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function o0(t){const{done:e,value:n}=t.next();return e?void 0:n}function a0(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${de(r)}\``}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*To(t,e,n,r){s0(t)||(t=[t]);for(const i of t){const s=a0(i,e,n,r);s&&(yield s)}}function*ea(t,e,n={}){const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&Ue(e.schema)&&Ue(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=n.message,c="not_valid",yield[u,void 0];for(let[u,l,h]of e.entries(t,a)){const f=ea(l,h,{path:u===void 0?r:[...r,u],branch:u===void 0?i:[...i,l],coerce:s,mask:o,message:n.message});for(const d of f)d[0]?(c=d[0].refinement!=null?"not_refined":"not_valid",yield[d[0],void 0]):s&&(l=d[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):Ue(t)&&(l!==void 0||u in t)&&(t[u]=l))}if(c!=="not_valid")for(const u of e.refiner(t,a))u.explanation=n.message,c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class le{constructor(e){const{type:n,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const l=i(c,u);return To(l,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const l=s(c,u);return To(l,u,this,c)}:this.refiner=()=>[]}assert(e,n){return Wl(e,this,n)}create(e,n){return Ul(e,this,n)}is(e){return ta(e,this)}mask(e,n){return zl(e,this,n)}validate(e,n={}){return An(e,this,n)}}function Wl(t,e,n){const r=An(t,e,{message:n});if(r[0])throw r[0]}function Ul(t,e,n){const r=An(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function zl(t,e,n){const r=An(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function ta(t,e){return!An(t,e)[0]}function An(t,e,n={}){const r=ea(t,e,n),i=o0(r);return i[0]?[new Hl(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function c0(...t){const e=t[0].type==="type",n=t.map(i=>i.schema),r=Object.assign({},...n);return e?ra(r):cr(r)}function Ne(t,e){return new le({type:t,schema:null,validator:e})}function u0(t,e){return new le({...t,refiner:(n,r)=>n===void 0||t.refiner(n,r),validator(n,r){return n===void 0?!0:(e(n,r),t.validator(n,r))}})}function l0(t){return new le({type:"dynamic",schema:null,*entries(e,n){yield*t(e,n).entries(e,n)},validator(e,n){return t(e,n).validator(e,n)},coercer(e,n){return t(e,n).coercer(e,n)},refiner(e,n){return t(e,n).refiner(e,n)}})}function h0(t){let e;return new le({type:"lazy",schema:null,*entries(n,r){e??(e=t()),yield*e.entries(n,r)},validator(n,r){return e??(e=t()),e.validator(n,r)},coercer(n,r){return e??(e=t()),e.coercer(n,r)},refiner(n,r){return e??(e=t()),e.refiner(n,r)}})}function f0(t,e){const{schema:n}=t,r={...n};for(const i of e)delete r[i];switch(t.type){case"type":return ra(r);default:return cr(r)}}function d0(t){const e=t instanceof le?{...t.schema}:{...t};for(const n in e)e[n]=ql(e[n]);return cr(e)}function p0(t,e){const{schema:n}=t,r={};for(const i of e)r[i]=n[i];return cr(r)}function b0(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Ne(t,e)}function g0(){return Ne("any",()=>!0)}function m0(t){return new le({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${de(e)}`}})}function y0(){return Ne("bigint",t=>typeof t=="bigint")}function v0(){return Ne("boolean",t=>typeof t=="boolean")}function _0(){return Ne("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${de(t)}`)}function w0(t){const e={},n=t.map(r=>de(r)).join();for(const r of t)e[r]=r;return new le({type:"enums",schema:e,validator(r){return t.includes(r)||`Expected one of \`${n}\`, but received: ${de(r)}`}})}function S0(){return Ne("func",t=>typeof t=="function"||`Expected a function, but received: ${de(t)}`)}function E0(t){return Ne("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${de(e)}`)}function C0(){return Ne("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${de(t)}`)}function I0(t){return new le({type:"intersection",schema:null,*entries(e,n){for(const r of t)yield*r.entries(e,n)},*validator(e,n){for(const r of t)yield*r.validator(e,n)},*refiner(e,n){for(const r of t)yield*r.refiner(e,n)}})}function x0(t){const e=de(t),n=typeof t;return new le({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?t:null,validator(r){return r===t||`Expected the literal \`${e}\`, but received: ${de(r)}`}})}function k0(t,e){return new le({type:"map",schema:null,*entries(n){if(t&&e&&n instanceof Map)for(const[r,i]of n.entries())yield[r,r,t],yield[r,i,e]},coercer(n){return n instanceof Map?new Map(n):n},validator(n){return n instanceof Map||`Expected a \`Map\` object, but received: ${de(n)}`}})}function na(){return Ne("never",()=>!1)}function R0(t){return new le({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function M0(){return Ne("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${de(t)}`)}function cr(t){const e=t?Object.keys(t):[],n=na();return new le({type:"object",schema:t||null,*entries(r){if(t&&Ue(r)){const i=new Set(Object.keys(r));for(const s of e)i.delete(s),yield[s,r[s],t[s]];for(const s of i)yield[s,r[s],n]}},validator(r){return Ue(r)||`Expected an object, but received: ${de(r)}`},coercer(r){return Ue(r)?{...r}:r}})}function ql(t){return new le({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function A0(t,e){return new le({type:"record",schema:null,*entries(n){if(Ue(n))for(const r in n){const i=n[r];yield[r,r,t],yield[r,i,e]}},validator(n){return Ue(n)||`Expected an object, but received: ${de(n)}`}})}function T0(){return Ne("regexp",t=>t instanceof RegExp)}function N0(t){return new le({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const n of e)yield[n,n,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${de(e)}`}})}function Gl(){return Ne("string",t=>typeof t=="string"||`Expected a string, but received: ${de(t)}`)}function O0(t){const e=na();return new le({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(t.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],t[i]||e]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${de(n)}`}})}function ra(t){const e=Object.keys(t);return new le({type:"type",schema:t,*entries(n){if(Ue(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return Ue(n)||`Expected an object, but received: ${de(n)}`},coercer(n){return Ue(n)?{...n}:n}})}function L0(t){const e=t.map(n=>n.type).join(" | ");return new le({type:"union",schema:null,coercer(n){for(const r of t){const[i,s]=r.validate(n,{coerce:!0});if(!i)return s}return n},validator(n,r){const i=[];for(const s of t){const[...o]=ea(n,s,r),[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: ${de(n)}`,...i]}})}function Jl(){return Ne("unknown",()=>!0)}function ia(t,e,n){return new le({...t,coercer:(r,i)=>ta(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}function j0(t,e,n={}){return ia(t,Jl(),r=>{const i=typeof e=="function"?e():e;if(r===void 0)return i;if(!n.strict&&jc(r)&&jc(i)){const s={...r};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return r})}function $0(t){return ia(t,Gl(),e=>e.trim())}function P0(t){return Zt(t,"empty",e=>{const n=Ql(e);return n===0||`Expected an empty ${t.type} but received one with a size of \`${n}\``})}function Ql(t){return t instanceof Map||t instanceof Set?t.size:t.length}function D0(t,e,n={}){const{exclusive:r}=n;return Zt(t,"max",i=>r?i<e:i<=e||`Expected a ${t.type} less than ${r?"":"or equal to "}${e} but received \`${i}\``)}function F0(t,e,n={}){const{exclusive:r}=n;return Zt(t,"min",i=>r?i>e:i>=e||`Expected a ${t.type} greater than ${r?"":"or equal to "}${e} but received \`${i}\``)}function B0(t){return Zt(t,"nonempty",e=>Ql(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function V0(t,e){return Zt(t,"pattern",n=>e.test(n)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${n}"`)}function H0(t,e,n=e){const r=`Expected a ${t.type}`,i=e===n?`of \`${e}\``:`between \`${e}\` and \`${n}\``;return Zt(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=n||`${r} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=n||`${r} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=n||`${r} with a length ${i} but received one with a length of \`${o}\``}})}function Zt(t,e,n){return new le({...t,*refiner(r,i){yield*t.refiner(r,i);const s=n(r,i),o=To(s,i,t,r);for(const a of o)yield{...a,refinement:e}}})}const W0=Object.freeze(Object.defineProperty({__proto__:null,Struct:le,StructError:Hl,any:g0,array:m0,assert:Wl,assign:c0,bigint:y0,boolean:v0,coerce:ia,create:Ul,date:_0,defaulted:j0,define:Ne,deprecated:u0,dynamic:l0,empty:P0,enums:w0,func:S0,instance:E0,integer:C0,intersection:I0,is:ta,lazy:h0,literal:x0,map:k0,mask:zl,max:D0,min:F0,never:na,nonempty:B0,nullable:R0,number:M0,object:cr,omit:f0,optional:ql,partial:d0,pattern:V0,pick:p0,record:A0,refine:Zt,regexp:T0,set:N0,size:H0,string:Gl,struct:b0,trimmed:$0,tuple:O0,type:ra,union:L0,unknown:Jl,validate:An},Symbol.toStringTag,{value:"Module"})),Yt=xn(W0);Object.defineProperty(_e,"__esModule",{value:!0});_e.assertExhaustive=_e.assertStruct=_e.assert=_e.AssertionError=void 0;const U0=Yt;function z0(t){return typeof t=="object"&&t!==null&&"message"in t}function q0(t){var e,n;return typeof((n=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||n===void 0?void 0:n.name)=="string"}function G0(t){const e=z0(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Zl(t,e){return q0(t)?new t({message:e}):t({message:e})}class sa extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}_e.AssertionError=sa;function J0(t,e="Assertion failed.",n=sa){if(!t)throw e instanceof Error?e:Zl(n,e)}_e.assert=J0;function Q0(t,e,n="Assertion failed",r=sa){try{(0,U0.assert)(t,e)}catch(i){throw Zl(r,`${n}: ${G0(i)}.`)}}_e.assertStruct=Q0;function Z0(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}_e.assertExhaustive=Z0;var ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.base64=void 0;const Y0=Yt,K0=_e,X0=(t,e={})=>{var n,r;const i=(n=e.paddingRequired)!==null&&n!==void 0?n:!1,s=(r=e.characterSet)!==null&&r!==void 0?r:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,K0.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,Y0.pattern)(t,a)};ur.base64=X0;var Q={},lr={};(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=Yt,n=_e;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 r(u){return(0,e.is)(u,t.HexStruct)}t.isHexString=r;function i(u){return(0,e.is)(u,t.StrictHexStruct)}t.isStrictHexString=i;function s(u){(0,n.assert)(r(u),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(u){(0,n.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})(lr);Object.defineProperty(Q,"__esModule",{value:!0});Q.createDataView=Q.concatBytes=Q.valueToBytes=Q.stringToBytes=Q.numberToBytes=Q.signedBigIntToBytes=Q.bigIntToBytes=Q.hexToBytes=Q.bytesToString=Q.bytesToNumber=Q.bytesToSignedBigInt=Q.bytesToBigInt=Q.bytesToHex=Q.assertIsBytes=Q.isBytes=void 0;const je=_e,No=lr,$c=48,Pc=58,Dc=87;function eb(){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 tb=eb();function oa(t){return t instanceof Uint8Array}Q.isBytes=oa;function Tn(t){(0,je.assert)(oa(t),"Value must be a Uint8Array.")}Q.assertIsBytes=Tn;function Yl(t){if(Tn(t),t.length===0)return"0x";const e=tb(),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return(0,No.add0x)(n.join(""))}Q.bytesToHex=Yl;function Kl(t){Tn(t);const e=Yl(t);return BigInt(e)}Q.bytesToBigInt=Kl;function nb(t){Tn(t);let e=BigInt(0);for(const n of t)e=(e<<BigInt(8))+BigInt(n);return BigInt.asIntN(t.length*8,e)}Q.bytesToSignedBigInt=nb;function rb(t){Tn(t);const e=Kl(t);return(0,je.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}Q.bytesToNumber=rb;function ib(t){return Tn(t),new TextDecoder().decode(t)}Q.bytesToString=ib;function li(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,No.assertIsHexString)(t);const n=(0,No.remove0x)(t).toLowerCase(),r=n.length%2===0?n:`0${n}`,i=new Uint8Array(r.length/2);for(let s=0;s<i.length;s++){const o=r.charCodeAt(s*2),a=r.charCodeAt(s*2+1),c=o-(o<Pc?$c:Dc),u=a-(a<Pc?$c:Dc);i[s]=c*16+u}return i}Q.hexToBytes=li;function Xl(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 li(e)}Q.bigIntToBytes=Xl;function sb(t,e){(0,je.assert)(e>0);const n=t>>BigInt(31);return!((~t&n)+(t&~n)>>BigInt(e*8+-1))}function ob(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)(sb(t,e),"Byte length is too small to represent the given value.");let n=t;const r=new Uint8Array(e);for(let i=0;i<r.length;i++)r[i]=Number(BigInt.asUintN(8,n)),n>>=BigInt(8);return r.reverse()}Q.signedBigIntToBytes=ob;function eh(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 li(e)}Q.numberToBytes=eh;function th(t){return(0,je.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}Q.stringToBytes=th;function nh(t){if(typeof t=="bigint")return Xl(t);if(typeof t=="number")return eh(t);if(typeof t=="string")return t.startsWith("0x")?li(t):th(t);if(oa(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}Q.valueToBytes=nh;function ab(t){const e=new Array(t.length);let n=0;for(let i=0;i<t.length;i++){const s=nh(t[i]);e[i]=s,n+=s.length}const r=new Uint8Array(n);for(let i=0,s=0;i<e.length;i++)r.set(e[i],s),s+=e[i].length;return r}Q.concatBytes=ab;function cb(t){if(typeof B<"u"&&t instanceof B){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}Q.createDataView=cb;var hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.ChecksumStruct=void 0;const Fc=Yt,ub=ur;hi.ChecksumStruct=(0,Fc.size)((0,ub.base64)((0,Fc.string)(),{paddingRequired:!0}),44,44);var at={};Object.defineProperty(at,"__esModule",{value:!0});at.createHex=at.createBytes=at.createBigInt=at.createNumber=void 0;const ie=Yt,lb=_e,rh=Q,fi=lr,ih=(0,ie.union)([(0,ie.number)(),(0,ie.bigint)(),(0,ie.string)(),fi.StrictHexStruct]),hb=(0,ie.coerce)((0,ie.number)(),ih,Number),fb=(0,ie.coerce)((0,ie.bigint)(),ih,BigInt);(0,ie.union)([fi.StrictHexStruct,(0,ie.instance)(Uint8Array)]);const db=(0,ie.coerce)((0,ie.instance)(Uint8Array),(0,ie.union)([fi.StrictHexStruct]),rh.hexToBytes),pb=(0,ie.coerce)(fi.StrictHexStruct,(0,ie.instance)(Uint8Array),rh.bytesToHex);function bb(t){try{const e=(0,ie.create)(t,hb);return(0,lb.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){throw e instanceof ie.StructError?new Error(`Expected a number-like value, got "${t}".`):e}}at.createNumber=bb;function gb(t){try{return(0,ie.create)(t,fb)}catch(e){throw e instanceof ie.StructError?new Error(`Expected a number-like value, got "${String(e.value)}".`):e}}at.createBigInt=gb;function mb(t){if(typeof t=="string"&&t.toLowerCase()==="0x")return new Uint8Array;try{return(0,ie.create)(t,db)}catch(e){throw e instanceof ie.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}at.createBytes=mb;function yb(t){if(t instanceof Uint8Array&&t.length===0||typeof t=="string"&&t.toLowerCase()==="0x")return"0x";try{return(0,ie.create)(t,pb)}catch(e){throw e instanceof ie.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}at.createHex=yb;var gn={},sh=A&&A.__classPrivateFieldSet||function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="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 r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},Re=A&&A.__classPrivateFieldGet||function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},qe,tt;Object.defineProperty(gn,"__esModule",{value:!0});gn.FrozenSet=gn.FrozenMap=void 0;class aa{constructor(e){qe.set(this,void 0),sh(this,qe,new Map(e),"f"),Object.freeze(this)}get size(){return Re(this,qe,"f").size}[(qe=new WeakMap,Symbol.iterator)](){return Re(this,qe,"f")[Symbol.iterator]()}entries(){return Re(this,qe,"f").entries()}forEach(e,n){return Re(this,qe,"f").forEach((r,i,s)=>e.call(n,r,i,this))}get(e){return Re(this,qe,"f").get(e)}has(e){return Re(this,qe,"f").has(e)}keys(){return Re(this,qe,"f").keys()}values(){return Re(this,qe,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,n])=>`${String(e)} => ${String(n)}`).join(", ")} `:""}}`}}gn.FrozenMap=aa;class ca{constructor(e){tt.set(this,void 0),sh(this,tt,new Set(e),"f"),Object.freeze(this)}get size(){return Re(this,tt,"f").size}[(tt=new WeakMap,Symbol.iterator)](){return Re(this,tt,"f")[Symbol.iterator]()}entries(){return Re(this,tt,"f").entries()}forEach(e,n){return Re(this,tt,"f").forEach((r,i,s)=>e.call(n,r,i,this))}has(e){return Re(this,tt,"f").has(e)}keys(){return Re(this,tt,"f").keys()}values(){return Re(this,tt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}gn.FrozenSet=ca;Object.freeze(aa);Object.freeze(aa.prototype);Object.freeze(ca);Object.freeze(ca.prototype);var oh={},ua={};(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 n(u){return u==null}t.isNullOrUndefined=n;function r(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}t.isObject=r;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((f,d)=>o(d)?f+1:f+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})(ua);(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=Yt,n=_e,r=ua;t.JsonStruct=(0,e.define)("Json",E=>{const[N]=k(E,!0);return N?!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,N){(0,n.assertStruct)(E,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",N)}t.assertIsJsonRpcNotification=o;function a(E){return(0,e.is)(E,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function c(E,N){(0,n.assertStruct)(E,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",N)}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,N){(0,n.assertStruct)(E,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",N)}t.assertIsPendingJsonRpcResponse=l;function h(E){return(0,e.is)(E,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=h;function f(E,N){(0,n.assertStruct)(E,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",N)}t.assertIsJsonRpcResponse=f;function d(E){return(0,e.is)(E,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=d;function p(E,N){(0,n.assertStruct)(E,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",N)}t.assertIsJsonRpcSuccess=p;function _(E){return(0,e.is)(E,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=_;function m(E,N){(0,n.assertStruct)(E,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",N)}t.assertIsJsonRpcFailure=m;function b(E){return(0,e.is)(E,t.JsonRpcErrorStruct)}t.isJsonRpcError=b;function y(E,N){(0,n.assertStruct)(E,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",N)}t.assertIsJsonRpcError=y;function S(E){const{permitEmptyString:N,permitFractions:U,permitNull:z}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},E);return q=>!!(typeof q=="number"&&(U||Number.isInteger(q))||typeof q=="string"&&(N||q.length>0)||z&&q===null)}t.getJsonRpcIdValidator=S;function k(E,N=!1){const U=new Set;function z(P,q){if(P===void 0)return[!1,0];if(P===null)return[!0,q?0:r.JsonSize.Null];const ue=typeof P;try{if(ue==="function")return[!1,0];if(ue==="string"||P instanceof String)return[!0,q?0:(0,r.calculateStringSize)(P)+r.JsonSize.Quote*2];if(ue==="boolean"||P instanceof Boolean)return q?[!0,0]:[!0,P==!0?r.JsonSize.True:r.JsonSize.False];if(ue==="number"||P instanceof Number)return q?[!0,0]:[!0,(0,r.calculateNumberSize)(P)];if(P instanceof Date)return q?[!0,0]:[!0,isNaN(P.getDate())?r.JsonSize.Null:r.JsonSize.Date+r.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,r.isPlainObject)(P)&&!Array.isArray(P))return[!1,0];if(U.has(P))return[!1,0];U.add(P);try{return[!0,Object.entries(P).reduce((G,[w,v],R,C)=>{let[T,I]=z(v,q);if(!T)throw new Error("JSON validation did not pass. Validation process stopped.");if(U.delete(P),q)return 0;const L=Array.isArray(P)?0:w.length+r.JsonSize.Comma+r.JsonSize.Colon*2,J=R<C.length-1?r.JsonSize.Comma:0;return G+L+I+J},q?0:r.JsonSize.Wrapper*2)]}catch{return[!1,0]}}return z(E,N)}t.validateJsonAndGetSize=k})(oh);var mn={},Oo={exports:{}},no,Bc;function vb(){if(Bc)return no;Bc=1;var t=1e3,e=t*60,n=e*60,r=n*24,i=r*7,s=r*365.25;no=function(l,h){h=h||{};var f=typeof l;if(f==="string"&&l.length>0)return o(l);if(f==="number"&&isFinite(l))return h.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 h=/^(-?(?:\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(h){var f=parseFloat(h[1]),d=(h[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return f*s;case"weeks":case"week":case"w":return f*i;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*e;case"seconds":case"second":case"secs":case"sec":case"s":return f*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(l){var h=Math.abs(l);return h>=r?Math.round(l/r)+"d":h>=n?Math.round(l/n)+"h":h>=e?Math.round(l/e)+"m":h>=t?Math.round(l/t)+"s":l+"ms"}function c(l){var h=Math.abs(l);return h>=r?u(l,h,r,"day"):h>=n?u(l,h,n,"hour"):h>=e?u(l,h,e,"minute"):h>=t?u(l,h,t,"second"):l+" ms"}function u(l,h,f,d){var p=h>=f*1.5;return Math.round(l/f)+" "+d+(p?"s":"")}return no}function _b(t){n.debug=n,n.default=n,n.coerce=c,n.disable=s,n.enable=i,n.enabled=o,n.humanize=vb(),n.destroy=u,Object.keys(t).forEach(l=>{n[l]=t[l]}),n.names=[],n.skips=[],n.formatters={};function e(l){let h=0;for(let f=0;f<l.length;f++)h=(h<<5)-h+l.charCodeAt(f),h|=0;return n.colors[Math.abs(h)%n.colors.length]}n.selectColor=e;function n(l){let h,f=null,d,p;function _(...m){if(!_.enabled)return;const b=_,y=Number(new Date),S=y-(h||y);b.diff=S,b.prev=h,b.curr=y,h=y,m[0]=n.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let k=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(N,U)=>{if(N==="%%")return"%";k++;const z=n.formatters[U];if(typeof z=="function"){const P=m[k];N=z.call(b,P),m.splice(k,1),k--}return N}),n.formatArgs.call(b,m),(b.log||n.log).apply(b,m)}return _.namespace=l,_.useColors=n.useColors(),_.color=n.selectColor(l),_.extend=r,_.destroy=n.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(d!==n.namespaces&&(d=n.namespaces,p=n.enabled(l)),p),set:m=>{f=m}}),typeof n.init=="function"&&n.init(_),_}function r(l,h){const f=n(this.namespace+(typeof h>"u"?":":h)+l);return f.log=this.log,f}function i(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];let h;const f=(typeof l=="string"?l:"").split(/[\s,]+/),d=f.length;for(h=0;h<d;h++)f[h]&&(l=f[h].replace(/\*/g,".*?"),l[0]==="-"?n.skips.push(new RegExp("^"+l.slice(1)+"$")):n.names.push(new RegExp("^"+l+"$")))}function s(){const l=[...n.names.map(a),...n.skips.map(a).map(h=>"-"+h)].join(",");return n.enable(""),l}function o(l){if(l[l.length-1]==="*")return!0;let h,f;for(h=0,f=n.skips.length;h<f;h++)if(n.skips[h].test(l))return!1;for(h=0,f=n.names.length;h<f;h++)if(n.names[h].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 n.enable(n.load()),n}var wb=_b;(function(t,e){e.formatArgs=r,e.save=i,e.load=s,e.useColors=n,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","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){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 r(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,h=0;c[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(l++,f==="%c"&&(h=l))}),c.splice(h,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 ko<"u"&&"env"in ko&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=wb(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(Oo,Oo.exports);var Sb=Oo.exports,Eb=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mn,"__esModule",{value:!0});mn.createModuleLogger=mn.createProjectLogger=void 0;const Cb=Eb(Sb),Ib=(0,Cb.default)("metamask");function xb(t){return Ib.extend(t)}mn.createProjectLogger=xb;function kb(t,e){return t.extend(e)}mn.createModuleLogger=kb;var ct={};Object.defineProperty(ct,"__esModule",{value:!0});ct.hexToBigInt=ct.hexToNumber=ct.bigIntToHex=ct.numberToHex=void 0;const ln=_e,Yn=lr,Rb=t=>((0,ln.assert)(typeof t=="number","Value must be a number."),(0,ln.assert)(t>=0,"Value must be a non-negative number."),(0,ln.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Yn.add0x)(t.toString(16)));ct.numberToHex=Rb;const Mb=t=>((0,ln.assert)(typeof t=="bigint","Value must be a bigint."),(0,ln.assert)(t>=0,"Value must be a non-negative bigint."),(0,Yn.add0x)(t.toString(16)));ct.bigIntToHex=Mb;const Ab=t=>{(0,Yn.assertIsHexString)(t);const e=parseInt(t,16);return(0,ln.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};ct.hexToNumber=Ab;const Tb=t=>((0,Yn.assertIsHexString)(t),BigInt((0,Yn.add0x)(t)));ct.hexToBigInt=Tb;var ah={};Object.defineProperty(ah,"__esModule",{value:!0});var ch={};(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,n=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function r(s,o){return n(s,"count"),s*o}t.inMilliseconds=r;function i(s){return n(s,"timestamp"),Date.now()-s}t.timeSince=i})(ch);var uh={},Lo={exports:{}};const Nb="2.0.0",lh=256,Ob=Number.MAX_SAFE_INTEGER||9007199254740991,Lb=16,jb=lh-6,$b=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var di={MAX_LENGTH:lh,MAX_SAFE_COMPONENT_LENGTH:Lb,MAX_SAFE_BUILD_LENGTH:jb,MAX_SAFE_INTEGER:Ob,RELEASE_TYPES:$b,SEMVER_SPEC_VERSION:Nb,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Pb=typeof ko=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var pi=Pb;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=di,s=pi;e=t.exports={};const o=e.re=[],a=e.safeRe=[],c=e.src=[],u=e.t={};let l=0;const h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[h,r]],d=_=>{for(const[m,b]of f)_=_.split(`${m}*`).join(`${m}{0,${b}}`).split(`${m}+`).join(`${m}{1,${b}}`);return _},p=(_,m,b)=>{const y=d(m),S=l++;s(_,S,m),u[_]=S,c[S]=m,o[S]=new RegExp(m,b?"g":void 0),a[S]=new RegExp(y,b?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),p("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${h}+`),p("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),p("FULL",`^${c[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),p("LOOSE",`^${c[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),p("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[u.COERCE],!0),p("COERCERTLFULL",c[u.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",p("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",p("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Lo,Lo.exports);var hr=Lo.exports;const Db=Object.freeze({loose:!0}),Fb=Object.freeze({}),Bb=t=>t?typeof t!="object"?Db:t:Fb;var la=Bb;const Vc=/^[0-9]+$/,hh=(t,e)=>{const n=Vc.test(t),r=Vc.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},Vb=(t,e)=>hh(e,t);var fh={compareIdentifiers:hh,rcompareIdentifiers:Vb};const xr=pi,{MAX_LENGTH:Hc,MAX_SAFE_INTEGER:kr}=di,{safeRe:Wc,t:Uc}=hr,Hb=la,{compareIdentifiers:en}=fh;let Wb=class rt{constructor(e,n){if(n=Hb(n),e instanceof rt){if(e.loose===!!n.loose&&e.includePrerelease===!!n.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>Hc)throw new TypeError(`version is longer than ${Hc} characters`);xr("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=e.trim().match(n.loose?Wc[Uc.LOOSE]:Wc[Uc.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>kr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>kr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>kr||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<kr)return s}return i}):this.prerelease=[],this.build=r[5]?r[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(xr("SemVer.compare",this.version,this.options,e),!(e instanceof rt)){if(typeof e=="string"&&e===this.version)return 0;e=new rt(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof rt||(e=new rt(e,this.options)),en(this.major,e.major)||en(this.minor,e.minor)||en(this.patch,e.patch)}comparePre(e){if(e instanceof rt||(e=new rt(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 n=0;do{const r=this.prerelease[n],i=e.prerelease[n];if(xr("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return en(r,i)}while(++n)}compareBuild(e){e instanceof rt||(e=new rt(e,this.options));let n=0;do{const r=this.build[n],i=e.build[n];if(xr("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return en(r,i)}while(++n)}inc(e,n,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);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(r)?1:0;if(!n&&r===!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(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let s=[n,i];r===!1&&(s=[n]),en(this.prerelease[0],n)===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 Te=Wb;const zc=Te,Ub=(t,e,n=!1)=>{if(t instanceof zc)return t;try{return new zc(t,e)}catch(r){if(!n)return null;throw r}};var Nn=Ub;const zb=Nn,qb=(t,e)=>{const n=zb(t,e);return n?n.version:null};var Gb=qb;const Jb=Nn,Qb=(t,e)=>{const n=Jb(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};var Zb=Qb;const qc=Te,Yb=(t,e,n,r,i)=>{typeof n=="string"&&(i=r,r=n,n=void 0);try{return new qc(t instanceof qc?t.version:t,n).inc(e,r,i).version}catch{return null}};var Kb=Yb;const Gc=Nn,Xb=(t,e)=>{const n=Gc(t,null,!0),r=Gc(e,null,!0),i=n.compare(r);if(i===0)return null;const s=i>0,o=s?n:r,a=s?r:n,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 n.major!==r.major?l+"major":n.minor!==r.minor?l+"minor":n.patch!==r.patch?l+"patch":"prerelease"};var eg=Xb;const tg=Te,ng=(t,e)=>new tg(t,e).major;var rg=ng;const ig=Te,sg=(t,e)=>new ig(t,e).minor;var og=sg;const ag=Te,cg=(t,e)=>new ag(t,e).patch;var ug=cg;const lg=Nn,hg=(t,e)=>{const n=lg(t,e);return n&&n.prerelease.length?n.prerelease:null};var fg=hg;const Jc=Te,dg=(t,e,n)=>new Jc(t,n).compare(new Jc(e,n));var Ke=dg;const pg=Ke,bg=(t,e,n)=>pg(e,t,n);var gg=bg;const mg=Ke,yg=(t,e)=>mg(t,e,!0);var vg=yg;const Qc=Te,_g=(t,e,n)=>{const r=new Qc(t,n),i=new Qc(e,n);return r.compare(i)||r.compareBuild(i)};var ha=_g;const wg=ha,Sg=(t,e)=>t.sort((n,r)=>wg(n,r,e));var Eg=Sg;const Cg=ha,Ig=(t,e)=>t.sort((n,r)=>Cg(r,n,e));var xg=Ig;const kg=Ke,Rg=(t,e,n)=>kg(t,e,n)>0;var bi=Rg;const Mg=Ke,Ag=(t,e,n)=>Mg(t,e,n)<0;var fa=Ag;const Tg=Ke,Ng=(t,e,n)=>Tg(t,e,n)===0;var dh=Ng;const Og=Ke,Lg=(t,e,n)=>Og(t,e,n)!==0;var ph=Lg;const jg=Ke,$g=(t,e,n)=>jg(t,e,n)>=0;var da=$g;const Pg=Ke,Dg=(t,e,n)=>Pg(t,e,n)<=0;var pa=Dg;const Fg=dh,Bg=ph,Vg=bi,Hg=da,Wg=fa,Ug=pa,zg=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return Fg(t,n,r);case"!=":return Bg(t,n,r);case">":return Vg(t,n,r);case">=":return Hg(t,n,r);case"<":return Wg(t,n,r);case"<=":return Ug(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};var bh=zg;const qg=Te,Gg=Nn,{safeRe:Rr,t:Mr}=hr,Jg=(t,e)=>{if(t instanceof qg)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?Rr[Mr.COERCEFULL]:Rr[Mr.COERCE]);else{const c=e.includePrerelease?Rr[Mr.COERCERTLFULL]:Rr[Mr.COERCERTL];let u;for(;(u=c.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||u.index+u[0].length!==n.index+n[0].length)&&(n=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(n===null)return null;const r=n[2],i=n[3]||"0",s=n[4]||"0",o=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return Gg(`${r}.${i}.${s}${o}${a}`,e)};var Qg=Jg,ro,Zc;function Zg(){return Zc||(Zc=1,ro=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),ro}var Yg=Z;Z.Node=qt;Z.create=Z;function Z(t){var e=this;if(e instanceof Z||(e=new Z),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 n=0,r=arguments.length;n<r;n++)e.push(arguments[n]);return e}Z.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;return e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null,e};Z.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++}};Z.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++}};Z.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)Xg(this,arguments[t]);return this.length};Z.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)em(this,arguments[t]);return this.length};Z.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}};Z.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}};Z.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,r=0;n!==null;r++)t.call(e,n.value,r,this),n=n.next};Z.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,r=this.length-1;n!==null;r--)t.call(e,n.value,r,this),n=n.prev};Z.prototype.get=function(t){for(var e=0,n=this.head;n!==null&&e<t;e++)n=n.next;if(e===t&&n!==null)return n.value};Z.prototype.getReverse=function(t){for(var e=0,n=this.tail;n!==null&&e<t;e++)n=n.prev;if(e===t&&n!==null)return n.value};Z.prototype.map=function(t,e){e=e||this;for(var n=new Z,r=this.head;r!==null;)n.push(t.call(e,r.value,this)),r=r.next;return n};Z.prototype.mapReverse=function(t,e){e=e||this;for(var n=new Z,r=this.tail;r!==null;)n.push(t.call(e,r.value,this)),r=r.prev;return n};Z.prototype.reduce=function(t,e){var n,r=this.head;if(arguments.length>1)n=e;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=t(n,r.value,i),r=r.next;return n};Z.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=t(n,r.value,i),r=r.prev;return n};Z.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;n!==null;e++)t[e]=n.value,n=n.next;return t};Z.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;n!==null;e++)t[e]=n.value,n=n.prev;return t};Z.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new Z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(;i!==null&&r<e;r++,i=i.next)n.push(i.value);return n};Z.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new Z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,i=this.tail;i!==null&&r>e;r--)i=i.prev;for(;i!==null&&r>t;r--,i=i.prev)n.push(i.value);return n};Z.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(var s=[],r=0;i&&r<e;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=Kg(this,i,n[r]);return s};Z.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=e,this.tail=t,this};function Kg(t,e,n){var r=e===t.head?new qt(n,null,e,t):new qt(n,e,e.next,t);return r.next===null&&(t.tail=r),r.prev===null&&(t.head=r),t.length++,r}function Xg(t,e){t.tail=new qt(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function em(t,e){t.head=new qt(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function qt(t,e,n,r){if(!(this instanceof qt))return new qt(t,e,n,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{Zg()(Z)}catch{}const tm=Yg,Ft=Symbol("max"),bt=Symbol("length"),tn=Symbol("lengthCalculator"),zn=Symbol("allowStale"),Wt=Symbol("maxAge"),ft=Symbol("dispose"),Yc=Symbol("noDisposeOnSet"),ge=Symbol("lruList"),Qe=Symbol("cache"),gh=Symbol("updateAgeOnGet"),io=()=>1;class nm{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[Ft]=e.max||1/0;const n=e.length||io;if(this[tn]=typeof n!="function"?io:n,this[zn]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Wt]=e.maxAge||0,this[ft]=e.dispose,this[Yc]=e.noDisposeOnSet||!1,this[gh]=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[Ft]=e||1/0,Dn(this)}get max(){return this[Ft]}set allowStale(e){this[zn]=!!e}get allowStale(){return this[zn]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Wt]=e,Dn(this)}get maxAge(){return this[Wt]}set lengthCalculator(e){typeof e!="function"&&(e=io),e!==this[tn]&&(this[tn]=e,this[bt]=0,this[ge].forEach(n=>{n.length=this[tn](n.value,n.key),this[bt]+=n.length})),Dn(this)}get lengthCalculator(){return this[tn]}get length(){return this[bt]}get itemCount(){return this[ge].length}rforEach(e,n){n=n||this;for(let r=this[ge].tail;r!==null;){const i=r.prev;Kc(this,e,r,n),r=i}}forEach(e,n){n=n||this;for(let r=this[ge].head;r!==null;){const i=r.next;Kc(this,e,r,n),r=i}}keys(){return this[ge].toArray().map(e=>e.key)}values(){return this[ge].toArray().map(e=>e.value)}reset(){this[ft]&&this[ge]&&this[ge].length&&this[ge].forEach(e=>this[ft](e.key,e.value)),this[Qe]=new Map,this[ge]=new tm,this[bt]=0}dump(){return this[ge].map(e=>Wr(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[ge]}set(e,n,r){if(r=r||this[Wt],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[tn](n,e);if(this[Qe].has(e)){if(s>this[Ft])return hn(this,this[Qe].get(e)),!1;const c=this[Qe].get(e).value;return this[ft]&&(this[Yc]||this[ft](e,c.value)),c.now=i,c.maxAge=r,c.value=n,this[bt]+=s-c.length,c.length=s,this.get(e),Dn(this),!0}const o=new rm(e,n,s,i,r);return o.length>this[Ft]?(this[ft]&&this[ft](e,n),!1):(this[bt]+=o.length,this[ge].unshift(o),this[Qe].set(e,this[ge].head),Dn(this),!0)}has(e){if(!this[Qe].has(e))return!1;const n=this[Qe].get(e).value;return!Wr(this,n)}get(e){return so(this,e,!0)}peek(e){return so(this,e,!1)}pop(){const e=this[ge].tail;return e?(hn(this,e),e.value):null}del(e){hn(this,this[Qe].get(e))}load(e){this.reset();const n=Date.now();for(let r=e.length-1;r>=0;r--){const i=e[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-n;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Qe].forEach((e,n)=>so(this,n,!1))}}const so=(t,e,n)=>{const r=t[Qe].get(e);if(r){const i=r.value;if(Wr(t,i)){if(hn(t,r),!t[zn])return}else n&&(t[gh]&&(r.value.now=Date.now()),t[ge].unshiftNode(r));return i.value}},Wr=(t,e)=>{if(!e||!e.maxAge&&!t[Wt])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[Wt]&&n>t[Wt]},Dn=t=>{if(t[bt]>t[Ft])for(let e=t[ge].tail;t[bt]>t[Ft]&&e!==null;){const n=e.prev;hn(t,e),e=n}},hn=(t,e)=>{if(e){const n=e.value;t[ft]&&t[ft](n.key,n.value),t[bt]-=n.length,t[Qe].delete(n.key),t[ge].removeNode(e)}};class rm{constructor(e,n,r,i,s){this.key=e,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const Kc=(t,e,n,r)=>{let i=n.value;Wr(t,i)&&(hn(t,n),t[zn]||(i=void 0)),i&&e.call(r,i.value,i.key,t)};var im=nm,oo,Xc;function Xe(){if(Xc)return oo;Xc=1;class t{constructor(v,R){if(R=r(R),v instanceof t)return v.loose===!!R.loose&&v.includePrerelease===!!R.includePrerelease?v:new t(v.raw,R);if(v instanceof i)return this.raw=v.value,this.set=[[v]],this.format(),this;if(this.options=R,this.loose=!!R.loose,this.includePrerelease=!!R.includePrerelease,this.raw=v.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(C=>this.parseRange(C.trim())).filter(C=>C.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const C=this.set[0];if(this.set=this.set.filter(T=>!p(T[0])),this.set.length===0)this.set=[C];else if(this.set.length>1){for(const T of this.set)if(T.length===1&&_(T[0])){this.set=[T];break}}}this.format()}format(){return this.range=this.set.map(v=>v.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(v){const C=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+v,T=n.get(C);if(T)return T;const I=this.options.loose,L=I?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];v=v.replace(L,ue(this.options.includePrerelease)),s("hyphen replace",v),v=v.replace(a[c.COMPARATORTRIM],u),s("comparator trim",v),v=v.replace(a[c.TILDETRIM],l),s("tilde trim",v),v=v.replace(a[c.CARETTRIM],h),s("caret trim",v);let J=v.split(" ").map(ne=>b(ne,this.options)).join(" ").split(/\s+/).map(ne=>q(ne,this.options));I&&(J=J.filter(ne=>(s("loose invalid filter",ne,this.options),!!ne.match(a[c.COMPARATORLOOSE])))),s("range list",J);const D=new Map,X=J.map(ne=>new i(ne,this.options));for(const ne of X){if(p(ne))return[ne];D.set(ne.value,ne)}D.size>1&&D.has("")&&D.delete("");const we=[...D.values()];return n.set(C,we),we}intersects(v,R){if(!(v instanceof t))throw new TypeError("a Range is required");return this.set.some(C=>m(C,R)&&v.set.some(T=>m(T,R)&&C.every(I=>T.every(L=>I.intersects(L,R)))))}test(v){if(!v)return!1;if(typeof v=="string")try{v=new o(v,this.options)}catch{return!1}for(let R=0;R<this.set.length;R++)if(G(this.set[R],v,this.options))return!0;return!1}}oo=t;const e=im,n=new e({max:1e3}),r=la,i=gi(),s=pi,o=Te,{safeRe:a,t:c,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:h}=hr,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=di,p=w=>w.value==="<0.0.0-0",_=w=>w.value==="",m=(w,v)=>{let R=!0;const C=w.slice();let T=C.pop();for(;R&&C.length;)R=C.every(I=>T.intersects(I,v)),T=C.pop();return R},b=(w,v)=>(s("comp",w,v),w=E(w,v),s("caret",w),w=S(w,v),s("tildes",w),w=U(w,v),s("xrange",w),w=P(w,v),s("stars",w),w),y=w=>!w||w.toLowerCase()==="x"||w==="*",S=(w,v)=>w.trim().split(/\s+/).map(R=>k(R,v)).join(" "),k=(w,v)=>{const R=v.loose?a[c.TILDELOOSE]:a[c.TILDE];return w.replace(R,(C,T,I,L,J)=>{s("tilde",w,C,T,I,L,J);let D;return y(T)?D="":y(I)?D=`>=${T}.0.0 <${+T+1}.0.0-0`:y(L)?D=`>=${T}.${I}.0 <${T}.${+I+1}.0-0`:J?(s("replaceTilde pr",J),D=`>=${T}.${I}.${L}-${J} <${T}.${+I+1}.0-0`):D=`>=${T}.${I}.${L} <${T}.${+I+1}.0-0`,s("tilde return",D),D})},E=(w,v)=>w.trim().split(/\s+/).map(R=>N(R,v)).join(" "),N=(w,v)=>{s("caret",w,v);const R=v.loose?a[c.CARETLOOSE]:a[c.CARET],C=v.includePrerelease?"-0":"";return w.replace(R,(T,I,L,J,D)=>{s("caret",w,T,I,L,J,D);let X;return y(I)?X="":y(L)?X=`>=${I}.0.0${C} <${+I+1}.0.0-0`:y(J)?I==="0"?X=`>=${I}.${L}.0${C} <${I}.${+L+1}.0-0`:X=`>=${I}.${L}.0${C} <${+I+1}.0.0-0`:D?(s("replaceCaret pr",D),I==="0"?L==="0"?X=`>=${I}.${L}.${J}-${D} <${I}.${L}.${+J+1}-0`:X=`>=${I}.${L}.${J}-${D} <${I}.${+L+1}.0-0`:X=`>=${I}.${L}.${J}-${D} <${+I+1}.0.0-0`):(s("no pr"),I==="0"?L==="0"?X=`>=${I}.${L}.${J}${C} <${I}.${L}.${+J+1}-0`:X=`>=${I}.${L}.${J}${C} <${I}.${+L+1}.0-0`:X=`>=${I}.${L}.${J} <${+I+1}.0.0-0`),s("caret return",X),X})},U=(w,v)=>(s("replaceXRanges",w,v),w.split(/\s+/).map(R=>z(R,v)).join(" ")),z=(w,v)=>{w=w.trim();const R=v.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return w.replace(R,(C,T,I,L,J,D)=>{s("xRange",w,C,T,I,L,J,D);const X=y(I),we=X||y(L),ne=we||y(J),wt=ne;return T==="="&&wt&&(T=""),D=v.includePrerelease?"-0":"",X?T===">"||T==="<"?C="<0.0.0-0":C="*":T&&wt?(we&&(L=0),J=0,T===">"?(T=">=",we?(I=+I+1,L=0,J=0):(L=+L+1,J=0)):T==="<="&&(T="<",we?I=+I+1:L=+L+1),T==="<"&&(D="-0"),C=`${T+I}.${L}.${J}${D}`):we?C=`>=${I}.0.0${D} <${+I+1}.0.0-0`:ne&&(C=`>=${I}.${L}.0${D} <${I}.${+L+1}.0-0`),s("xRange return",C),C})},P=(w,v)=>(s("replaceStars",w,v),w.trim().replace(a[c.STAR],"")),q=(w,v)=>(s("replaceGTE0",w,v),w.trim().replace(a[v.includePrerelease?c.GTE0PRE:c.GTE0],"")),ue=w=>(v,R,C,T,I,L,J,D,X,we,ne,wt,ts)=>(y(C)?R="":y(T)?R=`>=${C}.0.0${w?"-0":""}`:y(I)?R=`>=${C}.${T}.0${w?"-0":""}`:L?R=`>=${R}`:R=`>=${R}${w?"-0":""}`,y(X)?D="":y(we)?D=`<${+X+1}.0.0-0`:y(ne)?D=`<${X}.${+we+1}.0-0`:wt?D=`<=${X}.${we}.${ne}-${wt}`:w?D=`<${X}.${we}.${+ne+1}-0`:D=`<=${D}`,`${R} ${D}`.trim()),G=(w,v,R)=>{for(let C=0;C<w.length;C++)if(!w[C].test(v))return!1;if(v.prerelease.length&&!R.includePrerelease){for(let C=0;C<w.length;C++)if(s(w[C].semver),w[C].semver!==i.ANY&&w[C].semver.prerelease.length>0){const T=w[C].semver;if(T.major===v.major&&T.minor===v.minor&&T.patch===v.patch)return!0}return!1}return!0};return oo}var ao,eu;function gi(){if(eu)return ao;eu=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(l,h){if(h=n(h),l instanceof e){if(l.loose===!!h.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),o("comparator",l,h),this.options=h,this.loose=!!h.loose,this.parse(l),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(l){const h=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],f=l.match(h);if(!f)throw new TypeError(`Invalid comparator: ${l}`);this.operator=f[1]!==void 0?f[1]:"",this.operator==="="&&(this.operator=""),f[2]?this.semver=new a(f[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,h){if(!(l instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,h).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,h).test(l.semver):(h=n(h),h.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!h.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,h)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||s(this.semver,">",l.semver,h)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}ao=e;const n=la,{safeRe:r,t:i}=hr,s=bh,o=pi,a=Te,c=Xe();return ao}const sm=Xe(),om=(t,e,n)=>{try{e=new sm(e,n)}catch{return!1}return e.test(t)};var mi=om;const am=Xe(),cm=(t,e)=>new am(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));var um=cm;const lm=Te,hm=Xe(),fm=(t,e,n)=>{let r=null,i=null,s=null;try{s=new hm(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===-1)&&(r=o,i=new lm(r,n))}),r};var dm=fm;const pm=Te,bm=Xe(),gm=(t,e,n)=>{let r=null,i=null,s=null;try{s=new bm(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===1)&&(r=o,i=new pm(r,n))}),r};var mm=gm;const co=Te,ym=Xe(),tu=bi,vm=(t,e)=>{t=new ym(t,e);let n=new co("0.0.0");if(t.test(n)||(n=new co("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){const i=t.set[r];let s=null;i.forEach(o=>{const a=new co(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||tu(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!n||tu(n,s))&&(n=s)}return n&&t.test(n)?n:null};var _m=vm;const wm=Xe(),Sm=(t,e)=>{try{return new wm(t,e).range||"*"}catch{return null}};var Em=Sm;const Cm=Te,mh=gi(),{ANY:Im}=mh,xm=Xe(),km=mi,nu=bi,ru=fa,Rm=pa,Mm=da,Am=(t,e,n,r)=>{t=new Cm(t,r),e=new xm(e,r);let i,s,o,a,c;switch(n){case">":i=nu,s=Rm,o=ru,a=">",c=">=";break;case"<":i=ru,s=Mm,o=nu,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(km(t,e,r))return!1;for(let u=0;u<e.set.length;++u){const l=e.set[u];let h=null,f=null;if(l.forEach(d=>{d.semver===Im&&(d=new mh(">=0.0.0")),h=h||d,f=f||d,i(d.semver,h.semver,r)?h=d:o(d.semver,f.semver,r)&&(f=d)}),h.operator===a||h.operator===c||(!f.operator||f.operator===a)&&s(t,f.semver))return!1;if(f.operator===c&&o(t,f.semver))return!1}return!0};var ba=Am;const Tm=ba,Nm=(t,e,n)=>Tm(t,e,">",n);var Om=Nm;const Lm=ba,jm=(t,e,n)=>Lm(t,e,"<",n);var $m=jm;const iu=Xe(),Pm=(t,e,n)=>(t=new iu(t,n),e=new iu(e,n),t.intersects(e,n));var Dm=Pm;const Fm=mi,Bm=Ke;var Vm=(t,e,n)=>{const r=[];let i=null,s=null;const o=t.sort((l,h)=>Bm(l,h,n));for(const l of o)Fm(l,e,n)?(s=l,i||(i=l)):(s&&r.push([i,s]),s=null,i=null);i&&r.push([i,null]);const a=[];for(const[l,h]of r)l===h?a.push(l):!h&&l===o[0]?a.push("*"):h?l===o[0]?a.push(`<=${h}`):a.push(`${l} - ${h}`):a.push(`>=${l}`);const c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e};const su=Xe(),ga=gi(),{ANY:uo}=ga,Fn=mi,ma=Ke,Hm=(t,e,n={})=>{if(t===e)return!0;t=new su(t,n),e=new su(e,n);let r=!1;e:for(const i of t.set){for(const s of e.set){const o=Um(i,s,n);if(r=r||o!==null,o)continue e}if(r)return!1}return!0},Wm=[new ga(">=0.0.0-0")],ou=[new ga(">=0.0.0")],Um=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===uo){if(e.length===1&&e[0].semver===uo)return!0;n.includePrerelease?t=Wm:t=ou}if(e.length===1&&e[0].semver===uo){if(n.includePrerelease)return!0;e=ou}const r=new Set;let i,s;for(const d of t)d.operator===">"||d.operator===">="?i=au(i,d,n):d.operator==="<"||d.operator==="<="?s=cu(s,d,n):r.add(d.semver);if(r.size>1)return null;let o;if(i&&s){if(o=ma(i.semver,s.semver,n),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const d of r){if(i&&!Fn(d,String(i),n)||s&&!Fn(d,String(s),n))return null;for(const p of e)if(!Fn(d,String(p),n))return!1;return!0}let a,c,u,l,h=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(const d of e){if(l=l||d.operator===">"||d.operator===">=",u=u||d.operator==="<"||d.operator==="<=",i){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator===">"||d.operator===">="){if(a=au(i,d,n),a===d&&a!==i)return!1}else if(i.operator===">="&&!Fn(i.semver,String(d),n))return!1}if(s){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator==="<"||d.operator==="<="){if(c=cu(s,d,n),c===d&&c!==s)return!1}else if(s.operator==="<="&&!Fn(s.semver,String(d),n))return!1}if(!d.operator&&(s||i)&&o!==0)return!1}return!(i&&u&&!s&&o!==0||s&&l&&!i&&o!==0||f||h)},au=(t,e,n)=>{if(!t)return e;const r=ma(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},cu=(t,e,n)=>{if(!t)return e;const r=ma(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};var zm=Hm;const lo=hr,uu=di,qm=Te,lu=fh,Gm=Nn,Jm=Gb,Qm=Zb,Zm=Kb,Ym=eg,Km=rg,Xm=og,e1=ug,t1=fg,n1=Ke,r1=gg,i1=vg,s1=ha,o1=Eg,a1=xg,c1=bi,u1=fa,l1=dh,h1=ph,f1=da,d1=pa,p1=bh,b1=Qg,g1=gi(),m1=Xe(),y1=mi,v1=um,_1=dm,w1=mm,S1=_m,E1=Em,C1=ba,I1=Om,x1=$m,k1=Dm,R1=Vm,M1=zm;var A1={parse:Gm,valid:Jm,clean:Qm,inc:Zm,diff:Ym,major:Km,minor:Xm,patch:e1,prerelease:t1,compare:n1,rcompare:r1,compareLoose:i1,compareBuild:s1,sort:o1,rsort:a1,gt:c1,lt:u1,eq:l1,neq:h1,gte:f1,lte:d1,cmp:p1,coerce:b1,Comparator:g1,Range:m1,satisfies:y1,toComparators:v1,maxSatisfying:_1,minSatisfying:w1,minVersion:S1,validRange:E1,outside:C1,gtr:I1,ltr:x1,intersects:k1,simplifyRange:R1,subset:M1,SemVer:qm,re:lo.re,src:lo.src,tokens:lo.t,SEMVER_SPEC_VERSION:uu.SEMVER_SPEC_VERSION,RELEASE_TYPES:uu.RELEASE_TYPES,compareIdentifiers:lu.compareIdentifiers,rcompareIdentifiers:lu.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=A1,n=Yt,r=_e;t.VersionStruct=(0,n.refine)((0,n.string)(),"Version",h=>(0,e.valid)(h)===null?`Expected SemVer version, got "${h}"`:!0),t.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",h=>(0,e.validRange)(h)===null?`Expected SemVer range, got "${h}"`:!0);function i(h){return(0,n.is)(h,t.VersionStruct)}t.isValidSemVerVersion=i;function s(h){return(0,n.is)(h,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(h){(0,r.assertStruct)(h,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(h){(0,r.assertStruct)(h,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(h,f){return(0,e.gt)(h,f)}t.gtVersion=c;function u(h,f){return(0,e.gtr)(h,f)}t.gtRange=u;function l(h,f){return(0,e.satisfies)(h,f,{includePrerelease:!0})}t.satisfiesVersionRange=l})(uh);(function(t){var e=A&&A.__createBinding||(Object.create?function(r,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(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=A&&A.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(_e,t),n(ur,t),n(Q,t),n(hi,t),n(at,t),n(gn,t),n(lr,t),n(oh,t),n(mn,t),n(ua,t),n(ct,t),n(ah,t),n(ch,t),n(uh,t)})(Vl);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=Vl;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(Bl);var yh=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ui,"__esModule",{value:!0});ui.PollingBlockTracker=void 0;const T1=yh(Xo),N1=yh(Xp),O1=ar,hu=Bl,fu=(0,hu.createModuleLogger)(hu.projectLogger,"polling-block-tracker"),L1=(0,T1.default)(),j1=1e3;class $1 extends O1.BaseBlockTracker{constructor(e={}){var n;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(n=e.blockResetDuration)!==null&&n!==void 0?n:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*j1,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 n=du(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await n}catch(n){const r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
|
|
2
|
-
${(e=n.stack)!==null&&e!==void 0?e:n}`);try{this.emit("error",r)}catch{console.error(r)}const i=du(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:L1(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),fu("Making request",e);const n=await(0,N1.default)(r=>this._provider.sendAsync(e,r))();if(fu("Got response",n),n.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
3
|
-
${n.error.message}`);return n.result}}ui.PollingBlockTracker=$1;function du(t,e){return new Promise(n=>{const r=setTimeout(n,t);r.unref&&e&&r.unref()})}var yi={},P1=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yi,"__esModule",{value:!0});yi.SubscribeBlockTracker=void 0;const D1=P1(Xo),F1=ar,B1=(0,D1.default)();class V1 extends F1.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()}async _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,...n){return new Promise((r,i)=>{this._provider.sendAsync({id:B1(),method:e,params:n,jsonrpc:"2.0"},(s,o)=>{s?i(s):r(o.result)})})}_handleSubData(e,n){var r;n.method==="eth_subscription"&&((r=n.params)===null||r===void 0?void 0:r.subscription)===this._subscriptionId&&this._newPotentialLatest(n.params.result.number)}}yi.SubscribeBlockTracker=V1;var vh={};Object.defineProperty(vh,"__esModule",{value:!0});(function(t){var e=A&&A.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=A&&A.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(ui,t),n(yi,t),n(vh,t)})(Fl);var ya={},vi={},fr={};Object.defineProperty(fr,"__esModule",{value:!0});fr.getUniqueId=void 0;const _h=4294967295;let ho=Math.floor(Math.random()*_h);function H1(){return ho=(ho+1)%_h,ho}fr.getUniqueId=H1;Object.defineProperty(vi,"__esModule",{value:!0});vi.createIdRemapMiddleware=void 0;const W1=fr;function U1(){return(t,e,n,r)=>{const i=t.id,s=W1.getUniqueId();t.id=s,e.id=s,n(o=>{t.id=i,e.id=i,o()})}}vi.createIdRemapMiddleware=U1;var _i={};Object.defineProperty(_i,"__esModule",{value:!0});_i.createAsyncMiddleware=void 0;function z1(t){return async(e,n,r,i)=>{let s;const o=new Promise(l=>{s=l});let a=null,c=!1;const u=async()=>{c=!0,r(l=>{a=l,s()}),await o};try{await t(e,n,u),c?(await o,a(null)):i(null)}catch(l){a?a(l):i(l)}}}_i.createAsyncMiddleware=z1;var wi={};Object.defineProperty(wi,"__esModule",{value:!0});wi.createScaffoldMiddleware=void 0;function q1(t){return(e,n,r,i)=>{const s=t[e.method];return s===void 0?r():typeof s=="function"?s(e,n,r,i):(n.result=s,i())}}wi.createScaffoldMiddleware=q1;var dr={},G1=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(dr,"__esModule",{value:!0});dr.JsonRpcEngine=void 0;const J1=G1(Qt),Fe=rr;class dt extends J1.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,n){if(n&&typeof n!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?n?this._handleBatch(e,n):this._handleBatch(e):n?this._handle(e,n):this._promiseHandle(e)}asMiddleware(){return async(e,n,r,i)=>{try{const[s,o,a]=await dt._runAllMiddleware(e,n,this._middleware);return o?(await dt._runReturnHandlers(a),i(s)):r(async c=>{try{await dt._runReturnHandlers(a)}catch(u){return c(u)}return c()})}catch(s){return i(s)}}}async _handleBatch(e,n){try{const r=await Promise.all(e.map(this._promiseHandle.bind(this)));return n?n(null,r):r}catch(r){if(n)return n(r);throw r}}_promiseHandle(e){return new Promise(n=>{this._handle(e,(r,i)=>{n(i)})})}async _handle(e,n){if(!e||Array.isArray(e)||typeof e!="object"){const o=new Fe.EthereumRpcError(Fe.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return n(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof e.method!="string"){const o=new Fe.EthereumRpcError(Fe.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return n(o,{id:e.id,jsonrpc:"2.0",error:o})}const r=Object.assign({},e),i={id:r.id,jsonrpc:r.jsonrpc};let s=null;try{await this._processRequest(r,i)}catch(o){s=o}return s&&(delete i.result,i.error||(i.error=Fe.serializeError(s))),n(s,i)}async _processRequest(e,n){const[r,i,s]=await dt._runAllMiddleware(e,n,this._middleware);if(dt._checkForCompletion(e,n,i),await dt._runReturnHandlers(s),r)throw r}static async _runAllMiddleware(e,n,r){const i=[];let s=null,o=!1;for(const a of r)if([s,o]=await dt._runMiddleware(e,n,a,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(e,n,r,i){return new Promise(s=>{const o=c=>{const u=c||n.error;u&&(n.error=Fe.serializeError(u)),s([u,!0])},a=c=>{n.error?o(n.error):(c&&(typeof c!="function"&&o(new Fe.EthereumRpcError(Fe.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request:
|
|
4
|
-
${fo(e)}`,{request:e})),i.push(c)),s([null,!1]))};try{r(e,n,a,o)}catch(c){o(c)}})}static async _runReturnHandlers(e){for(const n of e)await new Promise((r,i)=>{n(s=>s?i(s):r())})}static _checkForCompletion(e,n,r){if(!("result"in n)&&!("error"in n))throw new Fe.EthereumRpcError(Fe.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
|
|
5
|
-
${fo(e)}`,{request:e});if(!r)throw new Fe.EthereumRpcError(Fe.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
|
|
6
|
-
${fo(e)}`,{request:e})}}dr.JsonRpcEngine=dt;function fo(t){return JSON.stringify(t,null,2)}var Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.mergeMiddleware=void 0;const Q1=dr;function Z1(t){const e=new Q1.JsonRpcEngine;return t.forEach(n=>e.push(n)),e.asMiddleware()}Si.mergeMiddleware=Z1;(function(t){var e=A&&A.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=A&&A.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(vi,t),n(_i,t),n(wi,t),n(fr,t),n(dr,t),n(Si,t)})(ya);var wh={},va={},jo=function(t,e){return jo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},jo(t,e)};function Sh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");jo(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Ur=function(){return Ur=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ur.apply(this,arguments)};function Eh(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Ch(t,e,n,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}function Ih(t,e){return function(n,r){e(n,r,t)}}function Y1(t,e,n,r,i,s){function o(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var a=r.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!e&&t?r.static?t:t.prototype:null,l=e||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),h,f=!1,d=n.length-1;d>=0;d--){var p={};for(var _ in r)p[_]=_==="access"?{}:r[_];for(var _ in r.access)p.access[_]=r.access[_];p.addInitializer=function(b){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(b||null))};var m=(0,n[d])(a==="accessor"?{get:l.get,set:l.set}:l[c],p);if(a==="accessor"){if(m===void 0)continue;if(m===null||typeof m!="object")throw new TypeError("Object expected");(h=o(m.get))&&(l.get=h),(h=o(m.set))&&(l.set=h),(h=o(m.init))&&i.unshift(h)}else(h=o(m))&&(a==="field"?i.unshift(h):l[c]=h)}u&&Object.defineProperty(u,r.name,l),f=!0}function K1(t,e,n){for(var r=arguments.length>2,i=0;i<e.length;i++)n=r?e[i].call(t,n):e[i].call(t);return r?n:void 0}function X1(t){return typeof t=="symbol"?t:"".concat(t)}function ey(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})}function xh(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function kh(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{u(r.next(l))}catch(h){o(h)}}function c(l){try{u(r.throw(l))}catch(h){o(h)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})}function Rh(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(l){return c([u,l])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(l){u=[6,l],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Ei=Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]};function Mh(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Ei(e,t,n)}function zr(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _a(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}function Ah(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_a(arguments[e]));return t}function Th(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}function Nh(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}function yn(t){return this instanceof yn?(this.v=t,this):new yn(t)}function Oh(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(f){r[f]&&(i[f]=function(d){return new Promise(function(p,_){s.push([f,d,p,_])>1||a(f,d)})})}function a(f,d){try{c(r[f](d))}catch(p){h(s[0][3],p)}}function c(f){f.value instanceof yn?Promise.resolve(f.value.v).then(u,l):h(s[0][2],f)}function u(f){a("next",f)}function l(f){a("throw",f)}function h(f,d){f(d),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Lh(t){var e,n;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=t[i]?function(o){return(n=!n)?{value:yn(t[i](o)),done:!1}:s?s(o):o}:s}}function jh(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof zr=="function"?zr(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function $h(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var ty=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function Ph(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Ei(e,t,n);return ty(e,t),e}function Dh(t){return t&&t.__esModule?t:{default:t}}function Fh(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}function Bh(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="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 r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n}function Vh(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}const ny={__extends:Sh,__assign:Ur,__rest:Eh,__decorate:Ch,__param:Ih,__metadata:xh,__awaiter:kh,__generator:Rh,__createBinding:Ei,__exportStar:Mh,__values:zr,__read:_a,__spread:Ah,__spreadArrays:Th,__spreadArray:Nh,__await:yn,__asyncGenerator:Oh,__asyncDelegator:Lh,__asyncValues:jh,__makeTemplateObject:$h,__importStar:Ph,__importDefault:Dh,__classPrivateFieldGet:Fh,__classPrivateFieldSet:Bh,__classPrivateFieldIn:Vh},ry=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Ur},__asyncDelegator:Lh,__asyncGenerator:Oh,__asyncValues:jh,__await:yn,__awaiter:kh,__classPrivateFieldGet:Fh,__classPrivateFieldIn:Vh,__classPrivateFieldSet:Bh,__createBinding:Ei,__decorate:Ch,__esDecorate:Y1,__exportStar:Mh,__extends:Sh,__generator:Rh,__importDefault:Dh,__importStar:Ph,__makeTemplateObject:$h,__metadata:xh,__param:Ih,__propKey:X1,__read:_a,__rest:Eh,__runInitializers:K1,__setFunctionName:ey,__spread:Ah,__spreadArray:Nh,__spreadArrays:Th,__values:zr,default:ny},Symbol.toStringTag,{value:"Module"})),wa=xn(ry);var Ci={};Object.defineProperty(Ci,"__esModule",{value:!0});var pu=wa,iy=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,n=this.isLocked(),r=new Promise(function(i){return e._queue.push(i)});return n||this._dispatch(),r},t.prototype.runExclusive=function(e){return pu.__awaiter(this,void 0,void 0,function(){var n,r,i;return pu.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:n=s.sent(),r=n[0],i=n[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,e(r)];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,n=this._queue.shift();if(n){var r=!1;this._currentReleaser=function(){r||(r=!0,e._value++,e._dispatch())},n([this._value--,this._currentReleaser])}},t}();Ci.default=iy;Object.defineProperty(va,"__esModule",{value:!0});var bu=wa,sy=Ci,oy=function(){function t(){this._semaphore=new sy.default(1)}return t.prototype.acquire=function(){return bu.__awaiter(this,void 0,void 0,function(){var e,n;return bu.__generator(this,function(r){switch(r.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=r.sent(),n=e[1],[2,n]}})})},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}();va.default=oy;var Ii={};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.withTimeout=void 0;var Ar=wa;function ay(t,e,n){var r=this;return n===void 0&&(n=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return Ar.__awaiter(r,void 0,void 0,function(){var o,a,c;return Ar.__generator(this,function(u){switch(u.label){case 0:return o=!1,setTimeout(function(){o=!0,s(n)},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 Ar.__awaiter(this,void 0,void 0,function(){var s,o;return Ar.__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()}}}Ii.withTimeout=ay;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=va;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var n=Ci;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return n.default}});var r=Ii;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return r.withTimeout}})})(wh);var cy=ly,uy=Object.prototype.hasOwnProperty;function ly(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var r in n)uy.call(n,r)&&(t[r]=n[r])}return t}const hy=cy,fy=Xo();var dy=j;function j(t){const e=this;e.currentProvider=t}j.prototype.getBalance=pr(2,"eth_getBalance");j.prototype.getCode=pr(2,"eth_getCode");j.prototype.getTransactionCount=pr(2,"eth_getTransactionCount");j.prototype.getStorageAt=pr(3,"eth_getStorageAt");j.prototype.call=pr(2,"eth_call");j.prototype.protocolVersion=H("eth_protocolVersion");j.prototype.syncing=H("eth_syncing");j.prototype.coinbase=H("eth_coinbase");j.prototype.mining=H("eth_mining");j.prototype.hashrate=H("eth_hashrate");j.prototype.gasPrice=H("eth_gasPrice");j.prototype.accounts=H("eth_accounts");j.prototype.blockNumber=H("eth_blockNumber");j.prototype.getBlockTransactionCountByHash=H("eth_getBlockTransactionCountByHash");j.prototype.getBlockTransactionCountByNumber=H("eth_getBlockTransactionCountByNumber");j.prototype.getUncleCountByBlockHash=H("eth_getUncleCountByBlockHash");j.prototype.getUncleCountByBlockNumber=H("eth_getUncleCountByBlockNumber");j.prototype.sign=H("eth_sign");j.prototype.sendTransaction=H("eth_sendTransaction");j.prototype.sendRawTransaction=H("eth_sendRawTransaction");j.prototype.estimateGas=H("eth_estimateGas");j.prototype.getBlockByHash=H("eth_getBlockByHash");j.prototype.getBlockByNumber=H("eth_getBlockByNumber");j.prototype.getTransactionByHash=H("eth_getTransactionByHash");j.prototype.getTransactionByBlockHashAndIndex=H("eth_getTransactionByBlockHashAndIndex");j.prototype.getTransactionByBlockNumberAndIndex=H("eth_getTransactionByBlockNumberAndIndex");j.prototype.getTransactionReceipt=H("eth_getTransactionReceipt");j.prototype.getUncleByBlockHashAndIndex=H("eth_getUncleByBlockHashAndIndex");j.prototype.getUncleByBlockNumberAndIndex=H("eth_getUncleByBlockNumberAndIndex");j.prototype.getCompilers=H("eth_getCompilers");j.prototype.compileLLL=H("eth_compileLLL");j.prototype.compileSolidity=H("eth_compileSolidity");j.prototype.compileSerpent=H("eth_compileSerpent");j.prototype.newFilter=H("eth_newFilter");j.prototype.newBlockFilter=H("eth_newBlockFilter");j.prototype.newPendingTransactionFilter=H("eth_newPendingTransactionFilter");j.prototype.uninstallFilter=H("eth_uninstallFilter");j.prototype.getFilterChanges=H("eth_getFilterChanges");j.prototype.getFilterLogs=H("eth_getFilterLogs");j.prototype.getLogs=H("eth_getLogs");j.prototype.getWork=H("eth_getWork");j.prototype.submitWork=H("eth_submitWork");j.prototype.submitHashrate=H("eth_submitHashrate");j.prototype.sendAsync=function(t,e){this.currentProvider.sendAsync(py(t),function(r,i){if(!r&&i.error&&(r=new Error("EthQuery - RPC Error - "+i.error.message)),r)return e(r);e(null,i.result)})};function H(t){return function(){const e=this;var n=[].slice.call(arguments),r=n.pop();e.sendAsync({method:t,params:n},r)}}function pr(t,e){return function(){const n=this;var r=[].slice.call(arguments),i=r.pop();r.length<t&&r.push("latest"),n.sendAsync({method:e,params:r},i)}}function py(t){return hy({id:fy(),jsonrpc:"2.0",params:[]},t)}const gu=(t,e,n,r)=>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===n?r:this,i)})},mu=new WeakMap;var by=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const n=typeof t;if(!(t!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":n}\``);const r=(o,a)=>{let c=mu.get(o);if(c||(c={},mu.set(o,c)),a in c)return c[a];const u=p=>typeof p=="string"||typeof a=="symbol"?a===p:p.test(a),l=Reflect.getOwnPropertyDescriptor(o,a),h=l===void 0||l.writable||l.configurable,d=(e.include?e.include.some(u):!e.exclude.some(u))&&h;return c[a]=d,d},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:gu(o,e,s,o);return i.set(o,l),Reflect.apply(l,a,c)},get(o,a){const c=o[a];if(!r(o,a)||c===Function.prototype[a])return c;const u=i.get(c);if(u)return u;if(typeof c=="function"){const l=gu(c,e,s,o);return i.set(c,l),l}return c}});return s};const gy=Qt.default;let my=class extends gy{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(n=>this.emit("update",n))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var Sa=my;const yy=Sa;let vy=class extends yy{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 _y=vy,br={minBlockRef:wy,maxBlockRef:Sy,sortBlockRefs:Ea,bnToHex:Ey,blockRefIsNumber:Cy,hexToInt:qr,incrementHexInt:Iy,intToHex:Hh,unsafeRandomBytes:xy};function wy(...t){return Ea(t)[0]}function Sy(...t){const e=Ea(t);return e[e.length-1]}function Ea(t){return t.sort((e,n)=>e==="latest"||n==="earliest"?1:n==="latest"||e==="earliest"?-1:qr(e)-qr(n))}function Ey(t){return"0x"+t.toString(16)}function Cy(t){return t&&!["earliest","latest","pending"].includes(t)}function qr(t){return t==null?t:Number.parseInt(t,16)}function Iy(t){if(t==null)return t;const e=qr(t);return Hh(e+1)}function Hh(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function xy(t){let e="0x";for(let n=0;n<t;n++)e+=yu(),e+=yu();return e}function yu(){return Math.floor(Math.random()*16).toString(16)}const ky=dy,Ry=by,My=_y,{bnToHex:y5,hexToInt:Tr,incrementHexInt:Ay,minBlockRef:Ty,blockRefIsNumber:Ny}=br;let Oy=class extends My{constructor({provider:e,params:n}){super(),this.type="log",this.ethQuery=new ky(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},n),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(r=>r.toLowerCase()))}async initialize({currentBlock:e}){let n=this.params.fromBlock;["latest","pending"].includes(n)&&(n=e),n==="earliest"&&(n="0x0"),this.params.fromBlock=n;const r=Ty(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:r}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:n}){const r=n;let i;e?i=Ay(e):i=n;const s=Object.assign({},this.params,{fromBlock:i,toBlock:r}),a=(await this._fetchLogs(s)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(e){return await Ry(r=>this.ethQuery.getLogs(e,r))()}matchLog(e){if(Tr(this.params.fromBlock)>=Tr(e.blockNumber)||Ny(this.params.toBlock)&&Tr(this.params.toBlock)<=Tr(e.blockNumber))return!1;const n=e.address&&e.address.toLowerCase();return this.params.address&&n&&!this.params.address.includes(n)?!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];return a.includes(null)?!0:(a=a.map(l=>l.toLowerCase()),a.includes(o))})}};var Ly=Oy,Ca=jy;async function jy({provider:t,fromBlock:e,toBlock:n}){e||(e=n);const r=vu(e),s=vu(n)-r+1,o=Array(s).fill().map((c,u)=>r+u).map($y);return await Promise.all(o.map(c=>Dy(t,"eth_getBlockByNumber",[c,!1])))}function vu(t){return t==null?t:Number.parseInt(t,16)}function $y(t){return t==null?t:"0x"+t.toString(16)}function Py(t,e){return new Promise((n,r)=>{t.sendAsync(e,(i,s)=>{i?r(i):s.error?r(s.error):s.result?n(s.result):r(new Error("Result was empty"))})})}async function Dy(t,e,n){for(let r=0;r<3;r++)try{return await Py(t,{id:1,jsonrpc:"2.0",method:e,params:n})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}throw new Error(`Block not found for params: ${JSON.stringify(n)}`)}const Fy=Sa,By=Ca,{incrementHexInt:Vy}=br;let Hy=class extends Fy{constructor({provider:e,params:n}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:n}){const r=n,i=Vy(e),o=(await By({provider:this.provider,fromBlock:i,toBlock:r})).map(a=>a.hash);this.addResults(o)}};var Wy=Hy;const Uy=Sa,zy=Ca,{incrementHexInt:qy}=br;let Gy=class extends Uy{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const n=e,r=qy(e),i=await zy({provider:this.provider,fromBlock:r,toBlock:n}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var Jy=Gy;const Qy=wh.Mutex,{createAsyncMiddleware:Zy,createScaffoldMiddleware:Yy}=ya,Ky=Ly,Xy=Wy,ev=Jy,{intToHex:Wh,hexToInt:po}=br;var tv=nv;function nv({blockTracker:t,provider:e}){let n=0,r={};const i=new Qy,s=rv({mutex:i}),o=Yy({eth_newFilter:s(bo(c)),eth_newBlockFilter:s(bo(u)),eth_newPendingTransactionFilter:s(bo(l)),eth_uninstallFilter:s(Pr(d)),eth_getFilterChanges:s(Pr(h)),eth_getFilterLogs:s(Pr(f))}),a=async({oldBlock:y,newBlock:S})=>{if(r.length===0)return;const k=await i.acquire();try{await Promise.all(nn(r).map(async E=>{try{await E.update({oldBlock:y,newBlock:S})}catch(N){console.error(N)}}))}catch(E){console.error(E)}k()};return o.newLogFilter=c,o.newBlockFilter=u,o.newPendingTransactionFilter=l,o.uninstallFilter=d,o.getFilterChanges=h,o.getFilterLogs=f,o.destroy=()=>{m()},o;async function c(y){const S=new Ky({provider:e,params:y});return await p(S),S}async function u(){const y=new Xy({provider:e});return await p(y),y}async function l(){const y=new ev({provider:e});return await p(y),y}async function h(y){const S=po(y),k=r[S];if(!k)throw new Error(`No filter for index "${S}"`);return k.getChangesAndClear()}async function f(y){const S=po(y),k=r[S];if(!k)throw new Error(`No filter for index "${S}"`);let E=[];return k.type==="log"&&(E=k.getAllResults()),E}async function d(y){const S=po(y),E=!!r[S];return E&&await _(S),E}async function p(y){const S=nn(r).length,k=await t.getLatestBlock();await y.initialize({currentBlock:k}),n++,r[n]=y,y.id=n,y.idHex=Wh(n);const E=nn(r).length;return b({prevFilterCount:S,newFilterCount:E}),n}async function _(y){const S=nn(r).length;delete r[y];const k=nn(r).length;b({prevFilterCount:S,newFilterCount:k})}async function m(){const y=nn(r).length;r={},b({prevFilterCount:y,newFilterCount:0})}function b({prevFilterCount:y,newFilterCount:S}){if(y===0&&S>0){t.on("sync",a);return}if(y>0&&S===0){t.removeListener("sync",a);return}}}function bo(t){return Pr(async(...e)=>{const n=await t(...e);return Wh(n.id)})}function Pr(t){return Zy(async(e,n)=>{const r=await t.apply(null,e.params);n.result=r})}function rv({mutex:t}){return e=>async(n,r,i,s)=>{(await t.acquire())(),e(n,r,i,s)}}function nn(t,e){const n=[];for(let r in t)n.push(t[r]);return n}const iv=Qt.default,{createAsyncMiddleware:_u,createScaffoldMiddleware:sv}=ya,ov=tv,{unsafeRandomBytes:av,incrementHexInt:cv}=br,uv=Ca;var lv=hv;function hv({blockTracker:t,provider:e}){const n={},r=ov({blockTracker:t,provider:e});let i=!1;const s=new iv,o=sv({eth_subscribe:_u(a),eth_unsubscribe:_u(c)});return o.destroy=l,{events:s,middleware:o};async function a(h,f){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const d=h.params[0],p=av(16);let _;switch(d){case"newHeads":_=m({subId:p});break;case"logs":const y=h.params[1],S=await r.newLogFilter(y);_=b({subId:p,filter:S});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${d}"`)}n[p]=_,f.result=p;return;function m({subId:y}){const S={type:d,destroy:async()=>{t.removeListener("sync",S.update)},update:async({oldBlock:k,newBlock:E})=>{const N=E,U=cv(k);(await uv({provider:e,fromBlock:U,toBlock:N})).map(fv).filter(q=>q!==null).forEach(q=>{u(y,q)})}};return t.on("sync",S.update),S}function b({subId:y,filter:S}){return S.on("update",E=>u(y,E)),{type:d,destroy:async()=>await r.uninstallFilter(S.idHex)}}}async function c(h,f){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const d=h.params[0],p=n[d];if(!p){f.result=!1;return}delete n[d],await p.destroy(),f.result=!0}function u(h,f){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:h,result:f}})}function l(){s.removeAllListeners();for(const h in n)n[h].destroy(),delete n[h];i=!0}}function fv(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,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(ci,"__esModule",{value:!0});ci.SubscriptionManager=void 0;const dv=Fl,pv=lv,wu=()=>{};class bv{constructor(e){const n=new dv.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:r,middleware:i}=pv({blockTracker:n,provider:e});this.events=r,this.subscriptionMiddleware=i}async handleRequest(e){const n={};return await this.subscriptionMiddleware(e,n,wu,wu),n}destroy(){this.subscriptionMiddleware.destroy()}}ci.SubscriptionManager=bv;var Ia=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(dn,"__esModule",{value:!0});dn.CoinbaseWalletProvider=void 0;const gv=Ia(Qt),mv=Ia(ti),Ee=rr,go=kn,Su=Rn,Eu=Ye,F=x,mo=Ia(Jp),yv=bn,Y=Dl,vv=ci,Cu="DefaultChainId",Iu="DefaultJsonRpcUrl";class _v extends gv.default{constructor(e){var n,r;super(),this._filterPolyfill=new yv.FilterPolyfill(this),this._subscriptionManager=new vv.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this._send=this.send.bind(this),this._sendAsync=this.sendAsync.bind(this),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=(n=e.overrideIsCoinbaseWallet)!==null&&n!==void 0?n:!0,this.isCoinbaseBrowser=(r=e.overrideIsCoinbaseBrowser)!==null&&r!==void 0?r:!1,this.qrUrl=e.qrUrl,this.supportsAddressSwitching=e.supportsAddressSwitching,this.isLedger=e.isLedger;const i=this.getChainId(),s=(0,F.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(Eu.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,F.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,F.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(Iu))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(Iu,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,n){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=n,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,n){this.jsonRpcUrl=e;const r=this.getChainId();this._storage.setItem(Cu,n.toString(10)),((0,F.ensureIntNumber)(n)!==r||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,n,r,i,s,o){return!!(await(await this.initializeRelay()).watchAsset(e,n,r,i,s,o==null?void 0:o.toString()).promise).result}async addEthereumChain(e,n,r,i,s,o){var a,c;if((0,F.ensureIntNumber)(e)===this.getChainId())return!1;const u=await this.initializeRelay(),l=u.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!l&&await u.requestEthereumAccounts().promise;const h=await u.addEthereumChain(e.toString(),n,s,r,i,o).promise;return((a=h.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(n[0],e),((c=h.result)===null||c===void 0?void 0:c.isApproved)===!0}async switchEthereumChain(e){const r=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if(r.errorCode)throw Ee.ethErrors.provider.custom({code:r.errorCode});const i=r.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,n){this.initializeRelay().then(r=>r.setAppInfo(e,n))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(go.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?Su.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this._send(Y.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(e,n){if(typeof e=="string"){const i=e,s=Array.isArray(n)?n:n!==void 0?[n]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof n=="function"){const i=e,s=n;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const r=e;return this._sendRequest(r)}async sendAsync(e,n){if(typeof n!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=n;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const r=n;return this._sendRequestAsync(e).then(i=>r(null,i)).catch(i=>r(i,null))}async request(e){if(!e||typeof e!="object"||Array.isArray(e))throw Ee.ethErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:n,params:r}=e;if(typeof n!="string"||n.length===0)throw Ee.ethErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))throw Ee.ethErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=r===void 0?[]:r,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:n,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){const r=await(await this.initializeRelay()).scanQRCode((0,F.ensureRegExpString)(e)).promise;if(typeof r.result!="string")throw new Error("result was not a string");return r.result}async genericRequest(e,n){const i=await(await this.initializeRelay()).genericRequest(e,n).promise;if(typeof i.result!="string")throw new Error("result was not a string");return i.result}async selectProvider(e){const r=await(await this.initializeRelay()).selectProvider(e).promise;if(typeof r.result!="string")throw new Error("result was not a string");return r.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 n={jsonrpc:"2.0",id:e.id},{method:r}=e;if(n.result=this._handleSynchronousMethods(e),n.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${r} synchronously without a callback. Please provide a callback parameter to call ${r} asynchronously.`);return n}_setAddresses(e,n){if(!Array.isArray(e))throw new Error("addresses is not an array");const r=e.map(i=>(0,F.ensureAddressString)(i));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&this.supportsAddressSwitching===!1&&!n||(this._addresses=r,this.emit("accountsChanged",this._addresses),this._storage.setItem(Eu.LOCAL_STORAGE_ADDRESSES_KEY,r.join(" "))))}_sendRequestAsync(e){return new Promise((n,r)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return n({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(a=>n(Object.assign(Object.assign({},a),{id:e.id}))).catch(a=>r(a));return}const o=this._handleSubscriptionMethods(e);if(o!==void 0){o.then(a=>n({jsonrpc:"2.0",id:e.id,result:a.result})).catch(a=>r(a));return}}catch(i){return r(i)}this._handleAsynchronousMethods(e).then(i=>i&&n(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>r(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(n=>this._sendRequestAsync(n)))}_handleSynchronousMethods(e){const{method:n}=e,r=e.params||[];switch(n){case Y.JSONRPCMethod.eth_accounts:return this._eth_accounts();case Y.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case Y.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(r);case Y.JSONRPCMethod.net_version:return this._net_version();case Y.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:n}=e,r=e.params||[];switch(n){case Y.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case Y.JSONRPCMethod.eth_sign:return this._eth_sign(r);case Y.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(r);case Y.JSONRPCMethod.personal_sign:return this._personal_sign(r);case Y.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(r);case Y.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(r);case Y.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(r);case Y.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(r);case Y.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(r);case Y.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case Y.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(r);case Y.JSONRPCMethod.eth_signTypedData_v4:case Y.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(r);case Y.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(r);case Y.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(r);case Y.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(r);case Y.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(r)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(e){const{method:n}=e,r=e.params||[];switch(n){case Y.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(r);case Y.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case Y.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case Y.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(r);case Y.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(r)}}_handleSubscriptionMethods(e){switch(e.method){case Y.JSONRPCMethod.eth_subscribe:case Y.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const n=(0,F.ensureAddressString)(e);return this._addresses.map(i=>(0,F.ensureAddressString)(i)).includes(n)}catch{}return!1}_ensureKnownAddress(e){var n;if(!this._isKnownAddress(e))throw(n=this.diagnostic)===null||n===void 0||n.log(go.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const n=e.from?(0,F.ensureAddressString)(e.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(n);const r=e.to?(0,F.ensureAddressString)(e.to):null,i=e.value!=null?(0,F.ensureBN)(e.value):new mv.default(0),s=e.data?(0,F.ensureBuffer)(e.data):B.alloc(0),o=e.nonce!=null?(0,F.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,F.ensureBN)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,F.ensureBN)(e.maxFeePerGas):null,u=e.maxPriorityFeePerGas!=null?(0,F.ensureBN)(e.maxPriorityFeePerGas):null,l=e.gas!=null?(0,F.ensureBN)(e.gas):null,h=this.getChainId();return{fromAddress:n,toAddress:r,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:u,gasLimit:l,chainId:h}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Ee.ethErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Ee.ethErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,n,r,i){this._ensureKnownAddress(n);try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumMessage(e,n,r,i).promise).result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?Ee.ethErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,n,r){return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,n,r).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,F.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(Cu);if(!e)return(0,F.ensureIntNumber)(this._chainIdFromOpts);const n=parseInt(e,10);return(0,F.ensureIntNumber)(n)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(go.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?Su.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let n;try{n=await(await this.initializeRelay()).requestEthereumAccounts().promise}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Ee.ethErrors.provider.userRejectedRequest("User denied account authorization"):r}if(!n.result)throw new Error("accounts received is empty");return this._setAddresses(n.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const n=(0,F.ensureAddressString)(e[0]),r=(0,F.ensureBuffer)(e[1]);return this._signEthereumMessage(r,n,!1)}_eth_ecRecover(e){const n=(0,F.ensureBuffer)(e[0]),r=(0,F.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(n,r,!1)}_personal_sign(e){this._requireAuthorization();const n=(0,F.ensureBuffer)(e[0]),r=(0,F.ensureAddressString)(e[1]);return this._signEthereumMessage(n,r,!0)}_personal_ecRecover(e){const n=(0,F.ensureBuffer)(e[0]),r=(0,F.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(n,r,!0)}async _eth_signTransaction(e){this._requireAuthorization();const n=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumTransaction(n).promise).result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Ee.ethErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_sendRawTransaction(e){const n=(0,F.ensureBuffer)(e[0]);return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).submitEthereumTransaction(n,this.getChainId()).promise).result}}async _eth_sendTransaction(e){this._requireAuthorization();const n=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signAndSubmitEthereumTransaction(n).promise).result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Ee.ethErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_signTypedData_v1(e){this._requireAuthorization();const n=(0,F.ensureParsedJSONObject)(e[0]),r=(0,F.ensureAddressString)(e[1]);this._ensureKnownAddress(r);const i=mo.default.hashForSignTypedDataLegacy({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const n=(0,F.ensureAddressString)(e[0]),r=(0,F.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(n);const i=mo.default.hashForSignTypedData_v3({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const n=(0,F.ensureAddressString)(e[0]),r=(0,F.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(n);const i=mo.default.hashForSignTypedData_v4({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _cbwallet_arbitrary(e){const n=e[0],r=e[1];if(typeof r!="string")throw new Error("parameter must be a string");if(typeof n!="object"||n===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(n,r)}}async _wallet_addEthereumChain(e){var n,r,i,s;const o=e[0];if(((n=o.rpcUrls)===null||n===void 0?void 0:n.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 Ee.ethErrors.provider.custom({code:0,message:"chainName is a required field"});if(!o.nativeCurrency)throw Ee.ethErrors.provider.custom({code:0,message:"nativeCurrency is a required field"});const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(r=o.rpcUrls)!==null&&r!==void 0?r:[],(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 n=e[0];return await this.switchEthereumChain(parseInt(n.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const n=Array.isArray(e)?e[0]:e;if(!n.type)throw Ee.ethErrors.rpc.invalidParams({message:"Type is required"});if((n==null?void 0:n.type)!=="ERC20")throw Ee.ethErrors.rpc.invalidParams({message:`Asset of type '${n.type}' is not supported`});if(!(n!=null&&n.options))throw Ee.ethErrors.rpc.invalidParams({message:"Options are required"});if(!(n!=null&&n.options.address))throw Ee.ethErrors.rpc.invalidParams({message:"Address is required"});const r=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=n.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(n.type,i,s,a,o,r)}}_eth_uninstallFilter(e){const n=(0,F.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(n)}async _eth_newFilter(e){const n=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(n)}}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 n=(0,F.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(n)}_eth_getFilterLogs(e){const n=(0,F.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(n)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((n,r)=>this._setAddresses(n,r)),e.setChainCallback((n,r)=>{this.updateProviderInfo(r,parseInt(n,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}dn.CoinbaseWalletProvider=_v;var xi={},ki={},gr,$,Uh,zh,Bt,xu,qh,$o,Gh,Gr={},Jh=[],wv=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ri=Array.isArray;function gt(t,e){for(var n in e)t[n]=e[n];return t}function Qh(t){var e=t.parentNode;e&&e.removeChild(t)}function Po(t,e,n){var r,i,s,o={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?gr.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return qn(t,o,r,i,null)}function qn(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++Uh};return i==null&&$.vnode!=null&&$.vnode(s),s}function Sv(){return{current:null}}function mr(t){return t.children}function Gn(t,e){this.props=t,this.context=e}function Kn(t,e){if(e==null)return t.__?Kn(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Kn(t):null}function Zh(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Zh(t)}}function Do(t){(!t.__d&&(t.__d=!0)&&Bt.push(t)&&!Jr.__r++||xu!==$.debounceRendering)&&((xu=$.debounceRendering)||qh)(Jr)}function Jr(){var t,e,n,r,i,s,o,a;for(Bt.sort($o);t=Bt.shift();)t.__d&&(e=Bt.length,r=void 0,i=void 0,o=(s=(n=t).__v).__e,(a=n.__P)&&(r=[],(i=gt({},s)).__v=s.__v+1,xa(a,s,i,n.__n,a.ownerSVGElement!==void 0,s.__h!=null?[o]:null,r,o??Kn(s),s.__h),nf(r,s),s.__e!=o&&Zh(s)),Bt.length>e&&Bt.sort($o));Jr.__r=0}function Yh(t,e,n,r,i,s,o,a,c,u){var l,h,f,d,p,_,m,b=r&&r.__k||Jh,y=b.length;for(n.__k=[],l=0;l<e.length;l++)if((d=n.__k[l]=(d=e[l])==null||typeof d=="boolean"||typeof d=="function"?null:typeof d=="string"||typeof d=="number"||typeof d=="bigint"?qn(null,d,null,null,d):Ri(d)?qn(mr,{children:d},null,null,null):d.__b>0?qn(d.type,d.props,d.key,d.ref?d.ref:null,d.__v):d)!=null){if(d.__=n,d.__b=n.__b+1,(f=b[l])===null||f&&d.key==f.key&&d.type===f.type)b[l]=void 0;else for(h=0;h<y;h++){if((f=b[h])&&d.key==f.key&&d.type===f.type){b[h]=void 0;break}f=null}xa(t,d,f=f||Gr,i,s,o,a,c,u),p=d.__e,(h=d.ref)&&f.ref!=h&&(m||(m=[]),f.ref&&m.push(f.ref,null,d),m.push(h,d.__c||p,d)),p!=null?(_==null&&(_=p),typeof d.type=="function"&&d.__k===f.__k?d.__d=c=Kh(d,c,t):c=ef(t,d,f,b,p,c),typeof n.type=="function"&&(n.__d=c)):c&&f.__e==c&&c.parentNode!=t&&(c=Kn(f))}for(n.__e=_,l=y;l--;)b[l]!=null&&(typeof n.type=="function"&&b[l].__e!=null&&b[l].__e==n.__d&&(n.__d=tf(r).nextSibling),sf(b[l],b[l]));if(m)for(l=0;l<m.length;l++)rf(m[l],m[++l],m[++l])}function Kh(t,e,n){for(var r,i=t.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=t,e=typeof r.type=="function"?Kh(r,e,n):ef(n,r,r,i,r.__e,e));return e}function Xh(t,e){return e=e||[],t==null||typeof t=="boolean"||(Ri(t)?t.some(function(n){Xh(n,e)}):e.push(t)),e}function ef(t,e,n,r,i,s){var o,a,c;if(e.__d!==void 0)o=e.__d,e.__d=void 0;else if(n==null||i!=s||i.parentNode==null)e:if(s==null||s.parentNode!==t)t.appendChild(i),o=null;else{for(a=s,c=0;(a=a.nextSibling)&&c<r.length;c+=1)if(a==i)break e;t.insertBefore(i,s),o=s}return o!==void 0?o:i.nextSibling}function tf(t){var e,n,r;if(t.type==null||typeof t.type=="string")return t.__e;if(t.__k){for(e=t.__k.length-1;e>=0;e--)if((n=t.__k[e])&&(r=tf(n)))return r}return null}function Ev(t,e,n,r,i){var s;for(s in n)s==="children"||s==="key"||s in e||Qr(t,s,null,n[s],r);for(s in e)i&&typeof e[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||n[s]===e[s]||Qr(t,s,e[s],n[s],r)}function ku(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||wv.test(e)?n:n+"px"}function Qr(t,e,n,r,i){var s;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ku(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||ku(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r||t.addEventListener(e,s?Mu:Ru,s):t.removeEventListener(e,s?Mu:Ru,s);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,n))}}function Ru(t){return this.l[t.type+!1]($.event?$.event(t):t)}function Mu(t){return this.l[t.type+!0]($.event?$.event(t):t)}function xa(t,e,n,r,i,s,o,a,c){var u,l,h,f,d,p,_,m,b,y,S,k,E,N,U,z=e.type;if(e.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,a=e.__e=n.__e,e.__h=null,s=[a]),(u=$.__b)&&u(e);try{e:if(typeof z=="function"){if(m=e.props,b=(u=z.contextType)&&r[u.__c],y=u?b?b.props.value:u.__:r,n.__c?_=(l=e.__c=n.__c).__=l.__E:("prototype"in z&&z.prototype.render?e.__c=l=new z(m,y):(e.__c=l=new Gn(m,y),l.constructor=z,l.render=Iv),b&&b.sub(l),l.props=m,l.state||(l.state={}),l.context=y,l.__n=r,h=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),z.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=gt({},l.__s)),gt(l.__s,z.getDerivedStateFromProps(m,l.__s))),f=l.props,d=l.state,l.__v=e,h)z.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(z.getDerivedStateFromProps==null&&m!==f&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(m,y),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(m,l.__s,y)===!1||e.__v===n.__v){for(e.__v!==n.__v&&(l.props=m,l.state=l.__s,l.__d=!1),l.__e=!1,e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(P){P&&(P.__=e)}),S=0;S<l._sb.length;S++)l.__h.push(l._sb[S]);l._sb=[],l.__h.length&&o.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(m,l.__s,y),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(f,d,p)})}if(l.context=y,l.props=m,l.__P=t,k=$.__r,E=0,"prototype"in z&&z.prototype.render){for(l.state=l.__s,l.__d=!1,k&&k(e),u=l.render(l.props,l.state,l.context),N=0;N<l._sb.length;N++)l.__h.push(l._sb[N]);l._sb=[]}else do l.__d=!1,k&&k(e),u=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++E<25);l.state=l.__s,l.getChildContext!=null&&(r=gt(gt({},r),l.getChildContext())),h||l.getSnapshotBeforeUpdate==null||(p=l.getSnapshotBeforeUpdate(f,d)),Yh(t,Ri(U=u!=null&&u.type===mr&&u.key==null?u.props.children:u)?U:[U],e,n,r,i,s,o,a,c),l.base=e.__e,e.__h=null,l.__h.length&&o.push(l),_&&(l.__E=l.__=null),l.__e=!1}else s==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=Cv(n.__e,e,n,r,i,s,o,c);(u=$.diffed)&&u(e)}catch(P){e.__v=null,(c||s!=null)&&(e.__e=a,e.__h=!!c,s[s.indexOf(a)]=null),$.__e(P,e,n)}}function nf(t,e){$.__c&&$.__c(e,t),t.some(function(n){try{t=n.__h,n.__h=[],t.some(function(r){r.call(n)})}catch(r){$.__e(r,n.__v)}})}function Cv(t,e,n,r,i,s,o,a){var c,u,l,h=n.props,f=e.props,d=e.type,p=0;if(d==="svg"&&(i=!0),s!=null){for(;p<s.length;p++)if((c=s[p])&&"setAttribute"in c==!!d&&(d?c.localName===d:c.nodeType===3)){t=c,s[p]=null;break}}if(t==null){if(d===null)return document.createTextNode(f);t=i?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,f.is&&f),s=null,a=!1}if(d===null)h===f||a&&t.data===f||(t.data=f);else{if(s=s&&gr.call(t.childNodes),u=(h=n.props||Gr).dangerouslySetInnerHTML,l=f.dangerouslySetInnerHTML,!a){if(s!=null)for(h={},p=0;p<t.attributes.length;p++)h[t.attributes[p].name]=t.attributes[p].value;(l||u)&&(l&&(u&&l.__html==u.__html||l.__html===t.innerHTML)||(t.innerHTML=l&&l.__html||""))}if(Ev(t,f,h,i,a),l)e.__k=[];else if(Yh(t,Ri(p=e.props.children)?p:[p],e,n,r,i&&d!=="foreignObject",s,o,s?s[0]:n.__k&&Kn(n,0),a),s!=null)for(p=s.length;p--;)s[p]!=null&&Qh(s[p]);a||("value"in f&&(p=f.value)!==void 0&&(p!==t.value||d==="progress"&&!p||d==="option"&&p!==h.value)&&Qr(t,"value",p,h.value,!1),"checked"in f&&(p=f.checked)!==void 0&&p!==t.checked&&Qr(t,"checked",p,h.checked,!1))}return t}function rf(t,e,n){try{typeof t=="function"?t(e):t.current=e}catch(r){$.__e(r,n)}}function sf(t,e,n){var r,i;if($.unmount&&$.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||rf(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){$.__e(s,e)}r.base=r.__P=null,t.__c=void 0}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&sf(r[i],e,n||typeof t.type!="function");n||t.__e==null||Qh(t.__e),t.__=t.__e=t.__d=void 0}function Iv(t,e,n){return this.constructor(t,n)}function of(t,e,n){var r,i,s;$.__&&$.__(t,e),i=(r=typeof n=="function")?null:n&&n.__k||e.__k,s=[],xa(e,t=(!r&&n||e).__k=Po(mr,null,[t]),i||Gr,Gr,e.ownerSVGElement!==void 0,!r&&n?[n]:i?null:e.firstChild?gr.call(e.childNodes):null,s,!r&&n?n:i?i.__e:e.firstChild,r),nf(s,t)}function af(t,e){of(t,e,af)}function xv(t,e,n){var r,i,s,o,a=gt({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)s=="key"?r=e[s]:s=="ref"?i=e[s]:a[s]=e[s]===void 0&&o!==void 0?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?gr.call(arguments,2):n),qn(t.type,a,r||t.key,i||t.ref,null)}function kv(t,e){var n={__c:e="__cC"+Gh++,__:t,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(a){a.__e=!0,Do(a)})},this.sub=function(o){i.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),a&&a.call(o)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}gr=Jh.slice,$={__e:function(t,e,n,r){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),o=i.__d),o)return i.__E=i}catch(a){t=a}throw t}},Uh=0,zh=function(t){return t!=null&&t.constructor===void 0},Gn.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=gt({},this.state),typeof t=="function"&&(t=t(gt({},n),this.props)),t&>(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Do(this))},Gn.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Do(this))},Gn.prototype.render=mr,Bt=[],qh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,$o=function(t,e){return t.__v.__b-e.__v.__b},Jr.__r=0,Gh=0;const Rv=Object.freeze(Object.defineProperty({__proto__:null,Component:Gn,Fragment:mr,cloneElement:xv,createContext:kv,createElement:Po,createRef:Sv,h:Po,hydrate:af,get isValidElement(){return zh},get options(){return $},render:of,toChildArray:Xh},Symbol.toStringTag,{value:"Module"})),Pe=xn(Rv);function vn(t){return typeof t=="function"}var Au=!1,Be={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;""+e.stack}Au=t},get useDeprecatedSynchronousErrorHandling(){return Au}};function on(t){setTimeout(function(){throw t},0)}var Zr={closed:!0,next:function(t){},error:function(t){if(Be.useDeprecatedSynchronousErrorHandling)throw t;on(t)},complete:function(){}},Me=function(){return Array.isArray||function(t){return t&&typeof t.length=="number"}}();function ka(t){return t!==null&&typeof t=="object"}var Mv=function(){function t(e){return Error.call(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
7
|
-
`+e.map(function(n,r){return r+1+") "+n.toString()}).join(`
|
|
8
|
-
`):"",this.name="UnsubscriptionError",this.errors=e,this}return t.prototype=Object.create(Error.prototype),t}(),Jn=Mv,se=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 n=this,r=n._parentOrParents,i=n._ctorUnsubscribe,s=n._unsubscribe,o=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof t)r.remove(this);else if(r!==null)for(var a=0;a<r.length;++a){var c=r[a];c.remove(this)}if(vn(s)){i&&(this._unsubscribe=void 0);try{s.call(this)}catch(h){e=h instanceof Jn?Tu(h.errors):[h]}}if(Me(o))for(var a=-1,u=o.length;++a<u;){var l=o[a];if(ka(l))try{l.unsubscribe()}catch(f){e=e||[],f instanceof Jn?e=e.concat(Tu(f.errors)):e.push(f)}}if(e)throw new Jn(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||typeof n.unsubscribe!="function")return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;n=new t,n._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=n._parentOrParents;if(i===null)n._parentOrParents=this;else if(i instanceof t){if(i===this)return n;n._parentOrParents=[i,this]}else if(i.indexOf(this)===-1)i.push(this);else return n;var s=this._subscriptions;return s===null?this._subscriptions=[n]:s.push(n),n},t.prototype.remove=function(e){var n=this._subscriptions;if(n){var r=n.indexOf(e);r!==-1&&n.splice(r,1)}},t.EMPTY=function(e){return e.closed=!0,e}(new t),t}();function Tu(t){return t.reduce(function(e,n){return e.concat(n instanceof Jn?n.errors:n)},[])}var Yr=function(){return typeof Symbol=="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),M=function(t){g(e,t);function e(n,r,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=Zr;break;case 1:if(!n){s.destination=Zr;break}if(typeof n=="object"){n instanceof e?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new Nu(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new Nu(s,n,r,i);break}return s}return e.prototype[Yr]=function(){return this},e.create=function(n,r,i){var s=new e(n,r,i);return s.syncErrorThrowable=!1,s},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},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(n){this.destination.next(n)},e.prototype._error=function(n){this.destination.error(n),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var n=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=n,this},e}(se),Nu=function(t){g(e,t);function e(n,r,i,s){var o=t.call(this)||this;o._parentSubscriber=n;var a,c=o;return vn(r)?a=r:r&&(a=r.next,i=r.error,s=r.complete,r!==Zr&&(c=Object.create(r),vn(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(n){if(!this.isStopped&&this._next){var r=this._parentSubscriber;!Be.useDeprecatedSynchronousErrorHandling||!r.syncErrorThrowable?this.__tryOrUnsub(this._next,n):this.__tryOrSetError(r,this._next,n)&&this.unsubscribe()}},e.prototype.error=function(n){if(!this.isStopped){var r=this._parentSubscriber,i=Be.useDeprecatedSynchronousErrorHandling;if(this._error)!i||!r.syncErrorThrowable?(this.__tryOrUnsub(this._error,n),this.unsubscribe()):(this.__tryOrSetError(r,this._error,n),this.unsubscribe());else if(r.syncErrorThrowable)i?(r.syncErrorValue=n,r.syncErrorThrown=!0):on(n),this.unsubscribe();else{if(this.unsubscribe(),i)throw n;on(n)}}},e.prototype.complete=function(){var n=this;if(!this.isStopped){var r=this._parentSubscriber;if(this._complete){var i=function(){return n._complete.call(n._context)};!Be.useDeprecatedSynchronousErrorHandling||!r.syncErrorThrowable?(this.__tryOrUnsub(i),this.unsubscribe()):(this.__tryOrSetError(r,i),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(n,r){try{n.call(this._context,r)}catch(i){if(this.unsubscribe(),Be.useDeprecatedSynchronousErrorHandling)throw i;on(i)}},e.prototype.__tryOrSetError=function(n,r,i){if(!Be.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{r.call(this._context,i)}catch(s){return Be.useDeprecatedSynchronousErrorHandling?(n.syncErrorValue=s,n.syncErrorThrown=!0,!0):(on(s),!0)}return!1},e.prototype._unsubscribe=function(){var n=this._parentSubscriber;this._context=null,this._parentSubscriber=null,n.unsubscribe()},e}(M);function Ra(t){for(;t;){var e=t,n=e.closed,r=e.destination,i=e.isStopped;if(n||i)return!1;r&&r instanceof M?t=r:t=null}return!0}function Av(t,e,n){if(t){if(t instanceof M)return t;if(t[Yr])return t[Yr]()}return!t&&!e&&!n?new M(Zr):new M(t,e,n)}var On=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function At(t){return t}function Fo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cf(t)}function cf(t){return t.length===0?At:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var V=function(){function t(e){this._isScalar=!1,e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this.operator,s=Av(e,n,r);if(i?s.add(i.call(s,this.source)):s.add(this.source||Be.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),Be.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){Be.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=n),Ra(e)?e.error(n):console.warn(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Ou(n),new n(function(i,s){var o;o=r.subscribe(function(a){try{e(a)}catch(c){s(c),o&&o.unsubscribe()}},s,i)})},t.prototype._subscribe=function(e){var n=this.source;return n&&n.subscribe(e)},t.prototype[On]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.length===0?this:cf(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Ou(e),new e(function(r,i){var s;n.subscribe(function(o){return s=o},function(o){return i(o)},function(){return r(s)})})},t.create=function(e){return new t(e)},t}();function Ou(t){if(t||(t=Be.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var Tv=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),xt=Tv,uf=function(t){g(e,t);function e(n,r){var i=t.call(this)||this;return i.subject=n,i.subscriber=r,i.closed=!1,i}return e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var n=this.subject,r=n.observers;if(this.subject=null,!(!r||r.length===0||n.isStopped||n.closed)){var i=r.indexOf(this.subscriber);i!==-1&&r.splice(i,1)}}},e}(se),lf=function(t){g(e,t);function e(n){var r=t.call(this,n)||this;return r.destination=n,r}return e}(M),ye=function(t){g(e,t);function e(){var n=t.call(this)||this;return n.observers=[],n.closed=!1,n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype[Yr]=function(){return new lf(this)},e.prototype.lift=function(n){var r=new Lu(this,this);return r.operator=n,r},e.prototype.next=function(n){if(this.closed)throw new xt;if(!this.isStopped)for(var r=this.observers,i=r.length,s=r.slice(),o=0;o<i;o++)s[o].next(n)},e.prototype.error=function(n){if(this.closed)throw new xt;this.hasError=!0,this.thrownError=n,this.isStopped=!0;for(var r=this.observers,i=r.length,s=r.slice(),o=0;o<i;o++)s[o].error(n);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new xt;this.isStopped=!0;for(var n=this.observers,r=n.length,i=n.slice(),s=0;s<r;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(n){if(this.closed)throw new xt;return t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){if(this.closed)throw new xt;return this.hasError?(n.error(this.thrownError),se.EMPTY):this.isStopped?(n.complete(),se.EMPTY):(this.observers.push(n),new uf(this,n))},e.prototype.asObservable=function(){var n=new V;return n.source=this,n},e.create=function(n,r){return new Lu(n,r)},e}(V),Lu=function(t){g(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r=this.destination;r&&r.next&&r.next(n)},e.prototype.error=function(n){var r=this.destination;r&&r.error&&this.destination.error(n)},e.prototype.complete=function(){var n=this.destination;n&&n.complete&&this.destination.complete()},e.prototype._subscribe=function(n){var r=this.source;return r?this.source.subscribe(n):se.EMPTY},e}(ye);function Ma(){return function(e){return e.lift(new Nv(e))}}var Nv=function(){function t(e){this.connectable=e}return t.prototype.call=function(e,n){var r=this.connectable;r._refCount++;var i=new Ov(e,r),s=n.subscribe(i);return i.closed||(i.connection=r.connect()),s},t}(),Ov=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.connectable=r,i}return e.prototype._unsubscribe=function(){var n=this.connectable;if(!n){this.connection=null;return}this.connectable=null;var r=n._refCount;if(r<=0){this.connection=null;return}if(n._refCount=r-1,r>1){this.connection=null;return}var i=this.connection,s=n._connection;this.connection=null,s&&(!i||s===i)&&s.unsubscribe()},e}(M),hf=function(t){g(e,t);function e(n,r){var i=t.call(this)||this;return i.source=n,i.subjectFactory=r,i._refCount=0,i._isComplete=!1,i}return e.prototype._subscribe=function(n){return this.getSubject().subscribe(n)},e.prototype.getSubject=function(){var n=this._subject;return(!n||n.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var n=this._connection;return n||(this._isComplete=!1,n=this._connection=new se,n.add(this.source.subscribe(new jv(this.getSubject(),this))),n.closed&&(this._connection=null,n=se.EMPTY)),n},e.prototype.refCount=function(){return Ma()(this)},e}(V),Lv=function(){var t=hf.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}}}(),jv=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.connectable=r,i}return e.prototype._error=function(n){this._unsubscribe(),t.prototype._error.call(this,n)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var n=this.connectable;if(n){this.connectable=null;var r=n._connection;n._refCount=0,n._subject=null,n._connection=null,r&&r.unsubscribe()}},e}(lf);function $v(t,e,n,r){return function(i){return i.lift(new Pv(t,e,n,r))}}var Pv=function(){function t(e,n,r,i){this.keySelector=e,this.elementSelector=n,this.durationSelector=r,this.subjectSelector=i}return t.prototype.call=function(e,n){return n.subscribe(new Dv(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),Dv=function(t){g(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;return a.keySelector=r,a.elementSelector=i,a.durationSelector=s,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return e.prototype._next=function(n){var r;try{r=this.keySelector(n)}catch(i){this.error(i);return}this._group(n,r)},e.prototype._group=function(n,r){var i=this.groups;i||(i=this.groups=new Map);var s=i.get(r),o;if(this.elementSelector)try{o=this.elementSelector(n)}catch(u){this.error(u)}else o=n;if(!s){s=this.subjectSelector?this.subjectSelector():new ye,i.set(r,s);var a=new Bo(r,s,this);if(this.destination.next(a),this.durationSelector){var c=void 0;try{c=this.durationSelector(new Bo(r,s))}catch(u){this.error(u);return}this.add(c.subscribe(new Fv(r,s,this)))}}s.closed||s.next(o)},e.prototype._error=function(n){var r=this.groups;r&&(r.forEach(function(i,s){i.error(n)}),r.clear()),this.destination.error(n)},e.prototype._complete=function(){var n=this.groups;n&&(n.forEach(function(r,i){r.complete()}),n.clear()),this.destination.complete()},e.prototype.removeGroup=function(n){this.groups.delete(n)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,this.count===0&&t.prototype.unsubscribe.call(this))},e}(M),Fv=function(t){g(e,t);function e(n,r,i){var s=t.call(this,r)||this;return s.key=n,s.group=r,s.parent=i,s}return e.prototype._next=function(n){this.complete()},e.prototype._unsubscribe=function(){var n=this,r=n.parent,i=n.key;this.key=this.parent=null,r&&r.removeGroup(i)},e}(M),Bo=function(t){g(e,t);function e(n,r,i){var s=t.call(this)||this;return s.key=n,s.groupSubject=r,s.refCountSubscription=i,s}return e.prototype._subscribe=function(n){var r=new se,i=this,s=i.refCountSubscription,o=i.groupSubject;return s&&!s.closed&&r.add(new Bv(s)),r.add(o.subscribe(n)),r},e}(V),Bv=function(t){g(e,t);function e(n){var r=t.call(this)||this;return r.parent=n,n.count++,r}return e.prototype.unsubscribe=function(){var n=this.parent;!n.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),n.count-=1,n.count===0&&n.attemptedToUnsubscribe&&n.unsubscribe())},e}(se),ff=function(t){g(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return r&&!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new xt;return this._value},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(ye),Vv=function(t){g(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(se),yr=function(t){g(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){if(r===void 0&&(r=0),this.closed)return this;this.state=n;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,r)),this.pending=!0,this.delay=r,this.id=this.id||this.requestAsyncId(s,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!==null&&this.delay===i&&this.pending===!1)return r;clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,s=void 0;try{this.work(n)}catch(o){i=!0,s=!!o&&o||new Error(o)}if(i)return this.unsubscribe(),s},e.prototype._unsubscribe=function(){var n=this.id,r=this.scheduler,i=r.actions,s=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,s!==-1&&i.splice(s,1),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null},e}(Vv),Hv=function(t){g(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i}return e.prototype.schedule=function(n,r){return r===void 0&&(r=0),r>0?t.prototype.schedule.call(this,n,r):(this.delay=r,this.state=n,this.scheduler.flush(this),this)},e.prototype.execute=function(n,r){return r>0||this.closed?t.prototype.execute.call(this,n,r):this._execute(n,r)},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0?t.prototype.requestAsyncId.call(this,n,r,i):n.flush(this)},e}(yr),Vo=function(){function t(e,n){n===void 0&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.SchedulerAction(this,e).schedule(r,n)},t.now=function(){return Date.now()},t}(),vr=function(t){g(e,t);function e(n,r){r===void 0&&(r=Vo.now);var i=t.call(this,n,function(){return e.delegate&&e.delegate!==i?e.delegate.now():r()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return e.prototype.schedule=function(n,r,i){return r===void 0&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},e.prototype.flush=function(n){var r=this.actions;if(this.active){r.push(n);return}var i;this.active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this.active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(Vo),Wv=function(t){g(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(vr),df=new Wv(Hv),pf=df,_n=new V(function(t){return t.complete()});function Ln(t){return t?Uv(t):_n}function Uv(t){return new V(function(e){return t.schedule(function(){return e.complete()})})}function $e(t){return t&&typeof t.schedule=="function"}var bf=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}};function Aa(t,e){return new V(function(n){var r=new se,i=0;return r.add(e.schedule(function(){if(i===t.length){n.complete();return}n.next(t[i++]),n.closed||r.add(this.schedule())})),r})}function _r(t,e){return e?Aa(t,e):new V(bf(t))}function Mi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return $e(n)?(t.pop(),Aa(t,n)):_r(t)}function Ta(t,e){return e?new V(function(n){return e.schedule(zv,0,{error:t,subscriber:n})}):new V(function(n){return n.error(t)})}function zv(t){var e=t.error,n=t.subscriber;n.error(e)}var Ho;Ho||(Ho={});var mt=function(){function t(e,n,r){this.kind=e,this.value=n,this.error=r,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,n,r){var i=this.kind;switch(i){case"N":return e&&e(this.value);case"E":return n&&n(this.error);case"C":return r&&r()}},t.prototype.accept=function(e,n,r){return e&&typeof e.next=="function"?this.observe(e):this.do(e,n,r)},t.prototype.toObservable=function(){var e=this.kind;switch(e){case"N":return Mi(this.value);case"E":return Ta(this.error);case"C":return Ln()}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 qv(t,e){return e===void 0&&(e=0),function(r){return r.lift(new Gv(t,e))}}var Gv=function(){function t(e,n){n===void 0&&(n=0),this.scheduler=e,this.delay=n}return t.prototype.call=function(e,n){return n.subscribe(new gf(e,this.scheduler,this.delay))},t}(),gf=function(t){g(e,t);function e(n,r,i){i===void 0&&(i=0);var s=t.call(this,n)||this;return s.scheduler=r,s.delay=i,s}return e.dispatch=function(n){var r=n.notification,i=n.destination;r.observe(i),this.unsubscribe()},e.prototype.scheduleMessage=function(n){var r=this.destination;r.add(this.scheduler.schedule(e.dispatch,this.delay,new Jv(n,this.destination)))},e.prototype._next=function(n){this.scheduleMessage(mt.createNext(n))},e.prototype._error=function(n){this.scheduleMessage(mt.createError(n)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(mt.createComplete()),this.unsubscribe()},e}(M),Jv=function(){function t(e,n){this.notification=e,this.destination=n}return t}(),Na=function(t){g(e,t);function e(n,r,i){n===void 0&&(n=Number.POSITIVE_INFINITY),r===void 0&&(r=Number.POSITIVE_INFINITY);var s=t.call(this)||this;return s.scheduler=i,s._events=[],s._infiniteTimeWindow=!1,s._bufferSize=n<1?1:n,s._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(s._infiniteTimeWindow=!0,s.next=s.nextInfiniteTimeWindow):s.next=s.nextTimeWindow,s}return e.prototype.nextInfiniteTimeWindow=function(n){if(!this.isStopped){var r=this._events;r.push(n),r.length>this._bufferSize&&r.shift()}t.prototype.next.call(this,n)},e.prototype.nextTimeWindow=function(n){this.isStopped||(this._events.push(new Qv(this._getNow(),n)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){var r=this._infiniteTimeWindow,i=r?this._events:this._trimBufferThenGetEvents(),s=this.scheduler,o=i.length,a;if(this.closed)throw new xt;if(this.isStopped||this.hasError?a=se.EMPTY:(this.observers.push(n),a=new uf(this,n)),s&&n.add(n=new gf(n,s)),r)for(var c=0;c<o&&!n.closed;c++)n.next(i[c]);else for(var c=0;c<o&&!n.closed;c++)n.next(i[c].value);return this.hasError?n.error(this.thrownError):this.isStopped&&n.complete(),a},e.prototype._getNow=function(){return(this.scheduler||pf).now()},e.prototype._trimBufferThenGetEvents=function(){for(var n=this._getNow(),r=this._bufferSize,i=this._windowTime,s=this._events,o=s.length,a=0;a<o&&!(n-s[a].time<i);)a++;return o>r&&(a=Math.max(a,o-r)),a>0&&s.splice(0,a),s},e}(ye),Qv=function(){function t(e,n){this.time=e,this.value=n}return t}(),jn=function(t){g(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.value=null,n.hasNext=!1,n.hasCompleted=!1,n}return e.prototype._subscribe=function(n){return this.hasError?(n.error(this.thrownError),se.EMPTY):this.hasCompleted&&this.hasNext?(n.next(this.value),n.complete(),se.EMPTY):t.prototype._subscribe.call(this,n)},e.prototype.next=function(n){this.hasCompleted||(this.value=n,this.hasNext=!0)},e.prototype.error=function(n){this.hasCompleted||t.prototype.error.call(this,n)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(ye),Zv=1,Yv=function(){return Promise.resolve()}(),Wo={};function ju(t){return t in Wo?(delete Wo[t],!0):!1}var $u={setImmediate:function(t){var e=Zv++;return Wo[e]=!0,Yv.then(function(){return ju(e)&&t()}),e},clearImmediate:function(t){ju(t)}},Kv=function(t){g(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i}return e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,n,r,i):(n.actions.push(this),n.scheduled||(n.scheduled=$u.setImmediate(n.flush.bind(n,null))))},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,n,r,i);n.actions.length===0&&($u.clearImmediate(r),n.scheduled=void 0)},e}(yr),Xv=function(t){g(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(n){this.active=!0,this.scheduled=void 0;var r=this.actions,i,s=-1,o=r.length;n=n||r.shift();do if(i=n.execute(n.state,n.delay))break;while(++s<o&&(n=r.shift()));if(this.active=!1,i){for(;++s<o&&(n=r.shift());)n.unsubscribe();throw i}},e}(vr),mf=new Xv(Kv),Dr=mf,yf=new vr(yr),Ae=yf,e_=function(t){g(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i}return e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,n,r,i):(n.actions.push(this),n.scheduled||(n.scheduled=requestAnimationFrame(function(){return n.flush(null)})))},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,n,r,i);n.actions.length===0&&(cancelAnimationFrame(r),n.scheduled=void 0)},e}(yr),t_=function(t){g(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(n){this.active=!0,this.scheduled=void 0;var r=this.actions,i,s=-1,o=r.length;n=n||r.shift();do if(i=n.execute(n.state,n.delay))break;while(++s<o&&(n=r.shift()));if(this.active=!1,i){for(;++s<o&&(n=r.shift());)n.unsubscribe();throw i}},e}(vr),vf=new t_(e_),n_=vf,r_=function(t){g(e,t);function e(n,r){n===void 0&&(n=_f),r===void 0&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,n,function(){return i.frame})||this;return i.maxFrames=r,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var n=this,r=n.actions,i=n.maxFrames,s,o;(o=r[0])&&o.delay<=i&&(r.shift(),this.frame=o.delay,!(s=o.execute(o.state,o.delay))););if(s){for(;o=r.shift();)o.unsubscribe();throw s}},e.frameTimeFactor=10,e}(vr),_f=function(t){g(e,t);function e(n,r,i){i===void 0&&(i=n.index+=1);var s=t.call(this,n,r)||this;return s.scheduler=n,s.work=r,s.index=i,s.active=!0,s.index=n.index=i,s}return e.prototype.schedule=function(n,r){if(r===void 0&&(r=0),!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)},e.prototype.requestAsyncId=function(n,r,i){i===void 0&&(i=0),this.delay=n.frame+i;var s=n.actions;return s.push(this),s.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(n,r,i){},e.prototype._execute=function(n,r){if(this.active===!0)return t.prototype._execute.call(this,n,r)},e.sortActions=function(n,r){return n.delay===r.delay?n.index===r.index?0:n.index>r.index?1:-1:n.delay>r.delay?1:-1},e}(yr);function st(){}function i_(t){return!!t&&(t instanceof V||typeof t.lift=="function"&&typeof t.subscribe=="function")}var s_=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}(),wn=s_,o_=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}(),wr=o_,a_=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}(),wf=a_;function ze(t,e){return function(r){if(typeof t!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new c_(t,e))}}var c_=function(){function t(e,n){this.project=e,this.thisArg=n}return t.prototype.call=function(e,n){return n.subscribe(new u_(e,this.project,this.thisArg))},t}(),u_=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.project=r,s.count=0,s.thisArg=i||s,s}return e.prototype._next=function(n){var r;try{r=this.project.call(this.thisArg,n,this.count++)}catch(i){this.destination.error(i);return}this.destination.next(r)},e}(M);function Sf(t,e,n){if(e)if($e(e))n=e;else return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return Sf(t,n).apply(void 0,r).pipe(ze(function(s){return Me(s)?e.apply(void 0,s):e(s)}))};return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s=this,o,a={context:s,subject:o,callbackFunc:t,scheduler:n};return new V(function(c){if(n){var l={args:r,subscriber:c,params:a};return n.schedule(l_,0,l)}else{if(!o){o=new jn;var u=function(){for(var h=[],f=0;f<arguments.length;f++)h[f]=arguments[f];o.next(h.length<=1?h[0]:h),o.complete()};try{t.apply(s,r.concat([u]))}catch(h){Ra(o)?o.error(h):console.warn(h)}}return o.subscribe(c)}})}}function l_(t){var e=this,n=t.args,r=t.subscriber,i=t.params,s=i.callbackFunc,o=i.context,a=i.scheduler,c=i.subject;if(!c){c=i.subject=new jn;var u=function(){for(var l=[],h=0;h<arguments.length;h++)l[h]=arguments[h];var f=l.length<=1?l[0]:l;e.add(a.schedule(h_,0,{value:f,subject:c}))};try{s.apply(o,n.concat([u]))}catch(l){c.error(l)}}this.add(c.subscribe(r))}function h_(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function Ef(t,e,n){if(e)if($e(e))n=e;else return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return Ef(t,n).apply(void 0,r).pipe(ze(function(s){return Me(s)?e.apply(void 0,s):e(s)}))};return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s={subject:void 0,args:r,callbackFunc:t,scheduler:n,context:this};return new V(function(o){var a=s.context,c=s.subject;if(n)return n.schedule(f_,0,{params:s,subscriber:o,context:a});if(!c){c=s.subject=new jn;var u=function(){for(var l=[],h=0;h<arguments.length;h++)l[h]=arguments[h];var f=l.shift();if(f){c.error(f);return}c.next(l.length<=1?l[0]:l),c.complete()};try{t.apply(a,r.concat([u]))}catch(l){Ra(c)?c.error(l):console.warn(l)}}return c.subscribe(o)})}}function f_(t){var e=this,n=t.params,r=t.subscriber,i=t.context,s=n.callbackFunc,o=n.args,a=n.scheduler,c=n.subject;if(!c){c=n.subject=new jn;var u=function(){for(var l=[],h=0;h<arguments.length;h++)l[h]=arguments[h];var f=l.shift();if(f)e.add(a.schedule(Pu,0,{err:f,subject:c}));else{var d=l.length<=1?l[0]:l;e.add(a.schedule(d_,0,{value:d,subject:c}))}};try{s.apply(i,o.concat([u]))}catch(l){this.add(a.schedule(Pu,0,{err:l,subject:c}))}}this.add(c.subscribe(r))}function d_(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function Pu(t){var e=t.err,n=t.subject;n.error(e)}var Kt=function(t){g(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(n,r,i,s,o){this.destination.next(r)},e.prototype.notifyError=function(n,r){this.destination.error(n)},e.prototype.notifyComplete=function(n){this.destination.complete()},e}(M),p_=function(t){g(e,t);function e(n,r,i){var s=t.call(this)||this;return s.parent=n,s.outerValue=r,s.outerIndex=i,s.index=0,s}return e.prototype._next=function(n){this.parent.notifyNext(this.outerValue,n,this.outerIndex,this.index++,this)},e.prototype._error=function(n){this.parent.notifyError(n,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(M),b_=function(t){return function(e){return t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,on),e}};function g_(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Tt=g_(),m_=function(t){return function(e){var n=t[Tt]();do{var r=void 0;try{r=n.next()}catch(i){return e.error(i),e}if(r.done){e.complete();break}if(e.next(r.value),e.closed)break}while(!0);return typeof n.return=="function"&&e.add(function(){n.return&&n.return()}),e}},y_=function(t){return function(e){var n=t[On]();if(typeof n.subscribe!="function")throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)}},Cf=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function If(t){return!!t&&typeof t.subscribe!="function"&&typeof t.then=="function"}var Xn=function(t){if(t&&typeof t[On]=="function")return y_(t);if(Cf(t))return bf(t);if(If(t))return b_(t);if(t&&typeof t[Tt]=="function")return m_(t);var e=ka(t)?"an invalid object":"'"+t+"'",n="You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(n)};function yt(t,e,n,r,i){if(i===void 0&&(i=new p_(t,n,r)),!i.closed)return e instanceof V?e.subscribe(i):Xn(e)(i)}var Du={};function v_(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=void 0,r=void 0;return $e(t[t.length-1])&&(r=t.pop()),typeof t[t.length-1]=="function"&&(n=t.pop()),t.length===1&&Me(t[0])&&(t=t[0]),_r(t,r).lift(new Oa(n))}var Oa=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new __(e,this.resultSelector))},t}(),__=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.resultSelector=r,i.active=0,i.values=[],i.observables=[],i}return e.prototype._next=function(n){this.values.push(Du),this.observables.push(n)},e.prototype._complete=function(){var n=this.observables,r=n.length;if(r===0)this.destination.complete();else{this.active=r,this.toRespond=r;for(var i=0;i<r;i++){var s=n[i];this.add(yt(this,s,void 0,i))}}},e.prototype.notifyComplete=function(n){(this.active-=1)===0&&this.destination.complete()},e.prototype.notifyNext=function(n,r,i){var s=this.values,o=s[i],a=this.toRespond?o===Du?--this.toRespond:this.toRespond:0;s[i]=r,a===0&&(this.resultSelector?this._tryResultSelector(s):this.destination.next(s.slice()))},e.prototype._tryResultSelector=function(n){var r;try{r=this.resultSelector.apply(this,n)}catch(i){this.destination.error(i);return}this.destination.next(r)},e}(Kt);function w_(t,e){return new V(function(n){var r=new se;return r.add(e.schedule(function(){var i=t[On]();r.add(i.subscribe({next:function(s){r.add(e.schedule(function(){return n.next(s)}))},error:function(s){r.add(e.schedule(function(){return n.error(s)}))},complete:function(){r.add(e.schedule(function(){return n.complete()}))}}))})),r})}function S_(t,e){return new V(function(n){var r=new se;return r.add(e.schedule(function(){return t.then(function(i){r.add(e.schedule(function(){n.next(i),r.add(e.schedule(function(){return n.complete()}))}))},function(i){r.add(e.schedule(function(){return n.error(i)}))})})),r})}function E_(t,e){if(!t)throw new Error("Iterable cannot be null");return new V(function(n){var r=new se,i;return r.add(function(){i&&typeof i.return=="function"&&i.return()}),r.add(e.schedule(function(){i=t[Tt](),r.add(e.schedule(function(){if(!n.closed){var s,o;try{var a=i.next();s=a.value,o=a.done}catch(c){n.error(c);return}o?n.complete():(n.next(s),this.schedule())}}))})),r})}function C_(t){return t&&typeof t[On]=="function"}function I_(t){return t&&typeof t[Tt]=="function"}function xf(t,e){if(t!=null){if(C_(t))return w_(t,e);if(If(t))return S_(t,e);if(Cf(t))return Aa(t,e);if(I_(t)||typeof t=="string")return E_(t,e)}throw new TypeError((t!==null&&typeof t||t)+" is not observable")}function _t(t,e){return e?xf(t,e):t instanceof V?t:new V(Xn(t))}var oe=function(t){g(e,t);function e(n){var r=t.call(this)||this;return r.parent=n,r}return e.prototype._next=function(n){this.parent.notifyNext(n)},e.prototype._error=function(n){this.parent.notifyError(n),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(M),ae=function(t){g(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(n){this.destination.next(n)},e.prototype.notifyError=function(n){this.destination.error(n)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(M);function ce(t,e){if(!e.closed){if(t instanceof V)return t.subscribe(e);var n;try{n=Xn(t)(e)}catch(r){e.error(r)}return n}}function Gt(t,e,n){return n===void 0&&(n=Number.POSITIVE_INFINITY),typeof e=="function"?function(r){return r.pipe(Gt(function(i,s){return _t(t(i,s)).pipe(ze(function(o,a){return e(i,o,s,a)}))},n))}:(typeof e=="number"&&(n=e),function(r){return r.lift(new x_(t,n))})}var x_=function(){function t(e,n){n===void 0&&(n=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=n}return t.prototype.call=function(e,n){return n.subscribe(new k_(e,this.project,this.concurrent))},t}(),k_=function(t){g(e,t);function e(n,r,i){i===void 0&&(i=Number.POSITIVE_INFINITY);var s=t.call(this,n)||this;return s.project=r,s.concurrent=i,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return e.prototype._next=function(n){this.active<this.concurrent?this._tryNext(n):this.buffer.push(n)},e.prototype._tryNext=function(n){var r,i=this.index++;try{r=this.project(n,i)}catch(s){this.destination.error(s);return}this.active++,this._innerSub(r)},e.prototype._innerSub=function(n){var r=new oe(this),i=this.destination;i.add(r);var s=ce(n,r);s!==r&&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(n){this.destination.next(n)},e.prototype.notifyComplete=function(){var n=this.buffer;this.active--,n.length>0?this._next(n.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},e}(ae),R_=Gt;function La(t){return t===void 0&&(t=Number.POSITIVE_INFINITY),Gt(At,t)}function kf(){return La(1)}function er(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return kf()(Mi.apply(void 0,t))}function ja(t){return new V(function(e){var n;try{n=t()}catch(i){e.error(i);return}var r=n?_t(n):Ln();return r.subscribe(e)})}function M_(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1){var n=t[0];if(Me(n))return Nr(n,null);if(ka(n)&&Object.getPrototypeOf(n)===Object.prototype){var r=Object.keys(n);return Nr(r.map(function(s){return n[s]}),r)}}if(typeof t[t.length-1]=="function"){var i=t.pop();return t=t.length===1&&Me(t[0])?t[0]:t,Nr(t,null).pipe(ze(function(s){return i.apply(void 0,s)}))}return Nr(t,null)}function Nr(t,e){return new V(function(n){var r=t.length;if(r===0){n.complete();return}for(var i=new Array(r),s=0,o=0,a=function(u){var l=_t(t[u]),h=!1;n.add(l.subscribe({next:function(f){h||(h=!0,o++),i[u]=f},error:function(f){return n.error(f)},complete:function(){s++,(s===r||!h)&&(o===r&&n.next(e?e.reduce(function(f,d,p){return f[d]=i[p],f},{}):i),n.complete())}}))},c=0;c<r;c++)a(c)})}function Rf(t,e,n,r){return vn(n)&&(r=n,n=void 0),r?Rf(t,e,n).pipe(ze(function(i){return Me(i)?r.apply(void 0,i):r(i)})):new V(function(i){function s(o){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(o)}Mf(t,e,s,i,n)})}function Mf(t,e,n,r,i){var s;if(N_(t)){var o=t;t.addEventListener(e,n,i),s=function(){return o.removeEventListener(e,n,i)}}else if(T_(t)){var a=t;t.on(e,n),s=function(){return a.off(e,n)}}else if(A_(t)){var c=t;t.addListener(e,n),s=function(){return c.removeListener(e,n)}}else if(t&&t.length)for(var u=0,l=t.length;u<l;u++)Mf(t[u],e,n,r,i);else throw new TypeError("Invalid event target");r.add(s)}function A_(t){return t&&typeof t.addListener=="function"&&typeof t.removeListener=="function"}function T_(t){return t&&typeof t.on=="function"&&typeof t.off=="function"}function N_(t){return t&&typeof t.addEventListener=="function"&&typeof t.removeEventListener=="function"}function Af(t,e,n){return n?Af(t,e).pipe(ze(function(r){return Me(r)?n.apply(void 0,r):n(r)})):new V(function(r){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return r.next(o.length===1?o[0]:o)},s;try{s=t(i)}catch(o){r.error(o);return}if(vn(e))return function(){return e(i,s)}})}function O_(t,e,n,r,i){var s,o;if(arguments.length==1){var a=t;o=a.initialState,e=a.condition,n=a.iterate,s=a.resultSelector||At,i=a.scheduler}else r===void 0||$e(r)?(o=t,s=At,i=r):(o=t,s=r);return new V(function(c){var u=o;if(i)return i.schedule(L_,0,{subscriber:c,iterate:n,condition:e,resultSelector:s,state:u});do{if(e){var l=void 0;try{l=e(u)}catch(f){c.error(f);return}if(!l){c.complete();break}}var h=void 0;try{h=s(u)}catch(f){c.error(f);return}if(c.next(h),c.closed)break;try{u=n(u)}catch(f){c.error(f);return}}while(!0)})}function L_(t){var e=t.subscriber,n=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(n){var r=void 0;try{r=n(t.state)}catch(s){e.error(s);return}if(!r){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 j_(t,e,n){return e===void 0&&(e=_n),n===void 0&&(n=_n),ja(function(){return t()?e:n})}function Sn(t){return!Me(t)&&t-parseFloat(t)+1>=0}function $_(t,e){return t===void 0&&(t=0),e===void 0&&(e=Ae),(!Sn(t)||t<0)&&(t=0),(!e||typeof e.schedule!="function")&&(e=Ae),new V(function(n){return n.add(e.schedule(P_,t,{subscriber:n,counter:0,period:t})),n})}function P_(t){var e=t.subscriber,n=t.counter,r=t.period;e.next(n),this.schedule({subscriber:e,counter:n+1,period:r},r)}function Tf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,r=null,i=t[t.length-1];return $e(i)?(r=t.pop(),t.length>1&&typeof t[t.length-1]=="number"&&(n=t.pop())):typeof i=="number"&&(n=t.pop()),r===null&&t.length===1&&t[0]instanceof V?t[0]:La(n)(_r(t,r))}var Nf=new V(st);function D_(){return Nf}function Uo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===0)return _n;var n=t[0],r=t.slice(1);return t.length===1&&Me(n)?Uo.apply(void 0,n):new V(function(i){var s=function(){return i.add(Uo.apply(void 0,r).subscribe(i))};return _t(n).subscribe({next:function(o){i.next(o)},error:s,complete:s})})}function F_(t,e){return e?new V(function(n){var r=Object.keys(t),i=new se;return i.add(e.schedule(B_,0,{keys:r,index:0,subscriber:n,subscription:i,obj:t})),i}):new V(function(n){for(var r=Object.keys(t),i=0;i<r.length&&!n.closed;i++){var s=r[i];t.hasOwnProperty(s)&&n.next([s,t[s]])}n.complete()})}function B_(t){var e=t.keys,n=t.index,r=t.subscriber,i=t.subscription,s=t.obj;if(!r.closed)if(n<e.length){var o=e[n];r.next([o,s[o]]),i.add(this.schedule({keys:e,index:n+1,subscriber:r,subscription:i,obj:s}))}else r.complete()}function Of(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}function Nt(t,e){return function(r){return r.lift(new V_(t,e))}}var V_=function(){function t(e,n){this.predicate=e,this.thisArg=n}return t.prototype.call=function(e,n){return n.subscribe(new H_(e,this.predicate,this.thisArg))},t}(),H_=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.predicate=r,s.thisArg=i,s.count=0,s}return e.prototype._next=function(n){var r;try{r=this.predicate.call(this.thisArg,n,this.count++)}catch(i){this.destination.error(i);return}r&&this.destination.next(n)},e}(M);function W_(t,e,n){return[Nt(e,n)(new V(Xn(t))),Nt(Of(e,n))(new V(Xn(t)))]}function Lf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1)if(Me(t[0]))t=t[0];else return t[0];return _r(t,void 0).lift(new U_)}var U_=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new z_(e))},t}(),z_=function(t){g(e,t);function e(n){var r=t.call(this,n)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return e.prototype._next=function(n){this.observables.push(n)},e.prototype._complete=function(){var n=this.observables,r=n.length;if(r===0)this.destination.complete();else{for(var i=0;i<r&&!this.hasFirst;i++){var s=n[i],o=yt(this,s,void 0,i);this.subscriptions&&this.subscriptions.push(o),this.add(o)}this.observables=null}},e.prototype.notifyNext=function(n,r,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(r)},e}(Kt);function q_(t,e,n){return t===void 0&&(t=0),new V(function(r){e===void 0&&(e=t,t=0);var i=0,s=t;if(n)return n.schedule(G_,0,{index:i,count:e,start:t,subscriber:r});do{if(i++>=e){r.complete();break}if(r.next(s++),r.closed)break}while(!0)})}function G_(t){var e=t.start,n=t.index,r=t.count,i=t.subscriber;if(n>=r){i.complete();return}i.next(e),!i.closed&&(t.index=n+1,t.start=e+1,this.schedule(t))}function jf(t,e,n){t===void 0&&(t=0);var r=-1;return Sn(e)?r=Number(e)<1&&1||Number(e):$e(e)&&(n=e),$e(n)||(n=Ae),new V(function(i){var s=Sn(t)?t:+t-n.now();return n.schedule(J_,s,{index:0,period:r,subscriber:i})})}function J_(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(n===-1)return r.complete();t.index=e+1,this.schedule(t,n)}}function Q_(t,e){return new V(function(n){var r;try{r=t()}catch(a){n.error(a);return}var i;try{i=e(r)}catch(a){n.error(a);return}var s=i?_t(i):_n,o=s.subscribe(n);return function(){o.unsubscribe(),r&&r.unsubscribe()}})}function $f(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return typeof n=="function"&&t.pop(),_r(t,void 0).lift(new Pf(n))}var Pf=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new Z_(e,this.resultSelector))},t}(),Z_=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.resultSelector=r,s.iterators=[],s.active=0,s.resultSelector=typeof r=="function"?r:void 0,s}return e.prototype._next=function(n){var r=this.iterators;Me(n)?r.push(new K_(n)):typeof n[Tt]=="function"?r.push(new Y_(n[Tt]())):r.push(new X_(this.destination,this,n))},e.prototype._complete=function(){var n=this.iterators,r=n.length;if(this.unsubscribe(),r===0){this.destination.complete();return}this.active=r;for(var i=0;i<r;i++){var s=n[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 n=this.iterators,r=n.length,i=this.destination,s=0;s<r;s++){var o=n[s];if(typeof o.hasValue=="function"&&!o.hasValue())return}for(var a=!1,c=[],s=0;s<r;s++){var o=n[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(n){var r;try{r=this.resultSelector.apply(this,n)}catch(i){this.destination.error(i);return}this.destination.next(r)},e}(M),Y_=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}(),K_=function(){function t(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return t.prototype[Tt]=function(){return this},t.prototype.next=function(e){var n=this.index++,r=this.array;return n<this.length?{value:r[n],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}(),X_=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.parent=r,s.observable=i,s.stillUnsubscribed=!0,s.buffer=[],s.isComplete=!1,s}return e.prototype[Tt]=function(){return this},e.prototype.next=function(){var n=this.buffer;return n.length===0&&this.isComplete?{value:null,done:!0}:{value:n.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(n){this.buffer.push(n),this.parent.checkIterators()},e.prototype.subscribe=function(){return ce(this.observable,new oe(this))},e}(ae);const ew=Object.freeze(Object.defineProperty({__proto__:null,ArgumentOutOfRangeError:wn,AsyncSubject:jn,BehaviorSubject:ff,ConnectableObservable:hf,EMPTY:_n,EmptyError:wr,GroupedObservable:Bo,NEVER:Nf,Notification:mt,get NotificationKind(){return Ho},ObjectUnsubscribedError:xt,Observable:V,ReplaySubject:Na,Scheduler:Vo,Subject:ye,Subscriber:M,Subscription:se,TimeoutError:wf,UnsubscriptionError:Jn,VirtualAction:_f,VirtualTimeScheduler:r_,animationFrame:n_,animationFrameScheduler:vf,asap:Dr,asapScheduler:mf,async:Ae,asyncScheduler:yf,bindCallback:Sf,bindNodeCallback:Ef,combineLatest:v_,concat:er,config:Be,defer:ja,empty:Ln,forkJoin:M_,from:_t,fromEvent:Rf,fromEventPattern:Af,generate:O_,identity:At,iif:j_,interval:$_,isObservable:i_,merge:Tf,never:D_,noop:st,observable:On,of:Mi,onErrorResumeNext:Uo,pairs:F_,partition:W_,pipe:Fo,queue:pf,queueScheduler:df,race:Lf,range:q_,scheduled:xf,throwError:Ta,timer:jf,using:Q_,zip:$f},Symbol.toStringTag,{value:"Module"})),Ai=xn(ew);var Ti={},vt,K,yo,Fu,En=0,Df=[],Fr=[],Bu=$.__b,Vu=$.__r,Hu=$.diffed,Wu=$.__c,Uu=$.unmount;function Xt(t,e){$.__h&&$.__h(K,t,En||e),En=0;var n=K.__H||(K.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:Fr}),n.__[t]}function Ff(t){return En=1,Bf(Hf,t)}function Bf(t,e,n){var r=Xt(vt++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):Hf(void 0,e),function(a){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,a);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=K,!K.u)){var i=function(a,c,u){if(!r.__c.__H)return!0;var l=r.__c.__H.__.filter(function(f){return f.__c});if(l.every(function(f){return!f.__N}))return!s||s.call(this,a,c,u);var h=!1;return l.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(h=!0)}}),!(!h&&r.__c.props===a)&&(!s||s.call(this,a,c,u))};K.u=!0;var s=K.shouldComponentUpdate,o=K.componentWillUpdate;K.componentWillUpdate=function(a,c,u){if(this.__e){var l=s;s=void 0,i(a,c,u),s=l}o&&o.call(this,a,c,u)},K.shouldComponentUpdate=i}return r.__N||r.__}function tw(t,e){var n=Xt(vt++,3);!$.__s&&Pa(n.__H,e)&&(n.__=t,n.i=e,K.__H.__h.push(n))}function Vf(t,e){var n=Xt(vt++,4);!$.__s&&Pa(n.__H,e)&&(n.__=t,n.i=e,K.__h.push(n))}function nw(t){return En=5,$a(function(){return{current:t}},[])}function rw(t,e,n){En=6,Vf(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},n==null?n:n.concat(t))}function $a(t,e){var n=Xt(vt++,7);return Pa(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function iw(t,e){return En=8,$a(function(){return t},e)}function sw(t){var e=K.context[t.__c],n=Xt(vt++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(K)),e.props.value):t.__}function ow(t,e){$.useDebugValue&&$.useDebugValue(e?e(t):t)}function aw(t){var e=Xt(vt++,10),n=Ff();return e.__=t,K.componentDidCatch||(K.componentDidCatch=function(r,i){e.__&&e.__(r,i),n[1](r)}),[n[0],function(){n[1](void 0)}]}function cw(){var t=Xt(vt++,11);if(!t.__){for(var e=K.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function uw(){for(var t;t=Df.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Br),t.__H.__h.forEach(zo),t.__H.__h=[]}catch(e){t.__H.__h=[],$.__e(e,t.__v)}}$.__b=function(t){K=null,Bu&&Bu(t)},$.__r=function(t){Vu&&Vu(t),vt=0;var e=(K=t.__c).__H;e&&(yo===K?(e.__h=[],K.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Fr,n.__N=n.i=void 0})):(e.__h.forEach(Br),e.__h.forEach(zo),e.__h=[],vt=0)),yo=K},$.diffed=function(t){Hu&&Hu(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Df.push(e)!==1&&Fu===$.requestAnimationFrame||((Fu=$.requestAnimationFrame)||lw)(uw)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Fr&&(n.__=n.__V),n.i=void 0,n.__V=Fr})),yo=K=null},$.__c=function(t,e){e.some(function(n){try{n.__h.forEach(Br),n.__h=n.__h.filter(function(r){return!r.__||zo(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],$.__e(r,n.__v)}}),Wu&&Wu(t,e)},$.unmount=function(t){Uu&&Uu(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Br(r)}catch(i){e=i}}),n.__H=void 0,e&&$.__e(e,n.__v))};var zu=typeof requestAnimationFrame=="function";function lw(t){var e,n=function(){clearTimeout(r),zu&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);zu&&(e=requestAnimationFrame(n))}function Br(t){var e=K,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),K=e}function zo(t){var e=K;t.__c=t.__(),K=e}function Pa(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Hf(t,e){return typeof e=="function"?e(t):e}const hw=Object.freeze(Object.defineProperty({__proto__:null,useCallback:iw,useContext:sw,useDebugValue:ow,useEffect:tw,useErrorBoundary:aw,useId:cw,useImperativeHandle:rw,useLayoutEffect:Vf,useMemo:$a,useReducer:Bf,useRef:nw,useState:Ff},Symbol.toStringTag,{value:"Module"})),Sr=xn(hw);var ut={},Ni={};Object.defineProperty(Ni,"__esModule",{value:!0});Ni.LIB_VERSION=void 0;Ni.LIB_VERSION="3.6.6";var Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.CloseIcon=void 0;const qu=Pe;function fw(t){return(0,qu.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,qu.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"}))}Oi.CloseIcon=fw;var Da={};Object.defineProperty(Da,"__esModule",{value:!0});Da.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});Fa.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var Li={};Object.defineProperty(Li,"__esModule",{value:!0});Li.QRCodeIcon=void 0;const nt=Pe;function dw(t){return(0,nt.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,nt.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,nt.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,nt.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,nt.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,nt.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,nt.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,nt.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,nt.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,nt.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}Li.QRCodeIcon=dw;var Ba={};Object.defineProperty(Ba,"__esModule",{value:!0});const pw=`
|
|
9
|
-
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
10
|
-
<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"/>
|
|
11
|
-
<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"/>
|
|
12
|
-
<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"/>
|
|
13
|
-
</svg>
|
|
14
|
-
`;Ba.default=pw;var Va={};Object.defineProperty(Va,"__esModule",{value:!0});Va.default=`
|
|
15
|
-
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
16
|
-
<circle cx="50" cy="50" r="50" fill="white"/>
|
|
17
|
-
<circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/>
|
|
18
|
-
<circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/>
|
|
19
|
-
<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"/>
|
|
20
|
-
</svg>
|
|
21
|
-
`;var ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.StatusDotIcon=void 0;const Gu=Pe;function bw(t){return(0,Gu.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Gu.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"}))}ji.StatusDotIcon=bw;var $i={};function Wf(t){this.mode=Le.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,n=this.data.length;e<n;e++){var r=[],i=this.data.charCodeAt(e);i>65536?(r[0]=240|(i&1835008)>>>18,r[1]=128|(i&258048)>>>12,r[2]=128|(i&4032)>>>6,r[3]=128|i&63):i>2048?(r[0]=224|(i&61440)>>>12,r[1]=128|(i&4032)>>>6,r[2]=128|i&63):i>128?(r[0]=192|(i&1984)>>>6,r[1]=128|i&63):r[0]=i,this.parsedData.push(r)}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))}Wf.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,n=this.parsedData.length;e<n;e++)t.put(this.parsedData[e],8)}};function lt(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}lt.prototype={addData:function(t){var e=new Wf(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 n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++)this.modules[n][r]=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=lt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(var r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?this.modules[t+n][e+r]=!0:this.modules[t+n][e+r]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=re.getLostPoint(this);(n==0||t>r)&&(t=r,e=n)}return e},createMovieClip:function(t,e,n){var r=t.createEmptyMovieClip(e,n),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&&(r.beginFill(0,100),r.moveTo(c,o),r.lineTo(c+i,o),r.lineTo(c+i,o+i),r.lineTo(c,o+i),r.endFill())}return r},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=re.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var n=0;n<t.length;n++){var r=t[e],i=t[n];if(this.modules[r][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[r+s][i+o]=!0:this.modules[r+s][i+o]=!1}},setupTypeNumber:function(t){for(var e=re.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var r=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(var n=0;n<18;n++){var r=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},setupTypeInfo:function(t,e){for(var n=this.errorCorrectLevel<<3|e,r=re.getBCHTypeInfo(n),i=0;i<15;i++){var s=!t&&(r>>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&&(r>>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 n=-1,r=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[r][o-a]==null){var c=!1;s<t.length&&(c=(t[s]>>>i&1)==1);var u=re.getMask(e,r,o-a);u&&(c=!c),this.modules[r][o-a]=c,i--,i==-1&&(s++,i=7)}if(r+=n,r<0||this.moduleCount<=r){r-=n,n=-n;break}}}};lt.PAD0=236;lt.PAD1=17;lt.createData=function(t,e,n){for(var r=ot.getRSBlocks(t,e),i=new Uf,s=0;s<n.length;s++){var o=n[s];i.put(o.mode,4),i.put(o.getLength(),re.getLengthInBits(o.mode,t)),o.write(i)}for(var a=0,s=0;s<r.length;s++)a+=r[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(lt.PAD0,8),i.getLengthInBits()>=a*8));)i.put(lt.PAD1,8);return lt.createBytes(i,r)};lt.createBytes=function(t,e){for(var n=0,r=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;r=Math.max(r,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+n];n+=c;var h=re.getErrorCorrectPolynomial(u),f=new fn(s[a],h.getLength()-1),d=f.mod(h);o[a]=new Array(h.getLength()-1);for(var l=0;l<o[a].length;l++){var p=l+d.getLength()-o[a].length;o[a][l]=p>=0?d.get(p):0}}for(var _=0,l=0;l<e.length;l++)_+=e[l].totalCount;for(var m=new Array(_),b=0,l=0;l<r;l++)for(var a=0;a<e.length;a++)l<s[a].length&&(m[b++]=s[a][l]);for(var l=0;l<i;l++)for(var a=0;a<e.length;a++)l<o[a].length&&(m[b++]=o[a][l]);return m};var Le={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},kt={L:1,M:0,Q:3,H:2},St={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},re={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;re.getBCHDigit(e)-re.getBCHDigit(re.G15)>=0;)e^=re.G15<<re.getBCHDigit(e)-re.getBCHDigit(re.G15);return(t<<10|e)^re.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;re.getBCHDigit(e)-re.getBCHDigit(re.G18)>=0;)e^=re.G18<<re.getBCHDigit(e)-re.getBCHDigit(re.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return re.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,n){switch(t){case St.PATTERN000:return(e+n)%2==0;case St.PATTERN001:return e%2==0;case St.PATTERN010:return n%3==0;case St.PATTERN011:return(e+n)%3==0;case St.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case St.PATTERN101:return e*n%2+e*n%3==0;case St.PATTERN110:return(e*n%2+e*n%3)%2==0;case St.PATTERN111:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new fn([1],0),n=0;n<t;n++)e=e.multiply(new fn([1,me.gexp(n)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Le.MODE_NUMBER:return 10;case Le.MODE_ALPHA_NUM:return 9;case Le.MODE_8BIT_BYTE:return 8;case Le.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Le.MODE_NUMBER:return 12;case Le.MODE_ALPHA_NUM:return 11;case Le.MODE_8BIT_BYTE:return 16;case Le.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case Le.MODE_NUMBER:return 14;case Le.MODE_ALPHA_NUM:return 13;case Le.MODE_8BIT_BYTE:return 16;case Le.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+e)},getLostPoint:function(t){for(var e=t.getModuleCount(),n=0,r=0;r<e;r++)for(var i=0;i<e;i++){for(var s=0,o=t.isDark(r,i),a=-1;a<=1;a++)if(!(r+a<0||e<=r+a))for(var c=-1;c<=1;c++)i+c<0||e<=i+c||a==0&&c==0||o==t.isDark(r+a,i+c)&&s++;s>5&&(n+=3+s-5)}for(var r=0;r<e-1;r++)for(var i=0;i<e-1;i++){var u=0;t.isDark(r,i)&&u++,t.isDark(r+1,i)&&u++,t.isDark(r,i+1)&&u++,t.isDark(r+1,i+1)&&u++,(u==0||u==4)&&(n+=3)}for(var r=0;r<e;r++)for(var i=0;i<e-6;i++)t.isDark(r,i)&&!t.isDark(r,i+1)&&t.isDark(r,i+2)&&t.isDark(r,i+3)&&t.isDark(r,i+4)&&!t.isDark(r,i+5)&&t.isDark(r,i+6)&&(n+=40);for(var i=0;i<e;i++)for(var r=0;r<e-6;r++)t.isDark(r,i)&&!t.isDark(r+1,i)&&t.isDark(r+2,i)&&t.isDark(r+3,i)&&t.isDark(r+4,i)&&!t.isDark(r+5,i)&&t.isDark(r+6,i)&&(n+=40);for(var l=0,i=0;i<e;i++)for(var r=0;r<e;r++)t.isDark(r,i)&&l++;var h=Math.abs(100*l/e/e-50)/5;return n+=h*10,n}},me={glog:function(t){if(t<1)throw new Error("glog("+t+")");return me.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return me.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var ve=0;ve<8;ve++)me.EXP_TABLE[ve]=1<<ve;for(var ve=8;ve<256;ve++)me.EXP_TABLE[ve]=me.EXP_TABLE[ve-4]^me.EXP_TABLE[ve-5]^me.EXP_TABLE[ve-6]^me.EXP_TABLE[ve-8];for(var ve=0;ve<255;ve++)me.LOG_TABLE[me.EXP_TABLE[ve]]=ve;function fn(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var n=0;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(var r=0;r<t.length-n;r++)this.num[r]=t[r+n]}fn.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),n=0;n<this.getLength();n++)for(var r=0;r<t.getLength();r++)e[n+r]^=me.gexp(me.glog(this.get(n))+me.glog(t.get(r)));return new fn(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=me.glog(this.get(0))-me.glog(t.get(0)),n=new Array(this.getLength()),r=0;r<this.getLength();r++)n[r]=this.get(r);for(var r=0;r<t.getLength();r++)n[r]^=me.gexp(me.glog(t.get(r))+e);return new fn(n,0).mod(t)}};function ot(t,e){this.totalCount=t,this.dataCount=e}ot.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]];ot.getRSBlocks=function(t,e){var n=ot.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var r=n.length/3,i=[],s=0;s<r;s++)for(var o=n[s*3+0],a=n[s*3+1],c=n[s*3+2],u=0;u<o;u++)i.push(new ot(a,c));return i};ot.getRsBlockTable=function(t,e){switch(e){case kt.L:return ot.RS_BLOCK_TABLE[(t-1)*4+0];case kt.M:return ot.RS_BLOCK_TABLE[(t-1)*4+1];case kt.Q:return ot.RS_BLOCK_TABLE[(t-1)*4+2];case kt.H:return ot.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};function Uf(){this.buffer=[],this.length=0}Uf.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 n=0;n<e;n++)this.putBit((t>>>e-n-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 vo=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function zf(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 n(c){switch(c){case"L":return kt.L;case"M":return kt.M;case"Q":return kt.Q;case"H":return kt.H;default:throw new Error("Unknwon error correction level: "+c)}}function r(c,u){for(var l=i(c),h=1,f=0,d=0,p=vo.length;d<=p;d++){var _=vo[d];if(!_)throw new Error("Content too long: expected "+f+" but got "+l);switch(u){case"L":f=_[0];break;case"M":f=_[1];break;case"Q":f=_[2];break;case"H":f=_[3];break;default:throw new Error("Unknwon error correction level: "+u)}if(l<=f)break;h++}if(h>vo.length)throw new Error("Content too long");return h}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=r(s,this.options.ecl),a=n(this.options.ecl);this.qrcode=new lt(o,a),this.qrcode.addData(s),this.qrcode.make()}zf.prototype.svg=function(t){var e=this.options||{},n=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var r=typeof e.pretty<"u"?!!e.pretty:!0,i=r?" ":"",s=r?`\r
|
|
22
|
-
`:"",o=e.width,a=e.height,c=n.length,u=o/(c+2*e.padding),l=a/(c+2*e.padding),h=typeof e.join<"u"?!!e.join:!1,f=typeof e.swap<"u"?!!e.swap:!1,d=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,p=typeof e.predefined<"u"?!!e.predefined:!1,_=p?i+'<defs><path id="qrmodule" d="M0 0 h'+l+" v"+u+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+s:"",m=i+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+s,b="",y="",S=0;S<c;S++)for(var k=0;k<c;k++){var E=n[k][S];if(E){var N=k*u+e.padding*u,U=S*l+e.padding*l;if(f){var z=N;N=U,U=z}if(h){var P=u+N,q=l+U;N=Number.isInteger(N)?Number(N):N.toFixed(2),U=Number.isInteger(U)?Number(U):U.toFixed(2),P=Number.isInteger(P)?Number(P):P.toFixed(2),q=Number.isInteger(q)?Number(q):q.toFixed(2),y+="M"+N+","+U+" V"+q+" H"+P+" V"+U+" H"+N+" Z "}else p?b+=i+'<use x="'+N.toString()+'" y="'+U.toString()+'" href="#qrmodule" />'+s:b+=i+'<rect x="'+N.toString()+'" y="'+U.toString()+'" width="'+u+'" height="'+l+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+s}}h&&(b=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+y+'" />');let ue="";if(this.options.image!==void 0&&this.options.image.svg){const w=o*this.options.image.width/100,v=a*this.options.image.height/100,R=o/2-w/2,C=a/2-v/2;ue+=`<svg x="${R}" y="${C}" width="${w}" height="${v}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,ue+=this.options.image.svg+s,ue+="</svg>"}var G="";switch(t.container){case"svg":d&&(G+='<?xml version="1.0" standalone="yes"?>'+s),G+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+s,G+=_+m+b,G+=ue,G+="</svg>";break;case"svg-viewbox":d&&(G+='<?xml version="1.0" standalone="yes"?>'+s),G+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+s,G+=_+m+b,G+=ue,G+="</svg>";break;case"g":G+='<g width="'+o+'" height="'+a+'">'+s,G+=_+m+b,G+=ue,G+="</g>";break;default:G+=(_+m+b+ue).replace(/^\s+/,"");break}return G};var gw=zf,mw=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($i,"__esModule",{value:!0});$i.QRCode=void 0;const yw=Pe,Ju=Sr,vw=mw(gw),_w=t=>{const[e,n]=(0,Ju.useState)("");return(0,Ju.useEffect)(()=>{var r,i;const s=new vw.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(r=t.width)!==null&&r!==void 0?r:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),o=B.from(s.svg(),"utf8").toString("base64");n(`data:image/svg+xml;base64,${o}`)}),e?(0,yw.h)("img",{src:e,alt:"QR Code"}):null};$i.QRCode=_w;var Pi={},Ha={};Object.defineProperty(Ha,"__esModule",{value:!0});Ha.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 ww=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.Spinner=void 0;const Or=Pe,Sw=ww(Ha),Ew=t=>{var e;const n=(e=t.size)!==null&&e!==void 0?e:64,r=t.color||"#000";return(0,Or.h)("div",{class:"-cbwsdk-spinner"},(0,Or.h)("style",null,Sw.default),(0,Or.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:n,height:n}},(0,Or.h)("circle",{style:{cx:50,cy:50,r:45,stroke:r}})))};Pi.Spinner=Ew;var Wa={};Object.defineProperty(Wa,"__esModule",{value:!0});Wa.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;color:#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 $n=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ut,"__esModule",{value:!0});ut.CoinbaseAppSteps=ut.CoinbaseWalletSteps=ut.ConnectItem=ut.ConnectContent=void 0;const He=$n(ni),O=Pe,Qu=Sr,Cw=x,Iw=Ni,xw=Oi,kw=$n(Da),Rw=$n(Fa),qf=Li,Mw=$n(Ba),Aw=$n(Va),Tw=ji,Nw=$i,Ow=Pi,Lw=$n(Wa),Zu={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:Rw.default,steps:Jf},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:kw.default,steps:Qf}},jw=t=>{switch(t){case"coinbase-app":return Mw.default;case"coinbase-wallet-app":default:return Aw.default}},qo=t=>t==="light"?"#FFFFFF":"#0A0B0D";function $w(t){const{theme:e}=t,[n,r]=(0,Qu.useState)("coinbase-wallet-app"),i=(0,Qu.useCallback)(u=>{r(u)},[]),s=(0,Cw.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),o=Zu[n];if(!n)return null;const a=o.steps,c=n==="coinbase-app";return(0,O.h)("div",{"data-testid":"connect-content",class:(0,He.default)("-cbwsdk-connect-content",e)},(0,O.h)("style",null,Lw.default),(0,O.h)("div",{class:"-cbwsdk-connect-content-header"},(0,O.h)("h2",{class:(0,He.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,O.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,O.h)(xw.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,O.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,O.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,O.h)("div",null,Object.entries(Zu).map(([u,l])=>(0,O.h)(Gf,{key:u,title:l.title,description:l.description,icon:l.icon,selected:n===u,onClick:()=>i(u),theme:e}))),c&&(0,O.h)("div",{class:(0,He.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,O.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,O.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,O.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,O.h)(Nw.QRCode,{content:s,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:jw(n),width:25,height:25}}),(0,O.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Iw.LIB_VERSION}),(0,O.h)("input",{type:"hidden",value:s})),(0,O.h)(a,{theme:e}),!t.isConnected&&(0,O.h)("div",{"data-testid":"connecting-spinner",class:(0,He.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,O.h)(Ow.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,O.h)("p",null,"Connecting...")))))}ut.ConnectContent=$w;function Gf({title:t,description:e,icon:n,selected:r,theme:i,onClick:s}){return(0,O.h)("div",{onClick:s,class:(0,He.default)("-cbwsdk-connect-item",i,{selected:r})},(0,O.h)("div",null,(0,O.h)("img",{src:n,alt:t})),(0,O.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,O.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,O.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}ut.ConnectItem=Gf;function Jf({theme:t}){return(0,O.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,O.h)("li",{class:(0,He.default)("-cbwsdk-wallet-steps-item",t)},(0,O.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,O.h)("li",{class:(0,He.default)("-cbwsdk-wallet-steps-item",t)},(0,O.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,O.h)("span",null,"Tap ",(0,O.h)("strong",null,"Scan")," "),(0,O.h)("span",{class:(0,He.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,O.h)(qf.QRCodeIcon,{fill:qo(t)})))))}ut.CoinbaseWalletSteps=Jf;function Qf({theme:t}){return(0,O.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,O.h)("li",{class:(0,He.default)("-cbwsdk-wallet-steps-item",t)},(0,O.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,O.h)("li",{class:(0,He.default)("-cbwsdk-wallet-steps-item",t)},(0,O.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,O.h)("span",null,"Tap ",(0,O.h)("strong",null,"More")),(0,O.h)("span",{class:(0,He.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,O.h)(Tw.StatusDotIcon,{fill:qo(t)})),(0,O.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,O.h)("strong",null,"Scan")),(0,O.h)("span",{class:(0,He.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,O.h)(qf.QRCodeIcon,{fill:qo(t)})))))}ut.CoinbaseAppSteps=Qf;var Di={},Fi={};Object.defineProperty(Fi,"__esModule",{value:!0});Fi.ArrowLeftIcon=void 0;const Yu=Pe;function Pw(t){return(0,Yu.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,Yu.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"}))}Fi.ArrowLeftIcon=Pw;var Bi={};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.LaptopIcon=void 0;const _o=Pe;function Dw(t){return(0,_o.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,_o.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,_o.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"}))}Bi.LaptopIcon=Dw;var Vi={};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.SafeIcon=void 0;const Ku=Pe;function Fw(t){return(0,Ku.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ku.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"}))}Vi.SafeIcon=Fw;var Ua={};Object.defineProperty(Ua,"__esModule",{value:!0});Ua.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 Zf=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Di,"__esModule",{value:!0});Di.TryExtensionContent=void 0;const Ot=Zf(ni),he=Pe,wo=Sr,Bw=Fi,Vw=Bi,Hw=Vi,Ww=Zf(Ua);function Uw({theme:t}){const[e,n]=(0,wo.useState)(!1),r=(0,wo.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,wo.useCallback)(()=>{e?window.location.reload():(r(),n(!0))},[r,e]);return(0,he.h)("div",{class:(0,Ot.default)("-cbwsdk-try-extension",t)},(0,he.h)("style",null,Ww.default),(0,he.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,he.h)("h3",{class:(0,Ot.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,he.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,he.h)("button",{class:(0,Ot.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,he.h)("div",null,!e&&(0,he.h)(Bw.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,he.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,he.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,he.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,he.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,he.h)("span",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,he.h)(Vw.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,he.h)("div",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,he.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,he.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,he.h)("span",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,he.h)(Hw.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,he.h)("div",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Di.TryExtensionContent=Uw;var za={};Object.defineProperty(za,"__esModule",{value:!0});za.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}.-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 Yf=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.ConnectDialog=void 0;const So=Yf(ni),Lt=Pe,Eo=Sr,zw=ut,qw=Di,Gw=Yf(za),Jw=t=>{const{isOpen:e,darkMode:n}=t,[r,i]=(0,Eo.useState)(!e),[s,o]=(0,Eo.useState)(!e);(0,Eo.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=n?"dark":"light";return(0,Lt.h)("div",{class:(0,So.default)("-cbwsdk-connect-dialog-container",r&&"-cbwsdk-connect-dialog-container-hidden")},(0,Lt.h)("style",null,Gw.default),(0,Lt.h)("div",{class:(0,So.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Lt.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Lt.h)("div",{class:(0,So.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,Lt.h)(zw.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,Lt.h)(qw.TryExtensionContent,{theme:a}))))};Ti.ConnectDialog=Jw;Object.defineProperty(ki,"__esModule",{value:!0});ki.LinkFlow=void 0;const Co=Pe,Xu=Ai,Qw=Ti;class Zw{constructor(e){this.extensionUI$=new Xu.BehaviorSubject({}),this.subscriptions=new Xu.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(n=>{this.isConnected!==n&&(this.isConnected=n,this.render())})),this.subscriptions.add(this.chainId$.subscribe(n=>{this.chainId!==n&&(this.chainId=n,this.render())}))}detach(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,Co.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,Co.render)((0,Co.h)(Qw.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)}}ki.LinkFlow=Zw;var Kf={},qa={};Object.defineProperty(qa,"__esModule",{value:!0});qa.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=A&&A.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const n=e(ni),r=Pe,i=Sr,s=e(qa),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function a(h){switch(h){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}class c{constructor(f){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=f.darkMode}attach(f){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",f.appendChild(this.root),this.render()}presentItem(f){const d=this.nextItemKey++;return this.items.set(d,f),this.render(),()=>{this.items.delete(d),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,r.render)((0,r.h)("div",null,(0,r.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([f,d])=>(0,r.h)(t.SnackbarInstance,Object.assign({},d,{key:f}))))),this.root)}}t.Snackbar=c;const u=h=>(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-container")},(0,r.h)("style",null,s.default),(0,r.h)("div",{class:"-cbwsdk-snackbar"},h.children));t.SnackbarContainer=u;const l=({autoExpand:h,message:f,menuItems:d,appSrc:p})=>{const[_,m]=(0,i.useState)(!0),[b,y]=(0,i.useState)(h??!1);(0,i.useEffect)(()=>{const k=[window.setTimeout(()=>{m(!1)},1),window.setTimeout(()=>{y(!0)},1e4)];return()=>{k.forEach(window.clearTimeout)}});const S=()=>{y(!b)};return(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance",_&&"-cbwsdk-snackbar-instance-hidden",b&&"-cbwsdk-snackbar-instance-expanded")},(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:S},(0,r.h)("img",{src:a(p),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},f),(0,r.h)("div",{class:"-gear-container"},!b&&(0,r.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,r.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),d&&d.length>0&&(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},d.map((k,E)=>(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item",k.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:k.onClick,key:E},(0,r.h)("svg",{width:k.svgWidth,height:k.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("path",{"fill-rule":k.defaultFillRule,"clip-rule":k.defaultClipRule,d:k.path,fill:"#AAAAAA"})),(0,r.h)("span",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item-info",k.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},k.info)))))};t.SnackbarInstance=l})(Kf);var Hi={},Ga={};Object.defineProperty(Ga,"__esModule",{value:!0});Ga.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 Yw=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.injectCssReset=void 0;const Kw=Yw(Ga);function Xw(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(Kw.default)),document.documentElement.appendChild(t)}Hi.injectCssReset=Xw;Object.defineProperty(xi,"__esModule",{value:!0});xi.WalletSDKUI=void 0;const e2=ki,t2=Kf,n2=Hi;class r2{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new t2.Snackbar({darkMode:e.darkMode}),this.linkFlow=new e2.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,n=document.createElement("div");n.className="-cbwsdk-css-reset",e.appendChild(n),this.linkFlow.attach(n),this.snackbar.attach(n),this.attached=!0,(0,n2.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 n;return e.isUnlinkedErrorState?n={autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:n={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(n)}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}}xi.WalletSDKUI=r2;var Wi={},Ui={};Object.defineProperty(Ui,"__esModule",{value:!0});var an;(function(t){t.typeOfFunction="function",t.boolTrue=!0})(an||(an={}));function Xf(t,e,n){if(!n||typeof n.value!==an.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:an.boolTrue,get:function(){var r=n.value.bind(this);return Object.defineProperty(this,e,{value:r,configurable:an.boolTrue,writable:an.boolTrue}),r}}}Ui.bind=Xf;Ui.default=Xf;function ed(t){return function(n){return n.lift(new i2(t))}}var i2=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new s2(e,this.durationSelector))},t}(),s2=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.durationSelector=r,i.hasValue=!1,i}return e.prototype._next=function(n){if(this.value=n,this.hasValue=!0,!this.throttled){var r=void 0;try{var i=this.durationSelector;r=i(n)}catch(o){return this.destination.error(o)}var s=ce(r,new oe(this));!s||s.closed?this.clearThrottle():this.add(this.throttled=s)}},e.prototype.clearThrottle=function(){var n=this,r=n.value,i=n.hasValue,s=n.throttled;s&&(this.remove(s),this.throttled=void 0,s.unsubscribe()),i&&(this.value=void 0,this.hasValue=!1,this.destination.next(r))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(ae);function o2(t,e){return e===void 0&&(e=Ae),ed(function(){return jf(t,e)})}function a2(t){return function(n){return n.lift(new c2(t))}}var c2=function(){function t(e){this.closingNotifier=e}return t.prototype.call=function(e,n){return n.subscribe(new u2(e,this.closingNotifier))},t}(),u2=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.buffer=[],i.add(ce(r,new oe(i))),i}return e.prototype._next=function(n){this.buffer.push(n)},e.prototype.notifyNext=function(){var n=this.buffer;this.buffer=[],this.destination.next(n)},e}(ae);function l2(t,e){return e===void 0&&(e=null),function(r){return r.lift(new h2(t,e))}}var h2=function(){function t(e,n){this.bufferSize=e,this.startBufferEvery=n,!n||e===n?this.subscriberClass=f2:this.subscriberClass=d2}return t.prototype.call=function(e,n){return n.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},t}(),f2=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.bufferSize=r,i.buffer=[],i}return e.prototype._next=function(n){var r=this.buffer;r.push(n),r.length==this.bufferSize&&(this.destination.next(r),this.buffer=[])},e.prototype._complete=function(){var n=this.buffer;n.length>0&&this.destination.next(n),t.prototype._complete.call(this)},e}(M),d2=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.bufferSize=r,s.startBufferEvery=i,s.buffers=[],s.count=0,s}return e.prototype._next=function(n){var r=this,i=r.bufferSize,s=r.startBufferEvery,o=r.buffers,a=r.count;this.count++,a%s===0&&o.push([]);for(var c=o.length;c--;){var u=o[c];u.push(n),u.length===i&&(o.splice(c,1),this.destination.next(u))}},e.prototype._complete=function(){for(var n=this,r=n.buffers,i=n.destination;r.length>0;){var s=r.shift();s.length>0&&i.next(s)}t.prototype._complete.call(this)},e}(M);function p2(t){var e=arguments.length,n=Ae;$e(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(o){return o.lift(new b2(t,r,i,n))}}var b2=function(){function t(e,n,r,i){this.bufferTimeSpan=e,this.bufferCreationInterval=n,this.maxBufferSize=r,this.scheduler=i}return t.prototype.call=function(e,n){return n.subscribe(new m2(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),g2=function(){function t(){this.buffer=[]}return t}(),m2=function(t){g(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;a.bufferTimeSpan=r,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:r};a.add(c.closeAction=o.schedule(el,r,u))}else{var l={subscriber:a,context:c},h={bufferTimeSpan:r,bufferCreationInterval:i,subscriber:a,scheduler:o};a.add(c.closeAction=o.schedule(td,r,l)),a.add(o.schedule(y2,i,h))}return a}return e.prototype._next=function(n){for(var r=this.contexts,i=r.length,s,o=0;o<i;o++){var a=r[o],c=a.buffer;c.push(n),c.length==this.maxBufferSize&&(s=a)}s&&this.onBufferFull(s)},e.prototype._error=function(n){this.contexts.length=0,t.prototype._error.call(this,n)},e.prototype._complete=function(){for(var n=this,r=n.contexts,i=n.destination;r.length>0;){var s=r.shift();i.next(s.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(n){this.closeContext(n);var r=n.closeAction;if(r.unsubscribe(),this.remove(r),!this.closed&&this.timespanOnly){n=this.openContext();var i=this.bufferTimeSpan,s={subscriber:this,context:n,bufferTimeSpan:i};this.add(n.closeAction=this.scheduler.schedule(el,i,s))}},e.prototype.openContext=function(){var n=new g2;return this.contexts.push(n),n},e.prototype.closeContext=function(n){this.destination.next(n.buffer);var r=this.contexts,i=r?r.indexOf(n):-1;i>=0&&r.splice(r.indexOf(n),1)},e}(M);function el(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function y2(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,i=t.scheduler,s=r.openContext(),o=this;r.closed||(r.add(s.closeAction=i.schedule(td,n,{subscriber:r,context:s})),o.schedule(t,e))}function td(t){var e=t.subscriber,n=t.context;e.closeContext(n)}function v2(t,e){return function(r){return r.lift(new _2(t,e))}}var _2=function(){function t(e,n){this.openings=e,this.closingSelector=n}return t.prototype.call=function(e,n){return n.subscribe(new w2(e,this.openings,this.closingSelector))},t}(),w2=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.closingSelector=i,s.contexts=[],s.add(yt(s,r)),s}return e.prototype._next=function(n){for(var r=this.contexts,i=r.length,s=0;s<i;s++)r[s].buffer.push(n)},e.prototype._error=function(n){for(var r=this.contexts;r.length>0;){var i=r.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,n)},e.prototype._complete=function(){for(var n=this.contexts;n.length>0;){var r=n.shift();this.destination.next(r.buffer),r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(n,r){n?this.closeBuffer(n):this.openBuffer(r)},e.prototype.notifyComplete=function(n){this.closeBuffer(n.context)},e.prototype.openBuffer=function(n){try{var r=this.closingSelector,i=r.call(this,n);i&&this.trySubscribe(i)}catch(s){this._error(s)}},e.prototype.closeBuffer=function(n){var r=this.contexts;if(r&&n){var i=n.buffer,s=n.subscription;this.destination.next(i),r.splice(r.indexOf(n),1),this.remove(s),s.unsubscribe()}},e.prototype.trySubscribe=function(n){var r=this.contexts,i=[],s=new se,o={buffer:i,subscription:s};r.push(o);var a=yt(this,n,o);!a||a.closed?this.closeBuffer(o):(a.context=o,this.add(a),s.add(a))},e}(Kt);function S2(t){return function(e){return e.lift(new E2(t))}}var E2=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new C2(e,this.closingSelector))},t}(),C2=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.closingSelector=r,i.subscribing=!1,i.openBuffer(),i}return e.prototype._next=function(n){this.buffer.push(n)},e.prototype._complete=function(){var n=this.buffer;n&&this.destination.next(n),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 n=this.closingSubscription;n&&(this.remove(n),n.unsubscribe());var r=this.buffer;this.buffer&&this.destination.next(r),this.buffer=[];var i;try{var s=this.closingSelector;i=s()}catch(o){return this.error(o)}n=new se,this.closingSubscription=n,this.add(n),this.subscribing=!0,n.add(ce(i,new oe(this))),this.subscribing=!1},e}(ae);function I2(t){return function(n){var r=new x2(t),i=n.lift(r);return r.caught=i}}var x2=function(){function t(e){this.selector=e}return t.prototype.call=function(e,n){return n.subscribe(new k2(e,this.selector,this.caught))},t}(),k2=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.selector=r,s.caught=i,s}return e.prototype.error=function(n){if(!this.isStopped){var r=void 0;try{r=this.selector(n,this.caught)}catch(o){t.prototype.error.call(this,o);return}this._unsubscribeAndRecycle();var i=new oe(this);this.add(i);var s=ce(r,i);s!==i&&this.add(s)}},e}(ae);function R2(t){return function(e){return e.lift(new Oa(t))}}function M2(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null;return typeof t[t.length-1]=="function"&&(n=t.pop()),t.length===1&&Me(t[0])&&(t=t[0].slice()),function(r){return r.lift.call(_t([r].concat(t)),new Oa(n))}}function A2(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return n.lift.call(er.apply(void 0,[n].concat(t)))}}function nd(t,e){return Gt(t,e,1)}function T2(t,e){return nd(function(){return t},e)}function N2(t){return function(e){return e.lift(new O2(t,e))}}var O2=function(){function t(e,n){this.predicate=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new L2(e,this.predicate,this.source))},t}(),L2=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.predicate=r,s.source=i,s.count=0,s.index=0,s}return e.prototype._next=function(n){this.predicate?this._tryPredicate(n):this.count++},e.prototype._tryPredicate=function(n){var r;try{r=this.predicate(n,this.index++,this.source)}catch(i){this.destination.error(i);return}r&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(M);function j2(t){return function(e){return e.lift(new $2(t))}}var $2=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new P2(e,this.durationSelector))},t}(),P2=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.durationSelector=r,i.hasValue=!1,i}return e.prototype._next=function(n){try{var r=this.durationSelector.call(this,n);r&&this._tryNext(n,r)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(n,r){var i=this.durationSubscription;this.value=n,this.hasValue=!0,i&&(i.unsubscribe(),this.remove(i)),i=ce(r,new oe(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 n=this.value,r=this.durationSubscription;r&&(this.durationSubscription=void 0,r.unsubscribe(),this.remove(r)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,n)}},e}(ae);function D2(t,e){return e===void 0&&(e=Ae),function(n){return n.lift(new F2(t,e))}}var F2=function(){function t(e,n){this.dueTime=e,this.scheduler=n}return t.prototype.call=function(e,n){return n.subscribe(new B2(e,this.dueTime,this.scheduler))},t}(),B2=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.dueTime=r,s.scheduler=i,s.debouncedSubscription=null,s.lastValue=null,s.hasValue=!1,s}return e.prototype._next=function(n){this.clearDebounce(),this.lastValue=n,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(V2,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var n=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(n)}},e.prototype.clearDebounce=function(){var n=this.debouncedSubscription;n!==null&&(this.remove(n),n.unsubscribe(),this.debouncedSubscription=null)},e}(M);function V2(t){t.debouncedNext()}function Er(t){return t===void 0&&(t=null),function(e){return e.lift(new H2(t))}}var H2=function(){function t(e){this.defaultValue=e}return t.prototype.call=function(e,n){return n.subscribe(new W2(e,this.defaultValue))},t}(),W2=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.defaultValue=r,i.isEmpty=!0,i}return e.prototype._next=function(n){this.isEmpty=!1,this.destination.next(n)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(M);function rd(t){return t instanceof Date&&!isNaN(+t)}function U2(t,e){e===void 0&&(e=Ae);var n=rd(t),r=n?+t-e.now():Math.abs(t);return function(i){return i.lift(new z2(r,e))}}var z2=function(){function t(e,n){this.delay=e,this.scheduler=n}return t.prototype.call=function(e,n){return n.subscribe(new q2(e,this.delay,this.scheduler))},t}(),q2=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.delay=r,s.scheduler=i,s.queue=[],s.active=!1,s.errored=!1,s}return e.dispatch=function(n){for(var r=n.source,i=r.queue,s=n.scheduler,o=n.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(n,a)}else this.unsubscribe(),r.active=!1},e.prototype._schedule=function(n){this.active=!0;var r=this.destination;r.add(n.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:n}))},e.prototype.scheduleNotification=function(n){if(this.errored!==!0){var r=this.scheduler,i=new G2(r.now()+this.delay,n);this.queue.push(i),this.active===!1&&this._schedule(r)}},e.prototype._next=function(n){this.scheduleNotification(mt.createNext(n))},e.prototype._error=function(n){this.errored=!0,this.queue=[],this.destination.error(n),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(mt.createComplete()),this.unsubscribe()},e}(M),G2=function(){function t(e,n){this.time=e,this.notification=n}return t}();function J2(t,e){return e?function(n){return new Z2(n,e).lift(new tl(t))}:function(n){return n.lift(new tl(t))}}var tl=function(){function t(e){this.delayDurationSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new Q2(e,this.delayDurationSelector))},t}(),Q2=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.delayDurationSelector=r,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return e.prototype.notifyNext=function(n,r,i,s,o){this.destination.next(n),this.removeSubscription(o),this.tryComplete()},e.prototype.notifyError=function(n,r){this._error(n)},e.prototype.notifyComplete=function(n){var r=this.removeSubscription(n);r&&this.destination.next(r),this.tryComplete()},e.prototype._next=function(n){var r=this.index++;try{var i=this.delayDurationSelector(n,r);i&&this.tryDelay(i,n)}catch(s){this.destination.error(s)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(n){n.unsubscribe();var r=this.delayNotifierSubscriptions.indexOf(n);return r!==-1&&this.delayNotifierSubscriptions.splice(r,1),n.outerValue},e.prototype.tryDelay=function(n,r){var i=yt(this,n,r);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}(Kt),Z2=function(t){g(e,t);function e(n,r){var i=t.call(this)||this;return i.source=n,i.subscriptionDelay=r,i}return e.prototype._subscribe=function(n){this.subscriptionDelay.subscribe(new Y2(n,this.source))},e}(V),Y2=function(t){g(e,t);function e(n,r){var i=t.call(this)||this;return i.parent=n,i.source=r,i.sourceSubscribed=!1,i}return e.prototype._next=function(n){this.subscribeToSource()},e.prototype._error=function(n){this.unsubscribe(),this.parent.error(n)},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}(M);function K2(){return function(e){return e.lift(new X2)}}var X2=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new eS(e))},t}(),eS=function(t){g(e,t);function e(n){return t.call(this,n)||this}return e.prototype._next=function(n){n.observe(this.destination)},e}(M);function tS(t,e){return function(n){return n.lift(new nS(t,e))}}var nS=function(){function t(e,n){this.keySelector=e,this.flushes=n}return t.prototype.call=function(e,n){return n.subscribe(new rS(e,this.keySelector,this.flushes))},t}(),rS=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.keySelector=r,s.values=new Set,i&&s.add(ce(i,new oe(s))),s}return e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(n){this._error(n)},e.prototype._next=function(n){this.keySelector?this._useKeySelector(n):this._finalizeNext(n,n)},e.prototype._useKeySelector=function(n){var r,i=this.destination;try{r=this.keySelector(n)}catch(s){i.error(s);return}this._finalizeNext(r,n)},e.prototype._finalizeNext=function(n,r){var i=this.values;i.has(n)||(i.add(n),this.destination.next(r))},e}(ae);function id(t,e){return function(n){return n.lift(new iS(t,e))}}var iS=function(){function t(e,n){this.compare=e,this.keySelector=n}return t.prototype.call=function(e,n){return n.subscribe(new sS(e,this.compare,this.keySelector))},t}(),sS=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.keySelector=i,s.hasKey=!1,typeof r=="function"&&(s.compare=r),s}return e.prototype.compare=function(n,r){return n===r},e.prototype._next=function(n){var r;try{var i=this.keySelector;r=i?i(n):n}catch(a){return this.destination.error(a)}var s=!1;if(this.hasKey)try{var o=this.compare;s=o(this.key,r)}catch(a){return this.destination.error(a)}else this.hasKey=!0;s||(this.key=r,this.destination.next(n))},e}(M);function oS(t,e){return id(function(n,r){return e?e(n[t],r[t]):n[t]===r[t]})}function zi(t){return t===void 0&&(t=uS),function(e){return e.lift(new aS(t))}}var aS=function(){function t(e){this.errorFactory=e}return t.prototype.call=function(e,n){return n.subscribe(new cS(e,this.errorFactory))},t}(),cS=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.errorFactory=r,i.hasValue=!1,i}return e.prototype._next=function(n){this.hasValue=!0,this.destination.next(n)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var n=void 0;try{n=this.errorFactory()}catch(r){n=r}this.destination.error(n)},e}(M);function uS(){return new wr}function Ja(t){return function(e){return t===0?Ln():e.lift(new lS(t))}}var lS=function(){function t(e){if(this.total=e,this.total<0)throw new wn}return t.prototype.call=function(e,n){return n.subscribe(new hS(e,this.total))},t}(),hS=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.total=r,i.count=0,i}return e.prototype._next=function(n){var r=this.total,i=++this.count;i<=r&&(this.destination.next(n),i===r&&(this.destination.complete(),this.unsubscribe()))},e}(M);function fS(t,e){if(t<0)throw new wn;var n=arguments.length>=2;return function(r){return r.pipe(Nt(function(i,s){return s===t}),Ja(1),n?Er(e):zi(function(){return new wn}))}}function dS(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return er(n,Mi.apply(void 0,t))}}function pS(t,e){return function(n){return n.lift(new bS(t,e,n))}}var bS=function(){function t(e,n,r){this.predicate=e,this.thisArg=n,this.source=r}return t.prototype.call=function(e,n){return n.subscribe(new gS(e,this.predicate,this.thisArg,this.source))},t}(),gS=function(t){g(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.predicate=r,o.thisArg=i,o.source=s,o.index=0,o.thisArg=i||o,o}return e.prototype.notifyComplete=function(n){this.destination.next(n),this.destination.complete()},e.prototype._next=function(n){var r=!1;try{r=this.predicate.call(this.thisArg,n,this.index++,this.source)}catch(i){this.destination.error(i);return}r||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(M);function mS(){return function(t){return t.lift(new yS)}}var yS=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new vS(e))},t}(),vS=function(t){g(e,t);function e(n){var r=t.call(this,n)||this;return r.hasCompleted=!1,r.hasSubscription=!1,r}return e.prototype._next=function(n){this.hasSubscription||(this.hasSubscription=!0,this.add(ce(n,new oe(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}(ae);function sd(t,e){return e?function(n){return n.pipe(sd(function(r,i){return _t(t(r,i)).pipe(ze(function(s,o){return e(r,s,i,o)}))}))}:function(n){return n.lift(new _S(t))}}var _S=function(){function t(e){this.project=e}return t.prototype.call=function(e,n){return n.subscribe(new wS(e,this.project))},t}(),wS=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.project=r,i.hasSubscription=!1,i.hasCompleted=!1,i.index=0,i}return e.prototype._next=function(n){this.hasSubscription||this.tryNext(n)},e.prototype.tryNext=function(n){var r,i=this.index++;try{r=this.project(n,i)}catch(s){this.destination.error(s);return}this.hasSubscription=!0,this._innerSub(r)},e.prototype._innerSub=function(n){var r=new oe(this),i=this.destination;i.add(r);var s=ce(n,r);s!==r&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(n){this.destination.next(n)},e.prototype.notifyError=function(n){this.destination.error(n)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(ae);function SS(t,e,n){return e===void 0&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(r){return r.lift(new ES(t,e,n))}}var ES=function(){function t(e,n,r){this.project=e,this.concurrent=n,this.scheduler=r}return t.prototype.call=function(e,n){return n.subscribe(new CS(e,this.project,this.concurrent,this.scheduler))},t}(),CS=function(t){g(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.project=r,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(n){var r=n.subscriber,i=n.result,s=n.value,o=n.index;r.subscribeToProjection(i,s,o)},e.prototype._next=function(n){var r=this.destination;if(r.closed){this._complete();return}var i=this.index++;if(this.active<this.concurrent){r.next(n);try{var s=this.project,o=s(n,i);if(!this.scheduler)this.subscribeToProjection(o,n,i);else{var a={subscriber:this,result:o,value:n,index:i},c=this.destination;c.add(this.scheduler.schedule(e.dispatch,0,a))}}catch(u){r.error(u)}}else this.buffer.push(n)},e.prototype.subscribeToProjection=function(n,r,i){this.active++;var s=this.destination;s.add(ce(n,new oe(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&this.active===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(n){this._next(n)},e.prototype.notifyComplete=function(){var n=this.buffer;this.active--,n&&n.length>0&&this._next(n.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},e}(ae);function IS(t){return function(e){return e.lift(new xS(t))}}var xS=function(){function t(e){this.callback=e}return t.prototype.call=function(e,n){return n.subscribe(new kS(e,this.callback))},t}(),kS=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.add(new se(r)),i}return e}(M);function RS(t,e){if(typeof t!="function")throw new TypeError("predicate is not a function");return function(n){return n.lift(new od(t,n,!1,e))}}var od=function(){function t(e,n,r,i){this.predicate=e,this.source=n,this.yieldIndex=r,this.thisArg=i}return t.prototype.call=function(e,n){return n.subscribe(new MS(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),MS=function(t){g(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;return a.predicate=r,a.source=i,a.yieldIndex=s,a.thisArg=o,a.index=0,a}return e.prototype.notifyComplete=function(n){var r=this.destination;r.next(n),r.complete(),this.unsubscribe()},e.prototype._next=function(n){var r=this,i=r.predicate,s=r.thisArg,o=this.index++;try{var a=i.call(s||this,n,o,this.source);a&&this.notifyComplete(this.yieldIndex?o:n)}catch(c){this.destination.error(c)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(M);function AS(t,e){return function(n){return n.lift(new od(t,n,!0,e))}}function TS(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Nt(function(i,s){return t(i,s,r)}):At,Ja(1),n?Er(e):zi(function(){return new wr}))}}function NS(){return function(e){return e.lift(new OS)}}var OS=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new LS(e))},t}(),LS=function(t){g(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._next=function(n){},e}(M);function jS(){return function(t){return t.lift(new $S)}}var $S=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new PS(e))},t}(),PS=function(t){g(e,t);function e(n){return t.call(this,n)||this}return e.prototype.notifyComplete=function(n){var r=this.destination;r.next(n),r.complete()},e.prototype._next=function(n){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(M);function Kr(t){return function(n){return t===0?Ln():n.lift(new DS(t))}}var DS=function(){function t(e){if(this.total=e,this.total<0)throw new wn}return t.prototype.call=function(e,n){return n.subscribe(new FS(e,this.total))},t}(),FS=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.total=r,i.ring=new Array,i.count=0,i}return e.prototype._next=function(n){var r=this.ring,i=this.total,s=this.count++;if(r.length<i)r.push(n);else{var o=s%i;r[o]=n}},e.prototype._complete=function(){var n=this.destination,r=this.count;if(r>0)for(var i=this.count>=this.total?this.total:this.count,s=this.ring,o=0;o<i;o++){var a=r++%i;n.next(s[a])}n.complete()},e}(M);function BS(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Nt(function(i,s){return t(i,s,r)}):At,Kr(1),n?Er(e):zi(function(){return new wr}))}}function VS(t){return function(e){return e.lift(new HS(t))}}var HS=function(){function t(e){this.value=e}return t.prototype.call=function(e,n){return n.subscribe(new WS(e,this.value))},t}(),WS=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.value=r,i}return e.prototype._next=function(n){this.destination.next(this.value)},e}(M);function US(){return function(e){return e.lift(new zS)}}var zS=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new qS(e))},t}(),qS=function(t){g(e,t);function e(n){return t.call(this,n)||this}return e.prototype._next=function(n){this.destination.next(mt.createNext(n))},e.prototype._error=function(n){var r=this.destination;r.next(mt.createError(n)),r.complete()},e.prototype._complete=function(){var n=this.destination;n.next(mt.createComplete()),n.complete()},e}(M);function Xr(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new GS(t,e,n))}}var GS=function(){function t(e,n,r){r===void 0&&(r=!1),this.accumulator=e,this.seed=n,this.hasSeed=r}return t.prototype.call=function(e,n){return n.subscribe(new JS(e,this.accumulator,this.seed,this.hasSeed))},t}(),JS=function(t){g(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.accumulator=r,o._seed=i,o.hasSeed=s,o.index=0,o}return Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(n){this.hasSeed=!0,this._seed=n},enumerable:!0,configurable:!0}),e.prototype._next=function(n){if(!this.hasSeed)this.seed=n,this.destination.next(n);else return this._tryNext(n)},e.prototype._tryNext=function(n){var r=this.index++,i;try{i=this.accumulator(this.seed,n,r)}catch(s){this.destination.error(s)}this.seed=i,this.destination.next(i)},e}(M);function qi(t,e){return arguments.length>=2?function(r){return Fo(Xr(t,e),Kr(1),Er(e))(r)}:function(r){return Fo(Xr(function(i,s,o){return t(i,s,o+1)}),Kr(1))(r)}}function QS(t){var e=typeof t=="function"?function(n,r){return t(n,r)>0?n:r}:function(n,r){return n>r?n:r};return qi(e)}function ZS(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return n.lift.call(Tf.apply(void 0,[n].concat(t)))}}function YS(t,e,n){return n===void 0&&(n=Number.POSITIVE_INFINITY),typeof e=="function"?Gt(function(){return t},e,n):(typeof e=="number"&&(n=e),Gt(function(){return t},n))}function KS(t,e,n){return n===void 0&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new XS(t,e,n))}}var XS=function(){function t(e,n,r){this.accumulator=e,this.seed=n,this.concurrent=r}return t.prototype.call=function(e,n){return n.subscribe(new eE(e,this.accumulator,this.seed,this.concurrent))},t}(),eE=function(t){g(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.accumulator=r,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(n){if(this.active<this.concurrent){var r=this.index++,i=this.destination,s=void 0;try{var o=this.accumulator;s=o(this.acc,n,r)}catch(a){return i.error(a)}this.active++,this._innerSub(s)}else this.buffer.push(n)},e.prototype._innerSub=function(n){var r=new oe(this),i=this.destination;i.add(r);var s=ce(n,r);s!==r&&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(n){var r=this.destination;this.acc=n,this.hasValue=!0,r.next(n)},e.prototype.notifyComplete=function(){var n=this.buffer;this.active--,n.length>0?this._next(n.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},e}(ae);function tE(t){var e=typeof t=="function"?function(n,r){return t(n,r)<0?n:r}:function(n,r){return n<r?n:r};return qi(e)}function Jt(t,e){return function(r){var i;if(typeof t=="function"?i=t:i=function(){return t},typeof e=="function")return r.lift(new nE(i,e));var s=Object.create(r,Lv);return s.source=r,s.subjectFactory=i,s}}var nE=function(){function t(e,n){this.subjectFactory=e,this.selector=n}return t.prototype.call=function(e,n){var r=this.selector,i=this.subjectFactory(),s=r(i).subscribe(e);return s.add(n.subscribe(i)),s},t}();function rE(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1&&Me(t[0])&&(t=t[0]),function(n){return n.lift(new iE(t))}}var iE=function(){function t(e){this.nextSources=e}return t.prototype.call=function(e,n){return n.subscribe(new sE(e,this.nextSources))},t}(),sE=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.destination=n,i.nextSources=r,i}return e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(n){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var n=this.nextSources.shift();if(n){var r=new oe(this),i=this.destination;i.add(r);var s=ce(n,r);s!==r&&i.add(s)}else this.destination.complete()},e}(ae);function oE(){return function(t){return t.lift(new aE)}}var aE=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new cE(e))},t}(),cE=function(t){g(e,t);function e(n){var r=t.call(this,n)||this;return r.hasPrev=!1,r}return e.prototype._next=function(n){var r;this.hasPrev?r=[this.prev,n]:this.hasPrev=!0,this.prev=n,r&&this.destination.next(r)},e}(M);function uE(t,e){return function(n){return[Nt(t,e)(n),Nt(Of(t,e))(n)]}}function lE(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(n===0)throw new Error("list of properties cannot be empty.");return function(r){return ze(hE(t,n))(r)}}function hE(t,e){var n=function(r){for(var i=r,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 n}function fE(t){return t?Jt(function(){return new ye},t):Jt(new ye)}function dE(t){return function(e){return Jt(new ff(t))(e)}}function pE(){return function(t){return Jt(new jn)(t)}}function bE(t,e,n,r){n&&typeof n!="function"&&(r=n);var i=typeof n=="function"?n:void 0,s=new Na(t,e,r);return function(o){return Jt(function(){return s},i)(o)}}function gE(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return t.length===1&&Me(t[0])&&(t=t[0]),r.lift.call(Lf.apply(void 0,[r].concat(t)))}}function mE(t){return t===void 0&&(t=-1),function(e){return t===0?Ln():t<0?e.lift(new nl(-1,e)):e.lift(new nl(t-1,e))}}var nl=function(){function t(e,n){this.count=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new yE(e,this.count,this.source))},t}(),yE=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.count=r,s.source=i,s}return e.prototype.complete=function(){if(!this.isStopped){var n=this,r=n.source,i=n.count;if(i===0)return t.prototype.complete.call(this);i>-1&&(this.count=i-1),r.subscribe(this._unsubscribeAndRecycle())}},e}(M);function vE(t){return function(e){return e.lift(new _E(t))}}var _E=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,n){return n.subscribe(new wE(e,this.notifier,n))},t}(),wE=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.notifier=r,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 n=this,r=n.notifications,i=n.retriesSubscription;r&&(r.unsubscribe(),this.notifications=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var n=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=n,this},e.prototype.subscribeToRetries=function(){this.notifications=new ye;var n;try{var r=this.notifier;n=r(this.notifications)}catch{return t.prototype.complete.call(this)}this.retries=n,this.retriesSubscription=ce(n,new oe(this))},e}(ae);function SE(t){return t===void 0&&(t=-1),function(e){return e.lift(new EE(t,e))}}var EE=function(){function t(e,n){this.count=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new CE(e,this.count,this.source))},t}(),CE=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.count=r,s.source=i,s}return e.prototype.error=function(n){if(!this.isStopped){var r=this,i=r.source,s=r.count;if(s===0)return t.prototype.error.call(this,n);s>-1&&(this.count=s-1),i.subscribe(this._unsubscribeAndRecycle())}},e}(M);function IE(t){return function(e){return e.lift(new xE(t,e))}}var xE=function(){function t(e,n){this.notifier=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new kE(e,this.notifier,this.source))},t}(),kE=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.notifier=r,s.source=i,s}return e.prototype.error=function(n){if(!this.isStopped){var r=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{r=new ye;try{var o=this.notifier;i=o(r)}catch(a){return t.prototype.error.call(this,a)}s=ce(i,new oe(this))}this._unsubscribeAndRecycle(),this.errors=r,this.retries=i,this.retriesSubscription=s,r.next(n)}},e.prototype._unsubscribe=function(){var n=this,r=n.errors,i=n.retriesSubscription;r&&(r.unsubscribe(),this.errors=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var n=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=n,this.source.subscribe(this)},e}(ae);function RE(t){return function(e){return e.lift(new ME(t))}}var ME=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,n){var r=new AE(e),i=n.subscribe(r);return i.add(ce(this.notifier,new oe(r))),i},t}(),AE=function(t){g(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.hasValue=!1,n}return e.prototype._next=function(n){this.value=n,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}(ae);function TE(t,e){return e===void 0&&(e=Ae),function(n){return n.lift(new NE(t,e))}}var NE=function(){function t(e,n){this.period=e,this.scheduler=n}return t.prototype.call=function(e,n){return n.subscribe(new OE(e,this.period,this.scheduler))},t}(),OE=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.period=r,s.scheduler=i,s.hasValue=!1,s.add(i.schedule(LE,r,{subscriber:s,period:r})),s}return e.prototype._next=function(n){this.lastValue=n,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(M);function LE(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}function jE(t,e){return function(n){return n.lift(new $E(t,e))}}var $E=function(){function t(e,n){this.compareTo=e,this.comparator=n}return t.prototype.call=function(e,n){return n.subscribe(new PE(e,this.compareTo,this.comparator))},t}(),PE=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.compareTo=r,s.comparator=i,s._a=[],s._b=[],s._oneComplete=!1,s.destination.add(r.subscribe(new DE(n,s))),s}return e.prototype._next=function(n){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(n),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 n=this,r=n._a,i=n._b,s=n.comparator;r.length>0&&i.length>0;){var o=r.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(n){var r=this.destination;r.next(n),r.complete()},e.prototype.nextB=function(n){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(n),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},e}(M),DE=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.parent=r,i}return e.prototype._next=function(n){this.parent.nextB(n)},e.prototype._error=function(n){this.parent.error(n),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(M);function FE(){return new ye}function BE(){return function(t){return Ma()(Jt(FE)(t))}}function VE(t,e,n){var r;return t&&typeof t=="object"?r=t:r={bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(i){return i.lift(HE(r))}}function HE(t){var e=t.bufferSize,n=e===void 0?Number.POSITIVE_INFINITY:e,r=t.windowTime,i=r===void 0?Number.POSITIVE_INFINITY:r,s=t.refCount,o=t.scheduler,a,c=0,u,l=!1,h=!1;return function(d){c++;var p;!a||l?(l=!1,a=new Na(n,i,o),p=a.subscribe(this),u=d.subscribe({next:function(_){a.next(_)},error:function(_){l=!0,a.error(_)},complete:function(){h=!0,u=void 0,a.complete()}}),h&&(u=void 0)):p=a.subscribe(this),this.add(function(){c--,p.unsubscribe(),p=void 0,u&&!h&&s&&c===0&&(u.unsubscribe(),u=void 0,a=void 0)})}}function WE(t){return function(e){return e.lift(new UE(t,e))}}var UE=function(){function t(e,n){this.predicate=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new zE(e,this.predicate,this.source))},t}(),zE=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.predicate=r,s.source=i,s.seenValue=!1,s.index=0,s}return e.prototype.applySingleValue=function(n){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=n)},e.prototype._next=function(n){var r=this.index++;this.predicate?this.tryNext(n,r):this.applySingleValue(n)},e.prototype.tryNext=function(n,r){try{this.predicate(n,r,this.source)&&this.applySingleValue(n)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){var n=this.destination;this.index>0?(n.next(this.seenValue?this.singleValue:void 0),n.complete()):n.error(new wr)},e}(M);function qE(t){return function(e){return e.lift(new GE(t))}}var GE=function(){function t(e){this.total=e}return t.prototype.call=function(e,n){return n.subscribe(new JE(e,this.total))},t}(),JE=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.total=r,i.count=0,i}return e.prototype._next=function(n){++this.count>this.total&&this.destination.next(n)},e}(M);function QE(t){return function(e){return e.lift(new ZE(t))}}var ZE=function(){function t(e){if(this._skipCount=e,this._skipCount<0)throw new wn}return t.prototype.call=function(e,n){return this._skipCount===0?n.subscribe(new M(e)):n.subscribe(new YE(e,this._skipCount))},t}(),YE=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i._skipCount=r,i._count=0,i._ring=new Array(r),i}return e.prototype._next=function(n){var r=this._skipCount,i=this._count++;if(i<r)this._ring[i]=n;else{var s=i%r,o=this._ring,a=o[s];o[s]=n,this.destination.next(a)}},e}(M);function KE(t){return function(e){return e.lift(new XE(t))}}var XE=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,n){return n.subscribe(new e3(e,this.notifier))},t}(),e3=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;i.hasValue=!1;var s=new oe(i);i.add(s),i.innerSubscription=s;var o=ce(r,s);return o!==s&&(i.add(o),i.innerSubscription=o),i}return e.prototype._next=function(n){this.hasValue&&t.prototype._next.call(this,n)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(ae);function t3(t){return function(e){return e.lift(new n3(t))}}var n3=function(){function t(e){this.predicate=e}return t.prototype.call=function(e,n){return n.subscribe(new r3(e,this.predicate))},t}(),r3=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.predicate=r,i.skipping=!0,i.index=0,i}return e.prototype._next=function(n){var r=this.destination;this.skipping&&this.tryCallPredicate(n),this.skipping||r.next(n)},e.prototype.tryCallPredicate=function(n){try{var r=this.predicate(n,this.index++);this.skipping=!!r}catch(i){this.destination.error(i)}},e}(M);function i3(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return $e(n)?(t.pop(),function(r){return er(t,r,n)}):function(r){return er(t,r)}}var s3=function(t){g(e,t);function e(n,r,i){r===void 0&&(r=0),i===void 0&&(i=Dr);var s=t.call(this)||this;return s.source=n,s.delayTime=r,s.scheduler=i,(!Sn(r)||r<0)&&(s.delayTime=0),(!i||typeof i.schedule!="function")&&(s.scheduler=Dr),s}return e.create=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=Dr),new e(n,r,i)},e.dispatch=function(n){var r=n.source,i=n.subscriber;return this.add(r.subscribe(i))},e.prototype._subscribe=function(n){var r=this.delayTime,i=this.source,s=this.scheduler;return s.schedule(e.dispatch,r,{source:i,subscriber:n})},e}(V);function o3(t,e){return e===void 0&&(e=0),function(r){return r.lift(new a3(t,e))}}var a3=function(){function t(e,n){this.scheduler=e,this.delay=n}return t.prototype.call=function(e,n){return new s3(n,this.delay,this.scheduler).subscribe(e)},t}();function tr(t,e){return typeof e=="function"?function(n){return n.pipe(tr(function(r,i){return _t(t(r,i)).pipe(ze(function(s,o){return e(r,s,i,o)}))}))}:function(n){return n.lift(new c3(t))}}var c3=function(){function t(e){this.project=e}return t.prototype.call=function(e,n){return n.subscribe(new u3(e,this.project))},t}(),u3=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.project=r,i.index=0,i}return e.prototype._next=function(n){var r,i=this.index++;try{r=this.project(n,i)}catch(s){this.destination.error(s);return}this._innerSub(r)},e.prototype._innerSub=function(n){var r=this.innerSubscription;r&&r.unsubscribe();var i=new oe(this),s=this.destination;s.add(i),this.innerSubscription=ce(n,i),this.innerSubscription!==i&&s.add(this.innerSubscription)},e.prototype._complete=function(){var n=this.innerSubscription;(!n||n.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(n){this.destination.next(n)},e}(ae);function l3(){return tr(At)}function h3(t,e){return e?tr(function(){return t},e):tr(function(){return t})}function f3(t){return function(e){return e.lift(new d3(t))}}var d3=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,n){var r=new p3(e),i=ce(this.notifier,new oe(r));return i&&!r.seenValue?(r.add(i),n.subscribe(r)):r},t}(),p3=function(t){g(e,t);function e(n){var r=t.call(this,n)||this;return r.seenValue=!1,r}return e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(ae);function b3(t,e){return e===void 0&&(e=!1),function(n){return n.lift(new g3(t,e))}}var g3=function(){function t(e,n){this.predicate=e,this.inclusive=n}return t.prototype.call=function(e,n){return n.subscribe(new m3(e,this.predicate,this.inclusive))},t}(),m3=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.predicate=r,s.inclusive=i,s.index=0,s}return e.prototype._next=function(n){var r=this.destination,i;try{i=this.predicate(n,this.index++)}catch(s){r.error(s);return}this.nextOrComplete(n,i)},e.prototype.nextOrComplete=function(n,r){var i=this.destination;r?i.next(n):(this.inclusive&&i.next(n),i.complete())},e}(M);function y3(t,e,n){return function(i){return i.lift(new v3(t,e,n))}}var v3=function(){function t(e,n,r){this.nextOrObserver=e,this.error=n,this.complete=r}return t.prototype.call=function(e,n){return n.subscribe(new _3(e,this.nextOrObserver,this.error,this.complete))},t}(),_3=function(t){g(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o._tapNext=st,o._tapError=st,o._tapComplete=st,o._tapError=i||st,o._tapComplete=s||st,vn(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||st,o._tapError=r.error||st,o._tapComplete=r.complete||st),o}return e.prototype._next=function(n){try{this._tapNext.call(this._context,n)}catch(r){this.destination.error(r);return}this.destination.next(n)},e.prototype._error=function(n){try{this._tapError.call(this._context,n)}catch(r){this.destination.error(r);return}this.destination.error(n)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(n){this.destination.error(n);return}return this.destination.complete()},e}(M),ad={leading:!0,trailing:!1};function w3(t,e){return e===void 0&&(e=ad),function(n){return n.lift(new S3(t,!!e.leading,!!e.trailing))}}var S3=function(){function t(e,n,r){this.durationSelector=e,this.leading=n,this.trailing=r}return t.prototype.call=function(e,n){return n.subscribe(new E3(e,this.durationSelector,this.leading,this.trailing))},t}(),E3=function(t){g(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.destination=n,o.durationSelector=r,o._leading=i,o._trailing=s,o._hasValue=!1,o}return e.prototype._next=function(n){this._hasValue=!0,this._sendValue=n,this._throttled||(this._leading?this.send():this.throttle(n))},e.prototype.send=function(){var n=this,r=n._hasValue,i=n._sendValue;r&&(this.destination.next(i),this.throttle(i)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(n){var r=this.tryDurationSelector(n);r&&this.add(this._throttled=ce(r,new oe(this)))},e.prototype.tryDurationSelector=function(n){try{return this.durationSelector(n)}catch(r){return this.destination.error(r),null}},e.prototype.throttlingDone=function(){var n=this,r=n._throttled,i=n._trailing;r&&r.unsubscribe(),this._throttled=void 0,i&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(ae);function C3(t,e,n){return e===void 0&&(e=Ae),n===void 0&&(n=ad),function(r){return r.lift(new I3(t,e,n.leading,n.trailing))}}var I3=function(){function t(e,n,r,i){this.duration=e,this.scheduler=n,this.leading=r,this.trailing=i}return t.prototype.call=function(e,n){return n.subscribe(new x3(e,this.duration,this.scheduler,this.leading,this.trailing))},t}(),x3=function(t){g(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;return a.duration=r,a.scheduler=i,a.leading=s,a.trailing=o,a._hasTrailingValue=!1,a._trailingValue=null,a}return e.prototype._next=function(n){this.throttled?this.trailing&&(this._trailingValue=n,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(k3,this.duration,{subscriber:this})),this.leading?this.destination.next(n):this.trailing&&(this._trailingValue=n,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 n=this.throttled;n&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),n.unsubscribe(),this.remove(n),this.throttled=null)},e}(M);function k3(t){var e=t.subscriber;e.clearThrottle()}function R3(t){return t===void 0&&(t=Ae),function(e){return ja(function(){return e.pipe(Xr(function(n,r){var i=n.current;return{value:r,current:t.now(),last:i}},{current:t.now(),value:void 0,last:void 0}),ze(function(n){var r=n.current,i=n.last,s=n.value;return new M3(s,r-i)}))})}}var M3=function(){function t(e,n){this.value=e,this.interval=n}return t}();function cd(t,e,n){return n===void 0&&(n=Ae),function(r){var i=rd(t),s=i?+t-n.now():Math.abs(t);return r.lift(new A3(s,i,e,n))}}var A3=function(){function t(e,n,r,i){this.waitFor=e,this.absoluteTimeout=n,this.withObservable=r,this.scheduler=i}return t.prototype.call=function(e,n){return n.subscribe(new T3(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),T3=function(t){g(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;return a.absoluteTimeout=r,a.waitFor=i,a.withObservable=s,a.scheduler=o,a.scheduleTimeout(),a}return e.dispatchTimeout=function(n){var r=n.withObservable;n._unsubscribeAndRecycle(),n.add(ce(r,new oe(n)))},e.prototype.scheduleTimeout=function(){var n=this.action;n?this.action=n.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(n){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,n)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(ae);function N3(t,e){return e===void 0&&(e=Ae),cd(t,Ta(new wf),e)}function O3(t){return t===void 0&&(t=Ae),ze(function(e){return new L3(e,t.now())})}var L3=function(){function t(e,n){this.value=e,this.timestamp=n}return t}();function j3(t,e,n){return n===0?[e]:(t.push(e),t)}function $3(){return qi(j3,[])}function P3(t){return function(n){return n.lift(new D3(t))}}var D3=function(){function t(e){this.windowBoundaries=e}return t.prototype.call=function(e,n){var r=new F3(e),i=n.subscribe(r);return i.closed||r.add(ce(this.windowBoundaries,new oe(r))),i},t}(),F3=function(t){g(e,t);function e(n){var r=t.call(this,n)||this;return r.window=new ye,n.next(r.window),r}return e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(n){this._error(n)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(n){this.window.next(n)},e.prototype._error=function(n){this.window.error(n),this.destination.error(n)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var n=this.window;n&&n.complete();var r=this.destination,i=this.window=new ye;r.next(i)},e}(ae);function B3(t,e){return e===void 0&&(e=0),function(r){return r.lift(new V3(t,e))}}var V3=function(){function t(e,n){this.windowSize=e,this.startWindowEvery=n}return t.prototype.call=function(e,n){return n.subscribe(new H3(e,this.windowSize,this.startWindowEvery))},t}(),H3=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.destination=n,s.windowSize=r,s.startWindowEvery=i,s.windows=[new ye],s.count=0,n.next(s.windows[0]),s}return e.prototype._next=function(n){for(var r=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(n);var u=this.count-s+1;if(u>=0&&u%r===0&&!this.closed&&o.shift().complete(),++this.count%r===0&&!this.closed){var l=new ye;o.push(l),i.next(l)}},e.prototype._error=function(n){var r=this.windows;if(r)for(;r.length>0&&!this.closed;)r.shift().error(n);this.destination.error(n)},e.prototype._complete=function(){var n=this.windows;if(n)for(;n.length>0&&!this.closed;)n.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(M);function W3(t){var e=Ae,n=null,r=Number.POSITIVE_INFINITY;return $e(arguments[3])&&(e=arguments[3]),$e(arguments[2])?e=arguments[2]:Sn(arguments[2])&&(r=Number(arguments[2])),$e(arguments[1])?e=arguments[1]:Sn(arguments[1])&&(n=Number(arguments[1])),function(s){return s.lift(new U3(t,n,r,e))}}var U3=function(){function t(e,n,r,i){this.windowTimeSpan=e,this.windowCreationInterval=n,this.maxWindowSize=r,this.scheduler=i}return t.prototype.call=function(e,n){return n.subscribe(new q3(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),z3=function(t){g(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n._numberOfNextedValues=0,n}return e.prototype.next=function(n){this._numberOfNextedValues++,t.prototype.next.call(this,n)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(ye),q3=function(t){g(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;a.destination=n,a.windowTimeSpan=r,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:r,windowCreationInterval:i,subscriber:a,scheduler:o};a.add(o.schedule(ud,r,u)),a.add(o.schedule(J3,i,l))}else{var h={subscriber:a,window:c,windowTimeSpan:r};a.add(o.schedule(G3,r,h))}return a}return e.prototype._next=function(n){for(var r=this.windows,i=r.length,s=0;s<i;s++){var o=r[s];o.closed||(o.next(n),o.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(o))}},e.prototype._error=function(n){for(var r=this.windows;r.length>0;)r.shift().error(n);this.destination.error(n)},e.prototype._complete=function(){for(var n=this.windows;n.length>0;){var r=n.shift();r.closed||r.complete()}this.destination.complete()},e.prototype.openWindow=function(){var n=new z3;this.windows.push(n);var r=this.destination;return r.next(n),n},e.prototype.closeWindow=function(n){n.complete();var r=this.windows;r.splice(r.indexOf(n),1)},e}(M);function G3(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function J3(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,i=t.windowCreationInterval,s=n.openWindow(),o=this,a={action:o,subscription:null},c={subscriber:n,window:s,context:a};a.subscription=r.schedule(ud,e,c),o.add(a.subscription),o.schedule(t,i)}function ud(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}function Q3(t,e){return function(n){return n.lift(new Z3(t,e))}}var Z3=function(){function t(e,n){this.openings=e,this.closingSelector=n}return t.prototype.call=function(e,n){return n.subscribe(new Y3(e,this.openings,this.closingSelector))},t}(),Y3=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.openings=r,s.closingSelector=i,s.contexts=[],s.add(s.openSubscription=yt(s,r,r)),s}return e.prototype._next=function(n){var r=this.contexts;if(r)for(var i=r.length,s=0;s<i;s++)r[s].window.next(n)},e.prototype._error=function(n){var r=this.contexts;if(this.contexts=null,r)for(var i=r.length,s=-1;++s<i;){var o=r[s];o.window.error(n),o.subscription.unsubscribe()}t.prototype._error.call(this,n)},e.prototype._complete=function(){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var s=n[i];s.window.complete(),s.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var s=n[i];s.window.unsubscribe(),s.subscription.unsubscribe()}},e.prototype.notifyNext=function(n,r,i,s,o){if(n===this.openings){var a=void 0;try{var c=this.closingSelector;a=c(r)}catch(d){return this.error(d)}var u=new ye,l=new se,h={window:u,subscription:l};this.contexts.push(h);var f=yt(this,a,h);f.closed?this.closeWindow(this.contexts.length-1):(f.context=h,l.add(f)),this.destination.next(u)}else this.closeWindow(this.contexts.indexOf(n))},e.prototype.notifyError=function(n){this.error(n)},e.prototype.notifyComplete=function(n){n!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(n.context))},e.prototype.closeWindow=function(n){if(n!==-1){var r=this.contexts,i=r[n],s=i.window,o=i.subscription;r.splice(n,1),s.complete(),o.unsubscribe()}},e}(Kt);function K3(t){return function(n){return n.lift(new X3(t))}}var X3=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new e4(e,this.closingSelector))},t}(),e4=function(t){g(e,t);function e(n,r){var i=t.call(this,n)||this;return i.destination=n,i.closingSelector=r,i.openWindow(),i}return e.prototype.notifyNext=function(n,r,i,s,o){this.openWindow(o)},e.prototype.notifyError=function(n){this._error(n)},e.prototype.notifyComplete=function(n){this.openWindow(n)},e.prototype._next=function(n){this.window.next(n)},e.prototype._error=function(n){this.window.error(n),this.destination.error(n),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(n){n===void 0&&(n=null),n&&(this.remove(n),n.unsubscribe());var r=this.window;r&&r.complete();var i=this.window=new ye;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=yt(this,s))},e}(Kt);function t4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){var r;typeof t[t.length-1]=="function"&&(r=t.pop());var i=t;return n.lift(new n4(i,r))}}var n4=function(){function t(e,n){this.observables=e,this.project=n}return t.prototype.call=function(e,n){return n.subscribe(new r4(e,this.observables,this.project))},t}(),r4=function(t){g(e,t);function e(n,r,i){var s=t.call(this,n)||this;s.observables=r,s.project=i,s.toRespond=[];var o=r.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=r[a];s.add(yt(s,c,void 0,a))}return s}return e.prototype.notifyNext=function(n,r,i){this.values[i]=r;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(n){if(this.toRespond.length===0){var r=[n].concat(this.values);this.project?this._tryProject(r):this.destination.next(r)}},e.prototype._tryProject=function(n){var r;try{r=this.project.apply(this,n)}catch(i){this.destination.error(i);return}this.destination.next(r)},e}(Kt);function i4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call($f.apply(void 0,[r].concat(t)))}}function s4(t){return function(e){return e.lift(new Pf(t))}}const o4=Object.freeze(Object.defineProperty({__proto__:null,audit:ed,auditTime:o2,buffer:a2,bufferCount:l2,bufferTime:p2,bufferToggle:v2,bufferWhen:S2,catchError:I2,combineAll:R2,combineLatest:M2,concat:A2,concatAll:kf,concatMap:nd,concatMapTo:T2,count:N2,debounce:j2,debounceTime:D2,defaultIfEmpty:Er,delay:U2,delayWhen:J2,dematerialize:K2,distinct:tS,distinctUntilChanged:id,distinctUntilKeyChanged:oS,elementAt:fS,endWith:dS,every:pS,exhaust:mS,exhaustMap:sd,expand:SS,filter:Nt,finalize:IS,find:RS,findIndex:AS,first:TS,flatMap:R_,groupBy:$v,ignoreElements:NS,isEmpty:jS,last:BS,map:ze,mapTo:VS,materialize:US,max:QS,merge:ZS,mergeAll:La,mergeMap:Gt,mergeMapTo:YS,mergeScan:KS,min:tE,multicast:Jt,observeOn:qv,onErrorResumeNext:rE,pairwise:oE,partition:uE,pluck:lE,publish:fE,publishBehavior:dE,publishLast:pE,publishReplay:bE,race:gE,reduce:qi,refCount:Ma,repeat:mE,repeatWhen:vE,retry:SE,retryWhen:IE,sample:RE,sampleTime:TE,scan:Xr,sequenceEqual:jE,share:BE,shareReplay:VE,single:WE,skip:qE,skipLast:QE,skipUntil:KE,skipWhile:t3,startWith:i3,subscribeOn:o3,switchAll:l3,switchMap:tr,switchMapTo:h3,take:Ja,takeLast:Kr,takeUntil:f3,takeWhile:b3,tap:y3,throttle:w3,throttleTime:C3,throwIfEmpty:zi,timeInterval:R3,timeout:N3,timeoutWith:cd,timestamp:O3,toArray:$3,window:P3,windowCount:B3,windowTime:W3,windowToggle:Q3,windowWhen:K3,withLatestFrom:t4,zip:i4,zipAll:s4},Symbol.toStringTag,{value:"Module"})),Qa=xn(o4);var Gi={},Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.ClientMessagePublishEvent=Ve.ClientMessageSetSessionConfig=Ve.ClientMessageGetSessionConfig=Ve.ClientMessageIsLinked=Ve.ClientMessageHostSession=void 0;function a4(t){return Object.assign({type:"HostSession"},t)}Ve.ClientMessageHostSession=a4;function c4(t){return Object.assign({type:"IsLinked"},t)}Ve.ClientMessageIsLinked=c4;function u4(t){return Object.assign({type:"GetSessionConfig"},t)}Ve.ClientMessageGetSessionConfig=u4;function l4(t){return Object.assign({type:"SetSessionConfig"},t)}Ve.ClientMessageSetSessionConfig=l4;function h4(t){return Object.assign({type:"PublishEvent"},t)}Ve.ClientMessagePublishEvent=h4;var ld={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;const e=Ai,n=Qa;var r;(function(s){s[s.DISCONNECTED=0]="DISCONNECTED",s[s.CONNECTING=1]="CONNECTING",s[s.CONNECTED=2]="CONNECTED"})(r=t.ConnectionState||(t.ConnectionState={}));class i{constructor(o,a=WebSocket){this.WebSocketClass=a,this.webSocket=null,this.connectionStateSubject=new e.BehaviorSubject(r.DISCONNECTED),this.incomingDataSubject=new 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(r.CONNECTING),a.onclose=c=>{this.clearWebSocket(),o.error(new Error(`websocket error ${c.code}: ${c.reason}`)),this.connectionStateSubject.next(r.DISCONNECTED)},a.onopen=c=>{o.next(),o.complete(),this.connectionStateSubject.next(r.CONNECTED)},a.onmessage=c=>{this.incomingDataSubject.next(c.data)}}).pipe((0,n.take)(1))}disconnect(){const{webSocket:o}=this;if(o){this.clearWebSocket(),this.connectionStateSubject.next(r.DISCONNECTED);try{o.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,n.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})(ld);var Ji={};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.isServerMessageFail=void 0;function f4(t){return t&&t.type==="Fail"&&typeof t.id=="number"&&typeof t.sessionId=="string"&&typeof t.error=="string"}Ji.isServerMessageFail=f4;Object.defineProperty(Gi,"__esModule",{value:!0});Gi.WalletSDKConnection=void 0;const Ge=Ai,W=Qa,Bn=Rn,rn=ir,Vn=Ve,Hn=kn,Lr=ld,Io=Ji,rl=1e4,d4=6e4;class p4{constructor(e,n,r,i,s=WebSocket){this.sessionId=e,this.sessionKey=n,this.diagnostic=i,this.subscriptions=new Ge.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,rn.IntNumber)(1),this.connectedSubject=new Ge.BehaviorSubject(!1),this.linkedSubject=new Ge.BehaviorSubject(!1),this.sessionConfigSubject=new Ge.ReplaySubject(1);const o=new Lr.RxWebSocket(r+"/rpc",s);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,W.tap)(a=>{var c;return(c=this.diagnostic)===null||c===void 0?void 0:c.log(Hn.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:Bn.Session.hash(e)})}),(0,W.skip)(1),(0,W.filter)(a=>a===Lr.ConnectionState.DISCONNECTED&&!this.destroyed),(0,W.delay)(5e3),(0,W.filter)(a=>!this.destroyed),(0,W.flatMap)(a=>o.connect()),(0,W.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,W.skip)(2),(0,W.switchMap)(a=>(0,Ge.iif)(()=>a===Lr.ConnectionState.CONNECTED,this.authenticate().pipe((0,W.tap)(c=>this.sendIsLinked()),(0,W.tap)(c=>this.sendGetSessionConfig()),(0,W.map)(c=>!0)),(0,Ge.of)(!1))),(0,W.distinctUntilChanged)(),(0,W.catchError)(a=>(0,Ge.of)(!1))).subscribe(a=>this.connectedSubject.next(a))),this.subscriptions.add(o.connectionState$.pipe((0,W.skip)(1),(0,W.switchMap)(a=>(0,Ge.iif)(()=>a===Lr.ConnectionState.CONNECTED,(0,Ge.timer)(0,rl)))).subscribe(a=>a===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(o.incomingData$.pipe((0,W.filter)(a=>a==="h")).subscribe(a=>this.updateLastHeartbeat())),this.subscriptions.add(o.incomingJSONData$.pipe((0,W.filter)(a=>["IsLinkedOK","Linked"].includes(a.type))).subscribe(a=>{var c;const u=a;(c=this.diagnostic)===null||c===void 0||c.log(Hn.EVENTS.LINKED,{sessionIdHash:Bn.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,W.filter)(a=>["GetSessionConfigOK","SessionConfigUpdated"].includes(a.type))).subscribe(a=>{var c;const u=a;(c=this.diagnostic)===null||c===void 0||c.log(Hn.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Bn.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(Hn.EVENTS.STARTED_CONNECTING,{sessionIdHash:Bn.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(Hn.EVENTS.DISCONNECTED,{sessionIdHash:Bn.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,W.filter)(e=>e),(0,W.take)(1),(0,W.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,W.filter)(e=>e),(0,W.take)(1),(0,W.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,W.filter)(e=>{if(e.type!=="Event")return!1;const n=e;return typeof n.sessionId=="string"&&typeof n.eventId=="string"&&typeof n.event=="string"&&typeof n.data=="string"}),(0,W.map)(e=>e))}setSessionMetadata(e,n){const r=(0,Vn.ClientMessageSetSessionConfig)({id:(0,rn.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[e]:n}});return this.onceConnected$.pipe((0,W.flatMap)(i=>this.makeRequest(r)),(0,W.map)(i=>{if((0,Io.isServerMessageFail)(i))throw new Error(i.error||"failed to set session metadata")}))}publishEvent(e,n,r=!1){const i=(0,Vn.ClientMessagePublishEvent)({id:(0,rn.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:n,callWebhook:r});return this.onceLinked$.pipe((0,W.flatMap)(s=>this.makeRequest(i)),(0,W.map)(s=>{if((0,Io.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>rl*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}makeRequest(e,n=d4){const r=e.id;try{this.sendData(e)}catch(i){return(0,Ge.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,W.timeoutWith)(n,(0,Ge.throwError)(new Error(`request ${r} timed out`))),(0,W.filter)(i=>i.id===r),(0,W.take)(1))}authenticate(){const e=(0,Vn.ClientMessageHostSession)({id:(0,rn.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,W.map)(n=>{if((0,Io.isServerMessageFail)(n))throw new Error(n.error||"failed to authentcate")}))}sendIsLinked(){const e=(0,Vn.ClientMessageIsLinked)({id:(0,rn.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}sendGetSessionConfig(){const e=(0,Vn.ClientMessageGetSessionConfig)({id:(0,rn.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}Gi.WalletSDKConnection=p4;var Qi={};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.WalletUIError=void 0;class nr extends Error{constructor(e,n){super(e),this.message=e,this.errorCode=n}}Qi.WalletUIError=nr;nr.UserRejectedRequest=new nr("User rejected request");nr.SwitchEthereumChainUnsupportedChainId=new nr("Unsupported chainId",4902);var Cn={};Object.defineProperty(Cn,"__esModule",{value:!0});Cn.decrypt=Cn.encrypt=void 0;const ei=x;async function b4(t,e){if(e.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.importKey("raw",(0,ei.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},r,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),h=new Uint8Array([...n,...u,...l]);return(0,ei.uint8ArrayToHex)(h)}Cn.encrypt=b4;function g4(t,e){if(e.length!==64)throw Error("secret must be 256 bits");return new Promise((n,r)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,ei.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,ei.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 h=await window.crypto.subtle.decrypt(l,i,u),f=new TextDecoder;n(f.decode(h))}catch(h){r(h)}})()})}Cn.decrypt=g4;var Za={};(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={}))})(Za);var Zi={},Yi={};(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={}))})(Yi);Object.defineProperty(Zi,"__esModule",{value:!0});Zi.Web3RequestCanceledMessage=void 0;const m4=Yi;function y4(t){return{type:m4.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}}Zi.Web3RequestCanceledMessage=y4;var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.Web3RequestMessage=void 0;const v4=Yi;function _4(t){return Object.assign({type:v4.RelayMessageType.WEB3_REQUEST},t)}Ki.Web3RequestMessage=_4;var te={};Object.defineProperty(te,"__esModule",{value:!0});te.EthereumAddressFromSignedMessageResponse=te.SubmitEthereumTransactionResponse=te.SignEthereumTransactionResponse=te.SignEthereumMessageResponse=te.isRequestEthereumAccountsResponse=te.SelectProviderResponse=te.WatchAssetReponse=te.RequestEthereumAccountsResponse=te.SwitchEthereumChainResponse=te.AddEthereumChainResponse=te.ErrorResponse=void 0;const ht=Za;function w4(t,e,n){return{method:t,errorMessage:e,errorCode:n}}te.ErrorResponse=w4;function S4(t){return{method:ht.Web3Method.addEthereumChain,result:t}}te.AddEthereumChainResponse=S4;function E4(t){return{method:ht.Web3Method.switchEthereumChain,result:t}}te.SwitchEthereumChainResponse=E4;function C4(t){return{method:ht.Web3Method.requestEthereumAccounts,result:t}}te.RequestEthereumAccountsResponse=C4;function I4(t){return{method:ht.Web3Method.watchAsset,result:t}}te.WatchAssetReponse=I4;function x4(t){return{method:ht.Web3Method.selectProvider,result:t}}te.SelectProviderResponse=x4;function k4(t){return t&&t.method===ht.Web3Method.requestEthereumAccounts}te.isRequestEthereumAccountsResponse=k4;function R4(t){return{method:ht.Web3Method.signEthereumMessage,result:t}}te.SignEthereumMessageResponse=R4;function M4(t){return{method:ht.Web3Method.signEthereumTransaction,result:t}}te.SignEthereumTransactionResponse=M4;function A4(t){return{method:ht.Web3Method.submitEthereumTransaction,result:t}}te.SubmitEthereumTransactionResponse=A4;function T4(t){return{method:ht.Web3Method.ethereumAddressFromSignedMessage,result:t}}te.EthereumAddressFromSignedMessageResponse=T4;var In={};Object.defineProperty(In,"__esModule",{value:!0});In.isWeb3ResponseMessage=In.Web3ResponseMessage=void 0;const hd=Yi;function N4(t){return Object.assign({type:hd.RelayMessageType.WEB3_RESPONSE},t)}In.Web3ResponseMessage=N4;function O4(t){return t&&t.type===hd.RelayMessageType.WEB3_RESPONSE}In.isWeb3ResponseMessage=O4;var L4=A&&A.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),j4=A&&A.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),fd=A&&A.__decorate||function(t,e,n,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s},$4=A&&A.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&L4(e,t,n);return j4(e,t),e},P4=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.WalletSDKRelay=void 0;const dd=P4(Ui),il=rr,jt=Ai,fe=Qa,Ce=kn,D4=Gi,xo=Qi,F4=ir,ee=x,Et=$4(Cn),Ct=Rn,jr=Ye,pe=Za,B4=Zi,V4=Ki,Oe=te,xe=In;class Ze extends jr.WalletSDKRelayAbstract{constructor(e){var n;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new jt.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new jt.Subscription,this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:r,ui:i,connection:s}=this.subscribe();if(this._session=r,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=(n=e.reloadOnDisconnect)!==null&&n!==void 0?n:!0,this.ui=i}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe(i=>{this.dappDefaultChain!==i&&(this.dappDefaultChain=i)}));const e=Ct.Session.load(this.storage)||new Ct.Session(this.storage).save(),n=new D4.WalletSDKConnection(e.id,e.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(n.sessionConfig$.subscribe({next:i=>{this.onSessionConfigChanged(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Ce.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(n.incomingEvent$.pipe((0,fe.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(n.linked$.pipe((0,fe.skip)(1),(0,fe.tap)(i=>{var s;this.isLinked=i;const o=this.storage.getItem(jr.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(Ce.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:u})}}})).subscribe()),this.subscriptions.add(n.sessionConfig$.pipe((0,fe.filter)(i=>!!i.metadata&&i.metadata.__destroyed==="1")).subscribe(()=>{var i;const s=n.isDestroyed;return(i=this.diagnostic)===null||i===void 0||i.log(Ce.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:s,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(n.sessionConfig$.pipe((0,fe.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,fe.mergeMap)(i=>Et.decrypt(i.metadata.WalletUsername,e.secret))).subscribe({next:i=>{this.storage.setItem(jr.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Ce.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(n.sessionConfig$.pipe((0,fe.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,fe.mergeMap)(i=>Et.decrypt(i.metadata.AppVersion,e.secret))).subscribe({next:i=>{this.storage.setItem(jr.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Ce.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(n.sessionConfig$.pipe((0,fe.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,fe.mergeMap)(i=>(0,jt.zip)(Et.decrypt(i.metadata.ChainId,e.secret),Et.decrypt(i.metadata.JsonRpcUrl,e.secret)))).pipe((0,fe.distinctUntilChanged)()).subscribe({next:([i,s])=>{this.chainCallback&&this.chainCallback(i,s)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Ce.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(n.sessionConfig$.pipe((0,fe.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,fe.mergeMap)(i=>Et.decrypt(i.metadata.EthereumAddress,e.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),Ze.accountRequestCallbackIds.size>0&&(Array.from(Ze.accountRequestCallbackIds.values()).forEach(s=>{const o=(0,xe.Web3ResponseMessage)({id:s,response:(0,Oe.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),Ze.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Ce.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(n.sessionConfig$.pipe((0,fe.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,fe.mergeMap)(i=>Et.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(Ce.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const r=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:e,connected$:n.connected$,chainId$:this.dappDefaultChainSubject});return n.connect(),{session:e,ui:r,connection:n}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,fe.timeout)(1e3),(0,fe.catchError)(e=>(0,jt.of)(null))).subscribe(e=>{var n,r,i;const s=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch{(n=this.diagnostic)===null||n===void 0||n.log(Ce.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(r=this.diagnostic)===null||r===void 0||r.log(Ce.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=Ct.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(Ce.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Ct.Session.hash(o.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new jt.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 n;(n=this.diagnostic)===null||n===void 0||n.log(Ce.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,n){this.appName=e,this.appLogoUrl=n}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,n){this.storage.setItem(e,n)}signEthereumMessage(e,n,r,i){return this.sendRequest({method:pe.Web3Method.signEthereumMessage,params:{message:(0,ee.hexStringFromBuffer)(e,!0),address:n,addPrefix:r,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,n,r){return this.sendRequest({method:pe.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,ee.hexStringFromBuffer)(e,!0),signature:(0,ee.hexStringFromBuffer)(n,!0),addPrefix:r}})}signEthereumTransaction(e){return this.sendRequest({method:pe.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,ee.bigIntStringFromBN)(e.weiValue),data:(0,ee.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,ee.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,ee.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,ee.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,ee.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:pe.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,ee.bigIntStringFromBN)(e.weiValue),data:(0,ee.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,ee.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,ee.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,ee.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,ee.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,n){return this.sendRequest({method:pe.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,ee.hexStringFromBuffer)(e,!0),chainId:n}})}scanQRCode(e){return this.sendRequest({method:pe.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,ee.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,n){return this.sendRequest({method:pe.Web3Method.generic,params:{action:n,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let n=null;const r=(0,ee.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,o),n==null||n()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(n=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(r,c=>{if(n==null||n(),c.errorMessage)return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(r,e):this.publishWeb3RequestEvent(r,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,n){var r;const i=(0,V4.Web3RequestMessage)({id:e,request:n}),s=Ct.Session.load(this.storage);(r=this.diagnostic)===null||r===void 0||r.log(Ce.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ct.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(Ce.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ct.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})},error:o=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:o.message}}))}}))}publishWeb3RequestCanceledEvent(e){const n=(0,B4.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",n,!1).subscribe())}publishEvent(e,n,r){const i=this.session.secret;return new jt.Observable(s=>{Et.encrypt(JSON.stringify(Object.assign(Object.assign({},n),{origin:location.origin})),i).then(o=>{s.next(o),s.complete()})}).pipe((0,fe.mergeMap)(s=>this.connection.publishEvent(e,s,r)))}handleIncomingEvent(e){try{this.subscriptions.add((0,jt.from)(Et.decrypt(e.data,this.session.secret)).pipe((0,fe.map)(n=>JSON.parse(n))).subscribe({next:n=>{const r=(0,xe.isWeb3ResponseMessage)(n)?n:null;r&&this.handleWeb3ResponseMessage(r)},error:()=>{var n;(n=this.diagnostic)===null||n===void 0||n.log(Ce.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(e){var n;const{response:r}=e;if((n=this.diagnostic)===null||n===void 0||n.log(Ce.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash()}),(0,Oe.isRequestEthereumAccountsResponse)(r)){Ze.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),Ze.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,n,r,i){this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:e,response:(0,Oe.ErrorResponse)(n,(r??xo.WalletUIError.UserRejectedRequest).message,i)}))}invokeCallback(e){const n=this.relayEventManager.callbacks.get(e.id);n&&(n(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:pe.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},n=(0,ee.randomBytesHex)(8),r=s=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,s)};return{promise:new Promise((s,o)=>{var a;this.relayEventManager.callbacks.set(n,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,ee.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,xe.Web3ResponseMessage)({id:n,response:(0,Oe.RequestEthereumAccountsResponse)(l)}))};this.ui.requestEthereumAccounts({onCancel:r,onAccounts:u})}else{const u=il.ethErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>r(u)})}Ze.accountRequestCallbackIds.add(n),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(n,e)}),cancel:r}}selectProvider(e){const n={method:pe.Web3Method.selectProvider,params:{providerOptions:e}},r=(0,ee.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,n.method,o)},s=new Promise((o,a)=>{this.relayEventManager.callbacks.set(r,l=>{if(l.errorMessage)return a(new Error(l.errorMessage));o(l)});const c=l=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:r,response:(0,Oe.SelectProviderResponse)(F4.ProviderType.Unselected)}))},u=l=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:r,response:(0,Oe.SelectProviderResponse)(l)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:u,onCancel:c,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,n,r,i,s,o){const a={method:pe.Web3Method.watchAsset,params:{type:e,options:{address:n,symbol:r,decimals:i,image:s},chainId:o}};let c=null;const u=(0,ee.randomBytesHex)(8),l=f=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,f),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}));const h=new Promise((f,d)=>{this.relayEventManager.callbacks.set(u,m=>{if(c==null||c(),m.errorMessage)return d(new Error(m.errorMessage));f(m)});const p=m=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:u,response:(0,Oe.WatchAssetReponse)(!1)}))},_=()=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:u,response:(0,Oe.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:_,onCancel:p,type:e,address:n,symbol:r,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,a)});return{cancel:l,promise:h}}addEthereumChain(e,n,r,i,s,o){const a={method:pe.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:n,blockExplorerUrls:i,chainName:s,iconUrls:r,nativeCurrency:o}};let c=null;const u=(0,ee.randomBytesHex)(8),l=f=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,f),c==null||c()};return this.ui.inlineAddEthereumChain(e)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload})),{promise:new Promise((f,d)=>{this.relayEventManager.callbacks.set(u,m=>{if(c==null||c(),m.errorMessage)return d(new Error(m.errorMessage));f(m)});const p=m=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:u,response:(0,Oe.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},_=m=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:u,response:(0,Oe.AddEthereumChainResponse)({isApproved:!0,rpcUrl:m})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:p,onApprove:_,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,n){const r={method:pe.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:n})},i=(0,ee.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,r.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(i,h=>{if(h.errorMessage&&h.errorCode)return c(il.ethErrors.provider.custom({code:h.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(h.errorMessage)return c(new Error(h.errorMessage));a(h)});const u=h=>{if(typeof h=="number"){const f=h;this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:i,response:(0,Oe.ErrorResponse)(pe.Web3Method.switchEthereumChain,xo.WalletUIError.SwitchEthereumChainUnsupportedChainId.message,f)}))}else h instanceof xo.WalletUIError?this.handleErrorResponse(i,pe.Web3Method.switchEthereumChain,h,h.errorCode):this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:i,response:(0,Oe.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},l=h=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:i,response:(0,Oe.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:h})}))};this.ui.switchEthereumChain({onCancel:u,onApprove:l,chainId:r.params.chainId,address:r.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,r)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return Ct.Session.hash(this._session.id)}sendRequestStandalone(e,n){const r=s=>{this.handleErrorResponse(e,n.method,s)},i=s=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:e,response:s}))};switch(n.method){case pe.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:n,onSuccess:i,onCancel:r});break;case pe.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:n,onSuccess:i,onCancel:r});break;case pe.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:n,onSuccess:i,onCancel:r});break;case pe.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:n,onSuccess:i});break;default:r();break}}onSessionConfigChanged(e){}}Ze.accountRequestCallbackIds=new Set;fd([dd.default],Ze.prototype,"resetAndReload",null);fd([dd.default],Ze.prototype,"handleIncomingEvent",null);Wi.WalletSDKRelay=Ze;var Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.WalletSDKRelayEventManager=void 0;const H4=x;class W4{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,n=(0,H4.prepend0x)(e.toString(16));return this.callbacks.get(n)&&this.callbacks.delete(n),e}}Xi.WalletSDKRelayEventManager=W4;const U4="@coinbase/wallet-sdk",z4="3.6.6",q4="Coinbase Wallet JavaScript SDK",G4=["cipher","cipherbrowser","coinbase","coinbasewallet","eth","ether","ethereum","etherium","injection","toshi","wallet","walletlink","web3"],J4="dist/index.js",Q4="dist/index.d.ts",Z4="https://github.com/coinbase/coinbase-wallet-sdk.git",Y4="Coinbase, Inc.",K4="Apache-2.0",X4={"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"},e5={"@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"},t5={"@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-preact":"^0.1.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-simple-import-sort":"^7.0.0",jasmine:"3.8.0",jest:"^27.5.1","jest-chrome":"^0.7.2","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"},n5={node:">= 10.0.0"},r5={name:U4,version:z4,description:q4,keywords:G4,main:J4,types:Q4,repository:Z4,author:Y4,license:K4,scripts:X4,dependencies:e5,devDependencies:t5,engines:n5};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.CoinbaseWalletSDK=void 0;const i5=ri,s5=ii,o5=dn,a5=xi,c5=Wi,u5=Xi,l5=x,h5={}.LINK_API_URL||"https://www.walletlink.org",pd={}.SDK_VERSION||r5.version||"unknown";class es{constructor(e){var n,r,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||h5;let o;if(e.uiConstructor?o=e.uiConstructor:o=u=>new a5.WalletSDKUI(u),typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(n=e.overrideIsCoinbaseWallet)!==null&&n!==void 0?n:!0,this._overrideIsCoinbaseBrowser=(r=e.overrideIsCoinbaseBrowser)!==null&&r!==void 0?r:!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 s5.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",es.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new u5.WalletSDKRelayEventManager,this._relay=new c5.WalletSDKRelay({linkAPIUrl:s,version:pd,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="",n=1){const r=this.walletExtension;if(r)return this.isCipherProvider(r)||r.setProviderInfo(e,n),this._reloadOnDisconnect===!1&&typeof r.disableReloadOnDisconnect=="function"&&r.disableReloadOnDisconnect(),r;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 o5.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:n,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,n){var r;this._appName=e||"DApp",this._appLogoUrl=n||(0,l5.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(r=this._relay)===null||r===void 0||r.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const n=this.walletExtension;n?n.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,n;return(n=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&n!==void 0?n:null}getCoinbaseWalletLogo(e,n=240){return(0,i5.walletLogo)(e,n)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,n;try{const r=(e=window.ethereum)!==null&&e!==void 0?e:(n=window.top)===null||n===void 0?void 0:n.ethereum;return r&&"isCoinbaseBrowser"in r&&r.isCoinbaseBrowser?r:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}Qn.CoinbaseWalletSDK=es;es.VERSION=pd;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=Qn,n=dn;var r=Qn;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return r.CoinbaseWalletSDK}});var i=dn;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=n.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=n.CoinbaseWalletProvider)})(Go);const f5=yd(Go),S5=vd({__proto__:null,default:f5},[Go]);export{S5 as i};
|