@dcl/auth-site 4.11.11-22679873465.commit-7d4c26d → 4.11.11-22682242726.commit-246993c

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.
Files changed (84) hide show
  1. package/assets/{ConstantsUtil-yomW0pHy.js → ConstantsUtil-BGh1FFZ5.js} +1 -1
  2. package/assets/{ContentfulRichText-BKrUamZQ.js → ContentfulRichText-CGpY5urT.js} +1 -1
  3. package/assets/{ExchangeController-DcCego9F.js → ExchangeController-CwTbzmTL.js} +1 -1
  4. package/assets/{HelpersUtil-BheIoNW3.js → HelpersUtil-B-cAHFH5.js} +1 -1
  5. package/assets/{NetworkUtil-CF6hfJpY.js → NetworkUtil-CQELJEgg.js} +1 -1
  6. package/assets/{SwapController-BGocu_eo.js → SwapController-DkEbeevE.js} +1 -1
  7. package/assets/{biconomy-BP3nUxy3.js → biconomy-oVpKVUPm.js} +1 -1
  8. package/assets/{ccip-qC52mjzf.js → ccip-C0CD4zME.js} +1 -1
  9. package/assets/{data-capture-BOh9LS3B.js → data-capture-Bt5BiIdl.js} +1 -1
  10. package/assets/{email--mg-XoDW.js → email-BGSswmXX.js} +1 -1
  11. package/assets/{embedded-wallet-D18D-zxi.js → embedded-wallet-tYZy4jns.js} +1 -1
  12. package/assets/{engine-C6J3ctMO.js → engine-CyEdBdkN.js} +1 -1
  13. package/assets/{extractIPFS-BjnAE5vj.js → extractIPFS-Cz2_LWBy.js} +1 -1
  14. package/assets/{features-RRoFcgOG.js → features-Vo0aRCRJ.js} +1 -1
  15. package/assets/{fortmatic-CAUWFEj2.js → fortmatic-DlIjAfoh.js} +1 -1
  16. package/assets/{getInstalledModules-c2Cj6z0L.js → getInstalledModules-DrEwW5qD.js} +1 -1
  17. package/assets/{if-defined-BFxH3C3I.js → if-defined-Dw-S0ise.js} +1 -1
  18. package/assets/{in-app-wallet-calls-CC57SOFU.js → in-app-wallet-calls-XjDSrm90.js} +1 -1
  19. package/assets/{index-CUmF3N4h.js → index-AAFgO9Es.js} +1 -1
  20. package/assets/{index-Ba0rEvGl.js → index-B-H2P3yc.js} +1 -1
  21. package/assets/{index-rgwfH8yu.js → index-B8LZftfz.js} +1 -1
  22. package/assets/{index-DiWSbg0n.js → index-B99E-jw5.js} +1 -1
  23. package/assets/{index-B_cJLIUw.js → index-BCJ58vx8.js} +1 -1
  24. package/assets/{index-CQjiMBRi.js → index-BCsQysFr.js} +1 -1
  25. package/assets/{index-JkcllXIB.js → index-BJd3alUP.js} +1 -1
  26. package/assets/{index-Irxa35iL.js → index-BKFbKSfO.js} +1 -1
  27. package/assets/{index-BYlbQdgt.js → index-BStI80XA.js} +1 -1
  28. package/assets/{index-Dqt7thvX.js → index-BTv8siy7.js} +4 -4
  29. package/assets/{index-BWY5rLcb.js → index-BbJ97fLK.js} +1 -1
  30. package/assets/{index-UhG8UyZK.js → index-Bm1pqpw6.js} +1 -1
  31. package/assets/{index-DGrL5VQf.js → index-Bn24T6C6.js} +1 -1
  32. package/assets/{index-u_z0VuO4.js → index-C1IWXAvt.js} +1 -1
  33. package/assets/{index-BCi3Crpp.js → index-CKiFyUbS.js} +1 -1
  34. package/assets/{index-CRuSCuQI.js → index-CP8gwVD7.js} +1 -1
  35. package/assets/{index-BirZA6-V.js → index-CUmC4Xrt.js} +1 -1
  36. package/assets/{index-DKdw3WSO.js → index-CXyslBbN.js} +1 -1
  37. package/assets/{index-C3wiW9wU.js → index-C_rsyY_8.js} +1 -1
  38. package/assets/{index-k03wpOWs.js → index-CaWUgWhg.js} +3 -3
  39. package/assets/{index-DooF4pRe.js → index-CeX6TG8F.js} +1 -1
  40. package/assets/{index-BO0AJK-5.js → index-CfvKVkmT.js} +1 -1
  41. package/assets/{index-umn2zf2U.js → index-ChhrHO41.js} +1 -1
  42. package/assets/{index-B4_b4exx.js → index-CiP4eK6c.js} +11 -11
  43. package/assets/{index-fUOxcsJn.js → index-Cjdp2jQS.js} +1 -1
  44. package/assets/{index-CzTDi-Qd.js → index-Crl68AnY.js} +1 -1
  45. package/assets/{index-DLeT0daB.js → index-D1MTUO-6.js} +1 -1
  46. package/assets/{index-jWDkqT86.js → index-D5iDb6Zh.js} +1 -1
  47. package/assets/{index-CkqxpDor.js → index-DC000vnB.js} +1 -1
  48. package/assets/{index-DEOnLFa_.js → index-DE00DX4x.js} +1 -1
  49. package/assets/{index-DakGfqsI.js → index-DFt6vA57.js} +1 -1
  50. package/assets/{index-D49q6WGA.js → index-DI_s4PrA.js} +2 -2
  51. package/assets/{index-CjjDbqo4.js → index-DMqjKNId.js} +1 -1
  52. package/assets/{index-BweHqCOo.js → index-DSE85PpW.js} +1 -1
  53. package/assets/{index-C2UIKTrX.js → index-D_03GM3Y.js} +1 -1
  54. package/assets/{index-DS2iQg6a.js → index-DcLOFQTk.js} +1 -1
  55. package/assets/{index-B8nye65f.js → index-DpMWOALf.js} +1 -1
  56. package/assets/{index-DnBgsYoI.js → index-Dq-8kq1Q.js} +1 -1
  57. package/assets/{index-Bra3n__0.js → index-S6mWvNtu.js} +1 -1
  58. package/assets/{index-D-Gi1xqQ.css → index-cm07hpEZ.css} +1 -1
  59. package/assets/{index-C8EawR99.js → index-iemeyF3Y.js} +1 -1
  60. package/assets/{index-CbpSQeXJ.js → index-ruFKM5IP.js} +1 -1
  61. package/assets/{index-ScXWC0Jt.js → index-t2VitGAA.js} +1 -1
  62. package/assets/{networks-Dx008HDB.js → networks-uu1z4SLN.js} +1 -1
  63. package/assets/{onramp-DAfqSdz3.js → onramp-DXS9iVuL.js} +1 -1
  64. package/assets/{openzeppelin-RFJtpOPp.js → openzeppelin-XDDUGfZO.js} +1 -1
  65. package/assets/{parse-typed-data-CeBP6yRt.js → parse-typed-data-D3ICG98X.js} +1 -1
  66. package/assets/{passkeys-ClpdZWDM.js → passkeys-CrH5Perh.js} +1 -1
  67. package/assets/{pay-with-exchange-C3MPUeD5.js → pay-with-exchange-BsB7KjQN.js} +1 -1
  68. package/assets/{receive-BFNtpKSU.js → receive-CZi4NBWz.js} +1 -1
  69. package/assets/{ref-DRpZWoiw.js → ref-KeBo7-wj.js} +1 -1
  70. package/assets/{resolveImplementation-DK2K0lJ_.js → resolveImplementation-DjUin-DW.js} +1 -1
  71. package/assets/{secp256k1-Dh4RTaBk.js → secp256k1-Df41lYXE.js} +1 -1
  72. package/assets/{send-aGoY5205.js → send-Dm6fxwX2.js} +1 -1
  73. package/assets/{send-eip712-transaction-B4cvY0rg.js → send-eip712-transaction-DFFONYGB.js} +1 -1
  74. package/assets/{send-gasless-transaction-Z1S87mrB.js → send-gasless-transaction-Cgbp-iMa.js} +2 -2
  75. package/assets/{socials-B8rog-mv.js → socials-DP3qhYJY.js} +1 -1
  76. package/assets/{swaps-H6bxSDcj.js → swaps-BTGByrFF.js} +1 -1
  77. package/assets/{thirdweb-CFgFLofm.js → thirdweb-C3Q9twFA.js} +3 -3
  78. package/assets/{transactions-DQHNvOVJ.js → transactions-BxJbW7b-.js} +1 -1
  79. package/assets/{ui-BnnR-c2T.js → ui-C_t4j8DL.js} +5 -5
  80. package/assets/{vendor-D-D-PWUq.js → vendor-BzW03oEY.js} +1 -1
  81. package/assets/{w3m-modal-CuGUSMxH.js → w3m-modal-CzhIDSVI.js} +1 -1
  82. package/assets/{web-connector-DMMtXI4x.js → web-connector-DAPSEaMX.js} +3 -3
  83. package/index.html +5 -5
  84. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PhArrowCircleDown-B305t-Sh.js","assets/property-C9JG5tag.js","assets/PhArrowClockwise-CJPxQhr_.js","assets/PhArrowDown-C4hT9BVu.js","assets/PhArrowLeft-Way4Cu-r.js","assets/PhArrowRight-Cp5ZME0F.js","assets/PhArrowSquareOut-NnrK69c5.js","assets/PhArrowsDownUp-BjBI4ckC.js","assets/PhArrowsLeftRight-CuLpbKRk.js","assets/PhArrowUp-Dph6j8rm.js","assets/PhArrowUpRight-BpJjRRRh.js","assets/PhArrowsClockwise-CFUT8X7R.js","assets/PhBank-Dchr4XQJ.js","assets/PhBrowser-dUu2TrC1.js","assets/PhCaretDown-78IuKU3V.js","assets/PhCaretLeft-_aiyH7n1.js","assets/PhCaretRight-8zJQEuDX.js","assets/PhCaretUp-CiCxKWwN.js","assets/PhCheck-CcADx8br.js","assets/PhCircleHalf-BYzSzd2h.js","assets/PhClock-UItiXeJq.js","assets/PhCompass-CUy3uA7t.js","assets/PhCopy-C-PDgSlZ.js","assets/PhCreditCard-CWRaUT6F.js","assets/PhCurrencyDollar-Cqla3AXT.js","assets/PhDesktop-BBIPrYLl.js","assets/PhDeviceMobile-BdsPaATg.js","assets/PhDotsThree-BMXCQl-0.js","assets/PhVault-l2PHF38a.js","assets/PhEnvelope-yUsis6yU.js","assets/PhFunnelSimple-Ba7BbWTp.js","assets/PhGlobe-DgLxBk5U.js","assets/PhIdentificationCard-Czjmq9Z3.js","assets/PhImage-BAJ_erz6.js","assets/PhInfo-Cr4DhVUE.js","assets/PhLightbulb-BX_7duTr.js","assets/PhMagnifyingGlass-Mygfryvz.js","assets/PhPaperPlaneRight-BeuCA660.js","assets/PhPlus-BMjcHjsT.js","assets/PhPower-CGffGmdb.js","assets/PhPuzzlePiece-wm_GpVSi.js","assets/PhQrCode-DRwRzXCH.js","assets/PhQuestion-M09j2U0T.js","assets/PhQuestionMark-BP9EMB6h.js","assets/PhSealCheck-BfG80yKn.js","assets/PhSignOut-C5YOWlPT.js","assets/PhSpinner-BXooDYzU.js","assets/PhTrash-Biq6rmmL.js","assets/PhUser-CAgZSpGe.js","assets/PhWallet-w25D16It.js","assets/PhWarning-DPEydIPw.js","assets/PhWarningCircle-BqjT745H.js","assets/PhX-s-SmVExa.js"])))=>i.map(i=>d[i]);
2
- import{ad as A,ae as T,t as V,r as y,o as x,q as E,I as s,v as g,af as I,m as Z}from"./index-Dqt7thvX.js";import{_ as l}from"./thirdweb-CFgFLofm.js";const L=".",v={getSpacingStyles(t,e){if(Array.isArray(t))return t[e]?`var(--apkt-spacing-${t[e]})`:void 0;if(typeof t=="string")return`var(--apkt-spacing-${t})`},getFormattedDate(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(t)},formatCurrency(t=0,e={}){const i=Number(t);return isNaN(i)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2,...e}).format(i)},getHostName(t){try{return new URL(t).hostname}catch{return""}},getTruncateString({string:t,charsStart:e,charsEnd:i,truncate:o}){return t.length<=e+i?t:o==="end"?`${t.substring(0,e)}...`:o==="start"?`...${t.substring(t.length-i)}`:`${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(i))}`},generateAvatarColors(t){const i=t.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),o=this.hexToRgb(i),n=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),a=100-3*Number(n==null?void 0:n.replace("px","")),h=`${a}% ${a}% at 65% 40%`,p=[];for(let d=0;d<5;d+=1){const m=this.tintColor(o,.15*d);p.push(`rgb(${m[0]}, ${m[1]}, ${m[2]})`)}return`
2
+ import{ad as A,ae as T,t as V,r as y,o as x,q as E,I as s,v as g,af as I,m as Z}from"./index-BTv8siy7.js";import{_ as l}from"./thirdweb-C3Q9twFA.js";const L=".",v={getSpacingStyles(t,e){if(Array.isArray(t))return t[e]?`var(--apkt-spacing-${t[e]})`:void 0;if(typeof t=="string")return`var(--apkt-spacing-${t})`},getFormattedDate(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(t)},formatCurrency(t=0,e={}){const i=Number(t);return isNaN(i)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2,...e}).format(i)},getHostName(t){try{return new URL(t).hostname}catch{return""}},getTruncateString({string:t,charsStart:e,charsEnd:i,truncate:o}){return t.length<=e+i?t:o==="end"?`${t.substring(0,e)}...`:o==="start"?`...${t.substring(t.length-i)}`:`${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(i))}`},generateAvatarColors(t){const i=t.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),o=this.hexToRgb(i),n=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),a=100-3*Number(n==null?void 0:n.replace("px","")),h=`${a}% ${a}% at 65% 40%`,p=[];for(let d=0;d<5;d+=1){const m=this.tintColor(o,.15*d);p.push(`rgb(${m[0]}, ${m[1]}, ${m[2]})`)}return`
3
3
  --local-color-1: ${p[0]};
4
4
  --local-color-2: ${p[1]};
5
5
  --local-color-3: ${p[2]};
