@privy-io/react-auth 1.23.1-beta.3 → 1.23.1

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 CHANGED
@@ -1,4 +1,4 @@
1
- var Wc=Object.create;var Do=Object.defineProperty;var Rc=Object.getOwnPropertyDescriptor;var Ic=Object.getOwnPropertyNames;var Mc=Object.getPrototypeOf,Nc=Object.prototype.hasOwnProperty;var bi=(e,t)=>()=>(e&&(t=e(e=0)),t);var qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vi=(e,t)=>{for(var o in t)Do(e,o,{get:t[o],enumerable:!0})},wi=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ic(t))!Nc.call(e,n)&&n!==o&&Do(e,n,{get:()=>t[n],enumerable:!(r=Rc(t,n))||r.enumerable});return e};var Oc=(e,t,o)=>(o=e!=null?Wc(Mc(e)):{},wi(t||!e||!e.__esModule?Do(o,"default",{value:e,enumerable:!0}):o,e)),Ci=e=>wi(Do({},"__esModule",{value:!0}),e);var Qo=qe((Wf,Yo)=>{var aa,sa,la,ca,da,pa,ua,fa,ma,Ko,sn,ha,ga,ya,Gt,ba,va,wa,Ca,Ea,xa,_a,Sa,La,Jo;(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 Yo=="object"&&typeof Yo.exports=="object"?e(o(t,o(Yo.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])};aa=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)},sa=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},la=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},ca=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 g=r.length-1;g>=0;g--)(c=r[g])&&(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},da=function(r,n){return function(i,a){n(i,a,r)}},pa=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},ua=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 g(y){try{p(a.next(y))}catch(b){c(b)}}function f(y){try{p(a.throw(y))}catch(b){c(b)}}function p(y){y.done?l(y.value):s(y.value).then(g,f)}p((a=a.apply(r,n||[])).next())})},fa=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:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function g(p){return function(y){return f([p,y])}}function f(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(y){p=[6,y],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},ma=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&Jo(n,r,i)},Jo=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]},Ko=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.")},sn=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(g){c={error:g}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return l},ha=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(sn(arguments[n]));return r},ga=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,g=l.length;c<g;c++,s++)a[s]=l[c];return a},ya=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))},Gt=function(r){return this instanceof Gt?(this.v=r,this):new Gt(r)},ba=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(h){return new Promise(function(v,S){l.push([d,h,v,S])>1||g(d,h)})})}function g(d,h){try{f(a[d](h))}catch(v){b(l[0][3],v)}}function f(d){d.value instanceof Gt?Promise.resolve(d.value.v).then(p,y):b(l[0][2],d)}function p(d){g("next",d)}function y(d){g("throw",d)}function b(d,h){d(h),l.shift(),l.length&&g(l[0][0],l[0][1])}},va=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:Gt(r[s](c)),done:s==="return"}:l?l(c):c}:l}},wa=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 Ko=="function"?Ko(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(g,f){c=r[l](c),s(g,f,c.done,c.value)})}}function s(l,c,g,f){Promise.resolve(f).then(function(p){l({value:p,done:g})},c)}},Ca=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};Ea=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)&&Jo(n,r,i);return o(n,r),n},xa=function(r){return r&&r.__esModule?r:{default:r}},_a=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)},Sa=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},La=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",aa),e("__assign",sa),e("__rest",la),e("__decorate",ca),e("__param",da),e("__metadata",pa),e("__awaiter",ua),e("__generator",fa),e("__exportStar",ma),e("__createBinding",Jo),e("__values",Ko),e("__read",sn),e("__spread",ha),e("__spreadArrays",ga),e("__spreadArray",ya),e("__await",Gt),e("__asyncGenerator",ba),e("__asyncDelegator",va),e("__asyncValues",wa),e("__makeTemplateObject",Ca),e("__importStar",Ea),e("__importDefault",xa),e("__classPrivateFieldGet",_a),e("__classPrivateFieldSet",Sa),e("__classPrivateFieldIn",La)})});var ln=qe(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.getLocalStorage=F.getLocalStorageOrThrow=F.getCrypto=F.getCryptoOrThrow=F.getLocation=F.getLocationOrThrow=F.getNavigator=F.getNavigatorOrThrow=F.getDocument=F.getDocumentOrThrow=F.getFromWindowOrThrow=F.getFromWindow=void 0;function Ct(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}F.getFromWindow=Ct;function Ht(e){let t=Ct(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}F.getFromWindowOrThrow=Ht;function ld(){return Ht("document")}F.getDocumentOrThrow=ld;function cd(){return Ct("document")}F.getDocument=cd;function dd(){return Ht("navigator")}F.getNavigatorOrThrow=dd;function pd(){return Ct("navigator")}F.getNavigator=pd;function ud(){return Ht("location")}F.getLocationOrThrow=ud;function fd(){return Ct("location")}F.getLocation=fd;function md(){return Ht("crypto")}F.getCryptoOrThrow=md;function hd(){return Ct("crypto")}F.getCrypto=hd;function gd(){return Ht("localStorage")}F.getLocalStorageOrThrow=gd;function yd(){return Ct("localStorage")}F.getLocalStorage=yd});var Ta=qe(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.getWindowMetadata=void 0;var Pa=ln();function bd(){let e,t;try{e=Pa.getDocumentOrThrow(),t=Pa.getLocationOrThrow()}catch{return null}function o(){let f=e.getElementsByTagName("link"),p=[];for(let y=0;y<f.length;y++){let b=f[y],d=b.getAttribute("rel");if(d&&d.toLowerCase().indexOf("icon")>-1){let h=b.getAttribute("href");if(h)if(h.toLowerCase().indexOf("https:")===-1&&h.toLowerCase().indexOf("http:")===-1&&h.indexOf("//")!==0){let v=t.protocol+"//"+t.host;if(h.indexOf("/")===0)v+=h;else{let S=t.pathname.split("/");S.pop(),v+=S.join("/")+"/"+h}p.push(v)}else if(h.indexOf("//")===0){let v=t.protocol+h;p.push(v)}else p.push(h)}}return p}function r(...f){let p=e.getElementsByTagName("meta");for(let y=0;y<p.length;y++){let b=p[y],d=["itemprop","property","name"].map(h=>b.getAttribute(h)).filter(h=>h?f.includes(h):!1);if(d.length&&d){let h=b.getAttribute("content");if(h)return h}}return""}function n(){let f=r("name","og:site_name","og:title","twitter:title");return f||(f=e.title),f}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}}Xo.getWindowMetadata=bd});var Ba={};vi(Ba,{BotInfo:()=>Ma,BrowserInfo:()=>Wa,NodeInfo:()=>Ra,ReactNativeInfo:()=>Na,SearchBotDeviceInfo:()=>Ia,browserName:()=>_d,detect:()=>xd,detectOS:()=>Da,getNodeVersion:()=>Ua,parseUserAgent:()=>cn});function xd(e){return e?cn(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Na:typeof navigator<"u"?cn(navigator.userAgent):Ua()}function Oa(e){return e!==""&&Ed.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 _d(e){var t=Oa(e);return t?t[0]:null}function cn(e){var t=Oa(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new Ma;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<Aa&&(n=vd(n,Sd(Aa-n.length))):n=[];var i=n.join("."),a=Da(e),s=Cd.exec(e);return s&&s[1]?new Ia(o,i,a,s[1]):new Wa(o,i,a)}function Da(e){for(var t=0,o=ka.length;t<o;t++){var r=ka[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function Ua(){var e=typeof process<"u"&&process.version;return e?new Ra(process.version.slice(1)):null}function Sd(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var vd,Wa,Ra,Ia,Ma,Na,wd,Cd,Aa,Ed,ka,Fa=bi(()=>{vd=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},Wa=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),Ra=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),Ia=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}(),Ma=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Na=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),wd=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Cd=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Aa=3,Ed=[["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",wd]],ka=[["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 pn=qe(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 Ga=Qo(),Ld=Ga.__importStar(Ta()),Te=Ga.__importStar(ln()),Pd=(Fa(),Ci(Ba));function dn(e){return(0,Pd.detect)(e)}L.detectEnv=dn;function er(){let e=dn();return e&&e.os?e.os:void 0}L.detectOS=er;function Ha(){let e=er();return e?e.toLowerCase().includes("android"):!1}L.isAndroid=Ha;function Va(){let e=er();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}L.isIOS=Va;function Td(){return er()?Ha()||Va():!1}L.isMobile=Td;function $a(){let e=dn();return e&&e.name?e.name.toLowerCase()==="node":!1}L.isNode=$a;function Ad(){return!$a()&&!!(0,L.getNavigator)()}L.isBrowser=Ad;L.getFromWindow=Te.getFromWindow;L.getFromWindowOrThrow=Te.getFromWindowOrThrow;L.getDocumentOrThrow=Te.getDocumentOrThrow;L.getDocument=Te.getDocument;L.getNavigatorOrThrow=Te.getNavigatorOrThrow;L.getNavigator=Te.getNavigator;L.getLocationOrThrow=Te.getLocationOrThrow;L.getLocation=Te.getLocation;L.getCryptoOrThrow=Te.getCryptoOrThrow;L.getCrypto=Te.getCrypto;L.getLocalStorageOrThrow=Te.getLocalStorageOrThrow;L.getLocalStorage=Te.getLocalStorage;function kd(){return Ld.getWindowMetadata()}L.getClientMeta=kd});var ja={};vi(ja,{safeJsonParse:()=>Wd,safeJsonStringify:()=>Rd});function Wd(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 Rd(e){return typeof e=="string"?e:JSON.stringify(e)}var qa=bi(()=>{});var un=qe(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.safeJsonStringify=Vt.safeJsonParse=void 0;var Id=Qo(),za=Id.__importStar((qa(),Ci(ja)));Vt.safeJsonParse=za.safeJsonParse;Vt.safeJsonStringify=za.safeJsonStringify});var mn=qe(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.removeLocal=it.getLocal=it.setLocal=void 0;var Za=un(),fn=pn();function Md(e,t){let o=(0,Za.safeJsonStringify)(t),r=(0,fn.getLocalStorage)();r&&r.setItem(e,o)}it.setLocal=Md;function Nd(e){let t=null,o=null,r=(0,fn.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,Za.safeJsonParse)(o),t}it.getLocal=Nd;function Od(e){let t=(0,fn.getLocalStorage)();t&&t.removeItem(e)}it.removeLocal=Od});var Ja=qe(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.getMobileLinkRegistry=be.getMobileRegistryEntry=be.saveMobileLinkInfo=be.formatIOSMobile=be.mobileLinkChoiceKey=void 0;var Dd=mn();be.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function Ud(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}be.formatIOSMobile=Ud;function Bd(e){let t=e.href.split("?")[0];(0,Dd.setLocal)(be.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}be.saveMobileLinkInfo=Bd;function Ka(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}be.getMobileRegistryEntry=Ka;function Fd(e,t){let o=e;return t&&(o=t.map(r=>Ka(e,r)).filter(Boolean)),o}be.getMobileLinkRegistry=Fd});var Xa=qe(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.formatMobileRegistry=Oe.formatMobileRegistryEntry=Oe.getDappRegistryUrl=Oe.getWalletRegistryUrl=void 0;var Ya="https://registry.walletconnect.com";function Gd(){return Ya+"/api/v2/wallets"}Oe.getWalletRegistryUrl=Gd;function Hd(){return Ya+"/api/v2/dapps"}Oe.getDappRegistryUrl=Hd;function Qa(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||""}}Oe.formatMobileRegistryEntry=Qa;function Vd(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>Qa(o,t))}Oe.formatMobileRegistry=Vd});var es=qe(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});var ho=Qo();ho.__exportStar(pn(),Et);ho.__exportStar(un(),Et);ho.__exportStar(mn(),Et);ho.__exportStar(Ja(),Et);ho.__exportStar(Xa(),Et)});import{Web3Provider as e0}from"@ethersproject/providers";import{useEffect as gi,useState as pe}from"react";var x=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import Dc from"axios";var We=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}]`:""}`}},Mt=class extends We{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},C=class extends We{constructor(o,r,n){super(o,r,n);this.type="client_error"}};var Z=class extends We{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},Q=e=>{if(e instanceof We)return e;if(!Dc.isAxiosError(e))return xe(e);if(!e.response)return new Mt("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.response.data;return new Mt(t||"ApiError",e.response.status,o||r,e,n)},xe=e=>e instanceof We?e:e instanceof Error?new C(e.message,e):new C(`Internal error: ${e}`);var Ei=()=>"/api/v1/sessions",xi=()=>"/api/v1/sessions/logout",_i=()=>"/api/v1/sessions/fork",Si=()=>"/api/v1/sessions/fork/recover",Li=()=>"/api/v1/siwe/init",Pi=()=>"/api/v1/siwe/authenticate",Ti=()=>"/api/v1/siwe/link",Ai=()=>"/api/v1/passwordless/init",ki=()=>"/api/v1/passwordless/authenticate",Wi=()=>"/api/v1/passwordless/link",Ri=()=>"/api/v1/passwordless_sms/init",Ii=()=>"/api/v1/passwordless_sms/authenticate",Mi=()=>"/api/v1/passwordless_sms/link",Ni=()=>"/api/v1/oauth/init",Oi=()=>"/api/v1/oauth/authenticate",Di=()=>"/api/v1/oauth/link",Ui=()=>"/api/v1/siwe/unlink",Bi=()=>"/api/v1/passwordless/unlink",Fi=()=>"/api/v1/passwordless_sms/unlink",Gi=()=>"/api/v1/oauth/unlink",Hi=()=>"/api/v1/analytics_events";var mt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new C("Email and email code must be set prior to calling authenticate.");try{let t=ki(),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 Q(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new C("Email and email code must be set prior to calling authenticate.");try{let t=Wi();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw Q(t)}}async sendCodeEmail(t){if(!this.api)throw new C("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new C("Email must be set when initialzing authentication.");try{let o=Ai();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw Q(o)}}};var rt=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 C("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new C("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new C("User denied confirmation during OAuth flow");try{let t=Oi(),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 Q(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new C("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new C("User denied confirmation during OAuth flow");try{let t=Di();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw Q(t)}}async getAuthorizationUrl(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.provider)throw new C("Provider must be set when initialzing OAuth authentication.");try{let t=Ni();return(await this.api.post(t,{provider:this.meta.provider,redirect_to:window.location.href})).data}catch(t){throw Q(t)}}};var nt=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 C("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Pi(),{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 Q(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Ti(),{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 Q(t)}}async promptConnect(){if(!this.api)throw new C("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 C("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 C("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 C("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(Li(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var ht=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new C("phone number and sms code must be set prior to calling authenticate.");try{let t=Ii(),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 Q(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new C("phone number and sms code must be set prior to calling authenticate.");try{let t=Mi();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw Q(t)}}async sendSmsCode(t){if(!this.api)throw new C("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new C("phone nNumber must be set when initialzing authentication.");try{let o=Ri();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw Q(o)}}};import{getAddress as jd}from"@ethersproject/address";var Vi="1.23.1-beta.3";var $i="AZD8ITQ3ZQS63BQIJN3SPP767ZZY89SZJX",gt="4df5e2316331463a9130964bd6078dfa",Uo="https://auth.privy.io",ji=1e4,_e=1400,Jr=Vi;var Nt="privy:token",Bo="privy:refresh_token",mo="privy:session_transfer_token",Fo="privy:connectors",Yr="walletconnect",qi=3e4;var Qr=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)}},Xr=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 Bc(){return typeof window<"u"&&window.localStorage?new Xr:new Qr}var q=Bc();import Zc from"@coinbase/wallet-sdk";import{getAddress as Kc}from"@ethersproject/address";import{jsx as zi,jsxs as Fc}from"react/jsx-runtime";var Se=({style:e,...t})=>Fc("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:[zi("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),zi("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 qc}from"@ethersproject/address";import{Web3Provider as zc}from"@ethersproject/providers";import{ErrorCode as Gc}from"@ethersproject/logger";var Ot=class extends Z{constructor(){super("Wallet timeout");this.type="wallet_error"}},bt=class extends Z{constructor(){super("User rejected connection");this.type="wallet_error"}},Le=e=>{if(e instanceof Z)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new Dt(e);return e.code===Gc.ACTION_REJECTED&&(t.details=yt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new Dt(e):new Z("Unknown connector error",e)},en=class extends We{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},Dt=class extends en{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(yt).find(l=>l.eipCode===r.code);this.details=n||yt.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=yt.E32002_CONNECTION_ALREADY_PENDING:this.details=yt.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=yt.E32002_WALLET_LOCKED))}},Hc={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}},Vc={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}},$c={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}},yt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...$c,...Vc},vt={...Hc,...yt};var jc=12e4,tn=(e=new Ot,t=jc)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),Re=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),tn()]).catch(o=>{throw Le(o)})}},wt=class extends Re{constructor(o){super(o)}},Go=class extends Re{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var Ie=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 Wc=Object.create;var Do=Object.defineProperty;var Rc=Object.getOwnPropertyDescriptor;var Ic=Object.getOwnPropertyNames;var Mc=Object.getPrototypeOf,Nc=Object.prototype.hasOwnProperty;var bi=(e,t)=>()=>(e&&(t=e(e=0)),t);var qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vi=(e,t)=>{for(var o in t)Do(e,o,{get:t[o],enumerable:!0})},wi=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ic(t))!Nc.call(e,n)&&n!==o&&Do(e,n,{get:()=>t[n],enumerable:!(r=Rc(t,n))||r.enumerable});return e};var Oc=(e,t,o)=>(o=e!=null?Wc(Mc(e)):{},wi(t||!e||!e.__esModule?Do(o,"default",{value:e,enumerable:!0}):o,e)),Ci=e=>wi(Do({},"__esModule",{value:!0}),e);var Qo=qe((Wf,Yo)=>{var aa,sa,la,ca,da,pa,ua,fa,ma,Ko,sn,ha,ga,ya,Gt,ba,va,wa,Ca,Ea,xa,_a,Sa,La,Jo;(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 Yo=="object"&&typeof Yo.exports=="object"?e(o(t,o(Yo.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])};aa=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)},sa=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},la=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},ca=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 g=r.length-1;g>=0;g--)(c=r[g])&&(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},da=function(r,n){return function(i,a){n(i,a,r)}},pa=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},ua=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 g(y){try{p(a.next(y))}catch(b){c(b)}}function f(y){try{p(a.throw(y))}catch(b){c(b)}}function p(y){y.done?l(y.value):s(y.value).then(g,f)}p((a=a.apply(r,n||[])).next())})},fa=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:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function g(p){return function(y){return f([p,y])}}function f(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(y){p=[6,y],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},ma=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&Jo(n,r,i)},Jo=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]},Ko=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.")},sn=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(g){c={error:g}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return l},ha=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(sn(arguments[n]));return r},ga=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,g=l.length;c<g;c++,s++)a[s]=l[c];return a},ya=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))},Gt=function(r){return this instanceof Gt?(this.v=r,this):new Gt(r)},ba=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(h){return new Promise(function(v,S){l.push([d,h,v,S])>1||g(d,h)})})}function g(d,h){try{f(a[d](h))}catch(v){b(l[0][3],v)}}function f(d){d.value instanceof Gt?Promise.resolve(d.value.v).then(p,y):b(l[0][2],d)}function p(d){g("next",d)}function y(d){g("throw",d)}function b(d,h){d(h),l.shift(),l.length&&g(l[0][0],l[0][1])}},va=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:Gt(r[s](c)),done:s==="return"}:l?l(c):c}:l}},wa=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 Ko=="function"?Ko(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(g,f){c=r[l](c),s(g,f,c.done,c.value)})}}function s(l,c,g,f){Promise.resolve(f).then(function(p){l({value:p,done:g})},c)}},Ca=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};Ea=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)&&Jo(n,r,i);return o(n,r),n},xa=function(r){return r&&r.__esModule?r:{default:r}},_a=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)},Sa=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},La=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",aa),e("__assign",sa),e("__rest",la),e("__decorate",ca),e("__param",da),e("__metadata",pa),e("__awaiter",ua),e("__generator",fa),e("__exportStar",ma),e("__createBinding",Jo),e("__values",Ko),e("__read",sn),e("__spread",ha),e("__spreadArrays",ga),e("__spreadArray",ya),e("__await",Gt),e("__asyncGenerator",ba),e("__asyncDelegator",va),e("__asyncValues",wa),e("__makeTemplateObject",Ca),e("__importStar",Ea),e("__importDefault",xa),e("__classPrivateFieldGet",_a),e("__classPrivateFieldSet",Sa),e("__classPrivateFieldIn",La)})});var ln=qe(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.getLocalStorage=F.getLocalStorageOrThrow=F.getCrypto=F.getCryptoOrThrow=F.getLocation=F.getLocationOrThrow=F.getNavigator=F.getNavigatorOrThrow=F.getDocument=F.getDocumentOrThrow=F.getFromWindowOrThrow=F.getFromWindow=void 0;function Ct(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}F.getFromWindow=Ct;function Ht(e){let t=Ct(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}F.getFromWindowOrThrow=Ht;function ld(){return Ht("document")}F.getDocumentOrThrow=ld;function cd(){return Ct("document")}F.getDocument=cd;function dd(){return Ht("navigator")}F.getNavigatorOrThrow=dd;function pd(){return Ct("navigator")}F.getNavigator=pd;function ud(){return Ht("location")}F.getLocationOrThrow=ud;function fd(){return Ct("location")}F.getLocation=fd;function md(){return Ht("crypto")}F.getCryptoOrThrow=md;function hd(){return Ct("crypto")}F.getCrypto=hd;function gd(){return Ht("localStorage")}F.getLocalStorageOrThrow=gd;function yd(){return Ct("localStorage")}F.getLocalStorage=yd});var Ta=qe(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.getWindowMetadata=void 0;var Pa=ln();function bd(){let e,t;try{e=Pa.getDocumentOrThrow(),t=Pa.getLocationOrThrow()}catch{return null}function o(){let f=e.getElementsByTagName("link"),p=[];for(let y=0;y<f.length;y++){let b=f[y],d=b.getAttribute("rel");if(d&&d.toLowerCase().indexOf("icon")>-1){let h=b.getAttribute("href");if(h)if(h.toLowerCase().indexOf("https:")===-1&&h.toLowerCase().indexOf("http:")===-1&&h.indexOf("//")!==0){let v=t.protocol+"//"+t.host;if(h.indexOf("/")===0)v+=h;else{let S=t.pathname.split("/");S.pop(),v+=S.join("/")+"/"+h}p.push(v)}else if(h.indexOf("//")===0){let v=t.protocol+h;p.push(v)}else p.push(h)}}return p}function r(...f){let p=e.getElementsByTagName("meta");for(let y=0;y<p.length;y++){let b=p[y],d=["itemprop","property","name"].map(h=>b.getAttribute(h)).filter(h=>h?f.includes(h):!1);if(d.length&&d){let h=b.getAttribute("content");if(h)return h}}return""}function n(){let f=r("name","og:site_name","og:title","twitter:title");return f||(f=e.title),f}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}}Xo.getWindowMetadata=bd});var Ba={};vi(Ba,{BotInfo:()=>Ma,BrowserInfo:()=>Wa,NodeInfo:()=>Ra,ReactNativeInfo:()=>Na,SearchBotDeviceInfo:()=>Ia,browserName:()=>_d,detect:()=>xd,detectOS:()=>Da,getNodeVersion:()=>Ua,parseUserAgent:()=>cn});function xd(e){return e?cn(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Na:typeof navigator<"u"?cn(navigator.userAgent):Ua()}function Oa(e){return e!==""&&Ed.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 _d(e){var t=Oa(e);return t?t[0]:null}function cn(e){var t=Oa(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new Ma;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<Aa&&(n=vd(n,Sd(Aa-n.length))):n=[];var i=n.join("."),a=Da(e),s=Cd.exec(e);return s&&s[1]?new Ia(o,i,a,s[1]):new Wa(o,i,a)}function Da(e){for(var t=0,o=ka.length;t<o;t++){var r=ka[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function Ua(){var e=typeof process<"u"&&process.version;return e?new Ra(process.version.slice(1)):null}function Sd(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var vd,Wa,Ra,Ia,Ma,Na,wd,Cd,Aa,Ed,ka,Fa=bi(()=>{vd=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},Wa=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),Ra=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),Ia=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}(),Ma=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Na=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),wd=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Cd=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Aa=3,Ed=[["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",wd]],ka=[["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 pn=qe(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 Ga=Qo(),Ld=Ga.__importStar(Ta()),Te=Ga.__importStar(ln()),Pd=(Fa(),Ci(Ba));function dn(e){return(0,Pd.detect)(e)}L.detectEnv=dn;function er(){let e=dn();return e&&e.os?e.os:void 0}L.detectOS=er;function Ha(){let e=er();return e?e.toLowerCase().includes("android"):!1}L.isAndroid=Ha;function Va(){let e=er();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}L.isIOS=Va;function Td(){return er()?Ha()||Va():!1}L.isMobile=Td;function $a(){let e=dn();return e&&e.name?e.name.toLowerCase()==="node":!1}L.isNode=$a;function Ad(){return!$a()&&!!(0,L.getNavigator)()}L.isBrowser=Ad;L.getFromWindow=Te.getFromWindow;L.getFromWindowOrThrow=Te.getFromWindowOrThrow;L.getDocumentOrThrow=Te.getDocumentOrThrow;L.getDocument=Te.getDocument;L.getNavigatorOrThrow=Te.getNavigatorOrThrow;L.getNavigator=Te.getNavigator;L.getLocationOrThrow=Te.getLocationOrThrow;L.getLocation=Te.getLocation;L.getCryptoOrThrow=Te.getCryptoOrThrow;L.getCrypto=Te.getCrypto;L.getLocalStorageOrThrow=Te.getLocalStorageOrThrow;L.getLocalStorage=Te.getLocalStorage;function kd(){return Ld.getWindowMetadata()}L.getClientMeta=kd});var ja={};vi(ja,{safeJsonParse:()=>Wd,safeJsonStringify:()=>Rd});function Wd(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 Rd(e){return typeof e=="string"?e:JSON.stringify(e)}var qa=bi(()=>{});var un=qe(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.safeJsonStringify=Vt.safeJsonParse=void 0;var Id=Qo(),za=Id.__importStar((qa(),Ci(ja)));Vt.safeJsonParse=za.safeJsonParse;Vt.safeJsonStringify=za.safeJsonStringify});var mn=qe(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.removeLocal=it.getLocal=it.setLocal=void 0;var Za=un(),fn=pn();function Md(e,t){let o=(0,Za.safeJsonStringify)(t),r=(0,fn.getLocalStorage)();r&&r.setItem(e,o)}it.setLocal=Md;function Nd(e){let t=null,o=null,r=(0,fn.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,Za.safeJsonParse)(o),t}it.getLocal=Nd;function Od(e){let t=(0,fn.getLocalStorage)();t&&t.removeItem(e)}it.removeLocal=Od});var Ja=qe(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.getMobileLinkRegistry=be.getMobileRegistryEntry=be.saveMobileLinkInfo=be.formatIOSMobile=be.mobileLinkChoiceKey=void 0;var Dd=mn();be.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function Ud(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}be.formatIOSMobile=Ud;function Bd(e){let t=e.href.split("?")[0];(0,Dd.setLocal)(be.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}be.saveMobileLinkInfo=Bd;function Ka(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}be.getMobileRegistryEntry=Ka;function Fd(e,t){let o=e;return t&&(o=t.map(r=>Ka(e,r)).filter(Boolean)),o}be.getMobileLinkRegistry=Fd});var Xa=qe(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.formatMobileRegistry=Oe.formatMobileRegistryEntry=Oe.getDappRegistryUrl=Oe.getWalletRegistryUrl=void 0;var Ya="https://registry.walletconnect.com";function Gd(){return Ya+"/api/v2/wallets"}Oe.getWalletRegistryUrl=Gd;function Hd(){return Ya+"/api/v2/dapps"}Oe.getDappRegistryUrl=Hd;function Qa(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||""}}Oe.formatMobileRegistryEntry=Qa;function Vd(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>Qa(o,t))}Oe.formatMobileRegistry=Vd});var es=qe(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});var ho=Qo();ho.__exportStar(pn(),Et);ho.__exportStar(un(),Et);ho.__exportStar(mn(),Et);ho.__exportStar(Ja(),Et);ho.__exportStar(Xa(),Et)});import{Web3Provider as e0}from"@ethersproject/providers";import{useEffect as gi,useState as pe}from"react";var x=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import Dc from"axios";var We=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}]`:""}`}},Mt=class extends We{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},C=class extends We{constructor(o,r,n){super(o,r,n);this.type="client_error"}};var Z=class extends We{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},Q=e=>{if(e instanceof We)return e;if(!Dc.isAxiosError(e))return xe(e);if(!e.response)return new Mt("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.response.data;return new Mt(t||"ApiError",e.response.status,o||r,e,n)},xe=e=>e instanceof We?e:e instanceof Error?new C(e.message,e):new C(`Internal error: ${e}`);var Ei=()=>"/api/v1/sessions",xi=()=>"/api/v1/sessions/logout",_i=()=>"/api/v1/sessions/fork",Si=()=>"/api/v1/sessions/fork/recover",Li=()=>"/api/v1/siwe/init",Pi=()=>"/api/v1/siwe/authenticate",Ti=()=>"/api/v1/siwe/link",Ai=()=>"/api/v1/passwordless/init",ki=()=>"/api/v1/passwordless/authenticate",Wi=()=>"/api/v1/passwordless/link",Ri=()=>"/api/v1/passwordless_sms/init",Ii=()=>"/api/v1/passwordless_sms/authenticate",Mi=()=>"/api/v1/passwordless_sms/link",Ni=()=>"/api/v1/oauth/init",Oi=()=>"/api/v1/oauth/authenticate",Di=()=>"/api/v1/oauth/link",Ui=()=>"/api/v1/siwe/unlink",Bi=()=>"/api/v1/passwordless/unlink",Fi=()=>"/api/v1/passwordless_sms/unlink",Gi=()=>"/api/v1/oauth/unlink",Hi=()=>"/api/v1/analytics_events";var mt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new C("Email and email code must be set prior to calling authenticate.");try{let t=ki(),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 Q(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new C("Email and email code must be set prior to calling authenticate.");try{let t=Wi();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw Q(t)}}async sendCodeEmail(t){if(!this.api)throw new C("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new C("Email must be set when initialzing authentication.");try{let o=Ai();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw Q(o)}}};var rt=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 C("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new C("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new C("User denied confirmation during OAuth flow");try{let t=Oi(),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 Q(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new C("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new C("User denied confirmation during OAuth flow");try{let t=Di();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw Q(t)}}async getAuthorizationUrl(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.provider)throw new C("Provider must be set when initialzing OAuth authentication.");try{let t=Ni();return(await this.api.post(t,{provider:this.meta.provider,redirect_to:window.location.href})).data}catch(t){throw Q(t)}}};var nt=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 C("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Pi(),{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 Q(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Ti(),{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 Q(t)}}async promptConnect(){if(!this.api)throw new C("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 C("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 C("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 C("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(Li(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var ht=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new C("phone number and sms code must be set prior to calling authenticate.");try{let t=Ii(),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 Q(t)}}async link(){if(!this.api)throw new C("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new C("phone number and sms code must be set prior to calling authenticate.");try{let t=Mi();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw Q(t)}}async sendSmsCode(t){if(!this.api)throw new C("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new C("phone nNumber must be set when initialzing authentication.");try{let o=Ri();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw Q(o)}}};import{getAddress as jd}from"@ethersproject/address";var Vi="1.23.1";var $i="AZD8ITQ3ZQS63BQIJN3SPP767ZZY89SZJX",gt="4df5e2316331463a9130964bd6078dfa",Uo="https://auth.privy.io",ji=1e4,_e=1400,Jr=Vi;var Nt="privy:token",Bo="privy:refresh_token",mo="privy:session_transfer_token",Fo="privy:connectors",Yr="walletconnect",qi=3e4;var Qr=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)}},Xr=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 Bc(){return typeof window<"u"&&window.localStorage?new Xr:new Qr}var q=Bc();import Zc from"@coinbase/wallet-sdk";import{getAddress as Kc}from"@ethersproject/address";import{jsx as zi,jsxs as Fc}from"react/jsx-runtime";var Se=({style:e,...t})=>Fc("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:[zi("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),zi("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 qc}from"@ethersproject/address";import{Web3Provider as zc}from"@ethersproject/providers";import{ErrorCode as Gc}from"@ethersproject/logger";var Ot=class extends Z{constructor(){super("Wallet timeout");this.type="wallet_error"}},bt=class extends Z{constructor(){super("User rejected connection");this.type="wallet_error"}},Le=e=>{if(e instanceof Z)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new Dt(e);return e.code===Gc.ACTION_REJECTED&&(t.details=yt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new Dt(e):new Z("Unknown connector error",e)},en=class extends We{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},Dt=class extends en{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(yt).find(l=>l.eipCode===r.code);this.details=n||yt.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=yt.E32002_CONNECTION_ALREADY_PENDING:this.details=yt.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=yt.E32002_WALLET_LOCKED))}},Hc={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}},Vc={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}},$c={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}},yt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...$c,...Vc},vt={...Hc,...yt};var jc=12e4,tn=(e=new Ot,t=jc)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),Re=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),tn()]).catch(o=>{throw Le(o)})}},wt=class extends Re{constructor(o){super(o)}},Go=class extends Re{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var Ie=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 Pc=Object.create;var tr=Object.defineProperty;var Tc=Object.getOwnPropertyDescriptor;var Ac=Object.getOwnPropertyNames;var kc=Object.getPrototypeOf,Wc=Object.prototype.hasOwnProperty;var Wi=(e,t)=>()=>(e&&(t=e(e=0)),t);var gt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Cn=(e,t)=>{for(var o in t)tr(e,o,{get:t[o],enumerable:!0})},Ri=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ac(t))!Wc.call(e,n)&&n!==o&&tr(e,n,{get:()=>t[n],enumerable:!(r=Tc(t,n))||r.enumerable});return e};var P=(e,t,o)=>(o=e!=null?Pc(kc(e)):{},Ri(t||!e||!e.__esModule?tr(o,"default",{value:e,enumerable:!0}):o,e)),En=e=>Ri(tr({},"__esModule",{value:!0}),e);var br=gt((s2,yr)=>{var xa,_a,Sa,La,Pa,Ta,Aa,ka,Wa,hr,Rn,Ra,Ia,Ma,po,Na,Oa,Da,Ua,Ba,Fa,Ga,Ha,Va,gr;(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 yr=="object"&&typeof yr.exports=="object"?e(o(t,o(yr.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])};xa=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)},_a=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},Sa=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},La=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 g=r.length-1;g>=0;g--)(c=r[g])&&(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},Pa=function(r,n){return function(i,a){n(i,a,r)}},Ta=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},Aa=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 g(y){try{p(a.next(y))}catch(b){c(b)}}function f(y){try{p(a.throw(y))}catch(b){c(b)}}function p(y){y.done?l(y.value):s(y.value).then(g,f)}p((a=a.apply(r,n||[])).next())})},ka=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:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function g(p){return function(y){return f([p,y])}}function f(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(y){p=[6,y],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Wa=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&gr(n,r,i)},gr=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]},hr=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.")},Rn=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(g){c={error:g}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return l},Ra=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Rn(arguments[n]));return r},Ia=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,g=l.length;c<g;c++,s++)a[s]=l[c];return a},Ma=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))},po=function(r){return this instanceof po?(this.v=r,this):new po(r)},Na=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(h){return new Promise(function(w,T){l.push([d,h,w,T])>1||g(d,h)})})}function g(d,h){try{f(a[d](h))}catch(w){b(l[0][3],w)}}function f(d){d.value instanceof po?Promise.resolve(d.value.v).then(p,y):b(l[0][2],d)}function p(d){g("next",d)}function y(d){g("throw",d)}function b(d,h){d(h),l.shift(),l.length&&g(l[0][0],l[0][1])}},Oa=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:po(r[s](c)),done:s==="return"}:l?l(c):c}:l}},Da=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 hr=="function"?hr(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(g,f){c=r[l](c),s(g,f,c.done,c.value)})}}function s(l,c,g,f){Promise.resolve(f).then(function(p){l({value:p,done:g})},c)}},Ua=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};Ba=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)&&gr(n,r,i);return o(n,r),n},Fa=function(r){return r&&r.__esModule?r:{default:r}},Ga=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)},Ha=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},Va=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",xa),e("__assign",_a),e("__rest",Sa),e("__decorate",La),e("__param",Pa),e("__metadata",Ta),e("__awaiter",Aa),e("__generator",ka),e("__exportStar",Wa),e("__createBinding",gr),e("__values",hr),e("__read",Rn),e("__spread",Ra),e("__spreadArrays",Ia),e("__spreadArray",Ma),e("__await",po),e("__asyncGenerator",Na),e("__asyncDelegator",Oa),e("__asyncValues",Da),e("__makeTemplateObject",Ua),e("__importStar",Ba),e("__importDefault",Fa),e("__classPrivateFieldGet",Ga),e("__classPrivateFieldSet",Ha),e("__classPrivateFieldIn",Va)})});var In=gt(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 Kt(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}V.getFromWindow=Kt;function uo(e){let t=Kt(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}V.getFromWindowOrThrow=uo;function Fc(){return uo("document")}V.getDocumentOrThrow=Fc;function Gc(){return Kt("document")}V.getDocument=Gc;function Hc(){return uo("navigator")}V.getNavigatorOrThrow=Hc;function Vc(){return Kt("navigator")}V.getNavigator=Vc;function $c(){return uo("location")}V.getLocationOrThrow=$c;function jc(){return Kt("location")}V.getLocation=jc;function qc(){return uo("crypto")}V.getCryptoOrThrow=qc;function zc(){return Kt("crypto")}V.getCrypto=zc;function Zc(){return uo("localStorage")}V.getLocalStorageOrThrow=Zc;function Kc(){return Kt("localStorage")}V.getLocalStorage=Kc});var ja=gt(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.getWindowMetadata=void 0;var $a=In();function Jc(){let e,t;try{e=$a.getDocumentOrThrow(),t=$a.getLocationOrThrow()}catch{return null}function o(){let f=e.getElementsByTagName("link"),p=[];for(let y=0;y<f.length;y++){let b=f[y],d=b.getAttribute("rel");if(d&&d.toLowerCase().indexOf("icon")>-1){let h=b.getAttribute("href");if(h)if(h.toLowerCase().indexOf("https:")===-1&&h.toLowerCase().indexOf("http:")===-1&&h.indexOf("//")!==0){let w=t.protocol+"//"+t.host;if(h.indexOf("/")===0)w+=h;else{let T=t.pathname.split("/");T.pop(),w+=T.join("/")+"/"+h}p.push(w)}else if(h.indexOf("//")===0){let w=t.protocol+h;p.push(w)}else p.push(h)}}return p}function r(...f){let p=e.getElementsByTagName("meta");for(let y=0;y<p.length;y++){let b=p[y],d=["itemprop","property","name"].map(h=>b.getAttribute(h)).filter(h=>h?f.includes(h):!1);if(d.length&&d){let h=b.getAttribute("content");if(h)return h}}return""}function n(){let f=r("name","og:site_name","og:title","twitter:title");return f||(f=e.title),f}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}}vr.getWindowMetadata=Jc});var os={};Cn(os,{BotInfo:()=>Ya,BrowserInfo:()=>Za,NodeInfo:()=>Ka,ReactNativeInfo:()=>Qa,SearchBotDeviceInfo:()=>Ja,browserName:()=>od,detect:()=>td,detectOS:()=>es,getNodeVersion:()=>ts,parseUserAgent:()=>Mn});function td(e){return e?Mn(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Qa:typeof navigator<"u"?Mn(navigator.userAgent):ts()}function Xa(e){return e!==""&&ed.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 od(e){var t=Xa(e);return t?t[0]:null}function Mn(e){var t=Xa(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new Ya;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<qa&&(n=Yc(n,rd(qa-n.length))):n=[];var i=n.join("."),a=es(e),s=Xc.exec(e);return s&&s[1]?new Ja(o,i,a,s[1]):new Za(o,i,a)}function es(e){for(var t=0,o=za.length;t<o;t++){var r=za[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function ts(){var e=typeof process<"u"&&process.version;return e?new Ka(process.version.slice(1)):null}function rd(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var Yc,Za,Ka,Ja,Ya,Qa,Qc,Xc,qa,ed,za,rs=Wi(()=>{Yc=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},Za=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),Ka=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),Ja=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}(),Ya=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Qa=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),Qc=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Xc=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,qa=3,ed=[["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",Qc]],za=[["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 On=gt(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 ns=br(),nd=ns.__importStar(ja()),qe=ns.__importStar(In()),id=(rs(),En(os));function Nn(e){return(0,id.detect)(e)}A.detectEnv=Nn;function wr(){let e=Nn();return e&&e.os?e.os:void 0}A.detectOS=wr;function is(){let e=wr();return e?e.toLowerCase().includes("android"):!1}A.isAndroid=is;function as(){let e=wr();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}A.isIOS=as;function ad(){return wr()?is()||as():!1}A.isMobile=ad;function ss(){let e=Nn();return e&&e.name?e.name.toLowerCase()==="node":!1}A.isNode=ss;function sd(){return!ss()&&!!(0,A.getNavigator)()}A.isBrowser=sd;A.getFromWindow=qe.getFromWindow;A.getFromWindowOrThrow=qe.getFromWindowOrThrow;A.getDocumentOrThrow=qe.getDocumentOrThrow;A.getDocument=qe.getDocument;A.getNavigatorOrThrow=qe.getNavigatorOrThrow;A.getNavigator=qe.getNavigator;A.getLocationOrThrow=qe.getLocationOrThrow;A.getLocation=qe.getLocation;A.getCryptoOrThrow=qe.getCryptoOrThrow;A.getCrypto=qe.getCrypto;A.getLocalStorageOrThrow=qe.getLocalStorageOrThrow;A.getLocalStorage=qe.getLocalStorage;function ld(){return nd.getWindowMetadata()}A.getClientMeta=ld});var ls={};Cn(ls,{safeJsonParse:()=>cd,safeJsonStringify:()=>dd});function cd(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 dd(e){return typeof e=="string"?e:JSON.stringify(e)}var cs=Wi(()=>{});var Dn=gt(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.safeJsonStringify=fo.safeJsonParse=void 0;var pd=br(),ds=pd.__importStar((cs(),En(ls)));fo.safeJsonParse=ds.safeJsonParse;fo.safeJsonStringify=ds.safeJsonStringify});var Bn=gt(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.removeLocal=Wt.getLocal=Wt.setLocal=void 0;var ps=Dn(),Un=On();function ud(e,t){let o=(0,ps.safeJsonStringify)(t),r=(0,Un.getLocalStorage)();r&&r.setItem(e,o)}Wt.setLocal=ud;function fd(e){let t=null,o=null,r=(0,Un.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,ps.safeJsonParse)(o),t}Wt.getLocal=fd;function md(e){let t=(0,Un.getLocalStorage)();t&&t.removeItem(e)}Wt.removeLocal=md});var fs=gt(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.getMobileLinkRegistry=Te.getMobileRegistryEntry=Te.saveMobileLinkInfo=Te.formatIOSMobile=Te.mobileLinkChoiceKey=void 0;var hd=Bn();Te.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function gd(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}Te.formatIOSMobile=gd;function yd(e){let t=e.href.split("?")[0];(0,hd.setLocal)(Te.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}Te.saveMobileLinkInfo=yd;function us(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}Te.getMobileRegistryEntry=us;function bd(e,t){let o=e;return t&&(o=t.map(r=>us(e,r)).filter(Boolean)),o}Te.getMobileLinkRegistry=bd});var gs=gt(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.formatMobileRegistry=at.formatMobileRegistryEntry=at.getDappRegistryUrl=at.getWalletRegistryUrl=void 0;var ms="https://registry.walletconnect.com";function vd(){return ms+"/api/v2/wallets"}at.getWalletRegistryUrl=vd;function wd(){return ms+"/api/v2/dapps"}at.getDappRegistryUrl=wd;function hs(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||""}}at.formatMobileRegistryEntry=hs;function Cd(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>hs(o,t))}at.formatMobileRegistry=Cd});var ys=gt(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});var Uo=br();Uo.__exportStar(On(),Jt);Uo.__exportStar(Dn(),Jt);Uo.__exportStar(Bn(),Jt);Uo.__exportStar(fs(),Jt);Uo.__exportStar(gs(),Jt)});var tu={};Cn(tu,{AsExternalProvider:()=>kt,ConnectorManager:()=>mo,PrivyClient:()=>go,PrivyProvider:()=>Sc,PrivyProxyProvider:()=>He,VERSION:()=>rr,WalletConnector:()=>Ve,getAccessToken:()=>_c,usePrivy:()=>B});module.exports=En(tu);var xc=require("@ethersproject/providers"),se=require("react");var S=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var Ii=P(require("axios")),Qe=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}]`:""}`}},io=class extends Qe{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},_=class extends Qe{constructor(o,r,n){super(o,r,n);this.type="client_error"}};var ee=class extends Qe{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},le=e=>{if(e instanceof Qe)return e;if(!Ii.default.isAxiosError(e))return Ue(e);if(!e.response)return new io("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.response.data;return new io(t||"ApiError",e.response.status,o||r,e,n)},Ue=e=>e instanceof Qe?e:e instanceof Error?new _(e.message,e):new _(`Internal error: ${e}`);var Mi=()=>"/api/v1/sessions",Ni=()=>"/api/v1/sessions/logout",Oi=()=>"/api/v1/sessions/fork",Di=()=>"/api/v1/sessions/fork/recover",Ui=()=>"/api/v1/siwe/init",Bi=()=>"/api/v1/siwe/authenticate",Fi=()=>"/api/v1/siwe/link",Gi=()=>"/api/v1/passwordless/init",Hi=()=>"/api/v1/passwordless/authenticate",Vi=()=>"/api/v1/passwordless/link",$i=()=>"/api/v1/passwordless_sms/init",ji=()=>"/api/v1/passwordless_sms/authenticate",qi=()=>"/api/v1/passwordless_sms/link",zi=()=>"/api/v1/oauth/init",Zi=()=>"/api/v1/oauth/authenticate",Ki=()=>"/api/v1/oauth/link",Ji=()=>"/api/v1/siwe/unlink",Yi=()=>"/api/v1/passwordless/unlink",Qi=()=>"/api/v1/passwordless_sms/unlink",Xi=()=>"/api/v1/oauth/unlink",ea=()=>"/api/v1/analytics_events";var Vt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new _("Email and email code must be set prior to calling authenticate.");try{let t=Hi(),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 le(t)}}async link(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new _("Email and email code must be set prior to calling authenticate.");try{let t=Vi();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw le(t)}}async sendCodeEmail(t){if(!this.api)throw new _("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new _("Email must be set when initialzing authentication.");try{let o=Gi();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw le(o)}}};var Tt=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 _("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new _("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new _("User denied confirmation during OAuth flow");try{let t=Zi(),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 le(t)}}async link(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new _("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new _("User denied confirmation during OAuth flow");try{let t=Ki();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw le(t)}}async getAuthorizationUrl(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.provider)throw new _("Provider must be set when initialzing OAuth authentication.");try{let t=zi();return(await this.api.post(t,{provider:this.meta.provider,redirect_to:window.location.href})).data}catch(t){throw le(t)}}};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 _("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Bi(),{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 le(t)}}async link(){if(!this.api)throw new _("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Fi(),{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 le(t)}}async promptConnect(){if(!this.api)throw new _("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 _("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 _("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 _("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(Ui(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var $t=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new _("phone number and sms code must be set prior to calling authenticate.");try{let t=ji(),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 le(t)}}async link(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new _("phone number and sms code must be set prior to calling authenticate.");try{let t=qi();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw le(t)}}async sendSmsCode(t){if(!this.api)throw new _("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new _("phone nNumber must be set when initialzing authentication.");try{let o=$i();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw le(o)}}};var _s=require("@ethersproject/address");var ta="1.23.1-beta.3";var oa="AZD8ITQ3ZQS63BQIJN3SPP767ZZY89SZJX",jt="4df5e2316331463a9130964bd6078dfa",or="https://auth.privy.io",ra=1e4,Be=1400,rr=ta;var ao="privy:token",nr="privy:refresh_token",Oo="privy:session_transfer_token",ir="privy:connectors",xn="walletconnect",na=3e4;var _n=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)}},Sn=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 Ic(){return typeof window<"u"&&window.localStorage?new Sn:new _n}var Q=Ic();var la=P(require("@coinbase/wallet-sdk")),ca=require("@ethersproject/address");var Do=require("react/jsx-runtime"),Fe=({style:e,...t})=>(0,Do.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,Do.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,Do.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 aa=require("@ethersproject/address"),sa=require("@ethersproject/providers");var ia=require("@ethersproject/logger");var so=class extends ee{constructor(){super("Wallet timeout");this.type="wallet_error"}},zt=class extends ee{constructor(){super("User rejected connection");this.type="wallet_error"}},Ge=e=>{if(e instanceof ee)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new lo(e);return e.code===ia.ErrorCode.ACTION_REJECTED&&(t.details=qt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new lo(e):new ee("Unknown connector error",e)},Ln=class extends Qe{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},lo=class extends Ln{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(qt).find(l=>l.eipCode===r.code);this.details=n||qt.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=qt.E32002_CONNECTION_ALREADY_PENDING:this.details=qt.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=qt.E32002_WALLET_LOCKED))}},Mc={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}},Nc={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}},Oc={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}},qt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...Oc,...Nc},Zt={...Mc,...qt};var Dc=12e4,Pn=(e=new so,t=Dc)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),He=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 ee(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),Pn()]).catch(o=>{throw Ge(o)})}},kt=class extends He{constructor(o){super(o)}},ar=class extends He{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var Ve=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 Pc=Object.create;var tr=Object.defineProperty;var Tc=Object.getOwnPropertyDescriptor;var Ac=Object.getOwnPropertyNames;var kc=Object.getPrototypeOf,Wc=Object.prototype.hasOwnProperty;var Wi=(e,t)=>()=>(e&&(t=e(e=0)),t);var gt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Cn=(e,t)=>{for(var o in t)tr(e,o,{get:t[o],enumerable:!0})},Ri=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ac(t))!Wc.call(e,n)&&n!==o&&tr(e,n,{get:()=>t[n],enumerable:!(r=Tc(t,n))||r.enumerable});return e};var P=(e,t,o)=>(o=e!=null?Pc(kc(e)):{},Ri(t||!e||!e.__esModule?tr(o,"default",{value:e,enumerable:!0}):o,e)),En=e=>Ri(tr({},"__esModule",{value:!0}),e);var br=gt((s2,yr)=>{var xa,_a,Sa,La,Pa,Ta,Aa,ka,Wa,hr,Rn,Ra,Ia,Ma,po,Na,Oa,Da,Ua,Ba,Fa,Ga,Ha,Va,gr;(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 yr=="object"&&typeof yr.exports=="object"?e(o(t,o(yr.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])};xa=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)},_a=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},Sa=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},La=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 g=r.length-1;g>=0;g--)(c=r[g])&&(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},Pa=function(r,n){return function(i,a){n(i,a,r)}},Ta=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},Aa=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 g(y){try{p(a.next(y))}catch(b){c(b)}}function f(y){try{p(a.throw(y))}catch(b){c(b)}}function p(y){y.done?l(y.value):s(y.value).then(g,f)}p((a=a.apply(r,n||[])).next())})},ka=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:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function g(p){return function(y){return f([p,y])}}function f(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(y){p=[6,y],s=0}finally{a=l=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Wa=function(r,n){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&gr(n,r,i)},gr=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]},hr=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.")},Rn=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(g){c={error:g}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return l},Ra=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Rn(arguments[n]));return r},Ia=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,g=l.length;c<g;c++,s++)a[s]=l[c];return a},Ma=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))},po=function(r){return this instanceof po?(this.v=r,this):new po(r)},Na=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(h){return new Promise(function(w,T){l.push([d,h,w,T])>1||g(d,h)})})}function g(d,h){try{f(a[d](h))}catch(w){b(l[0][3],w)}}function f(d){d.value instanceof po?Promise.resolve(d.value.v).then(p,y):b(l[0][2],d)}function p(d){g("next",d)}function y(d){g("throw",d)}function b(d,h){d(h),l.shift(),l.length&&g(l[0][0],l[0][1])}},Oa=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:po(r[s](c)),done:s==="return"}:l?l(c):c}:l}},Da=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 hr=="function"?hr(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(g,f){c=r[l](c),s(g,f,c.done,c.value)})}}function s(l,c,g,f){Promise.resolve(f).then(function(p){l({value:p,done:g})},c)}},Ua=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};Ba=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)&&gr(n,r,i);return o(n,r),n},Fa=function(r){return r&&r.__esModule?r:{default:r}},Ga=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)},Ha=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},Va=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",xa),e("__assign",_a),e("__rest",Sa),e("__decorate",La),e("__param",Pa),e("__metadata",Ta),e("__awaiter",Aa),e("__generator",ka),e("__exportStar",Wa),e("__createBinding",gr),e("__values",hr),e("__read",Rn),e("__spread",Ra),e("__spreadArrays",Ia),e("__spreadArray",Ma),e("__await",po),e("__asyncGenerator",Na),e("__asyncDelegator",Oa),e("__asyncValues",Da),e("__makeTemplateObject",Ua),e("__importStar",Ba),e("__importDefault",Fa),e("__classPrivateFieldGet",Ga),e("__classPrivateFieldSet",Ha),e("__classPrivateFieldIn",Va)})});var In=gt(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 Kt(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}V.getFromWindow=Kt;function uo(e){let t=Kt(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}V.getFromWindowOrThrow=uo;function Fc(){return uo("document")}V.getDocumentOrThrow=Fc;function Gc(){return Kt("document")}V.getDocument=Gc;function Hc(){return uo("navigator")}V.getNavigatorOrThrow=Hc;function Vc(){return Kt("navigator")}V.getNavigator=Vc;function $c(){return uo("location")}V.getLocationOrThrow=$c;function jc(){return Kt("location")}V.getLocation=jc;function qc(){return uo("crypto")}V.getCryptoOrThrow=qc;function zc(){return Kt("crypto")}V.getCrypto=zc;function Zc(){return uo("localStorage")}V.getLocalStorageOrThrow=Zc;function Kc(){return Kt("localStorage")}V.getLocalStorage=Kc});var ja=gt(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.getWindowMetadata=void 0;var $a=In();function Jc(){let e,t;try{e=$a.getDocumentOrThrow(),t=$a.getLocationOrThrow()}catch{return null}function o(){let f=e.getElementsByTagName("link"),p=[];for(let y=0;y<f.length;y++){let b=f[y],d=b.getAttribute("rel");if(d&&d.toLowerCase().indexOf("icon")>-1){let h=b.getAttribute("href");if(h)if(h.toLowerCase().indexOf("https:")===-1&&h.toLowerCase().indexOf("http:")===-1&&h.indexOf("//")!==0){let w=t.protocol+"//"+t.host;if(h.indexOf("/")===0)w+=h;else{let T=t.pathname.split("/");T.pop(),w+=T.join("/")+"/"+h}p.push(w)}else if(h.indexOf("//")===0){let w=t.protocol+h;p.push(w)}else p.push(h)}}return p}function r(...f){let p=e.getElementsByTagName("meta");for(let y=0;y<p.length;y++){let b=p[y],d=["itemprop","property","name"].map(h=>b.getAttribute(h)).filter(h=>h?f.includes(h):!1);if(d.length&&d){let h=b.getAttribute("content");if(h)return h}}return""}function n(){let f=r("name","og:site_name","og:title","twitter:title");return f||(f=e.title),f}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}}vr.getWindowMetadata=Jc});var os={};Cn(os,{BotInfo:()=>Ya,BrowserInfo:()=>Za,NodeInfo:()=>Ka,ReactNativeInfo:()=>Qa,SearchBotDeviceInfo:()=>Ja,browserName:()=>od,detect:()=>td,detectOS:()=>es,getNodeVersion:()=>ts,parseUserAgent:()=>Mn});function td(e){return e?Mn(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Qa:typeof navigator<"u"?Mn(navigator.userAgent):ts()}function Xa(e){return e!==""&&ed.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 od(e){var t=Xa(e);return t?t[0]:null}function Mn(e){var t=Xa(e);if(!t)return null;var o=t[0],r=t[1];if(o==="searchbot")return new Ya;var n=r[1]&&r[1].split(/[._]/).slice(0,3);n?n.length<qa&&(n=Yc(n,rd(qa-n.length))):n=[];var i=n.join("."),a=es(e),s=Xc.exec(e);return s&&s[1]?new Ja(o,i,a,s[1]):new Za(o,i,a)}function es(e){for(var t=0,o=za.length;t<o;t++){var r=za[t],n=r[0],i=r[1],a=i.exec(e);if(a)return n}return null}function ts(){var e=typeof process<"u"&&process.version;return e?new Ka(process.version.slice(1)):null}function rd(e){for(var t=[],o=0;o<e;o++)t.push("0");return t}var Yc,Za,Ka,Ja,Ya,Qa,Qc,Xc,qa,ed,za,rs=Wi(()=>{Yc=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},Za=function(){function e(t,o,r){this.name=t,this.version=o,this.os=r,this.type="browser"}return e}(),Ka=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),Ja=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}(),Ya=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Qa=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),Qc=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Xc=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,qa=3,ed=[["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",Qc]],za=[["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 On=gt(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 ns=br(),nd=ns.__importStar(ja()),qe=ns.__importStar(In()),id=(rs(),En(os));function Nn(e){return(0,id.detect)(e)}A.detectEnv=Nn;function wr(){let e=Nn();return e&&e.os?e.os:void 0}A.detectOS=wr;function is(){let e=wr();return e?e.toLowerCase().includes("android"):!1}A.isAndroid=is;function as(){let e=wr();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}A.isIOS=as;function ad(){return wr()?is()||as():!1}A.isMobile=ad;function ss(){let e=Nn();return e&&e.name?e.name.toLowerCase()==="node":!1}A.isNode=ss;function sd(){return!ss()&&!!(0,A.getNavigator)()}A.isBrowser=sd;A.getFromWindow=qe.getFromWindow;A.getFromWindowOrThrow=qe.getFromWindowOrThrow;A.getDocumentOrThrow=qe.getDocumentOrThrow;A.getDocument=qe.getDocument;A.getNavigatorOrThrow=qe.getNavigatorOrThrow;A.getNavigator=qe.getNavigator;A.getLocationOrThrow=qe.getLocationOrThrow;A.getLocation=qe.getLocation;A.getCryptoOrThrow=qe.getCryptoOrThrow;A.getCrypto=qe.getCrypto;A.getLocalStorageOrThrow=qe.getLocalStorageOrThrow;A.getLocalStorage=qe.getLocalStorage;function ld(){return nd.getWindowMetadata()}A.getClientMeta=ld});var ls={};Cn(ls,{safeJsonParse:()=>cd,safeJsonStringify:()=>dd});function cd(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 dd(e){return typeof e=="string"?e:JSON.stringify(e)}var cs=Wi(()=>{});var Dn=gt(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.safeJsonStringify=fo.safeJsonParse=void 0;var pd=br(),ds=pd.__importStar((cs(),En(ls)));fo.safeJsonParse=ds.safeJsonParse;fo.safeJsonStringify=ds.safeJsonStringify});var Bn=gt(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.removeLocal=Wt.getLocal=Wt.setLocal=void 0;var ps=Dn(),Un=On();function ud(e,t){let o=(0,ps.safeJsonStringify)(t),r=(0,Un.getLocalStorage)();r&&r.setItem(e,o)}Wt.setLocal=ud;function fd(e){let t=null,o=null,r=(0,Un.getLocalStorage)();return r&&(o=r.getItem(e)),t=o&&(0,ps.safeJsonParse)(o),t}Wt.getLocal=fd;function md(e){let t=(0,Un.getLocalStorage)();t&&t.removeItem(e)}Wt.removeLocal=md});var fs=gt(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.getMobileLinkRegistry=Te.getMobileRegistryEntry=Te.saveMobileLinkInfo=Te.formatIOSMobile=Te.mobileLinkChoiceKey=void 0;var hd=Bn();Te.mobileLinkChoiceKey="WALLETCONNECT_DEEPLINK_CHOICE";function gd(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${o}`:""}Te.formatIOSMobile=gd;function yd(e){let t=e.href.split("?")[0];(0,hd.setLocal)(Te.mobileLinkChoiceKey,Object.assign(Object.assign({},e),{href:t}))}Te.saveMobileLinkInfo=yd;function us(e,t){return e.filter(o=>o.name.toLowerCase().includes(t.toLowerCase()))[0]}Te.getMobileRegistryEntry=us;function bd(e,t){let o=e;return t&&(o=t.map(r=>us(e,r)).filter(Boolean)),o}Te.getMobileLinkRegistry=bd});var gs=gt(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.formatMobileRegistry=at.formatMobileRegistryEntry=at.getDappRegistryUrl=at.getWalletRegistryUrl=void 0;var ms="https://registry.walletconnect.com";function vd(){return ms+"/api/v2/wallets"}at.getWalletRegistryUrl=vd;function wd(){return ms+"/api/v2/dapps"}at.getDappRegistryUrl=wd;function hs(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||""}}at.formatMobileRegistryEntry=hs;function Cd(e,t="mobile"){return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>hs(o,t))}at.formatMobileRegistry=Cd});var ys=gt(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});var Uo=br();Uo.__exportStar(On(),Jt);Uo.__exportStar(Dn(),Jt);Uo.__exportStar(Bn(),Jt);Uo.__exportStar(fs(),Jt);Uo.__exportStar(gs(),Jt)});var tu={};Cn(tu,{AsExternalProvider:()=>kt,ConnectorManager:()=>mo,PrivyClient:()=>go,PrivyProvider:()=>Sc,PrivyProxyProvider:()=>He,VERSION:()=>rr,WalletConnector:()=>Ve,getAccessToken:()=>_c,usePrivy:()=>B});module.exports=En(tu);var xc=require("@ethersproject/providers"),se=require("react");var S=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var Ii=P(require("axios")),Qe=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}]`:""}`}},io=class extends Qe{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},_=class extends Qe{constructor(o,r,n){super(o,r,n);this.type="client_error"}};var ee=class extends Qe{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},le=e=>{if(e instanceof Qe)return e;if(!Ii.default.isAxiosError(e))return Ue(e);if(!e.response)return new io("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.response.data;return new io(t||"ApiError",e.response.status,o||r,e,n)},Ue=e=>e instanceof Qe?e:e instanceof Error?new _(e.message,e):new _(`Internal error: ${e}`);var Mi=()=>"/api/v1/sessions",Ni=()=>"/api/v1/sessions/logout",Oi=()=>"/api/v1/sessions/fork",Di=()=>"/api/v1/sessions/fork/recover",Ui=()=>"/api/v1/siwe/init",Bi=()=>"/api/v1/siwe/authenticate",Fi=()=>"/api/v1/siwe/link",Gi=()=>"/api/v1/passwordless/init",Hi=()=>"/api/v1/passwordless/authenticate",Vi=()=>"/api/v1/passwordless/link",$i=()=>"/api/v1/passwordless_sms/init",ji=()=>"/api/v1/passwordless_sms/authenticate",qi=()=>"/api/v1/passwordless_sms/link",zi=()=>"/api/v1/oauth/init",Zi=()=>"/api/v1/oauth/authenticate",Ki=()=>"/api/v1/oauth/link",Ji=()=>"/api/v1/siwe/unlink",Yi=()=>"/api/v1/passwordless/unlink",Qi=()=>"/api/v1/passwordless_sms/unlink",Xi=()=>"/api/v1/oauth/unlink",ea=()=>"/api/v1/analytics_events";var Vt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new _("Email and email code must be set prior to calling authenticate.");try{let t=Hi(),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 le(t)}}async link(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new _("Email and email code must be set prior to calling authenticate.");try{let t=Vi();return(await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})).data}catch(t){throw le(t)}}async sendCodeEmail(t){if(!this.api)throw new _("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new _("Email must be set when initialzing authentication.");try{let o=Gi();return(await this.api.post(o,{email:this.meta.email})).data}catch(o){throw le(o)}}};var Tt=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 _("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new _("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new _("User denied confirmation during OAuth flow");try{let t=Zi(),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 le(t)}}async link(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new _("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new _("User denied confirmation during OAuth flow");try{let t=Ki();return(await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})).data}catch(t){throw le(t)}}async getAuthorizationUrl(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.provider)throw new _("Provider must be set when initialzing OAuth authentication.");try{let t=zi();return(await this.api.post(t,{provider:this.meta.provider,redirect_to:window.location.href})).data}catch(t){throw le(t)}}};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 _("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Bi(),{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 le(t)}}async link(){if(!this.api)throw new _("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(Fi(),{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 le(t)}}async promptConnect(){if(!this.api)throw new _("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 _("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 _("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 _("Auth flow has no API instance");let o=t.address,r=t.chainId,n=await this.api.post(Ui(),{address:o});return this.preparedMessage=this.walletConnector.prepareMessage(r,o,n.data.nonce),this.preparedMessage}};var $t=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new _("phone number and sms code must be set prior to calling authenticate.");try{let t=ji(),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 le(t)}}async link(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new _("phone number and sms code must be set prior to calling authenticate.");try{let t=qi();return(await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})).data}catch(t){throw le(t)}}async sendSmsCode(t){if(!this.api)throw new _("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new _("phone nNumber must be set when initialzing authentication.");try{let o=$i();return(await this.api.post(o,{phoneNumber:this.meta.phoneNumber})).data}catch(o){throw le(o)}}};var _s=require("@ethersproject/address");var ta="1.23.1";var oa="AZD8ITQ3ZQS63BQIJN3SPP767ZZY89SZJX",jt="4df5e2316331463a9130964bd6078dfa",or="https://auth.privy.io",ra=1e4,Be=1400,rr=ta;var ao="privy:token",nr="privy:refresh_token",Oo="privy:session_transfer_token",ir="privy:connectors",xn="walletconnect",na=3e4;var _n=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)}},Sn=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 Ic(){return typeof window<"u"&&window.localStorage?new Sn:new _n}var Q=Ic();var la=P(require("@coinbase/wallet-sdk")),ca=require("@ethersproject/address");var Do=require("react/jsx-runtime"),Fe=({style:e,...t})=>(0,Do.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,Do.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,Do.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 aa=require("@ethersproject/address"),sa=require("@ethersproject/providers");var ia=require("@ethersproject/logger");var so=class extends ee{constructor(){super("Wallet timeout");this.type="wallet_error"}},zt=class extends ee{constructor(){super("User rejected connection");this.type="wallet_error"}},Ge=e=>{if(e instanceof ee)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new lo(e);return e.code===ia.ErrorCode.ACTION_REJECTED&&(t.details=qt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new lo(e):new ee("Unknown connector error",e)},Ln=class extends Qe{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},lo=class extends Ln{constructor(o){var i,a,s;let r=o;super(r.message,r.code,r.data);let n=Object.values(qt).find(l=>l.eipCode===r.code);this.details=n||qt.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=qt.E32002_CONNECTION_ALREADY_PENDING:this.details=qt.E32002_REQUEST_ALREADY_PENDING:(s=r.message)!=null&&s.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=qt.E32002_WALLET_LOCKED))}},Mc={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}},Nc={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}},Oc={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}},qt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...Oc,...Nc},Zt={...Mc,...qt};var Dc=12e4,Pn=(e=new so,t=Dc)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),He=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 ee(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),Pn()]).catch(o=>{throw Ge(o)})}},kt=class extends He{constructor(o){super(o)}},ar=class extends He{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var Ve=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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privy-io/react-auth",
3
- "version": "1.23.1-beta.3",
3
+ "version": "1.23.1",
4
4
  "description": "React client for the Privy Auth API",
5
5
  "keywords": [
6
6
  "authentication",