@privy-io/react-auth 1.24.0-beta.8 → 1.24.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/esm/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Od=Object.create;var Qo=Object.defineProperty;var Dd=Object.getOwnPropertyDescriptor;var Ud=Object.getOwnPropertyNames;var Bd=Object.getPrototypeOf,Fd=Object.prototype.hasOwnProperty;var $i=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ze=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qi=(e,t)=>{for(var o in t)Qo(e,o,{get:t[o],enumerable:!0})},ji=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ud(t))!Fd.call(e,n)&&n!==o&&Qo(e,n,{get:()=>t[n],enumerable:!(r=Dd(t,n))||r.enumerable});return e};var Gd=(e,t,o)=>(o=e!=null?Od(Bd(e)):{},ji(t||!e||!e.__esModule?Qo(o,"default",{value:e,enumerable:!0}):o,e)),zi=e=>ji(Qo({},"__esModule",{value:!0}),e);var hr=Ze((Ih,mr)=>{var Na,Oa,Da,Ua,Ba,Fa,Ga,Ha,Va,ur,kn,$a,qa,ja,jt,za,Za,Ka,Ja,Ya,Qa,Xa,es,ts,fr;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){e(o(t,o(r)))}):typeof mr=="object"&&typeof mr.exports=="object"?e(o(t,o(mr.exports))):e(o(t));function o(r,n){return r!==t&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(i,a){return r[i]=n?n(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])};Na=function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},Oa=Object.assign||function(r){for(var n,i=1,a=arguments.length;i<a;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},Da=function(r,n){var i={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&n.indexOf(a)<0&&(i[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(r);s<a.length;s++)n.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(r,a[s])&&(i[a[s]]=r[a[s]]);return i},Ua=function(r,n,i,a){var s=arguments.length,l=s<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(r,n,i,a);else for(var h=r.length-1;h>=0;h--)(c=r[h])&&(l=(s<3?c(l):s>3?c(n,i,l):c(n,i))||l);return s>3&&l&&Object.defineProperty(n,i,l),l},Ba=function(r,n){return function(i,a){n(i,a,r)}},Fa=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},Ga=function(r,n,i,a){function s(l){return l instanceof i?l:new i(function(c){c(l)})}return new(i||(i=Promise))(function(l,c){function h(g){try{p(a.next(g))}catch(b){c(b)}}function m(g){try{p(a.throw(g))}catch(b){c(b)}}function p(g){g.done?l(g.value):s(g.value).then(h,m)}p((a=a.apply(r,n||[])).next())})},Ha=function(r,n){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,s,l,c;return c={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function h(p){return function(g){return m([p,g])}}function m(p){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(l=p[0]&2?s.return:p[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,p[1])).done)return l;switch(s=0,l&&(p=[p[0]&2,l.value]),p[0]){case 0:case 1:l=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,s=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=l.length>0&&l[l.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!l||p[1]>l[0]&&p[1]<l[3])){i.label=p[1];break}if(p[0]===6&&i.label<l[1]){i.label=l[1],l=p;break}if(l&&i.label<l[2]){i.label=l[2],i.ops.push(p);break}l[2]&&i.ops.pop(),i.trys.pop();continue}p=n.call(r,i)}catch(g){p=[6,g],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Va=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&fr(n,r,i)},fr=Object.create?function(r,n,i,a){a===void 0&&(a=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||("get"in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(r,a,s)}:function(r,n,i,a){a===void 0&&(a=i),r[a]=n[i]},ur=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],a=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&a>=r.length&&(r=void 0),{value:r&&r[a++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},kn=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var a=i.call(r),s,l=[],c;try{for(;(n===void 0||n-- >0)&&!(s=a.next()).done;)l.push(s.value)}catch(h){c={error:h}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return l},$a=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(kn(arguments[n]));return r},qa=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var a=Array(r),s=0,n=0;n<i;n++)for(var l=arguments[n],c=0,h=l.length;c<h;c++,s++)a[s]=l[c];return a},ja=function(r,n,i){if(i||arguments.length===2)for(var a=0,s=n.length,l;a<s;a++)(l||!(a in n))&&(l||(l=Array.prototype.slice.call(n,0,a)),l[a]=n[a]);return r.concat(l||Array.prototype.slice.call(n))},jt=function(r){return this instanceof jt?(this.v=r,this):new jt(r)},za=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=i.apply(r,n||[]),s,l=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(d){a[d]&&(s[d]=function(y){return new Promise(function(v,P){l.push([d,y,v,P])>1||h(d,y)})})}function h(d,y){try{m(a[d](y))}catch(v){b(l[0][3],v)}}function m(d){d.value instanceof jt?Promise.resolve(d.value.v).then(p,g):b(l[0][2],d)}function p(d){h("next",d)}function g(d){h("throw",d)}function b(d,y){d(y),l.shift(),l.length&&h(l[0][0],l[0][1])}},Za=function(r){var n,i;return n={},a("next"),a("throw",function(s){throw s}),a("return"),n[Symbol.iterator]=function(){return this},n;function a(s,l){n[s]=r[s]?function(c){return(i=!i)?{value:jt(r[s](c)),done:s==="return"}:l?l(c):c}:l}},Ka=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof ur=="function"?ur(r):r[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(l){i[l]=r[l]&&function(c){return new Promise(function(h,m){c=r[l](c),s(h,m,c.done,c.value)})}}function s(l,c,h,m){Promise.resolve(m).then(function(p){l({value:p,done:h})},c)}},Ja=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};var o=Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n};Ya=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)i!=="default"&&Object.prototype.hasOwnProperty.call(r,i)&&fr(n,r,i);return o(n,r),n},Qa=function(r){return r&&r.__esModule?r:{default:r}},Xa=function(r,n,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!a:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(r):a?a.value:n.get(r)},es=function(r,n,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?r!==n||!s:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(r,i):s?s.value=i:n.set(r,i),i},ts=function(r,n){if(n===null||typeof n!="object"&&typeof n!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?n===r:r.has(n)},e("__extends",Na),e("__assign",Oa),e("__rest",Da),e("__decorate",Ua),e("__param",Ba),e("__metadata",Fa),e("__awaiter",Ga),e("__generator",Ha),e("__exportStar",Va),e("__createBinding",fr),e("__values",ur),e("__read",kn),e("__spread",$a),e("__spreadArrays",qa),e("__spreadArray",ja),e("__await",jt),e("__asyncGenerator",za),e("__asyncDelegator",Za),e("__asyncValues",Ka),e("__makeTemplateObject",Ja),e("__importStar",Ya),e("__importDefault",Qa),e("__classPrivateFieldGet",Xa),e("__classPrivateFieldSet",es),e("__classPrivateFieldIn",ts)})});var Rn=Ze(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.getLocalStorage=V.getLocalStorageOrThrow=V.getCrypto=V.getCryptoOrThrow=V.getLocation=V.getLocationOrThrow=V.getNavigator=V.getNavigatorOrThrow=V.getDocument=V.getDocumentOrThrow=V.getFromWindowOrThrow=V.getFromWindow=void 0;function Et(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}V.getFromWindow=Et;function zt(e){let t=Et(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}V.getFromWindowOrThrow=zt;function b1(){return zt("document")}V.getDocumentOrThrow=b1;function v1(){return Et("document")}V.getDocument=v1;function w1(){return zt("navigator")}V.getNavigatorOrThrow=w1;function C1(){return Et("navigator")}V.getNavigator=C1;function x1(){return zt("location")}V.getLocationOrThrow=x1;function E1(){return Et("location")}V.getLocation=E1;function _1(){return zt("crypto")}V.getCryptoOrThrow=_1;function P1(){return Et("crypto")}V.getCrypto=P1;function T1(){return zt("localStorage")}V.getLocalStorageOrThrow=T1;function A1(){return Et("localStorage")}V.getLocalStorage=A1});var rs=Ze(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.getWindowMetadata=void 0;var os=Rn();function S1(){let e,t;try{e=os.getDocumentOrThrow(),t=os.getLocationOrThrow()}catch{return null}function o(){let m=e.getElementsByTagName("link"),p=[];for(let g=0;g<m.length;g++){let b=m[g],d=b.getAttribute("rel");if(d&&d.toLowerCase().indexOf("icon")>-1){let y=b.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let v=t.protocol+"//"+t.host;if(y.indexOf("/")===0)v+=y;else{let P=t.pathname.split("/");P.pop(),v+=P.join("/")+"/"+y}p.push(v)}else if(y.indexOf("//")===0){let v=t.protocol+y;p.push(v)}else p.push(y)}}return p}function r(...m){let p=e.getElementsByTagName("meta");for(let g=0;g<p.length;g++){let b=p[g],d=["itemprop","property","name"].map(y=>b.getAttribute(y)).filter(y=>y?m.includes(y):!1);if(d.length&&d){let y=b.getAttribute("content");if(y)return y}}return""}function n(){let m=r("name","og:site_name","og:title","twitter:title");return m||(m=e.title),m}function i(){return r("description","og:description","twitter:description","keywords")}let a=n(),s=i(),l=t.origin,c=o();return{description:s,url:l,icons:c,name:a}}gr.getWindowMetadata=S1});var ms={};qi(ms,{BotInfo:()=>cs,BrowserInfo:()=>as,NodeInfo:()=>ss,ReactNativeInfo:()=>ds,SearchBotDeviceInfo:()=>ls,browserName:()=>M1,detect:()=>I1,detectOS:()=>us,getNodeVersion:()=>fs,parseUserAgent:()=>Wn});function I1(e){return e?Wn(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ds:typeof navigator<"u"?Wn(navigator.userAgent):fs()}function ps(e){return e!==""&&W1.reduce(function(t,o){var r=o[0],n=o[1];if(t)return t;var i=n.exec(e);return!!i&&[r,i]},!1)}function M1(e){var t=ps(e);return t?t[0]:null}function Wn(e){var t=ps(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new cs;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<ns&&(n=L1(n,N1(ns-n.length))):n=[];var i=n.join("."),a=us(e),s=R1.exec(e);return s&&s[1]?new ls(o,i,a,s[1]):new as(o,i,a)}function us(e){for(var t=0,o=is.length;t<o;t++){var r=is[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function fs(){var e=typeof process<"u"&&process.version;return e?new ss(process.version.slice(1)):null}function N1(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var L1,as,ss,ls,cs,ds,k1,R1,ns,W1,is,hs=$i(()=>{L1=function(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;for(var r=Array(e),n=0,t=0;t<o;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,n++)r[n]=i[a];return r},as=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),ss=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),ls=function(){function e(t,o,r,n){this.name=t,this.version=o,this.os=r,this.bot=n,this.type="bot-device"}return e}(),cs=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),ds=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),k1=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,R1=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,ns=3,W1=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",k1]],is=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]]});var Mn=Ze(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.getClientMeta=A.getLocalStorage=A.getLocalStorageOrThrow=A.getCrypto=A.getCryptoOrThrow=A.getLocation=A.getLocationOrThrow=A.getNavigator=A.getNavigatorOrThrow=A.getDocument=A.getDocumentOrThrow=A.getFromWindowOrThrow=A.getFromWindow=A.isBrowser=A.isNode=A.isMobile=A.isIOS=A.isAndroid=A.detectOS=A.detectEnv=void 0;var gs=hr(),O1=gs.__importStar(rs()),Le=gs.__importStar(Rn()),D1=(hs(),zi(ms));function In(e){return(0,D1.detect)(e)}A.detectEnv=In;function yr(){let e=In();return e&&e.os?e.os:void 0}A.detectOS=yr;function ys(){let e=yr();return e?e.toLowerCase().includes("android"):!1}A.isAndroid=ys;function bs(){let e=yr();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}A.isIOS=bs;function U1(){return yr()?ys()||bs():!1}A.isMobile=U1;function vs(){let e=In();return e&&e.name?e.name.toLowerCase()==="node":!1}A.isNode=vs;function B1(){return!vs()&&!!(0,A.getNavigator)()}A.isBrowser=B1;A.getFromWindow=Le.getFromWindow;A.getFromWindowOrThrow=Le.getFromWindowOrThrow;A.getDocumentOrThrow=Le.getDocumentOrThrow;A.getDocument=Le.getDocument;A.getNavigatorOrThrow=Le.getNavigatorOrThrow;A.getNavigator=Le.getNavigator;A.getLocationOrThrow=Le.getLocationOrThrow;A.getLocation=Le.getLocation;A.getCryptoOrThrow=Le.getCryptoOrThrow;A.getCrypto=Le.getCrypto;A.getLocalStorageOrThrow=Le.getLocalStorageOrThrow;A.getLocalStorage=Le.getLocalStorage;function F1(){return O1.getWindowMetadata()}A.getClientMeta=F1});var ws={};qi(ws,{safeJsonParse:()=>G1,safeJsonStringify:()=>H1});function G1(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return JSON.parse(e)}catch{return e}}function H1(e){return typeof e=="string"?e:JSON.stringify(e)}var Cs=$i(()=>{});var Nn=Ze(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.safeJsonStringify=Zt.safeJsonParse=void 0;var V1=hr(),xs=V1.__importStar((Cs(),zi(ws)));Zt.safeJsonParse=xs.safeJsonParse;Zt.safeJsonStringify=xs.safeJsonStringify});var Dn=Ze(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.removeLocal=ct.getLocal=ct.setLocal=void 0;var Es=Nn(),On=Mn();function $1(e,t){let o=(0,Es.safeJsonStringify)(t),r=(0,On.getLocalStorage)();r&&r.setItem(e,o)}ct.setLocal=$1;function q1(e){let t=null,o=null,r=(0,On.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,Es.safeJsonParse)(o),t}ct.getLocal=q1;function j1(e){let t=(0,On.getLocalStorage)();t&&t.removeItem(e)}ct.removeLocal=j1});var Ps=Ze(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.getMobileLinkRegistry=ye.getMobileRegistryEntry=ye.saveMobileLinkInfo=ye.formatIOSMobile=ye.mobileLinkChoiceKey=void 0;var z1=Dn();ye.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function Z1(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}ye.formatIOSMobile=Z1;function K1(e){let t=e.href.split("?")[0];(0,z1.setLocal)(ye.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}ye.saveMobileLinkInfo=K1;function _s(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}ye.getMobileRegistryEntry=_s;function J1(e,t){let o=e;return t&&(o=t.map(r=>_s(e,r)).filter(Boolean)),o}ye.getMobileLinkRegistry=J1});var Ss=Ze(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.formatMobileRegistry=De.formatMobileRegistryEntry=De.getDappRegistryUrl=De.getWalletRegistryUrl=void 0;var Ts="https://registry.walletconnect.com";function Y1(){return Ts+"/api/v2/wallets"}De.getWalletRegistryUrl=Y1;function Q1(){return Ts+"/api/v2/dapps"}De.getDappRegistryUrl=Q1;function As(e,t="mobile"){var o;return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:(o=e.image_url.sm)!==null&&o!==void 0?o:"",universalLink:e[t].universal||"",deepLink:e[t].native||""}}De.formatMobileRegistryEntry=As;function X1(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>As(o,t))}De.formatMobileRegistry=X1});var Ls=Ze(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});var Eo=hr();Eo.__exportStar(Mn(),_t);Eo.__exportStar(Nn(),_t);Eo.__exportStar(Dn(),_t);Eo.__exportStar(Ps(),_t);Eo.__exportStar(Ss(),_t)});import{Web3Provider as Vm}from"@ethersproject/providers";import{useEffect as fn,useState as ae}from"react";var C=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import Hd from"axios";var Re=class extends Error{constructor(o,r,n){super(o);r instanceof Error&&(this.cause=r),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},Bt=class extends Re{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},x=class extends Re{constructor(o,r,n){super(o,r,n);this.type="client_error"}};var Z=class extends Re{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},Y=e=>{if(e instanceof Re)return e;if(!Hd.isAxiosError(e))return Ee(e);if(!e.response)return new Bt("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.response.data;return new Bt(t||"ApiError",e.response.status,o||r,e,n)},Ee=e=>e instanceof Re?e:e instanceof Error?new x(e.message,e):new x(`Internal error: ${e}`);var Zi=()=>"/api/v1/sessions",Ki=()=>"/api/v1/sessions/logout",Ji=()=>"/api/v1/sessions/fork",Yi=()=>"/api/v1/sessions/fork/recover",Qi=()=>"/api/v1/siwe/init",Xi=()=>"/api/v1/siwe/authenticate",ea=()=>"/api/v1/siwe/link",ta=()=>"/api/v1/passwordless/init",oa=()=>"/api/v1/passwordless/authenticate",ra=()=>"/api/v1/passwordless/link",na=()=>"/api/v1/passwordless_sms/init",ia=()=>"/api/v1/passwordless_sms/authenticate",aa=()=>"/api/v1/passwordless_sms/link",sa=()=>"/api/v1/oauth/init",la=()=>"/api/v1/oauth/authenticate",ca=()=>"/api/v1/oauth/link",da=()=>"/api/v1/siwe/unlink",pa=()=>"/api/v1/passwordless/unlink",ua=()=>"/api/v1/passwordless_sms/unlink",fa=()=>"/api/v1/oauth/unlink",ma=()=>"/api/v1/analytics_events";var yt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{let t=oa(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw Y(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{let t=ra();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw Y(t)}}async sendCodeEmail(t){if(!this.api)throw new x("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new x("Email must be set when initialzing authentication.");try{let o=ta();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw Y(o)}}};var it=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=r}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new x("User denied confirmation during OAuth flow");try{let t=la(),o=await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw Y(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new x("User denied confirmation during OAuth flow");try{let t=ca();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw Y(t)}}async getAuthorizationUrl(){var t;if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.provider)throw new x("Provider must be set when initialzing OAuth authentication.");try{let o=sa();return(await this.api.post(o,{provider:this.meta.provider,redirect_to:window.location.href},{baseURL:(t=this.api)==null?void 0:t.fallbackApiUrl})).data}catch(o){throw Y(o)}}};var at=class{constructor(t,o,r){this._meta={walletType:o,walletId:r},this.connectors=t,this.walletConnector=this.connectors.createWalletConnector(o,null,r)}get meta(){return{...this._meta,walletName:this.walletConnector.walletBranding.name,walletIcon:this.walletConnector.walletBranding.icon}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Xi(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),{user:r.data.user,token:r.data.token,refresh_token:r.data.refresh_token,is_new_user:r.data.is_new_user}}catch(t){throw Y(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(ea(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),r.data}catch(t){throw Y(t)}}async promptConnect(){if(!this.api)throw new x("Auth flow has no API instance");let t=await this.walletConnector.connect({showPrompt:!0});return await this.buildSiweMessage(t),t}async sign(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.preparedMessage){let o=await this.walletConnector.connect({showPrompt:!1});await this.buildSiweMessage(o)}if(!this.preparedMessage)throw new x("Could not prepare SIWE message");let t=await this.walletConnector.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async buildSiweMessage(t){if(!this.api)throw new x("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(Qi(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var bt=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{let t=ia(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw Y(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{let t=aa();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw Y(t)}}async sendSmsCode(t){if(!this.api)throw new x("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new x("phone nNumber must be set when initialzing authentication.");try{let o=na();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw Y(o)}}};import{getAddress as tp}from"@ethersproject/address";var ha="1.24.0-beta.8";var Ne="4df5e2316331463a9130964bd6078dfa",Xo="https://auth.privy.io",ga=1e4,_e=1400,wn=ha;var Ft="privy:token",er="privy:refresh_token",wo="privy:session_transfer_token",tr="privy:connectors",Cn="walletconnect",ya=3e4,Pe=1;var xn=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,o){o!==void 0?this._cache[t]=o:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},En=class{get(t){let o=localStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?localStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function $d(){return typeof window<"u"&&window.localStorage?new En:new xn}var j=$d();import a1 from"@coinbase/wallet-sdk";import{getAddress as s1}from"@ethersproject/address";import{jsx as ba,jsxs as qd}from"react/jsx-runtime";var Te=({style:e,...t})=>qd("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[ba("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),ba("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});import{getAddress as n1}from"@ethersproject/address";import{Web3Provider as i1}from"@ethersproject/providers";import{isHexString as Xd}from"@ethersproject/bytes";import{InfuraProvider as e1}from"@ethersproject/providers";import{toUtf8String as t1}from"@ethersproject/strings";import o1 from"eventemitter3";var jd=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign"],va=e=>jd.includes(e);import{isPossiblePhoneNumber as zd}from"libphonenumber-js/min";var wa=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),Ca=e=>zd(String(e),"US"),xa=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},We=(e,t=3,o=4)=>{if(!e)return"";let r=2,n=3;if(t+o+r+n>=e.length)return e;let i=e.slice(0,r+t),a=e.slice(e.length-o,e.length);return`${i}...${a}`},_n=e=>new Promise(t=>setTimeout(t,e)),Ea=(e,t={})=>{let o=t.delayMs||40,r=t.maxAttempts||1e3;return new Promise(async(n,i)=>{let a=!1,s=0;for(;!a&&s<r;)e().then(()=>{a=!0,n()},(...l)=>{a=!0,i(...l)}),s+=1,await _n(o);a||i(new Error("Exceeded max attempts before resolving function"))})},or=(e,t,o={})=>{let r=new URL(t,e);for(let[n,i]of Object.entries(o))r.searchParams.set(n,i);return r.href},Zd=(e,t)=>e.toLowerCase()===t.toLowerCase(),Pn=(e,t)=>{for(let o of e)if(Zd(o,t))return!0;return!1},rr=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Co=e=>typeof e=="string"?e:"0x"+e.toString(16);import{ErrorCode as Kd}from"@ethersproject/logger";var Gt=class extends Z{constructor(){super("Wallet timeout");this.type="wallet_error"}},wt=class extends Z{constructor(){super("User rejected connection");this.type="wallet_error"}},Ae=e=>{if(e instanceof Z)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new Ht(e);return e.code===Kd.ACTION_REJECTED&&(t.details=vt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new Ht(e):new Z("Unknown connector error",e)},Tn=class extends Re{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},Ht=class extends Tn{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(vt).find(l=>l.eipCode===r.code);this.details=n||vt.UNKNOWN_ERROR,r.code===-32002&&((i=r.message)!=null&&i.includes("already pending for origin")?(a=r.message)!=null&&a.includes("wallet_requestPermissions")?this.details=vt.E32002_CONNECTION_ALREADY_PENDING:this.details=vt.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=vt.E32002_WALLET_LOCKED))}},Jd={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},Yd={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},Qd={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},vt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...Qd,...Yd},Ct={...Jd,...vt};var r1=12e4,An=(e=new Gt,t=r1)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),Ie=class{constructor(t){this.removeListener=(t,o)=>{if(this.walletProvider)return this.walletProvider.removeListener(t,o)};this.setWalletProvider=t=>{this.walletProvider=t,this._subscriptions.forEach(o=>{var r;(r=this.walletProvider)==null||r.on(o.eventName,o.listener)})};this.walletProvider=t,this._subscriptions=[]}on(t,o){if(this.walletProvider)return this.walletProvider.on(t,o);this._subscriptions.push({eventName:t,listener:o})}async request(t){if(!this.walletProvider)throw new Z(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),An()]).catch(o=>{throw Ae(o)})}},st=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},nr=class extends o1{constructor(o,r,n=1){super();this.walletProxy=o,this.address=r,this.chainId=n,this.infuraProvider=new e1(n,Ne)}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new st(`Invalid params for ${o.method}`,4200);let r=o.params[0],n=r.chainId;if(n&&Number(n)!==this.chainId)throw new st(`Chain disconnected. Currently connected to ${this.chainId}, attempting to send to ${Number(n)}`,4901);if(!await xo()||!this.address)throw new st("Disconnected",4900);return(await Pa(r)).transactionHash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new st(`Invalid params for ${o.method}`,4200);let r=o.params[0];this.chainId=Number(r),this.emit("chainChanged",r)}async handlePersonalSign(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r=o.params[0],n=Xd(r)?t1(r):r;return await _a(n)}async handleEstimateGas(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r={...o.params[0],chainId:Co(this.chainId)};return delete r.from,this.infuraProvider.send("eth_estimateGas",[r])}async request(o){switch(console.debug("Embedded1193Provider.request() called with args",o),o.method){case"eth_accounts":return this.address?[this.address]:[];case"eth_chainId":return Co(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(o);case"eth_sendTransaction":return this.handleSendTransaction(o);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(o);case"personal_sign":return this.handlePersonalSign(o);default:break}if(va(o.method)){let r=await xo();if(!r||!this.address)throw new st("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:r,request:{method:o.method,params:o.params}})).response.data}catch(n){throw console.error(n),new st("Disconnected",4900)}}else return this.infuraProvider.send(o.method,o.params)}async connect(){let o=await xo();if(!o||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:o})).address}catch(r){return console.error(r),null}}},xt=class extends Ie{constructor(o){super(o)}},ir=class extends Ie{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var he=class{constructor(t,o,r){this.createSiweMessage=(t,o,r,n,i,a,s)=>`${r} wants you to sign in with your Ethereum account:
|
|
1
|
+
var Od=Object.create;var Qo=Object.defineProperty;var Dd=Object.getOwnPropertyDescriptor;var Ud=Object.getOwnPropertyNames;var Bd=Object.getPrototypeOf,Fd=Object.prototype.hasOwnProperty;var $i=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ze=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qi=(e,t)=>{for(var o in t)Qo(e,o,{get:t[o],enumerable:!0})},ji=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ud(t))!Fd.call(e,n)&&n!==o&&Qo(e,n,{get:()=>t[n],enumerable:!(r=Dd(t,n))||r.enumerable});return e};var Gd=(e,t,o)=>(o=e!=null?Od(Bd(e)):{},ji(t||!e||!e.__esModule?Qo(o,"default",{value:e,enumerable:!0}):o,e)),zi=e=>ji(Qo({},"__esModule",{value:!0}),e);var hr=Ze((Ih,mr)=>{var Na,Oa,Da,Ua,Ba,Fa,Ga,Ha,Va,ur,kn,$a,qa,ja,jt,za,Za,Ka,Ja,Ya,Qa,Xa,es,ts,fr;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){e(o(t,o(r)))}):typeof mr=="object"&&typeof mr.exports=="object"?e(o(t,o(mr.exports))):e(o(t));function o(r,n){return r!==t&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(i,a){return r[i]=n?n(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])};Na=function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},Oa=Object.assign||function(r){for(var n,i=1,a=arguments.length;i<a;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},Da=function(r,n){var i={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&n.indexOf(a)<0&&(i[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(r);s<a.length;s++)n.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(r,a[s])&&(i[a[s]]=r[a[s]]);return i},Ua=function(r,n,i,a){var s=arguments.length,l=s<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(r,n,i,a);else for(var h=r.length-1;h>=0;h--)(c=r[h])&&(l=(s<3?c(l):s>3?c(n,i,l):c(n,i))||l);return s>3&&l&&Object.defineProperty(n,i,l),l},Ba=function(r,n){return function(i,a){n(i,a,r)}},Fa=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},Ga=function(r,n,i,a){function s(l){return l instanceof i?l:new i(function(c){c(l)})}return new(i||(i=Promise))(function(l,c){function h(g){try{p(a.next(g))}catch(b){c(b)}}function m(g){try{p(a.throw(g))}catch(b){c(b)}}function p(g){g.done?l(g.value):s(g.value).then(h,m)}p((a=a.apply(r,n||[])).next())})},Ha=function(r,n){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,s,l,c;return c={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function h(p){return function(g){return m([p,g])}}function m(p){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(l=p[0]&2?s.return:p[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,p[1])).done)return l;switch(s=0,l&&(p=[p[0]&2,l.value]),p[0]){case 0:case 1:l=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,s=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=l.length>0&&l[l.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!l||p[1]>l[0]&&p[1]<l[3])){i.label=p[1];break}if(p[0]===6&&i.label<l[1]){i.label=l[1],l=p;break}if(l&&i.label<l[2]){i.label=l[2],i.ops.push(p);break}l[2]&&i.ops.pop(),i.trys.pop();continue}p=n.call(r,i)}catch(g){p=[6,g],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Va=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&fr(n,r,i)},fr=Object.create?function(r,n,i,a){a===void 0&&(a=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||("get"in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(r,a,s)}:function(r,n,i,a){a===void 0&&(a=i),r[a]=n[i]},ur=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],a=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&a>=r.length&&(r=void 0),{value:r&&r[a++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},kn=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var a=i.call(r),s,l=[],c;try{for(;(n===void 0||n-- >0)&&!(s=a.next()).done;)l.push(s.value)}catch(h){c={error:h}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return l},$a=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(kn(arguments[n]));return r},qa=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var a=Array(r),s=0,n=0;n<i;n++)for(var l=arguments[n],c=0,h=l.length;c<h;c++,s++)a[s]=l[c];return a},ja=function(r,n,i){if(i||arguments.length===2)for(var a=0,s=n.length,l;a<s;a++)(l||!(a in n))&&(l||(l=Array.prototype.slice.call(n,0,a)),l[a]=n[a]);return r.concat(l||Array.prototype.slice.call(n))},jt=function(r){return this instanceof jt?(this.v=r,this):new jt(r)},za=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=i.apply(r,n||[]),s,l=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(d){a[d]&&(s[d]=function(y){return new Promise(function(v,P){l.push([d,y,v,P])>1||h(d,y)})})}function h(d,y){try{m(a[d](y))}catch(v){b(l[0][3],v)}}function m(d){d.value instanceof jt?Promise.resolve(d.value.v).then(p,g):b(l[0][2],d)}function p(d){h("next",d)}function g(d){h("throw",d)}function b(d,y){d(y),l.shift(),l.length&&h(l[0][0],l[0][1])}},Za=function(r){var n,i;return n={},a("next"),a("throw",function(s){throw s}),a("return"),n[Symbol.iterator]=function(){return this},n;function a(s,l){n[s]=r[s]?function(c){return(i=!i)?{value:jt(r[s](c)),done:s==="return"}:l?l(c):c}:l}},Ka=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof ur=="function"?ur(r):r[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(l){i[l]=r[l]&&function(c){return new Promise(function(h,m){c=r[l](c),s(h,m,c.done,c.value)})}}function s(l,c,h,m){Promise.resolve(m).then(function(p){l({value:p,done:h})},c)}},Ja=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};var o=Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n};Ya=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)i!=="default"&&Object.prototype.hasOwnProperty.call(r,i)&&fr(n,r,i);return o(n,r),n},Qa=function(r){return r&&r.__esModule?r:{default:r}},Xa=function(r,n,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!a:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(r):a?a.value:n.get(r)},es=function(r,n,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?r!==n||!s:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(r,i):s?s.value=i:n.set(r,i),i},ts=function(r,n){if(n===null||typeof n!="object"&&typeof n!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?n===r:r.has(n)},e("__extends",Na),e("__assign",Oa),e("__rest",Da),e("__decorate",Ua),e("__param",Ba),e("__metadata",Fa),e("__awaiter",Ga),e("__generator",Ha),e("__exportStar",Va),e("__createBinding",fr),e("__values",ur),e("__read",kn),e("__spread",$a),e("__spreadArrays",qa),e("__spreadArray",ja),e("__await",jt),e("__asyncGenerator",za),e("__asyncDelegator",Za),e("__asyncValues",Ka),e("__makeTemplateObject",Ja),e("__importStar",Ya),e("__importDefault",Qa),e("__classPrivateFieldGet",Xa),e("__classPrivateFieldSet",es),e("__classPrivateFieldIn",ts)})});var Rn=Ze(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.getLocalStorage=V.getLocalStorageOrThrow=V.getCrypto=V.getCryptoOrThrow=V.getLocation=V.getLocationOrThrow=V.getNavigator=V.getNavigatorOrThrow=V.getDocument=V.getDocumentOrThrow=V.getFromWindowOrThrow=V.getFromWindow=void 0;function Et(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}V.getFromWindow=Et;function zt(e){let t=Et(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}V.getFromWindowOrThrow=zt;function b1(){return zt("document")}V.getDocumentOrThrow=b1;function v1(){return Et("document")}V.getDocument=v1;function w1(){return zt("navigator")}V.getNavigatorOrThrow=w1;function C1(){return Et("navigator")}V.getNavigator=C1;function x1(){return zt("location")}V.getLocationOrThrow=x1;function E1(){return Et("location")}V.getLocation=E1;function _1(){return zt("crypto")}V.getCryptoOrThrow=_1;function P1(){return Et("crypto")}V.getCrypto=P1;function T1(){return zt("localStorage")}V.getLocalStorageOrThrow=T1;function A1(){return Et("localStorage")}V.getLocalStorage=A1});var rs=Ze(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.getWindowMetadata=void 0;var os=Rn();function S1(){let e,t;try{e=os.getDocumentOrThrow(),t=os.getLocationOrThrow()}catch{return null}function o(){let m=e.getElementsByTagName("link"),p=[];for(let g=0;g<m.length;g++){let b=m[g],d=b.getAttribute("rel");if(d&&d.toLowerCase().indexOf("icon")>-1){let y=b.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let v=t.protocol+"//"+t.host;if(y.indexOf("/")===0)v+=y;else{let P=t.pathname.split("/");P.pop(),v+=P.join("/")+"/"+y}p.push(v)}else if(y.indexOf("//")===0){let v=t.protocol+y;p.push(v)}else p.push(y)}}return p}function r(...m){let p=e.getElementsByTagName("meta");for(let g=0;g<p.length;g++){let b=p[g],d=["itemprop","property","name"].map(y=>b.getAttribute(y)).filter(y=>y?m.includes(y):!1);if(d.length&&d){let y=b.getAttribute("content");if(y)return y}}return""}function n(){let m=r("name","og:site_name","og:title","twitter:title");return m||(m=e.title),m}function i(){return r("description","og:description","twitter:description","keywords")}let a=n(),s=i(),l=t.origin,c=o();return{description:s,url:l,icons:c,name:a}}gr.getWindowMetadata=S1});var ms={};qi(ms,{BotInfo:()=>cs,BrowserInfo:()=>as,NodeInfo:()=>ss,ReactNativeInfo:()=>ds,SearchBotDeviceInfo:()=>ls,browserName:()=>M1,detect:()=>I1,detectOS:()=>us,getNodeVersion:()=>fs,parseUserAgent:()=>Wn});function I1(e){return e?Wn(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ds:typeof navigator<"u"?Wn(navigator.userAgent):fs()}function ps(e){return e!==""&&W1.reduce(function(t,o){var r=o[0],n=o[1];if(t)return t;var i=n.exec(e);return!!i&&[r,i]},!1)}function M1(e){var t=ps(e);return t?t[0]:null}function Wn(e){var t=ps(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new cs;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<ns&&(n=L1(n,N1(ns-n.length))):n=[];var i=n.join("."),a=us(e),s=R1.exec(e);return s&&s[1]?new ls(o,i,a,s[1]):new as(o,i,a)}function us(e){for(var t=0,o=is.length;t<o;t++){var r=is[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function fs(){var e=typeof process<"u"&&process.version;return e?new ss(process.version.slice(1)):null}function N1(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var L1,as,ss,ls,cs,ds,k1,R1,ns,W1,is,hs=$i(()=>{L1=function(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;for(var r=Array(e),n=0,t=0;t<o;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,n++)r[n]=i[a];return r},as=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),ss=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),ls=function(){function e(t,o,r,n){this.name=t,this.version=o,this.os=r,this.bot=n,this.type="bot-device"}return e}(),cs=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),ds=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),k1=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,R1=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,ns=3,W1=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",k1]],is=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]]});var Mn=Ze(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.getClientMeta=A.getLocalStorage=A.getLocalStorageOrThrow=A.getCrypto=A.getCryptoOrThrow=A.getLocation=A.getLocationOrThrow=A.getNavigator=A.getNavigatorOrThrow=A.getDocument=A.getDocumentOrThrow=A.getFromWindowOrThrow=A.getFromWindow=A.isBrowser=A.isNode=A.isMobile=A.isIOS=A.isAndroid=A.detectOS=A.detectEnv=void 0;var gs=hr(),O1=gs.__importStar(rs()),Le=gs.__importStar(Rn()),D1=(hs(),zi(ms));function In(e){return(0,D1.detect)(e)}A.detectEnv=In;function yr(){let e=In();return e&&e.os?e.os:void 0}A.detectOS=yr;function ys(){let e=yr();return e?e.toLowerCase().includes("android"):!1}A.isAndroid=ys;function bs(){let e=yr();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}A.isIOS=bs;function U1(){return yr()?ys()||bs():!1}A.isMobile=U1;function vs(){let e=In();return e&&e.name?e.name.toLowerCase()==="node":!1}A.isNode=vs;function B1(){return!vs()&&!!(0,A.getNavigator)()}A.isBrowser=B1;A.getFromWindow=Le.getFromWindow;A.getFromWindowOrThrow=Le.getFromWindowOrThrow;A.getDocumentOrThrow=Le.getDocumentOrThrow;A.getDocument=Le.getDocument;A.getNavigatorOrThrow=Le.getNavigatorOrThrow;A.getNavigator=Le.getNavigator;A.getLocationOrThrow=Le.getLocationOrThrow;A.getLocation=Le.getLocation;A.getCryptoOrThrow=Le.getCryptoOrThrow;A.getCrypto=Le.getCrypto;A.getLocalStorageOrThrow=Le.getLocalStorageOrThrow;A.getLocalStorage=Le.getLocalStorage;function F1(){return O1.getWindowMetadata()}A.getClientMeta=F1});var ws={};qi(ws,{safeJsonParse:()=>G1,safeJsonStringify:()=>H1});function G1(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return JSON.parse(e)}catch{return e}}function H1(e){return typeof e=="string"?e:JSON.stringify(e)}var Cs=$i(()=>{});var Nn=Ze(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.safeJsonStringify=Zt.safeJsonParse=void 0;var V1=hr(),xs=V1.__importStar((Cs(),zi(ws)));Zt.safeJsonParse=xs.safeJsonParse;Zt.safeJsonStringify=xs.safeJsonStringify});var Dn=Ze(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.removeLocal=ct.getLocal=ct.setLocal=void 0;var Es=Nn(),On=Mn();function $1(e,t){let o=(0,Es.safeJsonStringify)(t),r=(0,On.getLocalStorage)();r&&r.setItem(e,o)}ct.setLocal=$1;function q1(e){let t=null,o=null,r=(0,On.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,Es.safeJsonParse)(o),t}ct.getLocal=q1;function j1(e){let t=(0,On.getLocalStorage)();t&&t.removeItem(e)}ct.removeLocal=j1});var Ps=Ze(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.getMobileLinkRegistry=ye.getMobileRegistryEntry=ye.saveMobileLinkInfo=ye.formatIOSMobile=ye.mobileLinkChoiceKey=void 0;var z1=Dn();ye.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function Z1(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}ye.formatIOSMobile=Z1;function K1(e){let t=e.href.split("?")[0];(0,z1.setLocal)(ye.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}ye.saveMobileLinkInfo=K1;function _s(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}ye.getMobileRegistryEntry=_s;function J1(e,t){let o=e;return t&&(o=t.map(r=>_s(e,r)).filter(Boolean)),o}ye.getMobileLinkRegistry=J1});var Ss=Ze(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.formatMobileRegistry=De.formatMobileRegistryEntry=De.getDappRegistryUrl=De.getWalletRegistryUrl=void 0;var Ts="https://registry.walletconnect.com";function Y1(){return Ts+"/api/v2/wallets"}De.getWalletRegistryUrl=Y1;function Q1(){return Ts+"/api/v2/dapps"}De.getDappRegistryUrl=Q1;function As(e,t="mobile"){var o;return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:(o=e.image_url.sm)!==null&&o!==void 0?o:"",universalLink:e[t].universal||"",deepLink:e[t].native||""}}De.formatMobileRegistryEntry=As;function X1(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>As(o,t))}De.formatMobileRegistry=X1});var Ls=Ze(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});var Eo=hr();Eo.__exportStar(Mn(),_t);Eo.__exportStar(Nn(),_t);Eo.__exportStar(Dn(),_t);Eo.__exportStar(Ps(),_t);Eo.__exportStar(Ss(),_t)});import{Web3Provider as Vm}from"@ethersproject/providers";import{useEffect as fn,useState as ae}from"react";var C=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import Hd from"axios";var Re=class extends Error{constructor(o,r,n){super(o);r instanceof Error&&(this.cause=r),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},Bt=class extends Re{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},x=class extends Re{constructor(o,r,n){super(o,r,n);this.type="client_error"}};var Z=class extends Re{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},Y=e=>{if(e instanceof Re)return e;if(!Hd.isAxiosError(e))return Ee(e);if(!e.response)return new Bt("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.response.data;return new Bt(t||"ApiError",e.response.status,o||r,e,n)},Ee=e=>e instanceof Re?e:e instanceof Error?new x(e.message,e):new x(`Internal error: ${e}`);var Zi=()=>"/api/v1/sessions",Ki=()=>"/api/v1/sessions/logout",Ji=()=>"/api/v1/sessions/fork",Yi=()=>"/api/v1/sessions/fork/recover",Qi=()=>"/api/v1/siwe/init",Xi=()=>"/api/v1/siwe/authenticate",ea=()=>"/api/v1/siwe/link",ta=()=>"/api/v1/passwordless/init",oa=()=>"/api/v1/passwordless/authenticate",ra=()=>"/api/v1/passwordless/link",na=()=>"/api/v1/passwordless_sms/init",ia=()=>"/api/v1/passwordless_sms/authenticate",aa=()=>"/api/v1/passwordless_sms/link",sa=()=>"/api/v1/oauth/init",la=()=>"/api/v1/oauth/authenticate",ca=()=>"/api/v1/oauth/link",da=()=>"/api/v1/siwe/unlink",pa=()=>"/api/v1/passwordless/unlink",ua=()=>"/api/v1/passwordless_sms/unlink",fa=()=>"/api/v1/oauth/unlink",ma=()=>"/api/v1/analytics_events";var yt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{let t=oa(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw Y(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{let t=ra();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw Y(t)}}async sendCodeEmail(t){if(!this.api)throw new x("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new x("Email must be set when initialzing authentication.");try{let o=ta();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw Y(o)}}};var it=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=r}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new x("User denied confirmation during OAuth flow");try{let t=la(),o=await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw Y(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new x("User denied confirmation during OAuth flow");try{let t=ca();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw Y(t)}}async getAuthorizationUrl(){var t;if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.provider)throw new x("Provider must be set when initialzing OAuth authentication.");try{let o=sa();return(await this.api.post(o,{provider:this.meta.provider,redirect_to:window.location.href},{baseURL:(t=this.api)==null?void 0:t.fallbackApiUrl})).data}catch(o){throw Y(o)}}};var at=class{constructor(t,o,r){this._meta={walletType:o,walletId:r},this.connectors=t,this.walletConnector=this.connectors.createWalletConnector(o,null,r)}get meta(){return{...this._meta,walletName:this.walletConnector.walletBranding.name,walletIcon:this.walletConnector.walletBranding.icon}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Xi(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),{user:r.data.user,token:r.data.token,refresh_token:r.data.refresh_token,is_new_user:r.data.is_new_user}}catch(t){throw Y(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(ea(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),r.data}catch(t){throw Y(t)}}async promptConnect(){if(!this.api)throw new x("Auth flow has no API instance");let t=await this.walletConnector.connect({showPrompt:!0});return await this.buildSiweMessage(t),t}async sign(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.preparedMessage){let o=await this.walletConnector.connect({showPrompt:!1});await this.buildSiweMessage(o)}if(!this.preparedMessage)throw new x("Could not prepare SIWE message");let t=await this.walletConnector.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async buildSiweMessage(t){if(!this.api)throw new x("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(Qi(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var bt=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{let t=ia(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw Y(t)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{let t=aa();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw Y(t)}}async sendSmsCode(t){if(!this.api)throw new x("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new x("phone nNumber must be set when initialzing authentication.");try{let o=na();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw Y(o)}}};import{getAddress as tp}from"@ethersproject/address";var ha="1.24.0";var Ne="4df5e2316331463a9130964bd6078dfa",Xo="https://auth.privy.io",ga=1e4,_e=1400,wn=ha;var Ft="privy:token",er="privy:refresh_token",wo="privy:session_transfer_token",tr="privy:connectors",Cn="walletconnect",ya=3e4,Pe=1;var xn=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,o){o!==void 0?this._cache[t]=o:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},En=class{get(t){let o=localStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?localStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function $d(){return typeof window<"u"&&window.localStorage?new En:new xn}var j=$d();import a1 from"@coinbase/wallet-sdk";import{getAddress as s1}from"@ethersproject/address";import{jsx as ba,jsxs as qd}from"react/jsx-runtime";var Te=({style:e,...t})=>qd("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[ba("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),ba("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});import{getAddress as n1}from"@ethersproject/address";import{Web3Provider as i1}from"@ethersproject/providers";import{isHexString as Xd}from"@ethersproject/bytes";import{InfuraProvider as e1}from"@ethersproject/providers";import{toUtf8String as t1}from"@ethersproject/strings";import o1 from"eventemitter3";var jd=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign"],va=e=>jd.includes(e);import{isPossiblePhoneNumber as zd}from"libphonenumber-js/min";var wa=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),Ca=e=>zd(String(e),"US"),xa=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},We=(e,t=3,o=4)=>{if(!e)return"";let r=2,n=3;if(t+o+r+n>=e.length)return e;let i=e.slice(0,r+t),a=e.slice(e.length-o,e.length);return`${i}...${a}`},_n=e=>new Promise(t=>setTimeout(t,e)),Ea=(e,t={})=>{let o=t.delayMs||40,r=t.maxAttempts||1e3;return new Promise(async(n,i)=>{let a=!1,s=0;for(;!a&&s<r;)e().then(()=>{a=!0,n()},(...l)=>{a=!0,i(...l)}),s+=1,await _n(o);a||i(new Error("Exceeded max attempts before resolving function"))})},or=(e,t,o={})=>{let r=new URL(t,e);for(let[n,i]of Object.entries(o))r.searchParams.set(n,i);return r.href},Zd=(e,t)=>e.toLowerCase()===t.toLowerCase(),Pn=(e,t)=>{for(let o of e)if(Zd(o,t))return!0;return!1},rr=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Co=e=>typeof e=="string"?e:"0x"+e.toString(16);import{ErrorCode as Kd}from"@ethersproject/logger";var Gt=class extends Z{constructor(){super("Wallet timeout");this.type="wallet_error"}},wt=class extends Z{constructor(){super("User rejected connection");this.type="wallet_error"}},Ae=e=>{if(e instanceof Z)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new Ht(e);return e.code===Kd.ACTION_REJECTED&&(t.details=vt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new Ht(e):new Z("Unknown connector error",e)},Tn=class extends Re{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},Ht=class extends Tn{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(vt).find(l=>l.eipCode===r.code);this.details=n||vt.UNKNOWN_ERROR,r.code===-32002&&((i=r.message)!=null&&i.includes("already pending for origin")?(a=r.message)!=null&&a.includes("wallet_requestPermissions")?this.details=vt.E32002_CONNECTION_ALREADY_PENDING:this.details=vt.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=vt.E32002_WALLET_LOCKED))}},Jd={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},Yd={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},Qd={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},vt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...Qd,...Yd},Ct={...Jd,...vt};var r1=12e4,An=(e=new Gt,t=r1)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),Ie=class{constructor(t){this.removeListener=(t,o)=>{if(this.walletProvider)return this.walletProvider.removeListener(t,o)};this.setWalletProvider=t=>{this.walletProvider=t,this._subscriptions.forEach(o=>{var r;(r=this.walletProvider)==null||r.on(o.eventName,o.listener)})};this.walletProvider=t,this._subscriptions=[]}on(t,o){if(this.walletProvider)return this.walletProvider.on(t,o);this._subscriptions.push({eventName:t,listener:o})}async request(t){if(!this.walletProvider)throw new Z(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),An()]).catch(o=>{throw Ae(o)})}},st=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},nr=class extends o1{constructor(o,r,n=1){super();this.walletProxy=o,this.address=r,this.chainId=n,this.infuraProvider=new e1(n,Ne)}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new st(`Invalid params for ${o.method}`,4200);let r=o.params[0],n=r.chainId;if(n&&Number(n)!==this.chainId)throw new st(`Chain disconnected. Currently connected to ${this.chainId}, attempting to send to ${Number(n)}`,4901);if(!await xo()||!this.address)throw new st("Disconnected",4900);return(await Pa(r)).transactionHash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new st(`Invalid params for ${o.method}`,4200);let r=o.params[0];this.chainId=Number(r),this.emit("chainChanged",r)}async handlePersonalSign(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r=o.params[0],n=Xd(r)?t1(r):r;return await _a(n)}async handleEstimateGas(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r={...o.params[0],chainId:Co(this.chainId)};return delete r.from,this.infuraProvider.send("eth_estimateGas",[r])}async request(o){switch(console.debug("Embedded1193Provider.request() called with args",o),o.method){case"eth_accounts":return this.address?[this.address]:[];case"eth_chainId":return Co(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(o);case"eth_sendTransaction":return this.handleSendTransaction(o);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(o);case"personal_sign":return this.handlePersonalSign(o);default:break}if(va(o.method)){let r=await xo();if(!r||!this.address)throw new st("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:r,request:{method:o.method,params:o.params}})).response.data}catch(n){throw console.error(n),new st("Disconnected",4900)}}else return this.infuraProvider.send(o.method,o.params)}async connect(){let o=await xo();if(!o||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:o})).address}catch(r){return console.error(r),null}}},xt=class extends Ie{constructor(o){super(o)}},ir=class extends Ie{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var he=class{constructor(t,o,r){this.createSiweMessage=(t,o,r,n,i,a,s)=>`${r} wants you to sign in with your Ethereum account:
|
|
2
2
|
${o}
|
|
3
3
|
|
|
4
4
|
${s}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Id=Object.create;var xr=Object.defineProperty;var Md=Object.getOwnPropertyDescriptor;var Nd=Object.getOwnPropertyNames;var Od=Object.getPrototypeOf,Dd=Object.prototype.hasOwnProperty;var da=(e,t)=>()=>(e&&(t=e(e=0)),t);var wt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Kn=(e,t)=>{for(var o in t)xr(e,o,{get:t[o],enumerable:!0})},pa=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Nd(t))!Dd.call(e,n)&&n!==o&&xr(e,n,{get:()=>t[n],enumerable:!(r=Md(t,n))||r.enumerable});return e};var E=(e,t,o)=>(o=e!=null?Id(Od(e)):{},pa(t||!e||!e.__esModule?xr(o,"default",{value:e,enumerable:!0}):o,e)),Jn=e=>pa(xr({},"__esModule",{value:!0}),e);var Gr=wt((jf,Fr)=>{var ls,cs,ds,ps,us,fs,ms,hs,gs,Ur,si,ys,bs,vs,_o,ws,Cs,xs,Es,_s,Ps,Ts,As,Ss,Br;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){e(o(t,o(r)))}):typeof Fr=="object"&&typeof Fr.exports=="object"?e(o(t,o(Fr.exports))):e(o(t));function o(r,n){return r!==t&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(i,a){return r[i]=n?n(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])};ls=function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},cs=Object.assign||function(r){for(var n,i=1,a=arguments.length;i<a;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},ds=function(r,n){var i={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&n.indexOf(a)<0&&(i[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(r);s<a.length;s++)n.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(r,a[s])&&(i[a[s]]=r[a[s]]);return i},ps=function(r,n,i,a){var s=arguments.length,l=s<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(r,n,i,a);else for(var h=r.length-1;h>=0;h--)(c=r[h])&&(l=(s<3?c(l):s>3?c(n,i,l):c(n,i))||l);return s>3&&l&&Object.defineProperty(n,i,l),l},us=function(r,n){return function(i,a){n(i,a,r)}},fs=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},ms=function(r,n,i,a){function s(l){return l instanceof i?l:new i(function(c){c(l)})}return new(i||(i=Promise))(function(l,c){function h(g){try{p(a.next(g))}catch(b){c(b)}}function m(g){try{p(a.throw(g))}catch(b){c(b)}}function p(g){g.done?l(g.value):s(g.value).then(h,m)}p((a=a.apply(r,n||[])).next())})},hs=function(r,n){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,s,l,c;return c={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function h(p){return function(g){return m([p,g])}}function m(p){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(l=p[0]&2?s.return:p[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,p[1])).done)return l;switch(s=0,l&&(p=[p[0]&2,l.value]),p[0]){case 0:case 1:l=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,s=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=l.length>0&&l[l.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!l||p[1]>l[0]&&p[1]<l[3])){i.label=p[1];break}if(p[0]===6&&i.label<l[1]){i.label=l[1],l=p;break}if(l&&i.label<l[2]){i.label=l[2],i.ops.push(p);break}l[2]&&i.ops.pop(),i.trys.pop();continue}p=n.call(r,i)}catch(g){p=[6,g],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},gs=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&Br(n,r,i)},Br=Object.create?function(r,n,i,a){a===void 0&&(a=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||("get"in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(r,a,s)}:function(r,n,i,a){a===void 0&&(a=i),r[a]=n[i]},Ur=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],a=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&a>=r.length&&(r=void 0),{value:r&&r[a++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},si=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var a=i.call(r),s,l=[],c;try{for(;(n===void 0||n-- >0)&&!(s=a.next()).done;)l.push(s.value)}catch(h){c={error:h}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return l},ys=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(si(arguments[n]));return r},bs=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var a=Array(r),s=0,n=0;n<i;n++)for(var l=arguments[n],c=0,h=l.length;c<h;c++,s++)a[s]=l[c];return a},vs=function(r,n,i){if(i||arguments.length===2)for(var a=0,s=n.length,l;a<s;a++)(l||!(a in n))&&(l||(l=Array.prototype.slice.call(n,0,a)),l[a]=n[a]);return r.concat(l||Array.prototype.slice.call(n))},_o=function(r){return this instanceof _o?(this.v=r,this):new _o(r)},ws=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=i.apply(r,n||[]),s,l=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(d){a[d]&&(s[d]=function(y){return new Promise(function(w,A){l.push([d,y,w,A])>1||h(d,y)})})}function h(d,y){try{m(a[d](y))}catch(w){b(l[0][3],w)}}function m(d){d.value instanceof _o?Promise.resolve(d.value.v).then(p,g):b(l[0][2],d)}function p(d){h("next",d)}function g(d){h("throw",d)}function b(d,y){d(y),l.shift(),l.length&&h(l[0][0],l[0][1])}},Cs=function(r){var n,i;return n={},a("next"),a("throw",function(s){throw s}),a("return"),n[Symbol.iterator]=function(){return this},n;function a(s,l){n[s]=r[s]?function(c){return(i=!i)?{value:_o(r[s](c)),done:s==="return"}:l?l(c):c}:l}},xs=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof Ur=="function"?Ur(r):r[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(l){i[l]=r[l]&&function(c){return new Promise(function(h,m){c=r[l](c),s(h,m,c.done,c.value)})}}function s(l,c,h,m){Promise.resolve(m).then(function(p){l({value:p,done:h})},c)}},Es=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};var o=Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n};_s=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)i!=="default"&&Object.prototype.hasOwnProperty.call(r,i)&&Br(n,r,i);return o(n,r),n},Ps=function(r){return r&&r.__esModule?r:{default:r}},Ts=function(r,n,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!a:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(r):a?a.value:n.get(r)},As=function(r,n,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?r!==n||!s:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(r,i):s?s.value=i:n.set(r,i),i},Ss=function(r,n){if(n===null||typeof n!="object"&&typeof n!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?n===r:r.has(n)},e("__extends",ls),e("__assign",cs),e("__rest",ds),e("__decorate",ps),e("__param",us),e("__metadata",fs),e("__awaiter",ms),e("__generator",hs),e("__exportStar",gs),e("__createBinding",Br),e("__values",Ur),e("__read",si),e("__spread",ys),e("__spreadArrays",bs),e("__spreadArray",vs),e("__await",_o),e("__asyncGenerator",ws),e("__asyncDelegator",Cs),e("__asyncValues",xs),e("__makeTemplateObject",Es),e("__importStar",_s),e("__importDefault",Ps),e("__classPrivateFieldGet",Ts),e("__classPrivateFieldSet",As),e("__classPrivateFieldIn",Ss)})});var li=wt(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.getLocalStorage=z.getLocalStorageOrThrow=z.getCrypto=z.getCryptoOrThrow=z.getLocation=z.getLocationOrThrow=z.getNavigator=z.getNavigatorOrThrow=z.getDocument=z.getDocumentOrThrow=z.getFromWindowOrThrow=z.getFromWindow=void 0;function ro(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}z.getFromWindow=ro;function Po(e){let t=ro(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}z.getFromWindowOrThrow=Po;function zd(){return Po("document")}z.getDocumentOrThrow=zd;function Zd(){return ro("document")}z.getDocument=Zd;function Kd(){return Po("navigator")}z.getNavigatorOrThrow=Kd;function Jd(){return ro("navigator")}z.getNavigator=Jd;function Yd(){return Po("location")}z.getLocationOrThrow=Yd;function Qd(){return ro("location")}z.getLocation=Qd;function Xd(){return Po("crypto")}z.getCryptoOrThrow=Xd;function e1(){return ro("crypto")}z.getCrypto=e1;function t1(){return Po("localStorage")}z.getLocalStorageOrThrow=t1;function o1(){return ro("localStorage")}z.getLocalStorage=o1});var ks=wt(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.getWindowMetadata=void 0;var Ls=li();function r1(){let e,t;try{e=Ls.getDocumentOrThrow(),t=Ls.getLocationOrThrow()}catch{return null}function o(){let m=e.getElementsByTagName("link"),p=[];for(let g=0;g<m.length;g++){let b=m[g],d=b.getAttribute("rel");if(d&&d.toLowerCase().indexOf("icon")>-1){let y=b.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let w=t.protocol+"//"+t.host;if(y.indexOf("/")===0)w+=y;else{let A=t.pathname.split("/");A.pop(),w+=A.join("/")+"/"+y}p.push(w)}else if(y.indexOf("//")===0){let w=t.protocol+y;p.push(w)}else p.push(y)}}return p}function r(...m){let p=e.getElementsByTagName("meta");for(let g=0;g<p.length;g++){let b=p[g],d=["itemprop","property","name"].map(y=>b.getAttribute(y)).filter(y=>y?m.includes(y):!1);if(d.length&&d){let y=b.getAttribute("content");if(y)return y}}return""}function n(){let m=r("name","og:site_name","og:title","twitter:title");return m||(m=e.title),m}function i(){return r("description","og:description","twitter:description","keywords")}let a=n(),s=i(),l=t.origin,c=o();return{description:s,url:l,icons:c,name:a}}Hr.getWindowMetadata=r1});var Gs={};Kn(Gs,{BotInfo:()=>Os,BrowserInfo:()=>Is,NodeInfo:()=>Ms,ReactNativeInfo:()=>Ds,SearchBotDeviceInfo:()=>Ns,browserName:()=>c1,detect:()=>l1,detectOS:()=>Bs,getNodeVersion:()=>Fs,parseUserAgent:()=>ci});function l1(e){return e?ci(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Ds:typeof navigator<"u"?ci(navigator.userAgent):Fs()}function Us(e){return e!==""&&s1.reduce(function(t,o){var r=o[0],n=o[1];if(t)return t;var i=n.exec(e);return!!i&&[r,i]},!1)}function c1(e){var t=Us(e);return t?t[0]:null}function ci(e){var t=Us(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new Os;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<Rs&&(n=n1(n,d1(Rs-n.length))):n=[];var i=n.join("."),a=Bs(e),s=a1.exec(e);return s&&s[1]?new Ns(o,i,a,s[1]):new Is(o,i,a)}function Bs(e){for(var t=0,o=Ws.length;t<o;t++){var r=Ws[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function Fs(){var e=typeof process<"u"&&process.version;return e?new Ms(process.version.slice(1)):null}function d1(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var n1,Is,Ms,Ns,Os,Ds,i1,a1,Rs,s1,Ws,Hs=da(()=>{n1=function(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;for(var r=Array(e),n=0,t=0;t<o;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,n++)r[n]=i[a];return r},Is=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),Ms=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),Ns=function(){function e(t,o,r,n){this.name=t,this.version=o,this.os=r,this.bot=n,this.type="bot-device"}return e}(),Os=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Ds=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),i1=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,a1=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Rs=3,s1=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",i1]],Ws=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]]});var pi=wt(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.getClientMeta=L.getLocalStorage=L.getLocalStorageOrThrow=L.getCrypto=L.getCryptoOrThrow=L.getLocation=L.getLocationOrThrow=L.getNavigator=L.getNavigatorOrThrow=L.getDocument=L.getDocumentOrThrow=L.getFromWindowOrThrow=L.getFromWindow=L.isBrowser=L.isNode=L.isMobile=L.isIOS=L.isAndroid=L.detectOS=L.detectEnv=void 0;var Vs=Gr(),p1=Vs.__importStar(ks()),Ze=Vs.__importStar(li()),u1=(Hs(),Jn(Gs));function di(e){return(0,u1.detect)(e)}L.detectEnv=di;function Vr(){let e=di();return e&&e.os?e.os:void 0}L.detectOS=Vr;function $s(){let e=Vr();return e?e.toLowerCase().includes("android"):!1}L.isAndroid=$s;function qs(){let e=Vr();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}L.isIOS=qs;function f1(){return Vr()?$s()||qs():!1}L.isMobile=f1;function js(){let e=di();return e&&e.name?e.name.toLowerCase()==="node":!1}L.isNode=js;function m1(){return!js()&&!!(0,L.getNavigator)()}L.isBrowser=m1;L.getFromWindow=Ze.getFromWindow;L.getFromWindowOrThrow=Ze.getFromWindowOrThrow;L.getDocumentOrThrow=Ze.getDocumentOrThrow;L.getDocument=Ze.getDocument;L.getNavigatorOrThrow=Ze.getNavigatorOrThrow;L.getNavigator=Ze.getNavigator;L.getLocationOrThrow=Ze.getLocationOrThrow;L.getLocation=Ze.getLocation;L.getCryptoOrThrow=Ze.getCryptoOrThrow;L.getCrypto=Ze.getCrypto;L.getLocalStorageOrThrow=Ze.getLocalStorageOrThrow;L.getLocalStorage=Ze.getLocalStorage;function h1(){return p1.getWindowMetadata()}L.getClientMeta=h1});var zs={};Kn(zs,{safeJsonParse:()=>g1,safeJsonStringify:()=>y1});function g1(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return JSON.parse(e)}catch{return e}}function y1(e){return typeof e=="string"?e:JSON.stringify(e)}var Zs=da(()=>{});var ui=wt(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.safeJsonStringify=To.safeJsonParse=void 0;var b1=Gr(),Ks=b1.__importStar((Zs(),Jn(zs)));To.safeJsonParse=Ks.safeJsonParse;To.safeJsonStringify=Ks.safeJsonStringify});var mi=wt(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.removeLocal=Ut.getLocal=Ut.setLocal=void 0;var Js=ui(),fi=pi();function v1(e,t){let o=(0,Js.safeJsonStringify)(t),r=(0,fi.getLocalStorage)();r&&r.setItem(e,o)}Ut.setLocal=v1;function w1(e){let t=null,o=null,r=(0,fi.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,Js.safeJsonParse)(o),t}Ut.getLocal=w1;function C1(e){let t=(0,fi.getLocalStorage)();t&&t.removeItem(e)}Ut.removeLocal=C1});var Qs=wt(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.getMobileLinkRegistry=Se.getMobileRegistryEntry=Se.saveMobileLinkInfo=Se.formatIOSMobile=Se.mobileLinkChoiceKey=void 0;var x1=mi();Se.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function E1(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}Se.formatIOSMobile=E1;function _1(e){let t=e.href.split("?")[0];(0,x1.setLocal)(Se.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}Se.saveMobileLinkInfo=_1;function Ys(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}Se.getMobileRegistryEntry=Ys;function P1(e,t){let o=e;return t&&(o=t.map(r=>Ys(e,r)).filter(Boolean)),o}Se.getMobileLinkRegistry=P1});var tl=wt(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.formatMobileRegistry=dt.formatMobileRegistryEntry=dt.getDappRegistryUrl=dt.getWalletRegistryUrl=void 0;var Xs="https://registry.walletconnect.com";function T1(){return Xs+"/api/v2/wallets"}dt.getWalletRegistryUrl=T1;function A1(){return Xs+"/api/v2/dapps"}dt.getDappRegistryUrl=A1;function el(e,t="mobile"){var o;return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:(o=e.image_url.sm)!==null&&o!==void 0?o:"",universalLink:e[t].universal||"",deepLink:e[t].native||""}}dt.formatMobileRegistryEntry=el;function S1(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>el(o,t))}dt.formatMobileRegistry=S1});var ol=wt(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});var Yo=Gr();Yo.__exportStar(pi(),no);Yo.__exportStar(ui(),no);Yo.__exportStar(mi(),no);Yo.__exportStar(Qs(),no);Yo.__exportStar(tl(),no)});var L2={};Kn(L2,{AsExternalProvider:()=>Ot,ConnectorManager:()=>Ao,PrivyClient:()=>Lo,PrivyProvider:()=>Rd,PrivyProxyProvider:()=>qe,VERSION:()=>_r,WalletConnector:()=>_e,getAccessToken:()=>xo,usePrivy:()=>F});module.exports=Jn(L2);var Sd=require("@ethersproject/providers"),te=require("react");var _=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var ua=E(require("axios")),Xe=class extends Error{constructor(o,r,n){super(o);r instanceof Error&&(this.cause=r),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},bo=class extends Xe{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},P=class extends Xe{constructor(o,r,n){super(o,r,n);this.type="client_error"}};var oe=class extends Xe{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},de=e=>{if(e instanceof Xe)return e;if(!ua.default.isAxiosError(e))return Fe(e);if(!e.response)return new bo("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.response.data;return new bo(t||"ApiError",e.response.status,o||r,e,n)},Fe=e=>e instanceof Xe?e:e instanceof Error?new P(e.message,e):new P(`Internal error: ${e}`);var fa=()=>"/api/v1/sessions",ma=()=>"/api/v1/sessions/logout",ha=()=>"/api/v1/sessions/fork",ga=()=>"/api/v1/sessions/fork/recover",ya=()=>"/api/v1/siwe/init",ba=()=>"/api/v1/siwe/authenticate",va=()=>"/api/v1/siwe/link",wa=()=>"/api/v1/passwordless/init",Ca=()=>"/api/v1/passwordless/authenticate",xa=()=>"/api/v1/passwordless/link",Ea=()=>"/api/v1/passwordless_sms/init",_a=()=>"/api/v1/passwordless_sms/authenticate",Pa=()=>"/api/v1/passwordless_sms/link",Ta=()=>"/api/v1/oauth/init",Aa=()=>"/api/v1/oauth/authenticate",Sa=()=>"/api/v1/oauth/link",La=()=>"/api/v1/siwe/unlink",ka=()=>"/api/v1/passwordless/unlink",Ra=()=>"/api/v1/passwordless_sms/unlink",Wa=()=>"/api/v1/oauth/unlink",Ia=()=>"/api/v1/analytics_events";var Qt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=Ca(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw de(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=xa();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw de(t)}}async sendCodeEmail(t){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new P("Email must be set when initialzing authentication.");try{let o=wa();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw de(o)}}};var It=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=r}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");try{let t=Aa(),o=await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw de(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");try{let t=Sa();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw de(t)}}async getAuthorizationUrl(){var t;if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.provider)throw new P("Provider must be set when initialzing OAuth authentication.");try{let o=Ta();return(await this.api.post(o,{provider:this.meta.provider,redirect_to:window.location.href},{baseURL:(t=this.api)==null?void 0:t.fallbackApiUrl})).data}catch(o){throw de(o)}}};var Mt=class{constructor(t,o,r){this._meta={walletType:o,walletId:r},this.connectors=t,this.walletConnector=this.connectors.createWalletConnector(o,null,r)}get meta(){return{...this._meta,walletName:this.walletConnector.walletBranding.name,walletIcon:this.walletConnector.walletBranding.icon}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(ba(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),{user:r.data.user,token:r.data.token,refresh_token:r.data.refresh_token,is_new_user:r.data.is_new_user}}catch(t){throw de(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(va(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),r.data}catch(t){throw de(t)}}async promptConnect(){if(!this.api)throw new P("Auth flow has no API instance");let t=await this.walletConnector.connect({showPrompt:!0});return await this.buildSiweMessage(t),t}async sign(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.preparedMessage){let o=await this.walletConnector.connect({showPrompt:!1});await this.buildSiweMessage(o)}if(!this.preparedMessage)throw new P("Could not prepare SIWE message");let t=await this.walletConnector.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async buildSiweMessage(t){if(!this.api)throw new P("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(ya(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var Xt=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=_a(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw de(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=Pa();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw de(t)}}async sendSmsCode(t){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new P("phone nNumber must be set when initialzing authentication.");try{let o=Ea();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw de(o)}}};var cl=require("@ethersproject/address");var Ma="1.24.0-beta.8";var lt="4df5e2316331463a9130964bd6078dfa",Er="https://auth.privy.io",Na=1e4,Ge=1400,_r=Ma;var vo="privy:token",Pr="privy:refresh_token",Zo="privy:session_transfer_token",Tr="privy:connectors",Yn="walletconnect",Oa=3e4,He=1;var Qn=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,o){o!==void 0?this._cache[t]=o:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},Xn=class{get(t){let o=localStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?localStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function Bd(){return typeof window<"u"&&window.localStorage?new Xn:new Qn}var X=Bd();var Qa=E(require("@coinbase/wallet-sdk")),Xa=require("@ethersproject/address");var Ko=require("react/jsx-runtime"),Ve=({style:e,...t})=>(0,Ko.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,Ko.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,Ko.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var Ja=require("@ethersproject/address"),Ya=require("@ethersproject/providers");var $a=require("@ethersproject/bytes"),qa=require("@ethersproject/providers"),ja=require("@ethersproject/strings"),za=E(require("eventemitter3"));var Fd=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign"],Da=e=>Fd.includes(e);var Ua=require("libphonenumber-js/min");var Ba=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),Fa=e=>(0,Ua.isPossiblePhoneNumber)(String(e),"US"),Ga=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},et=(e,t=3,o=4)=>{if(!e)return"";let r=2,n=3;if(t+o+r+n>=e.length)return e;let i=e.slice(0,r+t),a=e.slice(e.length-o,e.length);return`${i}...${a}`},ei=e=>new Promise(t=>setTimeout(t,e)),Ha=(e,t={})=>{let o=t.delayMs||40,r=t.maxAttempts||1e3;return new Promise(async(n,i)=>{let a=!1,s=0;for(;!a&&s<r;)e().then(()=>{a=!0,n()},(...l)=>{a=!0,i(...l)}),s+=1,await ei(o);a||i(new Error("Exceeded max attempts before resolving function"))})},Ar=(e,t,o={})=>{let r=new URL(t,e);for(let[n,i]of Object.entries(o))r.searchParams.set(n,i);return r.href},Gd=(e,t)=>e.toLowerCase()===t.toLowerCase(),ti=(e,t)=>{for(let o of e)if(Gd(o,t))return!0;return!1},Sr=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Jo=e=>typeof e=="string"?e:"0x"+e.toString(16);var Va=require("@ethersproject/logger");var wo=class extends oe{constructor(){super("Wallet timeout");this.type="wallet_error"}},to=class extends oe{constructor(){super("User rejected connection");this.type="wallet_error"}},$e=e=>{if(e instanceof oe)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new Co(e);return e.code===Va.ErrorCode.ACTION_REJECTED&&(t.details=eo.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new Co(e):new oe("Unknown connector error",e)},oi=class extends Xe{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},Co=class extends oi{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(eo).find(l=>l.eipCode===r.code);this.details=n||eo.UNKNOWN_ERROR,r.code===-32002&&((i=r.message)!=null&&i.includes("already pending for origin")?(a=r.message)!=null&&a.includes("wallet_requestPermissions")?this.details=eo.E32002_CONNECTION_ALREADY_PENDING:this.details=eo.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=eo.E32002_WALLET_LOCKED))}},Hd={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},Vd={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},$d={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},eo={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...$d,...Vd},oo={...Hd,...eo};var qd=12e4,ri=(e=new wo,t=qd)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),qe=class{constructor(t){this.removeListener=(t,o)=>{if(this.walletProvider)return this.walletProvider.removeListener(t,o)};this.setWalletProvider=t=>{this.walletProvider=t,this._subscriptions.forEach(o=>{var r;(r=this.walletProvider)==null||r.on(o.eventName,o.listener)})};this.walletProvider=t,this._subscriptions=[]}on(t,o){if(this.walletProvider)return this.walletProvider.on(t,o);this._subscriptions.push({eventName:t,listener:o})}async request(t){if(!this.walletProvider)throw new oe(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),ri()]).catch(o=>{throw $e(o)})}},Nt=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},Lr=class extends za.default{constructor(o,r,n=1){super();this.walletProxy=o,this.address=r,this.chainId=n,this.infuraProvider=new qa.InfuraProvider(n,lt)}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new Nt(`Invalid params for ${o.method}`,4200);let r=o.params[0],n=r.chainId;if(n&&Number(n)!==this.chainId)throw new Nt(`Chain disconnected. Currently connected to ${this.chainId}, attempting to send to ${Number(n)}`,4901);if(!await xo()||!this.address)throw new Nt("Disconnected",4900);return(await Ka(r)).transactionHash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new Nt(`Invalid params for ${o.method}`,4200);let r=o.params[0];this.chainId=Number(r),this.emit("chainChanged",r)}async handlePersonalSign(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r=o.params[0],n=(0,$a.isHexString)(r)?(0,ja.toUtf8String)(r):r;return await Za(n)}async handleEstimateGas(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r={...o.params[0],chainId:Jo(this.chainId)};return delete r.from,this.infuraProvider.send("eth_estimateGas",[r])}async request(o){switch(console.debug("Embedded1193Provider.request() called with args",o),o.method){case"eth_accounts":return this.address?[this.address]:[];case"eth_chainId":return Jo(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(o);case"eth_sendTransaction":return this.handleSendTransaction(o);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(o);case"personal_sign":return this.handlePersonalSign(o);default:break}if(Da(o.method)){let r=await xo();if(!r||!this.address)throw new Nt("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:r,request:{method:o.method,params:o.params}})).response.data}catch(n){throw console.error(n),new Nt("Disconnected",4900)}}else return this.infuraProvider.send(o.method,o.params)}async connect(){let o=await xo();if(!o||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:o})).address}catch(r){return console.error(r),null}}},Ot=class extends qe{constructor(o){super(o)}},kr=class extends qe{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var _e=class{constructor(t,o,r){this.createSiweMessage=(t,o,r,n,i,a,s)=>`${r} wants you to sign in with your Ethereum account:
|
|
1
|
+
"use strict";var Id=Object.create;var xr=Object.defineProperty;var Md=Object.getOwnPropertyDescriptor;var Nd=Object.getOwnPropertyNames;var Od=Object.getPrototypeOf,Dd=Object.prototype.hasOwnProperty;var da=(e,t)=>()=>(e&&(t=e(e=0)),t);var wt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Kn=(e,t)=>{for(var o in t)xr(e,o,{get:t[o],enumerable:!0})},pa=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Nd(t))!Dd.call(e,n)&&n!==o&&xr(e,n,{get:()=>t[n],enumerable:!(r=Md(t,n))||r.enumerable});return e};var E=(e,t,o)=>(o=e!=null?Id(Od(e)):{},pa(t||!e||!e.__esModule?xr(o,"default",{value:e,enumerable:!0}):o,e)),Jn=e=>pa(xr({},"__esModule",{value:!0}),e);var Gr=wt((jf,Fr)=>{var ls,cs,ds,ps,us,fs,ms,hs,gs,Ur,si,ys,bs,vs,_o,ws,Cs,xs,Es,_s,Ps,Ts,As,Ss,Br;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){e(o(t,o(r)))}):typeof Fr=="object"&&typeof Fr.exports=="object"?e(o(t,o(Fr.exports))):e(o(t));function o(r,n){return r!==t&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(i,a){return r[i]=n?n(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])};ls=function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},cs=Object.assign||function(r){for(var n,i=1,a=arguments.length;i<a;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},ds=function(r,n){var i={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&n.indexOf(a)<0&&(i[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(r);s<a.length;s++)n.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(r,a[s])&&(i[a[s]]=r[a[s]]);return i},ps=function(r,n,i,a){var s=arguments.length,l=s<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(r,n,i,a);else for(var h=r.length-1;h>=0;h--)(c=r[h])&&(l=(s<3?c(l):s>3?c(n,i,l):c(n,i))||l);return s>3&&l&&Object.defineProperty(n,i,l),l},us=function(r,n){return function(i,a){n(i,a,r)}},fs=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},ms=function(r,n,i,a){function s(l){return l instanceof i?l:new i(function(c){c(l)})}return new(i||(i=Promise))(function(l,c){function h(g){try{p(a.next(g))}catch(b){c(b)}}function m(g){try{p(a.throw(g))}catch(b){c(b)}}function p(g){g.done?l(g.value):s(g.value).then(h,m)}p((a=a.apply(r,n||[])).next())})},hs=function(r,n){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,s,l,c;return c={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function h(p){return function(g){return m([p,g])}}function m(p){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(l=p[0]&2?s.return:p[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,p[1])).done)return l;switch(s=0,l&&(p=[p[0]&2,l.value]),p[0]){case 0:case 1:l=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,s=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=l.length>0&&l[l.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!l||p[1]>l[0]&&p[1]<l[3])){i.label=p[1];break}if(p[0]===6&&i.label<l[1]){i.label=l[1],l=p;break}if(l&&i.label<l[2]){i.label=l[2],i.ops.push(p);break}l[2]&&i.ops.pop(),i.trys.pop();continue}p=n.call(r,i)}catch(g){p=[6,g],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},gs=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&Br(n,r,i)},Br=Object.create?function(r,n,i,a){a===void 0&&(a=i);var s=Object.getOwnPropertyDescriptor(n,i);(!s||("get"in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(r,a,s)}:function(r,n,i,a){a===void 0&&(a=i),r[a]=n[i]},Ur=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],a=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&a>=r.length&&(r=void 0),{value:r&&r[a++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},si=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var a=i.call(r),s,l=[],c;try{for(;(n===void 0||n-- >0)&&!(s=a.next()).done;)l.push(s.value)}catch(h){c={error:h}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return l},ys=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(si(arguments[n]));return r},bs=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var a=Array(r),s=0,n=0;n<i;n++)for(var l=arguments[n],c=0,h=l.length;c<h;c++,s++)a[s]=l[c];return a},vs=function(r,n,i){if(i||arguments.length===2)for(var a=0,s=n.length,l;a<s;a++)(l||!(a in n))&&(l||(l=Array.prototype.slice.call(n,0,a)),l[a]=n[a]);return r.concat(l||Array.prototype.slice.call(n))},_o=function(r){return this instanceof _o?(this.v=r,this):new _o(r)},ws=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=i.apply(r,n||[]),s,l=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(d){a[d]&&(s[d]=function(y){return new Promise(function(w,A){l.push([d,y,w,A])>1||h(d,y)})})}function h(d,y){try{m(a[d](y))}catch(w){b(l[0][3],w)}}function m(d){d.value instanceof _o?Promise.resolve(d.value.v).then(p,g):b(l[0][2],d)}function p(d){h("next",d)}function g(d){h("throw",d)}function b(d,y){d(y),l.shift(),l.length&&h(l[0][0],l[0][1])}},Cs=function(r){var n,i;return n={},a("next"),a("throw",function(s){throw s}),a("return"),n[Symbol.iterator]=function(){return this},n;function a(s,l){n[s]=r[s]?function(c){return(i=!i)?{value:_o(r[s](c)),done:s==="return"}:l?l(c):c}:l}},xs=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof Ur=="function"?Ur(r):r[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(l){i[l]=r[l]&&function(c){return new Promise(function(h,m){c=r[l](c),s(h,m,c.done,c.value)})}}function s(l,c,h,m){Promise.resolve(m).then(function(p){l({value:p,done:h})},c)}},Es=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};var o=Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n};_s=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)i!=="default"&&Object.prototype.hasOwnProperty.call(r,i)&&Br(n,r,i);return o(n,r),n},Ps=function(r){return r&&r.__esModule?r:{default:r}},Ts=function(r,n,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!a:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(r):a?a.value:n.get(r)},As=function(r,n,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?r!==n||!s:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(r,i):s?s.value=i:n.set(r,i),i},Ss=function(r,n){if(n===null||typeof n!="object"&&typeof n!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?n===r:r.has(n)},e("__extends",ls),e("__assign",cs),e("__rest",ds),e("__decorate",ps),e("__param",us),e("__metadata",fs),e("__awaiter",ms),e("__generator",hs),e("__exportStar",gs),e("__createBinding",Br),e("__values",Ur),e("__read",si),e("__spread",ys),e("__spreadArrays",bs),e("__spreadArray",vs),e("__await",_o),e("__asyncGenerator",ws),e("__asyncDelegator",Cs),e("__asyncValues",xs),e("__makeTemplateObject",Es),e("__importStar",_s),e("__importDefault",Ps),e("__classPrivateFieldGet",Ts),e("__classPrivateFieldSet",As),e("__classPrivateFieldIn",Ss)})});var li=wt(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.getLocalStorage=z.getLocalStorageOrThrow=z.getCrypto=z.getCryptoOrThrow=z.getLocation=z.getLocationOrThrow=z.getNavigator=z.getNavigatorOrThrow=z.getDocument=z.getDocumentOrThrow=z.getFromWindowOrThrow=z.getFromWindow=void 0;function ro(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}z.getFromWindow=ro;function Po(e){let t=ro(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}z.getFromWindowOrThrow=Po;function zd(){return Po("document")}z.getDocumentOrThrow=zd;function Zd(){return ro("document")}z.getDocument=Zd;function Kd(){return Po("navigator")}z.getNavigatorOrThrow=Kd;function Jd(){return ro("navigator")}z.getNavigator=Jd;function Yd(){return Po("location")}z.getLocationOrThrow=Yd;function Qd(){return ro("location")}z.getLocation=Qd;function Xd(){return Po("crypto")}z.getCryptoOrThrow=Xd;function e1(){return ro("crypto")}z.getCrypto=e1;function t1(){return Po("localStorage")}z.getLocalStorageOrThrow=t1;function o1(){return ro("localStorage")}z.getLocalStorage=o1});var ks=wt(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.getWindowMetadata=void 0;var Ls=li();function r1(){let e,t;try{e=Ls.getDocumentOrThrow(),t=Ls.getLocationOrThrow()}catch{return null}function o(){let m=e.getElementsByTagName("link"),p=[];for(let g=0;g<m.length;g++){let b=m[g],d=b.getAttribute("rel");if(d&&d.toLowerCase().indexOf("icon")>-1){let y=b.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let w=t.protocol+"//"+t.host;if(y.indexOf("/")===0)w+=y;else{let A=t.pathname.split("/");A.pop(),w+=A.join("/")+"/"+y}p.push(w)}else if(y.indexOf("//")===0){let w=t.protocol+y;p.push(w)}else p.push(y)}}return p}function r(...m){let p=e.getElementsByTagName("meta");for(let g=0;g<p.length;g++){let b=p[g],d=["itemprop","property","name"].map(y=>b.getAttribute(y)).filter(y=>y?m.includes(y):!1);if(d.length&&d){let y=b.getAttribute("content");if(y)return y}}return""}function n(){let m=r("name","og:site_name","og:title","twitter:title");return m||(m=e.title),m}function i(){return r("description","og:description","twitter:description","keywords")}let a=n(),s=i(),l=t.origin,c=o();return{description:s,url:l,icons:c,name:a}}Hr.getWindowMetadata=r1});var Gs={};Kn(Gs,{BotInfo:()=>Os,BrowserInfo:()=>Is,NodeInfo:()=>Ms,ReactNativeInfo:()=>Ds,SearchBotDeviceInfo:()=>Ns,browserName:()=>c1,detect:()=>l1,detectOS:()=>Bs,getNodeVersion:()=>Fs,parseUserAgent:()=>ci});function l1(e){return e?ci(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Ds:typeof navigator<"u"?ci(navigator.userAgent):Fs()}function Us(e){return e!==""&&s1.reduce(function(t,o){var r=o[0],n=o[1];if(t)return t;var i=n.exec(e);return!!i&&[r,i]},!1)}function c1(e){var t=Us(e);return t?t[0]:null}function ci(e){var t=Us(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new Os;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<Rs&&(n=n1(n,d1(Rs-n.length))):n=[];var i=n.join("."),a=Bs(e),s=a1.exec(e);return s&&s[1]?new Ns(o,i,a,s[1]):new Is(o,i,a)}function Bs(e){for(var t=0,o=Ws.length;t<o;t++){var r=Ws[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function Fs(){var e=typeof process<"u"&&process.version;return e?new Ms(process.version.slice(1)):null}function d1(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var n1,Is,Ms,Ns,Os,Ds,i1,a1,Rs,s1,Ws,Hs=da(()=>{n1=function(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;for(var r=Array(e),n=0,t=0;t<o;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,n++)r[n]=i[a];return r},Is=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),Ms=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),Ns=function(){function e(t,o,r,n){this.name=t,this.version=o,this.os=r,this.bot=n,this.type="bot-device"}return e}(),Os=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Ds=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),i1=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,a1=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Rs=3,s1=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",i1]],Ws=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]]});var pi=wt(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.getClientMeta=L.getLocalStorage=L.getLocalStorageOrThrow=L.getCrypto=L.getCryptoOrThrow=L.getLocation=L.getLocationOrThrow=L.getNavigator=L.getNavigatorOrThrow=L.getDocument=L.getDocumentOrThrow=L.getFromWindowOrThrow=L.getFromWindow=L.isBrowser=L.isNode=L.isMobile=L.isIOS=L.isAndroid=L.detectOS=L.detectEnv=void 0;var Vs=Gr(),p1=Vs.__importStar(ks()),Ze=Vs.__importStar(li()),u1=(Hs(),Jn(Gs));function di(e){return(0,u1.detect)(e)}L.detectEnv=di;function Vr(){let e=di();return e&&e.os?e.os:void 0}L.detectOS=Vr;function $s(){let e=Vr();return e?e.toLowerCase().includes("android"):!1}L.isAndroid=$s;function qs(){let e=Vr();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}L.isIOS=qs;function f1(){return Vr()?$s()||qs():!1}L.isMobile=f1;function js(){let e=di();return e&&e.name?e.name.toLowerCase()==="node":!1}L.isNode=js;function m1(){return!js()&&!!(0,L.getNavigator)()}L.isBrowser=m1;L.getFromWindow=Ze.getFromWindow;L.getFromWindowOrThrow=Ze.getFromWindowOrThrow;L.getDocumentOrThrow=Ze.getDocumentOrThrow;L.getDocument=Ze.getDocument;L.getNavigatorOrThrow=Ze.getNavigatorOrThrow;L.getNavigator=Ze.getNavigator;L.getLocationOrThrow=Ze.getLocationOrThrow;L.getLocation=Ze.getLocation;L.getCryptoOrThrow=Ze.getCryptoOrThrow;L.getCrypto=Ze.getCrypto;L.getLocalStorageOrThrow=Ze.getLocalStorageOrThrow;L.getLocalStorage=Ze.getLocalStorage;function h1(){return p1.getWindowMetadata()}L.getClientMeta=h1});var zs={};Kn(zs,{safeJsonParse:()=>g1,safeJsonStringify:()=>y1});function g1(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return JSON.parse(e)}catch{return e}}function y1(e){return typeof e=="string"?e:JSON.stringify(e)}var Zs=da(()=>{});var ui=wt(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.safeJsonStringify=To.safeJsonParse=void 0;var b1=Gr(),Ks=b1.__importStar((Zs(),Jn(zs)));To.safeJsonParse=Ks.safeJsonParse;To.safeJsonStringify=Ks.safeJsonStringify});var mi=wt(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.removeLocal=Ut.getLocal=Ut.setLocal=void 0;var Js=ui(),fi=pi();function v1(e,t){let o=(0,Js.safeJsonStringify)(t),r=(0,fi.getLocalStorage)();r&&r.setItem(e,o)}Ut.setLocal=v1;function w1(e){let t=null,o=null,r=(0,fi.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,Js.safeJsonParse)(o),t}Ut.getLocal=w1;function C1(e){let t=(0,fi.getLocalStorage)();t&&t.removeItem(e)}Ut.removeLocal=C1});var Qs=wt(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.getMobileLinkRegistry=Se.getMobileRegistryEntry=Se.saveMobileLinkInfo=Se.formatIOSMobile=Se.mobileLinkChoiceKey=void 0;var x1=mi();Se.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function E1(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}Se.formatIOSMobile=E1;function _1(e){let t=e.href.split("?")[0];(0,x1.setLocal)(Se.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}Se.saveMobileLinkInfo=_1;function Ys(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}Se.getMobileRegistryEntry=Ys;function P1(e,t){let o=e;return t&&(o=t.map(r=>Ys(e,r)).filter(Boolean)),o}Se.getMobileLinkRegistry=P1});var tl=wt(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.formatMobileRegistry=dt.formatMobileRegistryEntry=dt.getDappRegistryUrl=dt.getWalletRegistryUrl=void 0;var Xs="https://registry.walletconnect.com";function T1(){return Xs+"/api/v2/wallets"}dt.getWalletRegistryUrl=T1;function A1(){return Xs+"/api/v2/dapps"}dt.getDappRegistryUrl=A1;function el(e,t="mobile"){var o;return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:(o=e.image_url.sm)!==null&&o!==void 0?o:"",universalLink:e[t].universal||"",deepLink:e[t].native||""}}dt.formatMobileRegistryEntry=el;function S1(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>el(o,t))}dt.formatMobileRegistry=S1});var ol=wt(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});var Yo=Gr();Yo.__exportStar(pi(),no);Yo.__exportStar(ui(),no);Yo.__exportStar(mi(),no);Yo.__exportStar(Qs(),no);Yo.__exportStar(tl(),no)});var L2={};Kn(L2,{AsExternalProvider:()=>Ot,ConnectorManager:()=>Ao,PrivyClient:()=>Lo,PrivyProvider:()=>Rd,PrivyProxyProvider:()=>qe,VERSION:()=>_r,WalletConnector:()=>_e,getAccessToken:()=>xo,usePrivy:()=>F});module.exports=Jn(L2);var Sd=require("@ethersproject/providers"),te=require("react");var _=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var ua=E(require("axios")),Xe=class extends Error{constructor(o,r,n){super(o);r instanceof Error&&(this.cause=r),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},bo=class extends Xe{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},P=class extends Xe{constructor(o,r,n){super(o,r,n);this.type="client_error"}};var oe=class extends Xe{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},de=e=>{if(e instanceof Xe)return e;if(!ua.default.isAxiosError(e))return Fe(e);if(!e.response)return new bo("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.response.data;return new bo(t||"ApiError",e.response.status,o||r,e,n)},Fe=e=>e instanceof Xe?e:e instanceof Error?new P(e.message,e):new P(`Internal error: ${e}`);var fa=()=>"/api/v1/sessions",ma=()=>"/api/v1/sessions/logout",ha=()=>"/api/v1/sessions/fork",ga=()=>"/api/v1/sessions/fork/recover",ya=()=>"/api/v1/siwe/init",ba=()=>"/api/v1/siwe/authenticate",va=()=>"/api/v1/siwe/link",wa=()=>"/api/v1/passwordless/init",Ca=()=>"/api/v1/passwordless/authenticate",xa=()=>"/api/v1/passwordless/link",Ea=()=>"/api/v1/passwordless_sms/init",_a=()=>"/api/v1/passwordless_sms/authenticate",Pa=()=>"/api/v1/passwordless_sms/link",Ta=()=>"/api/v1/oauth/init",Aa=()=>"/api/v1/oauth/authenticate",Sa=()=>"/api/v1/oauth/link",La=()=>"/api/v1/siwe/unlink",ka=()=>"/api/v1/passwordless/unlink",Ra=()=>"/api/v1/passwordless_sms/unlink",Wa=()=>"/api/v1/oauth/unlink",Ia=()=>"/api/v1/analytics_events";var Qt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=Ca(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw de(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=xa();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw de(t)}}async sendCodeEmail(t){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new P("Email must be set when initialzing authentication.");try{let o=wa();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw de(o)}}};var It=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=r}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");try{let t=Aa(),o=await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw de(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");try{let t=Sa();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw de(t)}}async getAuthorizationUrl(){var t;if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.provider)throw new P("Provider must be set when initialzing OAuth authentication.");try{let o=Ta();return(await this.api.post(o,{provider:this.meta.provider,redirect_to:window.location.href},{baseURL:(t=this.api)==null?void 0:t.fallbackApiUrl})).data}catch(o){throw de(o)}}};var Mt=class{constructor(t,o,r){this._meta={walletType:o,walletId:r},this.connectors=t,this.walletConnector=this.connectors.createWalletConnector(o,null,r)}get meta(){return{...this._meta,walletName:this.walletConnector.walletBranding.name,walletIcon:this.walletConnector.walletBranding.icon}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(ba(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),{user:r.data.user,token:r.data.token,refresh_token:r.data.refresh_token,is_new_user:r.data.is_new_user}}catch(t){throw de(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(va(),{message:t,signature:o});return this.connectors.addWalletConnector(this.walletConnector),await this.connectors.setActiveWallet(this.walletConnector.address)||console.warn("Failed to set active wallet"),r.data}catch(t){throw de(t)}}async promptConnect(){if(!this.api)throw new P("Auth flow has no API instance");let t=await this.walletConnector.connect({showPrompt:!0});return await this.buildSiweMessage(t),t}async sign(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.preparedMessage){let o=await this.walletConnector.connect({showPrompt:!1});await this.buildSiweMessage(o)}if(!this.preparedMessage)throw new P("Could not prepare SIWE message");let t=await this.walletConnector.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async buildSiweMessage(t){if(!this.api)throw new P("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(ya(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var Xt=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=_a(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.data.user,token:o.data.token,refresh_token:o.data.refresh_token,is_new_user:o.data.is_new_user}}catch(t){throw de(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=Pa();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw de(t)}}async sendSmsCode(t){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new P("phone nNumber must be set when initialzing authentication.");try{let o=Ea();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw de(o)}}};var cl=require("@ethersproject/address");var Ma="1.24.0";var lt="4df5e2316331463a9130964bd6078dfa",Er="https://auth.privy.io",Na=1e4,Ge=1400,_r=Ma;var vo="privy:token",Pr="privy:refresh_token",Zo="privy:session_transfer_token",Tr="privy:connectors",Yn="walletconnect",Oa=3e4,He=1;var Qn=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,o){o!==void 0?this._cache[t]=o:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},Xn=class{get(t){let o=localStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?localStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function Bd(){return typeof window<"u"&&window.localStorage?new Xn:new Qn}var X=Bd();var Qa=E(require("@coinbase/wallet-sdk")),Xa=require("@ethersproject/address");var Ko=require("react/jsx-runtime"),Ve=({style:e,...t})=>(0,Ko.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,Ko.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,Ko.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var Ja=require("@ethersproject/address"),Ya=require("@ethersproject/providers");var $a=require("@ethersproject/bytes"),qa=require("@ethersproject/providers"),ja=require("@ethersproject/strings"),za=E(require("eventemitter3"));var Fd=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign"],Da=e=>Fd.includes(e);var Ua=require("libphonenumber-js/min");var Ba=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),Fa=e=>(0,Ua.isPossiblePhoneNumber)(String(e),"US"),Ga=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},et=(e,t=3,o=4)=>{if(!e)return"";let r=2,n=3;if(t+o+r+n>=e.length)return e;let i=e.slice(0,r+t),a=e.slice(e.length-o,e.length);return`${i}...${a}`},ei=e=>new Promise(t=>setTimeout(t,e)),Ha=(e,t={})=>{let o=t.delayMs||40,r=t.maxAttempts||1e3;return new Promise(async(n,i)=>{let a=!1,s=0;for(;!a&&s<r;)e().then(()=>{a=!0,n()},(...l)=>{a=!0,i(...l)}),s+=1,await ei(o);a||i(new Error("Exceeded max attempts before resolving function"))})},Ar=(e,t,o={})=>{let r=new URL(t,e);for(let[n,i]of Object.entries(o))r.searchParams.set(n,i);return r.href},Gd=(e,t)=>e.toLowerCase()===t.toLowerCase(),ti=(e,t)=>{for(let o of e)if(Gd(o,t))return!0;return!1},Sr=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Jo=e=>typeof e=="string"?e:"0x"+e.toString(16);var Va=require("@ethersproject/logger");var wo=class extends oe{constructor(){super("Wallet timeout");this.type="wallet_error"}},to=class extends oe{constructor(){super("User rejected connection");this.type="wallet_error"}},$e=e=>{if(e instanceof oe)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new Co(e);return e.code===Va.ErrorCode.ACTION_REJECTED&&(t.details=eo.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new Co(e):new oe("Unknown connector error",e)},oi=class extends Xe{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},Co=class extends oi{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(eo).find(l=>l.eipCode===r.code);this.details=n||eo.UNKNOWN_ERROR,r.code===-32002&&((i=r.message)!=null&&i.includes("already pending for origin")?(a=r.message)!=null&&a.includes("wallet_requestPermissions")?this.details=eo.E32002_CONNECTION_ALREADY_PENDING:this.details=eo.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=eo.E32002_WALLET_LOCKED))}},Hd={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},Vd={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},$d={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},eo={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...$d,...Vd},oo={...Hd,...eo};var qd=12e4,ri=(e=new wo,t=qd)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),qe=class{constructor(t){this.removeListener=(t,o)=>{if(this.walletProvider)return this.walletProvider.removeListener(t,o)};this.setWalletProvider=t=>{this.walletProvider=t,this._subscriptions.forEach(o=>{var r;(r=this.walletProvider)==null||r.on(o.eventName,o.listener)})};this.walletProvider=t,this._subscriptions=[]}on(t,o){if(this.walletProvider)return this.walletProvider.on(t,o);this._subscriptions.push({eventName:t,listener:o})}async request(t){if(!this.walletProvider)throw new oe(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),ri()]).catch(o=>{throw $e(o)})}},Nt=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},Lr=class extends za.default{constructor(o,r,n=1){super();this.walletProxy=o,this.address=r,this.chainId=n,this.infuraProvider=new qa.InfuraProvider(n,lt)}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new Nt(`Invalid params for ${o.method}`,4200);let r=o.params[0],n=r.chainId;if(n&&Number(n)!==this.chainId)throw new Nt(`Chain disconnected. Currently connected to ${this.chainId}, attempting to send to ${Number(n)}`,4901);if(!await xo()||!this.address)throw new Nt("Disconnected",4900);return(await Ka(r)).transactionHash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new Nt(`Invalid params for ${o.method}`,4200);let r=o.params[0];this.chainId=Number(r),this.emit("chainChanged",r)}async handlePersonalSign(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r=o.params[0],n=(0,$a.isHexString)(r)?(0,ja.toUtf8String)(r):r;return await Za(n)}async handleEstimateGas(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r={...o.params[0],chainId:Jo(this.chainId)};return delete r.from,this.infuraProvider.send("eth_estimateGas",[r])}async request(o){switch(console.debug("Embedded1193Provider.request() called with args",o),o.method){case"eth_accounts":return this.address?[this.address]:[];case"eth_chainId":return Jo(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(o);case"eth_sendTransaction":return this.handleSendTransaction(o);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(o);case"personal_sign":return this.handlePersonalSign(o);default:break}if(Da(o.method)){let r=await xo();if(!r||!this.address)throw new Nt("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:r,request:{method:o.method,params:o.params}})).response.data}catch(n){throw console.error(n),new Nt("Disconnected",4900)}}else return this.infuraProvider.send(o.method,o.params)}async connect(){let o=await xo();if(!o||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:o})).address}catch(r){return console.error(r),null}}},Ot=class extends qe{constructor(o){super(o)}},kr=class extends qe{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var _e=class{constructor(t,o,r){this.createSiweMessage=(t,o,r,n,i,a,s)=>`${r} wants you to sign in with your Ethereum account:
|
|
2
2
|
${o}
|
|
3
3
|
|
|
4
4
|
${s}
|