@@ -1,4 +1,4 @@
1
- import{m as oe,o as se,q as w,r as Ce,C as pe,ac as F,a as xe,R as Fe,O as Re,E as Ne,y as Le,W as je}from"./index-Dqt7thvX.js";import{U as Te,n as I,r as Q,c as ae}from"./index-BWY5rLcb.js";import{g as ye}from"./thirdweb-CFgFLofm.js";import"./index-BCi3Crpp.js";import"./index-C2UIKTrX.js";import{o as ke}from"./if-defined-BFxH3C3I.js";import"./index-rgwfH8yu.js";import"./index-BirZA6-V.js";var me={exports:{}},ze=me.exports,Ie;function Ue(){return Ie||(Ie=1,function(e,t){(function(i,r){e.exports=r()})(ze,function(){var i=1e3,r=6e4,o=36e5,n="millisecond",s="second",u="minute",g="hour",p="day",y="week",$="month",j="quarter",D="year",R="date",Y="Invalid Date",X=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,ee=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,te={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(h){var l=["th","st","nd","rd"],a=h%100;return"["+h+(l[(a-20)%10]||l[a]||l[0])+"]"}},ie=function(h,l,a){var d=String(h);return!d||d.length>=l?h:""+Array(l+1-d.length).join(a)+h},q={s:ie,z:function(h){var l=-h.utcOffset(),a=Math.abs(l),d=Math.floor(a/60),c=a%60;return(l<=0?"+":"-")+ie(d,2,"0")+":"+ie(c,2,"0")},m:function h(l,a){if(l.date()<a.date())return-h(a,l);var d=12*(a.year()-l.year())+(a.month()-l.month()),c=l.clone().add(d,$),m=a-c<0,f=l.clone().add(d+(m?-1:1),$);return+(-(d+(a-c)/(m?c-f:f-c))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:$,y:D,w:y,d:p,D:R,h:g,m:u,s,ms:n,Q:j}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},S="en",O={};O[S]=te;var V="$isDayjsObject",B=function(h){return h instanceof le||!(!h||!h[V])},ce=function h(l,a,d){var c;if(!l)return S;if(typeof l=="string"){var m=l.toLowerCase();O[m]&&(c=m),a&&(O[m]=a,c=m);var f=l.split("-");if(!c&&f.length>1)return h(f[0])}else{var v=l.name;O[v]=l,c=v}return!d&&c&&(S=c),c||!d&&S},_=function(h,l){if(B(h))return h.clone();var a=typeof l=="object"?l:{};return a.date=h,a.args=arguments,new le(a)},x=q;x.l=ce,x.i=B,x.w=function(h,l){return _(h,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var le=function(){function h(a){this.$L=ce(a.locale,null,!0),this.parse(a),this.$x=this.$x||a.x||{},this[V]=!0}var l=h.prototype;return l.parse=function(a){this.$d=function(d){var c=d.date,m=d.utc;if(c===null)return new Date(NaN);if(x.u(c))return new Date;if(c instanceof Date)return new Date(c);if(typeof c=="string"&&!/Z$/i.test(c)){var f=c.match(X);if(f){var v=f[2]-1||0,b=(f[7]||"0").substring(0,3);return m?new Date(Date.UTC(f[1],v,f[3]||1,f[4]||0,f[5]||0,f[6]||0,b)):new Date(f[1],v,f[3]||1,f[4]||0,f[5]||0,f[6]||0,b)}}return new Date(c)}(a),this.init()},l.init=function(){var a=this.$d;this.$y=a.getFullYear(),this.$M=a.getMonth(),this.$D=a.getDate(),this.$W=a.getDay(),this.$H=a.getHours(),this.$m=a.getMinutes(),this.$s=a.getSeconds(),this.$ms=a.getMilliseconds()},l.$utils=function(){return x},l.isValid=function(){return this.$d.toString()!==Y},l.isSame=function(a,d){var c=_(a);return this.startOf(d)<=c&&c<=this.endOf(d)},l.isAfter=function(a,d){return _(a)<this.startOf(d)},l.isBefore=function(a,d){return this.endOf(d)<_(a)},l.$g=function(a,d,c){return x.u(a)?this[d]:this.set(c,a)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(a,d){var c=this,m=!!x.u(d)||d,f=x.p(a),v=function(P,A){var z=x.w(c.$u?Date.UTC(c.$y,A,P):new Date(c.$y,A,P),c);return m?z:z.endOf(p)},b=function(P,A){return x.w(c.toDate()[P].apply(c.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(A)),c)},T=this.$W,M=this.$M,C=this.$D,J="set"+(this.$u?"UTC":"");switch(f){case D:return m?v(1,0):v(31,11);case $:return m?v(1,M):v(0,M+1);case y:var W=this.$locale().weekStart||0,re=(T<W?T+7:T)-W;return v(m?C-re:C+(6-re),M);case p:case R:return b(J+"Hours",0);case g:return b(J+"Minutes",1);case u:return b(J+"Seconds",2);case s:return b(J+"Milliseconds",3);default:return this.clone()}},l.endOf=function(a){return this.startOf(a,!1)},l.$set=function(a,d){var c,m=x.p(a),f="set"+(this.$u?"UTC":""),v=(c={},c[p]=f+"Date",c[R]=f+"Date",c[$]=f+"Month",c[D]=f+"FullYear",c[g]=f+"Hours",c[u]=f+"Minutes",c[s]=f+"Seconds",c[n]=f+"Milliseconds",c)[m],b=m===p?this.$D+(d-this.$W):d;if(m===$||m===D){var T=this.clone().set(R,1);T.$d[v](b),T.init(),this.$d=T.set(R,Math.min(this.$D,T.daysInMonth())).$d}else v&&this.$d[v](b);return this.init(),this},l.set=function(a,d){return this.clone().$set(a,d)},l.get=function(a){return this[x.p(a)]()},l.add=function(a,d){var c,m=this;a=Number(a);var f=x.p(d),v=function(M){var C=_(m);return x.w(C.date(C.date()+Math.round(M*a)),m)};if(f===$)return this.set($,this.$M+a);if(f===D)return this.set(D,this.$y+a);if(f===p)return v(1);if(f===y)return v(7);var b=(c={},c[u]=r,c[g]=o,c[s]=i,c)[f]||1,T=this.$d.getTime()+a*b;return x.w(T,this)},l.subtract=function(a,d){return this.add(-1*a,d)},l.format=function(a){var d=this,c=this.$locale();if(!this.isValid())return c.invalidDate||Y;var m=a||"YYYY-MM-DDTHH:mm:ssZ",f=x.z(this),v=this.$H,b=this.$m,T=this.$M,M=c.weekdays,C=c.months,J=c.meridiem,W=function(A,z,ne,de){return A&&(A[z]||A(d,m))||ne[z].slice(0,de)},re=function(A){return x.s(v%12||12,A,"0")},P=J||function(A,z,ne){var de=A<12?"AM":"PM";return ne?de.toLowerCase():de};return m.replace(ee,function(A,z){return z||function(ne){switch(ne){case"YY":return String(d.$y).slice(-2);case"YYYY":return x.s(d.$y,4,"0");case"M":return T+1;case"MM":return x.s(T+1,2,"0");case"MMM":return W(c.monthsShort,T,C,3);case"MMMM":return W(C,T);case"D":return d.$D;case"DD":return x.s(d.$D,2,"0");case"d":return String(d.$W);case"dd":return W(c.weekdaysMin,d.$W,M,2);case"ddd":return W(c.weekdaysShort,d.$W,M,3);case"dddd":return M[d.$W];case"H":return String(v);case"HH":return x.s(v,2,"0");case"h":return re(1);case"hh":return re(2);case"a":return P(v,b,!0);case"A":return P(v,b,!1);case"m":return String(b);case"mm":return x.s(b,2,"0");case"s":return String(d.$s);case"ss":return x.s(d.$s,2,"0");case"SSS":return x.s(d.$ms,3,"0");case"Z":return f}return null}(A)||f.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(a,d,c){var m,f=this,v=x.p(d),b=_(a),T=(b.utcOffset()-this.utcOffset())*r,M=this-b,C=function(){return x.m(f,b)};switch(v){case D:m=C()/12;break;case $:m=C();break;case j:m=C()/3;break;case y:m=(M-T)/6048e5;break;case p:m=(M-T)/864e5;break;case g:m=M/o;break;case u:m=M/r;break;case s:m=M/i;break;default:m=M}return c?m:x.a(m)},l.daysInMonth=function(){return this.endOf($).$D},l.$locale=function(){return O[this.$L]},l.locale=function(a,d){if(!a)return this.$L;var c=this.clone(),m=ce(a,d,!0);return m&&(c.$L=m),c},l.clone=function(){return x.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},h}(),_e=le.prototype;return _.prototype=_e,[["$ms",n],["$s",s],["$m",u],["$H",g],["$W",p],["$M",$],["$y",D],["$D",R]].forEach(function(h){_e[h[1]]=function(l){return this.$g(l,h[0],h[1])}}),_.extend=function(h,l){return h.$i||(h(l,le,_),h.$i=!0),_},_.locale=ce,_.isDayjs=B,_.unix=function(h){return _(1e3*h)},_.en=O[S],_.Ls=O,_.p={},_})}(me)),me.exports}var Ee=Ue();const K=ye(Ee);var fe={exports:{}},Ye=fe.exports,Me;function qe(){return Me||(Me=1,function(e,t){(function(i,r){e.exports=r()})(Ye,function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(i){var r=["th","st","nd","rd"],o=i%100;return"["+i+(r[(o-20)%10]||r[o]||r[0])+"]"}}})}(fe)),fe.exports}var Be=qe();const We=ye(Be);var ge={exports:{}},Pe=ge.exports,Se;function He(){return Se||(Se=1,function(e,t){(function(i,r){e.exports=r()})(Pe,function(){return function(i,r,o){i=i||{};var n=r.prototype,s={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(p,y,$,j){return n.fromToBase(p,y,$,j)}o.en.relativeTime=s,n.fromToBase=function(p,y,$,j,D){for(var R,Y,X,ee=$.$locale().relativeTime||s,te=i.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],ie=te.length,q=0;q<ie;q+=1){var S=te[q];S.d&&(R=j?o(p).diff($,S.d,!0):$.diff(p,S.d,!0));var O=(i.rounding||Math.round)(Math.abs(R));if(X=R>0,O<=S.r||!S.r){O<=1&&q>0&&(S=te[q-1]);var V=ee[S.l];D&&(O=D(""+O)),Y=typeof V=="string"?V.replace("%d",O):V(O,y,S.l,X);break}}if(y)return Y;var B=X?ee.future:ee.past;return typeof B=="function"?B(Y):B.replace("%s",Y)},n.to=function(p,y){return u(p,y,this,!0)},n.from=function(p,y){return u(p,y,this)};var g=function(p){return p.$u?o.utc():o()};n.toNow=function(p){return this.to(g(this),p)},n.fromNow=function(p){return this.from(g(this),p)}}})}(ge)),ge.exports}var Ge=He();const Ve=ye(Ge);var we={exports:{}},Je=we.exports,Oe;function Ze(){return Oe||(Oe=1,function(e,t){(function(i,r){e.exports=r()})(Je,function(){return function(i,r,o){o.updateLocale=function(n,s){var u=o.Ls[n];if(u)return(s?Object.keys(s):[]).forEach(function(g){u[g]=s[g]}),u}}})}(we)),we.exports}var Ke=Ze();const Qe=ye(Ke);K.extend(Ve);K.extend(Qe);const Xe={...We,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}},et=["January","February","March","April","May","June","July","August","September","October","November","December"];K.locale("en-web3-modal",Xe);const $e={getMonthNameByIndex(e){return et[e]},getYear(e=new Date().toISOString()){return K(e).year()},getRelativeDateFromNow(e){return K(e).locale("en-web3-modal").fromNow(!0)},formatDate(e,t="DD MMM"){return K(e).format(t)}},tt=3,he=.1,it=["receive","deposit","borrow","claim"],rt=["withdraw","repay","burn"],Z={getTransactionGroupTitle(e,t){const i=$e.getYear(),r=$e.getMonthNameByIndex(t);return e===i?r:`${r} ${e}`},getTransactionImages(e){const[t]=e;return(e==null?void 0:e.length)>1?e.map(r=>this.getTransactionImage(r)):[this.getTransactionImage(t)]},getTransactionImage(e){return{type:Z.getTransactionTransferTokenType(e),url:Z.getTransactionImageURL(e)}},getTransactionImageURL(e){var o,n,s,u,g;let t;const i=!!(e!=null&&e.nft_info),r=!!(e!=null&&e.fungible_info);return e&&i?t=(s=(n=(o=e==null?void 0:e.nft_info)==null?void 0:o.content)==null?void 0:n.preview)==null?void 0:s.url:e&&r&&(t=(g=(u=e==null?void 0:e.fungible_info)==null?void 0:u.icon)==null?void 0:g.url),t},getTransactionTransferTokenType(e){if(e!=null&&e.fungible_info)return"FUNGIBLE";if(e!=null&&e.nft_info)return"NFT"},getTransactionDescriptions(e,t){var j;const i=(j=e==null?void 0:e.metadata)==null?void 0:j.operationType,r=t||(e==null?void 0:e.transfers),o=r&&r.length>0,n=r&&r.length>1,s=o&&r.every(D=>!!(D!=null&&D.fungible_info)),[u,g]=r||[];let p=this.getTransferDescription(u),y=this.getTransferDescription(g);if(!o)return(i==="send"||i==="receive")&&s?(p=Te.getTruncateString({string:e==null?void 0:e.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),y=Te.getTruncateString({string:e==null?void 0:e.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"}),[p,y]):[e.metadata.status];if(n)return r==null?void 0:r.map(D=>this.getTransferDescription(D));let $="";return it.includes(i)?$="+":rt.includes(i)&&($="-"),p=$.concat(p),[p]},getTransferDescription(e){var i;let t="";return e&&(e!=null&&e.nft_info?t=((i=e==null?void 0:e.nft_info)==null?void 0:i.name)||"-":e!=null&&e.fungible_info&&(t=this.getFungibleTransferDescription(e)||"-")),t},getFungibleTransferDescription(e){var r;return e?[this.getQuantityFixedValue(e==null?void 0:e.quantity.numeric),(r=e==null?void 0:e.fungible_info)==null?void 0:r.symbol].join(" ").trim():null},mergeTransfers(e){if((e==null?void 0:e.length)<=1)return e;const i=this.filterGasFeeTransfers(e).reduce((o,n)=>{var g;const s=(g=n==null?void 0:n.fungible_info)==null?void 0:g.name,u=o.find(({fungible_info:p,direction:y})=>s&&s===(p==null?void 0:p.name)&&y===n.direction);if(u){const p=Number(u.quantity.numeric)+Number(n.quantity.numeric);u.quantity.numeric=p.toString(),u.value=(u.value||0)+(n.value||0)}else o.push(n);return o},[]);let r=i;return i.length>2&&(r=i.sort((o,n)=>(n.value||0)-(o.value||0)).slice(0,2)),r=r.sort((o,n)=>o.direction==="out"&&n.direction==="in"?-1:o.direction==="in"&&n.direction==="out"?1:0),r},filterGasFeeTransfers(e){const t=e==null?void 0:e.reduce((r,o)=>{var s;const n=(s=o==null?void 0:o.fungible_info)==null?void 0:s.name;return n&&(r[n]||(r[n]=[]),r[n].push(o)),r},{}),i=[];return Object.values(t??{}).forEach(r=>{if(r.length===1){const o=r[0];o&&i.push(o)}else{const o=r.filter(s=>s.direction==="in"),n=r.filter(s=>s.direction==="out");if(o.length===1&&n.length===1){const s=o[0],u=n[0];let g=!1;if(s&&u){const p=Number(s.quantity.numeric),y=Number(u.quantity.numeric);y<p*he?(i.push(s),g=!0):p<y*he&&(i.push(u),g=!0)}g||i.push(...r)}else{const s=this.filterGasFeesFromTokenGroup(r);i.push(...s)}}}),e==null||e.forEach(r=>{var o;(o=r==null?void 0:r.fungible_info)!=null&&o.name||i.push(r)}),i},filterGasFeesFromTokenGroup(e){if(e.length<=1)return e;const t=e==null?void 0:e.map(u=>Number(u.quantity.numeric)),i=Math.max(...t),r=Math.min(...t),o=.01;if(r<i*o)return e==null?void 0:e.filter(g=>Number(g.quantity.numeric)>=i*o);const n=e==null?void 0:e.filter(u=>u.direction==="in"),s=e==null?void 0:e.filter(u=>u.direction==="out");if(n.length===1&&s.length===1){const u=n[0],g=s[0];if(u&&g){const p=Number(u.quantity.numeric),y=Number(g.quantity.numeric);if(y<p*he)return[u];if(p<y*he)return[g]}}return e},getQuantityFixedValue(e){return e?parseFloat(e).toFixed(tt):null}};var be;(function(e){e.approve="approved",e.bought="bought",e.borrow="borrowed",e.burn="burnt",e.cancel="canceled",e.claim="claimed",e.deploy="deployed",e.deposit="deposited",e.execute="executed",e.mint="minted",e.receive="received",e.repay="repaid",e.send="sent",e.sell="sold",e.stake="staked",e.trade="swapped",e.unstake="unstaked",e.withdraw="withdrawn"})(be||(be={}));const nt=oe`
1
+ import{m as oe,o as se,q as w,r as Ce,C as pe,ac as F,a as xe,R as Fe,O as Re,E as Ne,y as Le,W as je}from"./index-BTv8siy7.js";import{U as Te,n as I,r as Q,c as ae}from"./index-BbJ97fLK.js";import{g as ye}from"./thirdweb-C3Q9twFA.js";import"./index-CKiFyUbS.js";import"./index-D_03GM3Y.js";import{o as ke}from"./if-defined-Dw-S0ise.js";import"./index-B8LZftfz.js";import"./index-CUmC4Xrt.js";var me={exports:{}},ze=me.exports,Ie;function Ue(){return Ie||(Ie=1,function(e,t){(function(i,r){e.exports=r()})(ze,function(){var i=1e3,r=6e4,o=36e5,n="millisecond",s="second",u="minute",g="hour",p="day",y="week",$="month",j="quarter",D="year",R="date",Y="Invalid Date",X=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,ee=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,te={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(h){var l=["th","st","nd","rd"],a=h%100;return"["+h+(l[(a-20)%10]||l[a]||l[0])+"]"}},ie=function(h,l,a){var d=String(h);return!d||d.length>=l?h:""+Array(l+1-d.length).join(a)+h},q={s:ie,z:function(h){var l=-h.utcOffset(),a=Math.abs(l),d=Math.floor(a/60),c=a%60;return(l<=0?"+":"-")+ie(d,2,"0")+":"+ie(c,2,"0")},m:function h(l,a){if(l.date()<a.date())return-h(a,l);var d=12*(a.year()-l.year())+(a.month()-l.month()),c=l.clone().add(d,$),m=a-c<0,f=l.clone().add(d+(m?-1:1),$);return+(-(d+(a-c)/(m?c-f:f-c))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:$,y:D,w:y,d:p,D:R,h:g,m:u,s,ms:n,Q:j}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},S="en",O={};O[S]=te;var V="$isDayjsObject",B=function(h){return h instanceof le||!(!h||!h[V])},ce=function h(l,a,d){var c;if(!l)return S;if(typeof l=="string"){var m=l.toLowerCase();O[m]&&(c=m),a&&(O[m]=a,c=m);var f=l.split("-");if(!c&&f.length>1)return h(f[0])}else{var v=l.name;O[v]=l,c=v}return!d&&c&&(S=c),c||!d&&S},_=function(h,l){if(B(h))return h.clone();var a=typeof l=="object"?l:{};return a.date=h,a.args=arguments,new le(a)},x=q;x.l=ce,x.i=B,x.w=function(h,l){return _(h,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var le=function(){function h(a){this.$L=ce(a.locale,null,!0),this.parse(a),this.$x=this.$x||a.x||{},this[V]=!0}var l=h.prototype;return l.parse=function(a){this.$d=function(d){var c=d.date,m=d.utc;if(c===null)return new Date(NaN);if(x.u(c))return new Date;if(c instanceof Date)return new Date(c);if(typeof c=="string"&&!/Z$/i.test(c)){var f=c.match(X);if(f){var v=f[2]-1||0,b=(f[7]||"0").substring(0,3);return m?new Date(Date.UTC(f[1],v,f[3]||1,f[4]||0,f[5]||0,f[6]||0,b)):new Date(f[1],v,f[3]||1,f[4]||0,f[5]||0,f[6]||0,b)}}return new Date(c)}(a),this.init()},l.init=function(){var a=this.$d;this.$y=a.getFullYear(),this.$M=a.getMonth(),this.$D=a.getDate(),this.$W=a.getDay(),this.$H=a.getHours(),this.$m=a.getMinutes(),this.$s=a.getSeconds(),this.$ms=a.getMilliseconds()},l.$utils=function(){return x},l.isValid=function(){return this.$d.toString()!==Y},l.isSame=function(a,d){var c=_(a);return this.startOf(d)<=c&&c<=this.endOf(d)},l.isAfter=function(a,d){return _(a)<this.startOf(d)},l.isBefore=function(a,d){return this.endOf(d)<_(a)},l.$g=function(a,d,c){return x.u(a)?this[d]:this.set(c,a)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(a,d){var c=this,m=!!x.u(d)||d,f=x.p(a),v=function(P,A){var z=x.w(c.$u?Date.UTC(c.$y,A,P):new Date(c.$y,A,P),c);return m?z:z.endOf(p)},b=function(P,A){return x.w(c.toDate()[P].apply(c.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(A)),c)},T=this.$W,M=this.$M,C=this.$D,J="set"+(this.$u?"UTC":"");switch(f){case D:return m?v(1,0):v(31,11);case $:return m?v(1,M):v(0,M+1);case y:var W=this.$locale().weekStart||0,re=(T<W?T+7:T)-W;return v(m?C-re:C+(6-re),M);case p:case R:return b(J+"Hours",0);case g:return b(J+"Minutes",1);case u:return b(J+"Seconds",2);case s:return b(J+"Milliseconds",3);default:return this.clone()}},l.endOf=function(a){return this.startOf(a,!1)},l.$set=function(a,d){var c,m=x.p(a),f="set"+(this.$u?"UTC":""),v=(c={},c[p]=f+"Date",c[R]=f+"Date",c[$]=f+"Month",c[D]=f+"FullYear",c[g]=f+"Hours",c[u]=f+"Minutes",c[s]=f+"Seconds",c[n]=f+"Milliseconds",c)[m],b=m===p?this.$D+(d-this.$W):d;if(m===$||m===D){var T=this.clone().set(R,1);T.$d[v](b),T.init(),this.$d=T.set(R,Math.min(this.$D,T.daysInMonth())).$d}else v&&this.$d[v](b);return this.init(),this},l.set=function(a,d){return this.clone().$set(a,d)},l.get=function(a){return this[x.p(a)]()},l.add=function(a,d){var c,m=this;a=Number(a);var f=x.p(d),v=function(M){var C=_(m);return x.w(C.date(C.date()+Math.round(M*a)),m)};if(f===$)return this.set($,this.$M+a);if(f===D)return this.set(D,this.$y+a);if(f===p)return v(1);if(f===y)return v(7);var b=(c={},c[u]=r,c[g]=o,c[s]=i,c)[f]||1,T=this.$d.getTime()+a*b;return x.w(T,this)},l.subtract=function(a,d){return this.add(-1*a,d)},l.format=function(a){var d=this,c=this.$locale();if(!this.isValid())return c.invalidDate||Y;var m=a||"YYYY-MM-DDTHH:mm:ssZ",f=x.z(this),v=this.$H,b=this.$m,T=this.$M,M=c.weekdays,C=c.months,J=c.meridiem,W=function(A,z,ne,de){return A&&(A[z]||A(d,m))||ne[z].slice(0,de)},re=function(A){return x.s(v%12||12,A,"0")},P=J||function(A,z,ne){var de=A<12?"AM":"PM";return ne?de.toLowerCase():de};return m.replace(ee,function(A,z){return z||function(ne){switch(ne){case"YY":return String(d.$y).slice(-2);case"YYYY":return x.s(d.$y,4,"0");case"M":return T+1;case"MM":return x.s(T+1,2,"0");case"MMM":return W(c.monthsShort,T,C,3);case"MMMM":return W(C,T);case"D":return d.$D;case"DD":return x.s(d.$D,2,"0");case"d":return String(d.$W);case"dd":return W(c.weekdaysMin,d.$W,M,2);case"ddd":return W(c.weekdaysShort,d.$W,M,3);case"dddd":return M[d.$W];case"H":return String(v);case"HH":return x.s(v,2,"0");case"h":return re(1);case"hh":return re(2);case"a":return P(v,b,!0);case"A":return P(v,b,!1);case"m":return String(b);case"mm":return x.s(b,2,"0");case"s":return String(d.$s);case"ss":return x.s(d.$s,2,"0");case"SSS":return x.s(d.$ms,3,"0");case"Z":return f}return null}(A)||f.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(a,d,c){var m,f=this,v=x.p(d),b=_(a),T=(b.utcOffset()-this.utcOffset())*r,M=this-b,C=function(){return x.m(f,b)};switch(v){case D:m=C()/12;break;case $:m=C();break;case j:m=C()/3;break;case y:m=(M-T)/6048e5;break;case p:m=(M-T)/864e5;break;case g:m=M/o;break;case u:m=M/r;break;case s:m=M/i;break;default:m=M}return c?m:x.a(m)},l.daysInMonth=function(){return this.endOf($).$D},l.$locale=function(){return O[this.$L]},l.locale=function(a,d){if(!a)return this.$L;var c=this.clone(),m=ce(a,d,!0);return m&&(c.$L=m),c},l.clone=function(){return x.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},h}(),_e=le.prototype;return _.prototype=_e,[["$ms",n],["$s",s],["$m",u],["$H",g],["$W",p],["$M",$],["$y",D],["$D",R]].forEach(function(h){_e[h[1]]=function(l){return this.$g(l,h[0],h[1])}}),_.extend=function(h,l){return h.$i||(h(l,le,_),h.$i=!0),_},_.locale=ce,_.isDayjs=B,_.unix=function(h){return _(1e3*h)},_.en=O[S],_.Ls=O,_.p={},_})}(me)),me.exports}var Ee=Ue();const K=ye(Ee);var fe={exports:{}},Ye=fe.exports,Me;function qe(){return Me||(Me=1,function(e,t){(function(i,r){e.exports=r()})(Ye,function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(i){var r=["th","st","nd","rd"],o=i%100;return"["+i+(r[(o-20)%10]||r[o]||r[0])+"]"}}})}(fe)),fe.exports}var Be=qe();const We=ye(Be);var ge={exports:{}},Pe=ge.exports,Se;function He(){return Se||(Se=1,function(e,t){(function(i,r){e.exports=r()})(Pe,function(){return function(i,r,o){i=i||{};var n=r.prototype,s={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(p,y,$,j){return n.fromToBase(p,y,$,j)}o.en.relativeTime=s,n.fromToBase=function(p,y,$,j,D){for(var R,Y,X,ee=$.$locale().relativeTime||s,te=i.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],ie=te.length,q=0;q<ie;q+=1){var S=te[q];S.d&&(R=j?o(p).diff($,S.d,!0):$.diff(p,S.d,!0));var O=(i.rounding||Math.round)(Math.abs(R));if(X=R>0,O<=S.r||!S.r){O<=1&&q>0&&(S=te[q-1]);var V=ee[S.l];D&&(O=D(""+O)),Y=typeof V=="string"?V.replace("%d",O):V(O,y,S.l,X);break}}if(y)return Y;var B=X?ee.future:ee.past;return typeof B=="function"?B(Y):B.replace("%s",Y)},n.to=function(p,y){return u(p,y,this,!0)},n.from=function(p,y){return u(p,y,this)};var g=function(p){return p.$u?o.utc():o()};n.toNow=function(p){return this.to(g(this),p)},n.fromNow=function(p){return this.from(g(this),p)}}})}(ge)),ge.exports}var Ge=He();const Ve=ye(Ge);var we={exports:{}},Je=we.exports,Oe;function Ze(){return Oe||(Oe=1,function(e,t){(function(i,r){e.exports=r()})(Je,function(){return function(i,r,o){o.updateLocale=function(n,s){var u=o.Ls[n];if(u)return(s?Object.keys(s):[]).forEach(function(g){u[g]=s[g]}),u}}})}(we)),we.exports}var Ke=Ze();const Qe=ye(Ke);K.extend(Ve);K.extend(Qe);const Xe={...We,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}},et=["January","February","March","April","May","June","July","August","September","October","November","December"];K.locale("en-web3-modal",Xe);const $e={getMonthNameByIndex(e){return et[e]},getYear(e=new Date().toISOString()){return K(e).year()},getRelativeDateFromNow(e){return K(e).locale("en-web3-modal").fromNow(!0)},formatDate(e,t="DD MMM"){return K(e).format(t)}},tt=3,he=.1,it=["receive","deposit","borrow","claim"],rt=["withdraw","repay","burn"],Z={getTransactionGroupTitle(e,t){const i=$e.getYear(),r=$e.getMonthNameByIndex(t);return e===i?r:`${r} ${e}`},getTransactionImages(e){const[t]=e;return(e==null?void 0:e.length)>1?e.map(r=>this.getTransactionImage(r)):[this.getTransactionImage(t)]},getTransactionImage(e){return{type:Z.getTransactionTransferTokenType(e),url:Z.getTransactionImageURL(e)}},getTransactionImageURL(e){var o,n,s,u,g;let t;const i=!!(e!=null&&e.nft_info),r=!!(e!=null&&e.fungible_info);return e&&i?t=(s=(n=(o=e==null?void 0:e.nft_info)==null?void 0:o.content)==null?void 0:n.preview)==null?void 0:s.url:e&&r&&(t=(g=(u=e==null?void 0:e.fungible_info)==null?void 0:u.icon)==null?void 0:g.url),t},getTransactionTransferTokenType(e){if(e!=null&&e.fungible_info)return"FUNGIBLE";if(e!=null&&e.nft_info)return"NFT"},getTransactionDescriptions(e,t){var j;const i=(j=e==null?void 0:e.metadata)==null?void 0:j.operationType,r=t||(e==null?void 0:e.transfers),o=r&&r.length>0,n=r&&r.length>1,s=o&&r.every(D=>!!(D!=null&&D.fungible_info)),[u,g]=r||[];let p=this.getTransferDescription(u),y=this.getTransferDescription(g);if(!o)return(i==="send"||i==="receive")&&s?(p=Te.getTruncateString({string:e==null?void 0:e.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),y=Te.getTruncateString({string:e==null?void 0:e.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"}),[p,y]):[e.metadata.status];if(n)return r==null?void 0:r.map(D=>this.getTransferDescription(D));let $="";return it.includes(i)?$="+":rt.includes(i)&&($="-"),p=$.concat(p),[p]},getTransferDescription(e){var i;let t="";return e&&(e!=null&&e.nft_info?t=((i=e==null?void 0:e.nft_info)==null?void 0:i.name)||"-":e!=null&&e.fungible_info&&(t=this.getFungibleTransferDescription(e)||"-")),t},getFungibleTransferDescription(e){var r;return e?[this.getQuantityFixedValue(e==null?void 0:e.quantity.numeric),(r=e==null?void 0:e.fungible_info)==null?void 0:r.symbol].join(" ").trim():null},mergeTransfers(e){if((e==null?void 0:e.length)<=1)return e;const i=this.filterGasFeeTransfers(e).reduce((o,n)=>{var g;const s=(g=n==null?void 0:n.fungible_info)==null?void 0:g.name,u=o.find(({fungible_info:p,direction:y})=>s&&s===(p==null?void 0:p.name)&&y===n.direction);if(u){const p=Number(u.quantity.numeric)+Number(n.quantity.numeric);u.quantity.numeric=p.toString(),u.value=(u.value||0)+(n.value||0)}else o.push(n);return o},[]);let r=i;return i.length>2&&(r=i.sort((o,n)=>(n.value||0)-(o.value||0)).slice(0,2)),r=r.sort((o,n)=>o.direction==="out"&&n.direction==="in"?-1:o.direction==="in"&&n.direction==="out"?1:0),r},filterGasFeeTransfers(e){const t=e==null?void 0:e.reduce((r,o)=>{var s;const n=(s=o==null?void 0:o.fungible_info)==null?void 0:s.name;return n&&(r[n]||(r[n]=[]),r[n].push(o)),r},{}),i=[];return Object.values(t??{}).forEach(r=>{if(r.length===1){const o=r[0];o&&i.push(o)}else{const o=r.filter(s=>s.direction==="in"),n=r.filter(s=>s.direction==="out");if(o.length===1&&n.length===1){const s=o[0],u=n[0];let g=!1;if(s&&u){const p=Number(s.quantity.numeric),y=Number(u.quantity.numeric);y<p*he?(i.push(s),g=!0):p<y*he&&(i.push(u),g=!0)}g||i.push(...r)}else{const s=this.filterGasFeesFromTokenGroup(r);i.push(...s)}}}),e==null||e.forEach(r=>{var o;(o=r==null?void 0:r.fungible_info)!=null&&o.name||i.push(r)}),i},filterGasFeesFromTokenGroup(e){if(e.length<=1)return e;const t=e==null?void 0:e.map(u=>Number(u.quantity.numeric)),i=Math.max(...t),r=Math.min(...t),o=.01;if(r<i*o)return e==null?void 0:e.filter(g=>Number(g.quantity.numeric)>=i*o);const n=e==null?void 0:e.filter(u=>u.direction==="in"),s=e==null?void 0:e.filter(u=>u.direction==="out");if(n.length===1&&s.length===1){const u=n[0],g=s[0];if(u&&g){const p=Number(u.quantity.numeric),y=Number(g.quantity.numeric);if(y<p*he)return[u];if(p<y*he)return[g]}}return e},getQuantityFixedValue(e){return e?parseFloat(e).toFixed(tt):null}};var be;(function(e){e.approve="approved",e.bought="bought",e.borrow="borrowed",e.burn="burnt",e.cancel="canceled",e.claim="claimed",e.deploy="deployed",e.deposit="deposited",e.execute="executed",e.mint="minted",e.receive="received",e.repay="repaid",e.send="sent",e.sell="sold",e.stake="staked",e.trade="swapped",e.unstake="unstaked",e.withdraw="withdrawn"})(be||(be={}));const nt=oe`
2
2
  :host > wui-flex {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{I as t,t as d,r as p,o as n,q as w}from"./index-Dqt7thvX.js";import{n as f,c as k,a as v}from"./index-BWY5rLcb.js";const g=t`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ import{I as t,t as d,r as p,o as n,q as w}from"./index-BTv8siy7.js";import{n as f,c as k,a as v}from"./index-BbJ97fLK.js";const g=t`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <rect width="64" height="64" fill="#F7931A"/>
3
3
  <g clip-path="url(#clip0_1045_17)">
4
4
  <path d="M63.0394 39.7409C58.7654 56.8839 41.4024 67.3169 24.2574 63.0419C7.11937 58.7679 -3.31363 41.4039 0.962367 24.2619C5.23437 7.11686 22.5974 -3.31714 39.7374 0.956863C56.8814 5.23086 67.3134 22.5969 63.0394 39.7409Z" fill="#F7931A"/>
@@ -1,4 +1,4 @@
1
- import{p as g,k as C,l as w,m as k,r as $,o as m,q as d,O as l}from"./index-Dqt7thvX.js";import{n as x,c as f,r as v}from"./index-BWY5rLcb.js";import{o as z}from"./if-defined-BFxH3C3I.js";import{e as O,n as _}from"./ref-DRpZWoiw.js";const h=g({isLegalCheckboxChecked:!1}),u={state:h,subscribe(e){return w(h,()=>e(h))},subscribeKey(e,t){return C(h,e,t)},setIsLegalCheckboxChecked(e){h.isLegalCheckboxChecked=e}},E=k`
1
+ import{p as g,k as C,l as w,m as k,r as $,o as m,q as d,O as l}from"./index-BTv8siy7.js";import{n as x,c as f,r as v}from"./index-BbJ97fLK.js";import{o as z}from"./if-defined-Dw-S0ise.js";import{e as O,n as _}from"./ref-KeBo7-wj.js";const h=g({isLegalCheckboxChecked:!1}),u={state:h,subscribe(e){return w(h,()=>e(h))},subscribeKey(e,t){return C(h,e,t)},setIsLegalCheckboxChecked(e){h.isLegalCheckboxChecked=e}},E=k`
2
2
  label {
3
3
  display: inline-flex;
4
4
  align-items: center;
@@ -1,4 +1,4 @@
1
- import{m as u,r as h,n as f,o as p,q as g}from"./index-Dqt7thvX.js";import{n as d,c as m}from"./index-BWY5rLcb.js";import{o as b}from"./if-defined-BFxH3C3I.js";const y=u`
1
+ import{m as u,r as h,n as f,o as p,q as g}from"./index-BTv8siy7.js";import{n as d,c as m}from"./index-BbJ97fLK.js";import{o as b}from"./if-defined-Dw-S0ise.js";const y=u`
2
2
  :host {
3
3
  display: inline-flex;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{m as p,r as d,o as f,q as c}from"./index-Dqt7thvX.js";import{n as m,c as h}from"./index-BWY5rLcb.js";const x=p`
1
+ import{m as p,r as d,o as f,q as c}from"./index-BTv8siy7.js";import{n as m,c as h}from"./index-BbJ97fLK.js";const x=p`
2
2
  :host {
3
3
  position: relative;
4
4
  display: flex;
@@ -1,4 +1,4 @@
1
- import{m,o as l,q as c}from"./index-Dqt7thvX.js";import{n as h,c as f}from"./index-BWY5rLcb.js";const p=m`
1
+ import{m,o as l,q as c}from"./index-BTv8siy7.js";import{n as h,c as f}from"./index-BbJ97fLK.js";const p=m`
2
2
  :host {
3
3
  display: block;
4
4
  background: linear-gradient(
@@ -1,4 +1,4 @@
1
- import{O as $,_ as b,a as C,C as p,$ as B,x as w,a0 as j,p as q,E as _,S as T,R as L,M as x,k as z,l as X,t as W,o as F,q as m,T as J,G as M,H as Z}from"./index-Dqt7thvX.js";import{r as h,c as H}from"./index-BWY5rLcb.js";import{o as G}from"./if-defined-BFxH3C3I.js";import"./index-B8nye65f.js";import"./index-DakGfqsI.js";import"./index-BO0AJK-5.js";import"./index-rgwfH8yu.js";import"./index-DiWSbg0n.js";import"./index-BweHqCOo.js";import"./index-DooF4pRe.js";import"./index-CRuSCuQI.js";import"./index-Irxa35iL.js";import{C as g}from"./NetworkUtil-CF6hfJpY.js";import"./index-C8EawR99.js";import"./thirdweb-CFgFLofm.js";import"./index-B4_b4exx.js";import"./ui-BnnR-c2T.js";import"./vendor-D-D-PWUq.js";import"./index-BCi3Crpp.js";const o={INVALID_PAYMENT_CONFIG:"INVALID_PAYMENT_CONFIG",INVALID_RECIPIENT:"INVALID_RECIPIENT",INVALID_ASSET:"INVALID_ASSET",INVALID_AMOUNT:"INVALID_AMOUNT",UNKNOWN_ERROR:"UNKNOWN_ERROR",UNABLE_TO_INITIATE_PAYMENT:"UNABLE_TO_INITIATE_PAYMENT",INVALID_CHAIN_NAMESPACE:"INVALID_CHAIN_NAMESPACE",GENERIC_PAYMENT_ERROR:"GENERIC_PAYMENT_ERROR",UNABLE_TO_GET_EXCHANGES:"UNABLE_TO_GET_EXCHANGES",ASSET_NOT_SUPPORTED:"ASSET_NOT_SUPPORTED",UNABLE_TO_GET_PAY_URL:"UNABLE_TO_GET_PAY_URL",UNABLE_TO_GET_BUY_STATUS:"UNABLE_TO_GET_BUY_STATUS"},N={[o.INVALID_PAYMENT_CONFIG]:"Invalid payment configuration",[o.INVALID_RECIPIENT]:"Invalid recipient address",[o.INVALID_ASSET]:"Invalid asset specified",[o.INVALID_AMOUNT]:"Invalid payment amount",[o.UNKNOWN_ERROR]:"Unknown payment error occurred",[o.UNABLE_TO_INITIATE_PAYMENT]:"Unable to initiate payment",[o.INVALID_CHAIN_NAMESPACE]:"Invalid chain namespace",[o.GENERIC_PAYMENT_ERROR]:"Unable to process payment",[o.UNABLE_TO_GET_EXCHANGES]:"Unable to get exchanges",[o.ASSET_NOT_SUPPORTED]:"Asset not supported by the selected exchange",[o.UNABLE_TO_GET_PAY_URL]:"Unable to get payment URL",[o.UNABLE_TO_GET_BUY_STATUS]:"Unable to get buy status"};class c extends Error{get message(){return N[this.code]}constructor(e,s){super(N[e]),this.name="AppKitPayError",this.code=e,this.details=s,Error.captureStackTrace&&Error.captureStackTrace(this,c)}}const Q="https://rpc.walletconnect.org/v1/json-rpc";class ee extends Error{}function te(){const t=$.getSnapshot().projectId;return`${Q}?projectId=${t}`}async function O(t,e){const s=te(),{sdkType:a,sdkVersion:r,projectId:i}=$.getSnapshot(),u={jsonrpc:"2.0",id:1,method:t,params:{...e||{},st:a,sv:r,projectId:i}},A=await(await fetch(s,{method:"POST",body:JSON.stringify(u),headers:{"Content-Type":"application/json"}})).json();if(A.error)throw new ee(A.error.message);return A}async function Y(t){return(await O("reown_getExchanges",t)).result}async function ne(t){return(await O("reown_getExchangePayUrl",t)).result}async function se(t){return(await O("reown_getExchangeBuyStatus",t)).result}const ae=["eip155","solana"],re={eip155:{native:{assetNamespace:"slip44",assetReference:"60"},defaultTokenNamespace:"erc20"},solana:{native:{assetNamespace:"slip44",assetReference:"501"},defaultTokenNamespace:"token"}};function R(t,e){const{chainNamespace:s,chainId:a}=b.parseCaipNetworkId(t),r=re[s];if(!r)throw new Error(`Unsupported chain namespace for CAIP-19 formatting: ${s}`);let i=r.native.assetNamespace,u=r.native.assetReference;return e!=="native"&&(i=r.defaultTokenNamespace,u=e),`${`${s}:${a}`}/${i}:${u}`}function ie(t){const{chainNamespace:e}=b.parseCaipNetworkId(t);return ae.includes(e)}async function oe(t){const{paymentAssetNetwork:e,activeCaipNetwork:s,approvedCaipNetworkIds:a,requestedCaipNetworks:r}=t,u=C.sortRequestedNetworks(a,r).find(P=>P.caipNetworkId===e);if(!u)throw new c(o.INVALID_PAYMENT_CONFIG);if(u.caipNetworkId===s.caipNetworkId)return;const d=p.getNetworkProp("supportsAllNetworks",u.chainNamespace);if(!((a==null?void 0:a.includes(u.caipNetworkId))||d))throw new c(o.INVALID_PAYMENT_CONFIG);try{await p.switchActiveNetwork(u)}catch(P){throw new c(o.GENERIC_PAYMENT_ERROR,P)}}async function ce(t,e,s){var d;if(e!==g.CHAIN.EVM)throw new c(o.INVALID_CHAIN_NAMESPACE);if(!s.fromAddress)throw new c(o.INVALID_PAYMENT_CONFIG,"fromAddress is required for native EVM payments.");const a=typeof s.amount=="string"?parseFloat(s.amount):s.amount;if(isNaN(a))throw new c(o.INVALID_PAYMENT_CONFIG);const r=((d=t.metadata)==null?void 0:d.decimals)??18,i=w.parseUnits(a.toString(),r);if(typeof i!="bigint")throw new c(o.GENERIC_PAYMENT_ERROR);return await w.sendTransaction({chainNamespace:e,to:s.recipient,address:s.fromAddress,value:i,data:"0x"})??void 0}async function ue(t,e){if(!e.fromAddress)throw new c(o.INVALID_PAYMENT_CONFIG,"fromAddress is required for ERC20 EVM payments.");const s=t.asset,a=e.recipient,r=Number(t.metadata.decimals),i=w.parseUnits(e.amount.toString(),r);if(i===void 0)throw new c(o.GENERIC_PAYMENT_ERROR);return await w.writeContract({fromAddress:e.fromAddress,tokenAddress:s,args:[a,i],method:"transfer",abi:j.getERC20Abi(s),chainNamespace:g.CHAIN.EVM})??void 0}async function le(t,e){if(t!==g.CHAIN.SOLANA)throw new c(o.INVALID_CHAIN_NAMESPACE);if(!e.fromAddress)throw new c(o.INVALID_PAYMENT_CONFIG,"fromAddress is required for Solana payments.");const s=typeof e.amount=="string"?parseFloat(e.amount):e.amount;if(isNaN(s)||s<=0)throw new c(o.INVALID_PAYMENT_CONFIG,"Invalid payment amount.");try{if(!B.getProvider(t))throw new c(o.GENERIC_PAYMENT_ERROR,"No Solana provider available.");const r=await w.sendTransaction({chainNamespace:g.CHAIN.SOLANA,to:e.recipient,value:s,tokenMint:e.tokenMint});if(!r)throw new c(o.GENERIC_PAYMENT_ERROR,"Transaction failed.");return r}catch(a){throw a instanceof c?a:new c(o.GENERIC_PAYMENT_ERROR,`Solana payment failed: ${a}`)}}const V=0,v="unknown",n=q({paymentAsset:{network:"eip155:1",asset:"0x0",metadata:{name:"0x0",symbol:"0x0",decimals:0}},recipient:"0x0",amount:0,isConfigured:!1,error:null,isPaymentInProgress:!1,exchanges:[],isLoading:!1,openInNewTab:!0,redirectUrl:void 0,payWithExchange:void 0,currentPayment:void 0,analyticsSet:!1,paymentId:void 0}),l={state:n,subscribe(t){return X(n,()=>t(n))},subscribeKey(t,e){return z(n,t,e)},async handleOpenPay(t){this.resetState(),this.setPaymentConfig(t),this.subscribeEvents(),this.initializeAnalytics(),n.isConfigured=!0,_.sendEvent({type:"track",event:"PAY_MODAL_OPEN",properties:{exchanges:n.exchanges,configuration:{network:n.paymentAsset.network,asset:n.paymentAsset.asset,recipient:n.recipient,amount:n.amount}}}),await x.open({view:"Pay"})},resetState(){n.paymentAsset={network:"eip155:1",asset:"0x0",metadata:{name:"0x0",symbol:"0x0",decimals:0}},n.recipient="0x0",n.amount=0,n.isConfigured=!1,n.error=null,n.isPaymentInProgress=!1,n.isLoading=!1,n.currentPayment=void 0},setPaymentConfig(t){if(!t.paymentAsset)throw new c(o.INVALID_PAYMENT_CONFIG);try{n.paymentAsset=t.paymentAsset,n.recipient=t.recipient,n.amount=t.amount,n.openInNewTab=t.openInNewTab??!0,n.redirectUrl=t.redirectUrl,n.payWithExchange=t.payWithExchange,n.error=null}catch(e){throw new c(o.INVALID_PAYMENT_CONFIG,e.message)}},getPaymentAsset(){return n.paymentAsset},getExchanges(){return n.exchanges},async fetchExchanges(){try{n.isLoading=!0;const t=await Y({page:V,asset:R(n.paymentAsset.network,n.paymentAsset.asset),amount:n.amount.toString()});n.exchanges=t.exchanges.slice(0,2)}catch{throw T.showError(N.UNABLE_TO_GET_EXCHANGES),new c(o.UNABLE_TO_GET_EXCHANGES)}finally{n.isLoading=!1}},async getAvailableExchanges(t){var e;try{const s=t!=null&&t.asset&&(t!=null&&t.network)?R(t.network,t.asset):void 0;return await Y({page:(t==null?void 0:t.page)??V,asset:s,amount:(e=t==null?void 0:t.amount)==null?void 0:e.toString()})}catch{throw new c(o.UNABLE_TO_GET_EXCHANGES)}},async getPayUrl(t,e,s=!1){try{const a=Number(e.amount),r=await ne({exchangeId:t,asset:R(e.network,e.asset),amount:a.toString(),recipient:`${e.network}:${e.recipient}`});return _.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{source:"pay",exchange:{id:t},configuration:{network:e.network,asset:e.asset,recipient:e.recipient,amount:a},currentPayment:{type:"exchange",exchangeId:t},headless:s}}),s&&(this.initiatePayment(),_.sendEvent({type:"track",event:"PAY_INITIATED",properties:{source:"pay",paymentId:n.paymentId||v,configuration:{network:e.network,asset:e.asset,recipient:e.recipient,amount:a},currentPayment:{type:"exchange",exchangeId:t}}})),r}catch(a){throw a instanceof Error&&a.message.includes("is not supported")?new c(o.ASSET_NOT_SUPPORTED):new Error(a.message)}},async openPayUrl(t,e,s=!1){try{const a=await this.getPayUrl(t.exchangeId,e,s);if(!a)throw new c(o.UNABLE_TO_GET_PAY_URL);const i=t.openInNewTab??!0?"_blank":"_self";return C.openHref(a.url,i),a}catch(a){throw a instanceof c?n.error=a.message:n.error=N.GENERIC_PAYMENT_ERROR,new c(o.UNABLE_TO_GET_PAY_URL)}},subscribeEvents(){n.isConfigured||(w.subscribeKey("connections",t=>{t.size>0&&this.handlePayment()}),p.subscribeChainProp("accountState",t=>{const e=w.hasAnyConnection(g.CONNECTOR_ID.WALLET_CONNECT);t!=null&&t.caipAddress&&(e?setTimeout(()=>{this.handlePayment()},100):this.handlePayment())}))},async handlePayment(){n.currentPayment={type:"wallet",status:"IN_PROGRESS"};const t=p.getActiveCaipAddress();if(!t)return;const{chainId:e,address:s}=b.parseCaipAddress(t),a=p.state.activeChain;if(!s||!e||!a||!B.getProvider(a))return;const i=p.state.activeCaipNetwork;if(i&&!n.isPaymentInProgress)try{this.initiatePayment();const u=p.getAllRequestedCaipNetworks(),d=p.getAllApprovedCaipNetworkIds();switch(await oe({paymentAssetNetwork:n.paymentAsset.network,activeCaipNetwork:i,approvedCaipNetworkIds:d,requestedCaipNetworks:u}),await x.open({view:"PayLoading"}),a){case g.CHAIN.EVM:n.paymentAsset.asset==="native"&&(n.currentPayment.result=await ce(n.paymentAsset,a,{recipient:n.recipient,amount:n.amount,fromAddress:s})),n.paymentAsset.asset.startsWith("0x")&&(n.currentPayment.result=await ue(n.paymentAsset,{recipient:n.recipient,amount:n.amount,fromAddress:s})),n.currentPayment.status="SUCCESS";break;case g.CHAIN.SOLANA:n.currentPayment.result=await le(a,{recipient:n.recipient,amount:n.amount,fromAddress:s,tokenMint:n.paymentAsset.asset==="native"?void 0:n.paymentAsset.asset}),n.currentPayment.status="SUCCESS";break;default:throw new c(o.INVALID_CHAIN_NAMESPACE)}}catch(u){u instanceof c?n.error=u.message:n.error=N.GENERIC_PAYMENT_ERROR,n.currentPayment.status="FAILED",T.showError(n.error)}finally{n.isPaymentInProgress=!1}},getExchangeById(t){return n.exchanges.find(e=>e.id===t)},validatePayConfig(t){const{paymentAsset:e,recipient:s,amount:a}=t;if(!e)throw new c(o.INVALID_PAYMENT_CONFIG);if(!s)throw new c(o.INVALID_RECIPIENT);if(!e.asset)throw new c(o.INVALID_ASSET);if(a==null||a<=0)throw new c(o.INVALID_AMOUNT)},handlePayWithWallet(){const t=p.getActiveCaipAddress();if(!t){L.push("Connect");return}const{chainId:e,address:s}=b.parseCaipAddress(t),a=p.state.activeChain;if(!s||!e||!a){L.push("Connect");return}this.handlePayment()},async handlePayWithExchange(t){try{n.currentPayment={type:"exchange",exchangeId:t};const{network:e,asset:s}=n.paymentAsset,a={network:e,asset:s,amount:n.amount,recipient:n.recipient},r=await this.getPayUrl(t,a);if(!r)throw new c(o.UNABLE_TO_INITIATE_PAYMENT);return n.currentPayment.sessionId=r.sessionId,n.currentPayment.status="IN_PROGRESS",n.currentPayment.exchangeId=t,this.initiatePayment(),{url:r.url,openInNewTab:n.openInNewTab}}catch(e){return e instanceof c?n.error=e.message:n.error=N.GENERIC_PAYMENT_ERROR,n.isPaymentInProgress=!1,T.showError(n.error),null}},async getBuyStatus(t,e){var s,a;try{const r=await se({sessionId:e,exchangeId:t});return(r.status==="SUCCESS"||r.status==="FAILED")&&_.sendEvent({type:"track",event:r.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:r.status==="FAILED"?C.parseError(n.error):void 0,source:"pay",paymentId:n.paymentId||v,configuration:{network:n.paymentAsset.network,asset:n.paymentAsset.asset,recipient:n.recipient,amount:n.amount},currentPayment:{type:"exchange",exchangeId:(s=n.currentPayment)==null?void 0:s.exchangeId,sessionId:(a=n.currentPayment)==null?void 0:a.sessionId,result:r.txHash}}}),r}catch{throw new c(o.UNABLE_TO_GET_BUY_STATUS)}},async updateBuyStatus(t,e){try{const s=await this.getBuyStatus(t,e);n.currentPayment&&(n.currentPayment.status=s.status,n.currentPayment.result=s.txHash),(s.status==="SUCCESS"||s.status==="FAILED")&&(n.isPaymentInProgress=!1)}catch{throw new c(o.UNABLE_TO_GET_BUY_STATUS)}},initiatePayment(){n.isPaymentInProgress=!0,n.paymentId=crypto.randomUUID()},initializeAnalytics(){n.analyticsSet||(n.analyticsSet=!0,this.subscribeKey("isPaymentInProgress",t=>{var e;if((e=n.currentPayment)!=null&&e.status&&n.currentPayment.status!=="UNKNOWN"){const s={IN_PROGRESS:"PAY_INITIATED",SUCCESS:"PAY_SUCCESS",FAILED:"PAY_ERROR"}[n.currentPayment.status];_.sendEvent({type:"track",event:s,properties:{message:n.currentPayment.status==="FAILED"?C.parseError(n.error):void 0,source:"pay",paymentId:n.paymentId||v,configuration:{network:n.paymentAsset.network,asset:n.paymentAsset.asset,recipient:n.recipient,amount:n.amount},currentPayment:{type:n.currentPayment.type,exchangeId:n.currentPayment.exchangeId,sessionId:n.currentPayment.sessionId,result:n.currentPayment.result}}})}}))}},de=W`
1
+ import{O as $,_ as b,a as C,C as p,$ as B,x as w,a0 as j,p as q,E as _,S as T,R as L,M as x,k as z,l as X,t as W,o as F,q as m,T as J,G as M,H as Z}from"./index-BTv8siy7.js";import{r as h,c as H}from"./index-BbJ97fLK.js";import{o as G}from"./if-defined-Dw-S0ise.js";import"./index-DpMWOALf.js";import"./index-DFt6vA57.js";import"./index-CfvKVkmT.js";import"./index-B8LZftfz.js";import"./index-B99E-jw5.js";import"./index-DSE85PpW.js";import"./index-CeX6TG8F.js";import"./index-CP8gwVD7.js";import"./index-BKFbKSfO.js";import{C as g}from"./NetworkUtil-CQELJEgg.js";import"./index-iemeyF3Y.js";import"./thirdweb-C3Q9twFA.js";import"./index-CiP4eK6c.js";import"./ui-C_t4j8DL.js";import"./vendor-BzW03oEY.js";import"./index-CKiFyUbS.js";const o={INVALID_PAYMENT_CONFIG:"INVALID_PAYMENT_CONFIG",INVALID_RECIPIENT:"INVALID_RECIPIENT",INVALID_ASSET:"INVALID_ASSET",INVALID_AMOUNT:"INVALID_AMOUNT",UNKNOWN_ERROR:"UNKNOWN_ERROR",UNABLE_TO_INITIATE_PAYMENT:"UNABLE_TO_INITIATE_PAYMENT",INVALID_CHAIN_NAMESPACE:"INVALID_CHAIN_NAMESPACE",GENERIC_PAYMENT_ERROR:"GENERIC_PAYMENT_ERROR",UNABLE_TO_GET_EXCHANGES:"UNABLE_TO_GET_EXCHANGES",ASSET_NOT_SUPPORTED:"ASSET_NOT_SUPPORTED",UNABLE_TO_GET_PAY_URL:"UNABLE_TO_GET_PAY_URL",UNABLE_TO_GET_BUY_STATUS:"UNABLE_TO_GET_BUY_STATUS"},N={[o.INVALID_PAYMENT_CONFIG]:"Invalid payment configuration",[o.INVALID_RECIPIENT]:"Invalid recipient address",[o.INVALID_ASSET]:"Invalid asset specified",[o.INVALID_AMOUNT]:"Invalid payment amount",[o.UNKNOWN_ERROR]:"Unknown payment error occurred",[o.UNABLE_TO_INITIATE_PAYMENT]:"Unable to initiate payment",[o.INVALID_CHAIN_NAMESPACE]:"Invalid chain namespace",[o.GENERIC_PAYMENT_ERROR]:"Unable to process payment",[o.UNABLE_TO_GET_EXCHANGES]:"Unable to get exchanges",[o.ASSET_NOT_SUPPORTED]:"Asset not supported by the selected exchange",[o.UNABLE_TO_GET_PAY_URL]:"Unable to get payment URL",[o.UNABLE_TO_GET_BUY_STATUS]:"Unable to get buy status"};class c extends Error{get message(){return N[this.code]}constructor(e,s){super(N[e]),this.name="AppKitPayError",this.code=e,this.details=s,Error.captureStackTrace&&Error.captureStackTrace(this,c)}}const Q="https://rpc.walletconnect.org/v1/json-rpc";class ee extends Error{}function te(){const t=$.getSnapshot().projectId;return`${Q}?projectId=${t}`}async function O(t,e){const s=te(),{sdkType:a,sdkVersion:r,projectId:i}=$.getSnapshot(),u={jsonrpc:"2.0",id:1,method:t,params:{...e||{},st:a,sv:r,projectId:i}},A=await(await fetch(s,{method:"POST",body:JSON.stringify(u),headers:{"Content-Type":"application/json"}})).json();if(A.error)throw new ee(A.error.message);return A}async function Y(t){return(await O("reown_getExchanges",t)).result}async function ne(t){return(await O("reown_getExchangePayUrl",t)).result}async function se(t){return(await O("reown_getExchangeBuyStatus",t)).result}const ae=["eip155","solana"],re={eip155:{native:{assetNamespace:"slip44",assetReference:"60"},defaultTokenNamespace:"erc20"},solana:{native:{assetNamespace:"slip44",assetReference:"501"},defaultTokenNamespace:"token"}};function R(t,e){const{chainNamespace:s,chainId:a}=b.parseCaipNetworkId(t),r=re[s];if(!r)throw new Error(`Unsupported chain namespace for CAIP-19 formatting: ${s}`);let i=r.native.assetNamespace,u=r.native.assetReference;return e!=="native"&&(i=r.defaultTokenNamespace,u=e),`${`${s}:${a}`}/${i}:${u}`}function ie(t){const{chainNamespace:e}=b.parseCaipNetworkId(t);return ae.includes(e)}async function oe(t){const{paymentAssetNetwork:e,activeCaipNetwork:s,approvedCaipNetworkIds:a,requestedCaipNetworks:r}=t,u=C.sortRequestedNetworks(a,r).find(P=>P.caipNetworkId===e);if(!u)throw new c(o.INVALID_PAYMENT_CONFIG);if(u.caipNetworkId===s.caipNetworkId)return;const d=p.getNetworkProp("supportsAllNetworks",u.chainNamespace);if(!((a==null?void 0:a.includes(u.caipNetworkId))||d))throw new c(o.INVALID_PAYMENT_CONFIG);try{await p.switchActiveNetwork(u)}catch(P){throw new c(o.GENERIC_PAYMENT_ERROR,P)}}async function ce(t,e,s){var d;if(e!==g.CHAIN.EVM)throw new c(o.INVALID_CHAIN_NAMESPACE);if(!s.fromAddress)throw new c(o.INVALID_PAYMENT_CONFIG,"fromAddress is required for native EVM payments.");const a=typeof s.amount=="string"?parseFloat(s.amount):s.amount;if(isNaN(a))throw new c(o.INVALID_PAYMENT_CONFIG);const r=((d=t.metadata)==null?void 0:d.decimals)??18,i=w.parseUnits(a.toString(),r);if(typeof i!="bigint")throw new c(o.GENERIC_PAYMENT_ERROR);return await w.sendTransaction({chainNamespace:e,to:s.recipient,address:s.fromAddress,value:i,data:"0x"})??void 0}async function ue(t,e){if(!e.fromAddress)throw new c(o.INVALID_PAYMENT_CONFIG,"fromAddress is required for ERC20 EVM payments.");const s=t.asset,a=e.recipient,r=Number(t.metadata.decimals),i=w.parseUnits(e.amount.toString(),r);if(i===void 0)throw new c(o.GENERIC_PAYMENT_ERROR);return await w.writeContract({fromAddress:e.fromAddress,tokenAddress:s,args:[a,i],method:"transfer",abi:j.getERC20Abi(s),chainNamespace:g.CHAIN.EVM})??void 0}async function le(t,e){if(t!==g.CHAIN.SOLANA)throw new c(o.INVALID_CHAIN_NAMESPACE);if(!e.fromAddress)throw new c(o.INVALID_PAYMENT_CONFIG,"fromAddress is required for Solana payments.");const s=typeof e.amount=="string"?parseFloat(e.amount):e.amount;if(isNaN(s)||s<=0)throw new c(o.INVALID_PAYMENT_CONFIG,"Invalid payment amount.");try{if(!B.getProvider(t))throw new c(o.GENERIC_PAYMENT_ERROR,"No Solana provider available.");const r=await w.sendTransaction({chainNamespace:g.CHAIN.SOLANA,to:e.recipient,value:s,tokenMint:e.tokenMint});if(!r)throw new c(o.GENERIC_PAYMENT_ERROR,"Transaction failed.");return r}catch(a){throw a instanceof c?a:new c(o.GENERIC_PAYMENT_ERROR,`Solana payment failed: ${a}`)}}const V=0,v="unknown",n=q({paymentAsset:{network:"eip155:1",asset:"0x0",metadata:{name:"0x0",symbol:"0x0",decimals:0}},recipient:"0x0",amount:0,isConfigured:!1,error:null,isPaymentInProgress:!1,exchanges:[],isLoading:!1,openInNewTab:!0,redirectUrl:void 0,payWithExchange:void 0,currentPayment:void 0,analyticsSet:!1,paymentId:void 0}),l={state:n,subscribe(t){return X(n,()=>t(n))},subscribeKey(t,e){return z(n,t,e)},async handleOpenPay(t){this.resetState(),this.setPaymentConfig(t),this.subscribeEvents(),this.initializeAnalytics(),n.isConfigured=!0,_.sendEvent({type:"track",event:"PAY_MODAL_OPEN",properties:{exchanges:n.exchanges,configuration:{network:n.paymentAsset.network,asset:n.paymentAsset.asset,recipient:n.recipient,amount:n.amount}}}),await x.open({view:"Pay"})},resetState(){n.paymentAsset={network:"eip155:1",asset:"0x0",metadata:{name:"0x0",symbol:"0x0",decimals:0}},n.recipient="0x0",n.amount=0,n.isConfigured=!1,n.error=null,n.isPaymentInProgress=!1,n.isLoading=!1,n.currentPayment=void 0},setPaymentConfig(t){if(!t.paymentAsset)throw new c(o.INVALID_PAYMENT_CONFIG);try{n.paymentAsset=t.paymentAsset,n.recipient=t.recipient,n.amount=t.amount,n.openInNewTab=t.openInNewTab??!0,n.redirectUrl=t.redirectUrl,n.payWithExchange=t.payWithExchange,n.error=null}catch(e){throw new c(o.INVALID_PAYMENT_CONFIG,e.message)}},getPaymentAsset(){return n.paymentAsset},getExchanges(){return n.exchanges},async fetchExchanges(){try{n.isLoading=!0;const t=await Y({page:V,asset:R(n.paymentAsset.network,n.paymentAsset.asset),amount:n.amount.toString()});n.exchanges=t.exchanges.slice(0,2)}catch{throw T.showError(N.UNABLE_TO_GET_EXCHANGES),new c(o.UNABLE_TO_GET_EXCHANGES)}finally{n.isLoading=!1}},async getAvailableExchanges(t){var e;try{const s=t!=null&&t.asset&&(t!=null&&t.network)?R(t.network,t.asset):void 0;return await Y({page:(t==null?void 0:t.page)??V,asset:s,amount:(e=t==null?void 0:t.amount)==null?void 0:e.toString()})}catch{throw new c(o.UNABLE_TO_GET_EXCHANGES)}},async getPayUrl(t,e,s=!1){try{const a=Number(e.amount),r=await ne({exchangeId:t,asset:R(e.network,e.asset),amount:a.toString(),recipient:`${e.network}:${e.recipient}`});return _.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{source:"pay",exchange:{id:t},configuration:{network:e.network,asset:e.asset,recipient:e.recipient,amount:a},currentPayment:{type:"exchange",exchangeId:t},headless:s}}),s&&(this.initiatePayment(),_.sendEvent({type:"track",event:"PAY_INITIATED",properties:{source:"pay",paymentId:n.paymentId||v,configuration:{network:e.network,asset:e.asset,recipient:e.recipient,amount:a},currentPayment:{type:"exchange",exchangeId:t}}})),r}catch(a){throw a instanceof Error&&a.message.includes("is not supported")?new c(o.ASSET_NOT_SUPPORTED):new Error(a.message)}},async openPayUrl(t,e,s=!1){try{const a=await this.getPayUrl(t.exchangeId,e,s);if(!a)throw new c(o.UNABLE_TO_GET_PAY_URL);const i=t.openInNewTab??!0?"_blank":"_self";return C.openHref(a.url,i),a}catch(a){throw a instanceof c?n.error=a.message:n.error=N.GENERIC_PAYMENT_ERROR,new c(o.UNABLE_TO_GET_PAY_URL)}},subscribeEvents(){n.isConfigured||(w.subscribeKey("connections",t=>{t.size>0&&this.handlePayment()}),p.subscribeChainProp("accountState",t=>{const e=w.hasAnyConnection(g.CONNECTOR_ID.WALLET_CONNECT);t!=null&&t.caipAddress&&(e?setTimeout(()=>{this.handlePayment()},100):this.handlePayment())}))},async handlePayment(){n.currentPayment={type:"wallet",status:"IN_PROGRESS"};const t=p.getActiveCaipAddress();if(!t)return;const{chainId:e,address:s}=b.parseCaipAddress(t),a=p.state.activeChain;if(!s||!e||!a||!B.getProvider(a))return;const i=p.state.activeCaipNetwork;if(i&&!n.isPaymentInProgress)try{this.initiatePayment();const u=p.getAllRequestedCaipNetworks(),d=p.getAllApprovedCaipNetworkIds();switch(await oe({paymentAssetNetwork:n.paymentAsset.network,activeCaipNetwork:i,approvedCaipNetworkIds:d,requestedCaipNetworks:u}),await x.open({view:"PayLoading"}),a){case g.CHAIN.EVM:n.paymentAsset.asset==="native"&&(n.currentPayment.result=await ce(n.paymentAsset,a,{recipient:n.recipient,amount:n.amount,fromAddress:s})),n.paymentAsset.asset.startsWith("0x")&&(n.currentPayment.result=await ue(n.paymentAsset,{recipient:n.recipient,amount:n.amount,fromAddress:s})),n.currentPayment.status="SUCCESS";break;case g.CHAIN.SOLANA:n.currentPayment.result=await le(a,{recipient:n.recipient,amount:n.amount,fromAddress:s,tokenMint:n.paymentAsset.asset==="native"?void 0:n.paymentAsset.asset}),n.currentPayment.status="SUCCESS";break;default:throw new c(o.INVALID_CHAIN_NAMESPACE)}}catch(u){u instanceof c?n.error=u.message:n.error=N.GENERIC_PAYMENT_ERROR,n.currentPayment.status="FAILED",T.showError(n.error)}finally{n.isPaymentInProgress=!1}},getExchangeById(t){return n.exchanges.find(e=>e.id===t)},validatePayConfig(t){const{paymentAsset:e,recipient:s,amount:a}=t;if(!e)throw new c(o.INVALID_PAYMENT_CONFIG);if(!s)throw new c(o.INVALID_RECIPIENT);if(!e.asset)throw new c(o.INVALID_ASSET);if(a==null||a<=0)throw new c(o.INVALID_AMOUNT)},handlePayWithWallet(){const t=p.getActiveCaipAddress();if(!t){L.push("Connect");return}const{chainId:e,address:s}=b.parseCaipAddress(t),a=p.state.activeChain;if(!s||!e||!a){L.push("Connect");return}this.handlePayment()},async handlePayWithExchange(t){try{n.currentPayment={type:"exchange",exchangeId:t};const{network:e,asset:s}=n.paymentAsset,a={network:e,asset:s,amount:n.amount,recipient:n.recipient},r=await this.getPayUrl(t,a);if(!r)throw new c(o.UNABLE_TO_INITIATE_PAYMENT);return n.currentPayment.sessionId=r.sessionId,n.currentPayment.status="IN_PROGRESS",n.currentPayment.exchangeId=t,this.initiatePayment(),{url:r.url,openInNewTab:n.openInNewTab}}catch(e){return e instanceof c?n.error=e.message:n.error=N.GENERIC_PAYMENT_ERROR,n.isPaymentInProgress=!1,T.showError(n.error),null}},async getBuyStatus(t,e){var s,a;try{const r=await se({sessionId:e,exchangeId:t});return(r.status==="SUCCESS"||r.status==="FAILED")&&_.sendEvent({type:"track",event:r.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:r.status==="FAILED"?C.parseError(n.error):void 0,source:"pay",paymentId:n.paymentId||v,configuration:{network:n.paymentAsset.network,asset:n.paymentAsset.asset,recipient:n.recipient,amount:n.amount},currentPayment:{type:"exchange",exchangeId:(s=n.currentPayment)==null?void 0:s.exchangeId,sessionId:(a=n.currentPayment)==null?void 0:a.sessionId,result:r.txHash}}}),r}catch{throw new c(o.UNABLE_TO_GET_BUY_STATUS)}},async updateBuyStatus(t,e){try{const s=await this.getBuyStatus(t,e);n.currentPayment&&(n.currentPayment.status=s.status,n.currentPayment.result=s.txHash),(s.status==="SUCCESS"||s.status==="FAILED")&&(n.isPaymentInProgress=!1)}catch{throw new c(o.UNABLE_TO_GET_BUY_STATUS)}},initiatePayment(){n.isPaymentInProgress=!0,n.paymentId=crypto.randomUUID()},initializeAnalytics(){n.analyticsSet||(n.analyticsSet=!0,this.subscribeKey("isPaymentInProgress",t=>{var e;if((e=n.currentPayment)!=null&&e.status&&n.currentPayment.status!=="UNKNOWN"){const s={IN_PROGRESS:"PAY_INITIATED",SUCCESS:"PAY_SUCCESS",FAILED:"PAY_ERROR"}[n.currentPayment.status];_.sendEvent({type:"track",event:s,properties:{message:n.currentPayment.status==="FAILED"?C.parseError(n.error):void 0,source:"pay",paymentId:n.paymentId||v,configuration:{network:n.paymentAsset.network,asset:n.paymentAsset.asset,recipient:n.recipient,amount:n.amount},currentPayment:{type:n.currentPayment.type,exchangeId:n.currentPayment.exchangeId,sessionId:n.currentPayment.sessionId,result:n.currentPayment.result}}})}}))}},de=W`
2
2
  wui-separator {
3
3
  margin: var(--apkt-spacing-3) calc(var(--apkt-spacing-3) * -1) var(--apkt-spacing-2)
4
4
  calc(var(--apkt-spacing-3) * -1);
@@ -1,4 +1,4 @@
1
- import{t as m,r as c,o as f,q as d}from"./index-Dqt7thvX.js";import{n as u,c as b}from"./index-BWY5rLcb.js";import{o as h}from"./if-defined-BFxH3C3I.js";import"./index-B_cJLIUw.js";const v=m`
1
+ import{t as m,r as c,o as f,q as d}from"./index-BTv8siy7.js";import{n as u,c as b}from"./index-BbJ97fLK.js";import{o as h}from"./if-defined-Dw-S0ise.js";import"./index-BCJ58vx8.js";const v=m`
2
2
  :host {
3
3
  position: relative;
4
4
  display: inline-block;
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/in-app-wallet-calls-CC57SOFU.js","assets/thirdweb-CFgFLofm.js","assets/index-D49q6WGA.js","assets/send-eip712-transaction-B4cvY0rg.js","assets/parse-typed-data-CeBP6yRt.js","assets/types-DC0Zmj1B.js"])))=>i.map(i=>d[i]);
2
- import{I,y as M,j as R,i as f,J as A,K as P,M as U,N as B,O as H,P as l,Q as V,R as W,S as O,_ as g,T as v,k as F,m as h,r as D,B as N,U as $,o as k,b as z}from"./thirdweb-CFgFLofm.js";import{s as j}from"./types-DC0Zmj1B.js";function q(n){let e;return()=>(e||(e=n()),e)}function K(n={}){return I({filters:n,signature:"event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason)"})}function Z(n={}){return I({filters:n,signature:"event PostOpRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason)"})}function J(n){const{receipt:e}=n,t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs,status:e.status,to:e.to?e.to:null,transactionHash:e.transactionHash,transactionIndex:e.transactionIndex,type:e.type};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),{...n,actualGasCost:BigInt(n.actualGasCost),actualGasUsed:BigInt(n.actualGasUsed),nonce:BigInt(n.nonce),receipt:t,userOpHash:n.userOpHash}}const fe=()=>{const n=BigInt(Math.floor(Math.random()*4294967296)),e=BigInt(Math.floor(Math.random()*4294967296)),t=BigInt(Math.floor(Math.random()*4294967296)),r=BigInt(Math.floor(Math.random()*4294967296)),o=BigInt(Math.floor(Math.random()*4294967296)),p=BigInt(Math.floor(Math.random()*4294967296));return n<<BigInt(160)|e<<BigInt(128)|t<<BigInt(96)|r<<BigInt(64)|o<<BigInt(32)|p};function E(n){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,t==null||R(t)?t:M(t)]))}async function ge(n){return d({...n,operation:"eth_sendUserOperation",params:[E(n.userOp),n.options.entrypointAddress??U]})}async function we(n,e){const t=await d({...n,operation:"eth_estimateUserOperationGas",params:[E(n.userOp),n.options.entrypointAddress??U,e??{}]});return{callGasLimit:l(t.callGasLimit)+V,paymasterPostOpGasLimit:t.paymasterPostOpGasLimit!==void 0?l(t.paymasterPostOpGasLimit):void 0,paymasterVerificationGasLimit:t.paymasterVerificationGasLimit!==void 0?l(t.paymasterVerificationGasLimit):void 0,preVerificationGas:l(t.preVerificationGas),verificationGas:t.verificationGas!==void 0?l(t.verificationGas):void 0,verificationGasLimit:l(t.verificationGasLimit)}}async function Se(n){const e=await d({...n,operation:"thirdweb_getUserOperationGasPrice",params:[]});return{maxFeePerGas:l(e.maxFeePerGas),maxPriorityFeePerGas:l(e.maxPriorityFeePerGas)}}async function ve(n){var t,r;const e=await Q(n);if(e){if(e.success===!1){const p=(r=(t=B({events:[K(),Z()],logs:e.logs})[0])==null?void 0:t.args)==null?void 0:r.revertReason;if(!p)throw new Error(`UserOp failed at txHash: ${e.receipt.transactionHash}`);const a=H({data:p});throw new Error(`UserOp failed with reason: '${a.args.join(",")}' at txHash: ${e.receipt.transactionHash}`)}return e.receipt}}async function Q(n){const e=await d({operation:"eth_getUserOperationReceipt",options:n,params:[n.userOpHash]});if(e)return J(e)}async function Le(n){const e=await d({operation:"zk_paymasterData",options:n.options,params:[n.transaction]});return{paymaster:e.paymaster,paymasterInput:e.paymasterInput}}async function Y(n){const e=await d({...n,operation:"tw_execute",params:[n.eoaAddress,n.wrappedCalls,n.signature,n.authorization]});if(!e.queueId)throw new Error(`Error executing 7702 transaction: ${f(e)}`);return{transactionId:e.queueId}}async function X(n){return{transactionHash:(await d({...n,operation:"tw_getTransactionHash",params:[n.transactionId]})).transactionHash}}async function xe(n){return{transactionHash:(await d({operation:"zk_broadcastTransaction",options:n.options,params:[{...n.transaction,signedTransaction:n.signedTransaction}]})).transactionHash}}async function d(n){const{options:e,operation:t,params:r}=n,o=e.bundlerUrl??A(e.chain),a=await P(e.client)(o,{useAuthToken:!0,body:f({id:1,jsonrpc:"2.0",method:t,params:r}),headers:{"Content-Type":"application/json"},method:"POST"}),i=await a.json();if(!a.ok||i.error){let s=i.error||a.statusText;typeof s=="object"&&(s=f(s));const u=i.code||"UNKNOWN";throw new Error(`${t} error: ${s}
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/in-app-wallet-calls-XjDSrm90.js","assets/thirdweb-C3Q9twFA.js","assets/index-DI_s4PrA.js","assets/send-eip712-transaction-DFFONYGB.js","assets/parse-typed-data-D3ICG98X.js","assets/types-DC0Zmj1B.js"])))=>i.map(i=>d[i]);
2
+ import{I,y as M,j as R,i as f,J as A,K as P,M as U,N as B,O as H,P as l,Q as V,R as W,S as O,_ as g,T as v,k as F,m as h,r as D,B as N,U as $,o as k,b as z}from"./thirdweb-C3Q9twFA.js";import{s as j}from"./types-DC0Zmj1B.js";function q(n){let e;return()=>(e||(e=n()),e)}function K(n={}){return I({filters:n,signature:"event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason)"})}function Z(n={}){return I({filters:n,signature:"event PostOpRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason)"})}function J(n){const{receipt:e}=n,t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs,status:e.status,to:e.to?e.to:null,transactionHash:e.transactionHash,transactionIndex:e.transactionIndex,type:e.type};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),{...n,actualGasCost:BigInt(n.actualGasCost),actualGasUsed:BigInt(n.actualGasUsed),nonce:BigInt(n.nonce),receipt:t,userOpHash:n.userOpHash}}const fe=()=>{const n=BigInt(Math.floor(Math.random()*4294967296)),e=BigInt(Math.floor(Math.random()*4294967296)),t=BigInt(Math.floor(Math.random()*4294967296)),r=BigInt(Math.floor(Math.random()*4294967296)),o=BigInt(Math.floor(Math.random()*4294967296)),p=BigInt(Math.floor(Math.random()*4294967296));return n<<BigInt(160)|e<<BigInt(128)|t<<BigInt(96)|r<<BigInt(64)|o<<BigInt(32)|p};function E(n){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,t==null||R(t)?t:M(t)]))}async function ge(n){return d({...n,operation:"eth_sendUserOperation",params:[E(n.userOp),n.options.entrypointAddress??U]})}async function we(n,e){const t=await d({...n,operation:"eth_estimateUserOperationGas",params:[E(n.userOp),n.options.entrypointAddress??U,e??{}]});return{callGasLimit:l(t.callGasLimit)+V,paymasterPostOpGasLimit:t.paymasterPostOpGasLimit!==void 0?l(t.paymasterPostOpGasLimit):void 0,paymasterVerificationGasLimit:t.paymasterVerificationGasLimit!==void 0?l(t.paymasterVerificationGasLimit):void 0,preVerificationGas:l(t.preVerificationGas),verificationGas:t.verificationGas!==void 0?l(t.verificationGas):void 0,verificationGasLimit:l(t.verificationGasLimit)}}async function Se(n){const e=await d({...n,operation:"thirdweb_getUserOperationGasPrice",params:[]});return{maxFeePerGas:l(e.maxFeePerGas),maxPriorityFeePerGas:l(e.maxPriorityFeePerGas)}}async function ve(n){var t,r;const e=await Q(n);if(e){if(e.success===!1){const p=(r=(t=B({events:[K(),Z()],logs:e.logs})[0])==null?void 0:t.args)==null?void 0:r.revertReason;if(!p)throw new Error(`UserOp failed at txHash: ${e.receipt.transactionHash}`);const a=H({data:p});throw new Error(`UserOp failed with reason: '${a.args.join(",")}' at txHash: ${e.receipt.transactionHash}`)}return e.receipt}}async function Q(n){const e=await d({operation:"eth_getUserOperationReceipt",options:n,params:[n.userOpHash]});if(e)return J(e)}async function Le(n){const e=await d({operation:"zk_paymasterData",options:n.options,params:[n.transaction]});return{paymaster:e.paymaster,paymasterInput:e.paymasterInput}}async function Y(n){const e=await d({...n,operation:"tw_execute",params:[n.eoaAddress,n.wrappedCalls,n.signature,n.authorization]});if(!e.queueId)throw new Error(`Error executing 7702 transaction: ${f(e)}`);return{transactionId:e.queueId}}async function X(n){return{transactionHash:(await d({...n,operation:"tw_getTransactionHash",params:[n.transactionId]})).transactionHash}}async function xe(n){return{transactionHash:(await d({operation:"zk_broadcastTransaction",options:n.options,params:[{...n.transaction,signedTransaction:n.signedTransaction}]})).transactionHash}}async function d(n){const{options:e,operation:t,params:r}=n,o=e.bundlerUrl??A(e.chain),a=await P(e.client)(o,{useAuthToken:!0,body:f({id:1,jsonrpc:"2.0",method:t,params:r}),headers:{"Content-Type":"application/json"},method:"POST"}),i=await a.json();if(!a.ok||i.error){let s=i.error||a.statusText;typeof s=="object"&&(s=f(s));const u=i.code||"UNKNOWN";throw new Error(`${t} error: ${s}
3
3
  Status: ${a.status}
4
- Code: ${u}`)}return i.result}const ee=W({blockExplorers:[{name:"Etherscan",url:"https://etherscan.io"}],id:1,name:"Ethereum",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"}}),te="0x3f707e6b",ne=[{type:"tuple[]",name:"calls",components:[{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}]}],ae=[];function ie(n){const e=q(async()=>"asyncParams"in n?await n.asyncParams():n);return O({contract:n.contract,method:[te,ne,ae],params:async()=>[(await e()).calls],value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value},accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList}})}async function se(n){const{client:e,chain:t,bundlerUrl:r}=n,o=r??A(t),p=`delegation-contract:${o}`;return $(async()=>{var u;const i=await P(e)(o,{useAuthToken:!0,body:f({id:1,jsonrpc:"2.0",method:"tw_getDelegationContract",params:[]}),headers:{"Content-Type":"application/json"},method:"POST"});if(!i.ok)throw new Error(`Failed to fetch delegation contract: ${i.status} ${i.statusText}`);const s=await i.json();if(s.error)throw new Error(`Delegation contract RPC error: ${JSON.stringify(s.error)}`);if(!((u=s.result)!=null&&u.delegationContract))throw new Error("Invalid response: missing delegationContract in result");return s.result.delegationContract},{cacheKey:p,cacheTime:24*60*60*1e3})}const re=n=>{const{client:e,adminAccount:t,sponsorGas:r}=n,o=async a=>{var L,x,C;const i=a[0];if(!i)throw new Error("No transactions provided");const s=v(i.chainId),u=F({address:t.address,chain:s,client:e,abi:ce});let c=(L=i.authorizationList)==null?void 0:L[0];const m=await se({client:e,chain:s});if(c&&((x=c.address)==null?void 0:x.toLowerCase())!==m.toLowerCase())throw new Error(`Authorization address does not match expected delegation contract address. Expected ${m} but got ${c.address}`);if(!c&&!await pe(u,m)){let T=i.nonce?BigInt(i.nonce):BigInt(await oe({client:e,address:t.address,chain:s}));T+=r?0n:1n;const b=await((C=t.signAuthorization)==null?void 0:C.call(t,{address:h(m),chainId:i.chainId,nonce:T}));if(!b)throw new Error("Failed to sign authorization");c=b}if(r){const y={calls:a.map(S=>({data:S.data??"0x",target:h(S.to??""),value:S.value??0n})),uid:D()},T=await t.signTypedData({domain:{chainId:i.chainId,name:"MinimalAccount",verifyingContract:u.address,version:"1"},message:y,primaryType:"WrappedCalls",types:{Call:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],WrappedCalls:[{name:"calls",type:"Call[]"},{name:"uid",type:"bytes32"}]}}),b=await Y({authorization:c,eoaAddress:h(t.address),options:{chain:v(i.chainId),client:e},signature:T,wrappedCalls:y});return{transactionHash:await ue({options:{chain:v(i.chainId),client:e},transactionId:b.transactionId})}}const w=ie({calls:a.map(y=>({data:y.data??"0x",target:h(y.to??""),value:y.value??0n})),contract:u,overrides:{authorizationList:c?[c]:void 0,value:a.reduce((y,T)=>y+(T.value??0n),0n)}}),_=await N({from:t.address,transaction:w});return t.sendTransaction(_)},p={address:t.address,sendBatchTransaction:async a=>o(a),sendTransaction:async a=>o([a]),signMessage:({message:a,originalMessage:i,chainId:s})=>t.signMessage({chainId:s,message:a,originalMessage:i}),signTypedData:a=>t.signTypedData(a),sendCalls:async a=>{const{inAppWalletSendCalls:i}=await g(async()=>{const{inAppWalletSendCalls:w}=await import("./in-app-wallet-calls-CC57SOFU.js");return{inAppWalletSendCalls:w}},__vite__mapDeps([0,1])),s=a.calls[0];if(!s)throw new Error("No calls to send");const u=s.client,c=s.chain||a.chain,m=await i({account:p,calls:a.calls,chain:c});return{chain:c,client:u,id:m}},getCallsStatus:async a=>{const{inAppWalletGetCallsStatus:i}=await g(async()=>{const{inAppWalletGetCallsStatus:s}=await import("./in-app-wallet-calls-CC57SOFU.js");return{inAppWalletGetCallsStatus:s}},__vite__mapDeps([0,1]));return i(a)},getCapabilities:async a=>({[a.chainId??1]:{atomic:{status:"supported"},paymasterService:{supported:r??!1}}})};return p};async function oe(n){const{client:e,address:t,chain:r}=n,o=z({chain:r,client:e});return await g(async()=>{const{eth_getTransactionCount:a}=await import("./thirdweb-CFgFLofm.js").then(i=>i.av);return{eth_getTransactionCount:a}},[]).then(({eth_getTransactionCount:a})=>a(o,{address:h(t),blockTag:"pending"}))}async function pe(n,e){const t=await k(n),r=t.length>0&&t.startsWith("0xef0100"),o=`0x${t.slice(8,48)}`;return r&&o.toLowerCase()===e.toLowerCase()}async function ue(n){const e=n.timeoutMs||3e5,t=n.intervalMs||1e3,r=Date.now()+e;for(;Date.now()<r;){const o=await X({options:n.options,transactionId:n.transactionId});if(o.transactionHash)return o.transactionHash;await new Promise(p=>setTimeout(p,t))}throw new Error(`Timeout waiting for transaction to be mined on chain ${n.options.chain.id} with transactionId: ${n.transactionId}`)}const ce=[{type:"receive",stateMutability:"payable"},{type:"function",name:"createSessionWithSig",inputs:[{name:"sessionSpec",type:"tuple",internalType:"struct SessionLib.SessionSpec",components:[{name:"signer",type:"address",internalType:"address"},{name:"isWildcard",type:"bool",internalType:"bool"},{name:"expiresAt",type:"uint256",internalType:"uint256"},{name:"callPolicies",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]},{name:"transferPolicies",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeWithSig",inputs:[{name:"wrappedCalls",type:"tuple",internalType:"struct WrappedCalls",components:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"getCallPoliciesForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]}],stateMutability:"view"},{type:"function",name:"getSessionExpirationForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getSessionStateForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple",internalType:"struct SessionLib.SessionState",components:[{name:"transferValue",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]},{name:"callValue",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]},{name:"callParams",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]}]}],stateMutability:"view"},{type:"function",name:"getTransferPoliciesForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}],stateMutability:"view"},{type:"function",name:"isWildcardSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"onERC1155BatchReceived",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"onERC1155Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"supportsInterface",inputs:[{name:"interfaceId",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"event",name:"Executed",inputs:[{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"},{name:"data",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"SessionCreated",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"sessionSpec",type:"tuple",indexed:!1,internalType:"struct SessionLib.SessionSpec",components:[{name:"signer",type:"address",internalType:"address"},{name:"isWildcard",type:"bool",internalType:"bool"},{name:"expiresAt",type:"uint256",internalType:"uint256"},{name:"callPolicies",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]},{name:"transferPolicies",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]}],anonymous:!1},{type:"event",name:"ValueReceived",inputs:[{name:"from",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"AllowanceExceeded",inputs:[{name:"allowanceUsage",type:"uint256",internalType:"uint256"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint64",internalType:"uint64"}]},{type:"error",name:"CallPolicyViolated",inputs:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"}]},{type:"error",name:"CallReverted",inputs:[]},{type:"error",name:"ConditionFailed",inputs:[{name:"param",type:"bytes32",internalType:"bytes32"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"condition",type:"uint8",internalType:"uint8"}]},{type:"error",name:"InvalidDataLength",inputs:[{name:"actualLength",type:"uint256",internalType:"uint256"},{name:"expectedLength",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidSignature",inputs:[{name:"msgSender",type:"address",internalType:"address"},{name:"thisAddress",type:"address",internalType:"address"}]},{type:"error",name:"LifetimeUsageExceeded",inputs:[{name:"lifetimeUsage",type:"uint256",internalType:"uint256"},{name:"limit",type:"uint256",internalType:"uint256"}]},{type:"error",name:"MaxValueExceeded",inputs:[{name:"value",type:"uint256",internalType:"uint256"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NoCallsToExecute",inputs:[]},{type:"error",name:"SessionExpired",inputs:[]},{type:"error",name:"SessionExpiresTooSoon",inputs:[]},{type:"error",name:"SessionZeroSigner",inputs:[]},{type:"error",name:"TransferPolicyViolated",inputs:[{name:"target",type:"address",internalType:"address"}]},{type:"error",name:"UIDAlreadyProcessed",inputs:[]}];async function ye(n,e,t){var p,a,i,s;if(((p=e==null?void 0:e.auth)==null?void 0:p.mode)!=="popup"&&((a=e==null?void 0:e.auth)==null?void 0:a.mode)!==void 0&&t.authenticateWithRedirect){const u=n.strategy;j.includes(u)&&await t.authenticateWithRedirect(u,(i=e==null?void 0:e.auth)==null?void 0:i.mode,(s=e==null?void 0:e.auth)==null?void 0:s.redirectUrl)}const o=(await t.connect(n)).user.account;return G({authAccount:o,client:n.client,createOptions:e,desiredChain:n.chain})}async function le(n,e,t){n.authResult&&t.loginWithAuthToken&&await t.loginWithAuthToken(n.authResult);const r=await me(t);if(!r)throw new Error("Failed to authenticate user.");const o=r.account;return G({authAccount:o,client:n.client,createOptions:e,desiredChain:n.chain})}async function de(n){const{connectSmartAccount:e}=await g(async()=>{const{connectSmartAccount:t}=await import("./index-D49q6WGA.js");return{connectSmartAccount:t}},__vite__mapDeps([2,1,3,4,5]));return e({chain:n.chain,client:n.client,personalAccount:n.authAccount},n.smartAccountOptions)}async function me(n){const e=await n.getUser();switch(e.status){case"Logged In, Wallet Initialized":return e}}async function G(n){const{createOptions:e,authAccount:t,desiredChain:r,client:o}=n;let p,a;const i=e&&"executionMode"in e?e.executionMode:void 0;if(i&&(i.mode==="EIP4337"?p=i.smartAccount:i.mode==="EIP7702"&&(a=i)),e&&"smartAccount"in e&&(e!=null&&e.smartAccount)&&(p=e.smartAccount),p){const[s,u]=await de({authAccount:t,chain:r,client:o,smartAccountOptions:p});return{account:s,adminAccount:t,chain:u}}if(a){const s=r;if(!s)throw new Error("Chain is required for EIP-7702 execution, pass a chain when connecting the inAppWallet.");return{account:re({adminAccount:t,client:o,sponsorGas:a.sponsorGas}),adminAccount:t,chain:s}}return{account:t,chain:r||ee}}const Ce=Object.freeze(Object.defineProperty({__proto__:null,autoConnectInAppWallet:le,connectInAppWallet:ye},Symbol.toStringTag,{value:"Module"}));export{Se as a,fe as b,Le as c,xe as d,we as e,ge as f,ve as g,E as h,Ce as i,q as o};
4
+ Code: ${u}`)}return i.result}const ee=W({blockExplorers:[{name:"Etherscan",url:"https://etherscan.io"}],id:1,name:"Ethereum",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"}}),te="0x3f707e6b",ne=[{type:"tuple[]",name:"calls",components:[{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}]}],ae=[];function ie(n){const e=q(async()=>"asyncParams"in n?await n.asyncParams():n);return O({contract:n.contract,method:[te,ne,ae],params:async()=>[(await e()).calls],value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value},accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList}})}async function se(n){const{client:e,chain:t,bundlerUrl:r}=n,o=r??A(t),p=`delegation-contract:${o}`;return $(async()=>{var u;const i=await P(e)(o,{useAuthToken:!0,body:f({id:1,jsonrpc:"2.0",method:"tw_getDelegationContract",params:[]}),headers:{"Content-Type":"application/json"},method:"POST"});if(!i.ok)throw new Error(`Failed to fetch delegation contract: ${i.status} ${i.statusText}`);const s=await i.json();if(s.error)throw new Error(`Delegation contract RPC error: ${JSON.stringify(s.error)}`);if(!((u=s.result)!=null&&u.delegationContract))throw new Error("Invalid response: missing delegationContract in result");return s.result.delegationContract},{cacheKey:p,cacheTime:24*60*60*1e3})}const re=n=>{const{client:e,adminAccount:t,sponsorGas:r}=n,o=async a=>{var L,x,C;const i=a[0];if(!i)throw new Error("No transactions provided");const s=v(i.chainId),u=F({address:t.address,chain:s,client:e,abi:ce});let c=(L=i.authorizationList)==null?void 0:L[0];const m=await se({client:e,chain:s});if(c&&((x=c.address)==null?void 0:x.toLowerCase())!==m.toLowerCase())throw new Error(`Authorization address does not match expected delegation contract address. Expected ${m} but got ${c.address}`);if(!c&&!await pe(u,m)){let T=i.nonce?BigInt(i.nonce):BigInt(await oe({client:e,address:t.address,chain:s}));T+=r?0n:1n;const b=await((C=t.signAuthorization)==null?void 0:C.call(t,{address:h(m),chainId:i.chainId,nonce:T}));if(!b)throw new Error("Failed to sign authorization");c=b}if(r){const y={calls:a.map(S=>({data:S.data??"0x",target:h(S.to??""),value:S.value??0n})),uid:D()},T=await t.signTypedData({domain:{chainId:i.chainId,name:"MinimalAccount",verifyingContract:u.address,version:"1"},message:y,primaryType:"WrappedCalls",types:{Call:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],WrappedCalls:[{name:"calls",type:"Call[]"},{name:"uid",type:"bytes32"}]}}),b=await Y({authorization:c,eoaAddress:h(t.address),options:{chain:v(i.chainId),client:e},signature:T,wrappedCalls:y});return{transactionHash:await ue({options:{chain:v(i.chainId),client:e},transactionId:b.transactionId})}}const w=ie({calls:a.map(y=>({data:y.data??"0x",target:h(y.to??""),value:y.value??0n})),contract:u,overrides:{authorizationList:c?[c]:void 0,value:a.reduce((y,T)=>y+(T.value??0n),0n)}}),_=await N({from:t.address,transaction:w});return t.sendTransaction(_)},p={address:t.address,sendBatchTransaction:async a=>o(a),sendTransaction:async a=>o([a]),signMessage:({message:a,originalMessage:i,chainId:s})=>t.signMessage({chainId:s,message:a,originalMessage:i}),signTypedData:a=>t.signTypedData(a),sendCalls:async a=>{const{inAppWalletSendCalls:i}=await g(async()=>{const{inAppWalletSendCalls:w}=await import("./in-app-wallet-calls-XjDSrm90.js");return{inAppWalletSendCalls:w}},__vite__mapDeps([0,1])),s=a.calls[0];if(!s)throw new Error("No calls to send");const u=s.client,c=s.chain||a.chain,m=await i({account:p,calls:a.calls,chain:c});return{chain:c,client:u,id:m}},getCallsStatus:async a=>{const{inAppWalletGetCallsStatus:i}=await g(async()=>{const{inAppWalletGetCallsStatus:s}=await import("./in-app-wallet-calls-XjDSrm90.js");return{inAppWalletGetCallsStatus:s}},__vite__mapDeps([0,1]));return i(a)},getCapabilities:async a=>({[a.chainId??1]:{atomic:{status:"supported"},paymasterService:{supported:r??!1}}})};return p};async function oe(n){const{client:e,address:t,chain:r}=n,o=z({chain:r,client:e});return await g(async()=>{const{eth_getTransactionCount:a}=await import("./thirdweb-C3Q9twFA.js").then(i=>i.av);return{eth_getTransactionCount:a}},[]).then(({eth_getTransactionCount:a})=>a(o,{address:h(t),blockTag:"pending"}))}async function pe(n,e){const t=await k(n),r=t.length>0&&t.startsWith("0xef0100"),o=`0x${t.slice(8,48)}`;return r&&o.toLowerCase()===e.toLowerCase()}async function ue(n){const e=n.timeoutMs||3e5,t=n.intervalMs||1e3,r=Date.now()+e;for(;Date.now()<r;){const o=await X({options:n.options,transactionId:n.transactionId});if(o.transactionHash)return o.transactionHash;await new Promise(p=>setTimeout(p,t))}throw new Error(`Timeout waiting for transaction to be mined on chain ${n.options.chain.id} with transactionId: ${n.transactionId}`)}const ce=[{type:"receive",stateMutability:"payable"},{type:"function",name:"createSessionWithSig",inputs:[{name:"sessionSpec",type:"tuple",internalType:"struct SessionLib.SessionSpec",components:[{name:"signer",type:"address",internalType:"address"},{name:"isWildcard",type:"bool",internalType:"bool"},{name:"expiresAt",type:"uint256",internalType:"uint256"},{name:"callPolicies",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]},{name:"transferPolicies",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeWithSig",inputs:[{name:"wrappedCalls",type:"tuple",internalType:"struct WrappedCalls",components:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"getCallPoliciesForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]}],stateMutability:"view"},{type:"function",name:"getSessionExpirationForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getSessionStateForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple",internalType:"struct SessionLib.SessionState",components:[{name:"transferValue",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]},{name:"callValue",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]},{name:"callParams",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]}]}],stateMutability:"view"},{type:"function",name:"getTransferPoliciesForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}],stateMutability:"view"},{type:"function",name:"isWildcardSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"onERC1155BatchReceived",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"onERC1155Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"supportsInterface",inputs:[{name:"interfaceId",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"event",name:"Executed",inputs:[{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"},{name:"data",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"SessionCreated",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"sessionSpec",type:"tuple",indexed:!1,internalType:"struct SessionLib.SessionSpec",components:[{name:"signer",type:"address",internalType:"address"},{name:"isWildcard",type:"bool",internalType:"bool"},{name:"expiresAt",type:"uint256",internalType:"uint256"},{name:"callPolicies",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]},{name:"transferPolicies",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]}],anonymous:!1},{type:"event",name:"ValueReceived",inputs:[{name:"from",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"AllowanceExceeded",inputs:[{name:"allowanceUsage",type:"uint256",internalType:"uint256"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint64",internalType:"uint64"}]},{type:"error",name:"CallPolicyViolated",inputs:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"}]},{type:"error",name:"CallReverted",inputs:[]},{type:"error",name:"ConditionFailed",inputs:[{name:"param",type:"bytes32",internalType:"bytes32"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"condition",type:"uint8",internalType:"uint8"}]},{type:"error",name:"InvalidDataLength",inputs:[{name:"actualLength",type:"uint256",internalType:"uint256"},{name:"expectedLength",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidSignature",inputs:[{name:"msgSender",type:"address",internalType:"address"},{name:"thisAddress",type:"address",internalType:"address"}]},{type:"error",name:"LifetimeUsageExceeded",inputs:[{name:"lifetimeUsage",type:"uint256",internalType:"uint256"},{name:"limit",type:"uint256",internalType:"uint256"}]},{type:"error",name:"MaxValueExceeded",inputs:[{name:"value",type:"uint256",internalType:"uint256"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NoCallsToExecute",inputs:[]},{type:"error",name:"SessionExpired",inputs:[]},{type:"error",name:"SessionExpiresTooSoon",inputs:[]},{type:"error",name:"SessionZeroSigner",inputs:[]},{type:"error",name:"TransferPolicyViolated",inputs:[{name:"target",type:"address",internalType:"address"}]},{type:"error",name:"UIDAlreadyProcessed",inputs:[]}];async function ye(n,e,t){var p,a,i,s;if(((p=e==null?void 0:e.auth)==null?void 0:p.mode)!=="popup"&&((a=e==null?void 0:e.auth)==null?void 0:a.mode)!==void 0&&t.authenticateWithRedirect){const u=n.strategy;j.includes(u)&&await t.authenticateWithRedirect(u,(i=e==null?void 0:e.auth)==null?void 0:i.mode,(s=e==null?void 0:e.auth)==null?void 0:s.redirectUrl)}const o=(await t.connect(n)).user.account;return G({authAccount:o,client:n.client,createOptions:e,desiredChain:n.chain})}async function le(n,e,t){n.authResult&&t.loginWithAuthToken&&await t.loginWithAuthToken(n.authResult);const r=await me(t);if(!r)throw new Error("Failed to authenticate user.");const o=r.account;return G({authAccount:o,client:n.client,createOptions:e,desiredChain:n.chain})}async function de(n){const{connectSmartAccount:e}=await g(async()=>{const{connectSmartAccount:t}=await import("./index-DI_s4PrA.js");return{connectSmartAccount:t}},__vite__mapDeps([2,1,3,4,5]));return e({chain:n.chain,client:n.client,personalAccount:n.authAccount},n.smartAccountOptions)}async function me(n){const e=await n.getUser();switch(e.status){case"Logged In, Wallet Initialized":return e}}async function G(n){const{createOptions:e,authAccount:t,desiredChain:r,client:o}=n;let p,a;const i=e&&"executionMode"in e?e.executionMode:void 0;if(i&&(i.mode==="EIP4337"?p=i.smartAccount:i.mode==="EIP7702"&&(a=i)),e&&"smartAccount"in e&&(e!=null&&e.smartAccount)&&(p=e.smartAccount),p){const[s,u]=await de({authAccount:t,chain:r,client:o,smartAccountOptions:p});return{account:s,adminAccount:t,chain:u}}if(a){const s=r;if(!s)throw new Error("Chain is required for EIP-7702 execution, pass a chain when connecting the inAppWallet.");return{account:re({adminAccount:t,client:o,sponsorGas:a.sponsorGas}),adminAccount:t,chain:s}}return{account:t,chain:r||ee}}const Ce=Object.freeze(Object.defineProperty({__proto__:null,autoConnectInAppWallet:le,connectInAppWallet:ye},Symbol.toStringTag,{value:"Module"}));export{Se as a,fe as b,Le as c,xe as d,we as e,ge as f,ve as g,E as h,Ce as i,q as o};
@@ -1,4 +1,4 @@
1
- import{I as d,m as g,r as u,o as m,q as p}from"./index-Dqt7thvX.js";import{n as s,c as v}from"./index-BWY5rLcb.js";import"./index-rgwfH8yu.js";const w=d`<svg width="86" height="96" fill="none">
1
+ import{I as d,m as g,r as u,o as m,q as p}from"./index-BTv8siy7.js";import{n as s,c as v}from"./index-BbJ97fLK.js";import"./index-B8LZftfz.js";const w=d`<svg width="86" height="96" fill="none">
2
2
  <path
3
3
  d="M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z"
4
4
  />
@@ -1,4 +1,4 @@
1
- import{m as l,r as b,n as p,o as h,q as v}from"./index-Dqt7thvX.js";import{n as r,c as f}from"./index-BWY5rLcb.js";const m=l`
1
+ import{m as l,r as b,n as p,o as h,q as v}from"./index-BTv8siy7.js";import{n as r,c as f}from"./index-BbJ97fLK.js";const m=l`
2
2
  button {
3
3
  background-color: transparent;
4
4
  padding: ${({spacing:t})=>t[1]};
@@ -1,4 +1,4 @@
1
- import{m as v,r as _,n as T,o as f,q as l,C as d,O as m,a6 as ke,H as S,a as y,M as P,t as te,E as C,K as ge,G as b,R as h,e as D,S as A,x,y as Me,W as Ve,ag as Qt,ah as we,ai as J,_ as qi,X as I,aj as nt,D as Ti,Z as Gi,Y as Xi,V as Yi,T as bt,a7 as Jt,a8 as Zt,ak as Qi,a9 as zt,al as Ji}from"./index-Dqt7thvX.js";import{n as c,c as p,U as B,r as u,b as Ri}from"./index-BWY5rLcb.js";import{o as w}from"./if-defined-BFxH3C3I.js";import"./index-rgwfH8yu.js";import"./index-BweHqCOo.js";import"./index-DS2iQg6a.js";import"./index-BCi3Crpp.js";import{a as Ra,W as Wa}from"./index-jWDkqT86.js";import"./index-BO0AJK-5.js";import"./index-DiWSbg0n.js";import"./index-B8nye65f.js";import{C as E}from"./NetworkUtil-CF6hfJpY.js";import{H as ei}from"./HelpersUtil-BheIoNW3.js";import{E as Q}from"./ExchangeController-DcCego9F.js";import"./index-UhG8UyZK.js";import"./index-ScXWC0Jt.js";import{M as gt}from"./index-CQjiMBRi.js";import"./index-fUOxcsJn.js";import"./index-Irxa35iL.js";import"./index-CRuSCuQI.js";import{e as ti,n as ii}from"./ref-DRpZWoiw.js";import"./index-B_cJLIUw.js";import{n as Zi}from"./index-DooF4pRe.js";import"./index-BirZA6-V.js";import"./index-JkcllXIB.js";import"./index-C3wiW9wU.js";import{O as yt}from"./index-u_z0VuO4.js";import{e as en}from"./index-CzTDi-Qd.js";import"./index-C2UIKTrX.js";import"./index-C8EawR99.js";import"./index-Bra3n__0.js";import{N as tn}from"./NavigationUtil-DmfK5sOV.js";import"./index-DGrL5VQf.js";import"./thirdweb-CFgFLofm.js";import"./index-B4_b4exx.js";import"./ui-BnnR-c2T.js";import"./vendor-D-D-PWUq.js";import"./ConstantsUtil-yomW0pHy.js";const nn=v`
1
+ import{m as v,r as _,n as T,o as f,q as l,C as d,O as m,a6 as ke,H as S,a as y,M as P,t as te,E as C,K as ge,G as b,R as h,e as D,S as A,x,y as Me,W as Ve,ag as Qt,ah as we,ai as J,_ as qi,X as I,aj as nt,D as Ti,Z as Gi,Y as Xi,V as Yi,T as bt,a7 as Jt,a8 as Zt,ak as Qi,a9 as zt,al as Ji}from"./index-BTv8siy7.js";import{n as c,c as p,U as B,r as u,b as Ri}from"./index-BbJ97fLK.js";import{o as w}from"./if-defined-Dw-S0ise.js";import"./index-B8LZftfz.js";import"./index-DSE85PpW.js";import"./index-DcLOFQTk.js";import"./index-CKiFyUbS.js";import{a as Ra,W as Wa}from"./index-D5iDb6Zh.js";import"./index-CfvKVkmT.js";import"./index-B99E-jw5.js";import"./index-DpMWOALf.js";import{C as E}from"./NetworkUtil-CQELJEgg.js";import{H as ei}from"./HelpersUtil-B-cAHFH5.js";import{E as Q}from"./ExchangeController-CwTbzmTL.js";import"./index-Bm1pqpw6.js";import"./index-t2VitGAA.js";import{M as gt}from"./index-BCsQysFr.js";import"./index-Cjdp2jQS.js";import"./index-BKFbKSfO.js";import"./index-CP8gwVD7.js";import{e as ti,n as ii}from"./ref-KeBo7-wj.js";import"./index-BCJ58vx8.js";import{n as Zi}from"./index-CeX6TG8F.js";import"./index-CUmC4Xrt.js";import"./index-BJd3alUP.js";import"./index-C_rsyY_8.js";import{O as yt}from"./index-C1IWXAvt.js";import{e as en}from"./index-Crl68AnY.js";import"./index-D_03GM3Y.js";import"./index-iemeyF3Y.js";import"./index-S6mWvNtu.js";import{N as tn}from"./NavigationUtil-DmfK5sOV.js";import"./index-Bn24T6C6.js";import"./thirdweb-C3Q9twFA.js";import"./index-CiP4eK6c.js";import"./ui-C_t4j8DL.js";import"./vendor-BzW03oEY.js";import"./ConstantsUtil-BGh1FFZ5.js";const nn=v`
2
2
  :host {
3
3
  display: block;
4
4
  }