@dodoex/wallet-web3 0.5.3 → 0.6.0
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/dist/__tslib-cf28c574.js +1 -0
- package/dist/{alchemy-provider-5870b6fa-1cd0b182.js → alchemy-provider-5870b6fa-e4fa48d3.js} +1 -1
- package/dist/{alchemy-websocket-provider-213da986-a1e43b83.js → alchemy-websocket-provider-213da986-dc2bcf5c.js} +1 -1
- package/dist/{blocto-203f9ec1.js → blocto-2fb1d4e9.js} +1 -1
- package/dist/browser-3f7e560e.js +1 -0
- package/dist/{ccip-f118a914.js → ccip-3c08ea13.js} +1 -1
- package/dist/cjs/__tslib-c375fca0.cjs +1 -0
- package/dist/cjs/{alchemy-provider-5870b6fa-8031f5e9.cjs → alchemy-provider-5870b6fa-00140867.cjs} +1 -1
- package/dist/cjs/{alchemy-websocket-provider-213da986-ffd85fbf.cjs → alchemy-websocket-provider-213da986-b2e3ea59.cjs} +1 -1
- package/dist/cjs/{blocto-fd5fce1b.cjs → blocto-b086f036.cjs} +1 -1
- package/dist/cjs/browser-d0e333da.cjs +1 -0
- package/dist/cjs/{ccip-5821aa76.cjs → ccip-248539f9.cjs} +1 -1
- package/dist/cjs/{draggabilly-534a06c4.cjs → draggabilly-f7eacd66.cjs} +1 -1
- package/dist/cjs/id-a6c483f9.cjs +1 -0
- package/dist/cjs/{index-11beefa2.cjs → index-1a09310e.cjs} +1 -1
- package/dist/cjs/{index-1cafa7ef.cjs → index-24e8d66c.cjs} +2 -2
- package/dist/cjs/index-2659a245.cjs +2 -0
- package/dist/cjs/{index-2914fc1b.cjs → index-54591c6b.cjs} +1 -1
- package/dist/cjs/{index-3e679370.cjs → index-83b277b8.cjs} +7 -7
- package/dist/cjs/index-908a0281.cjs +27 -0
- package/dist/cjs/index-97619c59.cjs +15 -0
- package/dist/cjs/{index-da0f0dc4.cjs → index-9dd3dd7e.cjs} +1 -1
- package/dist/cjs/{index-fe6d443a.cjs → index-ace56b81.cjs} +1 -1
- package/dist/cjs/index-b64e1d7e.cjs +1 -0
- package/dist/cjs/{index-8810c52e.cjs → index-d297664c.cjs} +1 -1
- package/dist/cjs/index-d965eac9.cjs +1 -0
- package/dist/cjs/index-e65f9734.cjs +15 -0
- package/dist/cjs/{index-83d6612a.cjs → index-fd28b030.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.es-e98c5ee4.cjs +9 -0
- package/dist/cjs/{interface-d2286c23.cjs → interface-eb633eac.cjs} +1 -1
- package/dist/cjs/{lib-typedarrays-f0840aa6.cjs → lib-typedarrays-f699b687.cjs} +1 -1
- package/dist/cjs/mm-install-modal_2.entry-4950a7e9.cjs +1 -0
- package/dist/cjs/{portis-166a6955.cjs → portis-0c036243.cjs} +1 -1
- package/dist/cjs/providers/wallets/standalone.d.ts +1 -0
- package/dist/cjs/providers/wallets/types.d.ts +1 -0
- package/dist/cjs/rainbow-57ada25b.cjs +1 -0
- package/dist/cjs/{sha224-bc65dfff.cjs → sha224-267753d8.cjs} +1 -1
- package/dist/cjs/{sha256-0636f669.cjs → sha256-d6829c39.cjs} +1 -1
- package/dist/cjs/{typed-data-8eaefdb5.cjs → typed-data-12a9baf4.cjs} +1 -1
- package/dist/cjs/{uAuth-081ad6fc.cjs → uAuth-0858f962.cjs} +1 -1
- package/dist/cjs/{walletConnect-073ff8dd.cjs → walletConnect-c55b3f29.cjs} +1 -1
- package/dist/cjs/{walletLink-101917c2.cjs → walletLink-961041df.cjs} +1 -1
- package/dist/{draggabilly-5d335a04.js → draggabilly-921a68cb.js} +1 -1
- package/dist/id-d72ad2e3.js +1 -0
- package/dist/index-022bd88c.js +27 -0
- package/dist/{index-540337a5.js → index-18f1c3bb.js} +1 -1
- package/dist/index-21067fcb.js +15 -0
- package/dist/index-2dc796bb.js +2 -0
- package/dist/{index-b8d0e86d.js → index-3b7c9150.js} +1 -1
- package/dist/{index-d59ad34c.js → index-621d68a7.js} +1 -1
- package/dist/index-6b5aff68.js +1 -0
- package/dist/index-7b0eeb5c.js +1 -0
- package/dist/{index-5732342d.js → index-82e4bb0d.js} +3 -3
- package/dist/{index-b5f5db3c.js → index-a98e886d.js} +7 -7
- package/dist/{index-bfa2119a.js → index-d3e54bda.js} +1 -1
- package/dist/{index-0bf8d237.js → index-d815c390.js} +1 -1
- package/dist/{index-8ed7d553.js → index-e0e62601.js} +1 -1
- package/dist/{index-1ecaf2fe.js → index-ff4c01ce.js} +1 -1
- package/dist/index.es-e17cf755.js +9 -0
- package/dist/index.js +1 -1
- package/dist/{interface-3f9d4a5c.js → interface-b09eb8d7.js} +1 -1
- package/dist/{lib-typedarrays-53c6b915.js → lib-typedarrays-8b3801fe.js} +1 -1
- package/dist/mm-install-modal_2.entry-e9e33358.js +1 -0
- package/dist/{portis-9bab3be5.js → portis-57c88ff3.js} +1 -1
- package/dist/providers/wallets/standalone.d.ts +1 -0
- package/dist/providers/wallets/types.d.ts +1 -0
- package/dist/rainbow-c820ccae.js +1 -0
- package/dist/{sha224-204aec1e.js → sha224-5ae0e997.js} +1 -1
- package/dist/{sha256-940f00e6.js → sha256-260a708c.js} +1 -1
- package/dist/{typed-data-af5b29c1.js → typed-data-7ba4540a.js} +1 -1
- package/dist/{uAuth-4d80b0ec.js → uAuth-253510eb.js} +1 -1
- package/dist/{walletConnect-ae596280.js → walletConnect-fc6f0e52.js} +1 -1
- package/dist/{walletLink-0dd5c1e9.js → walletLink-d75a8dc8.js} +1 -1
- package/package.json +2 -2
- package/dist/cjs/id-20f6ce8c.cjs +0 -1
- package/dist/cjs/index-3c2f7ecb.cjs +0 -15
- package/dist/cjs/index-7d28ccd9.cjs +0 -9
- package/dist/cjs/index.es-1000eb22.cjs +0 -9
- package/dist/cjs/rainbow-9e206ee7.cjs +0 -1
- package/dist/cjs/v4-3e682452.cjs +0 -1
- package/dist/id-b1749683.js +0 -1
- package/dist/index-327eea25.js +0 -9
- package/dist/index.es-5e0a68ed.js +0 -9
- package/dist/rainbow-5e0452af.js +0 -1
- package/dist/v4-95658a31.js +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";var t=require("./index-83b277b8.cjs"),e=require("buffer");require("@ethersproject/address"),require("@ethersproject/providers"),require("zustand"),require("@ethersproject/bytes"),require("@ethersproject/properties"),require("@ethersproject/abstract-signer"),require("@ethersproject/abstract-provider"),require("@ethersproject/contracts"),require("events"),require("@ethersproject/constants"),require("@ethersproject/transactions");var n,r,i={exports:{}};function s(){if(r)return n;r=1;var t=1e3,e=60*t,i=60*e,s=24*i,o=7*s,a=365.25*s;function u(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}return n=function(n,r){r=r||{};var c=typeof n;if("string"===c&&n.length>0)return function(n){if((n=String(n)).length>100)return;var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(!r)return;var u=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*a;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*s;case"hours":case"hour":case"hrs":case"hr":case"h":return u*i;case"minutes":case"minute":case"mins":case"min":case"m":return u*e;case"seconds":case"second":case"secs":case"sec":case"s":return u*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(n);if("number"===c&&isFinite(n))return r.long?function(n){var r=Math.abs(n);if(r>=s)return u(n,r,s,"day");if(r>=i)return u(n,r,i,"hour");if(r>=e)return u(n,r,e,"minute");if(r>=t)return u(n,r,t,"second");return n+" ms"}(n):function(n){var r=Math.abs(n);if(r>=s)return Math.round(n/s)+"d";if(r>=i)return Math.round(n/i)+"h";if(r>=e)return Math.round(n/e)+"m";if(r>=t)return Math.round(n/t)+"s";return n+"ms"}(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))}}var o=function(t){function e(t){let r,i,s,o=null;function a(...t){if(!a.enabled)return;const n=a,i=Number(new Date),s=i-(r||i);n.diff=s,n.prev=r,n.curr=i,r=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let o=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";o++;const s=e.formatters[i];if("function"==typeof s){const e=t[o];r=s.call(n,e),t.splice(o,1),o--}return r})),e.formatArgs.call(n,t);(n.log||e.log).apply(n,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=n,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==e.namespaces&&(i=e.namespaces,s=e.enabled(t)),s),set:t=>{o=t}}),"function"==typeof e.init&&e.init(a),a}function n(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function r(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(r),...e.skips.map(r).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=s(),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((n=>{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e};!function(t,e){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=o(e);const{formatters:n}=t.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(i,i.exports);var a,u=i.exports,c={exports:{}};a=c,t.commonjsGlobal,a.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=90)}({17:function(t,e,n){e.__esModule=!0,e.default=void 0;var r=n(18),i=function(){function t(){}return t.getFirstMatch=function(t,e){var n=e.match(t);return n&&n.length>0&&n[1]||""},t.getSecondMatch=function(t,e){var n=e.match(t);return n&&n.length>1&&n[2]||""},t.matchAndReturnConst=function(t,e,n){if(t.test(e))return n},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),10===e[0])switch(e[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),!(1===e[0]&&e[1]<5))return 1===e[0]&&e[1]<6?"Cupcake":1===e[0]&&e[1]>=6?"Donut":2===e[0]&&e[1]<2?"Eclair":2===e[0]&&2===e[1]?"Froyo":2===e[0]&&e[1]>2?"Gingerbread":3===e[0]?"Honeycomb":4===e[0]&&e[1]<1?"Ice Cream Sandwich":4===e[0]&&e[1]<4?"Jelly Bean":4===e[0]&&e[1]>=4?"KitKat":5===e[0]?"Lollipop":6===e[0]?"Marshmallow":7===e[0]?"Nougat":8===e[0]?"Oreo":9===e[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(e,n,r){void 0===r&&(r=!1);var i=t.getVersionPrecision(e),s=t.getVersionPrecision(n),o=Math.max(i,s),a=0,u=t.map([e,n],(function(e){var n=o-t.getVersionPrecision(e),r=e+new Array(n+1).join(".0");return t.map(r.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(r&&(a=o-Math.min(i,s)),o-=1;o>=a;){if(u[0][o]>u[1][o])return 1;if(u[0][o]===u[1][o]){if(o===a)return 0;o-=1}else if(u[0][o]<u[1][o])return-1}},t.map=function(t,e){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(t,e);for(n=0;n<t.length;n+=1)r.push(e(t[n]));return r},t.find=function(t,e){var n,r;if(Array.prototype.find)return Array.prototype.find.call(t,e);for(n=0,r=t.length;n<r;n+=1){var i=t[n];if(e(i,n))return i}},t.assign=function(t){for(var e,n,r=t,i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[t].concat(s));var a=function(){var t=s[e];"object"==typeof t&&null!==t&&Object.keys(t).forEach((function(e){r[e]=t[e]}))};for(e=0,n=s.length;e<n;e+=1)a();return t},t.getBrowserAlias=function(t){return r.BROWSER_ALIASES_MAP[t]},t.getBrowserTypeByAlias=function(t){return r.BROWSER_MAP[t]||""},t}();e.default=i,t.exports=e.default},18:function(t,e,n){e.__esModule=!0,e.ENGINE_MAP=e.OS_MAP=e.PLATFORMS_MAP=e.BROWSER_MAP=e.BROWSER_ALIASES_MAP=void 0,e.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},e.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},e.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},e.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},e.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},s=n(18);function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var a=function(){function t(){}var e,n,r;return t.getParser=function(t,e){if(void 0===e&&(e=!1),"string"!=typeof t)throw new Error("UserAgent should be a string");return new i.default(t,e)},t.parse=function(t){return new i.default(t).getResult()},e=t,r=[{key:"BROWSER_MAP",get:function(){return s.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return s.ENGINE_MAP}},{key:"OS_MAP",get:function(){return s.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return s.PLATFORMS_MAP}}],(n=null)&&o(e.prototype,n),r&&o(e,r),t}();e.default=a,t.exports=e.default},91:function(t,e,n){e.__esModule=!0,e.default=void 0;var r=u(n(92)),i=u(n(93)),s=u(n(94)),o=u(n(95)),a=u(n(17));function u(t){return t&&t.__esModule?t:{default:t}}var c=function(){function t(t,e){if(void 0===e&&(e=!1),null==t||""===t)throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},!0!==e&&this.parse()}var e=t.prototype;return e.getUA=function(){return this._ua},e.test=function(t){return t.test(this._ua)},e.parseBrowser=function(){var t=this;this.parsedResult.browser={};var e=a.default.find(r.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser},e.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},e.getBrowserName=function(t){return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},e.getBrowserVersion=function(){return this.getBrowser().version},e.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},e.parseOS=function(){var t=this;this.parsedResult.os={};var e=a.default.find(i.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os},e.getOSName=function(t){var e=this.getOS().name;return t?String(e).toLowerCase()||"":e||""},e.getOSVersion=function(){return this.getOS().version},e.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},e.getPlatformType=function(t){void 0===t&&(t=!1);var e=this.getPlatform().type;return t?String(e).toLowerCase()||"":e||""},e.parsePlatform=function(){var t=this;this.parsedResult.platform={};var e=a.default.find(s.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform},e.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},e.getEngineName=function(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},e.parseEngine=function(){var t=this;this.parsedResult.engine={};var e=a.default.find(o.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine},e.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},e.getResult=function(){return a.default.assign({},this.parsedResult)},e.satisfies=function(t){var e=this,n={},r=0,i={},s=0;if(Object.keys(t).forEach((function(e){var o=t[e];"string"==typeof o?(i[e]=o,s+=1):"object"==typeof o&&(n[e]=o,r+=1)})),r>0){var o=Object.keys(n),u=a.default.find(o,(function(t){return e.isOS(t)}));if(u){var c=this.satisfies(n[u]);if(void 0!==c)return c}var l=a.default.find(o,(function(t){return e.isPlatform(t)}));if(l){var d=this.satisfies(n[l]);if(void 0!==d)return d}}if(s>0){var h=Object.keys(i),f=a.default.find(h,(function(t){return e.isBrowser(t,!0)}));if(void 0!==f)return this.compareVersion(i[f])}},e.isBrowser=function(t,e){void 0===e&&(e=!1);var n=this.getBrowserName().toLowerCase(),r=t.toLowerCase(),i=a.default.getBrowserTypeByAlias(r);return e&&i&&(r=i.toLowerCase()),r===n},e.compareVersion=function(t){var e=[0],n=t,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===t[0]||"<"===t[0]?(n=t.substr(1),"="===t[1]?(r=!0,n=t.substr(2)):e=[],">"===t[0]?e.push(1):e.push(-1)):"="===t[0]?n=t.substr(1):"~"===t[0]&&(r=!0,n=t.substr(1)),e.indexOf(a.default.compareVersions(i,n,r))>-1},e.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},e.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},e.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},e.is=function(t,e){return void 0===e&&(e=!1),this.isBrowser(t,e)||this.isOS(t)||this.isPlatform(t)},e.some=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.is(t)}))},t}();e.default=c,t.exports=e.default},92:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(t){var e={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/opera/i],describe:function(t){var e={name:"Opera"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opr\/|opios/i],describe:function(t){var e={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/SamsungBrowser/i],describe:function(t){var e={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Whale/i],describe:function(t){var e={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MZBrowser/i],describe:function(t){var e={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/focus/i],describe:function(t){var e={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/swing/i],describe:function(t){var e={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/coast/i],describe:function(t){var e={name:"Opera Coast"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(t){var e={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/yabrowser/i],describe:function(t){var e={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/ucbrowser/i],describe:function(t){var e={name:"UC Browser"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Maxthon|mxios/i],describe:function(t){var e={name:"Maxthon"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/epiphany/i],describe:function(t){var e={name:"Epiphany"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/puffin/i],describe:function(t){var e={name:"Puffin"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sleipnir/i],describe:function(t){var e={name:"Sleipnir"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/k-meleon/i],describe:function(t){var e={name:"K-Meleon"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/micromessenger/i],describe:function(t){var e={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/qqbrowser/i],describe:function(t){var e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/msie|trident/i],describe:function(t){var e={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/\sedg\//i],describe:function(t){var e={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/edg([ea]|ios)/i],describe:function(t){var e={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/vivaldi/i],describe:function(t){var e={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/seamonkey/i],describe:function(t){var e={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sailfish/i],describe:function(t){var e={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return n&&(e.version=n),e}},{test:[/silk/i],describe:function(t){var e={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/phantom/i],describe:function(t){var e={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/slimerjs/i],describe:function(t){var e={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e={name:"BlackBerry"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e={name:"WebOS Browser"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/bada/i],describe:function(t){var e={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/tizen/i],describe:function(t){var e={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/qupzilla/i],describe:function(t){var e={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var e={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/electron/i],describe:function(t){var e={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MiuiBrowser/i],describe:function(t){var e={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/chromium/i],describe:function(t){var e={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/chrome|crios|crmo/i],describe:function(t){var e={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/GSA/i],describe:function(t){var e={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:function(t){var e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe:function(t){var e={name:"Android Browser"},n=i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/playstation 4/i],describe:function(t){var e={name:"PlayStation 4"},n=i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/safari|applewebkit/i],describe:function(t){var e={name:"Safari"},n=i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/.*/i],describe:function(t){var e=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(e,t),version:i.default.getSecondMatch(e,t)}}}];e.default=o,t.exports=e.default},93:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:[/Roku\/DVP/],describe:function(t){var e=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:s.OS_MAP.Roku,version:e}}},{test:[/windows phone/i],describe:function(t){var e=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:s.OS_MAP.WindowsPhone,version:e}}},{test:[/windows /i],describe:function(t){var e=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),n=i.default.getWindowsVersionName(e);return{name:s.OS_MAP.Windows,version:e,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(t){var e={name:s.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return n&&(e.version=n),e}},{test:[/macintosh/i],describe:function(t){var e=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(e),r={name:s.OS_MAP.MacOS,version:e};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var e=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:s.OS_MAP.iOS,version:e}}},{test:function(t){var e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe:function(t){var e=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),n=i.default.getAndroidVersionName(e),r={name:s.OS_MAP.Android,version:e};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),n={name:s.OS_MAP.WebOS};return e&&e.length&&(n.version=e),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||i.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:s.OS_MAP.BlackBerry,version:e}}},{test:[/bada/i],describe:function(t){var e=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:s.OS_MAP.Bada,version:e}}},{test:[/tizen/i],describe:function(t){var e=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:s.OS_MAP.Tizen,version:e}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var e=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:s.OS_MAP.PlayStation4,version:e}}}];e.default=o,t.exports=e.default},94:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var e=i.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",n={type:s.PLATFORMS_MAP.mobile,vendor:"Huawei"};return e&&(n.model=e),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(t){var e=t.test(/ipod|iphone/i),n=t.test(/like (ipod|iphone)/i);return e&&!n},describe:function(t){var e=i.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:s.PLATFORMS_MAP.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var e=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&e>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];e.default=o,t.exports=e.default},95:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:s.ENGINE_MAP.Blink};var e=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:s.ENGINE_MAP.EdgeHTML,version:e}}},{test:[/trident/i],describe:function(t){var e={name:s.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:function(t){return t.test(/presto/i)},describe:function(t){var e={name:s.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:function(t){var e=t.test(/gecko/i),n=t.test(/like gecko/i);return e&&!n},describe:function(t){var e={name:s.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var e={name:s.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}}];e.default=o,t.exports=e.default}});var l=t.getDefaultExportFromCjs(c.exports);class d extends TypeError{constructor(t,e){let n;const{message:r,explanation:i,...s}=t,{path:o}=t,a=0===o.length?r:`At path: ${o.join(".")} -- ${r}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...e()])}}function h(t){return"object"==typeof t&&null!==t}function f(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function p(t,e,n,r){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:u=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${f(r)}\``}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:u}}function*m(t,e,n,r){(function(t){return h(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const i of t){const t=p(i,e,n,r);t&&(yield t)}}function*g(t,e,n={}){const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i};if(s&&(t=e.coercer(t,a),o&&"type"!==e.type&&h(e.schema)&&h(t)&&!Array.isArray(t)))for(const n in t)void 0===e.schema[n]&&delete t[n];let u="valid";for(const r of e.validator(t,a))r.explanation=n.message,u="not_valid",yield[r,void 0];for(let[c,l,d]of e.entries(t,a)){const e=g(l,d,{path:void 0===c?r:[...r,c],branch:void 0===c?i:[...i,l],coerce:s,mask:o,message:n.message});for(const n of e)n[0]?(u=null===n[0].refinement||void 0===n[0].refinement?"not_valid":"not_refined",yield[n[0],void 0]):s&&(l=n[1],void 0===c?t=l:t instanceof Map?t.set(c,l):t instanceof Set?t.add(l):h(t)&&(void 0!==l||c in t)&&(t[c]=l))}if("not_valid"!==u)for(const r of e.refiner(t,a))r.explanation=n.message,u="not_refined",yield[r,void 0];"valid"===u&&(yield[void 0,t])}class _{constructor(t){const{type:e,schema:n,validator:r,refiner:i,coercer:s=(t=>t),entries:o=function*(){}}=t;this.type=e,this.schema=n,this.entries=o,this.coercer=s,this.validator=r?(t,e)=>m(r(t,e),e,this,t):()=>[],this.refiner=i?(t,e)=>m(i(t,e),e,this,t):()=>[]}assert(t,e){return function(t,e,n){const r=k(t,e,{message:n});if(r[0])throw r[0]}(t,this,e)}create(t,e){return w(t,this,e)}is(t){return b(t,this)}mask(t,e){return function(t,e,n){const r=k(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}(t,this,e)}validate(t,e={}){return k(t,this,e)}}const v="EXACT_OPTIONAL";class y extends _{constructor(t){super({...t,type:`exact optional ${t.type}`}),this.brand=v}static isExactOptional(t){return h(t)&&"brand"in t&&t.brand===v}}function w(t,e,n){const r=k(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function b(t,e){return!k(t,e)[0]}function k(t,e,n={}){const r=g(t,e,n),i=function(t){const{done:e,value:n}=t.next();return e?void 0:n}(r);if(i[0]){return[new d(i[0],(function*(){for(const t of r)t[0]&&(yield t[0])})),void 0]}return[void 0,i[1]]}function E(t,e){return new _({type:t,schema:null,validator:e})}function A(t){const e=t?Object.keys(t):[],n=E("never",(()=>!1));return new _({type:"object",schema:t??null,*entries(r){if(t&&h(r)){const i=new Set(Object.keys(r));for(const n of e){i.delete(n);const e=t[n];y.isExactOptional(e)&&!Object.prototype.hasOwnProperty.call(r,n)||(yield[n,r[n],t[n]])}for(const t of i)yield[t,r[t],n]}},validator:t=>h(t)||`Expected an object, but received: ${f(t)}`,coercer:t=>h(t)?{...t}:t})}function C(t){return new _({...t,validator:(e,n)=>void 0===e||t.validator(e,n),refiner:(e,n)=>void 0===e||t.refiner(e,n)})}function x(){return E("string",(t=>"string"==typeof t||`Expected a string, but received: ${f(t)}`))}function S(t){const e=t.map((t=>t.type)).join(" | ");return new _({type:"union",schema:null,coercer(e){for(const n of t){const[t,r]=n.validate(e,{coerce:!0});if(!t)return r}return e},validator(n,r){const i=[];for(const e of t){const[...t]=g(n,e,r),[s]=t;if(!s?.[0])return[];for(const[e]of t)e&&i.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${f(n)}`,...i]}})}function M(t,e){return O(t,"pattern",(n=>e.test(n)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${n}"`))}function O(t,e,n){return new _({...t,*refiner(r,i){yield*t.refiner(r,i);const s=m(n(r,i),i,t,r);for(const t of s)yield{...t,refinement:e}}})}function I(t){return Boolean(t)&&"object"==typeof t&&!Array.isArray(t)}const R=(t,e)=>Object.hasOwnProperty.call(t,e);var T;!function(t){t[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date"}(T=T||(T={}));const P=BigInt(2**32-1),j=BigInt(32);function F(t,e=!1){return e?{h:Number(t&P),l:Number(t>>j&P)}:{h:0|Number(t>>j&P),l:0|Number(t&P)}}function N(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=F(t[i],e);[n[i],r[i]]=[s,o]}return[n,r]}const z=[],B=[],L=[],U=BigInt(0),q=BigInt(1),D=BigInt(2),$=BigInt(7),W=BigInt(256),Z=BigInt(113);for(let t=0,e=q,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],z.push(2*(5*r+n)),B.push((t+1)*(t+2)/2%64);let i=U;for(let t=0;t<7;t++)e=(e<<q^(e>>$)*Z)%W,e&D&&(i^=q<<(q<<BigInt(t))-q);L.push(i)}const[G,H]=N(L,!0),J=(t,e,n)=>n>32?((t,e,n)=>e<<n-32|t>>>64-n)(t,e,n):((t,e,n)=>t<<n|e>>>32-n)(t,e,n),V=(t,e,n)=>n>32?((t,e,n)=>t<<n-32|e>>>64-n)(t,e,n):((t,e,n)=>e<<n|t>>>32-n)(t,e,n);class K extends t.Hash{constructor(e,n,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,t.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=t.u32(this.state)}keccak(){t.isLE||t.byteSwap32(this.state32),function(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let e=0;e<10;e++)n[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const r=(e+8)%10,i=(e+2)%10,s=n[i],o=n[i+1],a=J(s,o,1)^n[r],u=V(s,o,1)^n[r+1];for(let n=0;n<50;n+=10)t[e+n]^=a,t[e+n+1]^=u}let e=t[2],i=t[3];for(let n=0;n<24;n++){const r=B[n],s=J(e,i,r),o=V(e,i,r),a=z[n];e=t[a],i=t[a+1],t[a]=s,t[a+1]=o}for(let e=0;e<50;e+=10){for(let r=0;r<10;r++)n[r]=t[e+r];for(let r=0;r<10;r++)t[e+r]^=~n[(r+2)%10]&n[(r+4)%10]}t[0]^=G[r],t[1]^=H[r]}n.fill(0)}(this.state32,this.rounds),t.isLE||t.byteSwap32(this.state32),this.posOut=0,this.pos=0}update(e){t.exists(this);const{blockLen:n,state:r}=this,i=(e=t.toBytes(e)).length;for(let t=0;t<i;){const s=Math.min(n-this.pos,i-t);for(let n=0;n<s;n++)r[this.pos++]^=e[t++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:n,blockLen:r}=this;t[n]^=e,0!=(128&e)&&n===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(e){t.exists(this,!1),t.bytes(e),this.finish();const n=this.state,{blockLen:r}=this;for(let t=0,i=e.length;t<i;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,i-t);e.set(n.subarray(this.posOut,this.posOut+s),t),this.posOut+=s,t+=s}return e}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(e){return t.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(t.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:n,outputLen:r,rounds:i,enableXOF:s}=this;return t||(t=new K(e,n,r,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=r,t.enableXOF=s,t.destroyed=this.destroyed,t}}const Q=((e,n,r)=>t.wrapConstructor((()=>new K(n,e,r))))(1,136,32);var X={exports:{}};!function(e,n){(function(){var r,i="Expected a function",s="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,u=32,c=64,l=128,d=256,h=1/0,f=9007199254740991,p=NaN,m=4294967295,g=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",u],["partialRight",c],["rearg",d]],_="[object Arguments]",v="[object Array]",y="[object Boolean]",w="[object Date]",b="[object Error]",k="[object Function]",E="[object GeneratorFunction]",A="[object Map]",C="[object Number]",x="[object Object]",S="[object Promise]",M="[object RegExp]",O="[object Set]",I="[object String]",R="[object Symbol]",T="[object WeakMap]",P="[object ArrayBuffer]",j="[object DataView]",F="[object Float32Array]",N="[object Float64Array]",z="[object Int8Array]",B="[object Int16Array]",L="[object Int32Array]",U="[object Uint8Array]",q="[object Uint8ClampedArray]",D="[object Uint16Array]",$="[object Uint32Array]",W=/\b__p \+= '';/g,Z=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,H=/&(?:amp|lt|gt|quot|#39);/g,J=/[&<>"']/g,V=RegExp(H.source),K=RegExp(J.source),Q=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,et=/^\w*$/,nt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rt=/[\\^$.*+?()[\]{}|]/g,it=RegExp(rt.source),st=/^\s+/,ot=/\s/,at=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,ct=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dt=/[()=,{}\[\]\/\s]/,ht=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,mt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,_t=/^\[object .+?Constructor\]$/,vt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,kt=/['\n\r\u2028\u2029\\]/g,Et="\\ud800-\\udfff",At="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ct="\\u2700-\\u27bf",xt="a-z\\xdf-\\xf6\\xf8-\\xff",St="A-Z\\xc0-\\xd6\\xd8-\\xde",Mt="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",It="['’]",Rt="["+Et+"]",Tt="["+Ot+"]",Pt="["+At+"]",jt="\\d+",Ft="["+Ct+"]",Nt="["+xt+"]",zt="[^"+Et+Ot+jt+Ct+xt+St+"]",Bt="\\ud83c[\\udffb-\\udfff]",Lt="[^"+Et+"]",Ut="(?:\\ud83c[\\udde6-\\uddff]){2}",qt="[\\ud800-\\udbff][\\udc00-\\udfff]",Dt="["+St+"]",$t="\\u200d",Wt="(?:"+Nt+"|"+zt+")",Zt="(?:"+Dt+"|"+zt+")",Gt="(?:['’](?:d|ll|m|re|s|t|ve))?",Ht="(?:['’](?:D|LL|M|RE|S|T|VE))?",Jt="(?:"+Pt+"|"+Bt+")"+"?",Vt="["+Mt+"]?",Kt=Vt+Jt+("(?:"+$t+"(?:"+[Lt,Ut,qt].join("|")+")"+Vt+Jt+")*"),Qt="(?:"+[Ft,Ut,qt].join("|")+")"+Kt,Xt="(?:"+[Lt+Pt+"?",Pt,Ut,qt,Rt].join("|")+")",Yt=RegExp(It,"g"),te=RegExp(Pt,"g"),ee=RegExp(Bt+"(?="+Bt+")|"+Xt+Kt,"g"),ne=RegExp([Dt+"?"+Nt+"+"+Gt+"(?="+[Tt,Dt,"$"].join("|")+")",Zt+"+"+Ht+"(?="+[Tt,Dt+Wt,"$"].join("|")+")",Dt+"?"+Wt+"+"+Gt,Dt+"+"+Ht,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jt,Qt].join("|"),"g"),re=RegExp("["+$t+Et+At+Mt+"]"),ie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,se=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,ae={};ae[F]=ae[N]=ae[z]=ae[B]=ae[L]=ae[U]=ae[q]=ae[D]=ae[$]=!0,ae[_]=ae[v]=ae[P]=ae[y]=ae[j]=ae[w]=ae[b]=ae[k]=ae[A]=ae[C]=ae[x]=ae[M]=ae[O]=ae[I]=ae[T]=!1;var ue={};ue[_]=ue[v]=ue[P]=ue[j]=ue[y]=ue[w]=ue[F]=ue[N]=ue[z]=ue[B]=ue[L]=ue[A]=ue[C]=ue[x]=ue[M]=ue[O]=ue[I]=ue[R]=ue[U]=ue[q]=ue[D]=ue[$]=!0,ue[b]=ue[k]=ue[T]=!1;var ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,de=parseInt,he="object"==typeof t.commonjsGlobal&&t.commonjsGlobal&&t.commonjsGlobal.Object===Object&&t.commonjsGlobal,fe="object"==typeof self&&self&&self.Object===Object&&self,pe=he||fe||Function("return this")(),me=n&&!n.nodeType&&n,ge=me&&e&&!e.nodeType&&e,_e=ge&&ge.exports===me,ve=_e&&he.process,ye=function(){try{var t=ge&&ge.require&&ge.require("util").types;return t||ve&&ve.binding&&ve.binding("util")}catch(t){}}(),we=ye&&ye.isArrayBuffer,be=ye&&ye.isDate,ke=ye&&ye.isMap,Ee=ye&&ye.isRegExp,Ae=ye&&ye.isSet,Ce=ye&&ye.isTypedArray;function xe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Se(t,e,n,r){for(var i=-1,s=null==t?0:t.length;++i<s;){var o=t[i];e(r,o,n(o),t)}return r}function Me(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Oe(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ie(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Re(t,e){for(var n=-1,r=null==t?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function Te(t,e){return!!(null==t?0:t.length)&&De(t,e,0)>-1}function Pe(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function je(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Fe(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Ne(t,e,n,r){var i=-1,s=null==t?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function ze(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Be(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Le=Ge("length");function Ue(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function qe(t,e,n,r){for(var i=t.length,s=n+(r?1:-1);r?s--:++s<i;)if(e(t[s],s,t))return s;return-1}function De(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):qe(t,We,n)}function $e(t,e,n,r){for(var i=n-1,s=t.length;++i<s;)if(r(t[i],e))return i;return-1}function We(t){return t!=t}function Ze(t,e){var n=null==t?0:t.length;return n?Ve(t,e)/n:p}function Ge(t){return function(e){return null==e?r:e[t]}}function He(t){return function(e){return null==t?r:t[e]}}function Je(t,e,n,r,i){return i(t,(function(t,i,s){n=r?(r=!1,t):e(n,t,i,s)})),n}function Ve(t,e){for(var n,i=-1,s=t.length;++i<s;){var o=e(t[i]);o!==r&&(n=n===r?o:n+o)}return n}function Ke(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Qe(t){return t?t.slice(0,mn(t)+1).replace(st,""):t}function Xe(t){return function(e){return t(e)}}function Ye(t,e){return je(e,(function(e){return t[e]}))}function tn(t,e){return t.has(e)}function en(t,e){for(var n=-1,r=t.length;++n<r&&De(e,t[n],0)>-1;);return n}function nn(t,e){for(var n=t.length;n--&&De(e,t[n],0)>-1;);return n}var rn=He({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),sn=He({"&":"&","<":"<",">":">",'"':""","'":"'"});function on(t){return"\\"+ce[t]}function an(t){return re.test(t)}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function cn(t,e){return function(n){return t(e(n))}}function ln(t,e){for(var n=-1,r=t.length,i=0,s=[];++n<r;){var a=t[n];a!==e&&a!==o||(t[n]=o,s[i++]=n)}return s}function dn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function hn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function fn(t){return an(t)?function(t){var e=ee.lastIndex=0;for(;ee.test(t);)++e;return e}(t):Le(t)}function pn(t){return an(t)?function(t){return t.match(ee)||[]}(t):function(t){return t.split("")}(t)}function mn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var gn=He({"&":"&","<":"<",">":">",""":'"',"'":"'"});var _n=function t(e){var n,ot=(e=null==e?pe:_n.defaults(pe.Object(),e,_n.pick(pe,se))).Array,Et=e.Date,At=e.Error,Ct=e.Function,xt=e.Math,St=e.Object,Mt=e.RegExp,Ot=e.String,It=e.TypeError,Rt=ot.prototype,Tt=Ct.prototype,Pt=St.prototype,jt=e["__core-js_shared__"],Ft=Tt.toString,Nt=Pt.hasOwnProperty,zt=0,Bt=(n=/[^.]+$/.exec(jt&&jt.keys&&jt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Lt=Pt.toString,Ut=Ft.call(St),qt=pe._,Dt=Mt("^"+Ft.call(Nt).replace(rt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$t=_e?e.Buffer:r,Wt=e.Symbol,Zt=e.Uint8Array,Gt=$t?$t.allocUnsafe:r,Ht=cn(St.getPrototypeOf,St),Jt=St.create,Vt=Pt.propertyIsEnumerable,Kt=Rt.splice,Qt=Wt?Wt.isConcatSpreadable:r,Xt=Wt?Wt.iterator:r,ee=Wt?Wt.toStringTag:r,re=function(){try{var t=hs(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),ce=e.clearTimeout!==pe.clearTimeout&&e.clearTimeout,he=Et&&Et.now!==pe.Date.now&&Et.now,fe=e.setTimeout!==pe.setTimeout&&e.setTimeout,me=xt.ceil,ge=xt.floor,ve=St.getOwnPropertySymbols,ye=$t?$t.isBuffer:r,Le=e.isFinite,He=Rt.join,vn=cn(St.keys,St),yn=xt.max,wn=xt.min,bn=Et.now,kn=e.parseInt,En=xt.random,An=Rt.reverse,Cn=hs(e,"DataView"),xn=hs(e,"Map"),Sn=hs(e,"Promise"),Mn=hs(e,"Set"),On=hs(e,"WeakMap"),In=hs(St,"create"),Rn=On&&new On,Tn={},Pn=Bs(Cn),jn=Bs(xn),Fn=Bs(Sn),Nn=Bs(Mn),zn=Bs(On),Bn=Wt?Wt.prototype:r,Ln=Bn?Bn.valueOf:r,Un=Bn?Bn.toString:r;function qn(t){if(na(t)&&!Zo(t)&&!(t instanceof Zn)){if(t instanceof Wn)return t;if(Nt.call(t,"__wrapped__"))return Ls(t)}return new Wn(t)}var Dn=function(){function t(){}return function(e){if(!ea(e))return{};if(Jt)return Jt(e);t.prototype=e;var n=new t;return t.prototype=r,n}}();function $n(){}function Wn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function Zn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Jn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Jn;++e<n;)this.add(t[e])}function Kn(t){var e=this.__data__=new Hn(t);this.size=e.size}function Qn(t,e){var n=Zo(t),r=!n&&Wo(t),i=!n&&!r&&Vo(t),s=!n&&!r&&!i&&la(t),o=n||r||i||s,a=o?Ke(t.length,Ot):[],u=a.length;for(var c in t)!e&&!Nt.call(t,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ys(c,u))||a.push(c);return a}function Xn(t){var e=t.length;return e?t[Vr(0,e-1)]:r}function Yn(t,e){return Fs(Ii(t),ur(e,0,t.length))}function tr(t){return Fs(Ii(t))}function er(t,e,n){(n!==r&&!qo(t[e],n)||n===r&&!(e in t))&&or(t,e,n)}function nr(t,e,n){var i=t[e];Nt.call(t,e)&&qo(i,n)&&(n!==r||e in t)||or(t,e,n)}function rr(t,e){for(var n=t.length;n--;)if(qo(t[n][0],e))return n;return-1}function ir(t,e,n,r){return fr(t,(function(t,i,s){e(r,t,n(t),s)})),r}function sr(t,e){return t&&Ri(e,Ta(e),t)}function or(t,e,n){"__proto__"==e&&re?re(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ar(t,e){for(var n=-1,i=e.length,s=ot(i),o=null==t;++n<i;)s[n]=o?r:Sa(t,e[n]);return s}function ur(t,e,n){return t==t&&(n!==r&&(t=t<=n?t:n),e!==r&&(t=t>=e?t:e)),t}function cr(t,e,n,i,s,o){var a,u=1&e,c=2&e,l=4&e;if(n&&(a=s?n(t,i,s,o):n(t)),a!==r)return a;if(!ea(t))return t;var d=Zo(t);if(d){if(a=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&Nt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!u)return Ii(t,a)}else{var h=ms(t),f=h==k||h==E;if(Vo(t))return Ai(t,u);if(h==x||h==_||f&&!s){if(a=c||f?{}:_s(t),!u)return c?function(t,e){return Ri(t,ps(t),e)}(t,function(t,e){return t&&Ri(e,Pa(e),t)}(a,t)):function(t,e){return Ri(t,fs(t),e)}(t,sr(a,t))}else{if(!ue[h])return s?t:{};a=function(t,e,n){var r=t.constructor;switch(e){case P:return Ci(t);case y:case w:return new r(+t);case j:return function(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case F:case N:case z:case B:case L:case U:case q:case D:case $:return xi(t,n);case A:return new r;case C:case I:return new r(t);case M:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case O:return new r;case R:return i=t,Ln?St(Ln.call(i)):{}}var i}(t,h,u)}}o||(o=new Kn);var p=o.get(t);if(p)return p;o.set(t,a),aa(t)?t.forEach((function(r){a.add(cr(r,e,n,r,t,o))})):ra(t)&&t.forEach((function(r,i){a.set(i,cr(r,e,n,i,t,o))}));var m=d?r:(l?c?ss:is:c?Pa:Ta)(t);return Me(m||t,(function(r,i){m&&(r=t[i=r]),nr(a,i,cr(r,e,n,i,t,o))})),a}function lr(t,e,n){var i=n.length;if(null==t)return!i;for(t=St(t);i--;){var s=n[i],o=e[s],a=t[s];if(a===r&&!(s in t)||!o(a))return!1}return!0}function dr(t,e,n){if("function"!=typeof t)throw new It(i);return Rs((function(){t.apply(r,n)}),e)}function hr(t,e,n,r){var i=-1,s=Te,o=!0,a=t.length,u=[],c=e.length;if(!a)return u;n&&(e=je(e,Xe(n))),r?(s=Pe,o=!1):e.length>=200&&(s=tn,o=!1,e=new Vn(e));t:for(;++i<a;){var l=t[i],d=null==n?l:n(l);if(l=r||0!==l?l:0,o&&d==d){for(var h=c;h--;)if(e[h]===d)continue t;u.push(l)}else s(e,d,r)||u.push(l)}return u}qn.templateSettings={escape:Q,evaluate:X,interpolate:Y,variable:"",imports:{_:qn}},qn.prototype=$n.prototype,qn.prototype.constructor=qn,Wn.prototype=Dn($n.prototype),Wn.prototype.constructor=Wn,Zn.prototype=Dn($n.prototype),Zn.prototype.constructor=Zn,Gn.prototype.clear=function(){this.__data__=In?In(null):{},this.size=0},Gn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Gn.prototype.get=function(t){var e=this.__data__;if(In){var n=e[t];return n===s?r:n}return Nt.call(e,t)?e[t]:r},Gn.prototype.has=function(t){var e=this.__data__;return In?e[t]!==r:Nt.call(e,t)},Gn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=In&&e===r?s:e,this},Hn.prototype.clear=function(){this.__data__=[],this.size=0},Hn.prototype.delete=function(t){var e=this.__data__,n=rr(e,t);return!(n<0)&&(n==e.length-1?e.pop():Kt.call(e,n,1),--this.size,!0)},Hn.prototype.get=function(t){var e=this.__data__,n=rr(e,t);return n<0?r:e[n][1]},Hn.prototype.has=function(t){return rr(this.__data__,t)>-1},Hn.prototype.set=function(t,e){var n=this.__data__,r=rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Jn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(xn||Hn),string:new Gn}},Jn.prototype.delete=function(t){var e=ls(this,t).delete(t);return this.size-=e?1:0,e},Jn.prototype.get=function(t){return ls(this,t).get(t)},Jn.prototype.has=function(t){return ls(this,t).has(t)},Jn.prototype.set=function(t,e){var n=ls(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Vn.prototype.add=Vn.prototype.push=function(t){return this.__data__.set(t,s),this},Vn.prototype.has=function(t){return this.__data__.has(t)},Kn.prototype.clear=function(){this.__data__=new Hn,this.size=0},Kn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Kn.prototype.get=function(t){return this.__data__.get(t)},Kn.prototype.has=function(t){return this.__data__.has(t)},Kn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Hn){var r=n.__data__;if(!xn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Jn(r)}return n.set(t,e),this.size=n.size,this};var fr=ji(br),pr=ji(kr,!0);function mr(t,e){var n=!0;return fr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function gr(t,e,n){for(var i=-1,s=t.length;++i<s;){var o=t[i],a=e(o);if(null!=a&&(u===r?a==a&&!ca(a):n(a,u)))var u=a,c=o}return c}function _r(t,e){var n=[];return fr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function vr(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=vs),i||(i=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?vr(a,e-1,n,r,i):Fe(i,a):r||(i[i.length]=a)}return i}var yr=Fi(),wr=Fi(!0);function br(t,e){return t&&yr(t,e,Ta)}function kr(t,e){return t&&wr(t,e,Ta)}function Er(t,e){return Re(e,(function(e){return Xo(t[e])}))}function Ar(t,e){for(var n=0,i=(e=wi(e,t)).length;null!=t&&n<i;)t=t[zs(e[n++])];return n&&n==i?t:r}function Cr(t,e,n){var r=e(t);return Zo(t)?r:Fe(r,n(t))}function xr(t){return null==t?t===r?"[object Undefined]":"[object Null]":ee&&ee in St(t)?function(t){var e=Nt.call(t,ee),n=t[ee];try{t[ee]=r;var i=!0}catch(t){}var s=Lt.call(t);i&&(e?t[ee]=n:delete t[ee]);return s}(t):function(t){return Lt.call(t)}(t)}function Sr(t,e){return t>e}function Mr(t,e){return null!=t&&Nt.call(t,e)}function Or(t,e){return null!=t&&e in St(t)}function Ir(t,e,n){for(var i=n?Pe:Te,s=t[0].length,o=t.length,a=o,u=ot(o),c=1/0,l=[];a--;){var d=t[a];a&&e&&(d=je(d,Xe(e))),c=wn(d.length,c),u[a]=!n&&(e||s>=120&&d.length>=120)?new Vn(a&&d):r}d=t[0];var h=-1,f=u[0];t:for(;++h<s&&l.length<c;){var p=d[h],m=e?e(p):p;if(p=n||0!==p?p:0,!(f?tn(f,m):i(l,m,n))){for(a=o;--a;){var g=u[a];if(!(g?tn(g,m):i(t[a],m,n)))continue t}f&&f.push(m),l.push(p)}}return l}function Rr(t,e,n){var i=null==(t=Ms(t,e=wi(e,t)))?t:t[zs(Ks(e))];return null==i?r:xe(i,t,n)}function Tr(t){return na(t)&&xr(t)==_}function Pr(t,e,n,i,s){return t===e||(null==t||null==e||!na(t)&&!na(e)?t!=t&&e!=e:function(t,e,n,i,s,o){var a=Zo(t),u=Zo(e),c=a?v:ms(t),l=u?v:ms(e),d=(c=c==_?x:c)==x,h=(l=l==_?x:l)==x,f=c==l;if(f&&Vo(t)){if(!Vo(e))return!1;a=!0,d=!1}if(f&&!d)return o||(o=new Kn),a||la(t)?ns(t,e,n,i,s,o):function(t,e,n,r,i,s,o){switch(n){case j:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case P:return!(t.byteLength!=e.byteLength||!s(new Zt(t),new Zt(e)));case y:case w:case C:return qo(+t,+e);case b:return t.name==e.name&&t.message==e.message;case M:case I:return t==e+"";case A:var a=un;case O:var u=1&r;if(a||(a=dn),t.size!=e.size&&!u)return!1;var c=o.get(t);if(c)return c==e;r|=2,o.set(t,e);var l=ns(a(t),a(e),r,i,s,o);return o.delete(t),l;case R:if(Ln)return Ln.call(t)==Ln.call(e)}return!1}(t,e,c,n,i,s,o);if(!(1&n)){var p=d&&Nt.call(t,"__wrapped__"),m=h&&Nt.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,k=m?e.value():e;return o||(o=new Kn),s(g,k,n,i,o)}}if(!f)return!1;return o||(o=new Kn),function(t,e,n,i,s,o){var a=1&n,u=is(t),c=u.length,l=is(e),d=l.length;if(c!=d&&!a)return!1;var h=c;for(;h--;){var f=u[h];if(!(a?f in e:Nt.call(e,f)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var g=!0;o.set(t,e),o.set(e,t);var _=a;for(;++h<c;){var v=t[f=u[h]],y=e[f];if(i)var w=a?i(y,v,f,e,t,o):i(v,y,f,t,e,o);if(!(w===r?v===y||s(v,y,n,i,o):w)){g=!1;break}_||(_="constructor"==f)}if(g&&!_){var b=t.constructor,k=e.constructor;b==k||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof k&&k instanceof k||(g=!1)}return o.delete(t),o.delete(e),g}(t,e,n,i,s,o)}(t,e,n,i,Pr,s))}function jr(t,e,n,i){var s=n.length,o=s,a=!i;if(null==t)return!o;for(t=St(t);s--;){var u=n[s];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++s<o;){var c=(u=n[s])[0],l=t[c],d=u[1];if(a&&u[2]){if(l===r&&!(c in t))return!1}else{var h=new Kn;if(i)var f=i(l,d,c,t,e,h);if(!(f===r?Pr(d,l,3,i,h):f))return!1}}return!0}function Fr(t){return!(!ea(t)||(e=t,Bt&&Bt in e))&&(Xo(t)?Dt:_t).test(Bs(t));var e}function Nr(t){return"function"==typeof t?t:null==t?iu:"object"==typeof t?Zo(t)?Dr(t[0],t[1]):qr(t):fu(t)}function zr(t){if(!As(t))return vn(t);var e=[];for(var n in St(t))Nt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Br(t){if(!ea(t))return function(t){var e=[];if(null!=t)for(var n in St(t))e.push(n);return e}(t);var e=As(t),n=[];for(var r in t)("constructor"!=r||!e&&Nt.call(t,r))&&n.push(r);return n}function Lr(t,e){return t<e}function Ur(t,e){var n=-1,r=Ho(t)?ot(t.length):[];return fr(t,(function(t,i,s){r[++n]=e(t,i,s)})),r}function qr(t){var e=ds(t);return 1==e.length&&e[0][2]?xs(e[0][0],e[0][1]):function(n){return n===t||jr(n,t,e)}}function Dr(t,e){return bs(t)&&Cs(e)?xs(zs(t),e):function(n){var i=Sa(n,t);return i===r&&i===e?Ma(n,t):Pr(e,i,3)}}function $r(t,e,n,i,s){t!==e&&yr(e,(function(o,a){if(s||(s=new Kn),ea(o))!function(t,e,n,i,s,o,a){var u=Os(t,n),c=Os(e,n),l=a.get(c);if(l)return void er(t,n,l);var d=o?o(u,c,n+"",t,e,a):r,h=d===r;if(h){var f=Zo(c),p=!f&&Vo(c),m=!f&&!p&&la(c);d=c,f||p||m?Zo(u)?d=u:Jo(u)?d=Ii(u):p?(h=!1,d=Ai(c,!0)):m?(h=!1,d=xi(c,!0)):d=[]:sa(c)||Wo(c)?(d=u,Wo(u)?d=va(u):ea(u)&&!Xo(u)||(d=_s(c))):h=!1}h&&(a.set(c,d),s(d,c,i,o,a),a.delete(c));er(t,n,d)}(t,e,a,n,$r,i,s);else{var u=i?i(Os(t,a),o,a+"",t,e,s):r;u===r&&(u=o),er(t,a,u)}}),Pa)}function Wr(t,e){var n=t.length;if(n)return ys(e+=e<0?n:0,n)?t[e]:r}function Zr(t,e,n){e=e.length?je(e,(function(t){return Zo(t)?function(e){return Ar(e,1===t.length?t[0]:t)}:t})):[iu];var r=-1;e=je(e,Xe(cs()));var i=Ur(t,(function(t,n,i){var s=je(e,(function(e){return e(t)}));return{criteria:s,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(i,(function(t,e){return function(t,e,n){var r=-1,i=t.criteria,s=e.criteria,o=i.length,a=n.length;for(;++r<o;){var u=Si(i[r],s[r]);if(u)return r>=a?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Gr(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=Ar(t,o);n(a,o)&&ti(s,wi(o,t),a)}return s}function Hr(t,e,n,r){var i=r?$e:De,s=-1,o=e.length,a=t;for(t===e&&(e=Ii(e)),n&&(a=je(t,Xe(n)));++s<o;)for(var u=0,c=e[s],l=n?n(c):c;(u=i(a,l,u,r))>-1;)a!==t&&Kt.call(a,u,1),Kt.call(t,u,1);return t}function Jr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==s){var s=i;ys(i)?Kt.call(t,i,1):hi(t,i)}}return t}function Vr(t,e){return t+ge(En()*(e-t+1))}function Kr(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=ge(e/2))&&(t+=t)}while(e);return n}function Qr(t,e){return Ts(Ss(t,e,iu),t+"")}function Xr(t){return Xn(qa(t))}function Yr(t,e){var n=qa(t);return Fs(n,ur(e,0,n.length))}function ti(t,e,n,i){if(!ea(t))return t;for(var s=-1,o=(e=wi(e,t)).length,a=o-1,u=t;null!=u&&++s<o;){var c=zs(e[s]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(s!=a){var d=u[c];(l=i?i(d,c,u):r)===r&&(l=ea(d)?d:ys(e[s+1])?[]:{})}nr(u,c,l),u=u[c]}return t}var ei=Rn?function(t,e){return Rn.set(t,e),t}:iu,ni=re?function(t,e){return re(t,"toString",{configurable:!0,enumerable:!1,value:eu(e),writable:!0})}:iu;function ri(t){return Fs(qa(t))}function ii(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=ot(i);++r<i;)s[r]=t[r+e];return s}function si(t,e){var n;return fr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function oi(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var s=r+i>>>1,o=t[s];null!==o&&!ca(o)&&(n?o<=e:o<e)?r=s+1:i=s}return i}return ai(t,e,iu,n)}function ai(t,e,n,i){var s=0,o=null==t?0:t.length;if(0===o)return 0;for(var a=(e=n(e))!=e,u=null===e,c=ca(e),l=e===r;s<o;){var d=ge((s+o)/2),h=n(t[d]),f=h!==r,p=null===h,m=h==h,g=ca(h);if(a)var _=i||m;else _=l?m&&(i||f):u?m&&f&&(i||!p):c?m&&f&&!p&&(i||!g):!p&&!g&&(i?h<=e:h<e);_?s=d+1:o=d}return wn(o,4294967294)}function ui(t,e){for(var n=-1,r=t.length,i=0,s=[];++n<r;){var o=t[n],a=e?e(o):o;if(!n||!qo(a,u)){var u=a;s[i++]=0===o?0:o}}return s}function ci(t){return"number"==typeof t?t:ca(t)?p:+t}function li(t){if("string"==typeof t)return t;if(Zo(t))return je(t,li)+"";if(ca(t))return Un?Un.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function di(t,e,n){var r=-1,i=Te,s=t.length,o=!0,a=[],u=a;if(n)o=!1,i=Pe;else if(s>=200){var c=e?null:Ki(t);if(c)return dn(c);o=!1,i=tn,u=new Vn}else u=e?[]:a;t:for(;++r<s;){var l=t[r],d=e?e(l):l;if(l=n||0!==l?l:0,o&&d==d){for(var h=u.length;h--;)if(u[h]===d)continue t;e&&u.push(d),a.push(l)}else i(u,d,n)||(u!==a&&u.push(d),a.push(l))}return a}function hi(t,e){return null==(t=Ms(t,e=wi(e,t)))||delete t[zs(Ks(e))]}function fi(t,e,n,r){return ti(t,e,n(Ar(t,e)),r)}function pi(t,e,n,r){for(var i=t.length,s=r?i:-1;(r?s--:++s<i)&&e(t[s],s,t););return n?ii(t,r?0:s,r?s+1:i):ii(t,r?s+1:0,r?i:s)}function mi(t,e){var n=t;return n instanceof Zn&&(n=n.value()),Ne(e,(function(t,e){return e.func.apply(e.thisArg,Fe([t],e.args))}),n)}function gi(t,e,n){var r=t.length;if(r<2)return r?di(t[0]):[];for(var i=-1,s=ot(r);++i<r;)for(var o=t[i],a=-1;++a<r;)a!=i&&(s[i]=hr(s[i]||o,t[a],e,n));return di(vr(s,1),e,n)}function _i(t,e,n){for(var i=-1,s=t.length,o=e.length,a={};++i<s;){var u=i<o?e[i]:r;n(a,t[i],u)}return a}function vi(t){return Jo(t)?t:[]}function yi(t){return"function"==typeof t?t:iu}function wi(t,e){return Zo(t)?t:bs(t,e)?[t]:Ns(ya(t))}var bi=Qr;function ki(t,e,n){var i=t.length;return n=n===r?i:n,!e&&n>=i?t:ii(t,e,n)}var Ei=ce||function(t){return pe.clearTimeout(t)};function Ai(t,e){if(e)return t.slice();var n=t.length,r=Gt?Gt(n):new t.constructor(n);return t.copy(r),r}function Ci(t){var e=new t.constructor(t.byteLength);return new Zt(e).set(new Zt(t)),e}function xi(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Si(t,e){if(t!==e){var n=t!==r,i=null===t,s=t==t,o=ca(t),a=e!==r,u=null===e,c=e==e,l=ca(e);if(!u&&!l&&!o&&t>e||o&&a&&c&&!u&&!l||i&&a&&c||!n&&c||!s)return 1;if(!i&&!o&&!l&&t<e||l&&n&&s&&!i&&!o||u&&n&&s||!a&&s||!c)return-1}return 0}function Mi(t,e,n,r){for(var i=-1,s=t.length,o=n.length,a=-1,u=e.length,c=yn(s-o,0),l=ot(u+c),d=!r;++a<u;)l[a]=e[a];for(;++i<o;)(d||i<s)&&(l[n[i]]=t[i]);for(;c--;)l[a++]=t[i++];return l}function Oi(t,e,n,r){for(var i=-1,s=t.length,o=-1,a=n.length,u=-1,c=e.length,l=yn(s-a,0),d=ot(l+c),h=!r;++i<l;)d[i]=t[i];for(var f=i;++u<c;)d[f+u]=e[u];for(;++o<a;)(h||i<s)&&(d[f+n[o]]=t[i++]);return d}function Ii(t,e){var n=-1,r=t.length;for(e||(e=ot(r));++n<r;)e[n]=t[n];return e}function Ri(t,e,n,i){var s=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var u=e[o],c=i?i(n[u],t[u],u,n,t):r;c===r&&(c=t[u]),s?or(n,u,c):nr(n,u,c)}return n}function Ti(t,e){return function(n,r){var i=Zo(n)?Se:ir,s=e?e():{};return i(n,t,cs(r,2),s)}}function Pi(t){return Qr((function(e,n){var i=-1,s=n.length,o=s>1?n[s-1]:r,a=s>2?n[2]:r;for(o=t.length>3&&"function"==typeof o?(s--,o):r,a&&ws(n[0],n[1],a)&&(o=s<3?r:o,s=1),e=St(e);++i<s;){var u=n[i];u&&t(e,u,i,o)}return e}))}function ji(t,e){return function(n,r){if(null==n)return n;if(!Ho(n))return t(n,r);for(var i=n.length,s=e?i:-1,o=St(n);(e?s--:++s<i)&&!1!==r(o[s],s,o););return n}}function Fi(t){return function(e,n,r){for(var i=-1,s=St(e),o=r(e),a=o.length;a--;){var u=o[t?a:++i];if(!1===n(s[u],u,s))break}return e}}function Ni(t){return function(e){var n=an(e=ya(e))?pn(e):r,i=n?n[0]:e.charAt(0),s=n?ki(n,1).join(""):e.slice(1);return i[t]()+s}}function zi(t){return function(e){return Ne(Xa(Wa(e).replace(Yt,"")),t,"")}}function Bi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Dn(t.prototype),r=t.apply(n,e);return ea(r)?r:n}}function Li(t){return function(e,n,i){var s=St(e);if(!Ho(e)){var o=cs(n,3);e=Ta(e),n=function(t){return o(s[t],t,s)}}var a=t(e,n,i);return a>-1?s[o?e[a]:a]:r}}function Ui(t){return rs((function(e){var n=e.length,s=n,o=Wn.prototype.thru;for(t&&e.reverse();s--;){var a=e[s];if("function"!=typeof a)throw new It(i);if(o&&!u&&"wrapper"==as(a))var u=new Wn([],!0)}for(s=u?s:n;++s<n;){var c=as(a=e[s]),l="wrapper"==c?os(a):r;u=l&&ks(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[as(l[0])].apply(u,l[3]):1==a.length&&ks(a)?u[c]():u.thru(a)}return function(){var t=arguments,r=t[0];if(u&&1==t.length&&Zo(r))return u.plant(r).value();for(var i=0,s=n?e[i].apply(this,t):r;++i<n;)s=e[i].call(this,s);return s}}))}function qi(t,e,n,i,s,o,a,u,c,d){var h=e&l,f=1&e,p=2&e,m=24&e,g=512&e,_=p?r:Bi(t);return function l(){for(var v=arguments.length,y=ot(v),w=v;w--;)y[w]=arguments[w];if(m)var b=us(l),k=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(y,b);if(i&&(y=Mi(y,i,s,m)),o&&(y=Oi(y,o,a,m)),v-=k,m&&v<d){var E=ln(y,b);return Ji(t,e,qi,l.placeholder,n,y,E,u,c,d-v)}var A=f?n:this,C=p?A[t]:t;return v=y.length,u?y=function(t,e){var n=t.length,i=wn(e.length,n),s=Ii(t);for(;i--;){var o=e[i];t[i]=ys(o,n)?s[o]:r}return t}(y,u):g&&v>1&&y.reverse(),h&&c<v&&(y.length=c),this&&this!==pe&&this instanceof l&&(C=_||Bi(C)),C.apply(A,y)}}function Di(t,e){return function(n,r){return function(t,e,n,r){return br(t,(function(t,i,s){e(r,n(t),i,s)})),r}(n,t,e(r),{})}}function $i(t,e){return function(n,i){var s;if(n===r&&i===r)return e;if(n!==r&&(s=n),i!==r){if(s===r)return i;"string"==typeof n||"string"==typeof i?(n=li(n),i=li(i)):(n=ci(n),i=ci(i)),s=t(n,i)}return s}}function Wi(t){return rs((function(e){return e=je(e,Xe(cs())),Qr((function(n){var r=this;return t(e,(function(t){return xe(t,r,n)}))}))}))}function Zi(t,e){var n=(e=e===r?" ":li(e)).length;if(n<2)return n?Kr(e,t):e;var i=Kr(e,me(t/fn(e)));return an(e)?ki(pn(i),0,t).join(""):i.slice(0,t)}function Gi(t){return function(e,n,i){return i&&"number"!=typeof i&&ws(e,n,i)&&(n=i=r),e=pa(e),n===r?(n=e,e=0):n=pa(n),function(t,e,n,r){for(var i=-1,s=yn(me((e-t)/(n||1)),0),o=ot(s);s--;)o[r?s:++i]=t,t+=n;return o}(e,n,i=i===r?e<n?1:-1:pa(i),t)}}function Hi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=_a(e),n=_a(n)),t(e,n)}}function Ji(t,e,n,i,s,o,a,l,d,h){var f=8&e;e|=f?u:c,4&(e&=~(f?c:u))||(e&=-4);var p=[t,e,s,f?o:r,f?a:r,f?r:o,f?r:a,l,d,h],m=n.apply(r,p);return ks(t)&&Is(m,p),m.placeholder=i,Ps(m,t,e)}function Vi(t){var e=xt[t];return function(t,n){if(t=_a(t),(n=null==n?0:wn(ma(n),292))&&Le(t)){var r=(ya(t)+"e").split("e");return+((r=(ya(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Ki=Mn&&1/dn(new Mn([,-0]))[1]==h?function(t){return new Mn(t)}:cu;function Qi(t){return function(e){var n=ms(e);return n==A?un(e):n==O?hn(e):function(t,e){return je(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Xi(t,e,n,s,h,f,p,m){var g=2&e;if(!g&&"function"!=typeof t)throw new It(i);var _=s?s.length:0;if(_||(e&=-97,s=h=r),p=p===r?p:yn(ma(p),0),m=m===r?m:ma(m),_-=h?h.length:0,e&c){var v=s,y=h;s=h=r}var w=g?r:os(t),b=[t,e,n,s,h,v,y,f,p,m];if(w&&function(t,e){var n=t[1],r=e[1],i=n|r,s=i<131,a=r==l&&8==n||r==l&&n==d&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!s&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var c=t[3];t[3]=c?Mi(c,u,e[4]):u,t[4]=c?ln(t[3],o):e[4]}(u=e[5])&&(c=t[5],t[5]=c?Oi(c,u,e[6]):u,t[6]=c?ln(t[5],o):e[6]);(u=e[7])&&(t[7]=u);r&l&&(t[8]=null==t[8]?e[8]:wn(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(b,w),t=b[0],e=b[1],n=b[2],s=b[3],h=b[4],!(m=b[9]=b[9]===r?g?0:t.length:yn(b[9]-_,0))&&24&e&&(e&=-25),e&&1!=e)k=8==e||e==a?function(t,e,n){var i=Bi(t);return function s(){for(var o=arguments.length,a=ot(o),u=o,c=us(s);u--;)a[u]=arguments[u];var l=o<3&&a[0]!==c&&a[o-1]!==c?[]:ln(a,c);return(o-=l.length)<n?Ji(t,e,qi,s.placeholder,r,a,l,r,r,n-o):xe(this&&this!==pe&&this instanceof s?i:t,this,a)}}(t,e,m):e!=u&&33!=e||h.length?qi.apply(r,b):function(t,e,n,r){var i=1&e,s=Bi(t);return function e(){for(var o=-1,a=arguments.length,u=-1,c=r.length,l=ot(c+a),d=this&&this!==pe&&this instanceof e?s:t;++u<c;)l[u]=r[u];for(;a--;)l[u++]=arguments[++o];return xe(d,i?n:this,l)}}(t,e,n,s);else var k=function(t,e,n){var r=1&e,i=Bi(t);return function e(){return(this&&this!==pe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return Ps((w?ei:Is)(k,b),t,e)}function Yi(t,e,n,i){return t===r||qo(t,Pt[n])&&!Nt.call(i,n)?e:t}function ts(t,e,n,i,s,o){return ea(t)&&ea(e)&&(o.set(e,t),$r(t,e,r,ts,o),o.delete(e)),t}function es(t){return sa(t)?r:t}function ns(t,e,n,i,s,o){var a=1&n,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var l=o.get(t),d=o.get(e);if(l&&d)return l==e&&d==t;var h=-1,f=!0,p=2&n?new Vn:r;for(o.set(t,e),o.set(e,t);++h<u;){var m=t[h],g=e[h];if(i)var _=a?i(g,m,h,e,t,o):i(m,g,h,t,e,o);if(_!==r){if(_)continue;f=!1;break}if(p){if(!Be(e,(function(t,e){if(!tn(p,e)&&(m===t||s(m,t,n,i,o)))return p.push(e)}))){f=!1;break}}else if(m!==g&&!s(m,g,n,i,o)){f=!1;break}}return o.delete(t),o.delete(e),f}function rs(t){return Ts(Ss(t,r,Zs),t+"")}function is(t){return Cr(t,Ta,fs)}function ss(t){return Cr(t,Pa,ps)}var os=Rn?function(t){return Rn.get(t)}:cu;function as(t){for(var e=t.name+"",n=Tn[e],r=Nt.call(Tn,e)?n.length:0;r--;){var i=n[r],s=i.func;if(null==s||s==t)return i.name}return e}function us(t){return(Nt.call(qn,"placeholder")?qn:t).placeholder}function cs(){var t=qn.iteratee||su;return t=t===su?Nr:t,arguments.length?t(arguments[0],arguments[1]):t}function ls(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function ds(t){for(var e=Ta(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Cs(i)]}return e}function hs(t,e){var n=function(t,e){return null==t?r:t[e]}(t,e);return Fr(n)?n:r}var fs=ve?function(t){return null==t?[]:(t=St(t),Re(ve(t),(function(e){return Vt.call(t,e)})))}:gu,ps=ve?function(t){for(var e=[];t;)Fe(e,fs(t)),t=Ht(t);return e}:gu,ms=xr;function gs(t,e,n){for(var r=-1,i=(e=wi(e,t)).length,s=!1;++r<i;){var o=zs(e[r]);if(!(s=null!=t&&n(t,o)))break;t=t[o]}return s||++r!=i?s:!!(i=null==t?0:t.length)&&ta(i)&&ys(o,i)&&(Zo(t)||Wo(t))}function _s(t){return"function"!=typeof t.constructor||As(t)?{}:Dn(Ht(t))}function vs(t){return Zo(t)||Wo(t)||!!(Qt&&t&&t[Qt])}function ys(t,e){var n=typeof t;return!!(e=null==e?f:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e}function ws(t,e,n){if(!ea(n))return!1;var r=typeof e;return!!("number"==r?Ho(n)&&ys(e,n.length):"string"==r&&e in n)&&qo(n[e],t)}function bs(t,e){if(Zo(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ca(t))||(et.test(t)||!tt.test(t)||null!=e&&t in St(e))}function ks(t){var e=as(t),n=qn[e];if("function"!=typeof n||!(e in Zn.prototype))return!1;if(t===n)return!0;var r=os(n);return!!r&&t===r[0]}(Cn&&ms(new Cn(new ArrayBuffer(1)))!=j||xn&&ms(new xn)!=A||Sn&&ms(Sn.resolve())!=S||Mn&&ms(new Mn)!=O||On&&ms(new On)!=T)&&(ms=function(t){var e=xr(t),n=e==x?t.constructor:r,i=n?Bs(n):"";if(i)switch(i){case Pn:return j;case jn:return A;case Fn:return S;case Nn:return O;case zn:return T}return e});var Es=jt?Xo:_u;function As(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Pt)}function Cs(t){return t==t&&!ea(t)}function xs(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==r||t in St(n)))}}function Ss(t,e,n){return e=yn(e===r?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=yn(r.length-e,0),o=ot(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=ot(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),xe(t,this,a)}}function Ms(t,e){return e.length<2?t:Ar(t,ii(e,0,-1))}function Os(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Is=js(ei),Rs=fe||function(t,e){return pe.setTimeout(t,e)},Ts=js(ni);function Ps(t,e,n){var r=e+"";return Ts(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(at,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Me(g,(function(n){var r="_."+n[0];e&n[1]&&!Te(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(ut);return e?e[1].split(ct):[]}(r),n)))}function js(t){var e=0,n=0;return function(){var i=bn(),s=16-(i-n);if(n=i,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function Fs(t,e){var n=-1,i=t.length,s=i-1;for(e=e===r?i:e;++n<e;){var o=Vr(n,s),a=t[o];t[o]=t[n],t[n]=a}return t.length=e,t}var Ns=function(t){var e=Fo(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(nt,(function(t,n,r,i){e.push(r?i.replace(ht,"$1"):n||t)})),e}));function zs(t){if("string"==typeof t||ca(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Bs(t){if(null!=t){try{return Ft.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ls(t){if(t instanceof Zn)return t.clone();var e=new Wn(t.__wrapped__,t.__chain__);return e.__actions__=Ii(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Us=Qr((function(t,e){return Jo(t)?hr(t,vr(e,1,Jo,!0)):[]})),qs=Qr((function(t,e){var n=Ks(e);return Jo(n)&&(n=r),Jo(t)?hr(t,vr(e,1,Jo,!0),cs(n,2)):[]})),Ds=Qr((function(t,e){var n=Ks(e);return Jo(n)&&(n=r),Jo(t)?hr(t,vr(e,1,Jo,!0),r,n):[]}));function $s(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ma(n);return i<0&&(i=yn(r+i,0)),qe(t,cs(e,3),i)}function Ws(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var s=i-1;return n!==r&&(s=ma(n),s=n<0?yn(i+s,0):wn(s,i-1)),qe(t,cs(e,3),s,!0)}function Zs(t){return(null==t?0:t.length)?vr(t,1):[]}function Gs(t){return t&&t.length?t[0]:r}var Hs=Qr((function(t){var e=je(t,vi);return e.length&&e[0]===t[0]?Ir(e):[]})),Js=Qr((function(t){var e=Ks(t),n=je(t,vi);return e===Ks(n)?e=r:n.pop(),n.length&&n[0]===t[0]?Ir(n,cs(e,2)):[]})),Vs=Qr((function(t){var e=Ks(t),n=je(t,vi);return(e="function"==typeof e?e:r)&&n.pop(),n.length&&n[0]===t[0]?Ir(n,r,e):[]}));function Ks(t){var e=null==t?0:t.length;return e?t[e-1]:r}var Qs=Qr(Xs);function Xs(t,e){return t&&t.length&&e&&e.length?Hr(t,e):t}var Ys=rs((function(t,e){var n=null==t?0:t.length,r=ar(t,e);return Jr(t,je(e,(function(t){return ys(t,n)?+t:t})).sort(Si)),r}));function to(t){return null==t?t:An.call(t)}var eo=Qr((function(t){return di(vr(t,1,Jo,!0))})),no=Qr((function(t){var e=Ks(t);return Jo(e)&&(e=r),di(vr(t,1,Jo,!0),cs(e,2))})),ro=Qr((function(t){var e=Ks(t);return e="function"==typeof e?e:r,di(vr(t,1,Jo,!0),r,e)}));function io(t){if(!t||!t.length)return[];var e=0;return t=Re(t,(function(t){if(Jo(t))return e=yn(t.length,e),!0})),Ke(e,(function(e){return je(t,Ge(e))}))}function so(t,e){if(!t||!t.length)return[];var n=io(t);return null==e?n:je(n,(function(t){return xe(e,r,t)}))}var oo=Qr((function(t,e){return Jo(t)?hr(t,e):[]})),ao=Qr((function(t){return gi(Re(t,Jo))})),uo=Qr((function(t){var e=Ks(t);return Jo(e)&&(e=r),gi(Re(t,Jo),cs(e,2))})),co=Qr((function(t){var e=Ks(t);return e="function"==typeof e?e:r,gi(Re(t,Jo),r,e)})),lo=Qr(io);var ho=Qr((function(t){var e=t.length,n=e>1?t[e-1]:r;return n="function"==typeof n?(t.pop(),n):r,so(t,n)}));function fo(t){var e=qn(t);return e.__chain__=!0,e}function po(t,e){return e(t)}var mo=rs((function(t){var e=t.length,n=e?t[0]:0,i=this.__wrapped__,s=function(e){return ar(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Zn&&ys(n)?((i=i.slice(n,+n+(e?1:0))).__actions__.push({func:po,args:[s],thisArg:r}),new Wn(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(r),t}))):this.thru(s)}));var go=Ti((function(t,e,n){Nt.call(t,n)?++t[n]:or(t,n,1)}));var _o=Li($s),vo=Li(Ws);function yo(t,e){return(Zo(t)?Me:fr)(t,cs(e,3))}function wo(t,e){return(Zo(t)?Oe:pr)(t,cs(e,3))}var bo=Ti((function(t,e,n){Nt.call(t,n)?t[n].push(e):or(t,n,[e])}));var ko=Qr((function(t,e,n){var r=-1,i="function"==typeof e,s=Ho(t)?ot(t.length):[];return fr(t,(function(t){s[++r]=i?xe(e,t,n):Rr(t,e,n)})),s})),Eo=Ti((function(t,e,n){or(t,n,e)}));function Ao(t,e){return(Zo(t)?je:Ur)(t,cs(e,3))}var Co=Ti((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var xo=Qr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&ws(t,e[0],e[1])?e=[]:n>2&&ws(e[0],e[1],e[2])&&(e=[e[0]]),Zr(t,vr(e,1),[])})),So=he||function(){return pe.Date.now()};function Mo(t,e,n){return e=n?r:e,e=t&&null==e?t.length:e,Xi(t,l,r,r,r,r,e)}function Oo(t,e){var n;if("function"!=typeof e)throw new It(i);return t=ma(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=r),n}}var Io=Qr((function(t,e,n){var r=1;if(n.length){var i=ln(n,us(Io));r|=u}return Xi(t,r,e,n,i)})),Ro=Qr((function(t,e,n){var r=3;if(n.length){var i=ln(n,us(Ro));r|=u}return Xi(e,r,t,n,i)}));function To(t,e,n){var s,o,a,u,c,l,d=0,h=!1,f=!1,p=!0;if("function"!=typeof t)throw new It(i);function m(e){var n=s,i=o;return s=o=r,d=e,u=t.apply(i,n)}function g(t){var n=t-l;return l===r||n>=e||n<0||f&&t-d>=a}function _(){var t=So();if(g(t))return v(t);c=Rs(_,function(t){var n=e-(t-l);return f?wn(n,a-(t-d)):n}(t))}function v(t){return c=r,p&&s?m(t):(s=o=r,u)}function y(){var t=So(),n=g(t);if(s=arguments,o=this,l=t,n){if(c===r)return function(t){return d=t,c=Rs(_,e),h?m(t):u}(l);if(f)return Ei(c),c=Rs(_,e),m(l)}return c===r&&(c=Rs(_,e)),u}return e=_a(e)||0,ea(n)&&(h=!!n.leading,a=(f="maxWait"in n)?yn(_a(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),y.cancel=function(){c!==r&&Ei(c),d=0,s=l=o=c=r},y.flush=function(){return c===r?u:v(So())},y}var Po=Qr((function(t,e){return dr(t,1,e)})),jo=Qr((function(t,e,n){return dr(t,_a(e)||0,n)}));function Fo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new It(i);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(Fo.Cache||Jn),n}function No(t){if("function"!=typeof t)throw new It(i);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Fo.Cache=Jn;var zo=bi((function(t,e){var n=(e=1==e.length&&Zo(e[0])?je(e[0],Xe(cs())):je(vr(e,1),Xe(cs()))).length;return Qr((function(r){for(var i=-1,s=wn(r.length,n);++i<s;)r[i]=e[i].call(this,r[i]);return xe(t,this,r)}))})),Bo=Qr((function(t,e){var n=ln(e,us(Bo));return Xi(t,u,r,e,n)})),Lo=Qr((function(t,e){var n=ln(e,us(Lo));return Xi(t,c,r,e,n)})),Uo=rs((function(t,e){return Xi(t,d,r,r,r,e)}));function qo(t,e){return t===e||t!=t&&e!=e}var Do=Hi(Sr),$o=Hi((function(t,e){return t>=e})),Wo=Tr(function(){return arguments}())?Tr:function(t){return na(t)&&Nt.call(t,"callee")&&!Vt.call(t,"callee")},Zo=ot.isArray,Go=we?Xe(we):function(t){return na(t)&&xr(t)==P};function Ho(t){return null!=t&&ta(t.length)&&!Xo(t)}function Jo(t){return na(t)&&Ho(t)}var Vo=ye||_u,Ko=be?Xe(be):function(t){return na(t)&&xr(t)==w};function Qo(t){if(!na(t))return!1;var e=xr(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!sa(t)}function Xo(t){if(!ea(t))return!1;var e=xr(t);return e==k||e==E||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Yo(t){return"number"==typeof t&&t==ma(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function ea(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function na(t){return null!=t&&"object"==typeof t}var ra=ke?Xe(ke):function(t){return na(t)&&ms(t)==A};function ia(t){return"number"==typeof t||na(t)&&xr(t)==C}function sa(t){if(!na(t)||xr(t)!=x)return!1;var e=Ht(t);if(null===e)return!0;var n=Nt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ft.call(n)==Ut}var oa=Ee?Xe(Ee):function(t){return na(t)&&xr(t)==M};var aa=Ae?Xe(Ae):function(t){return na(t)&&ms(t)==O};function ua(t){return"string"==typeof t||!Zo(t)&&na(t)&&xr(t)==I}function ca(t){return"symbol"==typeof t||na(t)&&xr(t)==R}var la=Ce?Xe(Ce):function(t){return na(t)&&ta(t.length)&&!!ae[xr(t)]};var da=Hi(Lr),ha=Hi((function(t,e){return t<=e}));function fa(t){if(!t)return[];if(Ho(t))return ua(t)?pn(t):Ii(t);if(Xt&&t[Xt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Xt]());var e=ms(t);return(e==A?un:e==O?dn:qa)(t)}function pa(t){return t?(t=_a(t))===h||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ma(t){var e=pa(t),n=e%1;return e==e?n?e-n:e:0}function ga(t){return t?ur(ma(t),0,m):0}function _a(t){if("number"==typeof t)return t;if(ca(t))return p;if(ea(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ea(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Qe(t);var n=gt.test(t);return n||vt.test(t)?de(t.slice(2),n?2:8):mt.test(t)?p:+t}function va(t){return Ri(t,Pa(t))}function ya(t){return null==t?"":li(t)}var wa=Pi((function(t,e){if(As(e)||Ho(e))Ri(e,Ta(e),t);else for(var n in e)Nt.call(e,n)&&nr(t,n,e[n])})),ba=Pi((function(t,e){Ri(e,Pa(e),t)})),ka=Pi((function(t,e,n,r){Ri(e,Pa(e),t,r)})),Ea=Pi((function(t,e,n,r){Ri(e,Ta(e),t,r)})),Aa=rs(ar);var Ca=Qr((function(t,e){t=St(t);var n=-1,i=e.length,s=i>2?e[2]:r;for(s&&ws(e[0],e[1],s)&&(i=1);++n<i;)for(var o=e[n],a=Pa(o),u=-1,c=a.length;++u<c;){var l=a[u],d=t[l];(d===r||qo(d,Pt[l])&&!Nt.call(t,l))&&(t[l]=o[l])}return t})),xa=Qr((function(t){return t.push(r,ts),xe(Fa,r,t)}));function Sa(t,e,n){var i=null==t?r:Ar(t,e);return i===r?n:i}function Ma(t,e){return null!=t&&gs(t,e,Or)}var Oa=Di((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),t[e]=n}),eu(iu)),Ia=Di((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),Nt.call(t,e)?t[e].push(n):t[e]=[n]}),cs),Ra=Qr(Rr);function Ta(t){return Ho(t)?Qn(t):zr(t)}function Pa(t){return Ho(t)?Qn(t,!0):Br(t)}var ja=Pi((function(t,e,n){$r(t,e,n)})),Fa=Pi((function(t,e,n,r){$r(t,e,n,r)})),Na=rs((function(t,e){var n={};if(null==t)return n;var r=!1;e=je(e,(function(e){return e=wi(e,t),r||(r=e.length>1),e})),Ri(t,ss(t),n),r&&(n=cr(n,7,es));for(var i=e.length;i--;)hi(n,e[i]);return n}));var za=rs((function(t,e){return null==t?{}:function(t,e){return Gr(t,e,(function(e,n){return Ma(t,n)}))}(t,e)}));function Ba(t,e){if(null==t)return{};var n=je(ss(t),(function(t){return[t]}));return e=cs(e),Gr(t,n,(function(t,n){return e(t,n[0])}))}var La=Qi(Ta),Ua=Qi(Pa);function qa(t){return null==t?[]:Ye(t,Ta(t))}var Da=zi((function(t,e,n){return e=e.toLowerCase(),t+(n?$a(e):e)}));function $a(t){return Qa(ya(t).toLowerCase())}function Wa(t){return(t=ya(t))&&t.replace(wt,rn).replace(te,"")}var Za=zi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ga=zi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ha=Ni("toLowerCase");var Ja=zi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Va=zi((function(t,e,n){return t+(n?" ":"")+Qa(e)}));var Ka=zi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Qa=Ni("toUpperCase");function Xa(t,e,n){return t=ya(t),(e=n?r:e)===r?function(t){return ie.test(t)}(t)?function(t){return t.match(ne)||[]}(t):function(t){return t.match(lt)||[]}(t):t.match(e)||[]}var Ya=Qr((function(t,e){try{return xe(t,r,e)}catch(t){return Qo(t)?t:new At(t)}})),tu=rs((function(t,e){return Me(e,(function(e){e=zs(e),or(t,e,Io(t[e],t))})),t}));function eu(t){return function(){return t}}var nu=Ui(),ru=Ui(!0);function iu(t){return t}function su(t){return Nr("function"==typeof t?t:cr(t,1))}var ou=Qr((function(t,e){return function(n){return Rr(n,t,e)}})),au=Qr((function(t,e){return function(n){return Rr(t,n,e)}}));function uu(t,e,n){var r=Ta(e),i=Er(e,r);null!=n||ea(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Er(e,Ta(e)));var s=!(ea(n)&&"chain"in n&&!n.chain),o=Xo(t);return Me(i,(function(n){var r=e[n];t[n]=r,o&&(t.prototype[n]=function(){var e=this.__chain__;if(s||e){var n=t(this.__wrapped__);return(n.__actions__=Ii(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Fe([this.value()],arguments))})})),t}function cu(){}var lu=Wi(je),du=Wi(Ie),hu=Wi(Be);function fu(t){return bs(t)?Ge(zs(t)):function(t){return function(e){return Ar(e,t)}}(t)}var pu=Gi(),mu=Gi(!0);function gu(){return[]}function _u(){return!1}var vu=$i((function(t,e){return t+e}),0),yu=Vi("ceil"),wu=$i((function(t,e){return t/e}),1),bu=Vi("floor");var ku,Eu=$i((function(t,e){return t*e}),1),Au=Vi("round"),Cu=$i((function(t,e){return t-e}),0);return qn.after=function(t,e){if("function"!=typeof e)throw new It(i);return t=ma(t),function(){if(--t<1)return e.apply(this,arguments)}},qn.ary=Mo,qn.assign=wa,qn.assignIn=ba,qn.assignInWith=ka,qn.assignWith=Ea,qn.at=Aa,qn.before=Oo,qn.bind=Io,qn.bindAll=tu,qn.bindKey=Ro,qn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Zo(t)?t:[t]},qn.chain=fo,qn.chunk=function(t,e,n){e=(n?ws(t,e,n):e===r)?1:yn(ma(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var s=0,o=0,a=ot(me(i/e));s<i;)a[o++]=ii(t,s,s+=e);return a},qn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i},qn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=ot(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Fe(Zo(n)?Ii(n):[n],vr(e,1))},qn.cond=function(t){var e=null==t?0:t.length,n=cs();return t=e?je(t,(function(t){if("function"!=typeof t[1])throw new It(i);return[n(t[0]),t[1]]})):[],Qr((function(n){for(var r=-1;++r<e;){var i=t[r];if(xe(i[0],this,n))return xe(i[1],this,n)}}))},qn.conforms=function(t){return function(t){var e=Ta(t);return function(n){return lr(n,t,e)}}(cr(t,1))},qn.constant=eu,qn.countBy=go,qn.create=function(t,e){var n=Dn(t);return null==e?n:sr(n,e)},qn.curry=function t(e,n,i){var s=Xi(e,8,r,r,r,r,r,n=i?r:n);return s.placeholder=t.placeholder,s},qn.curryRight=function t(e,n,i){var s=Xi(e,a,r,r,r,r,r,n=i?r:n);return s.placeholder=t.placeholder,s},qn.debounce=To,qn.defaults=Ca,qn.defaultsDeep=xa,qn.defer=Po,qn.delay=jo,qn.difference=Us,qn.differenceBy=qs,qn.differenceWith=Ds,qn.drop=function(t,e,n){var i=null==t?0:t.length;return i?ii(t,(e=n||e===r?1:ma(e))<0?0:e,i):[]},qn.dropRight=function(t,e,n){var i=null==t?0:t.length;return i?ii(t,0,(e=i-(e=n||e===r?1:ma(e)))<0?0:e):[]},qn.dropRightWhile=function(t,e){return t&&t.length?pi(t,cs(e,3),!0,!0):[]},qn.dropWhile=function(t,e){return t&&t.length?pi(t,cs(e,3),!0):[]},qn.fill=function(t,e,n,i){var s=null==t?0:t.length;return s?(n&&"number"!=typeof n&&ws(t,e,n)&&(n=0,i=s),function(t,e,n,i){var s=t.length;for((n=ma(n))<0&&(n=-n>s?0:s+n),(i=i===r||i>s?s:ma(i))<0&&(i+=s),i=n>i?0:ga(i);n<i;)t[n++]=e;return t}(t,e,n,i)):[]},qn.filter=function(t,e){return(Zo(t)?Re:_r)(t,cs(e,3))},qn.flatMap=function(t,e){return vr(Ao(t,e),1)},qn.flatMapDeep=function(t,e){return vr(Ao(t,e),h)},qn.flatMapDepth=function(t,e,n){return n=n===r?1:ma(n),vr(Ao(t,e),n)},qn.flatten=Zs,qn.flattenDeep=function(t){return(null==t?0:t.length)?vr(t,h):[]},qn.flattenDepth=function(t,e){return(null==t?0:t.length)?vr(t,e=e===r?1:ma(e)):[]},qn.flip=function(t){return Xi(t,512)},qn.flow=nu,qn.flowRight=ru,qn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},qn.functions=function(t){return null==t?[]:Er(t,Ta(t))},qn.functionsIn=function(t){return null==t?[]:Er(t,Pa(t))},qn.groupBy=bo,qn.initial=function(t){return(null==t?0:t.length)?ii(t,0,-1):[]},qn.intersection=Hs,qn.intersectionBy=Js,qn.intersectionWith=Vs,qn.invert=Oa,qn.invertBy=Ia,qn.invokeMap=ko,qn.iteratee=su,qn.keyBy=Eo,qn.keys=Ta,qn.keysIn=Pa,qn.map=Ao,qn.mapKeys=function(t,e){var n={};return e=cs(e,3),br(t,(function(t,r,i){or(n,e(t,r,i),t)})),n},qn.mapValues=function(t,e){var n={};return e=cs(e,3),br(t,(function(t,r,i){or(n,r,e(t,r,i))})),n},qn.matches=function(t){return qr(cr(t,1))},qn.matchesProperty=function(t,e){return Dr(t,cr(e,1))},qn.memoize=Fo,qn.merge=ja,qn.mergeWith=Fa,qn.method=ou,qn.methodOf=au,qn.mixin=uu,qn.negate=No,qn.nthArg=function(t){return t=ma(t),Qr((function(e){return Wr(e,t)}))},qn.omit=Na,qn.omitBy=function(t,e){return Ba(t,No(cs(e)))},qn.once=function(t){return Oo(2,t)},qn.orderBy=function(t,e,n,i){return null==t?[]:(Zo(e)||(e=null==e?[]:[e]),Zo(n=i?r:n)||(n=null==n?[]:[n]),Zr(t,e,n))},qn.over=lu,qn.overArgs=zo,qn.overEvery=du,qn.overSome=hu,qn.partial=Bo,qn.partialRight=Lo,qn.partition=Co,qn.pick=za,qn.pickBy=Ba,qn.property=fu,qn.propertyOf=function(t){return function(e){return null==t?r:Ar(t,e)}},qn.pull=Qs,qn.pullAll=Xs,qn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Hr(t,e,cs(n,2)):t},qn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Hr(t,e,r,n):t},qn.pullAt=Ys,qn.range=pu,qn.rangeRight=mu,qn.rearg=Uo,qn.reject=function(t,e){return(Zo(t)?Re:_r)(t,No(cs(e,3)))},qn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],s=t.length;for(e=cs(e,3);++r<s;){var o=t[r];e(o,r,t)&&(n.push(o),i.push(r))}return Jr(t,i),n},qn.rest=function(t,e){if("function"!=typeof t)throw new It(i);return Qr(t,e=e===r?e:ma(e))},qn.reverse=to,qn.sampleSize=function(t,e,n){return e=(n?ws(t,e,n):e===r)?1:ma(e),(Zo(t)?Yn:Yr)(t,e)},qn.set=function(t,e,n){return null==t?t:ti(t,e,n)},qn.setWith=function(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:ti(t,e,n,i)},qn.shuffle=function(t){return(Zo(t)?tr:ri)(t)},qn.slice=function(t,e,n){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&ws(t,e,n)?(e=0,n=i):(e=null==e?0:ma(e),n=n===r?i:ma(n)),ii(t,e,n)):[]},qn.sortBy=xo,qn.sortedUniq=function(t){return t&&t.length?ui(t):[]},qn.sortedUniqBy=function(t,e){return t&&t.length?ui(t,cs(e,2)):[]},qn.split=function(t,e,n){return n&&"number"!=typeof n&&ws(t,e,n)&&(e=n=r),(n=n===r?m:n>>>0)?(t=ya(t))&&("string"==typeof e||null!=e&&!oa(e))&&!(e=li(e))&&an(t)?ki(pn(t),0,n):t.split(e,n):[]},qn.spread=function(t,e){if("function"!=typeof t)throw new It(i);return e=null==e?0:yn(ma(e),0),Qr((function(n){var r=n[e],i=ki(n,0,e);return r&&Fe(i,r),xe(t,this,i)}))},qn.tail=function(t){var e=null==t?0:t.length;return e?ii(t,1,e):[]},qn.take=function(t,e,n){return t&&t.length?ii(t,0,(e=n||e===r?1:ma(e))<0?0:e):[]},qn.takeRight=function(t,e,n){var i=null==t?0:t.length;return i?ii(t,(e=i-(e=n||e===r?1:ma(e)))<0?0:e,i):[]},qn.takeRightWhile=function(t,e){return t&&t.length?pi(t,cs(e,3),!1,!0):[]},qn.takeWhile=function(t,e){return t&&t.length?pi(t,cs(e,3)):[]},qn.tap=function(t,e){return e(t),t},qn.throttle=function(t,e,n){var r=!0,s=!0;if("function"!=typeof t)throw new It(i);return ea(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),To(t,e,{leading:r,maxWait:e,trailing:s})},qn.thru=po,qn.toArray=fa,qn.toPairs=La,qn.toPairsIn=Ua,qn.toPath=function(t){return Zo(t)?je(t,zs):ca(t)?[t]:Ii(Ns(ya(t)))},qn.toPlainObject=va,qn.transform=function(t,e,n){var r=Zo(t),i=r||Vo(t)||la(t);if(e=cs(e,4),null==n){var s=t&&t.constructor;n=i?r?new s:[]:ea(t)&&Xo(s)?Dn(Ht(t)):{}}return(i?Me:br)(t,(function(t,r,i){return e(n,t,r,i)})),n},qn.unary=function(t){return Mo(t,1)},qn.union=eo,qn.unionBy=no,qn.unionWith=ro,qn.uniq=function(t){return t&&t.length?di(t):[]},qn.uniqBy=function(t,e){return t&&t.length?di(t,cs(e,2)):[]},qn.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?di(t,r,e):[]},qn.unset=function(t,e){return null==t||hi(t,e)},qn.unzip=io,qn.unzipWith=so,qn.update=function(t,e,n){return null==t?t:fi(t,e,yi(n))},qn.updateWith=function(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:fi(t,e,yi(n),i)},qn.values=qa,qn.valuesIn=function(t){return null==t?[]:Ye(t,Pa(t))},qn.without=oo,qn.words=Xa,qn.wrap=function(t,e){return Bo(yi(e),t)},qn.xor=ao,qn.xorBy=uo,qn.xorWith=co,qn.zip=lo,qn.zipObject=function(t,e){return _i(t||[],e||[],nr)},qn.zipObjectDeep=function(t,e){return _i(t||[],e||[],ti)},qn.zipWith=ho,qn.entries=La,qn.entriesIn=Ua,qn.extend=ba,qn.extendWith=ka,uu(qn,qn),qn.add=vu,qn.attempt=Ya,qn.camelCase=Da,qn.capitalize=$a,qn.ceil=yu,qn.clamp=function(t,e,n){return n===r&&(n=e,e=r),n!==r&&(n=(n=_a(n))==n?n:0),e!==r&&(e=(e=_a(e))==e?e:0),ur(_a(t),e,n)},qn.clone=function(t){return cr(t,4)},qn.cloneDeep=function(t){return cr(t,5)},qn.cloneDeepWith=function(t,e){return cr(t,5,e="function"==typeof e?e:r)},qn.cloneWith=function(t,e){return cr(t,4,e="function"==typeof e?e:r)},qn.conformsTo=function(t,e){return null==e||lr(t,e,Ta(e))},qn.deburr=Wa,qn.defaultTo=function(t,e){return null==t||t!=t?e:t},qn.divide=wu,qn.endsWith=function(t,e,n){t=ya(t),e=li(e);var i=t.length,s=n=n===r?i:ur(ma(n),0,i);return(n-=e.length)>=0&&t.slice(n,s)==e},qn.eq=qo,qn.escape=function(t){return(t=ya(t))&&K.test(t)?t.replace(J,sn):t},qn.escapeRegExp=function(t){return(t=ya(t))&&it.test(t)?t.replace(rt,"\\$&"):t},qn.every=function(t,e,n){var i=Zo(t)?Ie:mr;return n&&ws(t,e,n)&&(e=r),i(t,cs(e,3))},qn.find=_o,qn.findIndex=$s,qn.findKey=function(t,e){return Ue(t,cs(e,3),br)},qn.findLast=vo,qn.findLastIndex=Ws,qn.findLastKey=function(t,e){return Ue(t,cs(e,3),kr)},qn.floor=bu,qn.forEach=yo,qn.forEachRight=wo,qn.forIn=function(t,e){return null==t?t:yr(t,cs(e,3),Pa)},qn.forInRight=function(t,e){return null==t?t:wr(t,cs(e,3),Pa)},qn.forOwn=function(t,e){return t&&br(t,cs(e,3))},qn.forOwnRight=function(t,e){return t&&kr(t,cs(e,3))},qn.get=Sa,qn.gt=Do,qn.gte=$o,qn.has=function(t,e){return null!=t&&gs(t,e,Mr)},qn.hasIn=Ma,qn.head=Gs,qn.identity=iu,qn.includes=function(t,e,n,r){t=Ho(t)?t:qa(t),n=n&&!r?ma(n):0;var i=t.length;return n<0&&(n=yn(i+n,0)),ua(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&De(t,e,n)>-1},qn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ma(n);return i<0&&(i=yn(r+i,0)),De(t,e,i)},qn.inRange=function(t,e,n){return e=pa(e),n===r?(n=e,e=0):n=pa(n),function(t,e,n){return t>=wn(e,n)&&t<yn(e,n)}(t=_a(t),e,n)},qn.invoke=Ra,qn.isArguments=Wo,qn.isArray=Zo,qn.isArrayBuffer=Go,qn.isArrayLike=Ho,qn.isArrayLikeObject=Jo,qn.isBoolean=function(t){return!0===t||!1===t||na(t)&&xr(t)==y},qn.isBuffer=Vo,qn.isDate=Ko,qn.isElement=function(t){return na(t)&&1===t.nodeType&&!sa(t)},qn.isEmpty=function(t){if(null==t)return!0;if(Ho(t)&&(Zo(t)||"string"==typeof t||"function"==typeof t.splice||Vo(t)||la(t)||Wo(t)))return!t.length;var e=ms(t);if(e==A||e==O)return!t.size;if(As(t))return!zr(t).length;for(var n in t)if(Nt.call(t,n))return!1;return!0},qn.isEqual=function(t,e){return Pr(t,e)},qn.isEqualWith=function(t,e,n){var i=(n="function"==typeof n?n:r)?n(t,e):r;return i===r?Pr(t,e,r,n):!!i},qn.isError=Qo,qn.isFinite=function(t){return"number"==typeof t&&Le(t)},qn.isFunction=Xo,qn.isInteger=Yo,qn.isLength=ta,qn.isMap=ra,qn.isMatch=function(t,e){return t===e||jr(t,e,ds(e))},qn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:r,jr(t,e,ds(e),n)},qn.isNaN=function(t){return ia(t)&&t!=+t},qn.isNative=function(t){if(Es(t))throw new At("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Fr(t)},qn.isNil=function(t){return null==t},qn.isNull=function(t){return null===t},qn.isNumber=ia,qn.isObject=ea,qn.isObjectLike=na,qn.isPlainObject=sa,qn.isRegExp=oa,qn.isSafeInteger=function(t){return Yo(t)&&t>=-9007199254740991&&t<=f},qn.isSet=aa,qn.isString=ua,qn.isSymbol=ca,qn.isTypedArray=la,qn.isUndefined=function(t){return t===r},qn.isWeakMap=function(t){return na(t)&&ms(t)==T},qn.isWeakSet=function(t){return na(t)&&"[object WeakSet]"==xr(t)},qn.join=function(t,e){return null==t?"":He.call(t,e)},qn.kebabCase=Za,qn.last=Ks,qn.lastIndexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var s=i;return n!==r&&(s=(s=ma(n))<0?yn(i+s,0):wn(s,i-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,s):qe(t,We,s,!0)},qn.lowerCase=Ga,qn.lowerFirst=Ha,qn.lt=da,qn.lte=ha,qn.max=function(t){return t&&t.length?gr(t,iu,Sr):r},qn.maxBy=function(t,e){return t&&t.length?gr(t,cs(e,2),Sr):r},qn.mean=function(t){return Ze(t,iu)},qn.meanBy=function(t,e){return Ze(t,cs(e,2))},qn.min=function(t){return t&&t.length?gr(t,iu,Lr):r},qn.minBy=function(t,e){return t&&t.length?gr(t,cs(e,2),Lr):r},qn.stubArray=gu,qn.stubFalse=_u,qn.stubObject=function(){return{}},qn.stubString=function(){return""},qn.stubTrue=function(){return!0},qn.multiply=Eu,qn.nth=function(t,e){return t&&t.length?Wr(t,ma(e)):r},qn.noConflict=function(){return pe._===this&&(pe._=qt),this},qn.noop=cu,qn.now=So,qn.pad=function(t,e,n){t=ya(t);var r=(e=ma(e))?fn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Zi(ge(i),n)+t+Zi(me(i),n)},qn.padEnd=function(t,e,n){t=ya(t);var r=(e=ma(e))?fn(t):0;return e&&r<e?t+Zi(e-r,n):t},qn.padStart=function(t,e,n){t=ya(t);var r=(e=ma(e))?fn(t):0;return e&&r<e?Zi(e-r,n)+t:t},qn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),kn(ya(t).replace(st,""),e||0)},qn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&ws(t,e,n)&&(e=n=r),n===r&&("boolean"==typeof e?(n=e,e=r):"boolean"==typeof t&&(n=t,t=r)),t===r&&e===r?(t=0,e=1):(t=pa(t),e===r?(e=t,t=0):e=pa(e)),t>e){var i=t;t=e,e=i}if(n||t%1||e%1){var s=En();return wn(t+s*(e-t+le("1e-"+((s+"").length-1))),e)}return Vr(t,e)},qn.reduce=function(t,e,n){var r=Zo(t)?Ne:Je,i=arguments.length<3;return r(t,cs(e,4),n,i,fr)},qn.reduceRight=function(t,e,n){var r=Zo(t)?ze:Je,i=arguments.length<3;return r(t,cs(e,4),n,i,pr)},qn.repeat=function(t,e,n){return e=(n?ws(t,e,n):e===r)?1:ma(e),Kr(ya(t),e)},qn.replace=function(){var t=arguments,e=ya(t[0]);return t.length<3?e:e.replace(t[1],t[2])},qn.result=function(t,e,n){var i=-1,s=(e=wi(e,t)).length;for(s||(s=1,t=r);++i<s;){var o=null==t?r:t[zs(e[i])];o===r&&(i=s,o=n),t=Xo(o)?o.call(t):o}return t},qn.round=Au,qn.runInContext=t,qn.sample=function(t){return(Zo(t)?Xn:Xr)(t)},qn.size=function(t){if(null==t)return 0;if(Ho(t))return ua(t)?fn(t):t.length;var e=ms(t);return e==A||e==O?t.size:zr(t).length},qn.snakeCase=Ja,qn.some=function(t,e,n){var i=Zo(t)?Be:si;return n&&ws(t,e,n)&&(e=r),i(t,cs(e,3))},qn.sortedIndex=function(t,e){return oi(t,e)},qn.sortedIndexBy=function(t,e,n){return ai(t,e,cs(n,2))},qn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=oi(t,e);if(r<n&&qo(t[r],e))return r}return-1},qn.sortedLastIndex=function(t,e){return oi(t,e,!0)},qn.sortedLastIndexBy=function(t,e,n){return ai(t,e,cs(n,2),!0)},qn.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=oi(t,e,!0)-1;if(qo(t[n],e))return n}return-1},qn.startCase=Va,qn.startsWith=function(t,e,n){return t=ya(t),n=null==n?0:ur(ma(n),0,t.length),e=li(e),t.slice(n,n+e.length)==e},qn.subtract=Cu,qn.sum=function(t){return t&&t.length?Ve(t,iu):0},qn.sumBy=function(t,e){return t&&t.length?Ve(t,cs(e,2)):0},qn.template=function(t,e,n){var i=qn.templateSettings;n&&ws(t,e,n)&&(e=r),t=ya(t),e=ka({},e,i,Yi);var s,o,a=ka({},e.imports,i.imports,Yi),u=Ta(a),c=Ye(a,u),l=0,d=e.interpolate||bt,h="__p += '",f=Mt((e.escape||bt).source+"|"+d.source+"|"+(d===Y?ft:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(Nt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";t.replace(f,(function(e,n,r,i,a,u){return r||(r=i),h+=t.slice(l,u).replace(kt,on),n&&(s=!0,h+="' +\n__e("+n+") +\n'"),a&&(o=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),h+="';\n";var m=Nt.call(e,"variable")&&e.variable;if(m){if(dt.test(m))throw new At("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace(W,""):h).replace(Z,"$1").replace(G,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Ya((function(){return Ct(u,p+"return "+h).apply(r,c)}));if(g.source=h,Qo(g))throw g;return g},qn.times=function(t,e){if((t=ma(t))<1||t>f)return[];var n=m,r=wn(t,m);e=cs(e),t-=m;for(var i=Ke(r,e);++n<t;)e(n);return i},qn.toFinite=pa,qn.toInteger=ma,qn.toLength=ga,qn.toLower=function(t){return ya(t).toLowerCase()},qn.toNumber=_a,qn.toSafeInteger=function(t){return t?ur(ma(t),-9007199254740991,f):0===t?t:0},qn.toString=ya,qn.toUpper=function(t){return ya(t).toUpperCase()},qn.trim=function(t,e,n){if((t=ya(t))&&(n||e===r))return Qe(t);if(!t||!(e=li(e)))return t;var i=pn(t),s=pn(e);return ki(i,en(i,s),nn(i,s)+1).join("")},qn.trimEnd=function(t,e,n){if((t=ya(t))&&(n||e===r))return t.slice(0,mn(t)+1);if(!t||!(e=li(e)))return t;var i=pn(t);return ki(i,0,nn(i,pn(e))+1).join("")},qn.trimStart=function(t,e,n){if((t=ya(t))&&(n||e===r))return t.replace(st,"");if(!t||!(e=li(e)))return t;var i=pn(t);return ki(i,en(i,pn(e))).join("")},qn.truncate=function(t,e){var n=30,i="...";if(ea(e)){var s="separator"in e?e.separator:s;n="length"in e?ma(e.length):n,i="omission"in e?li(e.omission):i}var o=(t=ya(t)).length;if(an(t)){var a=pn(t);o=a.length}if(n>=o)return t;var u=n-fn(i);if(u<1)return i;var c=a?ki(a,0,u).join(""):t.slice(0,u);if(s===r)return c+i;if(a&&(u+=c.length-u),oa(s)){if(t.slice(u).search(s)){var l,d=c;for(s.global||(s=Mt(s.source,ya(pt.exec(s))+"g")),s.lastIndex=0;l=s.exec(d);)var h=l.index;c=c.slice(0,h===r?u:h)}}else if(t.indexOf(li(s),u)!=u){var f=c.lastIndexOf(s);f>-1&&(c=c.slice(0,f))}return c+i},qn.unescape=function(t){return(t=ya(t))&&V.test(t)?t.replace(H,gn):t},qn.uniqueId=function(t){var e=++zt;return ya(t)+e},qn.upperCase=Ka,qn.upperFirst=Qa,qn.each=yo,qn.eachRight=wo,qn.first=Gs,uu(qn,(ku={},br(qn,(function(t,e){Nt.call(qn.prototype,e)||(ku[e]=t)})),ku),{chain:!1}),qn.VERSION="4.17.21",Me(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){qn[t].placeholder=qn})),Me(["drop","take"],(function(t,e){Zn.prototype[t]=function(n){n=n===r?1:yn(ma(n),0);var i=this.__filtered__&&!e?new Zn(this):this.clone();return i.__filtered__?i.__takeCount__=wn(n,i.__takeCount__):i.__views__.push({size:wn(n,m),type:t+(i.__dir__<0?"Right":"")}),i},Zn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Me(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Zn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:cs(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Me(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Zn.prototype[t]=function(){return this[n](1).value()[0]}})),Me(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Zn.prototype[t]=function(){return this.__filtered__?new Zn(this):this[n](1)}})),Zn.prototype.compact=function(){return this.filter(iu)},Zn.prototype.find=function(t){return this.filter(t).head()},Zn.prototype.findLast=function(t){return this.reverse().find(t)},Zn.prototype.invokeMap=Qr((function(t,e){return"function"==typeof t?new Zn(this):this.map((function(n){return Rr(n,t,e)}))})),Zn.prototype.reject=function(t){return this.filter(No(cs(t)))},Zn.prototype.slice=function(t,e){t=ma(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Zn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==r&&(n=(e=ma(e))<0?n.dropRight(-e):n.take(e-t)),n)},Zn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Zn.prototype.toArray=function(){return this.take(m)},br(Zn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),s=qn[i?"take"+("last"==e?"Right":""):e],o=i||/^find/.test(e);s&&(qn.prototype[e]=function(){var e=this.__wrapped__,a=i?[1]:arguments,u=e instanceof Zn,c=a[0],l=u||Zo(e),d=function(t){var e=s.apply(qn,Fe([t],a));return i&&h?e[0]:e};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,f=!!this.__actions__.length,p=o&&!h,m=u&&!f;if(!o&&l){e=m?e:new Zn(this);var g=t.apply(e,a);return g.__actions__.push({func:po,args:[d],thisArg:r}),new Wn(g,h)}return p&&m?t.apply(this,a):(g=this.thru(d),p?i?g.value()[0]:g.value():g)})})),Me(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Rt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);qn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Zo(i)?i:[],t)}return this[n]((function(n){return e.apply(Zo(n)?n:[],t)}))}})),br(Zn.prototype,(function(t,e){var n=qn[e];if(n){var r=n.name+"";Nt.call(Tn,r)||(Tn[r]=[]),Tn[r].push({name:e,func:n})}})),Tn[qi(r,2).name]=[{name:"wrapper",func:r}],Zn.prototype.clone=function(){var t=new Zn(this.__wrapped__);return t.__actions__=Ii(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ii(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ii(this.__views__),t},Zn.prototype.reverse=function(){if(this.__filtered__){var t=new Zn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Zn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Zo(t),r=e<0,i=n?t.length:0,s=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var s=n[r],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=wn(e,t+o);break;case"takeRight":t=yn(t,e-o)}}return{start:t,end:e}}(0,i,this.__views__),o=s.start,a=s.end,u=a-o,c=r?a:o-1,l=this.__iteratees__,d=l.length,h=0,f=wn(u,this.__takeCount__);if(!n||!r&&i==u&&f==u)return mi(t,this.__actions__);var p=[];t:for(;u--&&h<f;){for(var m=-1,g=t[c+=e];++m<d;){var _=l[m],v=_.iteratee,y=_.type,w=v(g);if(2==y)g=w;else if(!w){if(1==y)continue t;break t}}p[h++]=g}return p},qn.prototype.at=mo,qn.prototype.chain=function(){return fo(this)},qn.prototype.commit=function(){return new Wn(this.value(),this.__chain__)},qn.prototype.next=function(){this.__values__===r&&(this.__values__=fa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},qn.prototype.plant=function(t){for(var e,n=this;n instanceof $n;){var i=Ls(n);i.__index__=0,i.__values__=r,e?s.__wrapped__=i:e=i;var s=i;n=n.__wrapped__}return s.__wrapped__=t,e},qn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Zn){var e=t;return this.__actions__.length&&(e=new Zn(this)),(e=e.reverse()).__actions__.push({func:po,args:[to],thisArg:r}),new Wn(e,this.__chain__)}return this.thru(to)},qn.prototype.toJSON=qn.prototype.valueOf=qn.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},qn.prototype.first=qn.prototype.head,Xt&&(qn.prototype[Xt]=function(){return this}),qn}();ge?((ge.exports=_n)._=_n,me._=_n):pe._=_n}).call(t.commonjsGlobal)}(X,X.exports);var Y=X.exports;function tt(t,e){return E(t,(t=>"string"==typeof t&&e.test(t)))}const et=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,nt=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u;var rt;function it(t){const e=et.exec(t);if(!e?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:e.groups.namespace,reference:e.groups.reference}}function st(t){const e=nt.exec(t);if(!e?.groups)throw new Error("Invalid CAIP account ID.");return{address:e.groups.accountAddress,chainId:e.groups.chainId,chain:{namespace:e.groups.namespace,reference:e.groups.reference}}}tt("CaipChainId",et),tt("CaipNamespace",/^[-a-z0-9]{3,8}$/u),tt("CaipReference",/^[-_a-zA-Z0-9]{1,32}$/u),tt("CaipAccountId",nt),tt("CaipAccountAddress",/^[-.%a-zA-Z0-9]{1,128}$/u),tt("CaipAssetNamespace",/^[-a-z0-9]{3,8}$/u),tt("CaipAssetReference",/^[-.%a-zA-Z0-9]{1,128}$/u),tt("CaipTokenId",/^[-.%a-zA-Z0-9]{1,78}$/u),tt("CaipAssetType",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u),tt("CaipAssetId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u),tt("CaipAssetTypeOrId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u),function(t){t.Bip122="bip122",t.Solana="solana",t.Stellar="stellar",t.Tron="tron",t.Eip155="eip155",t.Wallet="wallet"}(rt=rt||(rt={}));const ot=t=>A(t);function at({path:t,branch:e}){const n=t[t.length-1];return R(e[e.length-2],n)}function ut(t){return new _({...t,type:`optional ${t.type}`,validator:(e,n)=>!at(n)||t.validator(e,n),refiner:(e,n)=>!at(n)||t.refiner(e,n)})}function ct(t){if(null===t||"boolean"==typeof t||"string"==typeof t)return!0;if("number"==typeof t&&Number.isFinite(t))return!0;if("object"==typeof t){let e=!0;if(Array.isArray(t)){for(let n=0;n<t.length;n++)if(!ct(t[n])){e=!1;break}return e}const n=Object.entries(t);for(let t=0;t<n.length;t++)if("string"!=typeof n[t][0]||!ct(n[t][1])){e=!1;break}return e}return!1}const lt=E("JSON",(t=>ct(t))),dt=(ht=lt,ft=O(E("any",(()=>!0)),"JSON",(t=>b(t,lt))),pt=t=>JSON.parse(JSON.stringify(t,((t,e)=>{if("__proto__"!==t&&"constructor"!==t)return e}))),new _({...ht,coercer:(t,e)=>b(t,ft)?ht.coercer(pt(t,e),e):ht.coercer(t,e)}));var ht,ft,pt;function mt(t){try{return function(t){w(t,dt)}(t),!0}catch{return!1}}const gt=function(t){const e=f(t),n=typeof t;return new _({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?t:null,validator:n=>n===t||`Expected the literal \`${e}\`, but received: ${f(n)}`})}("2.0"),_t=function(t){return new _({...t,validator:(e,n)=>null===e||t.validator(e,n),refiner:(e,n)=>null===e||t.refiner(e,n)})}(S([E("number",(t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${f(t)}`)),x()])),vt=ot({code:E("integer",(t=>"number"==typeof t&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${f(t)}`)),message:x(),data:ut(dt),stack:ut(x())}),yt=S([(bt=x(),kt=dt,new _({type:"record",schema:null,*entries(t){if(h(t))for(const e in t){const n=t[e];yield[e,e,bt],yield[e,n,kt]}},validator:t=>h(t)||`Expected an object, but received: ${f(t)}`})),(wt=dt,new _({type:"array",schema:wt,*entries(t){if(wt&&Array.isArray(t))for(const[e,n]of t.entries())yield[e,n,wt]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${f(t)}`}))]);var wt,bt,kt;ot({id:_t,jsonrpc:gt,method:x(),params:ut(yt)}),ot({jsonrpc:gt,method:x(),params:ut(yt)}),A({id:_t,jsonrpc:gt,result:C(E("unknown",(()=>!0))),error:C(vt)});S([ot({id:_t,jsonrpc:gt,result:dt}),ot({id:_t,jsonrpc:gt,error:vt})]);function Et(t){let e=t.length;for(;--e>=0;)t[e]=0}const At=256,Ct=286,xt=30,St=15,Mt=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Ot=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),It=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Rt=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Tt=new Array(576);Et(Tt);const Pt=new Array(60);Et(Pt);const jt=new Array(512);Et(jt);const Ft=new Array(256);Et(Ft);const Nt=new Array(29);Et(Nt);const zt=new Array(xt);function Bt(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}let Lt,Ut,qt;function Dt(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}Et(zt);const $t=t=>t<256?jt[t]:jt[256+(t>>>7)],Wt=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},Zt=(t,e,n)=>{t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,Wt(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},Gt=(t,e,n)=>{Zt(t,n[2*e],n[2*e+1])},Ht=(t,e)=>{let n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1},Jt=(t,e,n)=>{const r=new Array(16);let i,s,o=0;for(i=1;i<=St;i++)o=o+n[i-1]<<1,r[i]=o;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=Ht(r[e]++,e))}},Vt=t=>{let e;for(e=0;e<Ct;e++)t.dyn_ltree[2*e]=0;for(e=0;e<xt;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Kt=t=>{t.bi_valid>8?Wt(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},Qt=(t,e,n,r)=>{const i=2*e,s=2*n;return t[i]<t[s]||t[i]===t[s]&&r[e]<=r[n]},Xt=(t,e,n)=>{const r=t.heap[n];let i=n<<1;for(;i<=t.heap_len&&(i<t.heap_len&&Qt(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!Qt(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r},Yt=(t,e,n)=>{let r,i,s,o,a=0;if(0!==t.sym_next)do{r=255&t.pending_buf[t.sym_buf+a++],r+=(255&t.pending_buf[t.sym_buf+a++])<<8,i=t.pending_buf[t.sym_buf+a++],0===r?Gt(t,i,e):(s=Ft[i],Gt(t,s+At+1,e),o=Mt[s],0!==o&&(i-=Nt[s],Zt(t,i,o)),r--,s=$t(r),Gt(t,s,n),o=Ot[s],0!==o&&(r-=zt[s],Zt(t,r,o)))}while(a<t.sym_next);Gt(t,256,e)},te=(t,e)=>{const n=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,a,u,c=-1;for(t.heap_len=0,t.heap_max=573,o=0;o<s;o++)0!==n[2*o]?(t.heap[++t.heap_len]=c=o,t.depth[o]=0):n[2*o+1]=0;for(;t.heap_len<2;)u=t.heap[++t.heap_len]=c<2?++c:0,n[2*u]=1,t.depth[u]=0,t.opt_len--,i&&(t.static_len-=r[2*u+1]);for(e.max_code=c,o=t.heap_len>>1;o>=1;o--)Xt(t,n,o);u=s;do{o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Xt(t,n,1),a=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=a,n[2*u]=n[2*o]+n[2*a],t.depth[u]=(t.depth[o]>=t.depth[a]?t.depth[o]:t.depth[a])+1,n[2*o+1]=n[2*a+1]=u,t.heap[1]=u++,Xt(t,n,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,u=e.stat_desc.max_length;let c,l,d,h,f,p,m=0;for(h=0;h<=St;h++)t.bl_count[h]=0;for(n[2*t.heap[t.heap_max]+1]=0,c=t.heap_max+1;c<573;c++)l=t.heap[c],h=n[2*n[2*l+1]+1]+1,h>u&&(h=u,m++),n[2*l+1]=h,l>r||(t.bl_count[h]++,f=0,l>=a&&(f=o[l-a]),p=n[2*l],t.opt_len+=p*(h+f),s&&(t.static_len+=p*(i[2*l+1]+f)));if(0!==m){do{for(h=u-1;0===t.bl_count[h];)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[u]--,m-=2}while(m>0);for(h=u;0!==h;h--)for(l=t.bl_count[h];0!==l;)d=t.heap[--c],d>r||(n[2*d+1]!==h&&(t.opt_len+=(h-n[2*d+1])*n[2*d],n[2*d+1]=h),l--)}})(t,e),Jt(n,c,t.bl_count)},ee=(t,e,n)=>{let r,i,s=-1,o=e[1],a=0,u=7,c=4;for(0===o&&(u=138,c=3),e[2*(n+1)+1]=65535,r=0;r<=n;r++)i=o,o=e[2*(r+1)+1],++a<u&&i===o||(a<c?t.bl_tree[2*i]+=a:0!==i?(i!==s&&t.bl_tree[2*i]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,s=i,0===o?(u=138,c=3):i===o?(u=6,c=3):(u=7,c=4))},ne=(t,e,n)=>{let r,i,s=-1,o=e[1],a=0,u=7,c=4;for(0===o&&(u=138,c=3),r=0;r<=n;r++)if(i=o,o=e[2*(r+1)+1],!(++a<u&&i===o)){if(a<c)do{Gt(t,i,t.bl_tree)}while(0!=--a);else 0!==i?(i!==s&&(Gt(t,i,t.bl_tree),a--),Gt(t,16,t.bl_tree),Zt(t,a-3,2)):a<=10?(Gt(t,17,t.bl_tree),Zt(t,a-3,3)):(Gt(t,18,t.bl_tree),Zt(t,a-11,7));a=0,s=i,0===o?(u=138,c=3):i===o?(u=6,c=3):(u=7,c=4)}};let re=!1;const ie=(t,e,n,r)=>{Zt(t,0+(r?1:0),3),Kt(t),Wt(t,n),Wt(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n};var se=(t,e,n,r)=>{let i,s,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<At;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),te(t,t.l_desc),te(t,t.d_desc),o=(t=>{let e;for(ee(t,t.dyn_ltree,t.l_desc.max_code),ee(t,t.dyn_dtree,t.d_desc.max_code),te(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*Rt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?ie(t,e,n,r):4===t.strategy||s===i?(Zt(t,2+(r?1:0),3),Yt(t,Tt,Pt)):(Zt(t,4+(r?1:0),3),((t,e,n,r)=>{let i;for(Zt(t,e-257,5),Zt(t,n-1,5),Zt(t,r-4,4),i=0;i<r;i++)Zt(t,t.bl_tree[2*Rt[i]+1],3);ne(t,t.dyn_ltree,e-1),ne(t,t.dyn_dtree,n-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),Yt(t,t.dyn_ltree,t.dyn_dtree)),Vt(t),r&&Kt(t)},oe={_tr_init:t=>{re||((()=>{let t,e,n,r,i;const s=new Array(16);for(n=0,r=0;r<28;r++)for(Nt[r]=n,t=0;t<1<<Mt[r];t++)Ft[n++]=r;for(Ft[n-1]=r,i=0,r=0;r<16;r++)for(zt[r]=i,t=0;t<1<<Ot[r];t++)jt[i++]=r;for(i>>=7;r<xt;r++)for(zt[r]=i<<7,t=0;t<1<<Ot[r]-7;t++)jt[256+i++]=r;for(e=0;e<=St;e++)s[e]=0;for(t=0;t<=143;)Tt[2*t+1]=8,t++,s[8]++;for(;t<=255;)Tt[2*t+1]=9,t++,s[9]++;for(;t<=279;)Tt[2*t+1]=7,t++,s[7]++;for(;t<=287;)Tt[2*t+1]=8,t++,s[8]++;for(Jt(Tt,287,s),t=0;t<xt;t++)Pt[2*t+1]=5,Pt[2*t]=Ht(t,5);Lt=new Bt(Tt,Mt,257,Ct,St),Ut=new Bt(Pt,Ot,0,xt,St),qt=new Bt(new Array(0),It,0,19,7)})(),re=!0),t.l_desc=new Dt(t.dyn_ltree,Lt),t.d_desc=new Dt(t.dyn_dtree,Ut),t.bl_desc=new Dt(t.bl_tree,qt),t.bi_buf=0,t.bi_valid=0,Vt(t)},_tr_stored_block:ie,_tr_flush_block:se,_tr_tally:(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(Ft[n]+At+1)]++,t.dyn_dtree[2*$t(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{Zt(t,2,3),Gt(t,256,Tt),(t=>{16===t.bi_valid?(Wt(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var ae=(t,e,n,r)=>{let i=65535&t|0,s=t>>>16&65535|0,o=0;for(;0!==n;){o=n>2e3?2e3:n,n-=o;do{i=i+e[r++]|0,s=s+i|0}while(--o);i%=65521,s%=65521}return i|s<<16|0};const ue=new Uint32Array((()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e})());var ce=(t,e,n,r)=>{const i=ue,s=r+n;t^=-1;for(let n=r;n<s;n++)t=t>>>8^i[255&(t^e[n])];return-1^t},le={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},de={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:he,_tr_stored_block:fe,_tr_flush_block:pe,_tr_tally:me,_tr_align:ge}=oe,{Z_NO_FLUSH:_e,Z_PARTIAL_FLUSH:ve,Z_FULL_FLUSH:ye,Z_FINISH:we,Z_BLOCK:be,Z_OK:ke,Z_STREAM_END:Ee,Z_STREAM_ERROR:Ae,Z_DATA_ERROR:Ce,Z_BUF_ERROR:xe,Z_DEFAULT_COMPRESSION:Se,Z_FILTERED:Me,Z_HUFFMAN_ONLY:Oe,Z_RLE:Ie,Z_FIXED:Re,Z_DEFAULT_STRATEGY:Te,Z_UNKNOWN:Pe,Z_DEFLATED:je}=de,Fe=258,Ne=262,ze=42,Be=113,Le=666,Ue=(t,e)=>(t.msg=le[e],e),qe=t=>2*t-(t>4?9:0),De=t=>{let e=t.length;for(;--e>=0;)t[e]=0},$e=t=>{let e,n,r,i=t.w_size;e=t.hash_size,r=e;do{n=t.head[--r],t.head[r]=n>=i?n-i:0}while(--e);e=i,r=e;do{n=t.prev[--r],t.prev[r]=n>=i?n-i:0}while(--e)};let We=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask;const Ze=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))},Ge=(t,e)=>{pe(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Ze(t.strm)},He=(t,e)=>{t.pending_buf[t.pending++]=e},Je=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Ve=(t,e,n,r)=>{let i=t.avail_in;return i>r&&(i=r),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),n),1===t.state.wrap?t.adler=ae(t.adler,e,i,n):2===t.state.wrap&&(t.adler=ce(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)},Ke=(t,e)=>{let n,r,i=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match;const u=t.strstart>t.w_size-Ne?t.strstart-(t.w_size-Ne):0,c=t.window,l=t.w_mask,d=t.prev,h=t.strstart+Fe;let f=c[s+o-1],p=c[s+o];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(n=e,c[n+o]===p&&c[n+o-1]===f&&c[n]===c[s]&&c[++n]===c[s+1]){s+=2,n++;do{}while(c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&s<h);if(r=Fe-(h-s),s=h-Fe,r>o){if(t.match_start=e,o=r,r>=a)break;f=c[s+o-1],p=c[s+o]}}}while((e=d[e&l])>u&&0!=--i);return o<=t.lookahead?o:t.lookahead},Qe=t=>{const e=t.w_size;let n,r,i;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Ne)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),$e(t),r+=e),0===t.strm.avail_in)break;if(n=Ve(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=n,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=We(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=We(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<Ne&&0!==t.strm.avail_in)},Xe=(t,e)=>{let n,r,i,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,o=0,a=t.strm.avail_in;do{if(n=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,r=t.strstart-t.block_start,n>r+t.strm.avail_in&&(n=r+t.strm.avail_in),n>i&&(n=i),n<s&&(0===n&&e!==we||e===_e||n!==r+t.strm.avail_in))break;o=e===we&&n===r+t.strm.avail_in?1:0,fe(t,0,0,o),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,Ze(t.strm),r&&(r>n&&(r=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+r),t.strm.next_out),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r,t.block_start+=r,n-=r),n&&(Ve(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(0===o);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?4:e!==_e&&e!==we&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(Ve(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i,s=i>t.w_size?t.w_size:i,r=t.strstart-t.block_start,(r>=s||(r||e===we)&&e!==_e&&0===t.strm.avail_in&&r<=i)&&(n=r>i?i:r,o=e===we&&0===t.strm.avail_in&&n===r?1:0,fe(t,t.block_start,n,o),t.block_start+=n,Ze(t.strm)),o?3:1)},Ye=(t,e)=>{let n,r;for(;;){if(t.lookahead<Ne){if(Qe(t),t.lookahead<Ne&&e===_e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=We(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-Ne&&(t.match_length=Ke(t,n)),t.match_length>=3)if(r=me(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=We(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=We(t,t.ins_h,t.window[t.strstart+1]);else r=me(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(Ge(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===we?(Ge(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Ge(t,!1),0===t.strm.avail_out)?1:2},tn=(t,e)=>{let n,r,i;for(;;){if(t.lookahead<Ne){if(Qe(t),t.lookahead<Ne&&e===_e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=We(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-Ne&&(t.match_length=Ke(t,n),t.match_length<=5&&(t.strategy===Me||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,r=me(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=We(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(Ge(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(r=me(t,0,t.window[t.strstart-1]),r&&Ge(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=me(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===we?(Ge(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Ge(t,!1),0===t.strm.avail_out)?1:2};function en(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}const nn=[new en(0,0,0,0,Xe),new en(4,4,8,4,Ye),new en(4,5,16,8,Ye),new en(4,6,32,32,Ye),new en(4,4,16,16,tn),new en(8,16,32,32,tn),new en(8,16,128,128,tn),new en(8,32,128,256,tn),new en(32,128,258,1024,tn),new en(32,258,258,4096,tn)];function rn(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=je,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),De(this.dyn_ltree),De(this.dyn_dtree),De(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),De(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),De(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const sn=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==ze&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==Be&&e.status!==Le?1:0},on=t=>{if(sn(t))return Ue(t,Ae);t.total_in=t.total_out=0,t.data_type=Pe;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?ze:Be,t.adler=2===e.wrap?0:1,e.last_flush=-2,he(e),ke},an=t=>{const e=on(t);var n;return e===ke&&((n=t.state).window_size=2*n.w_size,De(n.head),n.max_lazy_match=nn[n.level].max_lazy,n.good_match=nn[n.level].good_length,n.nice_match=nn[n.level].nice_length,n.max_chain_length=nn[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),e},un=(t,e,n,r,i,s)=>{if(!t)return Ae;let o=1;if(e===Se&&(e=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>9||n!==je||r<8||r>15||e<0||e>9||s<0||s>Re||8===r&&1!==o)return Ue(t,Ae);8===r&&(r=9);const a=new rn;return t.state=a,a.strm=t,a.status=ze,a.wrap=o,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=e,a.strategy=s,a.method=n,an(t)};var cn={deflateInit:(t,e)=>un(t,e,je,15,8,Te),deflateInit2:un,deflateReset:an,deflateResetKeep:on,deflateSetHeader:(t,e)=>sn(t)||2!==t.state.wrap?Ae:(t.state.gzhead=e,ke),deflate:(t,e)=>{if(sn(t)||e>be||e<0)return t?Ue(t,Ae):Ae;const n=t.state;if(!t.output||0!==t.avail_in&&!t.input||n.status===Le&&e!==we)return Ue(t,0===t.avail_out?xe:Ae);const r=n.last_flush;if(n.last_flush=e,0!==n.pending){if(Ze(t),0===t.avail_out)return n.last_flush=-1,ke}else if(0===t.avail_in&&qe(e)<=qe(r)&&e!==we)return Ue(t,xe);if(n.status===Le&&0!==t.avail_in)return Ue(t,xe);if(n.status===ze&&0===n.wrap&&(n.status=Be),n.status===ze){let e=je+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=Oe||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=r<<6,0!==n.strstart&&(e|=32),e+=31-e%31,Je(n,e),0!==n.strstart&&(Je(n,t.adler>>>16),Je(n,65535&t.adler)),t.adler=1,n.status=Be,Ze(t),0!==n.pending)return n.last_flush=-1,ke}if(57===n.status)if(t.adler=0,He(n,31),He(n,139),He(n,8),n.gzhead)He(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),He(n,255&n.gzhead.time),He(n,n.gzhead.time>>8&255),He(n,n.gzhead.time>>16&255),He(n,n.gzhead.time>>24&255),He(n,9===n.level?2:n.strategy>=Oe||n.level<2?4:0),He(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(He(n,255&n.gzhead.extra.length),He(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=ce(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(He(n,0),He(n,0),He(n,0),He(n,0),He(n,0),He(n,9===n.level?2:n.strategy>=Oe||n.level<2?4:0),He(n,3),n.status=Be,Ze(t),0!==n.pending)return n.last_flush=-1,ke;if(69===n.status){if(n.gzhead.extra){let e=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>e&&(t.adler=ce(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex+=i,Ze(t),0!==n.pending)return n.last_flush=-1,ke;e=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>e&&(t.adler=ce(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let e,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=ce(t.adler,n.pending_buf,n.pending-r,r)),Ze(t),0!==n.pending)return n.last_flush=-1,ke;r=0}e=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,He(n,e)}while(0!==e);n.gzhead.hcrc&&n.pending>r&&(t.adler=ce(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let e,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=ce(t.adler,n.pending_buf,n.pending-r,r)),Ze(t),0!==n.pending)return n.last_flush=-1,ke;r=0}e=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,He(n,e)}while(0!==e);n.gzhead.hcrc&&n.pending>r&&(t.adler=ce(t.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Ze(t),0!==n.pending))return n.last_flush=-1,ke;He(n,255&t.adler),He(n,t.adler>>8&255),t.adler=0}if(n.status=Be,Ze(t),0!==n.pending)return n.last_flush=-1,ke}if(0!==t.avail_in||0!==n.lookahead||e!==_e&&n.status!==Le){let r=0===n.level?Xe(n,e):n.strategy===Oe?((t,e)=>{let n;for(;;){if(0===t.lookahead&&(Qe(t),0===t.lookahead)){if(e===_e)return 1;break}if(t.match_length=0,n=me(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(Ge(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===we?(Ge(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Ge(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===Ie?((t,e)=>{let n,r,i,s;const o=t.window;for(;;){if(t.lookahead<=Fe){if(Qe(t),t.lookahead<=Fe&&e===_e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=t.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){s=t.strstart+Fe;do{}while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<s);t.match_length=Fe-(s-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=me(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=me(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(Ge(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===we?(Ge(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Ge(t,!1),0===t.strm.avail_out)?1:2})(n,e):nn[n.level].func(n,e);if(3!==r&&4!==r||(n.status=Le),1===r||3===r)return 0===t.avail_out&&(n.last_flush=-1),ke;if(2===r&&(e===ve?ge(n):e!==be&&(fe(n,0,0,!1),e===ye&&(De(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Ze(t),0===t.avail_out))return n.last_flush=-1,ke}return e!==we?ke:n.wrap<=0?Ee:(2===n.wrap?(He(n,255&t.adler),He(n,t.adler>>8&255),He(n,t.adler>>16&255),He(n,t.adler>>24&255),He(n,255&t.total_in),He(n,t.total_in>>8&255),He(n,t.total_in>>16&255),He(n,t.total_in>>24&255)):(Je(n,t.adler>>>16),Je(n,65535&t.adler)),Ze(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?ke:Ee)},deflateEnd:t=>{if(sn(t))return Ae;const e=t.state.status;return t.state=null,e===Be?Ue(t,Ce):ke},deflateSetDictionary:(t,e)=>{let n=e.length;if(sn(t))return Ae;const r=t.state,i=r.wrap;if(2===i||1===i&&r.status!==ze||r.lookahead)return Ae;if(1===i&&(t.adler=ae(t.adler,e,n,0)),r.wrap=0,n>=r.w_size){0===i&&(De(r.head),r.strstart=0,r.block_start=0,r.insert=0);let t=new Uint8Array(r.w_size);t.set(e.subarray(n-r.w_size,n),0),e=t,n=r.w_size}const s=t.avail_in,o=t.next_in,a=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,Qe(r);r.lookahead>=3;){let t=r.strstart,e=r.lookahead-2;do{r.ins_h=We(r,r.ins_h,r.window[t+3-1]),r.prev[t&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=t,t++}while(--e);r.strstart=t,r.lookahead=2,Qe(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,t.next_in=o,t.input=a,t.avail_in=s,r.wrap=i,ke},deflateInfo:"pako deflate (from Nodeca project)"};const ln=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var dn={assign:function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const e in n)ln(n,e)&&(t[e]=n[e])}}return t},flattenChunks:t=>{let e=0;for(let n=0,r=t.length;n<r;n++)e+=t[n].length;const n=new Uint8Array(e);for(let e=0,r=0,i=t.length;e<i;e++){let i=t[e];n.set(i,r),r+=i.length}return n}};let hn=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){hn=!1}const fn=new Uint8Array(256);for(let t=0;t<256;t++)fn[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;fn[254]=fn[254]=1;var pn={string2buf:t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,n,r,i,s,o=t.length,a=0;for(i=0;i<o;i++)n=t.charCodeAt(i),55296==(64512&n)&&i+1<o&&(r=t.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),a+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(a),s=0,i=0;s<a;i++)n=t.charCodeAt(i),55296==(64512&n)&&i+1<o&&(r=t.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},buf2string:(t,e)=>{const n=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let r,i;const s=new Array(2*n);for(i=0,r=0;r<n;){let e=t[r++];if(e<128){s[i++]=e;continue}let o=fn[e];if(o>4)s[i++]=65533,r+=o-1;else{for(e&=2===o?31:3===o?15:7;o>1&&r<n;)e=e<<6|63&t[r++],o--;o>1?s[i++]=65533:e<65536?s[i++]=e:(e-=65536,s[i++]=55296|e>>10&1023,s[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&hn)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n})(s,i)},utf8border:(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let n=e-1;for(;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+fn[t[n]]>e?n:e}};var mn=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const gn=Object.prototype.toString,{Z_NO_FLUSH:_n,Z_SYNC_FLUSH:vn,Z_FULL_FLUSH:yn,Z_FINISH:wn,Z_OK:bn,Z_STREAM_END:kn,Z_DEFAULT_COMPRESSION:En,Z_DEFAULT_STRATEGY:An,Z_DEFLATED:Cn}=de;function xn(t){this.options=dn.assign({level:En,method:Cn,chunkSize:16384,windowBits:15,memLevel:8,strategy:An},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new mn,this.strm.avail_out=0;let n=cn.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==bn)throw new Error(le[n]);if(e.header&&cn.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?pn.string2buf(e.dictionary):"[object ArrayBuffer]"===gn.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,n=cn.deflateSetDictionary(this.strm,t),n!==bn)throw new Error(le[n]);this._dict_set=!0}}function Sn(t,e){const n=new xn(e);if(n.push(t,!0),n.err)throw n.msg||le[n.err];return n.result}xn.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize;let i,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?wn:_n,"string"==typeof t?n.input=pn.string2buf(t):"[object ArrayBuffer]"===gn.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(s===vn||s===yn)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(i=cn.deflate(n,s),i===kn)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=cn.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===bn;if(0!==n.avail_out){if(s>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},xn.prototype.onData=function(t){this.chunks.push(t)},xn.prototype.onEnd=function(t){t===bn&&(this.result=dn.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Mn={Deflate:xn,deflate:Sn,deflateRaw:function(t,e){return(e=e||{}).raw=!0,Sn(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,Sn(t,e)},constants:de};const On=16209;var In=function(t,e){let n,r,i,s,o,a,u,c,l,d,h,f,p,m,g,_,v,y,w,b,k,E,A,C;const x=t.state;n=t.next_in,A=t.input,r=n+(t.avail_in-5),i=t.next_out,C=t.output,s=i-(e-t.avail_out),o=i+(t.avail_out-257),a=x.dmax,u=x.wsize,c=x.whave,l=x.wnext,d=x.window,h=x.hold,f=x.bits,p=x.lencode,m=x.distcode,g=(1<<x.lenbits)-1,_=(1<<x.distbits)-1;t:do{f<15&&(h+=A[n++]<<f,f+=8,h+=A[n++]<<f,f+=8),v=p[h&g];e:for(;;){if(y=v>>>24,h>>>=y,f-=y,y=v>>>16&255,0===y)C[i++]=65535&v;else{if(!(16&y)){if(0==(64&y)){v=p[(65535&v)+(h&(1<<y)-1)];continue e}if(32&y){x.mode=16191;break t}t.msg="invalid literal/length code",x.mode=On;break t}w=65535&v,y&=15,y&&(f<y&&(h+=A[n++]<<f,f+=8),w+=h&(1<<y)-1,h>>>=y,f-=y),f<15&&(h+=A[n++]<<f,f+=8,h+=A[n++]<<f,f+=8),v=m[h&_];n:for(;;){if(y=v>>>24,h>>>=y,f-=y,y=v>>>16&255,!(16&y)){if(0==(64&y)){v=m[(65535&v)+(h&(1<<y)-1)];continue n}t.msg="invalid distance code",x.mode=On;break t}if(b=65535&v,y&=15,f<y&&(h+=A[n++]<<f,f+=8,f<y&&(h+=A[n++]<<f,f+=8)),b+=h&(1<<y)-1,b>a){t.msg="invalid distance too far back",x.mode=On;break t}if(h>>>=y,f-=y,y=i-s,b>y){if(y=b-y,y>c&&x.sane){t.msg="invalid distance too far back",x.mode=On;break t}if(k=0,E=d,0===l){if(k+=u-y,y<w){w-=y;do{C[i++]=d[k++]}while(--y);k=i-b,E=C}}else if(l<y){if(k+=u+l-y,y-=l,y<w){w-=y;do{C[i++]=d[k++]}while(--y);if(k=0,l<w){y=l,w-=y;do{C[i++]=d[k++]}while(--y);k=i-b,E=C}}}else if(k+=l-y,y<w){w-=y;do{C[i++]=d[k++]}while(--y);k=i-b,E=C}for(;w>2;)C[i++]=E[k++],C[i++]=E[k++],C[i++]=E[k++],w-=3;w&&(C[i++]=E[k++],w>1&&(C[i++]=E[k++]))}else{k=i-b;do{C[i++]=C[k++],C[i++]=C[k++],C[i++]=C[k++],w-=3}while(w>2);w&&(C[i++]=C[k++],w>1&&(C[i++]=C[k++]))}break}}break}}while(n<r&&i<o);w=f>>3,n-=w,f-=w<<3,h&=(1<<f)-1,t.next_in=n,t.next_out=i,t.avail_in=n<r?r-n+5:5-(n-r),t.avail_out=i<o?o-i+257:257-(i-o),x.hold=h,x.bits=f};const Rn=15,Tn=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Pn=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),jn=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Fn=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Nn=(t,e,n,r,i,s,o,a)=>{const u=a.bits;let c,l,d,h,f,p,m=0,g=0,_=0,v=0,y=0,w=0,b=0,k=0,E=0,A=0,C=null;const x=new Uint16Array(16),S=new Uint16Array(16);let M,O,I,R=null;for(m=0;m<=Rn;m++)x[m]=0;for(g=0;g<r;g++)x[e[n+g]]++;for(y=u,v=Rn;v>=1&&0===x[v];v--);if(y>v&&(y=v),0===v)return i[s++]=20971520,i[s++]=20971520,a.bits=1,0;for(_=1;_<v&&0===x[_];_++);for(y<_&&(y=_),k=1,m=1;m<=Rn;m++)if(k<<=1,k-=x[m],k<0)return-1;if(k>0&&(0===t||1!==v))return-1;for(S[1]=0,m=1;m<Rn;m++)S[m+1]=S[m]+x[m];for(g=0;g<r;g++)0!==e[n+g]&&(o[S[e[n+g]]++]=g);if(0===t?(C=R=o,p=20):1===t?(C=Tn,R=Pn,p=257):(C=jn,R=Fn,p=0),A=0,g=0,m=_,f=s,w=y,b=0,d=-1,E=1<<y,h=E-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){M=m-b,o[g]+1<p?(O=0,I=o[g]):o[g]>=p?(O=R[o[g]-p],I=C[o[g]-p]):(O=96,I=0),c=1<<m-b,l=1<<w,_=l;do{l-=c,i[f+(A>>b)+l]=M<<24|O<<16|I|0}while(0!==l);for(c=1<<m-1;A&c;)c>>=1;if(0!==c?(A&=c-1,A+=c):A=0,g++,0==--x[m]){if(m===v)break;m=e[n+o[g]]}if(m>y&&(A&h)!==d){for(0===b&&(b=y),f+=_,w=m-b,k=1<<w;w+b<v&&(k-=x[w+b],!(k<=0));)w++,k<<=1;if(E+=1<<w,1===t&&E>852||2===t&&E>592)return 1;d=A&h,i[d]=y<<24|w<<16|f-s|0}}return 0!==A&&(i[f+A]=m-b<<24|64<<16|0),a.bits=y,0};const{Z_FINISH:zn,Z_BLOCK:Bn,Z_TREES:Ln,Z_OK:Un,Z_STREAM_END:qn,Z_NEED_DICT:Dn,Z_STREAM_ERROR:$n,Z_DATA_ERROR:Wn,Z_MEM_ERROR:Zn,Z_BUF_ERROR:Gn,Z_DEFLATED:Hn}=de,Jn=16180,Vn=16190,Kn=16191,Qn=16192,Xn=16194,Yn=16199,tr=16200,er=16206,nr=16209,rr=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function ir(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const sr=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<Jn||e.mode>16211?1:0},or=t=>{if(sr(t))return $n;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Jn,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,Un},ar=t=>{if(sr(t))return $n;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,or(t)},ur=(t,e)=>{let n;if(sr(t))return $n;const r=t.state;return e<0?(n=0,e=-e):(n=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?$n:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,ar(t))},cr=(t,e)=>{if(!t)return $n;const n=new ir;t.state=n,n.strm=t,n.window=null,n.mode=Jn;const r=ur(t,e);return r!==Un&&(t.state=null),r};let lr,dr,hr=!0;const fr=t=>{if(hr){lr=new Int32Array(512),dr=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Nn(1,t.lens,0,288,lr,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Nn(2,t.lens,0,32,dr,0,t.work,{bits:5}),hr=!1}t.lencode=lr,t.lenbits=9,t.distcode=dr,t.distbits=5},pr=(t,e,n,r)=>{let i;const s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),r>=s.wsize?(s.window.set(e.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),s.window.set(e.subarray(n-r,n-r+i),s.wnext),(r-=i)?(s.window.set(e.subarray(n-r,n),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0};var mr={inflateReset:ar,inflateReset2:ur,inflateResetKeep:or,inflateInit:t=>cr(t,15),inflateInit2:cr,inflate:(t,e)=>{let n,r,i,s,o,a,u,c,l,d,h,f,p,m,g,_,v,y,w,b,k,E,A=0;const C=new Uint8Array(4);let x,S;const M=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(sr(t)||!t.output||!t.input&&0!==t.avail_in)return $n;n=t.state,n.mode===Kn&&(n.mode=Qn),o=t.next_out,i=t.output,u=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,c=n.hold,l=n.bits,d=a,h=u,E=Un;t:for(;;)switch(n.mode){case Jn:if(0===n.wrap){n.mode=Qn;break}for(;l<16;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(2&n.wrap&&35615===c){0===n.wbits&&(n.wbits=15),n.check=0,C[0]=255&c,C[1]=c>>>8&255,n.check=ce(n.check,C,2,0),c=0,l=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",n.mode=nr;break}if((15&c)!==Hn){t.msg="unknown compression method",n.mode=nr;break}if(c>>>=4,l-=4,k=8+(15&c),0===n.wbits&&(n.wbits=k),k>15||k>n.wbits){t.msg="invalid window size",n.mode=nr;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=512&c?16189:Kn,c=0,l=0;break;case 16181:for(;l<16;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(n.flags=c,(255&n.flags)!==Hn){t.msg="unknown compression method",n.mode=nr;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=nr;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&4&n.wrap&&(C[0]=255&c,C[1]=c>>>8&255,n.check=ce(n.check,C,2,0)),c=0,l=0,n.mode=16182;case 16182:for(;l<32;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}n.head&&(n.head.time=c),512&n.flags&&4&n.wrap&&(C[0]=255&c,C[1]=c>>>8&255,C[2]=c>>>16&255,C[3]=c>>>24&255,n.check=ce(n.check,C,4,0)),c=0,l=0,n.mode=16183;case 16183:for(;l<16;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&4&n.wrap&&(C[0]=255&c,C[1]=c>>>8&255,n.check=ce(n.check,C,2,0)),c=0,l=0,n.mode=16184;case 16184:if(1024&n.flags){for(;l<16;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&4&n.wrap&&(C[0]=255&c,C[1]=c>>>8&255,n.check=ce(n.check,C,2,0)),c=0,l=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(f=n.length,f>a&&(f=a),f&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(s,s+f),k)),512&n.flags&&4&n.wrap&&(n.check=ce(n.check,r,f,s)),a-=f,s+=f,n.length-=f),n.length))break t;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===a)break t;f=0;do{k=r[s+f++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k))}while(k&&f<a);if(512&n.flags&&4&n.wrap&&(n.check=ce(n.check,r,f,s)),a-=f,s+=f,k)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===a)break t;f=0;do{k=r[s+f++],n.head&&k&&n.length<65536&&(n.head.comment+=String.fromCharCode(k))}while(k&&f<a);if(512&n.flags&&4&n.wrap&&(n.check=ce(n.check,r,f,s)),a-=f,s+=f,k)break t}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;l<16;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(4&n.wrap&&c!==(65535&n.check)){t.msg="header crc mismatch",n.mode=nr;break}c=0,l=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=Kn;break;case 16189:for(;l<32;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}t.adler=n.check=rr(c),c=0,l=0,n.mode=Vn;case Vn:if(0===n.havedict)return t.next_out=o,t.avail_out=u,t.next_in=s,t.avail_in=a,n.hold=c,n.bits=l,Dn;t.adler=n.check=1,n.mode=Kn;case Kn:if(e===Bn||e===Ln)break t;case Qn:if(n.last){c>>>=7&l,l-=7&l,n.mode=er;break}for(;l<3;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}switch(n.last=1&c,c>>>=1,l-=1,3&c){case 0:n.mode=16193;break;case 1:if(fr(n),n.mode=Yn,e===Ln){c>>>=2,l-=2;break t}break;case 2:n.mode=16196;break;case 3:t.msg="invalid block type",n.mode=nr}c>>>=2,l-=2;break;case 16193:for(c>>>=7&l,l-=7&l;l<32;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){t.msg="invalid stored block lengths",n.mode=nr;break}if(n.length=65535&c,c=0,l=0,n.mode=Xn,e===Ln)break t;case Xn:n.mode=16195;case 16195:if(f=n.length,f){if(f>a&&(f=a),f>u&&(f=u),0===f)break t;i.set(r.subarray(s,s+f),o),a-=f,s+=f,u-=f,o+=f,n.length-=f;break}n.mode=Kn;break;case 16196:for(;l<14;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(n.nlen=257+(31&c),c>>>=5,l-=5,n.ndist=1+(31&c),c>>>=5,l-=5,n.ncode=4+(15&c),c>>>=4,l-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=nr;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;l<3;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}n.lens[M[n.have++]]=7&c,c>>>=3,l-=3}for(;n.have<19;)n.lens[M[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,x={bits:n.lenbits},E=Nn(0,n.lens,0,19,n.lencode,0,n.work,x),n.lenbits=x.bits,E){t.msg="invalid code lengths set",n.mode=nr;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;A=n.lencode[c&(1<<n.lenbits)-1],g=A>>>24,_=A>>>16&255,v=65535&A,!(g<=l);){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(v<16)c>>>=g,l-=g,n.lens[n.have++]=v;else{if(16===v){for(S=g+2;l<S;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(c>>>=g,l-=g,0===n.have){t.msg="invalid bit length repeat",n.mode=nr;break}k=n.lens[n.have-1],f=3+(3&c),c>>>=2,l-=2}else if(17===v){for(S=g+3;l<S;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}c>>>=g,l-=g,k=0,f=3+(7&c),c>>>=3,l-=3}else{for(S=g+7;l<S;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}c>>>=g,l-=g,k=0,f=11+(127&c),c>>>=7,l-=7}if(n.have+f>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=nr;break}for(;f--;)n.lens[n.have++]=k}}if(n.mode===nr)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=nr;break}if(n.lenbits=9,x={bits:n.lenbits},E=Nn(1,n.lens,0,n.nlen,n.lencode,0,n.work,x),n.lenbits=x.bits,E){t.msg="invalid literal/lengths set",n.mode=nr;break}if(n.distbits=6,n.distcode=n.distdyn,x={bits:n.distbits},E=Nn(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,x),n.distbits=x.bits,E){t.msg="invalid distances set",n.mode=nr;break}if(n.mode=Yn,e===Ln)break t;case Yn:n.mode=tr;case tr:if(a>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=s,t.avail_in=a,n.hold=c,n.bits=l,In(t,h),o=t.next_out,i=t.output,u=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,c=n.hold,l=n.bits,n.mode===Kn&&(n.back=-1);break}for(n.back=0;A=n.lencode[c&(1<<n.lenbits)-1],g=A>>>24,_=A>>>16&255,v=65535&A,!(g<=l);){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(_&&0==(240&_)){for(y=g,w=_,b=v;A=n.lencode[b+((c&(1<<y+w)-1)>>y)],g=A>>>24,_=A>>>16&255,v=65535&A,!(y+g<=l);){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=g,l-=g,n.back+=g,n.length=v,0===_){n.mode=16205;break}if(32&_){n.back=-1,n.mode=Kn;break}if(64&_){t.msg="invalid literal/length code",n.mode=nr;break}n.extra=15&_,n.mode=16201;case 16201:if(n.extra){for(S=n.extra;l<S;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;A=n.distcode[c&(1<<n.distbits)-1],g=A>>>24,_=A>>>16&255,v=65535&A,!(g<=l);){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(0==(240&_)){for(y=g,w=_,b=v;A=n.distcode[b+((c&(1<<y+w)-1)>>y)],g=A>>>24,_=A>>>16&255,v=65535&A,!(y+g<=l);){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=g,l-=g,n.back+=g,64&_){t.msg="invalid distance code",n.mode=nr;break}n.offset=v,n.extra=15&_,n.mode=16203;case 16203:if(n.extra){for(S=n.extra;l<S;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=nr;break}n.mode=16204;case 16204:if(0===u)break t;if(f=h-u,n.offset>f){if(f=n.offset-f,f>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=nr;break}f>n.wnext?(f-=n.wnext,p=n.wsize-f):p=n.wnext-f,f>n.length&&(f=n.length),m=n.window}else m=i,p=o-n.offset,f=n.length;f>u&&(f=u),u-=f,n.length-=f;do{i[o++]=m[p++]}while(--f);0===n.length&&(n.mode=tr);break;case 16205:if(0===u)break t;i[o++]=n.length,u--,n.mode=tr;break;case er:if(n.wrap){for(;l<32;){if(0===a)break t;a--,c|=r[s++]<<l,l+=8}if(h-=u,t.total_out+=h,n.total+=h,4&n.wrap&&h&&(t.adler=n.check=n.flags?ce(n.check,i,h,o-h):ae(n.check,i,h,o-h)),h=u,4&n.wrap&&(n.flags?c:rr(c))!==n.check){t.msg="incorrect data check",n.mode=nr;break}c=0,l=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;l<32;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(4&n.wrap&&c!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=nr;break}c=0,l=0}n.mode=16208;case 16208:E=qn;break t;case nr:E=Wn;break t;case 16210:return Zn;default:return $n}return t.next_out=o,t.avail_out=u,t.next_in=s,t.avail_in=a,n.hold=c,n.bits=l,(n.wsize||h!==t.avail_out&&n.mode<nr&&(n.mode<er||e!==zn))&&pr(t,t.output,t.next_out,h-t.avail_out),d-=t.avail_in,h-=t.avail_out,t.total_in+=d,t.total_out+=h,n.total+=h,4&n.wrap&&h&&(t.adler=n.check=n.flags?ce(n.check,i,h,t.next_out-h):ae(n.check,i,h,t.next_out-h)),t.data_type=n.bits+(n.last?64:0)+(n.mode===Kn?128:0)+(n.mode===Yn||n.mode===Xn?256:0),(0===d&&0===h||e===zn)&&E===Un&&(E=Gn),E},inflateEnd:t=>{if(sr(t))return $n;let e=t.state;return e.window&&(e.window=null),t.state=null,Un},inflateGetHeader:(t,e)=>{if(sr(t))return $n;const n=t.state;return 0==(2&n.wrap)?$n:(n.head=e,e.done=!1,Un)},inflateSetDictionary:(t,e)=>{const n=e.length;let r,i,s;return sr(t)?$n:(r=t.state,0!==r.wrap&&r.mode!==Vn?$n:r.mode===Vn&&(i=1,i=ae(i,e,n,0),i!==r.check)?Wn:(s=pr(t,e,n,n),s?(r.mode=16210,Zn):(r.havedict=1,Un)))},inflateInfo:"pako inflate (from Nodeca project)"};var gr=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const _r=Object.prototype.toString,{Z_NO_FLUSH:vr,Z_FINISH:yr,Z_OK:wr,Z_STREAM_END:br,Z_NEED_DICT:kr,Z_STREAM_ERROR:Er,Z_DATA_ERROR:Ar,Z_MEM_ERROR:Cr}=de;function xr(t){this.options=dn.assign({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new mn,this.strm.avail_out=0;let n=mr.inflateInit2(this.strm,e.windowBits);if(n!==wr)throw new Error(le[n]);if(this.header=new gr,mr.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=pn.string2buf(e.dictionary):"[object ArrayBuffer]"===_r.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=mr.inflateSetDictionary(this.strm,e.dictionary),n!==wr)))throw new Error(le[n])}xr.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let s,o,a;if(this.ended)return!1;for(o=e===~~e?e:!0===e?yr:vr,"[object ArrayBuffer]"===_r.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),s=mr.inflate(n,o),s===kr&&i&&(s=mr.inflateSetDictionary(n,i),s===wr?s=mr.inflate(n,o):s===Ar&&(s=kr));n.avail_in>0&&s===br&&n.state.wrap>0&&0!==t[n.next_in];)mr.inflateReset(n),s=mr.inflate(n,o);switch(s){case Er:case Ar:case kr:case Cr:return this.onEnd(s),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(0===n.avail_out||s===br))if("string"===this.options.to){let t=pn.utf8border(n.output,n.next_out),e=n.next_out-t,i=pn.buf2string(n.output,t);n.next_out=e,n.avail_out=r-e,e&&n.output.set(n.output.subarray(t,t+e),0),this.onData(i)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(s!==wr||0!==a){if(s===br)return s=mr.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},xr.prototype.onData=function(t){this.chunks.push(t)},xr.prototype.onEnd=function(t){t===wr&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=dn.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const{Deflate:Sr,deflate:Mr,deflateRaw:Or,gzip:Ir}=Mn;var Rr=Mr;const Tr=4294967295;let Pr=Math.floor(Math.random()*Tr);const jr=()=>(Pr=(Pr+1)%Tr,Pr);function Fr(t,e,n){return-1===e?t:new Promise(((r,i)=>{const s=setTimeout((()=>{i(n?n():new Error(`Timeout after ${e}ms`))}),e);t.then((t=>{clearTimeout(s),r(t)})).catch((t=>{clearTimeout(s),i(t)}))}))}class Nr extends Error{constructor(t){super(t.message),this.name=this.constructor.name,this.cause=t,Object.setPrototypeOf(this,this.constructor.prototype)}}class zr extends Error{constructor(t,e){super(t),this.name=this.constructor.name,this.cause=e,Object.setPrototypeOf(this,this.constructor.prototype)}}class Br extends zr{constructor(t="Transport request timed out",e){super(t,e)}}function Lr({transport:t}){let e,n;async function r(){t.isConnected()||(n||(n=t.connect()),await n)}async function i(){return e||(e=(async()=>{await r(),await async function(t,e={}){const{maxRetries:n=10,retryDelay:r=200,timeoutErrorClass:i}=e;for(let e=0;e<=n;e++)try{return await t()}catch(t){if(e>=n)throw t;if(i&&"function"==typeof i&&t instanceof i)continue;await new Promise((t=>setTimeout(t,r)))}throw new Error("Max retries exceeded")}((()=>t.request({method:"wallet_getSession"},{timeout:t.warmupTimeout??1e3})))})()),await e}return r(),{createSession:async e=>(await i(),await Ur({transport:t,method:"wallet_createSession",params:e})),getSession:async()=>(await i(),await Ur({transport:t,method:"wallet_getSession"})),revokeSession:async r=>{await i(),e=void 0,n=void 0,await Ur({transport:t,method:"wallet_revokeSession",params:r}),await t.disconnect()},invokeMethod:async e=>(await i(),await Ur({transport:t,method:"wallet_invokeMethod",params:e})),extendsRpcApi:()=>Lr({transport:t}),onNotification:e=>t.onNotification(e)}}async function Ur({transport:t,method:e,params:n,timeout:r}){const i=await t.request({method:e,params:n},{timeout:r});if(i?.error)throw new Nr(i.error);return i.result}const qr="caip-348",Dr="metamask-contentscript",$r="metamask-inpage",Wr="metamask-multichain-provider",Zr="metamask-provider",Gr="METAMASK_EXTENSION_CONNECT_CAN_RETRY",Hr=-1,Jr=200;async function Vr(){return new Promise(((t,e)=>{const n=e=>{if(function(t){const{target:e,data:n}=t.data;return e===$r&&n?.name===Zr&&t.origin===location.origin}(e)){const i=e?.data?.data?.data;if(i?.method===Gr)Kr();else if(i?.result?.extensionId){const e=i?.result?.extensionId;t(e),window.removeEventListener("message",n),clearTimeout(r)}}},r=setTimeout((()=>{window.removeEventListener("message",n),e(new Error("MetaMask extension not found"))}),1e4);window.addEventListener("message",n),Kr()}))}function Kr(){window.postMessage({target:Dr,data:{name:Zr,data:{method:"metamask_getProviderState"}}},location.origin)}function Qr(t={}){let{extensionId:e}=t;const{defaultTimeout:n=Hr,warmupTimeout:r=Jr}=t;let i,s=jr();const o=new Map,a=new Set;function u(t){const{data:e}=t;if(null==e?.id)!function(t){for(const e of a)try{e(t)}catch(t){console.log("[ChromeTransport] notifyCallbacks error:",t)}}(e);else if(o.has(e.id)){const t=o.get(e.id);o.delete(e.id),t?.(e)}}return{warmupTimeout:r,connect:async()=>{try{e||(e=await Vr());const t=chrome.runtime.connect(e);let n=!0;if(t.onDisconnect.addListener((()=>{console.log("[ChromeTransport] chromePort disconnected"),i=void 0,n=!1})),await new Promise((t=>setTimeout(t,10))),!n)throw new Error(`No extension found with id: ${e}`);t.onMessage.addListener(u),i=t}catch(t){throw new zr("Failed to connect to MetaMask",t)}},disconnect:async()=>{if(i)try{i.disconnect(),i=void 0,a.clear(),o.clear()}catch(t){console.log("[ChromeTransport] disconnect error:",t)}},isConnected:()=>void 0!==i,request:async(t,e={})=>{const{timeout:r=n}=e,a=i;if(!a)throw new zr("Chrome port not connected");const u=s++,c={id:u,jsonrpc:"2.0",...t};try{return await Fr(new Promise((t=>{o.set(u,t),a.postMessage({type:qr,data:c})})),r,(()=>new Br))}catch(t){throw o.has(u)&&o.delete(u),t}},onNotification:t=>(a.add(t),()=>{a.delete(t)})}}function Xr(t={}){const{defaultTimeout:e=Hr,warmupTimeout:n=Jr}=t;let r=null;const i=new Map,s=new Set;function o(t){if(null==t?.id)!function(t){for(const e of s)try{e(t)}catch(t){console.log("[WindowPostMessageTransport] notifyCallbacks error:",t)}}(t);else if(i.has(t.id)){const e=i.get(t.id);i.delete(t.id),e?.(t)}}async function a(){r&&(window.removeEventListener("message",r),r=null),i.clear(),s.clear()}const u=()=>Boolean(r);return{warmupTimeout:n,connect:async()=>{u()&&await a(),r=t=>{const{target:e,data:n}=t.data;e===$r&&n?.name===Wr&&t.origin===location.origin&&o(n.data)},window.addEventListener("message",r)},disconnect:a,isConnected:u,request:(t,n={})=>{const{timeout:r=e}=n;if(!u())throw new zr("Transport not connected");const s=jr(),o={jsonrpc:"2.0",id:s,...t};return Fr(new Promise((t=>{i.set(s,(e=>t(e))),function(t){window.postMessage({target:Dr,data:{name:Wr,data:t}},location.origin)}(o)})),r,(()=>new Br)).catch((t=>{throw i.has(s)&&i.delete(s),t}))},onNotification:t=>(s.add(t),()=>{s.delete(t)})}}function Yr({extensionId:t,defaultTimeout:e,warmupTimeout:n}={}){return"undefined"!=typeof chrome&&chrome.runtime&&"function"==typeof chrome.runtime.connect?Qr({extensionId:t,defaultTimeout:e,warmupTimeout:n}):Xr({defaultTimeout:e,warmupTimeout:n})}var ti=oi;oi.default=oi,oi.stable=li,oi.stableStringify=li;var ei="[...]",ni="[Circular]",ri=[],ii=[];function si(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function oi(t,e,n,r){var i;void 0===r&&(r=si()),ui(t,"",0,[],void 0,0,r);try{i=0===ii.length?JSON.stringify(t,e,n):JSON.stringify(t,hi(e),n)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==ri.length;){var s=ri.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function ai(t,e,n,r){var i=Object.getOwnPropertyDescriptor(r,n);void 0!==i.get?i.configurable?(Object.defineProperty(r,n,{value:t}),ri.push([r,n,e,i])):ii.push([e,n,t]):(r[n]=t,ri.push([r,n,e]))}function ui(t,e,n,r,i,s,o){var a;if(s+=1,"object"==typeof t&&null!==t){for(a=0;a<r.length;a++)if(r[a]===t)return void ai(ni,t,e,i);if(void 0!==o.depthLimit&&s>o.depthLimit)return void ai(ei,t,e,i);if(void 0!==o.edgesLimit&&n+1>o.edgesLimit)return void ai(ei,t,e,i);if(r.push(t),Array.isArray(t))for(a=0;a<t.length;a++)ui(t[a],a,a,r,t,s,o);else{var u=Object.keys(t);for(a=0;a<u.length;a++){var c=u[a];ui(t[c],c,a,r,t,s,o)}}r.pop()}}function ci(t,e){return t<e?-1:t>e?1:0}function li(t,e,n,r){void 0===r&&(r=si());var i,s=di(t,"",0,[],void 0,0,r)||t;try{i=0===ii.length?JSON.stringify(s,e,n):JSON.stringify(s,hi(e),n)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==ri.length;){var o=ri.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function di(t,e,n,r,i,s,o){var a;if(s+=1,"object"==typeof t&&null!==t){for(a=0;a<r.length;a++)if(r[a]===t)return void ai(ni,t,e,i);try{if("function"==typeof t.toJSON)return}catch(t){return}if(void 0!==o.depthLimit&&s>o.depthLimit)return void ai(ei,t,e,i);if(void 0!==o.edgesLimit&&n+1>o.edgesLimit)return void ai(ei,t,e,i);if(r.push(t),Array.isArray(t))for(a=0;a<t.length;a++)di(t[a],a,a,r,t,s,o);else{var u={},c=Object.keys(t).sort(ci);for(a=0;a<c.length;a++){var l=c[a];di(t[l],l,a,r,t,s,o),u[l]=t[l]}if(void 0===i)return u;ri.push([i,e,t]),i[e]=u}r.pop()}}function hi(t){return t=void 0!==t?t:function(t,e){return e},function(e,n){if(ii.length>0)for(var r=0;r<ii.length;r++){var i=ii[r];if(i[1]===e&&i[0]===n){n=i[2],ii.splice(r,1);break}}return t.call(this,e,n)}}const fi={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},pi={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901},mi={"-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."}},gi=fi.internal,_i="Unspecified error message. This is a bug, please report it.";yi(gi);const vi="Unspecified server error.";function yi(t,e=_i){if(function(t){return Number.isInteger(t)}(t)){const e=t.toString();if(R(mi,e))return mi[e].message;if(function(t){return t>=-32099&&t<=-32e3}(t))return vi}return e}function wi(t){return Object.getOwnPropertyNames(t).reduce(((e,n)=>{const r=t[n];return mt(r)&&(e[n]=r),e}),{})}const bi=function(t){return t?.__esModule?t.default:t}(ti);class ki extends Error{constructor(t,e,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a non-empty string.');!function(t){return I(t)&&R(t,"cause")&&I(t.cause)}(n)?super(e):(super(e,{cause:n.cause}),R(this,"cause")||Object.assign(this,{cause:n.cause})),void 0!==n&&(this.data=n),this.code=t}serialize(){const t={code:this.code,message:this.message};var e;return void 0!==this.data&&(t.data=this.data,function(t){if("object"!=typeof t||null===t)return!1;try{let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}catch(t){return!1}}(this.data)&&(t.data.cause=(e=this.data.cause,Array.isArray(e)?e.map((t=>mt(t)?t:I(t)?wi(t):null)):I(e)?wi(e):mt(e)?e:null))),this.stack&&(t.stack=this.stack),t}toString(){return bi(this.serialize(),Ai,2)}}class Ei extends ki{constructor(t,e,n){if(!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,n)}}function Ai(t,e){if("[Circular]"!==e)return e}const Ci=t=>Mi(fi.internal,t),xi=t=>Oi(pi.unauthorized,t),Si=t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:n,data:r}=t;if(!n||"string"!=typeof n)throw new Error('"message" must be a nonempty string');return new Ei(e,n,r)};function Mi(t,e){const[n,r]=Ii(e);return new ki(t,n??yi(t),r)}function Oi(t,e){const[n,r]=Ii(e);return new Ei(t,n??yi(t),r)}function Ii(t){if(t){if("string"==typeof t)return[t];if("object"==typeof t&&!Array.isArray(t)){const{message:e,data:n}=t;if(e&&"string"!=typeof e)throw new Error("Must specify string message.");return[e??void 0,n]}}return[]}const Ri=/\{[^{}]+\}/g;function Ti(t){let{baseUrl:e="",Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:s,headers:o,requestInitExt:a,...u}={...t};a="object"==typeof process&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici?a:void 0,e=Li(e);const c=[];async function l(t,l){const{baseUrl:d,fetch:h=r,Request:f=n,headers:p,params:m={},parseAs:g="json",querySerializer:_,bodySerializer:v=s??zi,body:y,...w}=l||{};let b=e;d&&(b=Li(d)??e);let k="function"==typeof i?i:Ni(i);_&&(k="function"==typeof _?_:Ni({..."object"==typeof i?i:{},..._}));const E=void 0===y?void 0:v(y,Bi(o,p,m.header)),A=Bi(void 0===E||E instanceof FormData?{}:{"Content-Type":"application/json"},o,p,m.header),C={redirect:"follow",...u,...w,body:E,headers:A};let x,S,M,O=new n(function(t,e){let n=`${e.baseUrl}${t}`;e.params?.path&&(n=function(t,e){let n=t;for(const r of t.match(Ri)??[]){let t=r.substring(1,r.length-1),i=!1,s="simple";if(t.endsWith("*")&&(i=!0,t=t.substring(0,t.length-1)),t.startsWith(".")?(s="label",t=t.substring(1)):t.startsWith(";")&&(s="matrix",t=t.substring(1)),!e||void 0===e[t]||null===e[t])continue;const o=e[t];Array.isArray(o)?n=n.replace(r,Fi(t,o,{style:s,explode:i})):n="object"!=typeof o?"matrix"!==s?n.replace(r,"label"===s?`.${encodeURIComponent(o)}`:encodeURIComponent(o)):n.replace(r,`;${Pi(t,o)}`):n.replace(r,ji(t,o,{style:s,explode:i}))}return n}(n,e.params.path));let r=e.querySerializer(e.params.query??{});r.startsWith("?")&&(r=r.substring(1));r&&(n+=`?${r}`);return n}(t,{baseUrl:b,params:m,querySerializer:k}),C);for(const t in w)t in O||(O[t]=w[t]);if(c.length){x=Math.random().toString(36).slice(2,11),S=Object.freeze({baseUrl:b,fetch:h,parseAs:g,querySerializer:k,bodySerializer:v});for(const e of c)if(e&&"object"==typeof e&&"function"==typeof e.onRequest){const r=await e.onRequest({request:O,schemaPath:t,params:m,options:S,id:x});if(r){if(!(r instanceof n)){if(r instanceof Response){M=r;break}throw new Error("onRequest: must return new Request() or Response() when modifying the request")}O=r}}}if(!M){try{M=await h(O,a)}catch(I){let e=I;if(c.length)for(let n=c.length-1;n>=0;n--){const r=c[n];if(r&&"object"==typeof r&&"function"==typeof r.onError){const n=await r.onError({request:O,error:e,schemaPath:t,params:m,options:S,id:x});if(n){if(n instanceof Response){e=void 0,M=n;break}if(n instanceof Error){e=n;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(e)throw e}if(c.length)for(let e=c.length-1;e>=0;e--){const n=c[e];if(n&&"object"==typeof n&&"function"==typeof n.onResponse){const e=await n.onResponse({request:O,response:M,schemaPath:t,params:m,options:S,id:x});if(e){if(!(e instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");M=e}}}}if(204===M.status||"HEAD"===O.method||"0"===M.headers.get("Content-Length"))return M.ok?{data:void 0,response:M}:{error:void 0,response:M};if(M.ok)return"stream"===g?{data:M.body,response:M}:{data:await M[g](),response:M};let I=await M.text();try{I=JSON.parse(I)}catch{}return{error:I,response:M}}return{request:(t,e,n)=>l(e,{...n,method:t.toUpperCase()}),GET:(t,e)=>l(t,{...e,method:"GET"}),PUT:(t,e)=>l(t,{...e,method:"PUT"}),POST:(t,e)=>l(t,{...e,method:"POST"}),DELETE:(t,e)=>l(t,{...e,method:"DELETE"}),OPTIONS:(t,e)=>l(t,{...e,method:"OPTIONS"}),HEAD:(t,e)=>l(t,{...e,method:"HEAD"}),PATCH:(t,e)=>l(t,{...e,method:"PATCH"}),TRACE:(t,e)=>l(t,{...e,method:"TRACE"}),use(...t){for(const e of t)if(e){if("object"!=typeof e||!("onRequest"in e||"onResponse"in e||"onError"in e))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");c.push(e)}},eject(...t){for(const e of t){const t=c.indexOf(e);-1!==t&&c.splice(t,1)}}}}function Pi(t,e,n){if(null==e)return"";if("object"==typeof e)throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${!0===n?.allowReserved?e:encodeURIComponent(e)}`}function ji(t,e,n){if(!e||"object"!=typeof e)return"";const r=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if("deepObject"!==n.style&&!1===n.explode){for(const t in e)r.push(t,!0===n.allowReserved?e[t]:encodeURIComponent(e[t]));const i=r.join(",");switch(n.style){case"form":return`${t}=${i}`;case"label":return`.${i}`;case"matrix":return`;${t}=${i}`;default:return i}}for(const i in e){const s="deepObject"===n.style?`${t}[${i}]`:i;r.push(Pi(s,e[i],n))}const s=r.join(i);return"label"===n.style||"matrix"===n.style?`${i}${s}`:s}function Fi(t,e,n){if(!Array.isArray(e))return"";if(!1===n.explode){const r={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",i=(!0===n.allowReserved?e:e.map((t=>encodeURIComponent(t)))).join(r);switch(n.style){case"simple":return i;case"label":return`.${i}`;case"matrix":return`;${t}=${i}`;default:return`${t}=${i}`}}const r={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(const r of e)"simple"===n.style||"label"===n.style?i.push(!0===n.allowReserved?r:encodeURIComponent(r)):i.push(Pi(t,r,n));return"label"===n.style||"matrix"===n.style?`${r}${i.join(r)}`:i.join(r)}function Ni(t){return function(e){const n=[];if(e&&"object"==typeof e)for(const r in e){const i=e[r];if(null!=i)if(Array.isArray(i)){if(0===i.length)continue;n.push(Fi(r,i,{style:"form",explode:!0,...t?.array,allowReserved:t?.allowReserved||!1}))}else"object"!=typeof i?n.push(Pi(r,i,t)):n.push(ji(r,i,{style:"deepObject",explode:!0,...t?.object,allowReserved:t?.allowReserved||!1}))}return n.join("&")}}function zi(t,e){if(t instanceof FormData)return t;if(e){if("application/x-www-form-urlencoded"===(e.get instanceof Function?e.get("Content-Type")??e.get("content-type"):e["Content-Type"]??e["content-type"]))return new URLSearchParams(t).toString()}return JSON.stringify(t)}function Bi(...t){const e=new Headers;for(const n of t){if(!n||"object"!=typeof n)continue;const t=n instanceof Headers?n.entries():Object.entries(n);for(const[n,r]of t)if(null===r)e.delete(n);else if(Array.isArray(r))for(const t of r)e.append(n,t);else void 0!==r&&e.set(n,r)}return e}function Li(t){return t.endsWith("/")?t.substring(0,t.length-1):t}var Ui,qi=class{sendFn;batch=[];batchSize;baseTimeoutMs;currentTimeoutMs;maxTimeoutMs=3e4;timeoutId=null;isSending=!1;constructor(t){this.batchSize=t.batchSize,this.baseTimeoutMs=t.baseTimeoutMs,this.currentTimeoutMs=t.baseTimeoutMs,this.sendFn=t.sendFn}enqueue(t){this.batch.push(t),this.schedule()}clear(){this.batch=[],this.currentTimeoutMs=this.baseTimeoutMs,this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}schedule(){this.batch.length>0&&!this.timeoutId&&(this.timeoutId=setTimeout((()=>{this.timeoutId=null,this.flush()}),this.currentTimeoutMs))}async flush(){if(this.isSending||0===this.batch.length)return;this.isSending=!0;const t=[...this.batch.slice(0,this.batchSize)];this.batch=this.batch.slice(this.batchSize);try{await this.sendFn(t),this.currentTimeoutMs=this.baseTimeoutMs}catch(e){console.error("Sender: Failed to send batch",e),this.batch=[...t,...this.batch],this.currentTimeoutMs=Math.min(2*this.currentTimeoutMs,this.maxTimeoutMs)}finally{this.isSending=!1,this.schedule()}}},Di=class{enabled=!1;sender;properties={};constructor(t){const e=Ti({baseUrl:t});this.sender=new qi({batchSize:100,baseTimeoutMs:200,sendFn:async t=>{const n=await e.POST("/v2/events",{body:t});if(200!==n.response.status)throw new Error(n.error)}})}enable(){this.enabled=!0}disable(){this.enabled=!1,this.sender.clear()}setGlobalProperty(t,e){if("integration_types"!==t)this.properties[t]=e;else{const t=Array.isArray(this.properties.integration_types)?this.properties.integration_types:[],n=Array.isArray(e)?e:[];this.properties.integration_types=[...new Set([...t,...n])]}}track(t,e){if(!this.enabled)return;const n={namespace:"metamask/connect",event_name:t,properties:{...e,...this.properties}};this.sender.enqueue(n)}};"undefined"!=typeof process&&process.env&&(Ui=process.env.METAMASK_ANALYTICS_ENDPOINT??process.env.NEXT_PUBLIC_METAMASK_ANALYTICS_ENDPOINT);var $i=new Di(Ui??"https://mm-sdk-analytics.api.cx.metamask.io/"),Wi={exports:{}};!function(e,n){var r="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==t.commonjsGlobal&&t.commonjsGlobal,i=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(e){!function(n){var r=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==t.commonjsGlobal&&t.commonjsGlobal||{},i={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};if(i.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function a(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function u(t){return"string"!=typeof t&&(t=String(t)),t}function c(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i.iterable&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function h(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function f(t){var e=new FileReader,n=h(e);return e.readAsArrayBuffer(t),n}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():i.arrayBuffer&&i.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||o(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=d(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i.blob)return this.blob().then(f);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,n,r,i,s=d(this);if(s)return s;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=h(e),r=/charset=([A-Za-z0-9_-]+)/.exec(t.type),i=r?r[1]:"utf-8",e.readAsText(t,i),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=a(t),e=u(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},l.prototype.delete=function(t){delete this.map[a(t)]},l.prototype.get=function(t){return t=a(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(a(t))},l.prototype.set=function(t,e){this.map[a(t)]=u(e)},l.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),c(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),c(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),c(t)},i.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var g=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function _(t,e){if(!(this instanceof _))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,i,s=(e=e||{}).body;if(t instanceof _){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,s||null==t._bodyInit||(s=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(n=e.method||this.method||"GET",i=n.toUpperCase(),g.indexOf(i)>-1?i:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in r)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(s),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function v(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}})),e}function y(t,e){if(!(this instanceof y))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},m.call(_.prototype),m.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},y.error=function(){var t=new y(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var w=[301,302,303,307,308];y.redirect=function(t,e){if(-1===w.indexOf(e))throw new RangeError("Invalid status code");return new y(null,{status:e,headers:{location:t}})},n.DOMException=r.DOMException;try{new n.DOMException}catch(t){n.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},n.DOMException.prototype=Object.create(Error.prototype),n.DOMException.prototype.constructor=n.DOMException}function b(t,e){return new Promise((function(s,o){var c=new _(t,e);if(c.signal&&c.signal.aborted)return o(new n.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function h(){d.abort()}if(d.onload=function(){var t,e,n={statusText:d.statusText,headers:(t=d.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{e.append(r,i)}catch(t){console.warn("Response "+t.message)}}})),e)};0===c.url.indexOf("file://")&&(d.status<200||d.status>599)?n.status=200:n.status=d.status,n.url="responseURL"in d?d.responseURL:n.headers.get("X-Request-URL");var r="response"in d?d.response:d.responseText;setTimeout((function(){s(new y(r,n))}),0)},d.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},d.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request timed out"))}),0)},d.onabort=function(){setTimeout((function(){o(new n.DOMException("Aborted","AbortError"))}),0)},d.open(c.method,function(t){try{return""===t&&r.location.href?r.location.href:t}catch(e){return t}}(c.url),!0),"include"===c.credentials?d.withCredentials=!0:"omit"===c.credentials&&(d.withCredentials=!1),"responseType"in d&&(i.blob?d.responseType="blob":i.arrayBuffer&&(d.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof l||r.Headers&&e.headers instanceof r.Headers)){var f=[];Object.getOwnPropertyNames(e.headers).forEach((function(t){f.push(a(t)),d.setRequestHeader(t,u(e.headers[t]))})),c.headers.forEach((function(t,e){-1===f.indexOf(e)&&d.setRequestHeader(e,t)}))}else c.headers.forEach((function(t,e){d.setRequestHeader(e,t)}));c.signal&&(c.signal.addEventListener("abort",h),d.onreadystatechange=function(){4===d.readyState&&c.signal.removeEventListener("abort",h)}),d.send(void 0===c._bodyInit?null:c._bodyInit)}))}b.polyfill=!0,r.fetch||(r.fetch=b,r.Headers=l,r.Request=_,r.Response=y),n.Headers=l,n.Request=_,n.Response=y,n.fetch=b}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var s=r.fetch?r:i;(n=s.fetch).default=s.fetch,n.fetch=s.fetch,n.Headers=s.Headers,n.Request=s.Request,n.Response=s.Response,e.exports=n}(Wi,Wi.exports);var Zi=Wi.exports;const Gi=[];for(let t=0;t<256;++t)Gi.push((t+256).toString(16).slice(1));let Hi;const Ji=new Uint8Array(16);var Vi={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ki(t,e,n){if(Vi.randomUUID&&!e&&!t)return Vi.randomUUID();const r=(t=t||{}).random??t.rng?.()??function(){if(!Hi){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Hi=crypto.getRandomValues.bind(crypto)}return Hi(Ji)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){if((n=n||0)<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[n+t]=r[t];return e}return function(t,e=0){return(Gi[t[e+0]]+Gi[t[e+1]]+Gi[t[e+2]]+Gi[t[e+3]]+"-"+Gi[t[e+4]]+Gi[t[e+5]]+"-"+Gi[t[e+6]]+Gi[t[e+7]]+"-"+Gi[t[e+8]]+Gi[t[e+9]]+"-"+Gi[t[e+10]]+Gi[t[e+11]]+Gi[t[e+12]]+Gi[t[e+13]]+Gi[t[e+14]]+Gi[t[e+15]]).toLowerCase()}(r)}
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */function Qi(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))}function Xi(t,e){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}var Yi,ts,es,ns,rs,is,ss,os,as,us,cs,ls,ds,hs,fs="INSTALLED",ps="NOT_INSTALLED",ms="REGISTERED",gs="REGISTERING",_s="RELOADING",vs={CHROME:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",FIREFOX:"https://addons.mozilla.org/firefox/addon/ether-metamask/",DEFAULT:"https://metamask.io"},ys="REGISTRATION_IN_PROGRESS",ws="FORWARDER_ID",bs=function(){function t(e){var n=void 0===e?{}:e,r=n.forwarderOrigin,i=void 0===r?"https://fwd.metamask.io":r,s=n.forwarderMode,o=void 0===s?t.FORWARDER_MODE.INJECT:s;this.forwarderOrigin=i,this.forwarderMode=o,this.state=t.isMetaMaskInstalled()?fs:ps;var a=t._detectBrowser();this.downloadUrl=a?vs[a]:vs.DEFAULT,this._onMessage=this._onMessage.bind(this),this._onMessageFromForwarder=this._onMessageFromForwarder.bind(this),this._openForwarder=this._openForwarder.bind(this),this._openDownloadPage=this._openDownloadPage.bind(this),this.startOnboarding=this.startOnboarding.bind(this),this.stopOnboarding=this.stopOnboarding.bind(this),window.addEventListener("message",this._onMessage),o===t.FORWARDER_MODE.INJECT&&"true"===sessionStorage.getItem(ys)&&t._injectForwarder(this.forwarderOrigin)}return t.prototype._onMessage=function(t){if(t.origin===this.forwarderOrigin)return"metamask:reload"===t.data.type?this._onMessageFromForwarder(t):void console.debug("Unknown message from '"+t.origin+"' with data "+JSON.stringify(t.data))},t.prototype._onMessageUnknownStateError=function(t){throw new Error("Unknown state: '"+t+"'")},t.prototype._onMessageFromForwarder=function(e){return Qi(this,void 0,void 0,(function(){return Xi(this,(function(n){switch(n.label){case 0:switch(this.state){case _s:return[3,1];case ps:return[3,2];case fs:return[3,3];case gs:return[3,5];case ms:return[3,6]}return[3,7];case 1:return console.debug("Ignoring message while reloading"),[3,8];case 2:return console.debug("Reloading now to register with MetaMask"),this.state=_s,location.reload(),[3,8];case 3:return console.debug("Registering with MetaMask"),this.state=gs,[4,t._register()];case 4:return n.sent(),this.state=ms,e.source.postMessage({type:"metamask:registrationCompleted"},e.origin),this.stopOnboarding(),[3,8];case 5:return console.debug("Already registering - ignoring reload message"),[3,8];case 6:return console.debug("Already registered - ignoring reload message"),[3,8];case 7:this._onMessageUnknownStateError(this.state),n.label=8;case 8:return[2]}}))}))},t.prototype.startOnboarding=function(){sessionStorage.setItem(ys,"true"),this._openDownloadPage(),this._openForwarder()},t.prototype.stopOnboarding=function(){"true"===sessionStorage.getItem(ys)&&(this.forwarderMode===t.FORWARDER_MODE.INJECT&&(console.debug("Removing forwarder"),t._removeForwarder()),sessionStorage.setItem(ys,"false"))},t.prototype._openForwarder=function(){this.forwarderMode===t.FORWARDER_MODE.OPEN_TAB?window.open(this.forwarderOrigin,"_blank"):t._injectForwarder(this.forwarderOrigin)},t.prototype._openDownloadPage=function(){window.open(this.downloadUrl,"_blank")},t.isMetaMaskInstalled=function(){return Boolean(window.ethereum&&window.ethereum.isMetaMask)},t._register=function(){return window.ethereum.request({method:"wallet_registerOnboarding"})},t._injectForwarder=function(t){var e=document.body,n=document.createElement("iframe");n.setAttribute("height","0"),n.setAttribute("width","0"),n.setAttribute("style","display: none;"),n.setAttribute("src",t),n.setAttribute("id",ws),e.insertBefore(n,e.children[0])},t._removeForwarder=function(){var t;null===(t=document.getElementById(ws))||void 0===t||t.remove()},t._detectBrowser=function(){var t=l.parse(window.navigator.userAgent);return"Firefox"===t.browser.name?"FIREFOX":["Chrome","Chromium"].includes(t.browser.name||"")?"CHROME":null},t.FORWARDER_MODE={INJECT:"INJECT",OPEN_TAB:"OPEN_TAB"},t}(),ks=Object.defineProperty,Es=Object.defineProperties,As=Object.getOwnPropertyDescriptors,Cs=Object.getOwnPropertyNames,xs=Object.getOwnPropertySymbols,Ss=Object.prototype.hasOwnProperty,Ms=Object.prototype.propertyIsEnumerable,Os=t=>{throw TypeError(t)},Is=(t,e,n)=>e in t?ks(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Rs=(t,e)=>{for(var n in e||(e={}))Ss.call(e,n)&&Is(t,n,e[n]);if(xs)for(var n of xs(e))Ms.call(e,n)&&Is(t,n,e[n]);return t},Ts=(t,e)=>Es(t,As(e)),Ps=(t,e)=>function(){return t&&(e=(0,t[Cs(t)[0]])(t=0)),e},js=(t,e)=>{for(var n in e)ks(t,n,{get:e[n],enumerable:!0})},Fs=(t,e,n)=>e.has(t)||Os("Cannot "+n),Ns=(t,e,n)=>(Fs(t,e,"read from private field"),n?n.call(t):e.get(t)),zs=(t,e,n)=>e.has(t)?Os("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Bs=(t,e,n,r)=>(Fs(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Ls=(t,e,n)=>(Fs(t,e,"access private method"),n),Us=(t,e,n)=>new Promise(((r,i)=>{var s=t=>{try{a(n.next(t))}catch(t){i(t)}},o=t=>{try{a(n.throw(t))}catch(t){i(t)}},a=t=>t.done?r(t.value):Promise.resolve(t.value).then(s,o);a((n=n.apply(t,e)).next())})),qs=Ps({"src/domain/errors/base.ts"(){Yi=class extends Error{constructor(t,e){super(t),this.message=t,this.code=e}}}}),Ds=Ps({"src/domain/errors/rpc.ts"(){qs(),(ts=class t extends Yi{constructor(e,n,r){super(`RPCErr${t.code}: ${r} on ${e} for method ${n}`,t.code),this.rpcEndpoint=e,this.method=n,this.httpStatus=r}}).code=50,es=ts,(ns=class t extends Yi{constructor(e){super(`RPCErr${t.code}: RPC Client response reason ${e}`,t.code),this.reason=e}}).code=51,rs=ns,(is=class t extends Yi{constructor(e){super(`RPCErr${t.code}: RPC Client fetch reason ${e}`,t.code),this.reason=e}}).code=52,ss=is,(os=class t extends Yi{constructor(e,n,r){super(`RPCErr${t.code}: RPC Client invoke method reason (${e})`,t.code),this.reason=e,this.rpcCode=n,this.rpcMessage=r}}).code=53,as=os}}),$s=Ps({"src/domain/errors/index.ts"(){Ds()}}),Ws=Ps({"src/domain/events/index.ts"(){cs=class{constructor(){zs(this,us,new t.EventEmitter3)}emit(t,...e){Ns(this,us).emit(t,...e)}on(t,e){return Ns(this,us).on(t,e),()=>{this.off(t,e)}}off(t,e){Ns(this,us).off(t,e)}removeListener(t,e){Ns(this,us).off(t,e)}once(t,e){return Ns(this,us).once(t,e),()=>{this.off(t,e)}}listenerCount(t){return Ns(this,us).listenerCount(t)}},us=new WeakMap}});function Zs(t,e){return t.includes(e)||t.includes("metamask-sdk:*")||t.includes("*")}var Gs,Hs,Js,Vs,Ks=Ps({"src/domain/logger/index.ts"(){ls=(t="metamask-sdk",e="214")=>{const n=u(t);return n.color=e,n},ds=(t="metamask-sdk")=>{u.enable(t)},hs=(t,e)=>Us(null,null,(function*(){var n;if("process"in globalThis&&(null==(n=null==process?void 0:process.env)?void 0:n.DEBUG)){const{DEBUG:e}=process.env;return Zs(e,t)}const r=yield e.getDebug();return!!r&&Zs(r,t)}))}}),Qs=Ps({"src/domain/multichain/api/constants.ts"(){Gs=new Set(["eth_blockNumber","eth_gasPrice","eth_maxPriorityFeePerGas","eth_blobBaseFee","eth_feeHistory","eth_getBalance","eth_getCode","eth_getStorageAt","eth_call","eth_estimateGas","eth_getLogs","eth_getProof","eth_getTransactionCount","eth_getBlockByNumber","eth_getBlockByHash","eth_getBlockTransactionCountByNumber","eth_getBlockTransactionCountByHash","eth_getUncleCountByBlockNumber","eth_getUncleCountByBlockHash","eth_getTransactionByHash","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByBlockHashAndIndex","eth_getTransactionReceipt","eth_getUncleByBlockNumberAndIndex","eth_getUncleByBlockHashAndIndex","eth_getFilterChanges","eth_getFilterLogs","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter"]),Hs=new Set(["eth_accounts","eth_chainId"])}}),Xs=Ps({"src/domain/multichain/api/infura.ts"(){Qs()}});var Ys,to=Ps({"src/domain/multichain/index.ts"(){Ws(),Qs(),Xs(),Js=(t=>(t.Browser="browser",t.MWP="mwp",t.UNKNOWN="unknown",t))(Js||{}),Vs=class extends cs{constructor(t){super(),this.options=t}mergeOptions(t){var e,n,r,i,s,o,a,u,c,l,d,h,f,p,m,g,_;const v=this.options,y=Rs(Rs({},v.analytics),null!=(e=t.analytics)?e:{});!1===(null==(n=v.analytics)?void 0:n.enabled)&&(y.enabled=!1),this.options=Ts(Rs({},v),{api:Ts(Rs({},v.api),{supportedNetworks:Rs(Rs({},v.api.supportedNetworks),null!=(i=null==(r=t.api)?void 0:r.supportedNetworks)?i:{})}),versions:Rs(Rs({},v.versions),null!=(s=t.versions)?s:{}),analytics:Rs({},y),ui:Ts(Rs({},v.ui),{headless:null!=(a=null==(o=t.ui)?void 0:o.headless)?a:v.ui.headless,preferExtension:null!=(c=null==(u=t.ui)?void 0:u.preferExtension)?c:v.ui.preferExtension,showInstallModal:null!=(d=null==(l=t.ui)?void 0:l.showInstallModal)?d:v.ui.showInstallModal}),mobile:Rs(Rs({},v.mobile),null!=(h=t.mobile)?h:{}),transport:Ts(Rs({},null!=(f=v.transport)?f:{}),{extensionId:null!=(g=null==(p=t.transport)?void 0:p.extensionId)?g:null==(m=v.transport)?void 0:m.extensionId}),debug:null!=(_=t.debug)?_:v.debug})}}}});function eo(){var t,e;if("undefined"!=typeof global&&"ReactNative"===(null==(t=null==global?void 0:global.navigator)?void 0:t.product))return!0;return"undefined"!=typeof window&&void 0!==window.navigator&&"ReactNative"===(null==(e=window.navigator)?void 0:e.product)}function no(){return eo()?"react-native":"undefined"!=typeof window&&(null==window?void 0:window.navigator)&&"ReactNative"!==(null==navigator?void 0:navigator.product)?"undefined"!=typeof window&&Boolean(window.ReactNativeWebView)&&Boolean(window.navigator.userAgent.endsWith("MetaMaskMobile"))?"in-app-browser":function(){var t,e;const n=l.parse(window.navigator.userAgent);return"mobile"===(null==(t=null==n?void 0:n.platform)?void 0:t.type)||"tablet"===(null==(e=null==n?void 0:n.platform)?void 0:e.type)}()?"web-mobile":"web-desktop":"nodejs"}function ro(){const t=no();return eo()||"web-mobile"===t}function io(){return Us(this,null,(function*(){return Ys}))}var so,oo,ao,uo,co,lo=Ps({"src/domain/platform/index.ts"(){Ys=Us(null,null,(function*(){const t=no();return"nodejs"===t||"react-native"===t?Promise.resolve(!1):new Promise((t=>{const e=[],n=t=>{var n,r;(null==(r=null==(n=null==t?void 0:t.detail)?void 0:n.info)?void 0:r.rdns)&&e.push(t.detail)};window.addEventListener("eip6963:announceProvider",n),window.dispatchEvent(new Event("eip6963:requestProvider")),setTimeout((()=>{window.removeEventListener("eip6963:announceProvider",n);const r=e.some((t=>{var e,n;return null==(n=null==(e=null==t?void 0:t.info)?void 0:e.rdns)?void 0:n.startsWith("io.metamask")}));t(r)}),300)}))}))}}),ho=Ps({"src/domain/store/adapter.ts"(){so=class{constructor(t){this.options=t}}}}),fo=Ps({"src/domain/store/client.ts"(){oo=class{}}}),po=Ps({"src/domain/store/index.ts"(){ho(),fo()}}),mo=Ps({"src/domain/ui/types.ts"(){ao=class{constructor(t){this.options=t}get isMounted(){return void 0!==this.instance}get data(){if("object"==typeof this.options&&this.options&&"link"in this.options)return this.options.link;if("object"==typeof this.options&&this.options&&"otpCode"in this.options)return this.options.otpCode;throw new Error("Invalid options")}set data(t){"object"==typeof this.options&&this.options&&"link"in this.options&&(this.options.link=t),"object"==typeof this.options&&this.options&&"otpCode"in this.options&&(this.options.otpCode=t)}}}}),go=Ps({"src/domain/ui/index.ts"(){mo()}});function _o(t){var e,n,r,i;if("object"!=typeof t||null===t)return{code:void 0,message:""};if(t instanceof as)return{code:null!=(e=t.rpcCode)?e:t.code,message:null!=(r=null!=(n=t.rpcMessage)?n:t.message)?r:""};const s=t;return{code:s.code,message:null!=(i=s.message)?i:""}}function vo(t){if("object"!=typeof t||null===t)return!1;const{code:e,message:n}=_o(t),r=n.toLowerCase();return 4001===e||r.includes("reject")||r.includes("denied")||r.includes("cancel")||r.includes("user rejected")||r.includes("user denied")||r.includes("user cancelled")||r.includes("user canceled")}function yo(t){const e=function(t){var e,n;if("object"!=typeof t||null===t)return"unknown";const r=t,i=null!=(e=r.name)?e:"",s=null!=(n=r.message)?n:"",o=s.toLowerCase(),{code:a}=_o(t);if("number"==typeof a){if(-32601===a)return"wallet_method_unsupported";if(-32602===a)return"wallet_invalid_params";if(-32603===a)return"wallet_internal_error";if(a<=-32e3&&a>=-32099)return"wallet_internal_error";if(4100===a)return"wallet_unauthorized";if(4200===a)return"wallet_method_unsupported";if(4902===a)return"unrecognized_chain"}return"TransportTimeoutError"===i||"Request timeout"===s||o.includes("timed out")||o.includes("timeout")?"transport_timeout":"TransportError"===i||o.includes("not connected")||o.includes("transport disconnect")||o.includes("connection lost")||o.includes("socket closed")?"transport_disconnect":"unknown"}(t),{code:n,message:r}=_o(t),i=function(t){if(!t)return;let e=t;for(const{pattern:t,replacement:n}of co)e=e.replace(t,n);return e.length>uo&&(e=`${e.slice(0,uo-1)}…`),e}(r);return Rs(Rs({failure_reason:e},"number"==typeof n?{error_code:n}:{}),i?{error_message_sample:i}:{})}function wo(t,e){return Us(this,null,(function*(){var n;const r=Ro(t.dapp),i=no(),s=yield e.getAnonId();return{mmconnect_versions:null!=(n=t.versions)?n:{},dapp_id:r,platform:i,anon_id:s}}))}function bo(t,e,n,r,i){return Us(this,null,(function*(){var s;const o=Ro(t.dapp),a=yield e.getAnonId();return Rs(Rs(Rs({mmconnect_versions:null!=(s=t.versions)?s:{},dapp_id:o,method:n.request.method,caip_chain_id:n.scope,anon_id:a,transport_type:r},(null==i?void 0:i.failure_reason)?{failure_reason:i.failure_reason}:{}),"number"==typeof(null==i?void 0:i.error_code)?{error_code:i.error_code}:{}),(null==i?void 0:i.error_message_sample)?{error_message_sample:i.error_message_sample}:{})}))}var ko=Ps({"src/multichain/utils/analytics.ts"(){Go(),Mo(),uo=200,co=[{pattern:/0x[a-fA-F0-9]{40}/gu,replacement:"<addr>"},{pattern:/(?:0x)?[a-fA-F0-9]{16,}/gu,replacement:"<hex>"},{pattern:/https?:\/\/[^\s"')]+/gu,replacement:"<url>"},{pattern:/\b[a-z]{1,10}1[ac-hj-np-z02-9]{38,}\b/gu,replacement:"<addr>"},{pattern:/\b[1-9A-HJ-NP-Za-km-z]{32,}\b/gu,replacement:"<addr>"},{pattern:/\d{10,}/gu,replacement:"<num>"}]}});var Eo,Ao,Co,xo,So=Ps({"src/domain/utils/index.ts"(){ko()}}),Mo=Ps({"src/domain/index.ts"(){$s(),Ws(),Ks(),to(),lo(),po(),go(),So()}});function Oo(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;throw new Error("Unable to locate global object")}function Io(t){const e=Rr(t);return function(t){if("undefined"!=typeof btoa)return btoa(t);if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");throw new Error("No base64 encoding method available")}(String.fromCharCode.apply(null,Array.from(e)))}function Ro(t){var e;return null!=(e=t.url)?e:t.name}function To(t,e,n){var r;const{mobile:i}=t;if(null==(r=null==i?void 0:i.useDeeplink)||r)"undefined"!=typeof window&&(window.location.href=e);else if("undefined"!=typeof document){const t=document.createElement("a");t.href=n,t.target="_self",t.rel="noreferrer noopener",t.click()}}function Po(t){return t.reduce(((t,e)=>Ts(Rs({},t),{[e]:{methods:[],notifications:[],accounts:[]}})),{})}function jo(t,e,n,r){if(!(t.every((t=>e.includes(t)))&&e.every((e=>t.includes(e)))))return!1;const i=Object.values(n.sessionScopes).filter((({accounts:t})=>Boolean(t))).flatMap((({accounts:t})=>null!=t?t:[]));return r.every((t=>i.includes(t)))}function Fo(t){return t.reduce(((t,e)=>{try{return[...t,st(e)]}catch(n){const r=JSON.stringify(e);return console.error(`Invalid CAIP account ID: ${r}`,n),t}}),[])}function No(t,e){var n;if(!t||!(null==e?void 0:e.length))return t;const r=Object.fromEntries(Object.entries(t).map((([t,e])=>{var n,r,i;return[t,{methods:[...null!=(n=null==e?void 0:e.methods)?n:[]],notifications:[...null!=(r=null==e?void 0:e.notifications)?r:[]],accounts:[...null!=(i=null==e?void 0:e.accounts)?i:[]]}]}))),i=new Map;for(const t of e){const e=`${t.chain.namespace}:${t.chain.reference}`,r=`${t.chainId}:${t.address}`;i.has(e)||i.set(e,[]),null==(n=i.get(e))||n.push(r)}for(const[t,e]of Object.entries(r))if(null==e?void 0:e.accounts)try{const n=it(t),r=`${n.namespace}:${n.reference}`,s=i.get(r);if(s){const t=new Set(e.accounts),n=s.filter((e=>!t.has(e)));e.accounts.push(...n)}}catch(e){console.error(`Invalid scope format: ${t}`,e)}return r}var zo,Bo,Lo,Uo,qo,Do,$o,Wo,Zo,Go=Ps({"src/multichain/utils/index.ts"(){Mo(),Eo=()=>{var t;if("undefined"==typeof document)return;let e;const n=document.getElementsByTagName("link");for(let r=0;r<n.length;r++)"icon"!==n[r].getAttribute("rel")&&"shortcut icon"!==n[r].getAttribute("rel")||(e=null!=(t=n[r].getAttribute("href"))?t:void 0);return e},Ao=4294967295,Co=Math.floor(Math.random()*Ao),xo=()=>Co=(Co+1)%Ao}}),Ho=Ps({"src/multichain/transports/constants.ts"(){zo="metamask-multichain-provider"}}),Jo={};js(Jo,{MWPTransport:()=>Zo});var Vo=Ps({"src/multichain/transports/mwp/index.ts"(){Mo(),Go(),Ho(),6e4,6e4,12e4,1e4,Bo="cache_wallet_getSession",Lo="cache_eth_accounts",Uo="cache_eth_chainId",qo="pending_session_request",Do=["wallet_getSession","wallet_createSession","wallet_sessionChanged"],$o=["wallet_revokeSession","wallet_revokePermissions"],Wo=ls("metamask-sdk:transport"),Zo=class{constructor(t,e,n={requestTimeout:6e4,connectionTimeout:12e4,resumeTimeout:1e4}){this.dappClient=t,this.kvstore=e,this.options=n,this.__pendingRequests=new Map,this.notificationCallbacks=new Set,this.dappClient.on("message",this.handleMessage.bind(this)),this.dappClient.on("session_request",(t=>{this.currentSessionRequest=t,this.kvstore.set(qo,JSON.stringify(t)).catch((t=>{Wo("Failed to store pending session request",t)}))})),"undefined"!=typeof window&&void 0!==window.addEventListener&&(this.windowFocusHandler=this.onWindowFocus.bind(this),window.addEventListener("focus",this.windowFocusHandler))}get pendingRequests(){return this.__pendingRequests}set pendingRequests(t){this.__pendingRequests=t}get sessionRequest(){return this.currentSessionRequest}getStoredPendingSessionRequest(){return Us(this,null,(function*(){try{const t=yield this.kvstore.get(qo);return t?JSON.parse(t):null}catch(t){return null}}))}removeStoredPendingSessionRequest(){return Us(this,null,(function*(){yield this.kvstore.delete(qo)}))}onWindowFocus(){this.isConnected()||this.dappClient.reconnect()}notifyCallbacks(t){this.notificationCallbacks.forEach((e=>e(t)))}rejectRequest(t,e=new Error("Request rejected")){const n=this.pendingRequests.get(t);n&&(this.pendingRequests.delete(t),clearTimeout(n.timeout),n.reject(e))}parseWalletError(t){const e=t;if("number"==typeof e.code&&"string"==typeof e.message){const{code:t,message:n}=e;return t>=1e3&&t<=4999?Si({code:t,message:n}):new ki(t,n)}const n=t instanceof Error?t.message:JSON.stringify(t);return Ci({message:n})}handleMessage(t){if("object"==typeof t&&null!==t&&"data"in t){const e=t.data;if("id"in e&&"string"==typeof e.id){const t=this.pendingRequests.get(e.id);if(t){if(clearTimeout(t.timeout),"error"in e&&e.error)return this.pendingRequests.delete(e.id),void t.reject(this.parseWalletError(e.error));const n=Ts(Rs({},e),{method:"wallet_getSession"===t.method||"wallet_createSession"===t.method?"wallet_sessionChanged":t.method}),r=Ts(Rs({},e),{method:"wallet_getSession"===t.method||"wallet_createSession"===t.method?"wallet_sessionChanged":t.method,params:n.result});this.notifyCallbacks(r),t.resolve(n),this.pendingRequests.delete(e.id)}}else{if("metamask_chainChanged"===t.data.method&&this.kvstore.set(Uo,JSON.stringify(t.data.params.chainId)),"metamask_accountsChanged"===t.data.method&&this.kvstore.set(Lo,JSON.stringify(t.data.params)),"wallet_sessionChanged"===t.data.method){const e={result:t.data.params};this.kvstore.set(Bo,JSON.stringify(e))}this.notifyCallbacks(t.data)}}}onResumeSuccess(t,e,n){return Us(this,null,(function*(){var r,i,s,o,a,u,c;try{yield this.waitForWalletSessionIfNotCached();const l=yield this.request({method:"wallet_getSession"});if(l.error)return e(new Error(l.error.message));let d=l.result;if(d&&n){const t=Object.keys(null!=(r=null==d?void 0:d.sessionScopes)?r:{}),u=null!=(i=null==n?void 0:n.scopes)?i:[],c=jo(t,u,d,null!=(s=null==n?void 0:n.caipAccountIds)?s:[]);if(n.forceRequest||!c){const t={optionalScopes:No(Po(null!=(o=null==n?void 0:n.scopes)?o:[]),Fo(null!=(a=null==n?void 0:n.caipAccountIds)?a:[]))},r=yield this.request({method:"wallet_createSession",params:t});if(r.error)return e(new Error(r.error.message));d=r.result}}else if(!d){const t={optionalScopes:No(Po(null!=(u=null==n?void 0:n.scopes)?u:[]),Fo(null!=(c=null==n?void 0:n.caipAccountIds)?c:[]))},r=yield this.request({method:"wallet_createSession",params:t});if(r.error)return e(new Error(r.error.message));d=r.result}return yield this.removeStoredPendingSessionRequest(),this.notifyCallbacks({method:"wallet_sessionChanged",params:d}),t()}catch(t){return e(t)}}))}init(){return Us(this,null,(function*(){}))}sendEip1193Message(t,e){return Us(this,null,(function*(){const n=Rs({jsonrpc:"2.0",id:String(xo())},t),r=yield this.getCachedResponse(n);return r?(this.notifyCallbacks(r),r):new Promise(((t,r)=>{var i;const s=setTimeout((()=>{this.rejectRequest(n.id,new Br)}),null!=(i=null==e?void 0:e.timeout)?i:this.options.requestTimeout);this.pendingRequests.set(n.id,{request:n,method:n.method,resolve:e=>Us(this,null,(function*(){return yield this.storeWalletSession(n,e),t(e)})),reject:r,timeout:s}),this.dappClient.sendRequest({name:"metamask-provider",data:n}).catch(r)}))}))}connect(t){return Us(this,null,(function*(){const{dappClient:e}=this,n=yield this.getActiveSession();n&&Wo("active session found",{id:n.id,channel:n.channel,expiresAt:n.expiresAt});const r=yield this.getStoredPendingSessionRequest();let i,s;const o=new Promise(((o,a)=>Us(this,null,(function*(){let u;u=new Promise(n?(r,i)=>{var s;"CONNECTED"===this.dappClient.state?this.onResumeSuccess(r,i,t):(this.dappClient.once("connected",(()=>Us(this,null,(function*(){this.onResumeSuccess(r,i,t)})))),e.resume(null!=(s=null==n?void 0:n.id)?s:""))}:(n,r)=>{var i,o;const a={optionalScopes:No(Po(null!=(i=null==t?void 0:t.scopes)?i:[]),Fo(null!=(o=null==t?void 0:t.caipAccountIds)?o:[])),sessionProperties:null==t?void 0:t.sessionProperties},u={jsonrpc:"2.0",id:String(xo()),method:"wallet_createSession",params:a};s=t=>Us(this,null,(function*(){if("object"!=typeof t||null===t)return;if(!("data"in t))return;const e=t.data,i=e.id===u.id,s="wallet_createSession"===e.method||"wallet_sessionChanged"===e.method;return i||s?e.error?r(this.parseWalletError(e.error)):(yield this.storeWalletSession(u,e),yield this.removeStoredPendingSessionRequest(),this.notifyCallbacks(e),n()):void 0})),this.dappClient.on("message",s);const c=no(),l=["web-desktop","nodejs"].includes(c),d={name:zo,data:u};e.connect({mode:"trusted",initialPayload:l?void 0:d}).then((()=>Us(this,null,(function*(){if(l)return e.sendRequest(d)})))).catch((t=>{s&&this.dappClient.off("message",s),r(t)}))}),i=setTimeout((()=>{a(new Br)}),r?this.options.resumeTimeout:this.options.connectionTimeout),u.then(o).catch(a)}))));return o.catch((t=>Us(this,null,(function*(){throw yield this.dappClient.disconnect(),t})))).finally((()=>{i&&clearTimeout(i),s&&(this.dappClient.off("message",s),s=void 0),this.removeStoredPendingSessionRequest()}))}))}disconnect(){return Us(this,arguments,(function*(t=[]){var e,n;const r=yield this.getCachedResponse({jsonrpc:"2.0",id:"0",method:"wallet_getSession"}),i=null!=(n=null==(e=null==r?void 0:r.result)?void 0:e.sessionScopes)?n:{},s=0===t.length?[]:Object.keys(i).filter((e=>!t.includes(e))),o=Object.fromEntries(Object.entries(i).filter((([t])=>s.includes(t))));this.request({method:"wallet_revokeSession",params:{scopes:t}}).catch((t=>{console.error("error revoking session",t)}));s.some((t=>t.includes("eip155")))||(this.kvstore.delete(Lo),this.kvstore.delete(Uo)),s.length>0?this.kvstore.set(Bo,JSON.stringify({result:{sessionScopes:o}})):(this.kvstore.delete(Bo),"undefined"!=typeof window&&void 0!==window.removeEventListener&&this.windowFocusHandler&&(window.removeEventListener("focus",this.windowFocusHandler),this.windowFocusHandler=void 0),yield this.dappClient.disconnect()),this.notifyCallbacks({method:"wallet_sessionChanged",params:{sessionScopes:o}})}))}isConnected(){return"CONNECTED"===this.dappClient.state}attemptResumeSession(){return Us(this,null,(function*(){try{yield this.dappClient.reconnect(),yield new Promise(((t,e)=>{const n=setTimeout((()=>{e(new Error("Resume timeout"))}),2e3);this.isConnected()?(clearTimeout(n),t()):this.dappClient.once("connected",(()=>{clearTimeout(n),t()}))}))}catch(t){return Promise.reject(new Error(`Failed to resume session: ${t.message}`))}}))}getCachedResponse(t){return Us(this,null,(function*(){var e;if("wallet_getSession"===t.method){const n=yield this.kvstore.get(Bo);if(n){const r=JSON.parse(n);return{id:t.id,jsonrpc:"2.0",result:null!=(e=r.params)?e:r.result,method:t.method}}}else if("eth_accounts"===t.method){const e=yield this.kvstore.get(Lo);if(e)return{id:t.id,jsonrpc:"2.0",result:JSON.parse(e),method:t.method}}else if("eth_chainId"===t.method){const e=yield this.kvstore.get(Uo);if(e)return{id:t.id,jsonrpc:"2.0",result:JSON.parse(e),method:t.method}}}))}storeWalletSession(t,e){return Us(this,null,(function*(){e.error||(Do.includes(t.method)?yield this.kvstore.set(Bo,JSON.stringify(e)):"eth_accounts"===t.method?yield this.kvstore.set(Lo,JSON.stringify(e.result)):"eth_chainId"===t.method?yield this.kvstore.set(Uo,JSON.stringify(e.result)):$o.includes(t.method)&&(yield this.kvstore.delete(Bo),yield this.kvstore.delete(Lo),yield this.kvstore.delete(Uo)))}))}request(t,e){return Us(this,null,(function*(){const n=Rs({jsonrpc:"2.0",id:String(xo())},t),r=yield this.getCachedResponse(n);return r?(this.notifyCallbacks(r),r):(this.isConnected()||(yield this.attemptResumeSession()),new Promise(((t,r)=>{var i;const s=setTimeout((()=>{this.rejectRequest(n.id,new Br)}),null!=(i=null==e?void 0:e.timeout)?i:this.options.requestTimeout);this.pendingRequests.set(n.id,{request:n,method:n.method,resolve:e=>Us(this,null,(function*(){return yield this.storeWalletSession(n,e),t(e)})),reject:r,timeout:s}),this.dappClient.sendRequest({name:zo,data:n}).catch(r)})))}))}onNotification(t){return this.notificationCallbacks.add(t),()=>{this.notificationCallbacks.delete(t)}}getActiveSession(){return Us(this,null,(function*(){const{kvstore:t}=this,{SessionStore:e}=yield Promise.resolve().then((function(){return require("./index-d965eac9.cjs")})).then((function(t){return t.index})),n=yield e.create(t);try{const[t]=yield n.list();return t}catch(t){return void Wo("error getting active session",t)}}))}waitForWalletSessionIfNotCached(){return Us(this,null,(function*(){if(yield this.kvstore.get(Bo))return;let t;const e=new Promise((e=>{t=this.onNotification((n=>{if("object"==typeof n&&null!==n&&"data"in n){const r=n.data;"wallet_getSession"!==r.method&&"wallet_sessionChanged"!==r.method||(t(),e())}}))})),n=new Promise(((e,n)=>{setTimeout((()=>{t(),this.removeStoredPendingSessionRequest(),n(new Br)}),this.options.resumeTimeout)}));return Promise.race([e,n])}))}}}}),Ko={};function Qo(){return Us(this,null,(function*(){const{decrypt:t,encrypt:e,PrivateKey:n,PublicKey:r}=yield Promise.resolve().then((function(){return require("./index-908a0281.cjs")})).then((function(t){return t.index}));return{generateKeyPair(){const t=new n;return{privateKey:new Uint8Array(t.secret),publicKey:t.publicKey.toBytes(!0)}},encrypt(t,n){return Us(this,null,(function*(){const r=Buffer.from(t,"utf8");return e(n,r).toString("base64")}))},decrypt(e,n){return Us(this,null,(function*(){const r=Buffer.from(e,"base64"),i=yield t(n,r);return Buffer.from(i).toString("utf8")}))},validatePeerKey(t){r.fromHex(Buffer.from(t).toString("hex"))}}}))}js(Ko,{createKeyManager:()=>Qo});var Xo=Ps({"src/multichain/transports/mwp/KeyManager.ts"(){}});var Yo,ta,ea,na,ra,ia,sa,oa=Ps({"src/ui/modals/base/utils.ts"(){}}),aa=Ps({"src/ui/modals/base/AbstractInstallModal.ts"(){oa(),Mo(),Yo=ls("metamask-sdk:ui"),na=class extends ao{constructor(){super(...arguments),zs(this,ta,null),zs(this,ea,-1)}get link(){return this.data}set link(t){this.data=t}get connectionRequest(){return this.options.connectionRequest}set connectionRequest(t){this.options.connectionRequest=t}updateLink(t){this.link=t,this.instance&&(this.instance.link=t)}updateExpiresIn(t){t>=0&&this.instance&&(this.instance.expiresIn=t)}startExpirationCheck(t){this.stopExpirationCheck();let e=t;Bs(this,ta,setInterval((()=>Us(this,null,(function*(){const{sessionRequest:t}=e,n=Date.now(),r=t.expiresAt-n,i=Math.floor(r/1e3);if(r>0&&function(t){return t<=10||(t<=30?t%5==0:t<=60?t%10==0:t<=300?t%30==0:t%60==0)}(i)&&Ns(this,ea)!==i){const t=(s=r)<=0?"EXPIRED":`${Math.floor(s/1e3)}s`;Yo(`[UI: InstallModal-nodejs()] QR code expires in: ${t} (${i}s)`),Bs(this,ea,i)}var s;if(n>=t.expiresAt){this.stopExpirationCheck(),Yo("[UI: InstallModal-nodejs()] ⏰ QR code EXPIRED! Generating new one...");try{e=yield this.options.createConnectionRequest();const t=yield this.options.generateQRCode(e);Bs(this,ea,-1),this.updateLink(t),this.updateExpiresIn(i),this.renderQRCode(t,e)}catch(t){Yo(`[UI: InstallModal-nodejs()] ❌ Error generating new QR code: ${t}`)}}}))),1e3))}stopExpirationCheck(){Ns(this,ta)&&(clearInterval(Ns(this,ta)),Bs(this,ta,null),Yo("[UI: InstallModal-nodejs()] 🛑 Stopped QR code expiration checking"))}},ta=new WeakMap,ea=new WeakMap}}),ua=Ps({"src/ui/modals/web/install.ts"(){aa(),ra=class extends na{renderQRCode(){}mount(){var t;const{options:e}=this,n=document.createElement("mm-install-modal");n.showInstallModal=e.showInstallModal,n.addEventListener("close",(t=>{const{detail:n}=t;e.onClose(null==n?void 0:n.shouldTerminate)})),n.addEventListener("startDesktopOnboarding",e.startDesktopOnboarding),n.link=e.link,this.instance=n,null==(t=e.parentElement)||t.appendChild(n),this.startExpirationCheck(e.connectionRequest)}unmount(){var t;const{options:e,instance:n}=this;this.stopExpirationCheck(),n&&(null==(t=e.parentElement)?void 0:t.contains(n))&&(e.parentElement.removeChild(n),this.instance=void 0)}}}}),ca=Ps({"src/ui/modals/base/AbstractOTPModal.ts"(){Mo(),ia=class extends ao{get otpCode(){return this.data}set otpCode(t){this.data=t}updateOTPCode(t){this.otpCode=t,this.instance&&(this.instance.otpCode=t)}}}}),la=Ps({"src/ui/modals/web/otp.ts"(){ca(),sa=class extends ia{mount(){}unmount(){}}}}),da={};js(da,{InstallModal:()=>ra,OTPCodeModal:()=>sa});var ha,fa,pa=Ps({"src/ui/modals/web/index.ts"(){ua(),la()}}),ma={};js(ma,{StoreAdapterWeb:()=>fa});var ga=Ps({"src/store/adapters/web.ts"(){Mo(),ha=class t extends so{constructor(e="-kv-store",n=t.stores[0]){super(),this.storeName=n,this.platform="web";const r=`${t.DB_NAME}${e}`;this.dbPromise=new Promise(((e,n)=>{try{const i=this.internal.open(r,1);i.onerror=()=>n(new Error("Failed to open IndexedDB.")),i.onsuccess=()=>e(i.result),i.onupgradeneeded=()=>{const e=i.result;for(const n of t.stores)e.objectStoreNames.contains(n)||e.createObjectStore(n)}}catch(t){n(t)}}))}get internal(){if("undefined"==typeof window||!window.indexedDB)throw new Error("indexedDB is not available in this environment");return window.indexedDB}get(t){return Us(this,null,(function*(){const{storeName:e}=this,n=yield this.dbPromise;return new Promise(((r,i)=>{try{const s=n.transaction(e,"readonly"),o=s.objectStore(e).get(t);o.onerror=()=>i(new Error("Failed to get value from IndexedDB.")),o.onsuccess=()=>{var t;return r(null!=(t=o.result)?t:null)}}catch(t){i(t)}}))}))}set(t,e){return Us(this,null,(function*(){const{storeName:n}=this,r=yield this.dbPromise;return new Promise(((i,s)=>{try{const o=r.transaction(n,"readwrite"),a=o.objectStore(n).put(e,t);a.onerror=()=>s(new Error("Failed to set value in IndexedDB.")),a.onsuccess=()=>i()}catch(t){s(t)}}))}))}delete(t){return Us(this,null,(function*(){const{storeName:e}=this,n=yield this.dbPromise;return new Promise(((r,i)=>{try{const s=n.transaction(e,"readwrite"),o=s.objectStore(e).delete(t);o.onerror=()=>i(new Error("Failed to delete value from IndexedDB.")),o.onsuccess=()=>r()}catch(t){i(t)}}))}))}},ha.stores=["sdk-kv-store","key-value-pairs"],ha.DB_NAME="mmconnect",fa=ha}});Go();var _a=Oo();null!=_a.Buffer||(_a.Buffer=e.Buffer),Mo();var va="https://metamask.app.link/connect",ya="metamask://connect";Mo(),ko(),Ks(),to(),lo(),Mo();var wa=1;var ba,ka,Ea,Aa,Ca,xa,Sa=class extends Error{};function Ma(t){var e;if(t instanceof as)return t;const n=t;return new as(null!=(e=n.message)?e:"Unknown error",n.code)}Mo(),Go(),ko();ba=new WeakSet,ka=function(t,e){return Us(this,null,(function*(){var n;if(!1===(null==(n=this.config.analytics)?void 0:n.enabled))try{return yield e()}catch(t){throw Ma(t)}yield Ls(this,ba,Ea).call(this,t);try{const n=yield e();return yield Ls(this,ba,Aa).call(this,t),n}catch(e){throw vo(e)?yield Ls(this,ba,xa).call(this,t):yield Ls(this,ba,Ca).call(this,t,e),Ma(e)}}))},Ea=function(t){return Us(this,null,(function*(){const e=yield bo(this.config,this.config.storage,t,this.transportType);$i.track("mmconnect_wallet_action_requested",e)}))},Aa=function(t){return Us(this,null,(function*(){const e=yield bo(this.config,this.config.storage,t,this.transportType);$i.track("mmconnect_wallet_action_succeeded",e)}))},Ca=function(t,e){return Us(this,null,(function*(){const n=yield bo(this.config,this.config.storage,t,this.transportType,yo(e));$i.track("mmconnect_wallet_action_failed",n)}))},xa=function(t){return Us(this,null,(function*(){const e=yield bo(this.config,this.config.storage,t,this.transportType);$i.track("mmconnect_wallet_action_rejected",e)}))},Go();var Oa,Ia,Ra,Ta,Pa,ja,Fa,Na,za,Ba,La,Ua,qa,Da,$a,Wa,Za,Ga,Ha,Ja=class{constructor(){zs(this,Fa),zs(this,Oa,new Set),zs(this,Ia,Yr()),zs(this,Ra,{timeout:6e4}),zs(this,Ta,new Map),zs(this,Pa),zs(this,ja)}sendEip1193Message(t,e){return Us(this,null,(function*(){Ls(this,Fa,Ua).call(this);const n=String(xo()),r=Rs({jsonrpc:"2.0",id:n},t);return new Promise(((t,i)=>{var s;const o=setTimeout((()=>{Ns(this,Ta).delete(n),i(new Error("Request timeout"))}),null!=(s=null==e?void 0:e.timeout)?s:Ns(this,Ra).timeout);Ns(this,Ta).set(n,{resolve:e=>{t(e)},reject:i,timeout:o}),window.postMessage({target:"metamask-contentscript",data:{name:"metamask-provider",data:r}},location.origin)}))}))}init(){return Us(this,null,(function*(){yield Ls(this,Fa,qa).call(this);let t={sessionScopes:{}};try{t=(yield this.request({method:"wallet_getSession"},Ns(this,Ra))).result}catch(t){console.error("Failed to get wallet session during DefaultTransport init")}Ls(this,Fa,Na).call(this,{method:"wallet_sessionChanged",params:t})}))}connect(t){return Us(this,null,(function*(){var e,n,r,i,s;yield Ls(this,Fa,qa).call(this);const o=yield this.request({method:"wallet_getSession"},Ns(this,Ra));if(o.error)throw new Error(o.error.message);let a=o.result;const u={optionalScopes:No(Po(null!=(e=null==t?void 0:t.scopes)?e:[]),Fo(null!=(n=null==t?void 0:t.caipAccountIds)?n:[])),sessionProperties:null==t?void 0:t.sessionProperties};if(a&&t&&!t.forceRequest){if(!jo(Object.keys(null!=(r=null==a?void 0:a.sessionScopes)?r:{}),null!=(i=null==t?void 0:t.scopes)?i:[],a,null!=(s=null==t?void 0:t.caipAccountIds)?s:[])){const t=yield this.request({method:"wallet_createSession",params:u},Ns(this,Ra));if(t.error)throw new Error(t.error.message);a=t.result}}else if(!a||(null==t?void 0:t.forceRequest)){const t=yield this.request({method:"wallet_createSession",params:u},Ns(this,Ra));if(t.error)throw new Error(t.error.message);a=t.result}Ls(this,Fa,Na).call(this,{method:"wallet_sessionChanged",params:a})}))}disconnect(){return Us(this,arguments,(function*(t=[]){yield this.request({method:"wallet_revokeSession",params:{scopes:t}})}))}isConnected(){return Ns(this,Ia).isConnected()}request(t){return Us(this,arguments,(function*(t,e=Ns(this,Ra)){return Ns(this,Ia).request(t,e)}))}onNotification(t){return Ns(this,Ia).onNotification(t),Ns(this,Oa).add(t),()=>{Ns(this,Oa).delete(t)}}getActiveSession(){return Us(this,null,(function*(){throw new Error("getActiveSession is purposely not implemented for the DefaultTransport")}))}getStoredPendingSessionRequest(){return Us(this,null,(function*(){throw new Error("getStoredPendingSessionRequest is purposely not implemented for the DefaultTransport")}))}};Oa=new WeakMap,Ia=new WeakMap,Ra=new WeakMap,Ta=new WeakMap,Pa=new WeakMap,ja=new WeakMap,Fa=new WeakSet,Na=function(t){for(const e of Ns(this,Oa))try{e(t)}catch(t){console.log("[WindowPostMessageTransport] notifyCallbacks error:",t)}},za=function(t){var e,n;return"metamask-provider"===(null==(n=null==(e=null==t?void 0:t.data)?void 0:e.data)?void 0:n.name)&&t.origin===location.origin},Ba=function(t){var e,n;if(!Ls(this,Fa,za).call(this,t))return;const r=null==(n=null==(e=null==t?void 0:t.data)?void 0:e.data)?void 0:n.data;if(("object"!=typeof r||null===r||!("method"in r))&&"object"==typeof r&&null!==r&&"id"in r&&("result"in r||"error"in r)){const t=String(r.id),e=Ns(this,Ta).get(t);if(e){clearTimeout(e.timeout),Ns(this,Ta).delete(t);const n=r;if("error"in n&&n.error){const t=new Error(n.error.message||"Request failed");"number"==typeof n.error.code&&(t.code=n.error.code),e.reject(t)}else e.resolve(n)}}},La=function(t){var e,n;if(!Ls(this,Fa,za).call(this,t))return;const r=null==(n=null==(e=null==t?void 0:t.data)?void 0:e.data)?void 0:n.data;"object"==typeof r&&null!==r&&"method"in r&&Ls(this,Fa,Na).call(this,r)},Ua=function(){Ns(this,Pa)||(Bs(this,Pa,Ls(this,Fa,Ba).bind(this)),Bs(this,ja,Ls(this,Fa,La).bind(this)),window.addEventListener("message",Ns(this,Pa)),window.addEventListener("message",Ns(this,ja)))},qa=function(){return Us(this,null,(function*(){Ls(this,Fa,Ua).call(this),Ns(this,Ia).isConnected()||(yield Ns(this,Ia).connect())}))},Go();Da=new WeakMap,$a=new WeakSet,Wa=function(t){return Us(this,null,(function*(){const e=t.params,n=Object.keys(Rs(Rs({},e.optionalScopes),e.requiredScopes)),r=[];n.forEach((t=>{var n,i,s,o;const a=null==(n=e.requiredScopes)?void 0:n[t],u=null==(i=e.optionalScopes)?void 0:i[t];a&&r.push(...null!=(s=a.accounts)?s:[]),u&&r.push(...null!=(o=u.accounts)?o:[])}));const i=[...new Set(r)];return yield this.metamaskConnectMultichain.connect(n,i,e.sessionProperties),this.metamaskConnectMultichain.transport.request({method:"wallet_getSession"})}))},Za=function(t){return Us(this,null,(function*(){return this.isTransportConnected()?this.metamaskConnectMultichain.transport.request({method:"wallet_getSession"}):{jsonrpc:"2.0",id:t.id,result:{sessionScopes:{}}}}))},Ga=function(t){return Us(this,null,(function*(){var e;const n=t.params,r=null!=(e=null==n?void 0:n.scopes)?e:[];try{return yield this.metamaskConnectMultichain.disconnect(r),{jsonrpc:"2.0",id:t.id,result:!0}}catch(e){return{jsonrpc:"2.0",id:t.id,result:!1}}}))},Ha=function(t){return Us(this,null,(function*(){if(!this.isTransportConnected())return{error:xi()};return{result:this.metamaskConnectMultichain.invokeMethod(t.params)}}))},Go();var Va,Ka,Qa,Xa,Ya,tu,eu,nu,ru,iu,su,ou,au,uu,cu,lu,du,hu,fu,pu,mu,gu,_u,vu,yu,wu,bu,ku,Eu,Au=ls("metamask-sdk:core"),Cu="__METAMASK_CONNECT_MULTICHAIN_SINGLETON__";function xu(t){var e;return Ts(Rs({},null!=t?t:{}),{enabled:null==(e=null==t?void 0:t.enabled)||e,integrationType:(null==t?void 0:t.integrationType)||"direct"})}function Su(t){var e;return!1!==(null==(e=t.analytics)?void 0:e.enabled)}function Mu(t,e,n){return Us(this,null,(function*(){var r,i;if(!Su(t))return null==n||n(void 0),void $i.disable();const s=no();if(!("in-app-browser"===s||"web-desktop"===s||"web-mobile"===s)&&!("react-native"===s))return;const o=Ro(t.dapp),a=yield e.getAnonId();null==n||n(a);const{integrationType:u}=null!=(r=t.analytics)?r:{integrationType:""};$i.setGlobalProperty("mmconnect_versions",null!=(i=t.versions)?i:{}),$i.setGlobalProperty("dapp_id",o),$i.setGlobalProperty("anon_id",a),$i.setGlobalProperty("platform",s),u&&$i.setGlobalProperty("integration_types",[u]),$i.enable()}))}Ka=new WeakMap,Qa=new WeakMap,Xa=new WeakMap,Ya=new WeakMap,tu=new WeakMap,eu=new WeakMap,nu=new WeakMap,ru=new WeakMap,iu=new WeakMap,su=new WeakSet,ou=function(){return Us(this,null,(function*(){yield Mu(this.options,this.storage,(t=>{Bs(this,ru,t)}))}))},au=function(t){return Us(this,null,(function*(){var e,n,r;if("object"==typeof t&&null!==t&&"method"in t){if("wallet_sessionChanged"===t.method){const r=null!=(n=null==(e=t.params)?void 0:e.sessionScopes)?n:{},i=Object.keys(r).length>0;if("loaded"===this.status&&!i)return;this.status=i?"connected":"disconnected"}this.emit(t.method,null!=(r=t.params)?r:t.result)}}))},uu=function(){return Us(this,null,(function*(){const t=yield this.storage.getTransport(),e=yield io();if(t){if("browser"===t){if(e){const t=new Ja;return Bs(this,Xa,t),Bs(this,eu,"browser"),Ns(this,Qa).setupTransportNotificationListener(),Bs(this,nu,t.onNotification(Ls(this,su,au).bind(this))),t}}else if("mwp"===t){const{adapter:t}=this.options.storage,e=yield Ls(this,su,hu).call(this),{MWPTransport:n}=yield Promise.resolve().then((()=>(Vo(),Jo))),r=new n(e,t);return Bs(this,Ya,e),Bs(this,Xa,r),Bs(this,eu,"mwp"),Ns(this,Qa).setupTransportNotificationListener(),Bs(this,nu,r.onNotification(Ls(this,su,au).bind(this))),r}yield this.storage.removeTransport()}}))},cu=function(){return Us(this,null,(function*(){var t;if(yield Ls(this,su,uu).call(this))this.transport.isConnected()||(this.status="connecting",yield this.transport.connect()),this.status="connected","mwp"===Ns(this,eu)?yield this.storage.setTransport("mwp"):yield this.storage.setTransport("browser");else{this.status="loaded";const e=yield io(),n=null==(t=this.options.ui.preferExtension)||t;if(e&&n){yield Ls(this,su,yu).call(this,{persist:!1});try{yield this.transport.init()}catch(t){console.error("Passive init failed:",t)}}}}))},lu=function(){const t={dapp:this.options.dapp,sdk:{version:"0.0.0",platform:no()}};return Su(this.options)&&Ns(this,ru)&&(t.analytics={remote_session_id:Ns(this,ru)}),t},du=function(){return Us(this,null,(function*(){try{yield Ls(this,su,ou).call(this),yield Ls(this,su,cu).call(this)}catch(t){yield this.storage.removeTransport(),this.status="pending",Au("MetaMaskSDK error during initialization",t)}}))},hu=function(){return Us(this,null,(function*(){const[t,{DappClient:e},{createKeyManager:n}]=yield Promise.all([Promise.resolve().then((function(){return require("./index-d965eac9.cjs")})).then((function(t){return t.index})),Promise.resolve().then((function(){return require("./index-2659a245.cjs")})),Promise.resolve().then((()=>(Xo(),Ko)))]),r=yield n(),{adapter:i}=this.options.storage,s=yield t.SessionStore.create(i),o="undefined"!=typeof window?WebSocket:(yield Promise.resolve().then((function(){return require("./browser-d0e333da.cjs")})).then((function(t){return t.browser}))).WebSocket;return new e({transport:yield t.WebSocketTransport.create({url:"wss://mm-sdk-relay.api.cx.metamask.io/connection/websocket",kvstore:i,websocket:o}),sessionstore:s,keymanager:r})}))},fu=function(){return Us(this,null,(function*(){if("mwp"===Ns(this,eu))return;const{adapter:t}=this.options.storage,e=yield Ls(this,su,hu).call(this);Bs(this,Ya,e);const{MWPTransport:n}=yield Promise.resolve().then((()=>(Vo(),Jo))),r=new n(e,t);Bs(this,Xa,r),Bs(this,eu,"mwp"),Ns(this,Qa).setupTransportNotificationListener(),Bs(this,nu,this.transport.onNotification(Ls(this,su,au).bind(this))),yield this.storage.setTransport("mwp")}))},pu=function(){return Us(this,null,(function*(){var t;(null==(t=this.options.ui.factory.modal)?void 0:t.isMounted)&&(yield this.storage.removeTransport())}))},mu=function(){const t=Ls(this,su,pu).bind(this);return"undefined"!=typeof window&&void 0!==window.addEventListener&&window.addEventListener("beforeunload",t),()=>{"undefined"!=typeof window&&void 0!==window.removeEventListener&&window.removeEventListener("beforeunload",t)}},gu=function(t,e,n,r){return Us(this,null,(function*(){return new Promise(((i,s)=>{this.options.ui.factory.renderInstallModal(t,(()=>Us(this,null,(function*(){return"CONNECTED"!==this.dappClient.state&&"CONNECTING"!==this.dappClient.state||(yield this.dappClient.disconnect()),new Promise((t=>{this.dappClient.on("session_request",(e=>{t({sessionRequest:e,metadata:Ls(this,su,lu).call(this)})})),(()=>Us(this,null,(function*(){var t;try{yield this.transport.connect({scopes:e,caipAccountIds:n,sessionProperties:r}),yield this.options.ui.factory.unload(),null==(t=this.options.ui.factory.modal)||t.unmount(),this.status="connected",yield this.storage.setTransport("mwp")}catch(t){const{ProtocolError:e,ErrorCode:n}=yield Promise.resolve().then((function(){return require("./index-d965eac9.cjs")})).then((function(t){return t.index}));if(t instanceof e)t.code!==n.REQUEST_EXPIRED&&(this.status="disconnected",yield this.options.ui.factory.unload(t),s(t));else{this.status="disconnected";const e=t instanceof Error?t:new Error(String(t));yield this.options.ui.factory.unload(e),s(e)}}})))().catch((()=>{}))}))}))),(t=>Us(this,null,(function*(){t?(yield this.storage.removeTransport(),s(t)):(yield this.storage.setTransport("mwp"),i())}))),(t=>{this.emit("display_uri",t)})).catch((t=>{s(t instanceof Error?t:new Error(String(t)))}))}))}))},_u=function(t,e,n,r){return Us(this,null,(function*(){null!=Ns(this,tu)||Bs(this,tu,Ls(this,su,mu).call(this)),this.options.ui.headless?yield Ls(this,su,vu).call(this,e,n,r):yield Ls(this,su,gu).call(this,t,e,n,r)}))},vu=function(t,e,n){return Us(this,null,(function*(){return new Promise(((r,i)=>{"CONNECTED"!==this.dappClient.state&&"CONNECTING"!==this.dappClient.state||this.dappClient.disconnect().catch((()=>{})),this.dappClient.on("session_request",(t=>{const e={sessionRequest:t,metadata:Ls(this,su,lu).call(this)},n=this.options.ui.factory.createConnectionDeeplink(e);this.emit("display_uri",n)})),this.transport.connect({scopes:t,caipAccountIds:e,sessionProperties:n}).then((()=>Us(this,null,(function*(){this.status="connected",yield this.storage.setTransport("mwp"),r()})))).catch((t=>Us(this,null,(function*(){const{ProtocolError:e}=yield Promise.resolve().then((function(){return require("./index-d965eac9.cjs")})).then((function(t){return t.index}));t instanceof e?(this.status="disconnected",yield this.storage.removeTransport(),i(t)):(this.status="disconnected",yield this.storage.removeTransport(),i(t instanceof Error?t:new Error(String(t))))}))))}))}))},yu=function(){return Us(this,arguments,(function*(t={persist:!0}){if("browser"===Ns(this,eu))return Ns(this,Xa);(null==t?void 0:t.persist)&&(yield this.storage.setTransport("browser"));const e=new Ja;return Bs(this,nu,e.onNotification(Ls(this,su,au).bind(this))),Bs(this,Xa,e),Bs(this,eu,"browser"),Ns(this,Qa).setupTransportNotificationListener(),e}))},wu=function(t,e,n){return Us(this,null,(function*(){return new Promise(((r,i)=>Us(this,null,(function*(){const s=t=>{var e;if("object"!=typeof t||null===t||!("data"in t))return;const n=t.data;"object"==typeof n&&null!==n&&(n.error&&(this.dappClient.off("message",s),i(n.error)),(null==(e=null==n?void 0:n.result)?void 0:e.sessionScopes)&&this.dappClient.off("message",s))};let o;return this.dappClient.on("message",s),this.transport.isConnected()?o=setTimeout((()=>{this.openSimpleDeeplinkIfNeeded()}),250):this.dappClient.once("session_request",(t=>{var e;const n={sessionRequest:t,metadata:Ls(this,su,lu).call(this)},r=this.options.ui.factory.createConnectionDeeplink(n),i=this.options.ui.factory.createConnectionUniversalLink(n);this.emit("display_uri",r),(null==(e=this.options.mobile)?void 0:e.preferredOpenLink)?this.options.mobile.preferredOpenLink(r,"_self"):To(this.options,r,i)})),this.transport.connect({scopes:t,caipAccountIds:e,sessionProperties:n}).then(r).catch((t=>Us(this,null,(function*(){yield this.storage.removeTransport(),this.dappClient.off("message",s),i(t instanceof Error?t:new Error(String(t)))})))).finally((()=>{o&&clearTimeout(o)}))}))))}))},bu=function(t,e,n){return Us(this,null,(function*(){return this.status="connecting",t.then((()=>Us(this,null,(function*(){if(this.status="connected",Su(this.options))try{const t=yield wo(this.options,this.storage);$i.track("mmconnect_connection_established",Ts(Rs({},t),{transport_type:n,user_permissioned_chains:e}))}catch(t){Au("Error tracking connection_established event",t)}})))).catch((t=>Us(this,null,(function*(){if(this.status="disconnected",Su(this.options))try{const e=yield wo(this.options,this.storage);vo(t)?$i.track("mmconnect_connection_rejected",Ts(Rs({},e),{transport_type:n})):$i.track("mmconnect_connection_failed",Rs(Ts(Rs({},e),{transport_type:n}),yo(t)))}catch(e){Au("Error tracking connection failed/rejected event",t)}throw t}))))}))},ku=function(){return Us(this,null,(function*(){var t;let e={sessionScopes:{},sessionProperties:{}};if(null==(t=Ns(this,Xa))?void 0:t.isConnected())try{const t=yield this.transport.request({method:"wallet_getSession"});t.result&&(e=t.result)}catch(t){}return e}))},Eu=function(){return Us(this,null,(function*(){var t,e;const{ui:n}=this.options,{showInstallModal:r=!1}=null!=n?n:{};if(!(ro()&&!r))return;const i=yield null==(t=Ns(this,Xa))?void 0:t.getStoredPendingSessionRequest();if(!i)return;const s={sessionRequest:i,metadata:Ls(this,su,lu).call(this)},o=this.options.ui.factory.createConnectionDeeplink(s),a=this.options.ui.factory.createConnectionUniversalLink(s);(null==(e=this.options.mobile)?void 0:e.preferredOpenLink)?this.options.mobile.preferredOpenLink(o,"_self"):To(this.options,o,a)}))};var Ou=class t extends Vs{constructor(t){var e,n,r,i;const s=function(t){var e,n;const r=no(),i="web-desktop"===r||"web-mobile"===r||"in-app-browser"===r;if(!(null==(e=t.dapp)?void 0:e.name))throw new Error("You must provide dapp name");if(i&&(t.dapp=Ts(Rs({},t.dapp),{url:`${window.location.protocol}//${window.location.host}`})),!(null==(n=t.dapp)?void 0:n.url))throw new Error("You must provide dapp url");if("react-native"===r&&t.dapp.url){const e=function(t){var e;if(/^https?:\/\//u.test(t))return;const n=t.match(/^([^:]*):\/\//u);return{url:`https://${((null!=(e=null==n?void 0:n[1])?e:t).toLowerCase().replace(/[^a-z0-9-]/gu,"-").replace(/^-+|-+$/gu,"")||"unknown").slice(0,63).replace(/-+$/u,"")}.rn.dapp.local`,nativeScheme:t}}(t.dapp.url);e&&(console.info(`Normalizing dapp URL for React Native: "${t.dapp.url}" -> "${e.url}"`),t.dapp=Ts(Rs({},t.dapp),{url:e.url,nativeScheme:e.nativeScheme}))}const s=/^(http|https):\/\/[^\s]*$/u;if(t.dapp){"iconUrl"in t.dapp&&t.dapp.iconUrl&&!s.test(t.dapp.iconUrl)&&(console.warn("Invalid dappMetadata.iconUrl: URL must start with http:// or https://"),t.dapp.iconUrl=void 0),"base64Icon"in t.dapp&&t.dapp.base64Icon&&t.dapp.base64Icon.length>163400&&(console.warn("Invalid dappMetadata.base64Icon: Base64-encoded icon string length must be less than 163400 characters"),t.dapp.base64Icon=void 0),t.dapp.url&&!s.test(t.dapp.url)&&console.warn("Invalid dappMetadata.url: URL must start with http:// or https://");const e=Eo();if(e&&!("iconUrl"in t.dapp)&&!("base64Icon"in t.dapp)){const n=`${window.location.protocol}//${window.location.host}${e}`;t.dapp.iconUrl=n}}return t}(t);super(Ts(Rs({},s),{ui:Ts(Rs({},s.ui),{preferExtension:null==(e=s.ui.preferExtension)||e,showInstallModal:null!=(n=s.ui.showInstallModal)&&n,headless:null!=(r=s.ui.headless)&&r}),analytics:xu(t.analytics),versions:Rs({"connect-multichain":"0.15.0"},null!=(i=t.versions)?i:{})})),zs(this,su),zs(this,Ka),zs(this,Qa),zs(this,Xa),zs(this,Ya),zs(this,tu),zs(this,eu),this._status="pending",zs(this,nu),zs(this,ru),zs(this,iu,`Sdk/Javascript SdkVersion/0.0.0 Platform/${no()} dApp/${null!=(Va=this.options.dapp.url)?Va:this.options.dapp.name} dAppTitle/${this.options.dapp.name}`),Bs(this,Qa,new class{constructor(t){this.metamaskConnectMultichain=t,zs(this,$a),zs(this,Da,new Set)}isTransportDefined(){try{return Boolean(this.metamaskConnectMultichain.transport)}catch(t){return!1}}isTransportConnected(){return this.isTransportDefined()&&this.metamaskConnectMultichain.transport.isConnected()}clearNotificationCallbacks(){Ns(this,Da).clear()}notifyCallbacks(t){Ns(this,Da).forEach((e=>{e(t)}))}clearTransportNotificationListener(){var t;null==(t=this.notificationListener)||t.call(this),this.notificationListener=void 0}setupTransportNotificationListener(){this.isTransportDefined()&&!this.notificationListener&&(this.notificationListener=this.metamaskConnectMultichain.transport.onNotification(this.notifyCallbacks.bind(this)))}connect(){return Us(this,null,(function*(){return Promise.resolve()}))}disconnect(){return Us(this,null,(function*(){return Promise.resolve()}))}isConnected(){return!0}request(t){return Us(this,arguments,(function*(t,e={}){const n=xo(),r=Rs({id:n,jsonrpc:"2.0"},t);switch(r.method){case"wallet_createSession":return Ls(this,$a,Wa).call(this,r);case"wallet_getSession":return Ls(this,$a,Za).call(this,r);case"wallet_revokeSession":return Ls(this,$a,Ga).call(this,r);case"wallet_invokeMethod":return Ls(this,$a,Ha).call(this,r);default:throw new Error(`Unsupported method: ${r.method}`)}}))}onNotification(t){return this.setupTransportNotificationListener(),Ns(this,Da).add(t),()=>{Ns(this,Da).delete(t)}}}(this)),Bs(this,Ka,Lr({transport:Ns(this,Qa)}))}get status(){return this._status}set status(t){this._status!==t&&(this._status=t,this.emit("stateChanged",t))}get provider(){return Ns(this,Ka)}get transport(){if(!Ns(this,Xa))throw new Error("Transport not initialized, establish connection first");return Ns(this,Xa)}get dappClient(){if(!Ns(this,Ya))throw new Error("DappClient not initialized, establish connection first");return Ns(this,Ya)}get transportType(){var t;return null!=(t=Ns(this,eu))?t:"unknown"}get storage(){return this.options.storage}static create(e){return Us(this,null,(function*(){var n;const r=Oo(),i=r[Cu];if(i){const r=yield i;return r.mergeOptions(e),r instanceof t?yield Ls(n=r,su,ou).call(n):yield Mu(r.options,r.storage),e.debug&&ds("metamask-sdk:*"),r}const s=Us(null,null,(function*(){var n;const r=new t(e);return(yield hs("metamask-sdk:core",r.options.storage))&&ds("metamask-sdk:core"),yield Ls(n=r,su,du).call(n),r}));return r[Cu]=s,s.catch((t=>{r[Cu]=void 0,console.error("Error initializing MetaMaskConnectMultichain",t)})),s}))}connect(t,e,n,r){return Us(this,null,(function*(){var i;if("connecting"===this.status&&"mwp"===Ns(this,eu))throw yield Ls(this,su,Eu).call(this),new Error("Existing connection is pending. Please check your MetaMask Mobile app to continue.");const{ui:s}=this.options,o=no(),a="in-app-browser"===o||"web-desktop"===o,{preferExtension:u=!0,showInstallModal:c=!1}=s,l=ro(),d=yield io();let h;if(h="in-app-browser"===o||a&&d&&u?"browser":"mwp",Su(this.options))try{const e=yield wo(this.options,this.storage),n=Object.keys(this.options.api.supportedNetworks);$i.track("mmconnect_connection_initiated",Ts(Rs({},e),{transport_type:h,dapp_configured_chains:n,dapp_requested_chains:t}))}catch(t){Au("Error tracking connection_initiated event",t)}const f=yield Ls(this,su,ku).call(this),{mergedScopes:p,mergedCaipAccountIds:m,mergedSessionProperties:g}=function(t,e,n,r){const i=Object.keys(t.sessionScopes),s=[];return Object.values(t.sessionScopes).forEach((t=>{(null==t?void 0:t.accounts)&&Array.isArray(t.accounts)&&t.accounts.forEach((t=>{s.push(t)}))})),{mergedScopes:Array.from(new Set([...i,...e])),mergedCaipAccountIds:Array.from(new Set([...s,...n])),mergedSessionProperties:Rs(Rs({},t.sessionProperties),r)}}(f,t,e,n),_=Object.keys(null!=g?g:{}).length>0?g:void 0;if((null==(i=Ns(this,Xa))?void 0:i.isConnected())&&!l)return Ls(this,su,bu).call(this,Ns(this,Xa).connect({scopes:p,caipAccountIds:m,sessionProperties:_,forceRequest:r}).then((()=>Us(this,null,(function*(){return"mwp"===Ns(this,eu)?this.storage.setTransport("mwp"):this.storage.setTransport("browser")})))),t,h);if("in-app-browser"===o){const e=yield Ls(this,su,yu).call(this);return Ls(this,su,bu).call(this,e.connect({scopes:p,caipAccountIds:m,sessionProperties:_,forceRequest:r}),t,h)}if(a&&d&&u){const e=yield Ls(this,su,yu).call(this);return Ls(this,su,bu).call(this,e.connect({scopes:p,caipAccountIds:m,sessionProperties:_,forceRequest:r}),t,h)}yield Ls(this,su,fu).call(this);const v=d?c:!u||c;return l&&!v?Ls(this,su,bu).call(this,Ls(this,su,wu).call(this,p,m,_),t,h):Ls(this,su,bu).call(this,Ls(this,su,_u).call(this,v,p,m,_),t,h)}))}emit(t,e){var n,r;null==(r=null==(n=this.options.transport)?void 0:n.onNotification)||r.call(n,{method:t,params:e}),super.emit(t,e)}disconnect(){return Us(this,arguments,(function*(t=[]){var e,n,r;const i=yield Ls(this,su,ku).call(this),s=0===t.length?[]:Object.keys(i.sessionScopes).filter((e=>!t.includes(e)));yield null==(e=Ns(this,Xa))?void 0:e.disconnect(t),0===s.length&&(yield this.storage.removeTransport(),"browser"!==Ns(this,eu)&&(yield null==(n=Ns(this,nu))?void 0:n.call(this),null==(r=Ns(this,tu))||r.call(this),Bs(this,nu,void 0),Bs(this,tu,void 0),Bs(this,Xa,void 0),Bs(this,eu,void 0),Ns(this,Qa).clearTransportNotificationListener(),Bs(this,Ya,void 0)),this.status="disconnected")}))}invokeMethod(t){return Us(this,null,(function*(){var e;const{transport:n,options:r}=this,i=new class{constructor(t,e){this.config=t,this.sdkInfo=e}request(t){return Us(this,null,(function*(){const{request:e}=t,n=JSON.stringify({jsonrpc:"2.0",method:e.method,params:e.params,id:wa+=1}),r=this.getRpcEndpoint(t.scope),i=yield this.fetchWithTimeout(r,n,"POST",this.getHeaders(r),3e4);return yield this.parseResponse(i)}))}getRpcEndpoint(t){var e,n,r;const i=(null!=(r=null==(n=null==(e=this.config)?void 0:e.api)?void 0:n.supportedNetworks)?r:{})[t];if(!i)throw new Sa(`No RPC endpoint found for scope ${t}`);return i}fetchWithTimeout(t,e,n,r,i){return Us(this,null,(function*(){const s=new AbortController,o=setTimeout((()=>s.abort()),i);try{const i=yield Zi(t,{method:n,headers:r,body:e,signal:s.signal});if(clearTimeout(o),!i.ok)throw new es(t,n,i.status);return i}catch(t){if(clearTimeout(o),t instanceof es)throw t;if(t instanceof Error&&"AbortError"===t.name)throw new ss(`Request timeout after ${i}ms`);throw new ss(t.message)}}))}parseResponse(t){return Us(this,null,(function*(){try{return(yield t.json()).result}catch(t){throw new rs(t.message)}}))}getHeaders(t){const e={Accept:"application/json","Content-Type":"application/json"};return t.includes("infura")?Ts(Rs({},e),{"Metamask-Sdk-Info":this.sdkInfo}):e}}(r,Ns(this,iu)),s=new class{constructor(t,e,n,r){this.transport=t,this.rpcClient=e,this.config=n,this.transportType=r,zs(this,ba)}invokeMethod(t){return Us(this,null,(function*(){const{method:e}=t.request;return Gs.has(e)?this.handleWithRpcNode(t):Hs.has(e)?this.handleWithSdkState(t):this.handleWithWallet(t)}))}handleWithWallet(t){return Us(this,null,(function*(){return Ls(this,ba,ka).call(this,t,(()=>Us(this,null,(function*(){const e=this.transport.request({method:"wallet_invokeMethod",params:t}),{ui:n,mobile:r}=this.config,{showInstallModal:i=!1}=null!=n?n:{};ro()&&!i&&setTimeout((()=>Us(this,null,(function*(){const t=yield this.transport.getActiveSession();if(!t)throw new Error("No active session found");const e=`${ya}/mwp?id=${encodeURIComponent(t.id)}`;(null==r?void 0:r.preferredOpenLink)?r.preferredOpenLink(e,"_self"):To(this.config,e,va)}))),10);const s=yield e;if(s.error){const{error:t}=s;throw new as(`RPC Request failed with code ${t.code}: ${t.message}`,t.code,t.message)}return s.result}))))}))}handleWithRpcNode(t){return Us(this,null,(function*(){try{return yield this.rpcClient.request(t)}catch(e){if(e instanceof Sa)return this.handleWithWallet(t);throw e}}))}handleWithSdkState(t){return Us(this,null,(function*(){return console.warn(`Method "${t.request.method}" is configured for SDK state handling, but this is not yet implemented. Falling back to wallet passthrough.`),this.handleWithWallet(t)}))}}(n,i,r,null!=(e=Ns(this,eu))?e:"unknown");return s.invokeMethod(t)}))}openSimpleDeeplinkIfNeeded(){const{ui:t,mobile:e}=this.options,{showInstallModal:n=!1}=null!=t?t:{};ro()&&!n&&setTimeout((()=>Us(this,null,(function*(){const t=yield this.transport.getActiveSession();if(!t)throw new Error("No active session found");const n=`${ya}/mwp?id=${encodeURIComponent(t.id)}`;(null==e?void 0:e.preferredOpenLink)?e.preferredOpenLink(n,"_self"):To(this.options,n,va)}))),10)}emitSessionChanged(){return Us(this,null,(function*(){var t,e;const n={sessionScopes:{}};if(!(null==(t=Ns(this,Xa))?void 0:t.isConnected()))return void this.emit("wallet_sessionChanged",n);const r=yield this.transport.request({method:"wallet_getSession"});this.emit("wallet_sessionChanged",null!=(e=r.result)?e:n)}))}};qs();var Iu=class t extends Yi{constructor(e,n,r){super(`StorageErr${t.code}: ${e} storage get error in key: ${n} - ${r}`,t.code),this.platform=e,this.key=n,this.reason=r}};Iu.code=60;var Ru=Iu,Tu=class t extends Yi{constructor(e,n,r){super(`StorageErr${t.code}: ${e} storage set error in key: ${n} - ${r}`,t.code),this.platform=e,this.key=n,this.reason=r}};Tu.code=61;var Pu=Tu,ju=class t extends Yi{constructor(e,n,r){super(`StorageErr${t.code}: ${e} storage delete error in key: ${n} - ${r}`,t.code),this.platform=e,this.key=n,this.reason=r}};ju.code=62;var Fu=ju;to(),fo();var Nu=class extends oo{constructor(t){super(),this.adapter=t}getTransport(){return Us(this,null,(function*(){try{const t=yield this.adapter.get("multichain-transport");return t?function(t){switch(t){case"browser":return"browser";case"mwp":return"mwp";default:return"unknown"}}(t):null}catch(t){throw new Ru(this.adapter.platform,"multichain-transport",t.message)}}))}setTransport(t){return Us(this,null,(function*(){try{yield this.adapter.set("multichain-transport",t)}catch(t){throw new Pu(this.adapter.platform,"multichain-transport",t.message)}}))}removeTransport(){return Us(this,null,(function*(){try{yield this.adapter.delete("multichain-transport")}catch(t){throw new Fu(this.adapter.platform,"multichain-transport",t.message)}}))}getAnonId(){return Us(this,null,(function*(){try{const t=yield this.adapter.get("anonId");if(t)return t;const e=Ki();return yield this.adapter.set("anonId",e),e}catch(t){throw new Ru(this.adapter.platform,"anonId",t.message)}}))}getExtensionId(){return Us(this,null,(function*(){try{return yield this.adapter.get("extensionId")}catch(t){throw new Ru(this.adapter.platform,"extensionId",t.message)}}))}setAnonId(t){return Us(this,null,(function*(){try{return yield this.adapter.set("anonId",t)}catch(t){throw new Pu(this.adapter.platform,"anonId",t.message)}}))}setExtensionId(t){return Us(this,null,(function*(){try{return yield this.adapter.set("extensionId",t)}catch(t){throw new Pu(this.adapter.platform,"extensionId",t.message)}}))}removeExtensionId(){return Us(this,null,(function*(){try{return yield this.adapter.delete("extensionId")}catch(t){throw new Fu(this.adapter.platform,"extensionId",t.message)}}))}removeAnonId(){return Us(this,null,(function*(){try{return yield this.adapter.delete("anonId")}catch(t){throw new Fu(this.adapter.platform,"anonId",t.message)}}))}getDebug(){return Us(this,null,(function*(){try{return yield this.adapter.get("DEBUG")}catch(t){throw new Ru(this.adapter.platform,"DEBUG",t.message)}}))}};Mo(),Go();var zu=class{constructor(t){this.options=t,this.platform=no(),this.validateModals()}validateModals(){const t=["InstallModal","OTPCodeModal"].filter((t=>!this.options[t]));if(t.length>0)throw new Error(`Missing required modals: ${t.join(", ")}`)}unload(t){return Us(this,null,(function*(){var e,n;null==(e=this.modal)||e.unmount(),yield null==(n=this.successCallback)?void 0:n.call(this,t)}))}get isMobile(){return"react-native"===this.platform}get isNode(){return"nodejs"===this.platform}get isWeb(){return"web-desktop"===this.platform||"in-app-browser"===this.platform||"web-mobile"===this.platform}getContainer(){return"undefined"==typeof document?void 0:document.createElement("div")}getMountedContainer(){if("undefined"==typeof document)return;const t=this.getContainer();return t&&document.body.appendChild(t),t}createConnectionDeeplink(t){if(!t)throw new Error("createConnectionDeeplink can only be called with a connection request");const e=Io(JSON.stringify(t)),n=encodeURIComponent(e);return`${ya}/mwp?p=${n}&c=1`}createConnectionUniversalLink(t){if(!t)return`${va}`;const e=Io(JSON.stringify(t)),n=encodeURIComponent(e);return`${va}/mwp?p=${n}&c=1`}onCloseModal(t=!0){return Us(this,null,(function*(){return this.unload(t?new Error("User closed modal"):void 0)}))}onStartDesktopOnboarding(){(new bs).startOnboarding()}renderInstallModal(t,e,n,r){return Us(this,null,(function*(){var i,s;null==(i=this.modal)||i.unmount(),yield this.preload(),this.successCallback=n,this.displayUriCallback=r;const o=this.getMountedContainer(),a=yield e(),u=this.createConnectionDeeplink(a);null==(s=this.displayUriCallback)||s.call(this,u);const c=new this.options.InstallModal({expiresIn:(a.sessionRequest.expiresAt-Date.now())/1e3,connectionRequest:a,parentElement:o,showInstallModal:t,link:u,generateQRCode:t=>Us(this,null,(function*(){var e;const n=this.createConnectionDeeplink(t);return null==(e=this.displayUriCallback)||e.call(this,n),n})),onClose:this.onCloseModal.bind(this),startDesktopOnboarding:this.onStartDesktopOnboarding.bind(this),createConnectionRequest:e,onDisplayUri:this.displayUriCallback});this.modal=c,c.mount()}))}renderOTPCodeModal(t,e,n){return Us(this,null,(function*(){var r;null==(r=this.modal)||r.unmount(),yield this.preload(),this.successCallback=e;const i=this.getMountedContainer(),s=yield t(),o=new this.options.OTPCodeModal({parentElement:i,otpCode:s,onClose:this.onCloseModal.bind(this),createOTPCode:t,updateOTPCode:t=>n(t,o)});this.modal=o,o.mount()}))}};var Bu=class extends zu{preload(){return Us(this,null,(function*(){return function(){return Us(this,null,(function*(){if("undefined"!=typeof document)try{const{defineCustomElements:t}=yield Promise.resolve().then((function(){return require("./index-b64e1d7e.cjs")})).then((function(t){return t.index}));yield t()}catch(t){console.error("Failed to load customElements:",t)}}))}()}))}};Mo();var Lu=t=>Us(null,null,(function*(){t.debug&&ds("metamask-sdk:*");const e=yield Promise.resolve().then((()=>(pa(),da)));let n;if(t.storage)n=t.storage;else{const{StoreAdapterWeb:t}=yield Promise.resolve().then((()=>(ga(),ma))),e=new t;n=new Nu(e)}const r=new Bu(e);return Ou.create(Ts(Rs({},t),{storage:n,ui:Ts(Rs({},t.ui),{factory:r})}))}));function Uu(t,e){return n=t,Boolean("string"==typeof n?.prototype?.constructor?.name)?new t({message:e}):t({message:e});var n}class qu extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}function Du(t,e="Assertion failed.",n=qu){if(!t){if(e instanceof Error)throw e;throw Uu(n,e)}}const{memoize:$u}=Y,Wu=/^(?:0x)?[0-9a-f]+$/iu,Zu=/^0x[0-9a-f]{40}$/u,Gu=/^0x[0-9a-fA-F]{40}$/u;M(x(),Wu),M(x(),/^0x[0-9a-f]+$/iu),M(x(),Zu),M(x(),Gu);const Hu=t=>"string"==typeof t;function Ju(t){return Hu(t)&&Gu.test(t)}function Vu(t){Du(function(t){return Hu(t)&&Wu.test(t)}(t),"Value must be a hexadecimal string.")}const Ku=$u((function(t){Du(Ju(t),"Invalid hex address.");const e=function(t){if(t.startsWith("0x")||t.startsWith("0X"))return t.substring(2);return t}(t).toLowerCase(),n=Q(e),{length:r}=e,i=new Array(r);for(let t=0;t<r;t++){const r=1&t,s=n[t>>1],o=0===r?s>>4:15&s;i[t]=o>=8?e[t].toUpperCase():e[t]}return`0x${i.join("")}`}));const Qu=$u((function(t){return!!Ju(t)&&Ku(t)===t}));function Xu(t,e){return E(t,(t=>"string"==typeof t&&e.test(t)))}$u((function(t){return Hu(e=t)&&Zu.test(e)||Qu(t);var e}));const Yu=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,tc=/^[-a-z0-9]{3,8}$/u,ec=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u;var nc;function rc(t){const e=ec.exec(t);if(!e?.groups)throw new Error("Invalid CAIP account ID.");return{address:e.groups.accountAddress,chainId:e.groups.chainId,chain:{namespace:e.groups.namespace,reference:e.groups.reference}}}Xu("CaipChainId",Yu),Xu("CaipNamespace",tc),Xu("CaipReference",/^[-_a-zA-Z0-9]{1,32}$/u),Xu("CaipAccountId",ec),Xu("CaipAccountAddress",/^[-.%a-zA-Z0-9]{1,128}$/u),Xu("CaipAssetNamespace",/^[-a-z0-9]{3,8}$/u),Xu("CaipAssetReference",/^[-.%a-zA-Z0-9]{1,128}$/u),Xu("CaipTokenId",/^[-.%a-zA-Z0-9]{1,78}$/u),Xu("CaipAssetType",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u),Xu("CaipAssetId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u),Xu("CaipAssetTypeOrId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u),function(t){t.Bip122="bip122",t.Solana="solana",t.Stellar="stellar",t.Tron="tron",t.Eip155="eip155",t.Wallet="wallet"}(nc=nc||(nc={}));const ic=t=>{Vu(t);const e=parseInt(t,16);return Du(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};var sc,oc,ac,uc,cc=Object.defineProperty,lc=Object.defineProperties,dc=Object.getOwnPropertyDescriptors,hc=Object.getOwnPropertySymbols,fc=Object.prototype.hasOwnProperty,pc=Object.prototype.propertyIsEnumerable,mc=t=>{throw TypeError(t)},gc=(t,e,n)=>e in t?cc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,_c=(t,e)=>{for(var n in e||(e={}))fc.call(e,n)&&gc(t,n,e[n]);if(hc)for(var n of hc(e))pc.call(e,n)&&gc(t,n,e[n]);return t},vc=(t,e)=>lc(t,dc(e)),yc=(t,e,n)=>e.has(t)||mc("Cannot "+n),wc=(t,e,n)=>(yc(t,e,"read from private field"),n?n.call(t):e.get(t)),bc=(t,e,n)=>e.has(t)?mc("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),kc=(t,e,n,r)=>(yc(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Ec=(t,e,n)=>(yc(t,e,"access private method"),n),Ac=(t,e,n)=>new Promise(((r,i)=>{var s=t=>{try{a(n.next(t))}catch(t){i(t)}},o=t=>{try{a(n.throw(t))}catch(t){i(t)}},a=t=>t.done?r(t.value):Promise.resolve(t.value).then(s,o);a((n=n.apply(t,e)).next())})),Cc=["metamask_getProviderState","metamask_sendDomainMetadata","metamask_logWeb3ShimUsage","wallet_registerOnboarding","net_version","wallet_getPermissions"],xc=["eth_accounts","eth_coinbase",...Cc,"wallet_requestPermissions","eth_requestAccounts","eth_chainId","wallet_revokePermissions","wallet_switchEthereumChain","wallet_addEthereumChain"],Sc={"eip1193-compatible":!0},Mc="metamask-connect:evm",Oc=ls(Mc,"63"),Ic=()=>{ds(Mc)},Rc=class extends cs{constructor(t,e){super(),bc(this,sc),bc(this,oc),bc(this,ac,[]),bc(this,uc),kc(this,sc,t),kc(this,oc,e),this.request=this.request.bind(this),this.sendAsync=this.sendAsync.bind(this),this.send=this.send.bind(this),this.on=this.on.bind(this),this.off=this.off.bind(this),this.emit=this.emit.bind(this),this.once=this.once.bind(this),this.removeListener=this.removeListener.bind(this),this.listenerCount=this.listenerCount.bind(this)}request(t){return Ac(this,null,(function*(){var e,n,r,i;if(Oc(`request: ${t.method} - chainId: ${this.selectedChainId}`,t.params),xc.includes(t.method))return null==(e=wc(this,oc))?void 0:e.call(this,t);if(!wc(this,uc))throw new Error("No chain ID selected");const s=`eip155:${ic(wc(this,uc))}`,o=wc(this,sc).options;if(!(null!=(r=null==(n=null==o?void 0:o.api)?void 0:n.supportedNetworks)?r:{})[s])throw new Error(`Chain ${s} is not configured in supportedNetworks. Requests cannot be made to chains not explicitly configured in supportedNetworks.`);try{return yield wc(this,sc).invokeMethod({scope:s,request:{method:t.method,params:t.params}})}catch(t){if(t instanceof as&&void 0!==t.rpcCode){const e=new Error(null!=(i=t.rpcMessage)?i:t.reason);throw e.code=t.rpcCode,e}throw t}}))}get selectedAccount(){return this.accounts[0]}set accounts(t){kc(this,ac,t)}get accounts(){return wc(this,ac)}get selectedChainId(){return wc(this,uc)}set selectedChainId(t){kc(this,uc,t)}get chainId(){return this.selectedChainId}sendAsync(t,e){return Ac(this,null,(function*(){var n;const r=null!=(n=t.id)?n:1,i=this.request({method:t.method,params:t.params}).then((t=>({id:r,jsonrpc:"2.0",result:t}))).catch((t=>{var e,n;return{id:r,jsonrpc:"2.0",error:{code:null!=(e=t.code)?e:-32603,message:null!=(n=t.message)?n:"Internal error",data:t.data}}}));if(!e)return i;i.then((t=>{t.error?e(new Error(t.error.message),t):e(null,t)})).catch((t=>{e(t,null)}))}))}send(t,e){this.sendAsync(t,e)}};sc=new WeakMap,oc=new WeakMap,ac=new WeakMap,uc=new WeakMap;var Tc=t=>{return"string"==typeof(e=t)&&tc.test(e)?{namespace:t}:function(t){return"string"==typeof t&&Yu.test(t)}(t)?function(t){const e=Yu.exec(t);if(!e?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:e.groups.namespace,reference:e.groups.reference}}(t):{};var e},Pc=t=>{const{namespace:e}=Tc(t);return e===nc.Eip155||t===`${nc.Wallet}:${nc.Eip155}`},jc=t=>/^0x[0-9a-fA-F]+$/u.test(t),Fc=t=>jc(t)?t:`0x${BigInt(t).toString(16)}`,Nc=t=>{if(!t)return[];const e=[];for(const n of Object.keys(t)){const{namespace:t,reference:r}=Tc(n);t===nc.Eip155&&r&&e.push(Fc(r))}return Array.from(new Set(e))};var zc,Bc,Lc,Uc,qc,Dc,$c,Wc,Zc,Gc,Hc,Jc,Vc,Kc,Qc,Xc,Yc,tl,el,nl,rl,il,sl,ol,al,ul,cl,ll="0x1",dl="cache_eth_chainId";function hl(t){var e;return!1!==(null==(e=null==t?void 0:t.analytics)?void 0:e.enabled)}zc=new WeakMap,Bc=new WeakMap,Lc=new WeakMap,Uc=new WeakMap,qc=new WeakMap,Dc=new WeakMap,$c=new WeakMap,Wc=new WeakMap,Zc=new WeakMap,Gc=new WeakSet,Hc=function(){return wc(this,zc).options},Jc=function(t,e,n){return{scope:e,request:{method:t,params:n}}},Vc=function(t,e,n){return Ac(this,null,(function*(){const r=Ec(this,Gc,Hc).call(this);if(hl(r))try{const i=Ec(this,Gc,Jc).call(this,t,e,n),s=yield bo(r,wc(this,zc).storage,i,wc(this,zc).transportType);$i.track("mmconnect_wallet_action_requested",s)}catch(t){Oc("Error tracking mmconnect_wallet_action_requested event",t)}}))},Kc=function(t,e,n){return Ac(this,null,(function*(){const r=Ec(this,Gc,Hc).call(this);if(hl(r))try{const i=Ec(this,Gc,Jc).call(this,t,e,n),s=yield bo(r,wc(this,zc).storage,i,wc(this,zc).transportType);$i.track("mmconnect_wallet_action_succeeded",s)}catch(t){Oc("Error tracking mmconnect_wallet_action_succeeded event",t)}}))},Qc=function(t,e,n,r){return Ac(this,null,(function*(){const i=Ec(this,Gc,Hc).call(this);if(hl(i))try{const s=Ec(this,Gc,Jc).call(this,t,e,n),o=yield bo(i,wc(this,zc).storage,s,wc(this,zc).transportType);vo(r)?$i.track("mmconnect_wallet_action_rejected",o):$i.track("mmconnect_wallet_action_failed",o)}catch(t){Oc("Error tracking wallet action rejected or failed event",r)}}))},Xc=function(t){return Ac(this,null,(function*(){if(wc(this,Zc)&&t.includes(wc(this,Zc)))return wc(this,Zc);try{const e=yield wc(this,zc).storage.adapter.get(dl);if(e){const n=JSON.parse(e);if(t.includes(n))return n}}catch(t){Oc("Error retrieving cached chainId",t)}return t[0]}))},Yc=function(t){return Ac(this,null,(function*(){var e,n;if(Oc(`Intercepting request for method: ${t.method}`),Cc.includes(t.method))return Promise.reject(new Error(`Method: ${t.method} is not supported by Metamask Connect/EVM`));if("wallet_revokePermissions"===t.method)return this.disconnect();if("wallet_requestPermissions"===(n=t).method||"eth_requestAccounts"===n.method){const e="wallet_requestPermissions"===t.method,{method:n,params:r}=t,i=Nc(wc(this,Lc));0===i.length&&i.push(ll);const s=wc(this,Bc).selectedChainId,o=s&&i.includes(s)?s:i[0],a=[o,...i.filter((t=>t!==o))],u=`eip155:${ic(o)}`;yield Ec(this,Gc,Vc).call(this,n,u,r);try{const i=yield this.connect({chainIds:a,forceRequest:e});return yield Ec(this,Gc,Kc).call(this,n,u,r),"eth_requestAccounts"===t.method?i.accounts:i}catch(t){throw yield Ec(this,Gc,Qc).call(this,n,u,r,t),t}}return function(t){return"wallet_switchEthereumChain"===t.method}(t)?this.switchChain({chainId:t.params[0].chainId}):function(t){return"wallet_addEthereumChain"===t.method}(t)?Ec(this,Gc,el).call(this,t.params[0]):function(t){return"eth_accounts"===t.method||"eth_coinbase"===t.method}(t)?"eth_coinbase"===t.method?null!=(e=wc(this,Bc).selectedAccount)?e:null:wc(this,Bc).accounts:function(t){return"eth_chainId"===t.method}(t)?wc(this,Bc).selectedChainId:(Oc("Request not intercepted, forwarding to default handler",t),Promise.resolve())}))},tl=function(){wc(this,Bc).accounts=[],wc(this,Bc).selectedChainId=void 0},el=function(t){return Ac(this,null,(function*(){Oc("addEthereumChain called",{chainConfiguration:t});const e="wallet_addEthereumChain";if(!t)throw new Error("No chain configuration found.");const n=t.chainId||wc(this,Bc).selectedChainId||"0x1",r=`eip155:${ic(n)}`,i=[t];yield Ec(this,Gc,Vc).call(this,e,r,i);try{null===(yield Ec(this,Gc,nl).call(this,{method:"wallet_addEthereumChain",params:i})).result&&(yield Ec(this,Gc,rl).call(this,n),Ec(this,Gc,sl).call(this,n)),yield Ec(this,Gc,Kc).call(this,e,r,i)}catch(t){throw yield Ec(this,Gc,Qc).call(this,e,r,i,t),t}}))},nl=function(t){return Ac(this,null,(function*(){Oc("direct request to metamask-provider called",t);const e=wc(this,zc).transport.sendEip1193Message(t);return"wallet_addEthereumChain"!==t.method&&"wallet_switchEthereumChain"!==t.method||wc(this,zc).openSimpleDeeplinkIfNeeded(),e}))},rl=function(t){return Ac(this,null,(function*(){try{yield wc(this,zc).storage.adapter.set(dl,JSON.stringify(t))}catch(t){Oc("Error caching chainId",t)}}))},il=function(t){return Ac(this,null,(function*(){var e;Oc("event: wallet_sessionChanged",t),kc(this,Lc,null!=(e=null==t?void 0:t.sessionScopes)?e:{});const n=Nc(wc(this,Lc));if(0===n.length)Ec(this,Gc,ul).call(this);else{let t=[];if("connected"===wc(this,zc).status){t=(yield wc(this,zc).transport.sendEip1193Message({method:"eth_accounts",params:[]})).result}else t=(t=>{if(!t)return[];const e=[];for(const{accounts:n}of Object.values(t))if(n)for(const t of n){const{address:n,chainId:r}=rc(t);Pc(r)&&jc(n)&&e.push(n)}return Array.from(new Set(e))})(wc(this,Lc));const e=yield Ec(this,Gc,Xc).call(this,n);Ec(this,Gc,al).call(this,{chainId:e,accounts:t})}}))},sl=function(t){var e,n;t!==wc(this,Bc).selectedChainId&&(Oc("handler: chainChanged",{chainId:t}),wc(this,Bc).selectedChainId=t,wc(this,Bc).emit("chainChanged",t),null==(n=null==(e=wc(this,Uc))?void 0:e.chainChanged)||n.call(e,t))},ol=function(t){var e,n;t.length===wc(this,Bc).accounts.length&&t.every(((t,e)=>t===wc(this,Bc).accounts[e]))||(Oc("handler: accountsChanged",t),wc(this,Bc).accounts=t,wc(this,Bc).emit("accountsChanged",t),null==(n=null==(e=wc(this,Uc))?void 0:e.accountsChanged)||n.call(e,t))},al=function({chainId:t,accounts:e}){var n,r,i,s,o,a,u;Oc("handler: connect",{chainId:t,accounts:e});const c={chainId:t,accounts:e};if("connected"===wc(this,Wc))return Ec(this,Gc,sl).call(this,t),void Ec(this,Gc,ol).call(this,e);wc(this,Bc).selectedChainId=t,wc(this,Bc).accounts=e,kc(this,Wc,"connected"),wc(this,Bc).emit("connect",c),null==(r=null==(n=wc(this,Uc))?void 0:n.connect)||r.call(n,c),wc(this,Bc).emit("chainChanged",t),null==(s=null==(i=wc(this,Uc))?void 0:i.chainChanged)||s.call(i,t),wc(this,Bc).emit("accountsChanged",e),null==(a=null==(o=wc(this,Uc))?void 0:o.accountsChanged)||a.call(o,e),null==(u=wc(this,$c))||u.call(this);const l=t=>{Oc("core-event: accountsChanged",t),Ec(this,Gc,ol).call(this,t)},d=t=>{Oc("core-event: chainChanged",t.chainId),Ec(this,Gc,rl).call(this,t.chainId).catch((t=>{Oc("Error caching chainId in notification handler",t)})),Ec(this,Gc,sl).call(this,t.chainId)};wc(this,zc).on("metamask_accountsChanged",l),wc(this,zc).on("metamask_chainChanged",d),kc(this,$c,(()=>{wc(this,zc).off("metamask_accountsChanged",l),wc(this,zc).off("metamask_chainChanged",d)}))},ul=function(){var t,e;"disconnected"!==wc(this,Wc)&&(kc(this,Wc,"disconnected"),Oc("handler: disconnect"),wc(this,Bc).emit("disconnect"),null==(e=null==(t=wc(this,Uc))?void 0:t.disconnect)||e.call(t),Ec(this,Gc,ol).call(this,[]))},cl=function(t){var e,n;"connecting"===wc(this,Wc)&&(Oc("handler: display_uri",t),wc(this,Bc).emit("display_uri",t),null==(n=null==(e=wc(this,Uc))?void 0:e.displayUri)||n.call(e,t))};var fl=class t{constructor({core:t,eventHandlers:e}){bc(this,Gc),bc(this,zc),bc(this,Bc),bc(this,Lc,{}),bc(this,Uc),bc(this,qc),bc(this,Dc),bc(this,$c),bc(this,Wc,"disconnected"),bc(this,Zc),kc(this,zc,t),kc(this,Bc,new Rc(t,Ec(this,Gc,Yc).bind(this))),kc(this,Uc,e),kc(this,qc,Ec(this,Gc,il).bind(this)),wc(this,zc).on("wallet_sessionChanged",wc(this,qc)),kc(this,Dc,Ec(this,Gc,cl).bind(this)),wc(this,zc).on("display_uri",wc(this,Dc)),Oc("Connect/EVM constructor completed")}static create(e){return Ac(this,null,(function*(){var n;const r=new t(e);let i;try{i=yield wc(r,zc).provider.getSession()}catch(t){i={sessionScopes:{}}}return yield Ec(n=r,Gc,il).call(n,i),r}))}connect(){return Ac(this,arguments,(function*({account:t,forceRequest:e,chainIds:n=[ll]}={}){var r;if(Oc("request: connect",{account:t}),!n||0===n.length)throw new Error("chainIds must be an array of at least one chain ID");kc(this,Zc,n[0]);const i=Array.from(new Set(null!=(r=n.concat(ll))?r:[ll])).map((t=>`eip155:${ic(t)}`)),s=t?i.map((e=>`${e}:${t}`)):[];kc(this,Wc,"connecting");try{const t=new Promise((t=>{wc(this,Bc).once("connect",(({chainId:e,accounts:n})=>{Oc("fulfilled-request: connect",{chainId:e,accounts:n}),t({accounts:n,chainId:e})}))}));return yield wc(this,zc).connect(i,s,Sc,e),yield t}catch(t){throw kc(this,Wc,"disconnected"),Oc("Error connecting to wallet",t),t}finally{kc(this,Zc,void 0)}}))}connectAndSign(t){return Ac(this,arguments,(function*({message:t,chainIds:e}){var n,r;const{accounts:i,chainId:s}=yield this.connect({chainIds:null!=e?e:[ll]}),o=yield wc(this,Bc).request({method:"personal_sign",params:[i[0],t]});return null==(r=null==(n=wc(this,Uc))?void 0:n.connectAndSign)||r.call(n,{accounts:i,chainId:s,signature:o}),{accounts:i,chainId:s,signature:o}}))}connectWith(t){return Ac(this,arguments,(function*({method:t,params:e,chainIds:n,account:r,forceRequest:i}){var s,o;const{accounts:a,chainId:u}=yield this.connect({chainIds:null!=n?n:[ll],account:r,forceRequest:i}),c="function"==typeof e?e(a[0]):e,l=yield wc(this,Bc).request({method:t,params:c});return null==(o=null==(s=wc(this,Uc))?void 0:s.connectWith)||o.call(s,{accounts:a,chainId:u,result:l}),{accounts:a,chainId:u,result:l}}))}disconnect(){return Ac(this,null,(function*(){var t;Oc("request: disconnect");const e=wc(this,Lc),n=Object.keys(e).filter((t=>{const{namespace:e}=Tc(t);return"eip155"===e}));yield wc(this,zc).disconnect(n),Ec(this,Gc,ul).call(this),Ec(this,Gc,tl).call(this),null==(t=wc(this,$c))||t.call(this),kc(this,$c,void 0),Oc("fulfilled-request: disconnect")}))}switchChain(t){return Ac(this,arguments,(function*({chainId:t,chainConfiguration:e}){const n="wallet_switchEthereumChain",r=`eip155:${ic(t)}`,i=[{chainId:t}];if(this.selectedChainId===t)return Promise.resolve();if(Nc(wc(this,Lc)).includes(t)&&wc(this,zc).transportType===Js.MWP)return yield Ec(this,Gc,rl).call(this,t),Ec(this,Gc,sl).call(this,t),Promise.resolve();yield Ec(this,Gc,Vc).call(this,n,r,i);try{const e=yield Ec(this,Gc,nl).call(this,{method:"wallet_switchEthereumChain",params:i}),s=e;if(null==s?void 0:s.error)throw new Error(s.error.message);return yield Ec(this,Gc,Kc).call(this,n,r,i),null===e.result&&(yield Ec(this,Gc,rl).call(this,t),Ec(this,Gc,sl).call(this,t)),Promise.resolve()}catch(t){yield Ec(this,Gc,Qc).call(this,n,r,i,t);if(t.message.includes("Unrecognized chain ID")&&e)return Ec(this,Gc,el).call(this,e);throw t}}))}getProvider(){return wc(this,Bc)}getChainId(){return this.selectedChainId}getAccount(){return wc(this,Bc).selectedAccount}get accounts(){return wc(this,Bc).accounts}get selectedAccount(){return wc(this,Bc).selectedAccount}get selectedChainId(){return wc(this,Bc).selectedChainId}get status(){return wc(this,Wc)}};function pl(t){return Ac(this,null,(function*(){var e,n,r;if(t.debug&&Ic(),Oc("Creating Metamask Connect/EVM with options:",t),!(null==(e=t.api)?void 0:e.supportedNetworks)||0===Object.keys(t.api.supportedNetworks).length)throw new Error("supportedNetworks is required and must contain at least one chain configuration");!function(t,e){const n=[];for(const[e,r]of Object.entries(t))try{new URL(r)}catch(t){n.push(`${e}: ${r}`)}if(n.length>0)throw new Error(`${e} contains invalid URLs:\n${n.join("\n")}`)}(t.api.supportedNetworks,"supportedNetworks");const i=Object.entries(t.api.supportedNetworks).reduce(((t,[e,n])=>(t[`eip155:${parseInt(e,16)}`]=n,t)),{});try{const e=yield Lu(vc(_c({},t),{api:{supportedNetworks:i},analytics:vc(_c({},null!=(n=t.analytics)?n:{}),{integrationType:(null==(r=t.analytics)?void 0:r.integrationType)||"direct"}),versions:{"connect-evm":"1.4.0"}}));return fl.create({core:e,eventHandlers:t.eventHandlers,supportedNetworks:t.api.supportedNetworks})}catch(t){throw console.error("Error creating Metamask Connect/EVM",t),t}}))}exports.default=async function(e,n){const r={};e.rpc&&Object.entries(e.rpc).forEach((([t,e])=>{const n=`0x${Number(t).toString(16)}`;r[n]=e}));const i=await pl({dapp:{name:e.appName??"DODO",iconUrl:e.appLogoUrl},api:{supportedNetworks:r},mobile:{useDeeplink:!0}}),s=i.getProvider(),o=()=>n.disconnect(void 0),a=t=>n.message(t.type,t.data);s.removeListener("connect",n.connect),s.removeListener("disconnect",o),s.removeListener("accountsChanged",n.accountsChanged),s.removeListener("chainChanged",n.chainChanged),s.removeListener("message",a);try{s.on("connect",n.connect),s.on("disconnect",o),s.on("accountsChanged",n.accountsChanged),s.on("chainChanged",n.chainChanged),s.on("message",a)}catch(t){}const{accounts:u}=await i.connect();if(!u||0===u.length)throw new Error("MetaMask Connect: no accounts returned");return await t.convertWeb3Provider(s)};
|