@dcl/dao-site 0.1.0-9665947846.commit-7f9b152
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/1949206f0b8ec64d-808ab637.svg +9 -0
- package/assets/2bb1eda4abde747b-9a6386f8.svg +14 -0
- package/assets/405a77eb97c6d08b-39806354.png +0 -0
- package/assets/42a115892c45f786-52e9d5a0.png +0 -0
- package/assets/43a07b610a8dc06b-2805bd4f.png +0 -0
- package/assets/4681c4394eec49bce9599519ba179a34-1661de91.svg +9 -0
- package/assets/6fc36cd396ba9f47-457b8bc0.svg +16 -0
- package/assets/7b3beb6bcbc56ed9-1bed553a.png +0 -0
- package/assets/7b593e6c5f18da0e-7aec344f.png +0 -0
- package/assets/7da6c0fe9cc15329-ed9b180b.png +0 -0
- package/assets/805322223c96be40-5d829f5a.png +0 -0
- package/assets/81ac9d1ac3d6324c-15cdd640.svg +17 -0
- package/assets/93c9e021d08ebd29-581a0127.svg +11 -0
- package/assets/97d7aa272cd605ea-9a905beb.png +0 -0
- package/assets/Sentient-Variable-e57342c5.ttf +0 -0
- package/assets/b60869efa9cf4f8c-06465811.svg +18 -0
- package/assets/brand-icons-42e369dc.ttf +0 -0
- package/assets/brand-icons-6519a15b.svg +1008 -0
- package/assets/brand-icons-9fafd6c3.woff +0 -0
- package/assets/brand-icons-d023c55f.eot +0 -0
- package/assets/brand-icons-e7d4d534.woff2 +0 -0
- package/assets/council-23633596.png +0 -0
- package/assets/da0e2040ea4c51ef-19df0e50.svg +1 -0
- package/assets/dax-fe45aa94.webp +0 -0
- package/assets/decentraland-fd65fd50.svg +1 -0
- package/assets/flags-94d5c7f1.png +0 -0
- package/assets/footer-d8fda202.webp +0 -0
- package/assets/fortmatic-101518a1.js +14 -0
- package/assets/fortmatic-101518a1.js.map +1 -0
- package/assets/gc-73b5d709.webp +0 -0
- package/assets/grants-4cf59142.png +0 -0
- package/assets/grants-mobile-ed3af932.png +0 -0
- package/assets/grants_timeline_desktop-11f86fa8.svg +1 -0
- package/assets/grants_timeline_mobile-ee5fa2e5.svg +1 -0
- package/assets/header_recipients-aa54cae2.webp +0 -0
- package/assets/header_resources-f29c07f6.webp +0 -0
- package/assets/hero_desktop-62440ce0.webp +0 -0
- package/assets/hero_mobile-127431da.webp +0 -0
- package/assets/how-3260f470.png +0 -0
- package/assets/icons-282a64fb.svg +1518 -0
- package/assets/icons-434466b5.woff2 +0 -0
- package/assets/icons-8b4e1b84.eot +0 -0
- package/assets/icons-95b6a484.woff +0 -0
- package/assets/icons-cb7f81f5.ttf +0 -0
- package/assets/index-1bbd512b.js +15 -0
- package/assets/index-1bbd512b.js.map +1 -0
- package/assets/index-307c6e2d.js +55 -0
- package/assets/index-307c6e2d.js.map +1 -0
- package/assets/index-48ae71d8.css +691 -0
- package/assets/index-4bd9c4f0.js +6 -0
- package/assets/index-4bd9c4f0.js.map +1 -0
- package/assets/index-7c221453.js +2 -0
- package/assets/index-7c221453.js.map +1 -0
- package/assets/index-c3e34aec.js +4296 -0
- package/assets/index-c3e34aec.js.map +1 -0
- package/assets/index-cca00e0b.js +2 -0
- package/assets/index-cca00e0b.js.map +1 -0
- package/assets/index-fbe84902.js +13 -0
- package/assets/index-fbe84902.js.map +1 -0
- package/assets/index.es-4c3a1f45.js +57 -0
- package/assets/index.es-4c3a1f45.js.map +1 -0
- package/assets/marketplace-7ef0d210.png +0 -0
- package/assets/nf-bb5918bf.webp +0 -0
- package/assets/outline-icons-4537fa06.eot +0 -0
- package/assets/outline-icons-4bc359c2.woff +0 -0
- package/assets/outline-icons-4d288344.woff2 +0 -0
- package/assets/outline-icons-67172172.ttf +0 -0
- package/assets/outline-icons-ae8fd02a.svg +366 -0
- package/assets/services-cd0fa3dc.webp +0 -0
- package/assets/ship-4d8f16f2.png +0 -0
- package/assets/wearables-cec92369.png +0 -0
- package/assets/what_is-3b76744c.png +0 -0
- package/assets/why-f395c935.png +0 -0
- package/favicon.ico +0 -0
- package/index.html +20 -0
- package/manifest.json +6 -0
- package/package.json +22 -0
- package/robots.txt +2 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{f as Z,i as zn,B as se,j as st,g as qn,k as qr,e as Gn,r as sl,b as ge,d as Vd}from"./index-c3e34aec.js";function zd(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Co={},Ur={},Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.walletLogo=void 0;const qd=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.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 r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.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 r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Jn.walletLogo=qd;var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.LINK_API_URL=void 0;Zn.LINK_API_URL="https://www.walletlink.org";var z={},Gr={},Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.errorValues=Ct.standardErrorCodes=void 0;Ct.standardErrorCodes={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,unsupportedChain:4902}};Ct.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."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var Kn={},Qn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Ct,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(g,_=r){if(g&&Number.isInteger(g)){const E=g.toString();if(f(t.errorValues,E))return t.errorValues[E].message;if(c(g))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return _}e.getMessageFromCode=n;function i(g){if(!Number.isInteger(g))return!1;const _=g.toString();return!!(t.errorValues[_]||c(g))}e.isValidCode=i;function s(g){var _;if(typeof g=="number")return g;if(a(g))return(_=g.code)!==null&&_!==void 0?_:g.errorCode}e.getErrorCode=s;function a(g){return typeof g=="object"&&g!==null&&(typeof g.code=="number"||typeof g.errorCode=="number")}function o(g,{shouldIncludeStack:_=!1}={}){const E={};if(g&&typeof g=="object"&&!Array.isArray(g)&&f(g,"code")&&i(g.code)){const x=g;E.code=x.code,x.message&&typeof x.message=="string"?(E.message=x.message,f(x,"data")&&(E.data=x.data)):(E.message=n(E.code),E.data={originalError:u(g)})}else E.code=t.standardErrorCodes.rpc.internal,E.message=h(g,"message")?g.message:r,E.data={originalError:u(g)};return _&&(E.stack=h(g,"stack")?g.stack:void 0),E}e.serialize=o;function c(g){return g>=-32099&&g<=-32e3}function u(g){return g&&typeof g=="object"&&!Array.isArray(g)?Object.assign({},g):g}function f(g,_){return Object.prototype.hasOwnProperty.call(g,_)}function h(g,_){return typeof g=="object"&&g!==null&&_ in g&&typeof g[_]=="string"}})(Qn);Object.defineProperty(Kn,"__esModule",{value:!0});Kn.standardErrors=void 0;const Pe=Ct,ol=Qn;Kn.standardErrors={rpc:{parse:e=>Je(Pe.standardErrorCodes.rpc.parse,e),invalidRequest:e=>Je(Pe.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>Je(Pe.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>Je(Pe.standardErrorCodes.rpc.methodNotFound,e),internal:e=>Je(Pe.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Je(t,e)},invalidInput:e=>Je(Pe.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>Je(Pe.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Je(Pe.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Je(Pe.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Je(Pe.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Je(Pe.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>rr(Pe.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>rr(Pe.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>rr(Pe.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>rr(Pe.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>rr(Pe.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>rr(Pe.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ll(t,r,n)}}};function Je(e,t){const[r,n]=al(t);return new cl(e,r||(0,ol.getMessageFromCode)(e),n)}function rr(e,t){const[r,n]=al(t);return new ll(e,r||(0,ol.getMessageFromCode)(e),n)}function al(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let cl=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},ll=class extends cl{constructor(t,r,n){if(!Gd(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function Gd(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var Yn={},Rr={};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.isErrorResponse=void 0;function Jd(e){return e.errorMessage!==void 0}Rr.isErrorResponse=Jd;var Cr={};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.LIB_VERSION=void 0;Cr.LIB_VERSION="3.9.3";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.serializeError=void 0;const Zd=Rr,Kd=Cr,Qd=Ct,Yd=Qn;function Xd(e,t){const r=(0,Yd.serialize)(eh(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Kd.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=th(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}Yn.serializeError=Xd;function eh(e){return typeof e=="string"?{message:e,code:Qd.standardErrorCodes.rpc.internal}:(0,Zd.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function th(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=Ct;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=Kn;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=Yn;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=Qn;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(Gr);var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.ProviderType=Ae.RegExpString=Ae.IntNumber=Ae.BigIntString=Ae.AddressString=Ae.HexString=Ae.OpaqueType=void 0;function Jr(){return e=>e}Ae.OpaqueType=Jr;Ae.HexString=Jr();Ae.AddressString=Jr();Ae.BigIntString=Jr();function rh(e){return Math.floor(e)}Ae.IntNumber=rh;Ae.RegExpString=Jr();var _a;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(_a||(Ae.ProviderType=_a={}));var nh=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(z,"__esModule",{value:!0});z.isMobileWeb=z.getLocation=z.isInIFrame=z.createQrUrl=z.getFavicon=z.range=z.isBigNumber=z.ensureParsedJSONObject=z.ensureBN=z.ensureRegExpString=z.ensureIntNumber=z.ensureBuffer=z.ensureAddressString=z.ensureEvenLengthHexString=z.ensureHexString=z.isHexString=z.prepend0x=z.strip0x=z.has0xPrefix=z.hexStringFromIntNumber=z.intNumberFromHexString=z.bigIntStringFromBN=z.hexStringFromBuffer=z.hexStringToUint8Array=z.uint8ArrayToHex=z.randomBytesHex=void 0;const Nt=nh(zn),Zt=Gr,Xe=Ae,ul=/^[0-9]*$/,dl=/^[a-f0-9]*$/;function ih(e){return hl(crypto.getRandomValues(new Uint8Array(e)))}z.randomBytesHex=ih;function hl(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}z.uint8ArrayToHex=hl;function sh(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}z.hexStringToUint8Array=sh;function oh(e,t=!1){const r=e.toString("hex");return(0,Xe.HexString)(t?`0x${r}`:r)}z.hexStringFromBuffer=oh;function ah(e){return(0,Xe.BigIntString)(e.toString(10))}z.bigIntStringFromBN=ah;function ch(e){return(0,Xe.IntNumber)(new Nt.default(Kr(e,!1),16).toNumber())}z.intNumberFromHexString=ch;function lh(e){return(0,Xe.HexString)(`0x${new Nt.default(e).toString(16)}`)}z.hexStringFromIntNumber=lh;function ko(e){return e.startsWith("0x")||e.startsWith("0X")}z.has0xPrefix=ko;function Xn(e){return ko(e)?e.slice(2):e}z.strip0x=Xn;function fl(e){return ko(e)?`0x${e.slice(2)}`:`0x${e}`}z.prepend0x=fl;function Zr(e){if(typeof e!="string")return!1;const t=Xn(e).toLowerCase();return dl.test(t)}z.isHexString=Zr;function pl(e,t=!1){if(typeof e=="string"){const r=Xn(e).toLowerCase();if(dl.test(r))return(0,Xe.HexString)(t?`0x${r}`:r)}throw Zt.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}z.ensureHexString=pl;function Kr(e,t=!1){let r=pl(e,!1);return r.length%2===1&&(r=(0,Xe.HexString)(`0${r}`)),t?(0,Xe.HexString)(`0x${r}`):r}z.ensureEvenLengthHexString=Kr;function uh(e){if(typeof e=="string"){const t=Xn(e).toLowerCase();if(Zr(t)&&t.length===40)return(0,Xe.AddressString)(fl(t))}throw Zt.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}z.ensureAddressString=uh;function dh(e){if(se.isBuffer(e))return e;if(typeof e=="string"){if(Zr(e)){const t=Kr(e,!1);return se.from(t,"hex")}return se.from(e,"utf8")}throw Zt.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}z.ensureBuffer=dh;function gl(e){if(typeof e=="number"&&Number.isInteger(e))return(0,Xe.IntNumber)(e);if(typeof e=="string"){if(ul.test(e))return(0,Xe.IntNumber)(Number(e));if(Zr(e))return(0,Xe.IntNumber)(new Nt.default(Kr(e,!1),16).toNumber())}throw Zt.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}z.ensureIntNumber=gl;function hh(e){if(e instanceof RegExp)return(0,Xe.RegExpString)(e.toString());throw Zt.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}z.ensureRegExpString=hh;function fh(e){if(e!==null&&(Nt.default.isBN(e)||_l(e)))return new Nt.default(e.toString(10),10);if(typeof e=="number")return new Nt.default(gl(e));if(typeof e=="string"){if(ul.test(e))return new Nt.default(e,10);if(Zr(e))return new Nt.default(Kr(e,!1),16)}throw Zt.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}z.ensureBN=fh;function ph(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw Zt.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}z.ensureParsedJSONObject=ph;function _l(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}z.isBigNumber=_l;function gh(e,t){return Array.from({length:t-e},(r,n)=>e+n)}z.range=gh;function _h(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}z.getFavicon=_h;function mh(e,t,r,n,i,s){const a=n?"parent-id":"id",o=new URLSearchParams({[a]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${o}`}z.createQrUrl=mh;function ml(){try{return window.frameElement!==null}catch{return!1}}z.isInIFrame=ml;function bh(){try{return ml()&&window.top?window.top.location:window.location}catch{return window.location}}z.getLocation=bh;function yh(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}z.isMobileWeb=yh;var ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.ScopedLocalStorage=void 0;class wh{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(t)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}ei.ScopedLocalStorage=wh;var gr={},bl={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function s(c,u,f,h,g){if(typeof f!="function")throw new TypeError("The listener must be a function");var _=new i(f,h||c,g),E=r?r+u:u;return c._events[E]?c._events[E].fn?c._events[E]=[c._events[E],_]:c._events[E].push(_):(c._events[E]=_,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],f,h;if(this._eventsCount===0)return u;for(h in f=this._events)t.call(f,h)&&u.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},o.prototype.listeners=function(u){var f=r?r+u:u,h=this._events[f];if(!h)return[];if(h.fn)return[h.fn];for(var g=0,_=h.length,E=new Array(_);g<_;g++)E[g]=h[g].fn;return E},o.prototype.listenerCount=function(u){var f=r?r+u:u,h=this._events[f];return h?h.fn?1:h.length:0},o.prototype.emit=function(u,f,h,g,_,E){var x=r?r+u:u;if(!this._events[x])return!1;var S=this._events[x],b=arguments.length,v,C;if(S.fn){switch(S.once&&this.removeListener(u,S.fn,void 0,!0),b){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,f),!0;case 3:return S.fn.call(S.context,f,h),!0;case 4:return S.fn.call(S.context,f,h,g),!0;case 5:return S.fn.call(S.context,f,h,g,_),!0;case 6:return S.fn.call(S.context,f,h,g,_,E),!0}for(C=1,v=new Array(b-1);C<b;C++)v[C-1]=arguments[C];S.fn.apply(S.context,v)}else{var M=S.length,A;for(C=0;C<M;C++)switch(S[C].once&&this.removeListener(u,S[C].fn,void 0,!0),b){case 1:S[C].fn.call(S[C].context);break;case 2:S[C].fn.call(S[C].context,f);break;case 3:S[C].fn.call(S[C].context,f,h);break;case 4:S[C].fn.call(S[C].context,f,h,g);break;default:if(!v)for(A=1,v=new Array(b-1);A<b;A++)v[A-1]=arguments[A];S[C].fn.apply(S[C].context,v)}}return!0},o.prototype.on=function(u,f,h){return s(this,u,f,h,!1)},o.prototype.once=function(u,f,h){return s(this,u,f,h,!0)},o.prototype.removeListener=function(u,f,h,g){var _=r?r+u:u;if(!this._events[_])return this;if(!f)return a(this,_),this;var E=this._events[_];if(E.fn)E.fn===f&&(!g||E.once)&&(!h||E.context===h)&&a(this,_);else{for(var x=0,S=[],b=E.length;x<b;x++)(E[x].fn!==f||g&&!E[x].once||h&&E[x].context!==h)&&S.push(E[x]);S.length?this._events[_]=S.length===1?S[0]:S:a(this,_)}return this},o.prototype.removeAllListeners=function(u){var f;return u?(f=r?r+u:u,this._events[f]&&a(this,f)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o})(bl);var Eh=bl.exports,Qr={},Yr={},kr={};Object.defineProperty(kr,"__esModule",{value:!0});kr.EVENTS=void 0;kr.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",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.RelayAbstract=Ye.APP_VERSION_KEY=Ye.LOCAL_STORAGE_ADDRESSES_KEY=Ye.WALLET_USER_NAME_KEY=void 0;const ma=Gr;Ye.WALLET_USER_NAME_KEY="walletUsername";Ye.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Ye.APP_VERSION_KEY="AppVersion";class vh{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw ma.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,ma.serializeError)(s,t.method);return i})}}Ye.RelayAbstract=vh;var Ir={},yl={exports:{}},ao={exports:{}},xr={},ti={};ti.byteLength=Ch;ti.toByteArray=Ih;ti.fromByteArray=Th;var gt=[],Qe=[],Sh=typeof Uint8Array<"u"?Uint8Array:Array,Ms="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var nr=0,Rh=Ms.length;nr<Rh;++nr)gt[nr]=Ms[nr],Qe[Ms.charCodeAt(nr)]=nr;Qe["-".charCodeAt(0)]=62;Qe["_".charCodeAt(0)]=63;function wl(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function Ch(e){var t=wl(e),r=t[0],n=t[1];return(r+n)*3/4-n}function kh(e,t,r){return(t+r)*3/4-r}function Ih(e){var t,r=wl(e),n=r[0],i=r[1],s=new Sh(kh(e,n,i)),a=0,o=i>0?n-4:n,c;for(c=0;c<o;c+=4)t=Qe[e.charCodeAt(c)]<<18|Qe[e.charCodeAt(c+1)]<<12|Qe[e.charCodeAt(c+2)]<<6|Qe[e.charCodeAt(c+3)],s[a++]=t>>16&255,s[a++]=t>>8&255,s[a++]=t&255;return i===2&&(t=Qe[e.charCodeAt(c)]<<2|Qe[e.charCodeAt(c+1)]>>4,s[a++]=t&255),i===1&&(t=Qe[e.charCodeAt(c)]<<10|Qe[e.charCodeAt(c+1)]<<4|Qe[e.charCodeAt(c+2)]>>2,s[a++]=t>>8&255,s[a++]=t&255),s}function xh(e){return gt[e>>18&63]+gt[e>>12&63]+gt[e>>6&63]+gt[e&63]}function Ah(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),i.push(xh(n));return i.join("")}function Th(e){for(var t,r=e.length,n=r%3,i=[],s=16383,a=0,o=r-n;a<o;a+=s)i.push(Ah(e,a,a+s>o?o:a+s));return n===1?(t=e[r-1],i.push(gt[t>>2]+gt[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(gt[t>>10]+gt[t>>4&63]+gt[t<<2&63]+"=")),i.join("")}var Io={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Io.read=function(e,t,r,n,i){var s,a,o=i*8-n-1,c=(1<<o)-1,u=c>>1,f=-7,h=r?i-1:0,g=r?-1:1,_=e[t+h];for(h+=g,s=_&(1<<-f)-1,_>>=-f,f+=o;f>0;s=s*256+e[t+h],h+=g,f-=8);for(a=s&(1<<-f)-1,s>>=-f,f+=n;f>0;a=a*256+e[t+h],h+=g,f-=8);if(s===0)s=1-u;else{if(s===c)return a?NaN:(_?-1:1)*(1/0);a=a+Math.pow(2,n),s=s-u}return(_?-1:1)*a*Math.pow(2,s-n)};Io.write=function(e,t,r,n,i,s){var a,o,c,u=s*8-i-1,f=(1<<u)-1,h=f>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:s-1,E=n?1:-1,x=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+h>=1?t+=g/c:t+=g*Math.pow(2,1-h),t*c>=2&&(a++,c/=2),a+h>=f?(o=0,a=f):a+h>=1?(o=(t*c-1)*Math.pow(2,i),a=a+h):(o=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+_]=o&255,_+=E,o/=256,i-=8);for(a=a<<i|o,u+=i;u>0;e[r+_]=a&255,_+=E,a/=256,u-=8);e[r+_-E]|=x*128};/*!
|
|
2
|
+
* The buffer module from node.js, for the browser.
|
|
3
|
+
*
|
|
4
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/(function(e){const t=ti,r=Io,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=s(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const p=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(p,l),p.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function a(p){if(p>i)throw new RangeError('The value "'+p+'" is invalid for option "size"');const l=new Uint8Array(p);return Object.setPrototypeOf(l,o.prototype),l}function o(p,l,d){if(typeof p=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(p)}return c(p,l,d)}o.poolSize=8192;function c(p,l,d){if(typeof p=="string")return g(p,l);if(ArrayBuffer.isView(p))return E(p);if(p==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p);if($e(p,ArrayBuffer)||p&&$e(p.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($e(p,SharedArrayBuffer)||p&&$e(p.buffer,SharedArrayBuffer)))return x(p,l,d);if(typeof p=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const m=p.valueOf&&p.valueOf();if(m!=null&&m!==p)return o.from(m,l,d);const R=S(p);if(R)return R;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof p[Symbol.toPrimitive]=="function")return o.from(p[Symbol.toPrimitive]("string"),l,d);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p)}o.from=function(p,l,d){return c(p,l,d)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function u(p){if(typeof p!="number")throw new TypeError('"size" argument must be of type number');if(p<0)throw new RangeError('The value "'+p+'" is invalid for option "size"')}function f(p,l,d){return u(p),p<=0?a(p):l!==void 0?typeof d=="string"?a(p).fill(l,d):a(p).fill(l):a(p)}o.alloc=function(p,l,d){return f(p,l,d)};function h(p){return u(p),a(p<0?0:b(p)|0)}o.allocUnsafe=function(p){return h(p)},o.allocUnsafeSlow=function(p){return h(p)};function g(p,l){if((typeof l!="string"||l==="")&&(l="utf8"),!o.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const d=C(p,l)|0;let m=a(d);const R=m.write(p,l);return R!==d&&(m=m.slice(0,R)),m}function _(p){const l=p.length<0?0:b(p.length)|0,d=a(l);for(let m=0;m<l;m+=1)d[m]=p[m]&255;return d}function E(p){if($e(p,Uint8Array)){const l=new Uint8Array(p);return x(l.buffer,l.byteOffset,l.byteLength)}return _(p)}function x(p,l,d){if(l<0||p.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(p.byteLength<l+(d||0))throw new RangeError('"length" is outside of buffer bounds');let m;return l===void 0&&d===void 0?m=new Uint8Array(p):d===void 0?m=new Uint8Array(p,l):m=new Uint8Array(p,l,d),Object.setPrototypeOf(m,o.prototype),m}function S(p){if(o.isBuffer(p)){const l=b(p.length)|0,d=a(l);return d.length===0||p.copy(d,0,0,l),d}if(p.length!==void 0)return typeof p.length!="number"||ct(p.length)?a(0):_(p);if(p.type==="Buffer"&&Array.isArray(p.data))return _(p.data)}function b(p){if(p>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return p|0}function v(p){return+p!=p&&(p=0),o.alloc(+p)}o.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==o.prototype},o.compare=function(l,d){if($e(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),$e(d,Uint8Array)&&(d=o.from(d,d.offset,d.byteLength)),!o.isBuffer(l)||!o.isBuffer(d))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===d)return 0;let m=l.length,R=d.length;for(let T=0,N=Math.min(m,R);T<N;++T)if(l[T]!==d[T]){m=l[T],R=d[T];break}return m<R?-1:R<m?1:0},o.isEncoding=function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(l,d){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return o.alloc(0);let m;if(d===void 0)for(d=0,m=0;m<l.length;++m)d+=l[m].length;const R=o.allocUnsafe(d);let T=0;for(m=0;m<l.length;++m){let N=l[m];if($e(N,Uint8Array))T+N.length>R.length?(o.isBuffer(N)||(N=o.from(N)),N.copy(R,T)):Uint8Array.prototype.set.call(R,N,T);else if(o.isBuffer(N))N.copy(R,T);else throw new TypeError('"list" argument must be an Array of Buffers');T+=N.length}return R};function C(p,l){if(o.isBuffer(p))return p.length;if(ArrayBuffer.isView(p)||$e(p,ArrayBuffer))return p.byteLength;if(typeof p!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof p);const d=p.length,m=arguments.length>2&&arguments[2]===!0;if(!m&&d===0)return 0;let R=!1;for(;;)switch(l){case"ascii":case"latin1":case"binary":return d;case"utf8":case"utf-8":return ae(p).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d*2;case"hex":return d>>>1;case"base64":return xt(p).length;default:if(R)return m?-1:ae(p).length;l=(""+l).toLowerCase(),R=!0}}o.byteLength=C;function M(p,l,d){let m=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0,l>>>=0,d<=l))return"";for(p||(p="utf8");;)switch(p){case"hex":return K(this,l,d);case"utf8":case"utf-8":return O(this,l,d);case"ascii":return V(this,l,d);case"latin1":case"binary":return U(this,l,d);case"base64":return $(this,l,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,l,d);default:if(m)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),m=!0}}o.prototype._isBuffer=!0;function A(p,l,d){const m=p[l];p[l]=p[d],p[d]=m}o.prototype.swap16=function(){const l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let d=0;d<l;d+=2)A(this,d,d+1);return this},o.prototype.swap32=function(){const l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let d=0;d<l;d+=4)A(this,d,d+3),A(this,d+1,d+2);return this},o.prototype.swap64=function(){const l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let d=0;d<l;d+=8)A(this,d,d+7),A(this,d+1,d+6),A(this,d+2,d+5),A(this,d+3,d+4);return this},o.prototype.toString=function(){const l=this.length;return l===0?"":arguments.length===0?O(this,0,l):M.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(l){if(!o.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:o.compare(this,l)===0},o.prototype.inspect=function(){let l="";const d=e.INSPECT_MAX_BYTES;return l=this.toString("hex",0,d).replace(/(.{2})/g,"$1 ").trim(),this.length>d&&(l+=" ... "),"<Buffer "+l+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(l,d,m,R,T){if($e(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),!o.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(d===void 0&&(d=0),m===void 0&&(m=l?l.length:0),R===void 0&&(R=0),T===void 0&&(T=this.length),d<0||m>l.length||R<0||T>this.length)throw new RangeError("out of range index");if(R>=T&&d>=m)return 0;if(R>=T)return-1;if(d>=m)return 1;if(d>>>=0,m>>>=0,R>>>=0,T>>>=0,this===l)return 0;let N=T-R,X=m-d;const ye=Math.min(N,X),_e=this.slice(R,T),we=l.slice(d,m);for(let he=0;he<ye;++he)if(_e[he]!==we[he]){N=_e[he],X=we[he];break}return N<X?-1:X<N?1:0};function B(p,l,d,m,R){if(p.length===0)return-1;if(typeof d=="string"?(m=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,ct(d)&&(d=R?0:p.length-1),d<0&&(d=p.length+d),d>=p.length){if(R)return-1;d=p.length-1}else if(d<0)if(R)d=0;else return-1;if(typeof l=="string"&&(l=o.from(l,m)),o.isBuffer(l))return l.length===0?-1:G(p,l,d,m,R);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?R?Uint8Array.prototype.indexOf.call(p,l,d):Uint8Array.prototype.lastIndexOf.call(p,l,d):G(p,[l],d,m,R);throw new TypeError("val must be string, number or Buffer")}function G(p,l,d,m,R){let T=1,N=p.length,X=l.length;if(m!==void 0&&(m=String(m).toLowerCase(),m==="ucs2"||m==="ucs-2"||m==="utf16le"||m==="utf-16le")){if(p.length<2||l.length<2)return-1;T=2,N/=2,X/=2,d/=2}function ye(we,he){return T===1?we[he]:we.readUInt16BE(he*T)}let _e;if(R){let we=-1;for(_e=d;_e<N;_e++)if(ye(p,_e)===ye(l,we===-1?0:_e-we)){if(we===-1&&(we=_e),_e-we+1===X)return we*T}else we!==-1&&(_e-=_e-we),we=-1}else for(d+X>N&&(d=N-X),_e=d;_e>=0;_e--){let we=!0;for(let he=0;he<X;he++)if(ye(p,_e+he)!==ye(l,he)){we=!1;break}if(we)return _e}return-1}o.prototype.includes=function(l,d,m){return this.indexOf(l,d,m)!==-1},o.prototype.indexOf=function(l,d,m){return B(this,l,d,m,!0)},o.prototype.lastIndexOf=function(l,d,m){return B(this,l,d,m,!1)};function W(p,l,d,m){d=Number(d)||0;const R=p.length-d;m?(m=Number(m),m>R&&(m=R)):m=R;const T=l.length;m>T/2&&(m=T/2);let N;for(N=0;N<m;++N){const X=parseInt(l.substr(N*2,2),16);if(ct(X))return N;p[d+N]=X}return N}function F(p,l,d,m){return Et(ae(l,p.length-d),p,d,m)}function re(p,l,d,m){return Et(rt(l),p,d,m)}function Ee(p,l,d,m){return Et(xt(l),p,d,m)}function fe(p,l,d,m){return Et(wt(l,p.length-d),p,d,m)}o.prototype.write=function(l,d,m,R){if(d===void 0)R="utf8",m=this.length,d=0;else if(m===void 0&&typeof d=="string")R=d,m=this.length,d=0;else if(isFinite(d))d=d>>>0,isFinite(m)?(m=m>>>0,R===void 0&&(R="utf8")):(R=m,m=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const T=this.length-d;if((m===void 0||m>T)&&(m=T),l.length>0&&(m<0||d<0)||d>this.length)throw new RangeError("Attempt to write outside buffer bounds");R||(R="utf8");let N=!1;for(;;)switch(R){case"hex":return W(this,l,d,m);case"utf8":case"utf-8":return F(this,l,d,m);case"ascii":case"latin1":case"binary":return re(this,l,d,m);case"base64":return Ee(this,l,d,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe(this,l,d,m);default:if(N)throw new TypeError("Unknown encoding: "+R);R=(""+R).toLowerCase(),N=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(p,l,d){return l===0&&d===p.length?t.fromByteArray(p):t.fromByteArray(p.slice(l,d))}function O(p,l,d){d=Math.min(p.length,d);const m=[];let R=l;for(;R<d;){const T=p[R];let N=null,X=T>239?4:T>223?3:T>191?2:1;if(R+X<=d){let ye,_e,we,he;switch(X){case 1:T<128&&(N=T);break;case 2:ye=p[R+1],(ye&192)===128&&(he=(T&31)<<6|ye&63,he>127&&(N=he));break;case 3:ye=p[R+1],_e=p[R+2],(ye&192)===128&&(_e&192)===128&&(he=(T&15)<<12|(ye&63)<<6|_e&63,he>2047&&(he<55296||he>57343)&&(N=he));break;case 4:ye=p[R+1],_e=p[R+2],we=p[R+3],(ye&192)===128&&(_e&192)===128&&(we&192)===128&&(he=(T&15)<<18|(ye&63)<<12|(_e&63)<<6|we&63,he>65535&&he<1114112&&(N=he))}}N===null?(N=65533,X=1):N>65535&&(N-=65536,m.push(N>>>10&1023|55296),N=56320|N&1023),m.push(N),R+=X}return q(m)}const j=4096;function q(p){const l=p.length;if(l<=j)return String.fromCharCode.apply(String,p);let d="",m=0;for(;m<l;)d+=String.fromCharCode.apply(String,p.slice(m,m+=j));return d}function V(p,l,d){let m="";d=Math.min(p.length,d);for(let R=l;R<d;++R)m+=String.fromCharCode(p[R]&127);return m}function U(p,l,d){let m="";d=Math.min(p.length,d);for(let R=l;R<d;++R)m+=String.fromCharCode(p[R]);return m}function K(p,l,d){const m=p.length;(!l||l<0)&&(l=0),(!d||d<0||d>m)&&(d=m);let R="";for(let T=l;T<d;++T)R+=At[p[T]];return R}function ne(p,l,d){const m=p.slice(l,d);let R="";for(let T=0;T<m.length-1;T+=2)R+=String.fromCharCode(m[T]+m[T+1]*256);return R}o.prototype.slice=function(l,d){const m=this.length;l=~~l,d=d===void 0?m:~~d,l<0?(l+=m,l<0&&(l=0)):l>m&&(l=m),d<0?(d+=m,d<0&&(d=0)):d>m&&(d=m),d<l&&(d=l);const R=this.subarray(l,d);return Object.setPrototypeOf(R,o.prototype),R};function H(p,l,d){if(p%1!==0||p<0)throw new RangeError("offset is not uint");if(p+l>d)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(l,d,m){l=l>>>0,d=d>>>0,m||H(l,d,this.length);let R=this[l],T=1,N=0;for(;++N<d&&(T*=256);)R+=this[l+N]*T;return R},o.prototype.readUintBE=o.prototype.readUIntBE=function(l,d,m){l=l>>>0,d=d>>>0,m||H(l,d,this.length);let R=this[l+--d],T=1;for(;d>0&&(T*=256);)R+=this[l+--d]*T;return R},o.prototype.readUint8=o.prototype.readUInt8=function(l,d){return l=l>>>0,d||H(l,1,this.length),this[l]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(l,d){return l=l>>>0,d||H(l,2,this.length),this[l]|this[l+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(l,d){return l=l>>>0,d||H(l,2,this.length),this[l]<<8|this[l+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(l,d){return l=l>>>0,d||H(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(l,d){return l=l>>>0,d||H(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},o.prototype.readBigUInt64LE=De(function(l){l=l>>>0,L(l,"offset");const d=this[l],m=this[l+7];(d===void 0||m===void 0)&&D(l,this.length-8);const R=d+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,T=this[++l]+this[++l]*2**8+this[++l]*2**16+m*2**24;return BigInt(R)+(BigInt(T)<<BigInt(32))}),o.prototype.readBigUInt64BE=De(function(l){l=l>>>0,L(l,"offset");const d=this[l],m=this[l+7];(d===void 0||m===void 0)&&D(l,this.length-8);const R=d*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],T=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+m;return(BigInt(R)<<BigInt(32))+BigInt(T)}),o.prototype.readIntLE=function(l,d,m){l=l>>>0,d=d>>>0,m||H(l,d,this.length);let R=this[l],T=1,N=0;for(;++N<d&&(T*=256);)R+=this[l+N]*T;return T*=128,R>=T&&(R-=Math.pow(2,8*d)),R},o.prototype.readIntBE=function(l,d,m){l=l>>>0,d=d>>>0,m||H(l,d,this.length);let R=d,T=1,N=this[l+--R];for(;R>0&&(T*=256);)N+=this[l+--R]*T;return T*=128,N>=T&&(N-=Math.pow(2,8*d)),N},o.prototype.readInt8=function(l,d){return l=l>>>0,d||H(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},o.prototype.readInt16LE=function(l,d){l=l>>>0,d||H(l,2,this.length);const m=this[l]|this[l+1]<<8;return m&32768?m|4294901760:m},o.prototype.readInt16BE=function(l,d){l=l>>>0,d||H(l,2,this.length);const m=this[l+1]|this[l]<<8;return m&32768?m|4294901760:m},o.prototype.readInt32LE=function(l,d){return l=l>>>0,d||H(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},o.prototype.readInt32BE=function(l,d){return l=l>>>0,d||H(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},o.prototype.readBigInt64LE=De(function(l){l=l>>>0,L(l,"offset");const d=this[l],m=this[l+7];(d===void 0||m===void 0)&&D(l,this.length-8);const R=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(m<<24);return(BigInt(R)<<BigInt(32))+BigInt(d+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24)}),o.prototype.readBigInt64BE=De(function(l){l=l>>>0,L(l,"offset");const d=this[l],m=this[l+7];(d===void 0||m===void 0)&&D(l,this.length-8);const R=(d<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return(BigInt(R)<<BigInt(32))+BigInt(this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+m)}),o.prototype.readFloatLE=function(l,d){return l=l>>>0,d||H(l,4,this.length),r.read(this,l,!0,23,4)},o.prototype.readFloatBE=function(l,d){return l=l>>>0,d||H(l,4,this.length),r.read(this,l,!1,23,4)},o.prototype.readDoubleLE=function(l,d){return l=l>>>0,d||H(l,8,this.length),r.read(this,l,!0,52,8)},o.prototype.readDoubleBE=function(l,d){return l=l>>>0,d||H(l,8,this.length),r.read(this,l,!1,52,8)};function Q(p,l,d,m,R,T){if(!o.isBuffer(p))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>R||l<T)throw new RangeError('"value" argument is out of bounds');if(d+m>p.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(l,d,m,R){if(l=+l,d=d>>>0,m=m>>>0,!R){const X=Math.pow(2,8*m)-1;Q(this,l,d,m,X,0)}let T=1,N=0;for(this[d]=l&255;++N<m&&(T*=256);)this[d+N]=l/T&255;return d+m},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(l,d,m,R){if(l=+l,d=d>>>0,m=m>>>0,!R){const X=Math.pow(2,8*m)-1;Q(this,l,d,m,X,0)}let T=m-1,N=1;for(this[d+T]=l&255;--T>=0&&(N*=256);)this[d+T]=l/N&255;return d+m},o.prototype.writeUint8=o.prototype.writeUInt8=function(l,d,m){return l=+l,d=d>>>0,m||Q(this,l,d,1,255,0),this[d]=l&255,d+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(l,d,m){return l=+l,d=d>>>0,m||Q(this,l,d,2,65535,0),this[d]=l&255,this[d+1]=l>>>8,d+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(l,d,m){return l=+l,d=d>>>0,m||Q(this,l,d,2,65535,0),this[d]=l>>>8,this[d+1]=l&255,d+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(l,d,m){return l=+l,d=d>>>0,m||Q(this,l,d,4,4294967295,0),this[d+3]=l>>>24,this[d+2]=l>>>16,this[d+1]=l>>>8,this[d]=l&255,d+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(l,d,m){return l=+l,d=d>>>0,m||Q(this,l,d,4,4294967295,0),this[d]=l>>>24,this[d+1]=l>>>16,this[d+2]=l>>>8,this[d+3]=l&255,d+4};function pe(p,l,d,m,R){w(l,m,R,p,d,7);let T=Number(l&BigInt(4294967295));p[d++]=T,T=T>>8,p[d++]=T,T=T>>8,p[d++]=T,T=T>>8,p[d++]=T;let N=Number(l>>BigInt(32)&BigInt(4294967295));return p[d++]=N,N=N>>8,p[d++]=N,N=N>>8,p[d++]=N,N=N>>8,p[d++]=N,d}function de(p,l,d,m,R){w(l,m,R,p,d,7);let T=Number(l&BigInt(4294967295));p[d+7]=T,T=T>>8,p[d+6]=T,T=T>>8,p[d+5]=T,T=T>>8,p[d+4]=T;let N=Number(l>>BigInt(32)&BigInt(4294967295));return p[d+3]=N,N=N>>8,p[d+2]=N,N=N>>8,p[d+1]=N,N=N>>8,p[d]=N,d+8}o.prototype.writeBigUInt64LE=De(function(l,d=0){return pe(this,l,d,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=De(function(l,d=0){return de(this,l,d,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(l,d,m,R){if(l=+l,d=d>>>0,!R){const ye=Math.pow(2,8*m-1);Q(this,l,d,m,ye-1,-ye)}let T=0,N=1,X=0;for(this[d]=l&255;++T<m&&(N*=256);)l<0&&X===0&&this[d+T-1]!==0&&(X=1),this[d+T]=(l/N>>0)-X&255;return d+m},o.prototype.writeIntBE=function(l,d,m,R){if(l=+l,d=d>>>0,!R){const ye=Math.pow(2,8*m-1);Q(this,l,d,m,ye-1,-ye)}let T=m-1,N=1,X=0;for(this[d+T]=l&255;--T>=0&&(N*=256);)l<0&&X===0&&this[d+T+1]!==0&&(X=1),this[d+T]=(l/N>>0)-X&255;return d+m},o.prototype.writeInt8=function(l,d,m){return l=+l,d=d>>>0,m||Q(this,l,d,1,127,-128),l<0&&(l=255+l+1),this[d]=l&255,d+1},o.prototype.writeInt16LE=function(l,d,m){return l=+l,d=d>>>0,m||Q(this,l,d,2,32767,-32768),this[d]=l&255,this[d+1]=l>>>8,d+2},o.prototype.writeInt16BE=function(l,d,m){return l=+l,d=d>>>0,m||Q(this,l,d,2,32767,-32768),this[d]=l>>>8,this[d+1]=l&255,d+2},o.prototype.writeInt32LE=function(l,d,m){return l=+l,d=d>>>0,m||Q(this,l,d,4,2147483647,-2147483648),this[d]=l&255,this[d+1]=l>>>8,this[d+2]=l>>>16,this[d+3]=l>>>24,d+4},o.prototype.writeInt32BE=function(l,d,m){return l=+l,d=d>>>0,m||Q(this,l,d,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[d]=l>>>24,this[d+1]=l>>>16,this[d+2]=l>>>8,this[d+3]=l&255,d+4},o.prototype.writeBigInt64LE=De(function(l,d=0){return pe(this,l,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=De(function(l,d=0){return de(this,l,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Me(p,l,d,m,R,T){if(d+m>p.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function I(p,l,d,m,R){return l=+l,d=d>>>0,R||Me(p,l,d,4),r.write(p,l,d,m,23,4),d+4}o.prototype.writeFloatLE=function(l,d,m){return I(this,l,d,!0,m)},o.prototype.writeFloatBE=function(l,d,m){return I(this,l,d,!1,m)};function k(p,l,d,m,R){return l=+l,d=d>>>0,R||Me(p,l,d,8),r.write(p,l,d,m,52,8),d+8}o.prototype.writeDoubleLE=function(l,d,m){return k(this,l,d,!0,m)},o.prototype.writeDoubleBE=function(l,d,m){return k(this,l,d,!1,m)},o.prototype.copy=function(l,d,m,R){if(!o.isBuffer(l))throw new TypeError("argument should be a Buffer");if(m||(m=0),!R&&R!==0&&(R=this.length),d>=l.length&&(d=l.length),d||(d=0),R>0&&R<m&&(R=m),R===m||l.length===0||this.length===0)return 0;if(d<0)throw new RangeError("targetStart out of bounds");if(m<0||m>=this.length)throw new RangeError("Index out of range");if(R<0)throw new RangeError("sourceEnd out of bounds");R>this.length&&(R=this.length),l.length-d<R-m&&(R=l.length-d+m);const T=R-m;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(d,m,R):Uint8Array.prototype.set.call(l,this.subarray(m,R),d),T},o.prototype.fill=function(l,d,m,R){if(typeof l=="string"){if(typeof d=="string"?(R=d,d=0,m=this.length):typeof m=="string"&&(R=m,m=this.length),R!==void 0&&typeof R!="string")throw new TypeError("encoding must be a string");if(typeof R=="string"&&!o.isEncoding(R))throw new TypeError("Unknown encoding: "+R);if(l.length===1){const N=l.charCodeAt(0);(R==="utf8"&&N<128||R==="latin1")&&(l=N)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(d<0||this.length<d||this.length<m)throw new RangeError("Out of range index");if(m<=d)return this;d=d>>>0,m=m===void 0?this.length:m>>>0,l||(l=0);let T;if(typeof l=="number")for(T=d;T<m;++T)this[T]=l;else{const N=o.isBuffer(l)?l:o.from(l,R),X=N.length;if(X===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(T=0;T<m-d;++T)this[T+d]=N[T%X]}return this};const P={};function J(p,l,d){P[p]=class extends d{constructor(){super(),Object.defineProperty(this,"message",{value:l.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${p}]`,this.stack,delete this.name}get code(){return p}set code(R){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:R,writable:!0})}toString(){return`${this.name} [${p}]: ${this.message}`}}}J("ERR_BUFFER_OUT_OF_BOUNDS",function(p){return p?`${p} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),J("ERR_INVALID_ARG_TYPE",function(p,l){return`The "${p}" argument must be of type number. Received type ${typeof l}`},TypeError),J("ERR_OUT_OF_RANGE",function(p,l,d){let m=`The value of "${p}" is out of range.`,R=d;return Number.isInteger(d)&&Math.abs(d)>2**32?R=ee(String(d)):typeof d=="bigint"&&(R=String(d),(d>BigInt(2)**BigInt(32)||d<-(BigInt(2)**BigInt(32)))&&(R=ee(R)),R+="n"),m+=` It must be ${l}. Received ${R}`,m},RangeError);function ee(p){let l="",d=p.length;const m=p[0]==="-"?1:0;for(;d>=m+4;d-=3)l=`_${p.slice(d-3,d)}${l}`;return`${p.slice(0,d)}${l}`}function y(p,l,d){L(l,"offset"),(p[l]===void 0||p[l+d]===void 0)&&D(l,p.length-(d+1))}function w(p,l,d,m,R,T){if(p>d||p<l){const N=typeof l=="bigint"?"n":"";let X;throw T>3?l===0||l===BigInt(0)?X=`>= 0${N} and < 2${N} ** ${(T+1)*8}${N}`:X=`>= -(2${N} ** ${(T+1)*8-1}${N}) and < 2 ** ${(T+1)*8-1}${N}`:X=`>= ${l}${N} and <= ${d}${N}`,new P.ERR_OUT_OF_RANGE("value",X,p)}y(m,R,T)}function L(p,l){if(typeof p!="number")throw new P.ERR_INVALID_ARG_TYPE(l,"number",p)}function D(p,l,d){throw Math.floor(p)!==p?(L(p,d),new P.ERR_OUT_OF_RANGE(d||"offset","an integer",p)):l<0?new P.ERR_BUFFER_OUT_OF_BOUNDS:new P.ERR_OUT_OF_RANGE(d||"offset",`>= ${d?1:0} and <= ${l}`,p)}const me=/[^+/0-9A-Za-z-_]/g;function te(p){if(p=p.split("=")[0],p=p.trim().replace(me,""),p.length<2)return"";for(;p.length%4!==0;)p=p+"=";return p}function ae(p,l){l=l||1/0;let d;const m=p.length;let R=null;const T=[];for(let N=0;N<m;++N){if(d=p.charCodeAt(N),d>55295&&d<57344){if(!R){if(d>56319){(l-=3)>-1&&T.push(239,191,189);continue}else if(N+1===m){(l-=3)>-1&&T.push(239,191,189);continue}R=d;continue}if(d<56320){(l-=3)>-1&&T.push(239,191,189),R=d;continue}d=(R-55296<<10|d-56320)+65536}else R&&(l-=3)>-1&&T.push(239,191,189);if(R=null,d<128){if((l-=1)<0)break;T.push(d)}else if(d<2048){if((l-=2)<0)break;T.push(d>>6|192,d&63|128)}else if(d<65536){if((l-=3)<0)break;T.push(d>>12|224,d>>6&63|128,d&63|128)}else if(d<1114112){if((l-=4)<0)break;T.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw new Error("Invalid code point")}return T}function rt(p){const l=[];for(let d=0;d<p.length;++d)l.push(p.charCodeAt(d)&255);return l}function wt(p,l){let d,m,R;const T=[];for(let N=0;N<p.length&&!((l-=2)<0);++N)d=p.charCodeAt(N),m=d>>8,R=d%256,T.push(R),T.push(m);return T}function xt(p){return t.toByteArray(te(p))}function Et(p,l,d,m){let R;for(R=0;R<m&&!(R+d>=l.length||R>=p.length);++R)l[R+d]=p[R];return R}function $e(p,l){return p instanceof l||p!=null&&p.constructor!=null&&p.constructor.name!=null&&p.constructor.name===l.name}function ct(p){return p!==p}const At=function(){const p="0123456789abcdef",l=new Array(256);for(let d=0;d<16;++d){const m=d*16;for(let R=0;R<16;++R)l[m+R]=p[d]+p[R]}return l}();function De(p){return typeof BigInt>"u"?lt:p}function lt(){throw new Error("BigInt not supported")}})(xr);(function(e,t){var r=xr,n=r.Buffer;function i(a,o){for(var c in a)o[c]=a[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(a,o,c){return n(a,o,c)}i(n,s),s.from=function(a,o,c){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,o,c)},s.alloc=function(a,o,c){if(typeof a!="number")throw new TypeError("Argument must be a number");var u=n(a);return o!==void 0?typeof c=="string"?u.fill(o,c):u.fill(o):u.fill(0),u},s.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},s.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(a)}})(ao,ao.exports);var Kt=ao.exports,El=Kt.Buffer;function ri(e,t){this._block=El.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}ri.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=El.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,a=0;a<i;){for(var o=s%n,c=Math.min(i-a,n-o),u=0;u<c;u++)r[o+u]=e[a+u];s+=c,a+=c,s%n===0&&this._update(r)}return this._len+=i,this};ri.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};ri.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Ar=ri,Mh=st,vl=Ar,Nh=Kt.Buffer,Lh=[1518500249,1859775393,-1894007588,-899497514],Ph=new Array(80);function Xr(){this.init(),this._w=Ph,vl.call(this,64,56)}Mh(Xr,vl);Xr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Bh(e){return e<<5|e>>>27}function Oh(e){return e<<30|e>>>2}function $h(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Xr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,o=0;o<16;++o)t[o]=e.readInt32BE(o*4);for(;o<80;++o)t[o]=t[o-3]^t[o-8]^t[o-14]^t[o-16];for(var c=0;c<80;++c){var u=~~(c/20),f=Bh(r)+$h(u,n,i,s)+a+t[c]+Lh[u]|0;a=s,s=i,i=Oh(n),n=r,r=f}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};Xr.prototype._hash=function(){var e=Nh.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Fh=Xr,Dh=st,Sl=Ar,jh=Kt.Buffer,Uh=[1518500249,1859775393,-1894007588,-899497514],Hh=new Array(80);function en(){this.init(),this._w=Hh,Sl.call(this,64,56)}Dh(en,Sl);en.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Wh(e){return e<<1|e>>>31}function Vh(e){return e<<5|e>>>27}function zh(e){return e<<30|e>>>2}function qh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}en.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,o=0;o<16;++o)t[o]=e.readInt32BE(o*4);for(;o<80;++o)t[o]=Wh(t[o-3]^t[o-8]^t[o-14]^t[o-16]);for(var c=0;c<80;++c){var u=~~(c/20),f=Vh(r)+qh(u,n,i,s)+a+t[c]+Uh[u]|0;a=s,s=i,i=zh(n),n=r,r=f}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};en.prototype._hash=function(){var e=jh.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Gh=en,Jh=st,Rl=Ar,Zh=Kt.Buffer,Kh=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Qh=new Array(64);function tn(){this.init(),this._w=Qh,Rl.call(this,64,56)}Jh(tn,Rl);tn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Yh(e,t,r){return r^e&(t^r)}function Xh(e,t,r){return e&t|r&(e|t)}function ef(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function tf(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function rf(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function nf(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}tn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,o=this._f|0,c=this._g|0,u=this._h|0,f=0;f<16;++f)t[f]=e.readInt32BE(f*4);for(;f<64;++f)t[f]=nf(t[f-2])+t[f-7]+rf(t[f-15])+t[f-16]|0;for(var h=0;h<64;++h){var g=u+tf(a)+Yh(a,o,c)+Kh[h]+t[h]|0,_=ef(r)+Xh(r,n,i)|0;u=c,c=o,o=a,a=s+g|0,s=i,i=n,n=r,r=g+_|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=o+this._f|0,this._g=c+this._g|0,this._h=u+this._h|0};tn.prototype._hash=function(){var e=Zh.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Cl=tn,sf=st,of=Cl,af=Ar,cf=Kt.Buffer,lf=new Array(64);function ni(){this.init(),this._w=lf,af.call(this,64,56)}sf(ni,of);ni.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};ni.prototype._hash=function(){var e=cf.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var uf=ni,df=st,kl=Ar,hf=Kt.Buffer,ba=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],ff=new Array(160);function rn(){this.init(),this._w=ff,kl.call(this,128,112)}df(rn,kl);rn.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function ya(e,t,r){return r^e&(t^r)}function wa(e,t,r){return e&t|r&(e|t)}function Ea(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function va(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function pf(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function gf(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function _f(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function mf(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Ne(e,t){return e>>>0<t>>>0?1:0}rn.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,a=this._eh|0,o=this._fh|0,c=this._gh|0,u=this._hh|0,f=this._al|0,h=this._bl|0,g=this._cl|0,_=this._dl|0,E=this._el|0,x=this._fl|0,S=this._gl|0,b=this._hl|0,v=0;v<32;v+=2)t[v]=e.readInt32BE(v*4),t[v+1]=e.readInt32BE(v*4+4);for(;v<160;v+=2){var C=t[v-30],M=t[v-15*2+1],A=pf(C,M),B=gf(M,C);C=t[v-2*2],M=t[v-2*2+1];var G=_f(C,M),W=mf(M,C),F=t[v-7*2],re=t[v-7*2+1],Ee=t[v-16*2],fe=t[v-16*2+1],$=B+re|0,O=A+F+Ne($,B)|0;$=$+W|0,O=O+G+Ne($,W)|0,$=$+fe|0,O=O+Ee+Ne($,fe)|0,t[v]=O,t[v+1]=$}for(var j=0;j<160;j+=2){O=t[j],$=t[j+1];var q=wa(r,n,i),V=wa(f,h,g),U=Ea(r,f),K=Ea(f,r),ne=va(a,E),H=va(E,a),Q=ba[j],pe=ba[j+1],de=ya(a,o,c),Me=ya(E,x,S),I=b+H|0,k=u+ne+Ne(I,b)|0;I=I+Me|0,k=k+de+Ne(I,Me)|0,I=I+pe|0,k=k+Q+Ne(I,pe)|0,I=I+$|0,k=k+O+Ne(I,$)|0;var P=K+V|0,J=U+q+Ne(P,K)|0;u=c,b=S,c=o,S=x,o=a,x=E,E=_+I|0,a=s+k+Ne(E,_)|0,s=i,_=g,i=n,g=h,n=r,h=f,f=I+P|0,r=k+J+Ne(f,I)|0}this._al=this._al+f|0,this._bl=this._bl+h|0,this._cl=this._cl+g|0,this._dl=this._dl+_|0,this._el=this._el+E|0,this._fl=this._fl+x|0,this._gl=this._gl+S|0,this._hl=this._hl+b|0,this._ah=this._ah+r+Ne(this._al,f)|0,this._bh=this._bh+n+Ne(this._bl,h)|0,this._ch=this._ch+i+Ne(this._cl,g)|0,this._dh=this._dh+s+Ne(this._dl,_)|0,this._eh=this._eh+a+Ne(this._el,E)|0,this._fh=this._fh+o+Ne(this._fl,x)|0,this._gh=this._gh+c+Ne(this._gl,S)|0,this._hh=this._hh+u+Ne(this._hl,b)|0};rn.prototype._hash=function(){var e=hf.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Il=rn,bf=st,yf=Il,wf=Ar,Ef=Kt.Buffer,vf=new Array(160);function ii(){this.init(),this._w=vf,wf.call(this,128,112)}bf(ii,yf);ii.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};ii.prototype._hash=function(){var e=Ef.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Sf=ii,Qt=yl.exports=function(t){t=t.toLowerCase();var r=Qt[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};Qt.sha=Fh;Qt.sha1=Gh;Qt.sha224=uf;Qt.sha256=Cl;Qt.sha384=Sf;Qt.sha512=Il;var Rf=yl.exports;Object.defineProperty(Ir,"__esModule",{value:!0});Ir.Session=void 0;const Sa=Rf,Ra=z,Ca="session:id",ka="session:secret",Ia="session:linked";class xo{constructor(t,r,n,i){this._storage=t,this._id=r||(0,Ra.randomBytesHex)(16),this._secret=n||(0,Ra.randomBytesHex)(32),this._key=new Sa.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(Ca),n=t.getItem(Ia),i=t.getItem(ka);return r&&i?new xo(t,r,i,n==="1"):null}static hash(t){return new Sa.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Ca,this._id),this._storage.setItem(ka,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Ia,this._linked?"1":"0")}}Ir.Session=xo;var si={},oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.Cipher=void 0;const wn=z;class Cf{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,wn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),o=16,c=a.slice(a.byteLength-o),u=a.slice(0,a.byteLength-o),f=new Uint8Array(c),h=new Uint8Array(u),g=new Uint8Array([...n,...f,...h]);return(0,wn.uint8ArrayToHex)(g)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,wn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,wn.hexStringToUint8Array)(t),o=a.slice(0,12),c=a.slice(12,28),u=a.slice(28),f=new Uint8Array([...u,...c]),h={name:"AES-GCM",iv:new Uint8Array(o)};try{const g=await window.crypto.subtle.decrypt(h,s,f),_=new TextDecoder;n(_.decode(g))}catch(g){i(g)}})()})}}oi.Cipher=Cf;var ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.WalletLinkHTTP=void 0;class kf{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(t=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}ai.WalletLinkHTTP=kf;var _r={};Object.defineProperty(_r,"__esModule",{value:!0});_r.WalletLinkWebSocket=_r.ConnectionState=void 0;var ur;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(ur||(_r.ConnectionState=ur={}));class If{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,ur.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,ur.DISCONNECTED)},i.onopen=s=>{var a;t(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,ur.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},i.onmessage=s=>{var a,o;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(s.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,c)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,ur.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}_r.WalletLinkWebSocket=If;Object.defineProperty(si,"__esModule",{value:!0});si.WalletLinkConnection=void 0;const ir=Ae,xf=oi,ut=kr,xa=Ye,sr=Ir,Af=ai,En=_r,Aa=1e4,Tf=6e4;class Mf{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,ir.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=o=>{if(!o)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",u=>o.JsonRpcUrl&&this.handleChainUpdated(u,o.JsonRpcUrl)]]).forEach((u,f)=>{const h=o[f];h!==void 0&&u(h)})},this.handleDestroyed=o=>{var c,u;o==="1"&&((c=this.listener)===null||c===void 0||c.resetAndReload(),(u=this.diagnostic)===null||u===void 0||u.log(ut.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:sr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async o=>{var c,u;try{const f=await this.cipher.decrypt(o);(c=this.listener)===null||c===void 0||c.accountUpdated(f)}catch{(u=this.diagnostic)===null||u===void 0||u.log(ut.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(o,c)=>{var u,f;try{const h=await this.cipher.decrypt(c);(u=this.listener)===null||u===void 0||u.metadataUpdated(o,h)}catch{(f=this.diagnostic)===null||f===void 0||f.log(ut.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:o})}},this.handleWalletUsernameUpdated=async o=>{this.handleMetadataUpdated(xa.WALLET_USER_NAME_KEY,o)},this.handleAppVersionUpdated=async o=>{this.handleMetadataUpdated(xa.APP_VERSION_KEY,o)},this.handleChainUpdated=async(o,c)=>{var u,f;try{const h=await this.cipher.decrypt(o),g=await this.cipher.decrypt(c);(u=this.listener)===null||u===void 0||u.chainUpdated(h,g)}catch{(f=this.diagnostic)===null||f===void 0||f.log(ut.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new xf.Cipher(t.secret),this.diagnostic=i,this.listener=n;const a=new En.WalletLinkWebSocket(`${r}/rpc`,s);a.setConnectionStateListener(async o=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(ut.EVENTS.CONNECTED_STATE_CHANGE,{state:o,sessionIdHash:sr.Session.hash(t.id)});let u=!1;switch(o){case En.ConnectionState.DISCONNECTED:if(!this.destroyed){const f=async()=>{await new Promise(h=>setTimeout(h,5e3)),this.destroyed||a.connect().catch(()=>{f()})};f()}break;case En.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),u=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Aa),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case En.ConnectionState.CONNECTING:break}this.connected!==u&&(this.connected=u)}),a.setIncomingDataListener(o=>{var c,u,f;switch(o.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const h=o.type==="IsLinkedOK"?o.linked:void 0;(c=this.diagnostic)===null||c===void 0||c.log(ut.EVENTS.LINKED,{sessionIdHash:sr.Session.hash(t.id),linked:h,type:o.type,onlineGuests:o.onlineGuests}),this.linked=h||o.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(u=this.diagnostic)===null||u===void 0||u.log(ut.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:sr.Session.hash(t.id),metadata_keys:o&&o.metadata?Object.keys(o.metadata):void 0}),this.handleSessionMetadataUpdated(o.metadata);break}case"Event":{this.handleIncomingEvent(o);break}}o.id!==void 0&&((f=this.requestResolutions.get(o.id))===null||f===void 0||f(o))}),this.ws=a,this.http=new Af.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(ut.EVENTS.STARTED_CONNECTING,{sessionIdHash:sr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(ut.EVENTS.DISCONNECTED,{sessionIdHash:sr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(ut.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Aa*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Tf){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,ir.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,ir.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}si.WalletLinkConnection=Mf;var nn={},sn={},Ao={};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.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 Nf=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sn,"__esModule",{value:!0});sn.injectCssReset=void 0;const Lf=Nf(Ao);function Pf(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Lf.default)),document.documentElement.appendChild(e)}sn.injectCssReset=Pf;var ci={},on,ve,xl,Al,jt,Ta,Tl,co,To,lo,uo,Ml,Hr={},Nl=[],Bf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,li=Array.isArray;function Rt(e,t){for(var r in t)e[r]=t[r];return e}function Ll(e){var t=e.parentNode;t&&t.removeChild(e)}function ho(e,t,r){var n,i,s,a={};for(s in t)s=="key"?n=t[s]:s=="ref"?i=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?on.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)a[s]===void 0&&(a[s]=e.defaultProps[s]);return Fr(e,a,n,i,null)}function Fr(e,t,r,n,i){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++xl,__i:-1,__u:0};return i==null&&ve.vnode!=null&&ve.vnode(s),s}function Of(){return{current:null}}function an(e){return e.children}function Dr(e,t){this.props=e,this.context=t}function qt(e,t){if(t==null)return e.__?qt(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?qt(e):null}function Pl(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Pl(e)}}function fo(e){(!e.__d&&(e.__d=!0)&&jt.push(e)&&!Dn.__r++||Ta!==ve.debounceRendering)&&((Ta=ve.debounceRendering)||Tl)(Dn)}function Dn(){var e,t,r,n,i,s,a,o;for(jt.sort(co);e=jt.shift();)e.__d&&(t=jt.length,n=void 0,s=(i=(r=e).__v).__e,a=[],o=[],r.__P&&((n=Rt({},i)).__v=i.__v+1,ve.vnode&&ve.vnode(n),Mo(r.__P,n,i,r.__n,r.__P.namespaceURI,32&i.__u?[s]:null,a,s??qt(i),!!(32&i.__u),o),n.__v=i.__v,n.__.__k[n.__i]=n,Fl(a,n,o),n.__e!=s&&Pl(n)),jt.length>t&&jt.sort(co));Dn.__r=0}function Bl(e,t,r,n,i,s,a,o,c,u,f){var h,g,_,E,x,S=n&&n.__k||Nl,b=t.length;for(r.__d=c,$f(r,t,S),c=r.__d,h=0;h<b;h++)(_=r.__k[h])!=null&&typeof _!="boolean"&&typeof _!="function"&&(g=_.__i===-1?Hr:S[_.__i]||Hr,_.__i=h,Mo(e,_,g,i,s,a,o,c,u,f),E=_.__e,_.ref&&g.ref!=_.ref&&(g.ref&&No(g.ref,null,_),f.push(_.ref,_.__c||E,_)),x==null&&E!=null&&(x=E),65536&_.__u||g.__k===_.__k?(c&&!c.isConnected&&(c=qt(g)),c=Ol(_,c,e)):typeof _.type=="function"&&_.__d!==void 0?c=_.__d:E&&(c=E.nextSibling),_.__d=void 0,_.__u&=-196609);r.__d=c,r.__e=x}function $f(e,t,r){var n,i,s,a,o,c=t.length,u=r.length,f=u,h=0;for(e.__k=[],n=0;n<c;n++)a=n+h,(i=e.__k[n]=(i=t[n])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?Fr(null,i,null,null,null):li(i)?Fr(an,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?Fr(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,o=Ff(i,r,a,f),i.__i=o,s=null,o!==-1&&(f--,(s=r[o])&&(s.__u|=131072)),s==null||s.__v===null?(o==-1&&h--,typeof i.type!="function"&&(i.__u|=65536)):o!==a&&(o===a+1?h++:o>a?f>c-a?h+=o-a:h--:o<a?o==a-1&&(h=o-a):h=0,o!==n+h&&(i.__u|=65536))):(s=r[a])&&s.key==null&&s.__e&&!(131072&s.__u)&&(s.__e==e.__d&&(e.__d=qt(s)),po(s,s,!1),r[a]=null,f--);if(f)for(n=0;n<u;n++)(s=r[n])!=null&&!(131072&s.__u)&&(s.__e==e.__d&&(e.__d=qt(s)),po(s,s))}function Ol(e,t,r){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=Ol(n[i],t,r));return t}e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function $l(e,t){return t=t||[],e==null||typeof e=="boolean"||(li(e)?e.some(function(r){$l(r,t)}):t.push(e)),t}function Ff(e,t,r,n){var i=e.key,s=e.type,a=r-1,o=r+1,c=t[r];if(c===null||c&&i==c.key&&s===c.type&&!(131072&c.__u))return r;if(n>(c!=null&&!(131072&c.__u)?1:0))for(;a>=0||o<t.length;){if(a>=0){if((c=t[a])&&!(131072&c.__u)&&i==c.key&&s===c.type)return a;a--}if(o<t.length){if((c=t[o])&&!(131072&c.__u)&&i==c.key&&s===c.type)return o;o++}}return-1}function Ma(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Bf.test(t)?r:r+"px"}function vn(e,t,r,n,i){var s;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Ma(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Ma(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")s=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?n?r.u=n.u:(r.u=To,e.addEventListener(t,s?uo:lo,s)):e.removeEventListener(t,s?uo:lo,s);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,r))}}function Na(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=To++;else if(t.t<r.u)return;return r(ve.event?ve.event(t):t)}}}function Mo(e,t,r,n,i,s,a,o,c,u){var f,h,g,_,E,x,S,b,v,C,M,A,B,G,W,F=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),s=[o=t.__e=r.__e]),(f=ve.__b)&&f(t);e:if(typeof F=="function")try{if(b=t.props,v=(f=F.contextType)&&n[f.__c],C=f?v?v.props.value:f.__:n,r.__c?S=(h=t.__c=r.__c).__=h.__E:("prototype"in F&&F.prototype.render?t.__c=h=new F(b,C):(t.__c=h=new Dr(b,C),h.constructor=F,h.render=jf),v&&v.sub(h),h.props=b,h.state||(h.state={}),h.context=C,h.__n=n,g=h.__d=!0,h.__h=[],h._sb=[]),h.__s==null&&(h.__s=h.state),F.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Rt({},h.__s)),Rt(h.__s,F.getDerivedStateFromProps(b,h.__s))),_=h.props,E=h.state,h.__v=t,g)F.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(F.getDerivedStateFromProps==null&&b!==_&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(b,C),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(b,h.__s,C)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(re){re&&(re.__=t)}),M=0;M<h._sb.length;M++)h.__h.push(h._sb[M]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(b,h.__s,C),h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(_,E,x)})}if(h.context=C,h.props=b,h.__P=e,h.__e=!1,A=ve.__r,B=0,"prototype"in F&&F.prototype.render){for(h.state=h.__s,h.__d=!1,A&&A(t),f=h.render(h.props,h.state,h.context),G=0;G<h._sb.length;G++)h.__h.push(h._sb[G]);h._sb=[]}else do h.__d=!1,A&&A(t),f=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++B<25);h.state=h.__s,h.getChildContext!=null&&(n=Rt(Rt({},n),h.getChildContext())),g||h.getSnapshotBeforeUpdate==null||(x=h.getSnapshotBeforeUpdate(_,E)),Bl(e,li(W=f!=null&&f.type===an&&f.key==null?f.props.children:f)?W:[W],t,r,n,i,s,a,o,c,u),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),S&&(h.__E=h.__=null)}catch(re){t.__v=null,c||s!=null?(t.__e=o,t.__u|=c?160:32,s[s.indexOf(o)]=null):(t.__e=r.__e,t.__k=r.__k),ve.__e(re,t,r)}else s==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=Df(r.__e,t,r,n,i,s,a,c,u);(f=ve.diffed)&&f(t)}function Fl(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)No(r[n],r[++n],r[++n]);ve.__c&&ve.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(s){s.call(i)})}catch(s){ve.__e(s,i.__v)}})}function Df(e,t,r,n,i,s,a,o,c){var u,f,h,g,_,E,x,S=r.props,b=t.props,v=t.type;if(v==="svg"?i="http://www.w3.org/2000/svg":v==="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(u=0;u<s.length;u++)if((_=s[u])&&"setAttribute"in _==!!v&&(v?_.localName===v:_.nodeType===3)){e=_,s[u]=null;break}}if(e==null){if(v===null)return document.createTextNode(b);e=document.createElementNS(i,v,b.is&&b),s=null,o=!1}if(v===null)S===b||o&&e.data===b||(e.data=b);else{if(s=s&&on.call(e.childNodes),S=r.props||Hr,!o&&s!=null)for(S={},u=0;u<e.attributes.length;u++)S[(_=e.attributes[u]).name]=_.value;for(u in S)if(_=S[u],u!="children"){if(u=="dangerouslySetInnerHTML")h=_;else if(u!=="key"&&!(u in b)){if(u=="value"&&"defaultValue"in b||u=="checked"&&"defaultChecked"in b)continue;vn(e,u,null,_,i)}}for(u in b)_=b[u],u=="children"?g=_:u=="dangerouslySetInnerHTML"?f=_:u=="value"?E=_:u=="checked"?x=_:u==="key"||o&&typeof _!="function"||S[u]===_||vn(e,u,_,S[u],i);if(f)o||h&&(f.__html===h.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(h&&(e.innerHTML=""),Bl(e,li(g)?g:[g],t,r,n,v==="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,a,s?s[0]:r.__k&&qt(r,0),o,c),s!=null)for(u=s.length;u--;)s[u]!=null&&Ll(s[u]);o||(u="value",E!==void 0&&(E!==e[u]||v==="progress"&&!E||v==="option"&&E!==S[u])&&vn(e,u,E,S[u],i),u="checked",x!==void 0&&x!==e[u]&&vn(e,u,x,S[u],i))}return e}function No(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){ve.__e(n,r)}}function po(e,t,r){var n,i;if(ve.unmount&&ve.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||No(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){ve.__e(s,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&po(n[i],t,r||typeof e.type!="function");r||e.__e==null||Ll(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function jf(e,t,r){return this.constructor(e,r)}function Dl(e,t,r){var n,i,s,a;ve.__&&ve.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,s=[],a=[],Mo(t,e=(!n&&r||t).__k=ho(an,null,[e]),i||Hr,Hr,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?on.call(t.childNodes):null,s,!n&&r?r:i?i.__e:t.firstChild,n,a),Fl(s,e,a)}function jl(e,t){Dl(e,t,jl)}function Uf(e,t,r){var n,i,s,a,o=Rt({},e.props);for(s in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)s=="key"?n=t[s]:s=="ref"?i=t[s]:o[s]=t[s]===void 0&&a!==void 0?a[s]:t[s];return arguments.length>2&&(o.children=arguments.length>3?on.call(arguments,2):r),Fr(e.type,o,n||e.key,i||e.ref,null)}function Hf(e,t){var r={__c:t="__cC"+Ml++,__:e,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=[],(s={})[t]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.some(function(o){o.__e=!0,fo(o)})},this.sub=function(a){i.push(a);var o=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),o&&o.call(a)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}on=Nl.slice,ve={__e:function(e,t,r,n){for(var i,s,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(o){e=o}throw e}},xl=0,Al=function(e){return e!=null&&e.constructor==null},Dr.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Rt({},this.state),typeof e=="function"&&(e=e(Rt({},r),this.props)),e&&Rt(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),fo(this))},Dr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),fo(this))},Dr.prototype.render=an,jt=[],Tl=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,co=function(e,t){return e.__v.__b-t.__v.__b},Dn.__r=0,To=0,lo=Na(!1),uo=Na(!0),Ml=0;const Wf=Object.freeze(Object.defineProperty({__proto__:null,Component:Dr,Fragment:an,cloneElement:Uf,createContext:Hf,createElement:ho,createRef:Of,h:ho,hydrate:jl,get isValidElement(){return Al},get options(){return ve},render:Dl,toChildArray:$l},Symbol.toStringTag,{value:"Module"})),We=qn(Wf);var ui={},kt,be,Ns,La,mr=0,Ul=[],Bn=[],Ce=ve,Pa=Ce.__b,Ba=Ce.__r,Oa=Ce.diffed,$a=Ce.__c,Fa=Ce.unmount,Da=Ce.__;function Yt(e,t){Ce.__h&&Ce.__h(be,e,mr||t),mr=0;var r=be.__H||(be.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:Bn}),r.__[e]}function Hl(e){return mr=1,Wl(zl,e)}function Wl(e,t,r){var n=Yt(kt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):zl(void 0,t),function(o){var c=n.__N?n.__N[0]:n.__[0],u=n.t(c,o);c!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=be,!be.u)){var i=function(o,c,u){if(!n.__c.__H)return!0;var f=n.__c.__H.__.filter(function(g){return!!g.__c});if(f.every(function(g){return!g.__N}))return!s||s.call(this,o,c,u);var h=!1;return f.forEach(function(g){if(g.__N){var _=g.__[0];g.__=g.__N,g.__N=void 0,_!==g.__[0]&&(h=!0)}}),!(!h&&n.__c.props===o)&&(!s||s.call(this,o,c,u))};be.u=!0;var s=be.shouldComponentUpdate,a=be.componentWillUpdate;be.componentWillUpdate=function(o,c,u){if(this.__e){var f=s;s=void 0,i(o,c,u),s=f}a&&a.call(this,o,c,u)},be.shouldComponentUpdate=i}return n.__N||n.__}function Vf(e,t){var r=Yt(kt++,3);!Ce.__s&&Po(r.__H,t)&&(r.__=e,r.i=t,be.__H.__h.push(r))}function Vl(e,t){var r=Yt(kt++,4);!Ce.__s&&Po(r.__H,t)&&(r.__=e,r.i=t,be.__h.push(r))}function zf(e){return mr=5,Lo(function(){return{current:e}},[])}function qf(e,t,r){mr=6,Vl(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function Lo(e,t){var r=Yt(kt++,7);return Po(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Gf(e,t){return mr=8,Lo(function(){return e},t)}function Jf(e){var t=be.context[e.__c],r=Yt(kt++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(be)),t.props.value):e.__}function Zf(e,t){Ce.useDebugValue&&Ce.useDebugValue(t?t(e):e)}function Kf(e){var t=Yt(kt++,10),r=Hl();return t.__=e,be.componentDidCatch||(be.componentDidCatch=function(n,i){t.__&&t.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Qf(){var e=Yt(kt++,11);if(!e.__){for(var t=be.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Yf(){for(var e;e=Ul.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(On),e.__H.__h.forEach(go),e.__H.__h=[]}catch(t){e.__H.__h=[],Ce.__e(t,e.__v)}}Ce.__b=function(e){be=null,Pa&&Pa(e)},Ce.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Da&&Da(e,t)},Ce.__r=function(e){Ba&&Ba(e),kt=0;var t=(be=e.__c).__H;t&&(Ns===be?(t.__h=[],be.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Bn,r.__N=r.i=void 0})):(t.__h.forEach(On),t.__h.forEach(go),t.__h=[],kt=0)),Ns=be},Ce.diffed=function(e){Oa&&Oa(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ul.push(t)!==1&&La===Ce.requestAnimationFrame||((La=Ce.requestAnimationFrame)||Xf)(Yf)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Bn&&(r.__=r.__V),r.i=void 0,r.__V=Bn})),Ns=be=null},Ce.__c=function(e,t){t.some(function(r){try{r.__h.forEach(On),r.__h=r.__h.filter(function(n){return!n.__||go(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Ce.__e(n,r.__v)}}),$a&&$a(e,t)},Ce.unmount=function(e){Fa&&Fa(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{On(n)}catch(i){t=i}}),r.__H=void 0,t&&Ce.__e(t,r.__v))};var ja=typeof requestAnimationFrame=="function";function Xf(e){var t,r=function(){clearTimeout(n),ja&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);ja&&(t=requestAnimationFrame(r))}function On(e){var t=be,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),be=t}function go(e){var t=be;e.__c=e.__(),be=t}function Po(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function zl(e,t){return typeof t=="function"?t(e):t}const e0=Object.freeze(Object.defineProperty({__proto__:null,useCallback:Gf,useContext:Jf,useDebugValue:Zf,useEffect:Vf,useErrorBoundary:Kf,useId:Qf,useImperativeHandle:qf,useLayoutEffect:Vl,useMemo:Lo,useReducer:Wl,useRef:zf,useState:Hl},Symbol.toStringTag,{value:"Module"})),di=qn(e0);var br={},hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.CloseIcon=void 0;const Ua=We;function t0(e){return(0,Ua.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ua.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"}))}hi.CloseIcon=t0;var fi={};Object.defineProperty(fi,"__esModule",{value:!0});fi.CoinbaseWalletRound=void 0;const Sn=We;function r0(e){return(0,Sn.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Sn.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,Sn.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,Sn.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}fi.CoinbaseWalletRound=r0;var pi={};Object.defineProperty(pi,"__esModule",{value:!0});pi.QRCodeIcon=void 0;const Pr=We;function n0(e){return(0,Pr.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,Pr.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,Pr.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,Pr.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,Pr.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}pi.QRCodeIcon=n0;var gi={};function ql(e){this.mode=qe.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}ql.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function mt(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}mt.prototype={addData:function(e){var t=new ql(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=mt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=Re.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var a=s*i,o=0;o<this.modules[s].length;o++){var c=o*i,u=this.modules[s][o];u&&(n.beginFill(0,100),n.moveTo(c,a),n.lineTo(c+i,a),n.lineTo(c+i,a+i),n.lineTo(c,a+i),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=Re.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var a=-2;a<=2;a++)s==-2||s==2||a==-2||a==2||s==0&&a==0?this.modules[n+s][i+a]=!0:this.modules[n+s][i+a]=!1}},setupTypeNumber:function(e){for(var t=Re.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=Re.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var o=0;o<2;o++)if(this.modules[n][a-o]==null){var c=!1;s<e.length&&(c=(e[s]>>>i&1)==1);var u=Re.getMask(t,n,a-o);u&&(c=!c),this.modules[n][a-o]=c,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};mt.PAD0=236;mt.PAD1=17;mt.createData=function(e,t,r){for(var n=_t.getRSBlocks(e,t),i=new Gl,s=0;s<r.length;s++){var a=r[s];i.put(a.mode,4),i.put(a.getLength(),Re.getLengthInBits(a.mode,e)),a.write(i)}for(var o=0,s=0;s<n.length;s++)o+=n[s].dataCount;if(i.getLengthInBits()>o*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+o*8+")");for(i.getLengthInBits()+4<=o*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=o*8||(i.put(mt.PAD0,8),i.getLengthInBits()>=o*8));)i.put(mt.PAD1,8);return mt.createBytes(i,n)};mt.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),a=new Array(t.length),o=0;o<t.length;o++){var c=t[o].dataCount,u=t[o].totalCount-c;n=Math.max(n,c),i=Math.max(i,u),s[o]=new Array(c);for(var f=0;f<s[o].length;f++)s[o][f]=255&e.buffer[f+r];r+=c;var h=Re.getErrorCorrectPolynomial(u),g=new dr(s[o],h.getLength()-1),_=g.mod(h);a[o]=new Array(h.getLength()-1);for(var f=0;f<a[o].length;f++){var E=f+_.getLength()-a[o].length;a[o][f]=E>=0?_.get(E):0}}for(var x=0,f=0;f<t.length;f++)x+=t[f].totalCount;for(var S=new Array(x),b=0,f=0;f<n;f++)for(var o=0;o<t.length;o++)f<s[o].length&&(S[b++]=s[o][f]);for(var f=0;f<i;f++)for(var o=0;o<t.length;o++)f<a[o].length&&(S[b++]=a[o][f]);return S};var qe={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Lt={L:1,M:0,Q:3,H:2},Tt={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(e){for(var t=e<<10;Re.getBCHDigit(t)-Re.getBCHDigit(Re.G15)>=0;)t^=Re.G15<<Re.getBCHDigit(t)-Re.getBCHDigit(Re.G15);return(e<<10|t)^Re.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;Re.getBCHDigit(t)-Re.getBCHDigit(Re.G18)>=0;)t^=Re.G18<<Re.getBCHDigit(t)-Re.getBCHDigit(Re.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return Re.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Tt.PATTERN000:return(t+r)%2==0;case Tt.PATTERN001:return t%2==0;case Tt.PATTERN010:return r%3==0;case Tt.PATTERN011:return(t+r)%3==0;case Tt.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Tt.PATTERN101:return t*r%2+t*r%3==0;case Tt.PATTERN110:return(t*r%2+t*r%3)%2==0;case Tt.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new dr([1],0),r=0;r<e;r++)t=t.multiply(new dr([1,Le.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case qe.MODE_NUMBER:return 10;case qe.MODE_ALPHA_NUM:return 9;case qe.MODE_8BIT_BYTE:return 8;case qe.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case qe.MODE_NUMBER:return 12;case qe.MODE_ALPHA_NUM:return 11;case qe.MODE_8BIT_BYTE:return 16;case qe.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case qe.MODE_NUMBER:return 14;case qe.MODE_ALPHA_NUM:return 13;case qe.MODE_8BIT_BYTE:return 16;case qe.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var s=0,a=e.isDark(n,i),o=-1;o<=1;o++)if(!(n+o<0||t<=n+o))for(var c=-1;c<=1;c++)i+c<0||t<=i+c||o==0&&c==0||a==e.isDark(n+o,i+c)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var u=0;e.isDark(n,i)&&u++,e.isDark(n+1,i)&&u++,e.isDark(n,i+1)&&u++,e.isDark(n+1,i+1)&&u++,(u==0||u==4)&&(r+=3)}for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);for(var f=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&f++;var h=Math.abs(100*f/t/t-50)/5;return r+=h*10,r}},Le={glog:function(e){if(e<1)throw new Error("glog("+e+")");return Le.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return Le.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Be=0;Be<8;Be++)Le.EXP_TABLE[Be]=1<<Be;for(var Be=8;Be<256;Be++)Le.EXP_TABLE[Be]=Le.EXP_TABLE[Be-4]^Le.EXP_TABLE[Be-5]^Le.EXP_TABLE[Be-6]^Le.EXP_TABLE[Be-8];for(var Be=0;Be<255;Be++)Le.LOG_TABLE[Le.EXP_TABLE[Be]]=Be;function dr(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}dr.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=Le.gexp(Le.glog(this.get(r))+Le.glog(e.get(n)));return new dr(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=Le.glog(this.get(0))-Le.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=Le.gexp(Le.glog(e.get(n))+t);return new dr(r,0).mod(e)}};function _t(e,t){this.totalCount=e,this.dataCount=t}_t.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]];_t.getRSBlocks=function(e,t){var r=_t.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var a=r[s*3+0],o=r[s*3+1],c=r[s*3+2],u=0;u<a;u++)i.push(new _t(o,c));return i};_t.getRsBlockTable=function(e,t){switch(t){case Lt.L:return _t.RS_BLOCK_TABLE[(e-1)*4+0];case Lt.M:return _t.RS_BLOCK_TABLE[(e-1)*4+1];case Lt.Q:return _t.RS_BLOCK_TABLE[(e-1)*4+2];case Lt.H:return _t.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function Gl(){this.buffer=[],this.length=0}Gl.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Ls=[[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 Jl(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return Lt.L;case"M":return Lt.M;case"Q":return Lt.Q;case"H":return Lt.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,u){for(var f=i(c),h=1,g=0,_=0,E=Ls.length;_<=E;_++){var x=Ls[_];if(!x)throw new Error("Content too long: expected "+g+" but got "+f);switch(u){case"L":g=x[0];break;case"M":g=x[1];break;case"Q":g=x[2];break;case"H":g=x[3];break;default:throw new Error("Unknwon error correction level: "+u)}if(f<=g)break;h++}if(h>Ls.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,a=n(s,this.options.ecl),o=r(this.options.ecl);this.qrcode=new mt(a,o),this.qrcode.addData(s),this.qrcode.make()}Jl.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?" ":"",s=n?`\r
|
|
7
|
+
`:"",a=t.width,o=t.height,c=r.length,u=a/(c+2*t.padding),f=o/(c+2*t.padding),h=typeof t.join<"u"?!!t.join:!1,g=typeof t.swap<"u"?!!t.swap:!1,_=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,E=typeof t.predefined<"u"?!!t.predefined:!1,x=E?i+'<defs><path id="qrmodule" d="M0 0 h'+f+" v"+u+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+s:"",S=i+'<rect x="0" y="0" width="'+a+'" height="'+o+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+s,b="",v="",C=0;C<c;C++)for(var M=0;M<c;M++){var A=r[M][C];if(A){var B=M*u+t.padding*u,G=C*f+t.padding*f;if(g){var W=B;B=G,G=W}if(h){var F=u+B,re=f+G;B=Number.isInteger(B)?Number(B):B.toFixed(2),G=Number.isInteger(G)?Number(G):G.toFixed(2),F=Number.isInteger(F)?Number(F):F.toFixed(2),re=Number.isInteger(re)?Number(re):re.toFixed(2),v+="M"+B+","+G+" V"+re+" H"+F+" V"+G+" H"+B+" Z "}else E?b+=i+'<use x="'+B.toString()+'" y="'+G.toString()+'" href="#qrmodule" />'+s:b+=i+'<rect x="'+B.toString()+'" y="'+G.toString()+'" width="'+u+'" height="'+f+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+s}}h&&(b=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+v+'" />');let Ee="";if(this.options.image!==void 0&&this.options.image.svg){const $=a*this.options.image.width/100,O=o*this.options.image.height/100,j=a/2-$/2,q=o/2-O/2;Ee+=`<svg x="${j}" y="${q}" width="${$}" height="${O}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,Ee+=this.options.image.svg+s,Ee+="</svg>"}var fe="";switch(e.container){case"svg":_&&(fe+='<?xml version="1.0" standalone="yes"?>'+s),fe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+a+'" height="'+o+'">'+s,fe+=x+S+b,fe+=Ee,fe+="</svg>";break;case"svg-viewbox":_&&(fe+='<?xml version="1.0" standalone="yes"?>'+s),fe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+a+" "+o+'">'+s,fe+=x+S+b,fe+=Ee,fe+="</svg>";break;case"g":fe+='<g width="'+a+'" height="'+o+'">'+s,fe+=x+S+b,fe+=Ee,fe+="</g>";break;default:fe+=(x+S+b+Ee).replace(/^\s+/,"");break}return fe};var i0=Jl,s0=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gi,"__esModule",{value:!0});gi.QRCode=void 0;const o0=We,Ha=di,a0=s0(i0),c0=e=>{const[t,r]=(0,Ha.useState)("");return(0,Ha.useEffect)(()=>{var n,i;const s=new a0.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(i=e.height)!==null&&i!==void 0?i:256,padding:0,image:e.image}),a=se.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${a}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,o0.h)("img",{src:t,alt:"QR Code"}):null};gi.QRCode=c0;var _i={},Bo={};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.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 l0=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_i,"__esModule",{value:!0});_i.Spinner=void 0;const Rn=We,u0=l0(Bo),d0=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,Rn.h)("div",{class:"-cbwsdk-spinner"},(0,Rn.h)("style",null,u0.default),(0,Rn.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Rn.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};_i.Spinner=d0;var Oo={};Object.defineProperty(Oo,"__esModule",{value:!0});Oo.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;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-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 Zl=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(br,"__esModule",{value:!0});br.CoinbaseWalletSteps=br.ConnectContent=void 0;const zt=Zl(qr),le=We,h0=z,f0=Cr,p0=hi,g0=fi,_0=pi,m0=gi,b0=_i,y0=Zl(Oo),Ps={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Kl},w0=e=>e==="light"?"#FFFFFF":"#0A0B0D";function E0(e){const{theme:t}=e,r=(0,h0.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=Ps.steps;return(0,le.h)("div",{"data-testid":"connect-content",className:(0,zt.default)("-cbwsdk-connect-content",t)},(0,le.h)("style",null,y0.default),(0,le.h)("div",{className:"-cbwsdk-connect-content-header"},(0,le.h)("h2",{className:(0,zt.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,le.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,le.h)(p0.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,le.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,le.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,le.h)(v0,{title:Ps.title,description:Ps.description,theme:t})),(0,le.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,le.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,le.h)(m0.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,le.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:f0.LIB_VERSION}),(0,le.h)("input",{type:"hidden",value:r})),(0,le.h)(n,{theme:t}),!e.isConnected&&(0,le.h)("div",{"data-testid":"connecting-spinner",className:(0,zt.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,le.h)(b0.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,le.h)("p",null,"Connecting...")))))}br.ConnectContent=E0;function v0({title:e,description:t,theme:r}){return(0,le.h)("div",{className:(0,zt.default)("-cbwsdk-connect-item",r)},(0,le.h)("div",null,(0,le.h)(g0.CoinbaseWalletRound,null)),(0,le.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,le.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,le.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function Kl({theme:e}){return(0,le.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,le.h)("li",{className:(0,zt.default)("-cbwsdk-wallet-steps-item",e)},(0,le.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,le.h)("li",{className:(0,zt.default)("-cbwsdk-wallet-steps-item",e)},(0,le.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,le.h)("span",null,"Tap ",(0,le.h)("strong",null,"Scan")," "),(0,le.h)("span",{className:(0,zt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,le.h)(_0.QRCodeIcon,{fill:w0(e)})))))}br.CoinbaseWalletSteps=Kl;var mi={},bi={};Object.defineProperty(bi,"__esModule",{value:!0});bi.ArrowLeftIcon=void 0;const Wa=We;function S0(e){return(0,Wa.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,Wa.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"}))}bi.ArrowLeftIcon=S0;var yi={};Object.defineProperty(yi,"__esModule",{value:!0});yi.LaptopIcon=void 0;const Bs=We;function R0(e){return(0,Bs.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Bs.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Bs.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"}))}yi.LaptopIcon=R0;var wi={};Object.defineProperty(wi,"__esModule",{value:!0});wi.SafeIcon=void 0;const Va=We;function C0(e){return(0,Va.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Va.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"}))}wi.SafeIcon=C0;var $o={};Object.defineProperty($o,"__esModule",{value:!0});$o.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 Ql=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mi,"__esModule",{value:!0});mi.TryExtensionContent=void 0;const Ot=Ql(qr),xe=We,Os=di,k0=bi,I0=yi,x0=wi,A0=Ql($o);function T0({theme:e}){const[t,r]=(0,Os.useState)(!1),n=(0,Os.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Os.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,xe.h)("div",{class:(0,Ot.default)("-cbwsdk-try-extension",e)},(0,xe.h)("style",null,A0.default),(0,xe.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,xe.h)("h3",{class:(0,Ot.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,xe.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,xe.h)("button",{class:(0,Ot.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,xe.h)("div",null,!t&&(0,xe.h)(k0.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,xe.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,xe.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,xe.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,xe.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,xe.h)("span",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,xe.h)(I0.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,xe.h)("div",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,xe.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,xe.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,xe.h)("span",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,xe.h)(x0.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,xe.h)("div",{class:(0,Ot.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}mi.TryExtensionContent=T0;var Fo={};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.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 Yl=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ui,"__esModule",{value:!0});ui.ConnectDialog=void 0;const $s=Yl(qr),$t=We,Fs=di,M0=br,N0=mi,L0=Yl(Fo),P0=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,Fs.useState)(!t),[s,a]=(0,Fs.useState)(!t);(0,Fs.useEffect)(()=>{const c=[window.setTimeout(()=>{a(!t)},10)];return t?i(!1):c.push(window.setTimeout(()=>{i(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t]);const o=r?"dark":"light";return(0,$t.h)("div",{class:(0,$s.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,$t.h)("style",null,L0.default),(0,$t.h)("div",{class:(0,$s.default)("-cbwsdk-connect-dialog-backdrop",o,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,$t.h)("div",{class:"-cbwsdk-connect-dialog"},(0,$t.h)("div",{class:(0,$s.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,$t.h)(M0.ConnectContent,{theme:o,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,$t.h)(N0.TryExtensionContent,{theme:o}))))};ui.ConnectDialog=P0;Object.defineProperty(ci,"__esModule",{value:!0});ci.LinkFlow=void 0;const Ds=We,B0=ui;class O0{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,Ds.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Ds.render)((0,Ds.h)(B0.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}ci.LinkFlow=O0;var Do={},jo={};Object.defineProperty(jo,"__esModule",{value:!0});jo.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(e){var t=Z&&Z.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(qr),n=We,i=di,s=t(jo),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class c{constructor(g){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=g.darkMode}attach(g){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",g.appendChild(this.root),this.render()}presentItem(g){const _=this.nextItemKey++;return this.items.set(_,g),this.render(),()=>{this.items.delete(_),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([g,_])=>(0,n.h)(e.SnackbarInstance,Object.assign({},_,{key:g}))))),this.root)}}e.Snackbar=c;const u=h=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},h.children));e.SnackbarContainer=u;const f=({autoExpand:h,message:g,menuItems:_})=>{const[E,x]=(0,i.useState)(!0),[S,b]=(0,i.useState)(h??!1);(0,i.useEffect)(()=>{const C=[window.setTimeout(()=>{x(!1)},1),window.setTimeout(()=>{b(!0)},1e4)];return()=>{C.forEach(window.clearTimeout)}});const v=()=>{b(!S)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",E&&"-cbwsdk-snackbar-instance-hidden",S&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:v},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},g),(0,n.h)("div",{class:"-gear-container"},!S&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),_&&_.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},_.map((C,M)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",C.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:C.onClick,key:M},(0,n.h)("svg",{width:C.svgWidth,height:C.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":C.defaultFillRule,"clip-rule":C.defaultClipRule,d:C.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",C.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},C.info)))))};e.SnackbarInstance=f})(Do);Object.defineProperty(nn,"__esModule",{value:!0});nn.WalletLinkRelayUI=void 0;const $0=sn,F0=ci,D0=Do;class j0{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new D0.Snackbar({darkMode:t.darkMode}),this.linkFlow=new F0.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,$0.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.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:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}nn.WalletLinkRelayUI=j0;Object.defineProperty(Yr,"__esModule",{value:!0});Yr.WalletLinkRelay=void 0;const or=Gr,U0=Ae,Se=z,Ft=kr,za=Ye,Mt=Ir,H0=si,Dt=Rr,W0=nn;class St extends za.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=a=>{var o;this.isLinked=a;const c=this.storage.getItem(za.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this.session.linked=a),this.isUnlinkedErrorState=!1,c){const u=c.split(" "),f=this.storage.getItem("IsStandaloneSigning")==="true";if(u[0]!==""&&!a&&this.session.linked&&!f){this.isUnlinkedErrorState=!0;const h=this.getSessionIdHash();(o=this.diagnostic)===null||o===void 0||o.log(Ft.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:h})}}},this.metadataUpdated=(a,o)=>{this.storage.setItem(a,o)},this.chainUpdated=(a,o)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===o||(this.chainCallbackParams={chainId:a,jsonRpcUrl:o},this.chainCallback&&this.chainCallback(a,o))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),St.accountRequestCallbackIds.size>0&&(Array.from(St.accountRequestCallbackIds.values()).forEach(o=>{const c={type:"WEB3_RESPONSE",id:o,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},c),{id:o}))}),St.accountRequestCallbackIds.clear())},this.connectedUpdated=a=>{this.ui.setConnected(a)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const t=Mt.Session.load(this.storage)||new Mt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new H0.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:a}=this.options,o=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:a,session:t});return i.connect(),{session:t,ui:o,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(Ft.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=Mt.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(Ft.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Mt.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:a,connection:o}=this.subscribe();this._session=s,this.connection=o,this.ui=a,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Ft.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Se.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Se.hexStringFromBuffer)(t,!0),signature:(0,Se.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Se.bigIntStringFromBN)(t.weiValue),data:(0,Se.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Se.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Se.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Se.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Se.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Se.bigIntStringFromBN)(t.weiValue),data:(0,Se.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Se.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Se.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Se.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Se.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Se.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Se.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,Se.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,a),r==null||r()};return{promise:new Promise((a,o)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r==null||r(),(0,Dt.isErrorResponse)(c))return o(new Error(c.errorMessage));a(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:i}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof W0.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=Mt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Ft.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Mt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(a=>{var o;(o=this.diagnostic)===null||o===void 0||o.log(Ft.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Mt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(a=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:a.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(Ft.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){St.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),St.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const a=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,or.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:a,errorCode:i}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Se.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,a)=>{if(this.relayEventManager.callbacks.set(r,o=>{if(this.ui.hideRequestEthereumAccounts(),(0,Dt.isErrorResponse)(o))return a(new Error(o.errorMessage));s(o)}),this.ui.inlineAccountsResponse()){const o=c=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:c}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:o})}else{const o=or.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(o)})}St.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,Se.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},s=new Promise((a,o)=>{this.relayEventManager.callbacks.set(n,f=>{if((0,Dt.isErrorResponse)(f))return o(new Error(f.errorMessage));a(f)});const c=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:U0.ProviderType.Unselected}})},u=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:f}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:u,onCancel:c,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,a){const o={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:a}};let c=null;const u=(0,Se.randomBytesHex)(8),f=g=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,o.method,g),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:f,onResetConnection:this.resetAndReload}));const h=new Promise((g,_)=>{this.relayEventManager.callbacks.set(u,S=>{if(c==null||c(),(0,Dt.isErrorResponse)(S))return _(new Error(S.errorMessage));g(S)});const E=S=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!1}})},x=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:x,onCancel:E,type:t,address:r,symbol:n,decimals:i,image:s,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,o)});return{cancel:f,promise:h}}addEthereumChain(t,r,n,i,s,a){const o={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:a}};let c=null;const u=(0,Se.randomBytesHex)(8),f=g=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,o.method,g),c==null||c()};return this.ui.inlineAddEthereumChain(t)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:f,onResetConnection:this.resetAndReload})),{promise:new Promise((g,_)=>{this.relayEventManager.callbacks.set(u,S=>{if(c==null||c(),(0,Dt.isErrorResponse)(S))return _(new Error(S.errorMessage));g(S)});const E=S=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},x=S=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:S}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:E,onApprove:x,chainId:o.params.chainId,rpcUrls:o.params.rpcUrls,blockExplorerUrls:o.params.blockExplorerUrls,chainName:o.params.chainName,iconUrls:o.params.iconUrls,nativeCurrency:o.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,o)}),cancel:f}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,Se.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,o)};return{promise:new Promise((o,c)=>{this.relayEventManager.callbacks.set(i,h=>{if((0,Dt.isErrorResponse)(h)&&h.errorCode)return c(or.standardErrors.provider.custom({code:h.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,Dt.isErrorResponse)(h))return c(new Error(h.errorMessage));o(h)});const u=h=>{var g;if(h){const _=(g=(0,or.getErrorCode)(h))!==null&&g!==void 0?g:or.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",h instanceof Error?h:or.standardErrors.provider.unsupportedChain(t),_)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},f=h=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:h}}})};this.ui.switchEthereumChain({onCancel:u,onApprove:f,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return Mt.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=s=>{this.handleErrorResponse(t,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}Yr.WalletLinkRelay=St;St.accountRequestCallbackIds=new Set;var cn={},Ei={},Xl={};(function(e){var t=Z&&Z.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=Z&&Z.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Do,e)})(Xl);var Uo={};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.default=(()=>".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}")();var eu=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.RedirectDialog=void 0;const V0=eu(qr),pt=We,z0=sn,q0=Xl,G0=eu(Uo);class J0{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,z0.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,pt.render)(null,this.root),t&&(0,pt.render)((0,pt.h)(Z0,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}Ei.RedirectDialog=J0;const Z0=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,pt.h)(q0.SnackbarContainer,{darkMode:r},(0,pt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,pt.h)("style",null,G0.default),(0,pt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,pt.h)("div",{class:(0,V0.default)("-cbwsdk-redirect-dialog-box",s)},(0,pt.h)("p",null,e),(0,pt.h)("button",{onClick:n},t))))};Object.defineProperty(cn,"__esModule",{value:!0});cn.MobileRelayUI=void 0;const K0=Ei;class Q0{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new K0.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}cn.MobileRelayUI=Q0;Object.defineProperty(Qr,"__esModule",{value:!0});Qr.MobileRelay=void 0;const Y0=z,X0=Yr,ep=cn;class tp extends X0.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,Y0.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof ep.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}Qr.MobileRelay=tp;var _o={exports:{}},tu=Gn.EventEmitter,js,qa;function rp(){if(qa)return js;qa=1;function e(E,x){var S=Object.keys(E);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(E);x&&(b=b.filter(function(v){return Object.getOwnPropertyDescriptor(E,v).enumerable})),S.push.apply(S,b)}return S}function t(E){for(var x=1;x<arguments.length;x++){var S=arguments[x]!=null?arguments[x]:{};x%2?e(Object(S),!0).forEach(function(b){r(E,b,S[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(S)):e(Object(S)).forEach(function(b){Object.defineProperty(E,b,Object.getOwnPropertyDescriptor(S,b))})}return E}function r(E,x,S){return x=a(x),x in E?Object.defineProperty(E,x,{value:S,enumerable:!0,configurable:!0,writable:!0}):E[x]=S,E}function n(E,x){if(!(E instanceof x))throw new TypeError("Cannot call a class as a function")}function i(E,x){for(var S=0;S<x.length;S++){var b=x[S];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(E,a(b.key),b)}}function s(E,x,S){return x&&i(E.prototype,x),S&&i(E,S),Object.defineProperty(E,"prototype",{writable:!1}),E}function a(E){var x=o(E,"string");return typeof x=="symbol"?x:String(x)}function o(E,x){if(typeof E!="object"||E===null)return E;var S=E[Symbol.toPrimitive];if(S!==void 0){var b=S.call(E,x||"default");if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(E)}var c=xr,u=c.Buffer,f=sl,h=f.inspect,g=h&&h.custom||"inspect";function _(E,x,S){u.prototype.copy.call(E,x,S)}return js=function(){function E(){n(this,E),this.head=null,this.tail=null,this.length=0}return s(E,[{key:"push",value:function(S){var b={data:S,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length}},{key:"unshift",value:function(S){var b={data:S,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length}},{key:"shift",value:function(){if(this.length!==0){var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(S){if(this.length===0)return"";for(var b=this.head,v=""+b.data;b=b.next;)v+=S+b.data;return v}},{key:"concat",value:function(S){if(this.length===0)return u.alloc(0);for(var b=u.allocUnsafe(S>>>0),v=this.head,C=0;v;)_(v.data,b,C),C+=v.data.length,v=v.next;return b}},{key:"consume",value:function(S,b){var v;return S<this.head.data.length?(v=this.head.data.slice(0,S),this.head.data=this.head.data.slice(S)):S===this.head.data.length?v=this.shift():v=b?this._getString(S):this._getBuffer(S),v}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(S){var b=this.head,v=1,C=b.data;for(S-=C.length;b=b.next;){var M=b.data,A=S>M.length?M.length:S;if(A===M.length?C+=M:C+=M.slice(0,S),S-=A,S===0){A===M.length?(++v,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=M.slice(A));break}++v}return this.length-=v,C}},{key:"_getBuffer",value:function(S){var b=u.allocUnsafe(S),v=this.head,C=1;for(v.data.copy(b),S-=v.data.length;v=v.next;){var M=v.data,A=S>M.length?M.length:S;if(M.copy(b,b.length-S,0,A),S-=A,S===0){A===M.length?(++C,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=M.slice(A));break}++C}return this.length-=C,b}},{key:g,value:function(S,b){return h(this,t(t({},b),{},{depth:0,customInspect:!1}))}}]),E}(),js}function np(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ge.nextTick(mo,this,e)):ge.nextTick(mo,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?ge.nextTick($n,r):(r._writableState.errorEmitted=!0,ge.nextTick(Ga,r,s)):ge.nextTick(Ga,r,s):t?(ge.nextTick($n,r),t(s)):ge.nextTick($n,r)}),this)}function Ga(e,t){mo(e,t),$n(e)}function $n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function ip(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function mo(e,t){e.emit("error",t)}function sp(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var ru={destroy:np,undestroy:ip,errorOrDestroy:sp},Xt={};function op(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var nu={};function tt(e,t,r){r||(r=Error);function n(s,a,o){return typeof t=="string"?t:t(s,a,o)}var i=function(s){op(a,s);function a(o,c,u){return s.call(this,n(o,c,u))||this}return a}(r);i.prototype.name=r.name,i.prototype.code=e,nu[e]=i}function Ja(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function ap(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function cp(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function lp(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}tt("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);tt("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&ap(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(cp(e," argument"))i="The ".concat(e," ").concat(n," ").concat(Ja(t,"type"));else{var s=lp(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(Ja(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);tt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");tt("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});tt("ERR_STREAM_PREMATURE_CLOSE","Premature close");tt("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});tt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");tt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");tt("ERR_STREAM_WRITE_AFTER_END","write after end");tt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);tt("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);tt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Xt.codes=nu;var up=Xt.codes.ERR_INVALID_OPT_VALUE;function dp(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function hp(e,t,r,n){var i=dp(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new up(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var iu={getHighWaterMark:hp},fp=pp;function pp(e,t){if(Us("noDeprecation"))return e;var r=!1;function n(){if(!r){if(Us("throwDeprecation"))throw new Error(t);Us("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function Us(e){try{if(!Z.localStorage)return!1}catch{return!1}var t=Z.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Hs,Za;function su(){if(Za)return Hs;Za=1,Hs=W;function e(I){var k=this;this.next=null,this.entry=null,this.finish=function(){Me(k,I)}}var t;W.WritableState=B;var r={deprecate:fp},n=tu,i=xr.Buffer,s=(typeof Z<"u"?Z:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(I){return i.from(I)}function o(I){return i.isBuffer(I)||I instanceof s}var c=ru,u=iu,f=u.getHighWaterMark,h=Xt.codes,g=h.ERR_INVALID_ARG_TYPE,_=h.ERR_METHOD_NOT_IMPLEMENTED,E=h.ERR_MULTIPLE_CALLBACK,x=h.ERR_STREAM_CANNOT_PIPE,S=h.ERR_STREAM_DESTROYED,b=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,C=h.ERR_UNKNOWN_ENCODING,M=c.errorOrDestroy;st(W,n);function A(){}function B(I,k,P){t=t||yr(),I=I||{},typeof P!="boolean"&&(P=k instanceof t),this.objectMode=!!I.objectMode,P&&(this.objectMode=this.objectMode||!!I.writableObjectMode),this.highWaterMark=f(this,I,"writableHighWaterMark",P),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var J=I.decodeStrings===!1;this.decodeStrings=!J,this.defaultEncoding=I.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ee){q(k,ee)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=I.emitClose!==!1,this.autoDestroy=!!I.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}B.prototype.getBuffer=function(){for(var k=this.bufferedRequest,P=[];k;)P.push(k),k=k.next;return P},function(){try{Object.defineProperty(B.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var G;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(G=Function.prototype[Symbol.hasInstance],Object.defineProperty(W,Symbol.hasInstance,{value:function(k){return G.call(this,k)?!0:this!==W?!1:k&&k._writableState instanceof B}})):G=function(k){return k instanceof this};function W(I){t=t||yr();var k=this instanceof t;if(!k&&!G.call(W,this))return new W(I);this._writableState=new B(I,this,k),this.writable=!0,I&&(typeof I.write=="function"&&(this._write=I.write),typeof I.writev=="function"&&(this._writev=I.writev),typeof I.destroy=="function"&&(this._destroy=I.destroy),typeof I.final=="function"&&(this._final=I.final)),n.call(this)}W.prototype.pipe=function(){M(this,new x)};function F(I,k){var P=new v;M(I,P),ge.nextTick(k,P)}function re(I,k,P,J){var ee;return P===null?ee=new b:typeof P!="string"&&!k.objectMode&&(ee=new g("chunk",["string","Buffer"],P)),ee?(M(I,ee),ge.nextTick(J,ee),!1):!0}W.prototype.write=function(I,k,P){var J=this._writableState,ee=!1,y=!J.objectMode&&o(I);return y&&!i.isBuffer(I)&&(I=a(I)),typeof k=="function"&&(P=k,k=null),y?k="buffer":k||(k=J.defaultEncoding),typeof P!="function"&&(P=A),J.ending?F(this,P):(y||re(this,J,I,P))&&(J.pendingcb++,ee=fe(this,J,y,I,k,P)),ee},W.prototype.cork=function(){this._writableState.corked++},W.prototype.uncork=function(){var I=this._writableState;I.corked&&(I.corked--,!I.writing&&!I.corked&&!I.bufferProcessing&&I.bufferedRequest&&K(this,I))},W.prototype.setDefaultEncoding=function(k){if(typeof k=="string"&&(k=k.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((k+"").toLowerCase())>-1))throw new C(k);return this._writableState.defaultEncoding=k,this},Object.defineProperty(W.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Ee(I,k,P){return!I.objectMode&&I.decodeStrings!==!1&&typeof k=="string"&&(k=i.from(k,P)),k}Object.defineProperty(W.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function fe(I,k,P,J,ee,y){if(!P){var w=Ee(k,J,ee);J!==w&&(P=!0,ee="buffer",J=w)}var L=k.objectMode?1:J.length;k.length+=L;var D=k.length<k.highWaterMark;if(D||(k.needDrain=!0),k.writing||k.corked){var me=k.lastBufferedRequest;k.lastBufferedRequest={chunk:J,encoding:ee,isBuf:P,callback:y,next:null},me?me.next=k.lastBufferedRequest:k.bufferedRequest=k.lastBufferedRequest,k.bufferedRequestCount+=1}else $(I,k,!1,L,J,ee,y);return D}function $(I,k,P,J,ee,y,w){k.writelen=J,k.writecb=w,k.writing=!0,k.sync=!0,k.destroyed?k.onwrite(new S("write")):P?I._writev(ee,k.onwrite):I._write(ee,y,k.onwrite),k.sync=!1}function O(I,k,P,J,ee){--k.pendingcb,P?(ge.nextTick(ee,J),ge.nextTick(pe,I,k),I._writableState.errorEmitted=!0,M(I,J)):(ee(J),I._writableState.errorEmitted=!0,M(I,J),pe(I,k))}function j(I){I.writing=!1,I.writecb=null,I.length-=I.writelen,I.writelen=0}function q(I,k){var P=I._writableState,J=P.sync,ee=P.writecb;if(typeof ee!="function")throw new E;if(j(P),k)O(I,P,J,k,ee);else{var y=ne(P)||I.destroyed;!y&&!P.corked&&!P.bufferProcessing&&P.bufferedRequest&&K(I,P),J?ge.nextTick(V,I,P,y,ee):V(I,P,y,ee)}}function V(I,k,P,J){P||U(I,k),k.pendingcb--,J(),pe(I,k)}function U(I,k){k.length===0&&k.needDrain&&(k.needDrain=!1,I.emit("drain"))}function K(I,k){k.bufferProcessing=!0;var P=k.bufferedRequest;if(I._writev&&P&&P.next){var J=k.bufferedRequestCount,ee=new Array(J),y=k.corkedRequestsFree;y.entry=P;for(var w=0,L=!0;P;)ee[w]=P,P.isBuf||(L=!1),P=P.next,w+=1;ee.allBuffers=L,$(I,k,!0,k.length,ee,"",y.finish),k.pendingcb++,k.lastBufferedRequest=null,y.next?(k.corkedRequestsFree=y.next,y.next=null):k.corkedRequestsFree=new e(k),k.bufferedRequestCount=0}else{for(;P;){var D=P.chunk,me=P.encoding,te=P.callback,ae=k.objectMode?1:D.length;if($(I,k,!1,ae,D,me,te),P=P.next,k.bufferedRequestCount--,k.writing)break}P===null&&(k.lastBufferedRequest=null)}k.bufferedRequest=P,k.bufferProcessing=!1}W.prototype._write=function(I,k,P){P(new _("_write()"))},W.prototype._writev=null,W.prototype.end=function(I,k,P){var J=this._writableState;return typeof I=="function"?(P=I,I=null,k=null):typeof k=="function"&&(P=k,k=null),I!=null&&this.write(I,k),J.corked&&(J.corked=1,this.uncork()),J.ending||de(this,J,P),this},Object.defineProperty(W.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ne(I){return I.ending&&I.length===0&&I.bufferedRequest===null&&!I.finished&&!I.writing}function H(I,k){I._final(function(P){k.pendingcb--,P&&M(I,P),k.prefinished=!0,I.emit("prefinish"),pe(I,k)})}function Q(I,k){!k.prefinished&&!k.finalCalled&&(typeof I._final=="function"&&!k.destroyed?(k.pendingcb++,k.finalCalled=!0,ge.nextTick(H,I,k)):(k.prefinished=!0,I.emit("prefinish")))}function pe(I,k){var P=ne(k);if(P&&(Q(I,k),k.pendingcb===0&&(k.finished=!0,I.emit("finish"),k.autoDestroy))){var J=I._readableState;(!J||J.autoDestroy&&J.endEmitted)&&I.destroy()}return P}function de(I,k,P){k.ending=!0,pe(I,k),P&&(k.finished?ge.nextTick(P):I.once("finish",P)),k.ended=!0,I.writable=!1}function Me(I,k,P){var J=I.entry;for(I.entry=null;J;){var ee=J.callback;k.pendingcb--,ee(P),J=J.next}k.corkedRequestsFree.next=I}return Object.defineProperty(W.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(k){this._writableState&&(this._writableState.destroyed=k)}}),W.prototype.destroy=c.destroy,W.prototype._undestroy=c.undestroy,W.prototype._destroy=function(I,k){k(I)},Hs}var Ws,Ka;function yr(){if(Ka)return Ws;Ka=1;var e=Object.keys||function(u){var f=[];for(var h in u)f.push(h);return f};Ws=a;var t=au(),r=su();st(a,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var s=n[i];a.prototype[s]||(a.prototype[s]=r.prototype[s])}function a(u){if(!(this instanceof a))return new a(u);t.call(this,u),r.call(this,u),this.allowHalfOpen=!0,u&&(u.readable===!1&&(this.readable=!1),u.writable===!1&&(this.writable=!1),u.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",o)))}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function o(){this._writableState.ended||ge.nextTick(c,this)}function c(u){u.end()}return Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(f){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=f,this._writableState.destroyed=f)}}),Ws}var Vs={},Cn={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Qa;function gp(){return Qa||(Qa=1,function(e,t){var r=xr,n=r.Buffer;function i(a,o){for(var c in a)o[c]=a[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(a,o,c){return n(a,o,c)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(a,o,c){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,o,c)},s.alloc=function(a,o,c){if(typeof a!="number")throw new TypeError("Argument must be a number");var u=n(a);return o!==void 0?typeof c=="string"?u.fill(o,c):u.fill(o):u.fill(0),u},s.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},s.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(a)}}(Cn,Cn.exports)),Cn.exports}var Ya;function Xa(){if(Ya)return Vs;Ya=1;var e=gp().Buffer,t=e.isEncoding||function(b){switch(b=""+b,b&&b.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(b){if(!b)return"utf8";for(var v;;)switch(b){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return b;default:if(v)return;b=(""+b).toLowerCase(),v=!0}}function n(b){var v=r(b);if(typeof v!="string"&&(e.isEncoding===t||!t(b)))throw new Error("Unknown encoding: "+b);return v||b}Vs.StringDecoder=i;function i(b){this.encoding=n(b);var v;switch(this.encoding){case"utf16le":this.text=h,this.end=g,v=4;break;case"utf8":this.fillLast=c,v=4;break;case"base64":this.text=_,this.end=E,v=3;break;default:this.write=x,this.end=S;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(v)}i.prototype.write=function(b){if(b.length===0)return"";var v,C;if(this.lastNeed){if(v=this.fillLast(b),v===void 0)return"";C=this.lastNeed,this.lastNeed=0}else C=0;return C<b.length?v?v+this.text(b,C):this.text(b,C):v||""},i.prototype.end=f,i.prototype.text=u,i.prototype.fillLast=function(b){if(this.lastNeed<=b.length)return b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,b.length),this.lastNeed-=b.length};function s(b){return b<=127?0:b>>5===6?2:b>>4===14?3:b>>3===30?4:b>>6===2?-1:-2}function a(b,v,C){var M=v.length-1;if(M<C)return 0;var A=s(v[M]);return A>=0?(A>0&&(b.lastNeed=A-1),A):--M<C||A===-2?0:(A=s(v[M]),A>=0?(A>0&&(b.lastNeed=A-2),A):--M<C||A===-2?0:(A=s(v[M]),A>=0?(A>0&&(A===2?A=0:b.lastNeed=A-3),A):0))}function o(b,v,C){if((v[0]&192)!==128)return b.lastNeed=0,"�";if(b.lastNeed>1&&v.length>1){if((v[1]&192)!==128)return b.lastNeed=1,"�";if(b.lastNeed>2&&v.length>2&&(v[2]&192)!==128)return b.lastNeed=2,"�"}}function c(b){var v=this.lastTotal-this.lastNeed,C=o(this,b);if(C!==void 0)return C;if(this.lastNeed<=b.length)return b.copy(this.lastChar,v,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,v,0,b.length),this.lastNeed-=b.length}function u(b,v){var C=a(this,b,v);if(!this.lastNeed)return b.toString("utf8",v);this.lastTotal=C;var M=b.length-(C-this.lastNeed);return b.copy(this.lastChar,0,M),b.toString("utf8",v,M)}function f(b){var v=b&&b.length?this.write(b):"";return this.lastNeed?v+"�":v}function h(b,v){if((b.length-v)%2===0){var C=b.toString("utf16le",v);if(C){var M=C.charCodeAt(C.length-1);if(M>=55296&&M<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1],C.slice(0,-1)}return C}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",v,b.length-1)}function g(b){var v=b&&b.length?this.write(b):"";if(this.lastNeed){var C=this.lastTotal-this.lastNeed;return v+this.lastChar.toString("utf16le",0,C)}return v}function _(b,v){var C=(b.length-v)%3;return C===0?b.toString("base64",v):(this.lastNeed=3-C,this.lastTotal=3,C===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",v,b.length-C))}function E(b){var v=b&&b.length?this.write(b):"";return this.lastNeed?v+this.lastChar.toString("base64",0,3-this.lastNeed):v}function x(b){return b.toString(this.encoding)}function S(b){return b&&b.length?this.write(b):""}return Vs}var ec=Xt.codes.ERR_STREAM_PREMATURE_CLOSE;function _p(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function mp(){}function bp(e){return e.setHeader&&typeof e.abort=="function"}function ou(e,t,r){if(typeof t=="function")return ou(e,null,t);t||(t={}),r=_p(r||mp);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||o()},a=e._writableState&&e._writableState.finished,o=function(){i=!1,a=!0,n||r.call(e)},c=e._readableState&&e._readableState.endEmitted,u=function(){n=!1,c=!0,i||r.call(e)},f=function(E){r.call(e,E)},h=function(){var E;if(n&&!c)return(!e._readableState||!e._readableState.ended)&&(E=new ec),r.call(e,E);if(i&&!a)return(!e._writableState||!e._writableState.ended)&&(E=new ec),r.call(e,E)},g=function(){e.req.on("finish",o)};return bp(e)?(e.on("complete",o),e.on("abort",h),e.req?g():e.on("request",g)):i&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",u),e.on("finish",o),t.error!==!1&&e.on("error",f),e.on("close",h),function(){e.removeListener("complete",o),e.removeListener("abort",h),e.removeListener("request",g),e.req&&e.req.removeListener("finish",o),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",o),e.removeListener("end",u),e.removeListener("error",f),e.removeListener("close",h)}}var Ho=ou,zs,tc;function yp(){if(tc)return zs;tc=1;var e;function t(C,M,A){return M=r(M),M in C?Object.defineProperty(C,M,{value:A,enumerable:!0,configurable:!0,writable:!0}):C[M]=A,C}function r(C){var M=n(C,"string");return typeof M=="symbol"?M:String(M)}function n(C,M){if(typeof C!="object"||C===null)return C;var A=C[Symbol.toPrimitive];if(A!==void 0){var B=A.call(C,M||"default");if(typeof B!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return(M==="string"?String:Number)(C)}var i=Ho,s=Symbol("lastResolve"),a=Symbol("lastReject"),o=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function g(C,M){return{value:C,done:M}}function _(C){var M=C[s];if(M!==null){var A=C[h].read();A!==null&&(C[u]=null,C[s]=null,C[a]=null,M(g(A,!1)))}}function E(C){ge.nextTick(_,C)}function x(C,M){return function(A,B){C.then(function(){if(M[c]){A(g(void 0,!0));return}M[f](A,B)},B)}}var S=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((e={get stream(){return this[h]},next:function(){var M=this,A=this[o];if(A!==null)return Promise.reject(A);if(this[c])return Promise.resolve(g(void 0,!0));if(this[h].destroyed)return new Promise(function(F,re){ge.nextTick(function(){M[o]?re(M[o]):F(g(void 0,!0))})});var B=this[u],G;if(B)G=new Promise(x(B,this));else{var W=this[h].read();if(W!==null)return Promise.resolve(g(W,!1));G=new Promise(this[f])}return this[u]=G,G}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var M=this;return new Promise(function(A,B){M[h].destroy(null,function(G){if(G){B(G);return}A(g(void 0,!0))})})}),e),S),v=function(M){var A,B=Object.create(b,(A={},t(A,h,{value:M,writable:!0}),t(A,s,{value:null,writable:!0}),t(A,a,{value:null,writable:!0}),t(A,o,{value:null,writable:!0}),t(A,c,{value:M._readableState.endEmitted,writable:!0}),t(A,f,{value:function(W,F){var re=B[h].read();re?(B[u]=null,B[s]=null,B[a]=null,W(g(re,!1))):(B[s]=W,B[a]=F)},writable:!0}),A));return B[u]=null,i(M,function(G){if(G&&G.code!=="ERR_STREAM_PREMATURE_CLOSE"){var W=B[a];W!==null&&(B[u]=null,B[s]=null,B[a]=null,W(G)),B[o]=G;return}var F=B[s];F!==null&&(B[u]=null,B[s]=null,B[a]=null,F(g(void 0,!0))),B[c]=!0}),M.on("readable",E.bind(null,B)),B};return zs=v,zs}var qs,rc;function wp(){return rc||(rc=1,qs=function(){throw new Error("Readable.from is not available in the browser")}),qs}var Gs,nc;function au(){if(nc)return Gs;nc=1,Gs=F;var e;F.ReadableState=W,Gn.EventEmitter;var t=function(w,L){return w.listeners(L).length},r=tu,n=xr.Buffer,i=(typeof Z<"u"?Z:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(y){return n.from(y)}function a(y){return n.isBuffer(y)||y instanceof i}var o=sl,c;o&&o.debuglog?c=o.debuglog("stream"):c=function(){};var u=rp(),f=ru,h=iu,g=h.getHighWaterMark,_=Xt.codes,E=_.ERR_INVALID_ARG_TYPE,x=_.ERR_STREAM_PUSH_AFTER_EOF,S=_.ERR_METHOD_NOT_IMPLEMENTED,b=_.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,v,C,M;st(F,r);var A=f.errorOrDestroy,B=["error","close","destroy","pause","resume"];function G(y,w,L){if(typeof y.prependListener=="function")return y.prependListener(w,L);!y._events||!y._events[w]?y.on(w,L):Array.isArray(y._events[w])?y._events[w].unshift(L):y._events[w]=[L,y._events[w]]}function W(y,w,L){e=e||yr(),y=y||{},typeof L!="boolean"&&(L=w instanceof e),this.objectMode=!!y.objectMode,L&&(this.objectMode=this.objectMode||!!y.readableObjectMode),this.highWaterMark=g(this,y,"readableHighWaterMark",L),this.buffer=new u,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=y.emitClose!==!1,this.autoDestroy=!!y.autoDestroy,this.destroyed=!1,this.defaultEncoding=y.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,y.encoding&&(v||(v=Xa().StringDecoder),this.decoder=new v(y.encoding),this.encoding=y.encoding)}function F(y){if(e=e||yr(),!(this instanceof F))return new F(y);var w=this instanceof e;this._readableState=new W(y,this,w),this.readable=!0,y&&(typeof y.read=="function"&&(this._read=y.read),typeof y.destroy=="function"&&(this._destroy=y.destroy)),r.call(this)}Object.defineProperty(F.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(w){this._readableState&&(this._readableState.destroyed=w)}}),F.prototype.destroy=f.destroy,F.prototype._undestroy=f.undestroy,F.prototype._destroy=function(y,w){w(y)},F.prototype.push=function(y,w){var L=this._readableState,D;return L.objectMode?D=!0:typeof y=="string"&&(w=w||L.defaultEncoding,w!==L.encoding&&(y=n.from(y,w),w=""),D=!0),re(this,y,w,!1,D)},F.prototype.unshift=function(y){return re(this,y,null,!0,!1)};function re(y,w,L,D,me){c("readableAddChunk",w);var te=y._readableState;if(w===null)te.reading=!1,q(y,te);else{var ae;if(me||(ae=fe(te,w)),ae)A(y,ae);else if(te.objectMode||w&&w.length>0)if(typeof w!="string"&&!te.objectMode&&Object.getPrototypeOf(w)!==n.prototype&&(w=s(w)),D)te.endEmitted?A(y,new b):Ee(y,te,w,!0);else if(te.ended)A(y,new x);else{if(te.destroyed)return!1;te.reading=!1,te.decoder&&!L?(w=te.decoder.write(w),te.objectMode||w.length!==0?Ee(y,te,w,!1):K(y,te)):Ee(y,te,w,!1)}else D||(te.reading=!1,K(y,te))}return!te.ended&&(te.length<te.highWaterMark||te.length===0)}function Ee(y,w,L,D){w.flowing&&w.length===0&&!w.sync?(w.awaitDrain=0,y.emit("data",L)):(w.length+=w.objectMode?1:L.length,D?w.buffer.unshift(L):w.buffer.push(L),w.needReadable&&V(y)),K(y,w)}function fe(y,w){var L;return!a(w)&&typeof w!="string"&&w!==void 0&&!y.objectMode&&(L=new E("chunk",["string","Buffer","Uint8Array"],w)),L}F.prototype.isPaused=function(){return this._readableState.flowing===!1},F.prototype.setEncoding=function(y){v||(v=Xa().StringDecoder);var w=new v(y);this._readableState.decoder=w,this._readableState.encoding=this._readableState.decoder.encoding;for(var L=this._readableState.buffer.head,D="";L!==null;)D+=w.write(L.data),L=L.next;return this._readableState.buffer.clear(),D!==""&&this._readableState.buffer.push(D),this._readableState.length=D.length,this};var $=1073741824;function O(y){return y>=$?y=$:(y--,y|=y>>>1,y|=y>>>2,y|=y>>>4,y|=y>>>8,y|=y>>>16,y++),y}function j(y,w){return y<=0||w.length===0&&w.ended?0:w.objectMode?1:y!==y?w.flowing&&w.length?w.buffer.head.data.length:w.length:(y>w.highWaterMark&&(w.highWaterMark=O(y)),y<=w.length?y:w.ended?w.length:(w.needReadable=!0,0))}F.prototype.read=function(y){c("read",y),y=parseInt(y,10);var w=this._readableState,L=y;if(y!==0&&(w.emittedReadable=!1),y===0&&w.needReadable&&((w.highWaterMark!==0?w.length>=w.highWaterMark:w.length>0)||w.ended))return c("read: emitReadable",w.length,w.ended),w.length===0&&w.ended?P(this):V(this),null;if(y=j(y,w),y===0&&w.ended)return w.length===0&&P(this),null;var D=w.needReadable;c("need readable",D),(w.length===0||w.length-y<w.highWaterMark)&&(D=!0,c("length less than watermark",D)),w.ended||w.reading?(D=!1,c("reading or ended",D)):D&&(c("do read"),w.reading=!0,w.sync=!0,w.length===0&&(w.needReadable=!0),this._read(w.highWaterMark),w.sync=!1,w.reading||(y=j(L,w)));var me;return y>0?me=k(y,w):me=null,me===null?(w.needReadable=w.length<=w.highWaterMark,y=0):(w.length-=y,w.awaitDrain=0),w.length===0&&(w.ended||(w.needReadable=!0),L!==y&&w.ended&&P(this)),me!==null&&this.emit("data",me),me};function q(y,w){if(c("onEofChunk"),!w.ended){if(w.decoder){var L=w.decoder.end();L&&L.length&&(w.buffer.push(L),w.length+=w.objectMode?1:L.length)}w.ended=!0,w.sync?V(y):(w.needReadable=!1,w.emittedReadable||(w.emittedReadable=!0,U(y)))}}function V(y){var w=y._readableState;c("emitReadable",w.needReadable,w.emittedReadable),w.needReadable=!1,w.emittedReadable||(c("emitReadable",w.flowing),w.emittedReadable=!0,ge.nextTick(U,y))}function U(y){var w=y._readableState;c("emitReadable_",w.destroyed,w.length,w.ended),!w.destroyed&&(w.length||w.ended)&&(y.emit("readable"),w.emittedReadable=!1),w.needReadable=!w.flowing&&!w.ended&&w.length<=w.highWaterMark,I(y)}function K(y,w){w.readingMore||(w.readingMore=!0,ge.nextTick(ne,y,w))}function ne(y,w){for(;!w.reading&&!w.ended&&(w.length<w.highWaterMark||w.flowing&&w.length===0);){var L=w.length;if(c("maybeReadMore read 0"),y.read(0),L===w.length)break}w.readingMore=!1}F.prototype._read=function(y){A(this,new S("_read()"))},F.prototype.pipe=function(y,w){var L=this,D=this._readableState;switch(D.pipesCount){case 0:D.pipes=y;break;case 1:D.pipes=[D.pipes,y];break;default:D.pipes.push(y);break}D.pipesCount+=1,c("pipe count=%d opts=%j",D.pipesCount,w);var me=(!w||w.end!==!1)&&y!==ge.stdout&&y!==ge.stderr,te=me?rt:lt;D.endEmitted?ge.nextTick(te):L.once("end",te),y.on("unpipe",ae);function ae(p,l){c("onunpipe"),p===L&&l&&l.hasUnpiped===!1&&(l.hasUnpiped=!0,Et())}function rt(){c("onend"),y.end()}var wt=H(L);y.on("drain",wt);var xt=!1;function Et(){c("cleanup"),y.removeListener("close",At),y.removeListener("finish",De),y.removeListener("drain",wt),y.removeListener("error",ct),y.removeListener("unpipe",ae),L.removeListener("end",rt),L.removeListener("end",lt),L.removeListener("data",$e),xt=!0,D.awaitDrain&&(!y._writableState||y._writableState.needDrain)&&wt()}L.on("data",$e);function $e(p){c("ondata");var l=y.write(p);c("dest.write",l),l===!1&&((D.pipesCount===1&&D.pipes===y||D.pipesCount>1&&ee(D.pipes,y)!==-1)&&!xt&&(c("false write response, pause",D.awaitDrain),D.awaitDrain++),L.pause())}function ct(p){c("onerror",p),lt(),y.removeListener("error",ct),t(y,"error")===0&&A(y,p)}G(y,"error",ct);function At(){y.removeListener("finish",De),lt()}y.once("close",At);function De(){c("onfinish"),y.removeListener("close",At),lt()}y.once("finish",De);function lt(){c("unpipe"),L.unpipe(y)}return y.emit("pipe",L),D.flowing||(c("pipe resume"),L.resume()),y};function H(y){return function(){var L=y._readableState;c("pipeOnDrain",L.awaitDrain),L.awaitDrain&&L.awaitDrain--,L.awaitDrain===0&&t(y,"data")&&(L.flowing=!0,I(y))}}F.prototype.unpipe=function(y){var w=this._readableState,L={hasUnpiped:!1};if(w.pipesCount===0)return this;if(w.pipesCount===1)return y&&y!==w.pipes?this:(y||(y=w.pipes),w.pipes=null,w.pipesCount=0,w.flowing=!1,y&&y.emit("unpipe",this,L),this);if(!y){var D=w.pipes,me=w.pipesCount;w.pipes=null,w.pipesCount=0,w.flowing=!1;for(var te=0;te<me;te++)D[te].emit("unpipe",this,{hasUnpiped:!1});return this}var ae=ee(w.pipes,y);return ae===-1?this:(w.pipes.splice(ae,1),w.pipesCount-=1,w.pipesCount===1&&(w.pipes=w.pipes[0]),y.emit("unpipe",this,L),this)},F.prototype.on=function(y,w){var L=r.prototype.on.call(this,y,w),D=this._readableState;return y==="data"?(D.readableListening=this.listenerCount("readable")>0,D.flowing!==!1&&this.resume()):y==="readable"&&!D.endEmitted&&!D.readableListening&&(D.readableListening=D.needReadable=!0,D.flowing=!1,D.emittedReadable=!1,c("on readable",D.length,D.reading),D.length?V(this):D.reading||ge.nextTick(pe,this)),L},F.prototype.addListener=F.prototype.on,F.prototype.removeListener=function(y,w){var L=r.prototype.removeListener.call(this,y,w);return y==="readable"&&ge.nextTick(Q,this),L},F.prototype.removeAllListeners=function(y){var w=r.prototype.removeAllListeners.apply(this,arguments);return(y==="readable"||y===void 0)&&ge.nextTick(Q,this),w};function Q(y){var w=y._readableState;w.readableListening=y.listenerCount("readable")>0,w.resumeScheduled&&!w.paused?w.flowing=!0:y.listenerCount("data")>0&&y.resume()}function pe(y){c("readable nexttick read 0"),y.read(0)}F.prototype.resume=function(){var y=this._readableState;return y.flowing||(c("resume"),y.flowing=!y.readableListening,de(this,y)),y.paused=!1,this};function de(y,w){w.resumeScheduled||(w.resumeScheduled=!0,ge.nextTick(Me,y,w))}function Me(y,w){c("resume",w.reading),w.reading||y.read(0),w.resumeScheduled=!1,y.emit("resume"),I(y),w.flowing&&!w.reading&&y.read(0)}F.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function I(y){var w=y._readableState;for(c("flow",w.flowing);w.flowing&&y.read()!==null;);}F.prototype.wrap=function(y){var w=this,L=this._readableState,D=!1;y.on("end",function(){if(c("wrapped end"),L.decoder&&!L.ended){var ae=L.decoder.end();ae&&ae.length&&w.push(ae)}w.push(null)}),y.on("data",function(ae){if(c("wrapped data"),L.decoder&&(ae=L.decoder.write(ae)),!(L.objectMode&&ae==null)&&!(!L.objectMode&&(!ae||!ae.length))){var rt=w.push(ae);rt||(D=!0,y.pause())}});for(var me in y)this[me]===void 0&&typeof y[me]=="function"&&(this[me]=function(rt){return function(){return y[rt].apply(y,arguments)}}(me));for(var te=0;te<B.length;te++)y.on(B[te],this.emit.bind(this,B[te]));return this._read=function(ae){c("wrapped _read",ae),D&&(D=!1,y.resume())},this},typeof Symbol=="function"&&(F.prototype[Symbol.asyncIterator]=function(){return C===void 0&&(C=yp()),C(this)}),Object.defineProperty(F.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(F.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(F.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(w){this._readableState&&(this._readableState.flowing=w)}}),F._fromList=k,Object.defineProperty(F.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function k(y,w){if(w.length===0)return null;var L;return w.objectMode?L=w.buffer.shift():!y||y>=w.length?(w.decoder?L=w.buffer.join(""):w.buffer.length===1?L=w.buffer.first():L=w.buffer.concat(w.length),w.buffer.clear()):L=w.buffer.consume(y,w.decoder),L}function P(y){var w=y._readableState;c("endReadable",w.endEmitted),w.endEmitted||(w.ended=!0,ge.nextTick(J,w,y))}function J(y,w){if(c("endReadableNT",y.endEmitted,y.length),!y.endEmitted&&y.length===0&&(y.endEmitted=!0,w.readable=!1,w.emit("end"),y.autoDestroy)){var L=w._writableState;(!L||L.autoDestroy&&L.finished)&&w.destroy()}}typeof Symbol=="function"&&(F.from=function(y,w){return M===void 0&&(M=wp()),M(F,y,w)});function ee(y,w){for(var L=0,D=y.length;L<D;L++)if(y[L]===w)return L;return-1}return Gs}var cu=It,vi=Xt.codes,Ep=vi.ERR_METHOD_NOT_IMPLEMENTED,vp=vi.ERR_MULTIPLE_CALLBACK,Sp=vi.ERR_TRANSFORM_ALREADY_TRANSFORMING,Rp=vi.ERR_TRANSFORM_WITH_LENGTH_0,Si=yr();st(It,Si);function Cp(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new vp);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function It(e){if(!(this instanceof It))return new It(e);Si.call(this,e),this._transformState={afterTransform:Cp.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",kp)}function kp(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){ic(e,t,r)}):ic(this,null,null)}It.prototype.push=function(e,t){return this._transformState.needTransform=!1,Si.prototype.push.call(this,e,t)};It.prototype._transform=function(e,t,r){r(new Ep("_transform()"))};It.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};It.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};It.prototype._destroy=function(e,t){Si.prototype._destroy.call(this,e,function(r){t(r)})};function ic(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Rp;if(e._transformState.transforming)throw new Sp;return e.push(null)}var Ip=Wr,lu=cu;st(Wr,lu);function Wr(e){if(!(this instanceof Wr))return new Wr(e);lu.call(this,e)}Wr.prototype._transform=function(e,t,r){r(null,e)};var Js;function xp(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var uu=Xt.codes,Ap=uu.ERR_MISSING_ARGS,Tp=uu.ERR_STREAM_DESTROYED;function sc(e){if(e)throw e}function Mp(e){return e.setHeader&&typeof e.abort=="function"}function Np(e,t,r,n){n=xp(n);var i=!1;e.on("close",function(){i=!0}),Js===void 0&&(Js=Ho),Js(e,{readable:t,writable:r},function(a){if(a)return n(a);i=!0,n()});var s=!1;return function(a){if(!i&&!s){if(s=!0,Mp(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(a||new Tp("pipe"))}}}function oc(e){e()}function Lp(e,t){return e.pipe(t)}function Pp(e){return!e.length||typeof e[e.length-1]!="function"?sc:e.pop()}function Bp(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Pp(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Ap("streams");var i,s=t.map(function(a,o){var c=o<t.length-1,u=o>0;return Np(a,c,u,function(f){i||(i=f),f&&s.forEach(oc),!c&&(s.forEach(oc),n(i))})});return t.reduce(Lp)}var Op=Bp;(function(e,t){t=e.exports=au(),t.Stream=t,t.Readable=t,t.Writable=su(),t.Duplex=yr(),t.Transform=cu,t.PassThrough=Ip,t.finished=Ho,t.pipeline=Op})(_o,_o.exports);var du=_o.exports;const{Transform:$p}=du;var Fp=e=>class hu extends $p{constructor(r,n,i,s,a){super(a),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=a,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(a){s=a}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!se.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return se.isBuffer(r)||(r=se.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new hu(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:Dp}=du;var jp=e=>class fu extends Dp{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(a){s=a}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!se.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return se.isBuffer(r)||(r=se.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new fu(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const Up=Fp,Hp=jp;var Wp=function(e){const t=Up(e),r=Hp(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},pu={};const ac=[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];pu.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],o=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],h=e[9]^e[19]^e[29]^e[39]^e[49];let g=f^(i<<1|s>>>31),_=h^(s<<1|i>>>31);const E=e[0]^g,x=e[1]^_,S=e[10]^g,b=e[11]^_,v=e[20]^g,C=e[21]^_,M=e[30]^g,A=e[31]^_,B=e[40]^g,G=e[41]^_;g=r^(a<<1|o>>>31),_=n^(o<<1|a>>>31);const W=e[2]^g,F=e[3]^_,re=e[12]^g,Ee=e[13]^_,fe=e[22]^g,$=e[23]^_,O=e[32]^g,j=e[33]^_,q=e[42]^g,V=e[43]^_;g=i^(c<<1|u>>>31),_=s^(u<<1|c>>>31);const U=e[4]^g,K=e[5]^_,ne=e[14]^g,H=e[15]^_,Q=e[24]^g,pe=e[25]^_,de=e[34]^g,Me=e[35]^_,I=e[44]^g,k=e[45]^_;g=a^(f<<1|h>>>31),_=o^(h<<1|f>>>31);const P=e[6]^g,J=e[7]^_,ee=e[16]^g,y=e[17]^_,w=e[26]^g,L=e[27]^_,D=e[36]^g,me=e[37]^_,te=e[46]^g,ae=e[47]^_;g=c^(r<<1|n>>>31),_=u^(n<<1|r>>>31);const rt=e[8]^g,wt=e[9]^_,xt=e[18]^g,Et=e[19]^_,$e=e[28]^g,ct=e[29]^_,At=e[38]^g,De=e[39]^_,lt=e[48]^g,p=e[49]^_,l=E,d=x,m=b<<4|S>>>28,R=S<<4|b>>>28,T=v<<3|C>>>29,N=C<<3|v>>>29,X=A<<9|M>>>23,ye=M<<9|A>>>23,_e=B<<18|G>>>14,we=G<<18|B>>>14,he=W<<1|F>>>31,qi=F<<1|W>>>31,Gi=Ee<<12|re>>>20,Ji=re<<12|Ee>>>20,Zi=fe<<10|$>>>22,Ki=$<<10|fe>>>22,Qi=j<<13|O>>>19,Yi=O<<13|j>>>19,Xi=q<<2|V>>>30,es=V<<2|q>>>30,ts=K<<30|U>>>2,rs=U<<30|K>>>2,ns=ne<<6|H>>>26,is=H<<6|ne>>>26,ss=pe<<11|Q>>>21,os=Q<<11|pe>>>21,as=de<<15|Me>>>17,cs=Me<<15|de>>>17,ls=k<<29|I>>>3,us=I<<29|k>>>3,ds=P<<28|J>>>4,hs=J<<28|P>>>4,fs=y<<23|ee>>>9,ps=ee<<23|y>>>9,gs=w<<25|L>>>7,_s=L<<25|w>>>7,ms=D<<21|me>>>11,bs=me<<21|D>>>11,ys=ae<<24|te>>>8,ws=te<<24|ae>>>8,Es=rt<<27|wt>>>5,vs=wt<<27|rt>>>5,Ss=xt<<20|Et>>>12,Rs=Et<<20|xt>>>12,Cs=ct<<7|$e>>>25,ks=$e<<7|ct>>>25,Is=At<<8|De>>>24,xs=De<<8|At>>>24,As=lt<<14|p>>>18,Ts=p<<14|lt>>>18;e[0]=l^~Gi&ss,e[1]=d^~Ji&os,e[10]=ds^~Ss&T,e[11]=hs^~Rs&N,e[20]=he^~ns&gs,e[21]=qi^~is&_s,e[30]=Es^~m&Zi,e[31]=vs^~R&Ki,e[40]=ts^~fs&Cs,e[41]=rs^~ps&ks,e[2]=Gi^~ss&ms,e[3]=Ji^~os&bs,e[12]=Ss^~T&Qi,e[13]=Rs^~N&Yi,e[22]=ns^~gs&Is,e[23]=is^~_s&xs,e[32]=m^~Zi&as,e[33]=R^~Ki&cs,e[42]=fs^~Cs&X,e[43]=ps^~ks&ye,e[4]=ss^~ms&As,e[5]=os^~bs&Ts,e[14]=T^~Qi&ls,e[15]=N^~Yi&us,e[24]=gs^~Is&_e,e[25]=_s^~xs&we,e[34]=Zi^~as&ys,e[35]=Ki^~cs&ws,e[44]=Cs^~X&Xi,e[45]=ks^~ye&es,e[6]=ms^~As&l,e[7]=bs^~Ts&d,e[16]=Qi^~ls&ds,e[17]=Yi^~us&hs,e[26]=Is^~_e&he,e[27]=xs^~we&qi,e[36]=as^~ys&Es,e[37]=cs^~ws&vs,e[46]=X^~Xi&ts,e[47]=ye^~es&rs,e[8]=As^~l&Gi,e[9]=Ts^~d&Ji,e[18]=ls^~ds&Ss,e[19]=us^~hs&Rs,e[28]=_e^~he&ns,e[29]=we^~qi&is,e[38]=ys^~Es&m,e[39]=ws^~vs&R,e[48]=Xi^~ts&fs,e[49]=es^~rs&ps,e[0]^=ac[t*2],e[1]^=ac[t*2+1]}};const jn=pu;function Tr(){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}Tr.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};Tr.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(jn.p1600(this.state),this.count=0)};Tr.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&jn.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),jn.p1600(this.state),this.count=0,this.squeezing=!0};Tr.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=se.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(jn.p1600(this.state),this.count=0);return t};Tr.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Vp=Tr,zp=Wp(Vp);const qp=zp,Gp=zn;function gu(e){return se.allocUnsafe(e).fill(0)}function _u(e,t,r){const n=gu(t);return e=Ri(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function Jp(e,t){return _u(e,t,!0)}function Ri(e){if(!se.isBuffer(e))if(Array.isArray(e))e=se.from(e);else if(typeof e=="string")mu(e)?e=se.from(Qp(bu(e)),"hex"):e=se.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=se.allocUnsafe(0);else if(Gp.isBN(e))e=e.toArrayLike(se);else if(e.toArray)e=se.from(e.toArray());else throw new Error("invalid type");return e}function Zp(e){return e=Ri(e),"0x"+e.toString("hex")}function Kp(e,t){return e=Ri(e),t||(t=256),qp("keccak"+t).update(e).digest()}function Qp(e){return e.length%2?"0"+e:e}function mu(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function bu(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var yu={zeros:gu,setLength:_u,setLengthRight:Jp,isHexString:mu,stripHexPrefix:bu,toBuffer:Ri,bufferToHex:Zp,keccak:Kp};const Gt=yu,Wt=zn;function wu(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function hr(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function cc(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Eu(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function Ut(e){var t=typeof e;if(t==="string")return Gt.isHexString(e)?new Wt(Gt.stripHexPrefix(e),16):new Wt(e,10);if(t==="number")return new Wt(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function ft(e,t){var r,n,i,s;if(e==="address")return ft("uint160",Ut(t));if(e==="bool")return ft("uint8",t?1:0);if(e==="string")return ft("bytes",new se(t,"utf8"));if(Xp(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Eu(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(s in t)i.push(ft(e,t[s]));if(r==="dynamic"){var a=ft("uint256",t.length);i.unshift(a)}return se.concat(i)}else{if(e==="bytes")return t=new se(t),i=se.concat([ft("uint256",t.length),t]),t.length%32!==0&&(i=se.concat([i,Gt.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=hr(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return Gt.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=hr(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Ut(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(se,"be",32)}else if(e.startsWith("int")){if(r=hr(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Ut(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(se,"be",32)}else if(e.startsWith("ufixed")){if(r=cc(e),n=Ut(t),n<0)throw new Error("Supplied ufixed is negative");return ft("uint256",n.mul(new Wt(2).pow(new Wt(r[1]))))}else if(e.startsWith("fixed"))return r=cc(e),ft("int256",Ut(t).mul(new Wt(2).pow(new Wt(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function Yp(e){return e==="string"||e==="bytes"||Eu(e)==="dynamic"}function Xp(e){return e.lastIndexOf("]")===e.length-1}function e1(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var a=wu(e[s]),o=t[s],c=ft(a,o);Yp(a)?(r.push(ft("uint256",i)),n.push(c),i+=c.length):r.push(c)}return se.concat(r.concat(n))}function vu(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s<e.length;s++){var a=wu(e[s]),o=t[s];if(a==="bytes")i.push(o);else if(a==="string")i.push(new se(o,"utf8"));else if(a==="bool")i.push(new se(o?"01":"00","hex"));else if(a==="address")i.push(Gt.setLength(o,20));else if(a.startsWith("bytes")){if(r=hr(a),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(Gt.setLengthRight(o,r))}else if(a.startsWith("uint")){if(r=hr(a),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Ut(o),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(se,"be",r/8))}else if(a.startsWith("int")){if(r=hr(a),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Ut(o),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(se,"be",r/8))}else throw new Error("Unsupported or invalid type: "+a)}return se.concat(i)}function t1(e,t){return Gt.keccak(vu(e,t))}var r1={rawEncode:e1,solidityPack:vu,soliditySHA3:t1};const it=yu,jr=r1,Su={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"]},Zs={encodeData(e,t,r,n=!0){const i=["bytes32"],s=[this.hashType(e,r)];if(n){const a=(o,c,u)=>{if(r[c]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":it.keccak(this.encodeData(c,u,r,n))];if(u===void 0)throw new Error(`missing value for field ${o} of type ${c}`);if(c==="bytes")return["bytes32",it.keccak(u)];if(c==="string")return typeof u=="string"&&(u=se.from(u,"utf8")),["bytes32",it.keccak(u)];if(c.lastIndexOf("]")===c.length-1){const f=c.slice(0,c.lastIndexOf("[")),h=u.map(g=>a(o,f,g));return["bytes32",it.keccak(jr.rawEncode(h.map(([g])=>g),h.map(([,g])=>g)))]}return[c,u]};for(const o of r[e]){const[c,u]=a(o.name,o.type,t[o.name]);i.push(c),s.push(u)}}else for(const a of r[e]){let o=t[a.name];if(o!==void 0)if(a.type==="bytes")i.push("bytes32"),o=it.keccak(o),s.push(o);else if(a.type==="string")i.push("bytes32"),typeof o=="string"&&(o=se.from(o,"utf8")),o=it.keccak(o),s.push(o);else if(r[a.type]!==void 0)i.push("bytes32"),o=it.keccak(this.encodeData(a.type,o,r,n)),s.push(o);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),s.push(o)}}return jr.rawEncode(i,s)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(i=>i!==e);n=[e].concat(n.sort());for(const i of n){if(!t[i])throw new Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:a,type:o})=>o+" "+a).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return it.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return it.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Su.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[se.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),it.keccak(se.concat(n))}};var n1={TYPED_MESSAGE_SCHEMA:Su,TypedDataUtils:Zs,hashForSignTypedDataLegacy:function(e){return i1(e.data)},hashForSignTypedData_v3:function(e){return Zs.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return Zs.hash(e.data)}};function i1(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(s){return s.type==="bytes"?it.toBuffer(s.value):s.value}),n=e.map(function(s){return s.type}),i=e.map(function(s){if(!s.name)throw t;return s.type+" "+s.name});return jr.soliditySHA3(["bytes32","bytes32"],[jr.soliditySHA3(new Array(e.length).fill("string"),i),jr.soliditySHA3(n,r)])}var wr={};Object.defineProperty(wr,"__esModule",{value:!0});wr.filterFromParam=wr.FilterPolyfill=void 0;const lr=Ae,je=z,s1=5*60*1e3,Ht={jsonrpc:"2.0",id:0};class o1{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,lr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=Ru(t),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,je.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,je.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,je.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,je.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,je.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(kn())}async getFilterLogs(t){const r=(0,je.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Ht),{method:"eth_getLogs",params:[lc(n)]})):kn()}makeFilterId(){return(0,lr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return kn();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return In();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},Ht),{method:"eth_getLogs",params:[lc(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(a.result)){const o=a.result.map(u=>(0,je.intNumberFromHexString)(u.blockNumber||"0x0")),c=Math.max(...o);if(c&&c>n){const u=(0,lr.IntNumber)(c+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${u}`),this.cursors.set(t,u)}}return a}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return kn();const n=await this.getCurrentBlockHeight();if(r>n)return In();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,je.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,lr.IntNumber)(a))))).filter(a=>!!a),s=(0,lr.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${s}`),this.cursors.set(t,s),Object.assign(Object.assign({},Ht),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(In())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,i),i}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},s1);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},Ht),{method:"eth_blockNumber",params:[]}));return(0,je.intNumberFromHexString)((0,je.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},Ht),{method:"eth_getBlockByNumber",params:[(0,je.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,je.ensureHexString)(r.result.hash):null}}wr.FilterPolyfill=o1;function Ru(e){return{fromBlock:uc(e.fromBlock),toBlock:uc(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}wr.filterFromParam=Ru;function lc(e){const t={fromBlock:dc(e.fromBlock),toBlock:dc(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function uc(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,lr.IntNumber)(0);if((0,je.isHexString)(e))return(0,je.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function dc(e){return e==="latest"?e:(0,je.hexStringFromIntNumber)(e)}function kn(){return Object.assign(Object.assign({},Ht),{error:{code:-32e3,message:"filter not found"}})}function In(){return Object.assign(Object.assign({},Ht),{result:[]})}var Ci={},Cu={},ki={},Wo=a1;function a1(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const hc=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,s)=>{t.errorFirst?n.push(function(a,o){if(t.multiArgs){const c=new Array(arguments.length-1);for(let u=1;u<arguments.length;u++)c[u-1]=arguments[u];a?(c.unshift(a),s(c)):i(c)}else a?s(a):i(o)}):n.push(function(a){if(t.multiArgs){const o=new Array(arguments.length-1);for(let c=0;c<arguments.length;c++)o[c]=arguments[c];i(o)}else i(a)}),e.apply(this,n)})};var c1=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=a=>typeof a=="string"?i===a:a.test(i);return t.include?t.include.some(s):!t.exclude.some(s)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):hc(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const i in e){const s=e[i];n[i]=typeof s=="function"&&r(i)?hc(s,t):s}return n},ln={},un={};Object.defineProperty(un,"__esModule",{value:!0});const l1=Gn;function fc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function u1(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let d1=class extends l1.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;const o=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw o.context=a,o}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")fc(s,this,r);else{const a=s.length,o=u1(s);for(let c=0;c<a;c+=1)fc(o[c],this,r)}return!0}};un.default=d1;var h1=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ln,"__esModule",{value:!0});ln.BaseBlockTracker=void 0;const f1=h1(un),p1=1e3,g1=(e,t)=>e+t,pc=["sync","latest"];class _1 extends f1.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*p1,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):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(t){pc.includes(t)&&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 pc.map(t=>this.listenerCount(t)).reduce(g1)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=gc(t),i=gc(r);return this._usePastBlocks&&n<i||n>i}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_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}}ln.BaseBlockTracker=_1;function gc(e){return Number.parseInt(e,16)}var ku={},Iu={},Oe={};class xu extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...a}=t,{path:o}=t,c=o.length===0?i:`At path: ${o.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function m1(e){return et(e)&&typeof e[Symbol.iterator]=="function"}function et(e){return typeof e=="object"&&e!=null}function _c(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Te(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function b1(e){const{done:t,value:r}=e.next();return t?void 0:r}function y1(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:a}=r,{refinement:o,message:c=`Expected a value of type \`${a}\`${o?` with refinement \`${o}\``:""}, but received: \`${Te(n)}\``}=e;return{value:n,type:a,refinement:o,key:i[i.length-1],path:i,branch:s,...e,message:c}}function*bo(e,t,r,n){m1(e)||(e=[e]);for(const i of e){const s=y1(i,t,r,n);s&&(yield s)}}function*Vo(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:a=!1}=r,o={path:n,branch:i};if(s&&(e=t.coercer(e,o),a&&t.type!=="type"&&et(t.schema)&&et(e)&&!Array.isArray(e)))for(const u in e)t.schema[u]===void 0&&delete e[u];let c="valid";for(const u of t.validator(e,o))u.explanation=r.message,c="not_valid",yield[u,void 0];for(let[u,f,h]of t.entries(e,o)){const g=Vo(f,h,{path:u===void 0?n:[...n,u],branch:u===void 0?i:[...i,f],coerce:s,mask:a,message:r.message});for(const _ of g)_[0]?(c=_[0].refinement!=null?"not_refined":"not_valid",yield[_[0],void 0]):s&&(f=_[1],u===void 0?e=f:e instanceof Map?e.set(u,f):e instanceof Set?e.add(f):et(e)&&(f!==void 0||u in e)&&(e[u]=f))}if(c!=="not_valid")for(const u of t.refiner(e,o))u.explanation=r.message,c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,e])}class Ie{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:a=c=>c,entries:o=function*(){}}=t;this.type=r,this.schema=n,this.entries=o,this.coercer=a,i?this.validator=(c,u)=>{const f=i(c,u);return bo(f,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const f=s(c,u);return bo(f,u,this,c)}:this.refiner=()=>[]}assert(t,r){return Au(t,this,r)}create(t,r){return Tu(t,this,r)}is(t){return zo(t,this)}mask(t,r){return Mu(t,this,r)}validate(t,r={}){return Mr(t,this,r)}}function Au(e,t,r){const n=Mr(e,t,{message:r});if(n[0])throw n[0]}function Tu(e,t,r){const n=Mr(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Mu(e,t,r){const n=Mr(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function zo(e,t){return!Mr(e,t)[0]}function Mr(e,t,r={}){const n=Vo(e,t,r),i=b1(n);return i[0]?[new xu(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function w1(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?hn(n):dn(n)}function Ve(e,t){return new Ie({type:e,schema:null,validator:t})}function E1(e,t){return new Ie({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function v1(e){return new Ie({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function S1(e){let t;return new Ie({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function R1(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return hn(n);default:return dn(n)}}function C1(e){const t=e instanceof Ie,r=t?{...e.schema}:{...e};for(const n in r)r[n]=Nu(r[n]);return t&&e.type==="type"?hn(r):dn(r)}function k1(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return hn(n);default:return dn(n)}}function I1(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Ve(e,t)}function x1(){return Ve("any",()=>!0)}function A1(e){return new Ie({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Te(t)}`}})}function T1(){return Ve("bigint",e=>typeof e=="bigint")}function M1(){return Ve("boolean",e=>typeof e=="boolean")}function N1(){return Ve("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Te(e)}`)}function L1(e){const t={},r=e.map(n=>Te(n)).join();for(const n of e)t[n]=n;return new Ie({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Te(n)}`}})}function P1(){return Ve("func",e=>typeof e=="function"||`Expected a function, but received: ${Te(e)}`)}function B1(e){return Ve("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Te(t)}`)}function O1(){return Ve("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Te(e)}`)}function $1(e){return new Ie({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function F1(e){const t=Te(e),r=typeof e;return new Ie({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Te(n)}`}})}function D1(e,t){return new Ie({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Te(r)}`}})}function qo(){return Ve("never",()=>!1)}function j1(e){return new Ie({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function U1(){return Ve("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Te(e)}`)}function dn(e){const t=e?Object.keys(e):[],r=qo();return new Ie({type:"object",schema:e||null,*entries(n){if(e&&et(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return et(n)||`Expected an object, but received: ${Te(n)}`},coercer(n){return et(n)?{...n}:n}})}function Nu(e){return new Ie({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function H1(e,t){return new Ie({type:"record",schema:null,*entries(r){if(et(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return et(r)||`Expected an object, but received: ${Te(r)}`}})}function W1(){return Ve("regexp",e=>e instanceof RegExp)}function V1(e){return new Ie({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${Te(t)}`}})}function Lu(){return Ve("string",e=>typeof e=="string"||`Expected a string, but received: ${Te(e)}`)}function z1(e){const t=qo();return new Ie({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${Te(r)}`}})}function hn(e){const t=Object.keys(e);return new Ie({type:"type",schema:e,*entries(r){if(et(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return et(r)||`Expected an object, but received: ${Te(r)}`},coercer(r){return et(r)?{...r}:r}})}function q1(e){const t=e.map(r=>r.type).join(" | ");return new Ie({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...a]=Vo(r,s,n),[o]=a;if(o[0])for(const[c]of a)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Te(r)}`,...i]}})}function Pu(){return Ve("unknown",()=>!0)}function Go(e,t,r){return new Ie({...e,coercer:(n,i)=>zo(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function G1(e,t,r={}){return Go(e,Pu(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&_c(n)&&_c(i)){const s={...n};let a=!1;for(const o in i)s[o]===void 0&&(s[o]=i[o],a=!0);if(a)return s}return n})}function J1(e){return Go(e,Lu(),t=>t.trim())}function Z1(e){return er(e,"empty",t=>{const r=Bu(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Bu(e){return e instanceof Map||e instanceof Set?e.size:e.length}function K1(e,t,r={}){const{exclusive:n}=r;return er(e,"max",i=>n?i<t:i<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${i}\``)}function Q1(e,t,r={}){const{exclusive:n}=r;return er(e,"min",i=>n?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function Y1(e){return er(e,"nonempty",t=>Bu(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function X1(e,t){return er(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function eg(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return er(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:a}=s;return t<=a&&a<=r||`${n} with a size ${i} but received one with a size of \`${a}\``}else{const{length:a}=s;return t<=a&&a<=r||`${n} with a length ${i} but received one with a length of \`${a}\``}})}function er(e,t,r){return new Ie({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),a=bo(s,i,e,n);for(const o of a)yield{...o,refinement:t}}})}const tg=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ie,StructError:xu,any:x1,array:A1,assert:Au,assign:w1,bigint:T1,boolean:M1,coerce:Go,create:Tu,date:N1,defaulted:G1,define:Ve,deprecated:E1,dynamic:v1,empty:Z1,enums:L1,func:P1,instance:B1,integer:O1,intersection:$1,is:zo,lazy:S1,literal:F1,map:D1,mask:Mu,max:K1,min:Q1,never:qo,nonempty:Y1,nullable:j1,number:U1,object:dn,omit:R1,optional:Nu,partial:C1,pattern:X1,pick:k1,record:H1,refine:er,regexp:W1,set:V1,size:eg,string:Lu,struct:I1,trimmed:J1,tuple:z1,type:hn,union:q1,unknown:Pu,validate:Mr},Symbol.toStringTag,{value:"Module"})),tr=qn(tg);Object.defineProperty(Oe,"__esModule",{value:!0});Oe.assertExhaustive=Oe.assertStruct=Oe.assert=Oe.AssertionError=void 0;const rg=tr;function ng(e){return typeof e=="object"&&e!==null&&"message"in e}function ig(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function sg(e){const t=ng(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Ou(e,t){return ig(e)?new e({message:t}):e({message:t})}class Jo extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}Oe.AssertionError=Jo;function og(e,t="Assertion failed.",r=Jo){if(!e)throw t instanceof Error?t:Ou(r,t)}Oe.assert=og;function ag(e,t,r="Assertion failed",n=Jo){try{(0,rg.assert)(e,t)}catch(i){throw Ou(n,`${r}: ${sg(i)}.`)}}Oe.assertStruct=ag;function cg(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}Oe.assertExhaustive=cg;var fn={};Object.defineProperty(fn,"__esModule",{value:!0});fn.base64=void 0;const lg=tr,ug=Oe,dg=(e,t={})=>{var r,n;const i=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let a;s==="base64"?a=String.raw`[A-Za-z0-9+\/]`:((0,ug.assert)(s==="base64url"),a=String.raw`[-_A-Za-z0-9]`);let o;return i?o=new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):o=new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),(0,lg.pattern)(e,o)};fn.base64=dg;var ue={},pn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=tr,r=Oe;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(u){return(0,t.is)(u,e.HexStruct)}e.isHexString=n;function i(u){return(0,t.is)(u,e.StrictHexStruct)}e.isStrictHexString=i;function s(u){(0,r.assert)(n(u),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function a(u){(0,r.assert)(i(u),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=a;function o(u){return u.startsWith("0x")?u:u.startsWith("0X")?`0x${u.substring(2)}`:`0x${u}`}e.add0x=o;function c(u){return u.startsWith("0x")||u.startsWith("0X")?u.substring(2):u}e.remove0x=c})(pn);Object.defineProperty(ue,"__esModule",{value:!0});ue.createDataView=ue.concatBytes=ue.valueToBytes=ue.stringToBytes=ue.numberToBytes=ue.signedBigIntToBytes=ue.bigIntToBytes=ue.hexToBytes=ue.bytesToString=ue.bytesToNumber=ue.bytesToSignedBigInt=ue.bytesToBigInt=ue.bytesToHex=ue.assertIsBytes=ue.isBytes=void 0;const Ge=Oe,yo=pn,mc=48,bc=58,yc=87;function hg(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const fg=hg();function Zo(e){return e instanceof Uint8Array}ue.isBytes=Zo;function Nr(e){(0,Ge.assert)(Zo(e),"Value must be a Uint8Array.")}ue.assertIsBytes=Nr;function $u(e){if(Nr(e),e.length===0)return"0x";const t=fg(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,yo.add0x)(r.join(""))}ue.bytesToHex=$u;function Fu(e){Nr(e);const t=$u(e);return BigInt(t)}ue.bytesToBigInt=Fu;function pg(e){Nr(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}ue.bytesToSignedBigInt=pg;function gg(e){Nr(e);const t=Fu(e);return(0,Ge.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}ue.bytesToNumber=gg;function _g(e){return Nr(e),new TextDecoder().decode(e)}ue.bytesToString=_g;function Ii(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,yo.assertIsHexString)(e);const r=(0,yo.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const a=n.charCodeAt(s*2),o=n.charCodeAt(s*2+1),c=a-(a<bc?mc:yc),u=o-(o<bc?mc:yc);i[s]=c*16+u}return i}ue.hexToBytes=Ii;function Du(e){(0,Ge.assert)(typeof e=="bigint","Value must be a bigint."),(0,Ge.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return Ii(t)}ue.bigIntToBytes=Du;function mg(e,t){(0,Ge.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function bg(e,t){(0,Ge.assert)(typeof e=="bigint","Value must be a bigint."),(0,Ge.assert)(typeof t=="number","Byte length must be a number."),(0,Ge.assert)(t>0,"Byte length must be greater than 0."),(0,Ge.assert)(mg(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}ue.signedBigIntToBytes=bg;function ju(e){(0,Ge.assert)(typeof e=="number","Value must be a number."),(0,Ge.assert)(e>=0,"Value must be a non-negative number."),(0,Ge.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return Ii(t)}ue.numberToBytes=ju;function Uu(e){return(0,Ge.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}ue.stringToBytes=Uu;function Hu(e){if(typeof e=="bigint")return Du(e);if(typeof e=="number")return ju(e);if(typeof e=="string")return e.startsWith("0x")?Ii(e):Uu(e);if(Zo(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}ue.valueToBytes=Hu;function yg(e){const t=new Array(e.length);let r=0;for(let i=0;i<e.length;i++){const s=Hu(e[i]);t[i]=s,r+=s.length}const n=new Uint8Array(r);for(let i=0,s=0;i<t.length;i++)n.set(t[i],s),s+=t[i].length;return n}ue.concatBytes=yg;function wg(e){if(typeof se<"u"&&e instanceof se){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}ue.createDataView=wg;var xi={};Object.defineProperty(xi,"__esModule",{value:!0});xi.ChecksumStruct=void 0;const wc=tr,Eg=fn;xi.ChecksumStruct=(0,wc.size)((0,Eg.base64)((0,wc.string)(),{paddingRequired:!0}),44,44);var bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.createHex=bt.createBytes=bt.createBigInt=bt.createNumber=void 0;const ke=tr,vg=Oe,Wu=ue,Ai=pn,Vu=(0,ke.union)([(0,ke.number)(),(0,ke.bigint)(),(0,ke.string)(),Ai.StrictHexStruct]),Sg=(0,ke.coerce)((0,ke.number)(),Vu,Number),Rg=(0,ke.coerce)((0,ke.bigint)(),Vu,BigInt);(0,ke.union)([Ai.StrictHexStruct,(0,ke.instance)(Uint8Array)]);const Cg=(0,ke.coerce)((0,ke.instance)(Uint8Array),(0,ke.union)([Ai.StrictHexStruct]),Wu.hexToBytes),kg=(0,ke.coerce)(Ai.StrictHexStruct,(0,ke.instance)(Uint8Array),Wu.bytesToHex);function Ig(e){try{const t=(0,ke.create)(e,Sg);return(0,vg.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof ke.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}bt.createNumber=Ig;function xg(e){try{return(0,ke.create)(e,Rg)}catch(t){throw t instanceof ke.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}bt.createBigInt=xg;function Ag(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,ke.create)(e,Cg)}catch(t){throw t instanceof ke.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}bt.createBytes=Ag;function Tg(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,ke.create)(e,kg)}catch(t){throw t instanceof ke.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}bt.createHex=Tg;var Er={},zu=Z&&Z.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Ue=Z&&Z.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},nt,dt;Object.defineProperty(Er,"__esModule",{value:!0});Er.FrozenSet=Er.FrozenMap=void 0;class Ko{constructor(t){nt.set(this,void 0),zu(this,nt,new Map(t),"f"),Object.freeze(this)}get size(){return Ue(this,nt,"f").size}[(nt=new WeakMap,Symbol.iterator)](){return Ue(this,nt,"f")[Symbol.iterator]()}entries(){return Ue(this,nt,"f").entries()}forEach(t,r){return Ue(this,nt,"f").forEach((n,i,s)=>t.call(r,n,i,this))}get(t){return Ue(this,nt,"f").get(t)}has(t){return Ue(this,nt,"f").has(t)}keys(){return Ue(this,nt,"f").keys()}values(){return Ue(this,nt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Er.FrozenMap=Ko;class Qo{constructor(t){dt.set(this,void 0),zu(this,dt,new Set(t),"f"),Object.freeze(this)}get size(){return Ue(this,dt,"f").size}[(dt=new WeakMap,Symbol.iterator)](){return Ue(this,dt,"f")[Symbol.iterator]()}entries(){return Ue(this,dt,"f").entries()}forEach(t,r){return Ue(this,dt,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return Ue(this,dt,"f").has(t)}keys(){return Ue(this,dt,"f").keys()}values(){return Ue(this,dt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Er.FrozenSet=Qo;Object.freeze(Ko);Object.freeze(Ko.prototype);Object.freeze(Qo);Object.freeze(Qo.prototype);var qu={};Object.defineProperty(qu,"__esModule",{value:!0});var Gu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=tr,r=Oe,n=()=>(0,t.define)("finite number",A=>(0,t.is)(A,(0,t.number)())&&Number.isFinite(A));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(A,B)=>{function G(W,F){const Ee=[...F.validator(W,B)];return Ee.length>0?Ee:!0}try{const W=G(A,e.UnsafeJsonStruct);return W!==!0?W:G(JSON.parse(JSON.stringify(A)),e.UnsafeJsonStruct)}catch(W){return W instanceof RangeError?"Circular reference detected":!1}});function i(A){return(0,t.is)(A,e.JsonStruct)}e.isValidJson=i;function s(A){(0,r.assertStruct)(A,e.JsonStruct,"Invalid JSON value");const B=JSON.stringify(A);return new TextEncoder().encode(B).byteLength}e.getJsonSize=s,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function a(A){return(0,t.is)(A,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=a;function o(A,B){(0,r.assertStruct)(A,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",B)}e.assertIsJsonRpcNotification=o;function c(A){return(0,t.is)(A,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=c;function u(A,B){(0,r.assertStruct)(A,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",B)}e.assertIsJsonRpcRequest=u,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function f(A){return(0,t.is)(A,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=f;function h(A,B){(0,r.assertStruct)(A,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",B)}e.assertIsPendingJsonRpcResponse=h;function g(A){return(0,t.is)(A,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=g;function _(A,B){(0,r.assertStruct)(A,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",B)}e.assertIsJsonRpcResponse=_;function E(A){return(0,t.is)(A,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=E;function x(A,B){(0,r.assertStruct)(A,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",B)}e.assertIsJsonRpcSuccess=x;function S(A){return(0,t.is)(A,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=S;function b(A,B){(0,r.assertStruct)(A,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",B)}e.assertIsJsonRpcFailure=b;function v(A){return(0,t.is)(A,e.JsonRpcErrorStruct)}e.isJsonRpcError=v;function C(A,B){(0,r.assertStruct)(A,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",B)}e.assertIsJsonRpcError=C;function M(A){const{permitEmptyString:B,permitFractions:G,permitNull:W}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},A);return re=>!!(typeof re=="number"&&(G||Number.isInteger(re))||typeof re=="string"&&(B||re.length>0)||W&&re===null)}e.getJsonRpcIdValidator=M})(Gu);var Ju={};Object.defineProperty(Ju,"__esModule",{value:!0});var vr={},wo={exports:{}},Ks,Ec;function Mg(){if(Ec)return Ks;Ec=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,s=n*365.25;Ks=function(f,h){h=h||{};var g=typeof f;if(g==="string"&&f.length>0)return a(f);if(g==="number"&&isFinite(f))return h.long?c(f):o(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function a(f){if(f=String(f),!(f.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(f);if(h){var g=parseFloat(h[1]),_=(h[2]||"ms").toLowerCase();switch(_){case"years":case"year":case"yrs":case"yr":case"y":return g*s;case"weeks":case"week":case"w":return g*i;case"days":case"day":case"d":return g*n;case"hours":case"hour":case"hrs":case"hr":case"h":return g*r;case"minutes":case"minute":case"mins":case"min":case"m":return g*t;case"seconds":case"second":case"secs":case"sec":case"s":return g*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function o(f){var h=Math.abs(f);return h>=n?Math.round(f/n)+"d":h>=r?Math.round(f/r)+"h":h>=t?Math.round(f/t)+"m":h>=e?Math.round(f/e)+"s":f+"ms"}function c(f){var h=Math.abs(f);return h>=n?u(f,h,n,"day"):h>=r?u(f,h,r,"hour"):h>=t?u(f,h,t,"minute"):h>=e?u(f,h,e,"second"):f+" ms"}function u(f,h,g,_){var E=h>=g*1.5;return Math.round(f/g)+" "+_+(E?"s":"")}return Ks}function Ng(e){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=a,r.humanize=Mg(),r.destroy=u,Object.keys(e).forEach(f=>{r[f]=e[f]}),r.names=[],r.skips=[],r.formatters={};function t(f){let h=0;for(let g=0;g<f.length;g++)h=(h<<5)-h+f.charCodeAt(g),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=t;function r(f){let h,g=null,_,E;function x(...S){if(!x.enabled)return;const b=x,v=Number(new Date),C=v-(h||v);b.diff=C,b.prev=h,b.curr=v,h=v,S[0]=r.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let M=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(B,G)=>{if(B==="%%")return"%";M++;const W=r.formatters[G];if(typeof W=="function"){const F=S[M];B=W.call(b,F),S.splice(M,1),M--}return B}),r.formatArgs.call(b,S),(b.log||r.log).apply(b,S)}return x.namespace=f,x.useColors=r.useColors(),x.color=r.selectColor(f),x.extend=n,x.destroy=r.destroy,Object.defineProperty(x,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(_!==r.namespaces&&(_=r.namespaces,E=r.enabled(f)),E),set:S=>{g=S}}),typeof r.init=="function"&&r.init(x),x}function n(f,h){const g=r(this.namespace+(typeof h>"u"?":":h)+f);return g.log=this.log,g}function i(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h;const g=(typeof f=="string"?f:"").split(/[\s,]+/),_=g.length;for(h=0;h<_;h++)g[h]&&(f=g[h].replace(/\*/g,".*?"),f[0]==="-"?r.skips.push(new RegExp("^"+f.slice(1)+"$")):r.names.push(new RegExp("^"+f+"$")))}function s(){const f=[...r.names.map(o),...r.skips.map(o).map(h=>"-"+h)].join(",");return r.enable(""),f}function a(f){if(f[f.length-1]==="*")return!0;let h,g;for(h=0,g=r.skips.length;h<g;h++)if(r.skips[h].test(f))return!1;for(h=0,g=r.names.length;h<g;h++)if(r.names[h].test(f))return!0;return!1}function o(f){return f.toString().substring(2,f.toString().length-2).replace(/\.\*\?$/,"*")}function c(f){return f instanceof Error?f.stack||f.message:f}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Lg=Ng;(function(e,t){t.formatArgs=n,t.save=i,t.load=s,t.useColors=r,t.storage=a(),t.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`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;c.splice(1,0,u,"color: inherit");let f=0,h=0;c[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(f++,g==="%c"&&(h=f))}),c.splice(h,0,u)}t.log=console.debug||console.log||(()=>{});function i(c){try{c?t.storage.setItem("debug",c):t.storage.removeItem("debug")}catch{}}function s(){let c;try{c=t.storage.getItem("debug")}catch{}return!c&&typeof ge<"u"&&"env"in ge&&(c={}.DEBUG),c}function a(){try{return localStorage}catch{}}e.exports=Lg(t);const{formatters:o}=e.exports;o.j=function(c){try{return JSON.stringify(c)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(wo,wo.exports);var Pg=wo.exports,Bg=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vr,"__esModule",{value:!0});vr.createModuleLogger=vr.createProjectLogger=void 0;const Og=Bg(Pg),$g=(0,Og.default)("metamask");function Fg(e){return $g.extend(e)}vr.createProjectLogger=Fg;function Dg(e,t){return e.extend(t)}vr.createModuleLogger=Dg;var Zu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(u){return Array.isArray(u)&&u.length>0}e.isNonEmptyArray=t;function r(u){return u==null}e.isNullOrUndefined=r;function n(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}e.isObject=n;const i=(u,f)=>Object.hasOwnProperty.call(u,f);e.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"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(u){if(typeof u!="object"||u===null)return!1;try{let f=u;for(;Object.getPrototypeOf(f)!==null;)f=Object.getPrototypeOf(f);return Object.getPrototypeOf(u)===f}catch{return!1}}e.isPlainObject=s;function a(u){return u.charCodeAt(0)<=127}e.isASCII=a;function o(u){var f;return u.split("").reduce((g,_)=>a(_)?g+1:g+2,0)+((f=u.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&f!==void 0?f:[]).length}e.calculateStringSize=o;function c(u){return u.toString().length}e.calculateNumberSize=c})(Zu);var yt={};Object.defineProperty(yt,"__esModule",{value:!0});yt.hexToBigInt=yt.hexToNumber=yt.bigIntToHex=yt.numberToHex=void 0;const fr=Oe,Vr=pn,jg=e=>((0,fr.assert)(typeof e=="number","Value must be a number."),(0,fr.assert)(e>=0,"Value must be a non-negative number."),(0,fr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Vr.add0x)(e.toString(16)));yt.numberToHex=jg;const Ug=e=>((0,fr.assert)(typeof e=="bigint","Value must be a bigint."),(0,fr.assert)(e>=0,"Value must be a non-negative bigint."),(0,Vr.add0x)(e.toString(16)));yt.bigIntToHex=Ug;const Hg=e=>{(0,Vr.assertIsHexString)(e);const t=parseInt(e,16);return(0,fr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};yt.hexToNumber=Hg;const Wg=e=>((0,Vr.assertIsHexString)(e),BigInt((0,Vr.add0x)(e)));yt.hexToBigInt=Wg;var Ku={};Object.defineProperty(Ku,"__esModule",{value:!0});var Qu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.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"}(e.Duration||(e.Duration={}));const t=s=>Number.isInteger(s)&&s>=0,r=(s,a)=>{if(!t(s))throw new Error(`"${a}" must be a non-negative integer. Received: "${s}".`)};function n(s,a){return r(s,"count"),s*a}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(Qu);var Yu={};Object.defineProperty(Yu,"__esModule",{value:!0});var Xu={},Eo={exports:{}};const Vg="2.0.0",ed=256,zg=Number.MAX_SAFE_INTEGER||9007199254740991,qg=16,Gg=ed-6,Jg=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Ti={MAX_LENGTH:ed,MAX_SAFE_COMPONENT_LENGTH:qg,MAX_SAFE_BUILD_LENGTH:Gg,MAX_SAFE_INTEGER:zg,RELEASE_TYPES:Jg,SEMVER_SPEC_VERSION:Vg,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Zg=typeof ge=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Mi=Zg;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Ti,s=Mi;t=e.exports={};const a=t.re=[],o=t.safeRe=[],c=t.src=[],u=t.t={};let f=0;const h="[a-zA-Z0-9-]",g=[["\\s",1],["\\d",i],[h,n]],_=x=>{for(const[S,b]of g)x=x.split(`${S}*`).join(`${S}{0,${b}}`).split(`${S}+`).join(`${S}{1,${b}}`);return x},E=(x,S,b)=>{const v=_(S),C=f++;s(x,C,S),u[x]=C,c[C]=S,a[C]=new RegExp(S,b?"g":void 0),o[C]=new RegExp(v,b?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),E("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),E("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${h}+`),E("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),E("FULL",`^${c[u.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),E("LOOSE",`^${c[u.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),E("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),E("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",c[u.COERCE],!0),E("COERCERTLFULL",c[u.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",E("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",E("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Eo,Eo.exports);var gn=Eo.exports;const Kg=Object.freeze({loose:!0}),Qg=Object.freeze({}),Yg=e=>e?typeof e!="object"?Kg:e:Qg;var Yo=Yg;const vc=/^[0-9]+$/,td=(e,t)=>{const r=vc.test(e),n=vc.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Xg=(e,t)=>td(t,e);var rd={compareIdentifiers:td,rcompareIdentifiers:Xg};const xn=Mi,{MAX_LENGTH:Sc,MAX_SAFE_INTEGER:An}=Ti,{safeRe:Rc,t:Cc}=gn,e_=Yo,{compareIdentifiers:ar}=rd;let t_=class ht{constructor(t,r){if(r=e_(r),t instanceof ht){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Sc)throw new TypeError(`version is longer than ${Sc} characters`);xn("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?Rc[Cc.LOOSE]:Rc[Cc.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>An||this.major<0)throw new TypeError("Invalid major version");if(this.minor>An||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>An||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<An)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(xn("SemVer.compare",this.version,this.options,t),!(t instanceof ht)){if(typeof t=="string"&&t===this.version)return 0;t=new ht(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof ht||(t=new ht(t,this.options)),ar(this.major,t.major)||ar(this.minor,t.minor)||ar(this.patch,t.patch)}comparePre(t){if(t instanceof ht||(t=new ht(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(xn("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return ar(n,i)}while(++r)}compareBuild(t){t instanceof ht||(t=new ht(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(xn("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return ar(n,i)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),ar(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var He=t_;const kc=He,r_=(e,t,r=!1)=>{if(e instanceof kc)return e;try{return new kc(e,t)}catch(n){if(!r)return null;throw n}};var Lr=r_;const n_=Lr,i_=(e,t)=>{const r=n_(e,t);return r?r.version:null};var s_=i_;const o_=Lr,a_=(e,t)=>{const r=o_(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var c_=a_;const Ic=He,l_=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Ic(e instanceof Ic?e.version:e,r).inc(t,n,i).version}catch{return null}};var u_=l_;const xc=Lr,d_=(e,t)=>{const r=xc(e,null,!0),n=xc(t,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,a=s?r:n,o=s?n:r,c=!!a.prerelease.length;if(!!o.prerelease.length&&!c)return!o.patch&&!o.minor?"major":a.patch?"patch":a.minor?"minor":"major";const f=c?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"};var h_=d_;const f_=He,p_=(e,t)=>new f_(e,t).major;var g_=p_;const __=He,m_=(e,t)=>new __(e,t).minor;var b_=m_;const y_=He,w_=(e,t)=>new y_(e,t).patch;var E_=w_;const v_=Lr,S_=(e,t)=>{const r=v_(e,t);return r&&r.prerelease.length?r.prerelease:null};var R_=S_;const Ac=He,C_=(e,t,r)=>new Ac(e,r).compare(new Ac(t,r));var ot=C_;const k_=ot,I_=(e,t,r)=>k_(t,e,r);var x_=I_;const A_=ot,T_=(e,t)=>A_(e,t,!0);var M_=T_;const Tc=He,N_=(e,t,r)=>{const n=new Tc(e,r),i=new Tc(t,r);return n.compare(i)||n.compareBuild(i)};var Xo=N_;const L_=Xo,P_=(e,t)=>e.sort((r,n)=>L_(r,n,t));var B_=P_;const O_=Xo,$_=(e,t)=>e.sort((r,n)=>O_(n,r,t));var F_=$_;const D_=ot,j_=(e,t,r)=>D_(e,t,r)>0;var Ni=j_;const U_=ot,H_=(e,t,r)=>U_(e,t,r)<0;var ea=H_;const W_=ot,V_=(e,t,r)=>W_(e,t,r)===0;var nd=V_;const z_=ot,q_=(e,t,r)=>z_(e,t,r)!==0;var id=q_;const G_=ot,J_=(e,t,r)=>G_(e,t,r)>=0;var ta=J_;const Z_=ot,K_=(e,t,r)=>Z_(e,t,r)<=0;var ra=K_;const Q_=nd,Y_=id,X_=Ni,em=ta,tm=ea,rm=ra,nm=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Q_(e,r,n);case"!=":return Y_(e,r,n);case">":return X_(e,r,n);case">=":return em(e,r,n);case"<":return tm(e,r,n);case"<=":return rm(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var sd=nm;const im=He,sm=Lr,{safeRe:Tn,t:Mn}=gn,om=(e,t)=>{if(e instanceof im)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Tn[Mn.COERCEFULL]:Tn[Mn.COERCE]);else{const c=t.includePrerelease?Tn[Mn.COERCERTLFULL]:Tn[Mn.COERCERTL];let u;for(;(u=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",a=t.includePrerelease&&r[5]?`-${r[5]}`:"",o=t.includePrerelease&&r[6]?`+${r[6]}`:"";return sm(`${n}.${i}.${s}${a}${o}`,t)};var am=om;class cm{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}}var lm=cm,Qs,Mc;function at(){if(Mc)return Qs;Mc=1;class e{constructor(O,j){if(j=n(j),O instanceof e)return O.loose===!!j.loose&&O.includePrerelease===!!j.includePrerelease?O:new e(O.raw,j);if(O instanceof i)return this.raw=O.value,this.set=[[O]],this.format(),this;if(this.options=j,this.loose=!!j.loose,this.includePrerelease=!!j.includePrerelease,this.raw=O.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(q=>this.parseRange(q.trim())).filter(q=>q.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const q=this.set[0];if(this.set=this.set.filter(V=>!E(V[0])),this.set.length===0)this.set=[q];else if(this.set.length>1){for(const V of this.set)if(V.length===1&&x(V[0])){this.set=[V];break}}}this.format()}format(){return this.range=this.set.map(O=>O.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(O){const q=((this.options.includePrerelease&&g)|(this.options.loose&&_))+":"+O,V=r.get(q);if(V)return V;const U=this.options.loose,K=U?o[c.HYPHENRANGELOOSE]:o[c.HYPHENRANGE];O=O.replace(K,Ee(this.options.includePrerelease)),s("hyphen replace",O),O=O.replace(o[c.COMPARATORTRIM],u),s("comparator trim",O),O=O.replace(o[c.TILDETRIM],f),s("tilde trim",O),O=O.replace(o[c.CARETTRIM],h),s("caret trim",O);let ne=O.split(" ").map(de=>b(de,this.options)).join(" ").split(/\s+/).map(de=>re(de,this.options));U&&(ne=ne.filter(de=>(s("loose invalid filter",de,this.options),!!de.match(o[c.COMPARATORLOOSE])))),s("range list",ne);const H=new Map,Q=ne.map(de=>new i(de,this.options));for(const de of Q){if(E(de))return[de];H.set(de.value,de)}H.size>1&&H.has("")&&H.delete("");const pe=[...H.values()];return r.set(q,pe),pe}intersects(O,j){if(!(O instanceof e))throw new TypeError("a Range is required");return this.set.some(q=>S(q,j)&&O.set.some(V=>S(V,j)&&q.every(U=>V.every(K=>U.intersects(K,j)))))}test(O){if(!O)return!1;if(typeof O=="string")try{O=new a(O,this.options)}catch{return!1}for(let j=0;j<this.set.length;j++)if(fe(this.set[j],O,this.options))return!0;return!1}}Qs=e;const t=lm,r=new t,n=Yo,i=Li(),s=Mi,a=He,{safeRe:o,t:c,comparatorTrimReplace:u,tildeTrimReplace:f,caretTrimReplace:h}=gn,{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:_}=Ti,E=$=>$.value==="<0.0.0-0",x=$=>$.value==="",S=($,O)=>{let j=!0;const q=$.slice();let V=q.pop();for(;j&&q.length;)j=q.every(U=>V.intersects(U,O)),V=q.pop();return j},b=($,O)=>(s("comp",$,O),$=A($,O),s("caret",$),$=C($,O),s("tildes",$),$=G($,O),s("xrange",$),$=F($,O),s("stars",$),$),v=$=>!$||$.toLowerCase()==="x"||$==="*",C=($,O)=>$.trim().split(/\s+/).map(j=>M(j,O)).join(" "),M=($,O)=>{const j=O.loose?o[c.TILDELOOSE]:o[c.TILDE];return $.replace(j,(q,V,U,K,ne)=>{s("tilde",$,q,V,U,K,ne);let H;return v(V)?H="":v(U)?H=`>=${V}.0.0 <${+V+1}.0.0-0`:v(K)?H=`>=${V}.${U}.0 <${V}.${+U+1}.0-0`:ne?(s("replaceTilde pr",ne),H=`>=${V}.${U}.${K}-${ne} <${V}.${+U+1}.0-0`):H=`>=${V}.${U}.${K} <${V}.${+U+1}.0-0`,s("tilde return",H),H})},A=($,O)=>$.trim().split(/\s+/).map(j=>B(j,O)).join(" "),B=($,O)=>{s("caret",$,O);const j=O.loose?o[c.CARETLOOSE]:o[c.CARET],q=O.includePrerelease?"-0":"";return $.replace(j,(V,U,K,ne,H)=>{s("caret",$,V,U,K,ne,H);let Q;return v(U)?Q="":v(K)?Q=`>=${U}.0.0${q} <${+U+1}.0.0-0`:v(ne)?U==="0"?Q=`>=${U}.${K}.0${q} <${U}.${+K+1}.0-0`:Q=`>=${U}.${K}.0${q} <${+U+1}.0.0-0`:H?(s("replaceCaret pr",H),U==="0"?K==="0"?Q=`>=${U}.${K}.${ne}-${H} <${U}.${K}.${+ne+1}-0`:Q=`>=${U}.${K}.${ne}-${H} <${U}.${+K+1}.0-0`:Q=`>=${U}.${K}.${ne}-${H} <${+U+1}.0.0-0`):(s("no pr"),U==="0"?K==="0"?Q=`>=${U}.${K}.${ne}${q} <${U}.${K}.${+ne+1}-0`:Q=`>=${U}.${K}.${ne}${q} <${U}.${+K+1}.0-0`:Q=`>=${U}.${K}.${ne} <${+U+1}.0.0-0`),s("caret return",Q),Q})},G=($,O)=>(s("replaceXRanges",$,O),$.split(/\s+/).map(j=>W(j,O)).join(" ")),W=($,O)=>{$=$.trim();const j=O.loose?o[c.XRANGELOOSE]:o[c.XRANGE];return $.replace(j,(q,V,U,K,ne,H)=>{s("xRange",$,q,V,U,K,ne,H);const Q=v(U),pe=Q||v(K),de=pe||v(ne),Me=de;return V==="="&&Me&&(V=""),H=O.includePrerelease?"-0":"",Q?V===">"||V==="<"?q="<0.0.0-0":q="*":V&&Me?(pe&&(K=0),ne=0,V===">"?(V=">=",pe?(U=+U+1,K=0,ne=0):(K=+K+1,ne=0)):V==="<="&&(V="<",pe?U=+U+1:K=+K+1),V==="<"&&(H="-0"),q=`${V+U}.${K}.${ne}${H}`):pe?q=`>=${U}.0.0${H} <${+U+1}.0.0-0`:de&&(q=`>=${U}.${K}.0${H} <${U}.${+K+1}.0-0`),s("xRange return",q),q})},F=($,O)=>(s("replaceStars",$,O),$.trim().replace(o[c.STAR],"")),re=($,O)=>(s("replaceGTE0",$,O),$.trim().replace(o[O.includePrerelease?c.GTE0PRE:c.GTE0],"")),Ee=$=>(O,j,q,V,U,K,ne,H,Q,pe,de,Me)=>(v(q)?j="":v(V)?j=`>=${q}.0.0${$?"-0":""}`:v(U)?j=`>=${q}.${V}.0${$?"-0":""}`:K?j=`>=${j}`:j=`>=${j}${$?"-0":""}`,v(Q)?H="":v(pe)?H=`<${+Q+1}.0.0-0`:v(de)?H=`<${Q}.${+pe+1}.0-0`:Me?H=`<=${Q}.${pe}.${de}-${Me}`:$?H=`<${Q}.${pe}.${+de+1}-0`:H=`<=${H}`,`${j} ${H}`.trim()),fe=($,O,j)=>{for(let q=0;q<$.length;q++)if(!$[q].test(O))return!1;if(O.prerelease.length&&!j.includePrerelease){for(let q=0;q<$.length;q++)if(s($[q].semver),$[q].semver!==i.ANY&&$[q].semver.prerelease.length>0){const V=$[q].semver;if(V.major===O.major&&V.minor===O.minor&&V.patch===O.patch)return!0}return!1}return!0};return Qs}var Ys,Nc;function Li(){if(Nc)return Ys;Nc=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(f,h){if(h=r(h),f instanceof t){if(f.loose===!!h.loose)return f;f=f.value}f=f.trim().split(/\s+/).join(" "),a("comparator",f,h),this.options=h,this.loose=!!h.loose,this.parse(f),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(f){const h=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],g=f.match(h);if(!g)throw new TypeError(`Invalid comparator: ${f}`);this.operator=g[1]!==void 0?g[1]:"",this.operator==="="&&(this.operator=""),g[2]?this.semver=new o(g[2],this.options.loose):this.semver=e}toString(){return this.value}test(f){if(a("Comparator.test",f,this.options.loose),this.semver===e||f===e)return!0;if(typeof f=="string")try{f=new o(f,this.options)}catch{return!1}return s(f,this.operator,this.semver,this.options)}intersects(f,h){if(!(f instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(f.value,h).test(this.value):f.operator===""?f.value===""?!0:new c(this.value,h).test(f.semver):(h=r(h),h.includePrerelease&&(this.value==="<0.0.0-0"||f.value==="<0.0.0-0")||!h.includePrerelease&&(this.value.startsWith("<0.0.0")||f.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&f.operator.startsWith(">")||this.operator.startsWith("<")&&f.operator.startsWith("<")||this.semver.version===f.semver.version&&this.operator.includes("=")&&f.operator.includes("=")||s(this.semver,"<",f.semver,h)&&this.operator.startsWith(">")&&f.operator.startsWith("<")||s(this.semver,">",f.semver,h)&&this.operator.startsWith("<")&&f.operator.startsWith(">")))}}Ys=t;const r=Yo,{safeRe:n,t:i}=gn,s=sd,a=Mi,o=He,c=at();return Ys}const um=at(),dm=(e,t,r)=>{try{t=new um(t,r)}catch{return!1}return t.test(e)};var Pi=dm;const hm=at(),fm=(e,t)=>new hm(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var pm=fm;const gm=He,_m=at(),mm=(e,t,r)=>{let n=null,i=null,s=null;try{s=new _m(t,r)}catch{return null}return e.forEach(a=>{s.test(a)&&(!n||i.compare(a)===-1)&&(n=a,i=new gm(n,r))}),n};var bm=mm;const ym=He,wm=at(),Em=(e,t,r)=>{let n=null,i=null,s=null;try{s=new wm(t,r)}catch{return null}return e.forEach(a=>{s.test(a)&&(!n||i.compare(a)===1)&&(n=a,i=new ym(n,r))}),n};var vm=Em;const Xs=He,Sm=at(),Lc=Ni,Rm=(e,t)=>{e=new Sm(e,t);let r=new Xs("0.0.0");if(e.test(r)||(r=new Xs("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const i=e.set[n];let s=null;i.forEach(a=>{const o=new Xs(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!s||Lc(o,s))&&(s=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!r||Lc(r,s))&&(r=s)}return r&&e.test(r)?r:null};var Cm=Rm;const km=at(),Im=(e,t)=>{try{return new km(e,t).range||"*"}catch{return null}};var xm=Im;const Am=He,od=Li(),{ANY:Tm}=od,Mm=at(),Nm=Pi,Pc=Ni,Bc=ea,Lm=ra,Pm=ta,Bm=(e,t,r,n)=>{e=new Am(e,n),t=new Mm(t,n);let i,s,a,o,c;switch(r){case">":i=Pc,s=Lm,a=Bc,o=">",c=">=";break;case"<":i=Bc,s=Pm,a=Pc,o="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Nm(e,t,n))return!1;for(let u=0;u<t.set.length;++u){const f=t.set[u];let h=null,g=null;if(f.forEach(_=>{_.semver===Tm&&(_=new od(">=0.0.0")),h=h||_,g=g||_,i(_.semver,h.semver,n)?h=_:a(_.semver,g.semver,n)&&(g=_)}),h.operator===o||h.operator===c||(!g.operator||g.operator===o)&&s(e,g.semver))return!1;if(g.operator===c&&a(e,g.semver))return!1}return!0};var na=Bm;const Om=na,$m=(e,t,r)=>Om(e,t,">",r);var Fm=$m;const Dm=na,jm=(e,t,r)=>Dm(e,t,"<",r);var Um=jm;const Oc=at(),Hm=(e,t,r)=>(e=new Oc(e,r),t=new Oc(t,r),e.intersects(t,r));var Wm=Hm;const Vm=Pi,zm=ot;var qm=(e,t,r)=>{const n=[];let i=null,s=null;const a=e.sort((f,h)=>zm(f,h,r));for(const f of a)Vm(f,t,r)?(s=f,i||(i=f)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const o=[];for(const[f,h]of n)f===h?o.push(f):!h&&f===a[0]?o.push("*"):h?f===a[0]?o.push(`<=${h}`):o.push(`${f} - ${h}`):o.push(`>=${f}`);const c=o.join(" || "),u=typeof t.raw=="string"?t.raw:String(t);return c.length<u.length?c:t};const $c=at(),ia=Li(),{ANY:eo}=ia,Br=Pi,sa=ot,Gm=(e,t,r={})=>{if(e===t)return!0;e=new $c(e,r),t=new $c(t,r);let n=!1;e:for(const i of e.set){for(const s of t.set){const a=Zm(i,s,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},Jm=[new ia(">=0.0.0-0")],Fc=[new ia(">=0.0.0")],Zm=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===eo){if(t.length===1&&t[0].semver===eo)return!0;r.includePrerelease?e=Jm:e=Fc}if(t.length===1&&t[0].semver===eo){if(r.includePrerelease)return!0;t=Fc}const n=new Set;let i,s;for(const _ of e)_.operator===">"||_.operator===">="?i=Dc(i,_,r):_.operator==="<"||_.operator==="<="?s=jc(s,_,r):n.add(_.semver);if(n.size>1)return null;let a;if(i&&s){if(a=sa(i.semver,s.semver,r),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const _ of n){if(i&&!Br(_,String(i),r)||s&&!Br(_,String(s),r))return null;for(const E of t)if(!Br(_,String(E),r))return!1;return!0}let o,c,u,f,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,g=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(const _ of t){if(f=f||_.operator===">"||_.operator===">=",u=u||_.operator==="<"||_.operator==="<=",i){if(g&&_.semver.prerelease&&_.semver.prerelease.length&&_.semver.major===g.major&&_.semver.minor===g.minor&&_.semver.patch===g.patch&&(g=!1),_.operator===">"||_.operator===">="){if(o=Dc(i,_,r),o===_&&o!==i)return!1}else if(i.operator===">="&&!Br(i.semver,String(_),r))return!1}if(s){if(h&&_.semver.prerelease&&_.semver.prerelease.length&&_.semver.major===h.major&&_.semver.minor===h.minor&&_.semver.patch===h.patch&&(h=!1),_.operator==="<"||_.operator==="<="){if(c=jc(s,_,r),c===_&&c!==s)return!1}else if(s.operator==="<="&&!Br(s.semver,String(_),r))return!1}if(!_.operator&&(s||i)&&a!==0)return!1}return!(i&&u&&!s&&a!==0||s&&f&&!i&&a!==0||g||h)},Dc=(e,t,r)=>{if(!e)return t;const n=sa(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},jc=(e,t,r)=>{if(!e)return t;const n=sa(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var Km=Gm;const to=gn,Uc=Ti,Qm=He,Hc=rd,Ym=Lr,Xm=s_,eb=c_,tb=u_,rb=h_,nb=g_,ib=b_,sb=E_,ob=R_,ab=ot,cb=x_,lb=M_,ub=Xo,db=B_,hb=F_,fb=Ni,pb=ea,gb=nd,_b=id,mb=ta,bb=ra,yb=sd,wb=am,Eb=Li(),vb=at(),Sb=Pi,Rb=pm,Cb=bm,kb=vm,Ib=Cm,xb=xm,Ab=na,Tb=Fm,Mb=Um,Nb=Wm,Lb=qm,Pb=Km;var Bb={parse:Ym,valid:Xm,clean:eb,inc:tb,diff:rb,major:nb,minor:ib,patch:sb,prerelease:ob,compare:ab,rcompare:cb,compareLoose:lb,compareBuild:ub,sort:db,rsort:hb,gt:fb,lt:pb,eq:gb,neq:_b,gte:mb,lte:bb,cmp:yb,coerce:wb,Comparator:Eb,Range:vb,satisfies:Sb,toComparators:Rb,maxSatisfying:Cb,minSatisfying:kb,minVersion:Ib,validRange:xb,outside:Ab,gtr:Tb,ltr:Mb,intersects:Nb,simplifyRange:Lb,subset:Pb,SemVer:Qm,re:to.re,src:to.src,tokens:to.t,SEMVER_SPEC_VERSION:Uc.SEMVER_SPEC_VERSION,RELEASE_TYPES:Uc.RELEASE_TYPES,compareIdentifiers:Hc.compareIdentifiers,rcompareIdentifiers:Hc.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=Bb,r=tr,n=Oe;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",h=>(0,t.valid)(h)===null?`Expected SemVer version, got "${h}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",h=>(0,t.validRange)(h)===null?`Expected SemVer range, got "${h}"`:!0);function i(h){return(0,r.is)(h,e.VersionStruct)}e.isValidSemVerVersion=i;function s(h){return(0,r.is)(h,e.VersionRangeStruct)}e.isValidSemVerRange=s;function a(h){(0,n.assertStruct)(h,e.VersionStruct)}e.assertIsSemVerVersion=a;function o(h){(0,n.assertStruct)(h,e.VersionRangeStruct)}e.assertIsSemVerRange=o;function c(h,g){return(0,t.gt)(h,g)}e.gtVersion=c;function u(h,g){return(0,t.gtr)(h,g)}e.gtRange=u;function f(h,g){return(0,t.satisfies)(h,g,{includePrerelease:!0})}e.satisfiesVersionRange=f})(Xu);(function(e){var t=Z&&Z.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=Z&&Z.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Oe,e),r(fn,e),r(ue,e),r(xi,e),r(bt,e),r(Er,e),r(qu,e),r(pn,e),r(Gu,e),r(Ju,e),r(vr,e),r(Zu,e),r(yt,e),r(Ku,e),r(Qu,e),r(Yu,e),r(Xu,e)})(Iu);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Iu;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(ku);var ad=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ki,"__esModule",{value:!0});ki.PollingBlockTracker=void 0;const Ob=ad(Wo),$b=ad(c1),Fb=ln,Wc=ku,Vc=(0,Wc.createModuleLogger)(Wc.projectLogger,"polling-block-tracker"),Db=(0,Ob.default)(),jb=1e3;class Ub extends Fb.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*jb,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=zc(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
|
|
8
|
+
${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=zc(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:Db(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),Vc("Making request",t);const r=await(0,$b.default)(n=>this._provider.sendAsync(t,n))();if(Vc("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
9
|
+
${r.error.message}`);return r.result}}ki.PollingBlockTracker=Ub;function zc(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var Bi={},Hb=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.SubscribeBlockTracker=void 0;const Wb=Hb(Wo),Vb=ln,zb=(0,Wb.default)();class qb extends Vb.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:zb(),method:t,params:r,jsonrpc:"2.0"},(s,a)=>{s?i(s):n(a.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}Bi.SubscribeBlockTracker=qb;(function(e){var t=Z&&Z.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=Z&&Z.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(ki,e),r(Bi,e)})(Cu);var oa={},Oi={},_n={};Object.defineProperty(_n,"__esModule",{value:!0});_n.getUniqueId=void 0;const cd=4294967295;let ro=Math.floor(Math.random()*cd);function Gb(){return ro=(ro+1)%cd,ro}_n.getUniqueId=Gb;Object.defineProperty(Oi,"__esModule",{value:!0});Oi.createIdRemapMiddleware=void 0;const Jb=_n;function Zb(){return(e,t,r,n)=>{const i=e.id,s=Jb.getUniqueId();e.id=s,t.id=s,r(a=>{e.id=i,t.id=i,a()})}}Oi.createIdRemapMiddleware=Zb;var $i={};Object.defineProperty($i,"__esModule",{value:!0});$i.createAsyncMiddleware=void 0;function Kb(e){return async(t,r,n,i)=>{let s;const a=new Promise(f=>{s=f});let o=null,c=!1;const u=async()=>{c=!0,n(f=>{o=f,s()}),await a};try{await e(t,r,u),c?(await a,o(null)):i(null)}catch(f){o?o(f):i(f)}}}$i.createAsyncMiddleware=Kb;var Fi={};Object.defineProperty(Fi,"__esModule",{value:!0});Fi.createScaffoldMiddleware=void 0;function Qb(e){return(t,r,n,i)=>{const s=e[t.method];return s===void 0?n():typeof s=="function"?s(t,r,n,i):(r.result=s,i())}}Fi.createScaffoldMiddleware=Qb;var mn={},aa={};Object.defineProperty(aa,"__esModule",{value:!0});const Yb=Gn;function qc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Xb(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let ey=class extends Yb.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;const o=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw o.context=a,o}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")qc(s,this,r);else{const a=s.length,o=Xb(s);for(let c=0;c<a;c+=1)qc(o[c],this,r)}return!0}};aa.default=ey;var ld={},Pt={},ty=zr;zr.default=zr;zr.stable=hd;zr.stableStringify=hd;var Un="[...]",ud="[Circular]",Jt=[],Vt=[];function dd(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function zr(e,t,r,n){typeof n>"u"&&(n=dd()),vo(e,"",0,[],void 0,0,n);var i;try{Vt.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,fd(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Jt.length!==0;){var s=Jt.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function pr(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),Jt.push([n,r,t,i])):Vt.push([t,r,e]):(n[r]=e,Jt.push([n,r,t]))}function vo(e,t,r,n,i,s,a){s+=1;var o;if(typeof e=="object"&&e!==null){for(o=0;o<n.length;o++)if(n[o]===e){pr(ud,e,t,i);return}if(typeof a.depthLimit<"u"&&s>a.depthLimit){pr(Un,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){pr(Un,e,t,i);return}if(n.push(e),Array.isArray(e))for(o=0;o<e.length;o++)vo(e[o],o,o,n,e,s,a);else{var c=Object.keys(e);for(o=0;o<c.length;o++){var u=c[o];vo(e[u],u,o,n,e,s,a)}}n.pop()}}function ry(e,t){return e<t?-1:e>t?1:0}function hd(e,t,r,n){typeof n>"u"&&(n=dd());var i=So(e,"",0,[],void 0,0,n)||e,s;try{Vt.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,fd(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Jt.length!==0;){var a=Jt.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return s}function So(e,t,r,n,i,s,a){s+=1;var o;if(typeof e=="object"&&e!==null){for(o=0;o<n.length;o++)if(n[o]===e){pr(ud,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof a.depthLimit<"u"&&s>a.depthLimit){pr(Un,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){pr(Un,e,t,i);return}if(n.push(e),Array.isArray(e))for(o=0;o<e.length;o++)So(e[o],o,o,n,e,s,a);else{var c={},u=Object.keys(e).sort(ry);for(o=0;o<u.length;o++){var f=u[o];So(e[f],f,o,n,e,s,a),c[f]=e[f]}if(typeof i<"u")Jt.push([i,t,e]),i[t]=c;else return c}n.pop()}}function fd(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(Vt.length>0)for(var n=0;n<Vt.length;n++){var i=Vt[n];if(i[1]===t&&i[0]===r){r=i[2],Vt.splice(n,1);break}}return e.call(this,t,r)}}Object.defineProperty(Pt,"__esModule",{value:!0});Pt.EthereumProviderError=Pt.EthereumRpcError=void 0;const ny=ty;class pd extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return ny.default(this.serialize(),oy,2)}}Pt.EthereumRpcError=pd;class iy extends pd{constructor(t,r,n){if(!sy(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Pt.EthereumProviderError=iy;function sy(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function oy(e,t){if(t!=="[Circular]")return t}var ca={},Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.errorValues=Bt.errorCodes=void 0;Bt.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}};Bt.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(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Bt,r=Pt,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:a(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function a(g,_=i){if(Number.isInteger(g)){const E=g.toString();if(h(t.errorValues,E))return t.errorValues[E].message;if(u(g))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return _}e.getMessageFromCode=a;function o(g){if(!Number.isInteger(g))return!1;const _=g.toString();return!!(t.errorValues[_]||u(g))}e.isValidCode=o;function c(g,{fallbackError:_=s,shouldIncludeStack:E=!1}={}){var x,S;if(!_||!Number.isInteger(_.code)||typeof _.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(g instanceof r.EthereumRpcError)return g.serialize();const b={};if(g&&typeof g=="object"&&!Array.isArray(g)&&h(g,"code")&&o(g.code)){const C=g;b.code=C.code,C.message&&typeof C.message=="string"?(b.message=C.message,h(C,"data")&&(b.data=C.data)):(b.message=a(b.code),b.data={originalError:f(g)})}else{b.code=_.code;const C=(x=g)===null||x===void 0?void 0:x.message;b.message=C&&typeof C=="string"?C:_.message,b.data={originalError:f(g)}}const v=(S=g)===null||S===void 0?void 0:S.stack;return E&&g&&v&&typeof v=="string"&&(b.stack=v),b}e.serializeError=c;function u(g){return g>=-32099&&g<=-32e3}function f(g){return g&&typeof g=="object"&&!Array.isArray(g)?Object.assign({},g):g}function h(g,_){return Object.prototype.hasOwnProperty.call(g,_)}})(ca);var Di={};Object.defineProperty(Di,"__esModule",{value:!0});Di.ethErrors=void 0;const la=Pt,gd=ca,Fe=Bt;Di.ethErrors={rpc:{parse:e=>Ze(Fe.errorCodes.rpc.parse,e),invalidRequest:e=>Ze(Fe.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Ze(Fe.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Ze(Fe.errorCodes.rpc.methodNotFound,e),internal:e=>Ze(Fe.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ze(t,e)},invalidInput:e=>Ze(Fe.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Ze(Fe.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Ze(Fe.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Ze(Fe.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Ze(Fe.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Ze(Fe.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Or(Fe.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>Or(Fe.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>Or(Fe.errorCodes.provider.unsupportedMethod,e),disconnected:e=>Or(Fe.errorCodes.provider.disconnected,e),chainDisconnected:e=>Or(Fe.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new la.EthereumProviderError(t,r,n)}}};function Ze(e,t){const[r,n]=_d(t);return new la.EthereumRpcError(e,r||gd.getMessageFromCode(e),n)}function Or(e,t){const[r,n]=_d(t);return new la.EthereumProviderError(e,r||gd.getMessageFromCode(e),n)}function _d(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Pt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=ca;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Di;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Bt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(ld);var ay=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mn,"__esModule",{value:!0});mn.JsonRpcEngine=void 0;const cy=ay(aa),Ke=ld;class vt extends cy.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{const[s,a,o]=await vt._runAllMiddleware(t,r,this._middleware);return a?(await vt._runReturnHandlers(o),i(s)):n(async c=>{try{await vt._runReturnHandlers(o)}catch(u){return c(u)}return c()})}catch(s){return i(s)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const a=new Ke.EthereumRpcError(Ke.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(a,{id:void 0,jsonrpc:"2.0",error:a})}if(typeof t.method!="string"){const a=new Ke.EthereumRpcError(Ke.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(a,{id:t.id,jsonrpc:"2.0",error:a})}const n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(a){s=a}return s&&(delete i.result,i.error||(i.error=Ke.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await vt._runAllMiddleware(t,r,this._middleware);if(vt._checkForCompletion(t,r,i),await vt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,a=!1;for(const o of n)if([s,a]=await vt._runMiddleware(t,r,o,i),a)break;return[s,a,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const a=c=>{const u=c||r.error;u&&(r.error=Ke.serializeError(u)),s([u,!0])},o=c=>{r.error?a(r.error):(c&&(typeof c!="function"&&a(new Ke.EthereumRpcError(Ke.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request:
|
|
10
|
+
${no(t)}`,{request:t})),i.push(c)),s([null,!1]))};try{n(t,r,o,a)}catch(c){a(c)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new Ke.EthereumRpcError(Ke.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
|
|
11
|
+
${no(t)}`,{request:t});if(!n)throw new Ke.EthereumRpcError(Ke.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
|
|
12
|
+
${no(t)}`,{request:t})}}mn.JsonRpcEngine=vt;function no(e){return JSON.stringify(e,null,2)}var ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.mergeMiddleware=void 0;const ly=mn;function uy(e){const t=new ly.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}ji.mergeMiddleware=uy;(function(e){var t=Z&&Z.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=Z&&Z.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Oi,e),r($i,e),r(Fi,e),r(_n,e),r(mn,e),r(ji,e)})(oa);var md={},ua={},Ro=function(e,t){return Ro=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ro(e,t)};function bd(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ro(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Hn=function(){return Hn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Hn.apply(this,arguments)};function yd(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function wd(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function Ed(e,t){return function(r,n){t(r,n,e)}}function dy(e,t,r,n,i,s){function a(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var o=n.kind,c=o==="getter"?"get":o==="setter"?"set":"value",u=!t&&e?n.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),h,g=!1,_=r.length-1;_>=0;_--){var E={};for(var x in n)E[x]=x==="access"?{}:n[x];for(var x in n.access)E.access[x]=n.access[x];E.addInitializer=function(b){if(g)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(b||null))};var S=(0,r[_])(o==="accessor"?{get:f.get,set:f.set}:f[c],E);if(o==="accessor"){if(S===void 0)continue;if(S===null||typeof S!="object")throw new TypeError("Object expected");(h=a(S.get))&&(f.get=h),(h=a(S.set))&&(f.set=h),(h=a(S.init))&&i.unshift(h)}else(h=a(S))&&(o==="field"?i.unshift(h):f[c]=h)}u&&Object.defineProperty(u,n.name,f),g=!0}function hy(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function fy(e){return typeof e=="symbol"?e:"".concat(e)}function py(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function vd(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Sd(e,t,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(f){try{u(n.next(f))}catch(h){a(h)}}function c(f){try{u(n.throw(f))}catch(h){a(h)}}function u(f){f.done?s(f.value):i(f.value).then(o,c)}u((n=n.apply(e,t||[])).next())})}function Rd(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(f){return c([u,f])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(r=0)),r;)try{if(n=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 r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(f){u=[6,f],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Ui=Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]};function Cd(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Ui(t,e,r)}function Wn(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function da(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){a={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s}function kd(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(da(arguments[t]));return e}function Id(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var s=arguments[t],a=0,o=s.length;a<o;a++,i++)n[i]=s[a];return n}function xd(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}function Sr(e){return this instanceof Sr?(this.v=e,this):new Sr(e)}function Ad(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,s=[];return i={},o("next"),o("throw"),o("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(_){return function(E){return Promise.resolve(E).then(_,h)}}function o(_,E){n[_]&&(i[_]=function(x){return new Promise(function(S,b){s.push([_,x,S,b])>1||c(_,x)})},E&&(i[_]=E(i[_])))}function c(_,E){try{u(n[_](E))}catch(x){g(s[0][3],x)}}function u(_){_.value instanceof Sr?Promise.resolve(_.value.v).then(f,h):g(s[0][2],_)}function f(_){c("next",_)}function h(_){c("throw",_)}function g(_,E){_(E),s.shift(),s.length&&c(s[0][0],s[0][1])}}function Td(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,s){t[i]=e[i]?function(a){return(r=!r)?{value:Sr(e[i](a)),done:!1}:s?s(a):a}:s}}function Md(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Wn=="function"?Wn(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(a){return new Promise(function(o,c){a=e[s](a),i(o,c,a.done,a.value)})}}function i(s,a,o,c){Promise.resolve(c).then(function(u){s({value:u,done:o})},a)}}function Nd(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var gy=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function Ld(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Ui(t,e,r);return gy(t,e),t}function Pd(e){return e&&e.__esModule?e:{default:e}}function Bd(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Od(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r}function $d(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function Fd(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var _y=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function Dd(e){function t(n){e.error=e.hasError?new _y(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}function r(){for(;e.stack.length;){var n=e.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return t(s),r()})}catch(s){t(s)}}if(e.hasError)throw e.error}return r()}const my={__extends:bd,__assign:Hn,__rest:yd,__decorate:wd,__param:Ed,__metadata:vd,__awaiter:Sd,__generator:Rd,__createBinding:Ui,__exportStar:Cd,__values:Wn,__read:da,__spread:kd,__spreadArrays:Id,__spreadArray:xd,__await:Sr,__asyncGenerator:Ad,__asyncDelegator:Td,__asyncValues:Md,__makeTemplateObject:Nd,__importStar:Ld,__importDefault:Pd,__classPrivateFieldGet:Bd,__classPrivateFieldSet:Od,__classPrivateFieldIn:$d,__addDisposableResource:Fd,__disposeResources:Dd},by=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Fd,get __assign(){return Hn},__asyncDelegator:Td,__asyncGenerator:Ad,__asyncValues:Md,__await:Sr,__awaiter:Sd,__classPrivateFieldGet:Bd,__classPrivateFieldIn:$d,__classPrivateFieldSet:Od,__createBinding:Ui,__decorate:wd,__disposeResources:Dd,__esDecorate:dy,__exportStar:Cd,__extends:bd,__generator:Rd,__importDefault:Pd,__importStar:Ld,__makeTemplateObject:Nd,__metadata:vd,__param:Ed,__propKey:fy,__read:da,__rest:yd,__runInitializers:hy,__setFunctionName:py,__spread:kd,__spreadArray:xd,__spreadArrays:Id,__values:Wn,default:my},Symbol.toStringTag,{value:"Module"})),ha=qn(by);var Hi={};Object.defineProperty(Hi,"__esModule",{value:!0});var Gc=ha,yy=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(i){return t._queue.push(i)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return Gc.__awaiter(this,void 0,void 0,function(){var r,n,i;return Gc.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.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 t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();Hi.default=yy;Object.defineProperty(ua,"__esModule",{value:!0});var Jc=ha,wy=Hi,Ey=function(){function e(){this._semaphore=new wy.default(1)}return e.prototype.acquire=function(){return Jc.__awaiter(this,void 0,void 0,function(){var t,r;return Jc.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();ua.default=Ey;var Wi={};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.withTimeout=void 0;var Nn=ha;function vy(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return Nn.__awaiter(n,void 0,void 0,function(){var a,o,c;return Nn.__generator(this,function(u){switch(u.label){case 0:return a=!1,setTimeout(function(){a=!0,s(r)},t),[4,e.acquire()];case 1:return o=u.sent(),a?(c=Array.isArray(o)?o[1]:o,c()):i(o),[2]}})})})},runExclusive:function(i){return Nn.__awaiter(this,void 0,void 0,function(){var s,a;return Nn.__generator(this,function(o){switch(o.label){case 0:s=function(){},o.label=1;case 1:return o.trys.push([1,,7,8]),[4,this.acquire()];case 2:return a=o.sent(),Array.isArray(a)?(s=a[1],[4,i(a[0])]):[3,4];case 3:return[2,o.sent()];case 4:return s=a,[4,i()];case 5:return[2,o.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}Wi.withTimeout=vy;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=ua;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=Hi;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Wi;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(md);var Sy=Cy,Ry=Object.prototype.hasOwnProperty;function Cy(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)Ry.call(r,n)&&(e[n]=r[n])}return e}const ky=Sy,Iy=Wo();var xy=Y;function Y(e){const t=this;t.currentProvider=e}Y.prototype.getBalance=bn(2,"eth_getBalance");Y.prototype.getCode=bn(2,"eth_getCode");Y.prototype.getTransactionCount=bn(2,"eth_getTransactionCount");Y.prototype.getStorageAt=bn(3,"eth_getStorageAt");Y.prototype.call=bn(2,"eth_call");Y.prototype.protocolVersion=oe("eth_protocolVersion");Y.prototype.syncing=oe("eth_syncing");Y.prototype.coinbase=oe("eth_coinbase");Y.prototype.mining=oe("eth_mining");Y.prototype.hashrate=oe("eth_hashrate");Y.prototype.gasPrice=oe("eth_gasPrice");Y.prototype.accounts=oe("eth_accounts");Y.prototype.blockNumber=oe("eth_blockNumber");Y.prototype.getBlockTransactionCountByHash=oe("eth_getBlockTransactionCountByHash");Y.prototype.getBlockTransactionCountByNumber=oe("eth_getBlockTransactionCountByNumber");Y.prototype.getUncleCountByBlockHash=oe("eth_getUncleCountByBlockHash");Y.prototype.getUncleCountByBlockNumber=oe("eth_getUncleCountByBlockNumber");Y.prototype.sign=oe("eth_sign");Y.prototype.sendTransaction=oe("eth_sendTransaction");Y.prototype.sendRawTransaction=oe("eth_sendRawTransaction");Y.prototype.estimateGas=oe("eth_estimateGas");Y.prototype.getBlockByHash=oe("eth_getBlockByHash");Y.prototype.getBlockByNumber=oe("eth_getBlockByNumber");Y.prototype.getTransactionByHash=oe("eth_getTransactionByHash");Y.prototype.getTransactionByBlockHashAndIndex=oe("eth_getTransactionByBlockHashAndIndex");Y.prototype.getTransactionByBlockNumberAndIndex=oe("eth_getTransactionByBlockNumberAndIndex");Y.prototype.getTransactionReceipt=oe("eth_getTransactionReceipt");Y.prototype.getUncleByBlockHashAndIndex=oe("eth_getUncleByBlockHashAndIndex");Y.prototype.getUncleByBlockNumberAndIndex=oe("eth_getUncleByBlockNumberAndIndex");Y.prototype.getCompilers=oe("eth_getCompilers");Y.prototype.compileLLL=oe("eth_compileLLL");Y.prototype.compileSolidity=oe("eth_compileSolidity");Y.prototype.compileSerpent=oe("eth_compileSerpent");Y.prototype.newFilter=oe("eth_newFilter");Y.prototype.newBlockFilter=oe("eth_newBlockFilter");Y.prototype.newPendingTransactionFilter=oe("eth_newPendingTransactionFilter");Y.prototype.uninstallFilter=oe("eth_uninstallFilter");Y.prototype.getFilterChanges=oe("eth_getFilterChanges");Y.prototype.getFilterLogs=oe("eth_getFilterLogs");Y.prototype.getLogs=oe("eth_getLogs");Y.prototype.getWork=oe("eth_getWork");Y.prototype.submitWork=oe("eth_submitWork");Y.prototype.submitHashrate=oe("eth_submitHashrate");Y.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(Ay(e),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return t(n);t(null,i.result)})};function oe(e){return function(){const t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function bn(e,t){return function(){const r=this;var n=[].slice.call(arguments),i=n.pop();n.length<e&&n.push("latest"),r.sendAsync({method:t,params:n},i)}}function Ay(e){return ky({id:Iy(),jsonrpc:"2.0",params:[]},e)}const Zc=(e,t,r,n)=>function(...i){const s=t.promiseModule;return new s((a,o)=>{t.multiArgs?i.push((...u)=>{t.errorFirst?u[0]?o(u):(u.shift(),a(u)):a(u)}):t.errorFirst?i.push((u,f)=>{u?o(u):a(f)}):i.push(a),Reflect.apply(e,this===r?n:this,i)})},Kc=new WeakMap;var Ty=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(a,o)=>{let c=Kc.get(a);if(c||(c={},Kc.set(a,c)),o in c)return c[o];const u=E=>typeof E=="string"||typeof o=="symbol"?o===E:E.test(o),f=Reflect.getOwnPropertyDescriptor(a,o),h=f===void 0||f.writable||f.configurable,_=(t.include?t.include.some(u):!t.exclude.some(u))&&h;return c[o]=_,_},i=new WeakMap,s=new Proxy(e,{apply(a,o,c){const u=i.get(a);if(u)return Reflect.apply(u,o,c);const f=t.excludeMain?a:Zc(a,t,s,a);return i.set(a,f),Reflect.apply(f,o,c)},get(a,o){const c=a[o];if(!n(a,o)||c===Function.prototype[o])return c;const u=i.get(c);if(u)return u;if(typeof c=="function"){const f=Zc(c,t,s,a);return i.set(c,f),f}return c}});return s};const My=un.default;let Ny=class extends My{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var fa=Ny;const Ly=fa;let Py=class extends Ly{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var By=Py,yn={minBlockRef:Oy,maxBlockRef:$y,sortBlockRefs:pa,bnToHex:Fy,blockRefIsNumber:Dy,hexToInt:Vn,incrementHexInt:jy,intToHex:jd,unsafeRandomBytes:Uy};function Oy(...e){return pa(e)[0]}function $y(...e){const t=pa(e);return t[t.length-1]}function pa(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:Vn(t)-Vn(r))}function Fy(e){return"0x"+e.toString(16)}function Dy(e){return e&&!["earliest","latest","pending"].includes(e)}function Vn(e){return e==null?e:Number.parseInt(e,16)}function jy(e){if(e==null)return e;const t=Vn(e);return jd(t+1)}function jd(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function Uy(e){let t="0x";for(let r=0;r<e;r++)t+=Qc(),t+=Qc();return t}function Qc(){return Math.floor(Math.random()*16).toString(16)}const Hy=xy,Wy=Ty,Vy=By,{bnToHex:n2,hexToInt:Ln,incrementHexInt:zy,minBlockRef:qy,blockRefIsNumber:Gy}=yn;let Jy=class extends Vy{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new Hy(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=qy(this.params.toBlock,t),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:t,newBlock:r}){const n=r;let i;t?i=zy(t):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),o=(await this._fetchLogs(s)).filter(c=>this.matchLog(c));this.addResults(o)}async _fetchLogs(t){return await Wy(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(Ln(this.params.fromBlock)>=Ln(t.blockNumber)||Gy(this.params.toBlock)&&Ln(this.params.toBlock)<=Ln(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let a=t.topics[s];if(!a)return!1;a=a.toLowerCase();let o=Array.isArray(i)?i:[i];return o.includes(null)?!0:(o=o.map(f=>f.toLowerCase()),o.includes(a))})}};var Zy=Jy,ga=Ky;async function Ky({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=Yc(t),s=Yc(r)-n+1,a=Array(s).fill().map((c,u)=>n+u).map(Qy);let o=await Promise.all(a.map(c=>Xy(e,"eth_getBlockByNumber",[c,!1])));return o=o.filter(c=>c!==null),o}function Yc(e){return e==null?e:Number.parseInt(e,16)}function Qy(e){return e==null?e:"0x"+e.toString(16)}function Yy(e,t){return new Promise((r,n)=>{e.sendAsync(t,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function Xy(e,t,r){for(let n=0;n<3;n++)try{return await Yy(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const ew=fa,tw=ga,{incrementHexInt:rw}=yn;let nw=class extends ew{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=rw(t),a=(await tw({provider:this.provider,fromBlock:i,toBlock:n})).map(o=>o.hash);this.addResults(a)}};var iw=nw;const sw=fa,ow=ga,{incrementHexInt:aw}=yn;let cw=class extends sw{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=aw(t),i=await ow({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const a of i)s.push(...a.transactions);this.addResults(s)}};var lw=cw;const uw=md.Mutex,{createAsyncMiddleware:dw,createScaffoldMiddleware:hw}=oa,fw=Zy,pw=iw,gw=lw,{intToHex:Ud,hexToInt:io}=yn;var _w=mw;function mw({blockTracker:e,provider:t}){let r=0,n={};const i=new uw,s=bw({mutex:i}),a=hw({eth_newFilter:s(so(c)),eth_newBlockFilter:s(so(u)),eth_newPendingTransactionFilter:s(so(f)),eth_uninstallFilter:s(Fn(_)),eth_getFilterChanges:s(Fn(h)),eth_getFilterLogs:s(Fn(g))}),o=async({oldBlock:v,newBlock:C})=>{if(n.length===0)return;const M=await i.acquire();try{await Promise.all(cr(n).map(async A=>{try{await A.update({oldBlock:v,newBlock:C})}catch(B){console.error(B)}}))}catch(A){console.error(A)}M()};return a.newLogFilter=c,a.newBlockFilter=u,a.newPendingTransactionFilter=f,a.uninstallFilter=_,a.getFilterChanges=h,a.getFilterLogs=g,a.destroy=()=>{S()},a;async function c(v){const C=new fw({provider:t,params:v});return await E(C),C}async function u(){const v=new pw({provider:t});return await E(v),v}async function f(){const v=new gw({provider:t});return await E(v),v}async function h(v){const C=io(v),M=n[C];if(!M)throw new Error(`No filter for index "${C}"`);return M.getChangesAndClear()}async function g(v){const C=io(v),M=n[C];if(!M)throw new Error(`No filter for index "${C}"`);let A=[];return M.type==="log"&&(A=M.getAllResults()),A}async function _(v){const C=io(v),A=!!n[C];return A&&await x(C),A}async function E(v){const C=cr(n).length,M=await e.getLatestBlock();await v.initialize({currentBlock:M}),r++,n[r]=v,v.id=r,v.idHex=Ud(r);const A=cr(n).length;return b({prevFilterCount:C,newFilterCount:A}),r}async function x(v){const C=cr(n).length;delete n[v];const M=cr(n).length;b({prevFilterCount:C,newFilterCount:M})}async function S(){const v=cr(n).length;n={},b({prevFilterCount:v,newFilterCount:0})}function b({prevFilterCount:v,newFilterCount:C}){if(v===0&&C>0){e.on("sync",o);return}if(v>0&&C===0){e.removeListener("sync",o);return}}}function so(e){return Fn(async(...t)=>{const r=await e(...t);return Ud(r.id)})}function Fn(e){return dw(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function bw({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function cr(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const yw=un.default,{createAsyncMiddleware:Xc,createScaffoldMiddleware:ww}=oa,Ew=_w,{unsafeRandomBytes:vw,incrementHexInt:Sw}=yn,Rw=ga;var Cw=kw;function kw({blockTracker:e,provider:t}){const r={},n=Ew({blockTracker:e,provider:t});let i=!1;const s=new yw,a=ww({eth_subscribe:Xc(o),eth_unsubscribe:Xc(c)});return a.destroy=f,{events:s,middleware:a};async function o(h,g){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const _=h.params[0],E=vw(16);let x;switch(_){case"newHeads":x=S({subId:E});break;case"logs":const v=h.params[1],C=await n.newLogFilter(v);x=b({subId:E,filter:C});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${_}"`)}r[E]=x,g.result=E;return;function S({subId:v}){const C={type:_,destroy:async()=>{e.removeListener("sync",C.update)},update:async({oldBlock:M,newBlock:A})=>{const B=A,G=Sw(M);(await Rw({provider:t,fromBlock:G,toBlock:B})).map(Iw).filter(re=>re!==null).forEach(re=>{u(v,re)})}};return e.on("sync",C.update),C}function b({subId:v,filter:C}){return C.on("update",A=>u(v,A)),{type:_,destroy:async()=>await n.uninstallFilter(C.idHex)}}}async function c(h,g){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const _=h.params[0],E=r[_];if(!E){g.result=!1;return}delete r[_],await E.destroy(),g.result=!0}function u(h,g){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:h,result:g}})}function f(){s.removeAllListeners();for(const h in r)r[h].destroy(),delete r[h];i=!0}}function Iw(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(Ci,"__esModule",{value:!0});Ci.SubscriptionManager=void 0;const xw=Cu,Aw=Cw,el=()=>{};class Tw{constructor(t){const r=new xw.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=Aw({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,el,el),r}destroy(){this.subscriptionMiddleware.destroy()}}Ci.SubscriptionManager=Tw;var Hd=Z&&Z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gr,"__esModule",{value:!0});gr.CoinbaseWalletProvider=void 0;const Mw=Hd(zn),Nw=Eh,ce=Gr,ie=z,Lw=Qr,tl=Ye,Pn=Ir,ze=Rr,oo=Hd(n1),$r=kr,Pw=wr,Bw=Ci,rl="DefaultChainId",nl="DefaultJsonRpcUrl";class Ow extends Nw.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new Pw.FilterPolyfill(this),this._subscriptionManager=new Bw.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const i=this.getChainId(),s=(0,ie.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const a=this._storage.getItem(tl.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const o=a.split(" ");o[0]!==""&&(this._addresses=o.map(c=>(0,ie.ensureAddressString)(c)),this.emit("accountsChanged",o))}this._subscriptionManager.events.on("notification",o=>{this.emit("message",{type:o.method,data:o.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",o=>{var c;if(!(o.origin!==location.origin||o.source!==window)&&o.data.type==="walletLinkMessage"&&o.data.data.action==="dappChainSwitched"){const u=o.data.data.chainId,f=(c=o.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;this.updateProviderInfo(f,Number(u))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,ie.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 t;return(t=this._storage.getItem(nl))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(nl,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(rl,r.toString(10)),((0,ie.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,s,a){const c=await(await this.initializeRelay()).watchAsset(t,r,n,i,s,a==null?void 0:a.toString()).promise;return(0,ze.isErrorResponse)(c)?!1:!!c.result}async addEthereumChain(t,r,n,i,s,a){var o,c;if((0,ie.ensureIntNumber)(t)===this.getChainId())return!1;const u=await this.initializeRelay(),f=u.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!f&&await u.requestEthereumAccounts().promise;const h=await u.addEthereumChain(t.toString(),r,s,n,i,a).promise;return(0,ze.isErrorResponse)(h)?!1:(((o=h.result)===null||o===void 0?void 0:o.isApproved)===!0&&this.updateProviderInfo(r[0],t),((c=h.result)===null||c===void 0?void 0:c.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,ze.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===ce.standardErrorCodes.provider.unsupportedChain?ce.standardErrors.provider.unsupportedChain():ce.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log($r.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?Pn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(i=>{throw(0,ce.serializeError)(i,t)})}catch(n){throw(0,ce.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const i=t,s=Array.isArray(r)?r:r!==void 0?[r]:[],a={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(a).then(o=>o.result)}if(typeof r=="function"){const i=t,s=r;return this._sendAsync(i,s)}if(Array.isArray(t))return t.map(s=>this._sendRequest(s));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,ce.serializeError)(n,t)})}catch(n){return Promise.reject((0,ce.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const i=r;this._sendMultipleRequestsAsync(t).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(t).then(i=>n(null,i)).catch(i=>n(i,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,ce.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,ce.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw ce.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw ce.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw ce.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(t){const n=await(await this.initializeRelay()).scanQRCode((0,ie.ensureRegExpString)(t)).promise;if((0,ze.isErrorResponse)(n))throw(0,ce.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,ce.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const i=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,ze.isErrorResponse)(i))throw(0,ce.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,ce.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log($r.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?Pn.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof Lw.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,ze.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?ce.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,ze.isErrorResponse)(n))throw(0,ce.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,ce.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(i=>(0,ie.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(tl.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});const s=this._handleAsynchronousFilterMethods(t);if(s!==void 0){s.then(o=>r(Object.assign(Object.assign({},o),{id:t.id}))).catch(o=>n(o));return}const a=this._handleSubscriptionMethods(t);if(a!==void 0){a.then(o=>r({jsonrpc:"2.0",id:t.id,result:o.result})).catch(o=>n(o));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).catch(s=>{var a;throw(s.code===ce.standardErrorCodes.rpc.methodNotFound||s.code===ce.standardErrorCodes.rpc.methodNotSupported)&&((a=this.diagnostic)===null||a===void 0||a.log($r.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?Pn.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,ie.ensureAddressString)(t);return this._addresses.map(i=>(0,ie.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log($r.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,ie.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,ie.ensureAddressString)(t.to):null,i=t.value!=null?(0,ie.ensureBN)(t.value):new Mw.default(0),s=t.data?(0,ie.ensureBuffer)(t.data):se.alloc(0),a=t.nonce!=null?(0,ie.ensureIntNumber)(t.nonce):null,o=t.gasPrice!=null?(0,ie.ensureBN)(t.gasPrice):null,c=t.maxFeePerGas!=null?(0,ie.ensureBN)(t.maxFeePerGas):null,u=t.maxPriorityFeePerGas!=null?(0,ie.ensureBN)(t.maxPriorityFeePerGas):null,f=t.gas!=null?(0,ie.ensureBN)(t.gas):null,h=t.chainId?(0,ie.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:a,gasPriceInWei:o,maxFeePerGas:c,maxPriorityFeePerGas:u,gasLimit:f,chainId:h}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw ce.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw ce.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{const a=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;if((0,ze.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?ce.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(t,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,ze.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,ie.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(rl);if(!t)return(0,ie.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,ie.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log($r.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?Pn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,ze.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ce.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,ie.ensureAddressString)(t[0]),n=(0,ie.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,ie.ensureBuffer)(t[0]),n=(0,ie.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,ie.ensureBuffer)(t[0]),n=(0,ie.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,ie.ensureBuffer)(t[0]),n=(0,ie.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,ze.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ce.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,ie.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,ze.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,ze.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ce.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,ie.ensureParsedJSONObject)(t[0]),n=(0,ie.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=oo.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,ie.ensureAddressString)(t[0]),n=(0,ie.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=oo.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,ie.ensureAddressString)(t[0]),n=(0,ie.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=oo.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(t){const r=t[0],n=t[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(t){var r,n,i,s;const a=t[0];if(((r=a.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw ce.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw ce.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const o=parseInt(a.chainId,16);return await this.addEthereumChain(o,(n=a.rpcUrls)!==null&&n!==void 0?n:[],(i=a.blockExplorerUrls)!==null&&i!==void 0?i:[],a.chainName,(s=a.iconUrls)!==null&&s!==void 0?s:[],a.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(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw ce.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw ce.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw ce.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw ce.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:a,decimals:o}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,o,a,n)}}_eth_uninstallFilter(t){const r=(0,ie.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const r=(0,ie.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,ie.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}gr.CoinbaseWalletProvider=Ow;var Vi={};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.RelayEventManager=void 0;const $w=z;class Fw{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,$w.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}Vi.RelayEventManager=Fw;Object.defineProperty(Ur,"__esModule",{value:!0});Ur.CoinbaseWalletSDK=void 0;const Dw=Jn,jw=Zn,il=z,Uw=ei,Hw=gr,Ww=Qr,Vw=cn,zw=Vi,qw=nn,Gw=Yr,Wd=Cr;class zi{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||jw.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(i=t.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),o=`${a.protocol}//${a.host}`;if(this._storage=new Uw.ScopedLocalStorage(`-walletlink:${o}`),this._storage.setItem("version",zi.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new zw.RelayEventManager;const c=(0,il.isMobileWeb)(),u=t.uiConstructor||(h=>c?new Vw.MobileRelayUI(h):new qw.WalletLinkRelayUI(h)),f={linkAPIUrl:s,version:Wd.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:u,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=c?new Ww.MobileRelay(f):new Gw.WalletLinkRelay(f),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||s.setConnectDisabled(!0),new Hw.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,il.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,Dw.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}Ur.CoinbaseWalletSDK=zi;zi.VERSION=Wd.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=Ur,r=gr;var n=Ur;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=gr;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(Co);const Jw=Vd(Co),a2=zd({__proto__:null,default:Jw},[Co]);export{a2 as i};
|
|
13
|
+
//# sourceMappingURL=index-fbe84902.js.map
|