@naculus/connect-appkit-ui 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/styles/components.css +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var ta=Object.create;var
|
|
2
|
-
]))+`;he.KANJI=new RegExp(
|
|
3
|
-
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};To.exports=Fe});var Po=A((Ad,tn)=>{"use strict";var
|
|
4
|
-
Suggested mode is: `+P.toString(o));switch(n===P.KANJI&&!Rt.isKanjiModeEnabled()&&(n=P.BYTE),n){case P.NUMERIC:return new Do(t);case P.ALPHANUMERIC:return new Mo(t);case P.KANJI:return new
|
|
1
|
+
var ta=Object.create;var zn=Object.defineProperty;var na=Object.getOwnPropertyDescriptor;var oa=Object.getOwnPropertyNames;var ra=Object.getPrototypeOf,aa=Object.prototype.hasOwnProperty;var A=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var sa=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of oa(e))!aa.call(t,r)&&r!==n&&zn(t,r,{get:()=>e[r],enumerable:!(o=na(e,r))||o.enumerable});return t};var ia=(t,e,n)=>(n=t!=null?ta(ra(t)):{},sa(e||!t||!t.__esModule?zn(n,"default",{value:t,enumerable:!0}):n,t));var Qn=A((cd,jn)=>{"use strict";jn.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var xe=A(Te=>{"use strict";var Kt,Da=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Te.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Te.getSymbolTotalCodewords=function(e){return Da[e]};Te.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Te.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Kt=e};Te.isKanjiModeEnabled=function(){return typeof Kt<"u"};Te.toSJIS=function(e){return Kt(e)}});var yt=A(ce=>{"use strict";ce.L={bit:1};ce.M={bit:0};ce.Q={bit:3};ce.H={bit:2};function Ma(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return ce.L;case"m":case"medium":return ce.M;case"q":case"quartile":return ce.Q;case"h":case"high":return ce.H;default:throw new Error("Unknown EC Level: "+t)}}ce.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};ce.from=function(e,n){if(ce.isValid(e))return e;try{return Ma(e)}catch{return n}}});var Yn=A((md,Gn)=>{"use strict";function $n(){this.buffer=[],this.length=0}$n.prototype={get:function(t){let e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n<e;n++)this.putBit((t>>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};Gn.exports=$n});var Xn=A((pd,Jn)=>{"use strict";function et(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}et.prototype.set=function(t,e,n,o){let r=t*this.size+e;this.data[r]=n,o&&(this.reservedBit[r]=!0)};et.prototype.get=function(t,e){return this.data[t*this.size+e]};et.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};et.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};Jn.exports=et});var Zn=A(xt=>{"use strict";var za=xe().getSymbolSize;xt.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,o=za(e),r=o===145?26:Math.ceil((o-13)/(2*n-2))*2,a=[o-7];for(let i=1;i<n-1;i++)a[i]=a[i-1]-r;return a.push(6),a.reverse()};xt.getPositions=function(e){let n=[],o=xt.getRowColCoords(e),r=o.length;for(let a=0;a<r;a++)for(let i=0;i<r;i++)a===0&&i===0||a===0&&i===r-1||a===r-1&&i===0||n.push([o[a],o[i]]);return n}});var no=A(to=>{"use strict";var Ia=xe().getSymbolSize,eo=7;to.getPositions=function(e){let n=Ia(e);return[[0,0],[n-eo,0],[0,n-eo]]}});var oo=A(I=>{"use strict";I.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var Be={N1:3,N2:3,N3:40,N4:10};I.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};I.from=function(e){return I.isValid(e)?parseInt(e,10):void 0};I.getPenaltyN1=function(e){let n=e.size,o=0,r=0,a=0,i=null,s=null;for(let l=0;l<n;l++){r=a=0,i=s=null;for(let c=0;c<n;c++){let u=e.get(l,c);u===i?r++:(r>=5&&(o+=Be.N1+(r-5)),i=u,r=1),u=e.get(c,l),u===s?a++:(a>=5&&(o+=Be.N1+(a-5)),s=u,a=1)}r>=5&&(o+=Be.N1+(r-5)),a>=5&&(o+=Be.N1+(a-5))}return o};I.getPenaltyN2=function(e){let n=e.size,o=0;for(let r=0;r<n-1;r++)for(let a=0;a<n-1;a++){let i=e.get(r,a)+e.get(r,a+1)+e.get(r+1,a)+e.get(r+1,a+1);(i===4||i===0)&&o++}return o*Be.N2};I.getPenaltyN3=function(e){let n=e.size,o=0,r=0,a=0;for(let i=0;i<n;i++){r=a=0;for(let s=0;s<n;s++)r=r<<1&2047|e.get(i,s),s>=10&&(r===1488||r===93)&&o++,a=a<<1&2047|e.get(s,i),s>=10&&(a===1488||a===93)&&o++}return o*Be.N3};I.getPenaltyN4=function(e){let n=0,o=e.data.length;for(let a=0;a<o;a++)n+=e.data[a];return Math.abs(Math.ceil(n*100/o/5)-10)*Be.N4};function La(t,e,n){switch(t){case I.Patterns.PATTERN000:return(e+n)%2===0;case I.Patterns.PATTERN001:return e%2===0;case I.Patterns.PATTERN010:return n%3===0;case I.Patterns.PATTERN011:return(e+n)%3===0;case I.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2===0;case I.Patterns.PATTERN101:return e*n%2+e*n%3===0;case I.Patterns.PATTERN110:return(e*n%2+e*n%3)%2===0;case I.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2===0;default:throw new Error("bad maskPattern:"+t)}}I.applyMask=function(e,n){let o=n.size;for(let r=0;r<o;r++)for(let a=0;a<o;a++)n.isReserved(a,r)||n.xor(a,r,La(e,a,r))};I.getBestMask=function(e,n){let o=Object.keys(I.Patterns).length,r=0,a=1/0;for(let i=0;i<o;i++){n(i),I.applyMask(i,e);let s=I.getPenaltyN1(e)+I.getPenaltyN2(e)+I.getPenaltyN3(e)+I.getPenaltyN4(e);I.applyMask(i,e),s<a&&(a=s,r=i)}return r}});var jt=A(qt=>{"use strict";var ve=yt(),vt=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Ct=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];qt.getBlocksCount=function(e,n){switch(n){case ve.L:return vt[(e-1)*4+0];case ve.M:return vt[(e-1)*4+1];case ve.Q:return vt[(e-1)*4+2];case ve.H:return vt[(e-1)*4+3];default:return}};qt.getTotalCodewordsCount=function(e,n){switch(n){case ve.L:return Ct[(e-1)*4+0];case ve.M:return Ct[(e-1)*4+1];case ve.Q:return Ct[(e-1)*4+2];case ve.H:return Ct[(e-1)*4+3];default:return}}});var ro=A(wt=>{"use strict";var tt=new Uint8Array(512),Nt=new Uint8Array(256);(function(){let e=1;for(let n=0;n<255;n++)tt[n]=e,Nt[e]=n,e<<=1,e&256&&(e^=285);for(let n=255;n<512;n++)tt[n]=tt[n-255]})();wt.log=function(e){if(e<1)throw new Error("log("+e+")");return Nt[e]};wt.exp=function(e){return tt[e]};wt.mul=function(e,n){return e===0||n===0?0:tt[Nt[e]+Nt[n]]}});var ao=A(nt=>{"use strict";var Qt=ro();nt.mul=function(e,n){let o=new Uint8Array(e.length+n.length-1);for(let r=0;r<e.length;r++)for(let a=0;a<n.length;a++)o[r+a]^=Qt.mul(e[r],n[a]);return o};nt.mod=function(e,n){let o=new Uint8Array(e);for(;o.length-n.length>=0;){let r=o[0];for(let i=0;i<n.length;i++)o[i]^=Qt.mul(n[i],r);let a=0;for(;a<o.length&&o[a]===0;)a++;o=o.slice(a)}return o};nt.generateECPolynomial=function(e){let n=new Uint8Array([1]);for(let o=0;o<e;o++)n=nt.mul(n,new Uint8Array([1,Qt.exp(o)]));return n}});var lo=A((vd,io)=>{"use strict";var so=ao();function $t(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}$t.prototype.initialize=function(e){this.degree=e,this.genPoly=so.generateECPolynomial(this.degree)};$t.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let n=new Uint8Array(e.length+this.degree);n.set(e);let o=so.mod(n,this.genPoly),r=this.degree-o.length;if(r>0){let a=new Uint8Array(this.degree);return a.set(o,r),a}return o};io.exports=$t});var Gt=A(co=>{"use strict";co.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}});var Yt=A(he=>{"use strict";var uo="[0-9]+",Wa="[A-Z $%*+\\-./:]+",ot="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ot=ot.replace(/u/g,"\\u");var Va="(?:(?![A-Z0-9 $%*+\\-./:]|"+ot+`)(?:.|[\r
|
|
2
|
+
]))+`;he.KANJI=new RegExp(ot,"g");he.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");he.BYTE=new RegExp(Va,"g");he.NUMERIC=new RegExp(uo,"g");he.ALPHANUMERIC=new RegExp(Wa,"g");var Ua=new RegExp("^"+ot+"$"),Ha=new RegExp("^"+uo+"$"),Oa=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");he.testKanji=function(e){return Ua.test(e)};he.testNumeric=function(e){return Ha.test(e)};he.testAlphanumeric=function(e){return Oa.test(e)}});var Ce=A(O=>{"use strict";var _a=Gt(),Jt=Yt();O.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};O.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};O.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};O.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};O.MIXED={bit:-1};O.getCharCountIndicator=function(e,n){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!_a.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]};O.getBestModeForData=function(e){return Jt.testNumeric(e)?O.NUMERIC:Jt.testAlphanumeric(e)?O.ALPHANUMERIC:Jt.testKanji(e)?O.KANJI:O.BYTE};O.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")};O.isValid=function(e){return e&&e.bit&&e.ccBits};function Fa(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return O.NUMERIC;case"alphanumeric":return O.ALPHANUMERIC;case"kanji":return O.KANJI;case"byte":return O.BYTE;default:throw new Error("Unknown mode: "+t)}}O.from=function(e,n){if(O.isValid(e))return e;try{return Fa(e)}catch{return n}}});var ho=A(Pe=>{"use strict";var kt=xe(),Ka=jt(),mo=yt(),Ne=Ce(),Xt=Gt(),fo=7973,po=kt.getBCHDigit(fo);function qa(t,e,n){for(let o=1;o<=40;o++)if(e<=Pe.getCapacity(o,n,t))return o}function go(t,e){return Ne.getCharCountIndicator(t,e)+4}function ja(t,e){let n=0;return t.forEach(function(o){let r=go(o.mode,e);n+=r+o.getBitsLength()}),n}function Qa(t,e){for(let n=1;n<=40;n++)if(ja(t,n)<=Pe.getCapacity(n,e,Ne.MIXED))return n}Pe.from=function(e,n){return Xt.isValid(e)?parseInt(e,10):n};Pe.getCapacity=function(e,n,o){if(!Xt.isValid(e))throw new Error("Invalid QR Code version");typeof o>"u"&&(o=Ne.BYTE);let r=kt.getSymbolTotalCodewords(e),a=Ka.getTotalCodewordsCount(e,n),i=(r-a)*8;if(o===Ne.MIXED)return i;let s=i-go(o,e);switch(o){case Ne.NUMERIC:return Math.floor(s/10*3);case Ne.ALPHANUMERIC:return Math.floor(s/11*2);case Ne.KANJI:return Math.floor(s/13);case Ne.BYTE:default:return Math.floor(s/8)}};Pe.getBestVersionForData=function(e,n){let o,r=mo.from(n,mo.M);if(Array.isArray(e)){if(e.length>1)return Qa(e,r);if(e.length===0)return 1;o=e[0]}else o=e;return qa(o.mode,o.getLength(),r)};Pe.getEncodedBits=function(e){if(!Xt.isValid(e)||e<7)throw new Error("Invalid QR Code version");let n=e<<12;for(;kt.getBCHDigit(n)-po>=0;)n^=fo<<kt.getBCHDigit(n)-po;return e<<12|n}});var vo=A(xo=>{"use strict";var Zt=xe(),yo=1335,$a=21522,bo=Zt.getBCHDigit(yo);xo.getEncodedBits=function(e,n){let o=e.bit<<3|n,r=o<<10;for(;Zt.getBCHDigit(r)-bo>=0;)r^=yo<<Zt.getBCHDigit(r)-bo;return(o<<10|r)^$a}});var No=A((Sd,Co)=>{"use strict";var Ga=Ce();function He(t){this.mode=Ga.NUMERIC,this.data=t.toString()}He.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};He.prototype.getLength=function(){return this.data.length};He.prototype.getBitsLength=function(){return He.getBitsLength(this.data.length)};He.prototype.write=function(e){let n,o,r;for(n=0;n+3<=this.data.length;n+=3)o=this.data.substr(n,3),r=parseInt(o,10),e.put(r,10);let a=this.data.length-n;a>0&&(o=this.data.substr(n),r=parseInt(o,10),e.put(r,a*3+1))};Co.exports=He});var ko=A((Td,wo)=>{"use strict";var Ya=Ce(),en=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Oe(t){this.mode=Ya.ALPHANUMERIC,this.data=t}Oe.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Oe.prototype.getLength=function(){return this.data.length};Oe.prototype.getBitsLength=function(){return Oe.getBitsLength(this.data.length)};Oe.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let o=en.indexOf(this.data[n])*45;o+=en.indexOf(this.data[n+1]),e.put(o,11)}this.data.length%2&&e.put(en.indexOf(this.data[n]),6)};wo.exports=Oe});var So=A((Bd,Ro)=>{"use strict";var Ja=Ce();function _e(t){this.mode=Ja.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}_e.getBitsLength=function(e){return e*8};_e.prototype.getLength=function(){return this.data.length};_e.prototype.getBitsLength=function(){return _e.getBitsLength(this.data.length)};_e.prototype.write=function(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data[e],8)};Ro.exports=_e});var Bo=A((Pd,To)=>{"use strict";var Xa=Ce(),Za=xe();function Fe(t){this.mode=Xa.KANJI,this.data=t}Fe.getBitsLength=function(e){return e*13};Fe.prototype.getLength=function(){return this.data.length};Fe.prototype.getBitsLength=function(){return Fe.getBitsLength(this.data.length)};Fe.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let n=Za.toSJIS(this.data[e]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
3
|
+
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};To.exports=Fe});var Po=A((Ad,tn)=>{"use strict";var rt={single_source_shortest_paths:function(t,e,n){var o={},r={};r[e]=0;var a=rt.PriorityQueue.make();a.push(e,0);for(var i,s,l,c,u,d,f,h,g;!a.empty();){i=a.pop(),s=i.value,c=i.cost,u=t[s]||{};for(l in u)u.hasOwnProperty(l)&&(d=u[l],f=c+d,h=r[l],g=typeof r[l]>"u",(g||h>f)&&(r[l]=f,a.push(l,f),o[l]=s))}if(typeof n<"u"&&typeof r[n]>"u"){var m=["Could not find a path from ",e," to ",n,"."].join("");throw new Error(m)}return o},extract_shortest_path_from_predecessor_list:function(t,e){for(var n=[],o=e,r;o;)n.push(o),r=t[o],o=t[o];return n.reverse(),n},find_path:function(t,e,n){var o=rt.single_source_shortest_paths(t,e,n);return rt.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(t){var e=rt.PriorityQueue,n={},o;t=t||{};for(o in e)e.hasOwnProperty(o)&&(n[o]=e[o]);return n.queue=[],n.sorter=t.sorter||e.default_sorter,n},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof tn<"u"&&(tn.exports=rt)});var Wo=A(Ke=>{"use strict";var P=Ce(),Do=No(),Mo=ko(),zo=So(),Io=Bo(),at=Yt(),Rt=xe(),es=Po();function Ao(t){return unescape(encodeURIComponent(t)).length}function st(t,e,n){let o=[],r;for(;(r=t.exec(n))!==null;)o.push({data:r[0],index:r.index,mode:e,length:r[0].length});return o}function Lo(t){let e=st(at.NUMERIC,P.NUMERIC,t),n=st(at.ALPHANUMERIC,P.ALPHANUMERIC,t),o,r;return Rt.isKanjiModeEnabled()?(o=st(at.BYTE,P.BYTE,t),r=st(at.KANJI,P.KANJI,t)):(o=st(at.BYTE_KANJI,P.BYTE,t),r=[]),e.concat(n,o,r).sort(function(i,s){return i.index-s.index}).map(function(i){return{data:i.data,mode:i.mode,length:i.length}})}function nn(t,e){switch(e){case P.NUMERIC:return Do.getBitsLength(t);case P.ALPHANUMERIC:return Mo.getBitsLength(t);case P.KANJI:return Io.getBitsLength(t);case P.BYTE:return zo.getBitsLength(t)}}function ts(t){return t.reduce(function(e,n){let o=e.length-1>=0?e[e.length-1]:null;return o&&o.mode===n.mode?(e[e.length-1].data+=n.data,e):(e.push(n),e)},[])}function ns(t){let e=[];for(let n=0;n<t.length;n++){let o=t[n];switch(o.mode){case P.NUMERIC:e.push([o,{data:o.data,mode:P.ALPHANUMERIC,length:o.length},{data:o.data,mode:P.BYTE,length:o.length}]);break;case P.ALPHANUMERIC:e.push([o,{data:o.data,mode:P.BYTE,length:o.length}]);break;case P.KANJI:e.push([o,{data:o.data,mode:P.BYTE,length:Ao(o.data)}]);break;case P.BYTE:e.push([{data:o.data,mode:P.BYTE,length:Ao(o.data)}])}}return e}function os(t,e){let n={},o={start:{}},r=["start"];for(let a=0;a<t.length;a++){let i=t[a],s=[];for(let l=0;l<i.length;l++){let c=i[l],u=""+a+l;s.push(u),n[u]={node:c,lastCount:0},o[u]={};for(let d=0;d<r.length;d++){let f=r[d];n[f]&&n[f].node.mode===c.mode?(o[f][u]=nn(n[f].lastCount+c.length,c.mode)-nn(n[f].lastCount,c.mode),n[f].lastCount+=c.length):(n[f]&&(n[f].lastCount=c.length),o[f][u]=nn(c.length,c.mode)+4+P.getCharCountIndicator(c.mode,e))}}r=s}for(let a=0;a<r.length;a++)o[r[a]].end=0;return{map:o,table:n}}function Eo(t,e){let n,o=P.getBestModeForData(t);if(n=P.from(e,o),n!==P.BYTE&&n.bit<o.bit)throw new Error('"'+t+'" cannot be encoded with mode '+P.toString(n)+`.
|
|
4
|
+
Suggested mode is: `+P.toString(o));switch(n===P.KANJI&&!Rt.isKanjiModeEnabled()&&(n=P.BYTE),n){case P.NUMERIC:return new Do(t);case P.ALPHANUMERIC:return new Mo(t);case P.KANJI:return new Io(t);case P.BYTE:return new zo(t)}}Ke.fromArray=function(e){return e.reduce(function(n,o){return typeof o=="string"?n.push(Eo(o,null)):o.data&&n.push(Eo(o.data,o.mode)),n},[])};Ke.fromString=function(e,n){let o=Lo(e,Rt.isKanjiModeEnabled()),r=ns(o),a=os(r,n),i=es.find_path(a.map,"start","end"),s=[];for(let l=1;l<i.length-1;l++)s.push(a.table[i[l]].node);return Ke.fromArray(ts(s))};Ke.rawSplit=function(e){return Ke.fromArray(Lo(e,Rt.isKanjiModeEnabled()))}});var Uo=A(Vo=>{"use strict";var Tt=xe(),on=yt(),rs=Yn(),as=Xn(),ss=Zn(),is=no(),sn=oo(),ln=jt(),ls=lo(),St=ho(),cs=vo(),ds=Ce(),rn=Wo();function us(t,e){let n=t.size,o=is.getPositions(e);for(let r=0;r<o.length;r++){let a=o[r][0],i=o[r][1];for(let s=-1;s<=7;s++)if(!(a+s<=-1||n<=a+s))for(let l=-1;l<=7;l++)i+l<=-1||n<=i+l||(s>=0&&s<=6&&(l===0||l===6)||l>=0&&l<=6&&(s===0||s===6)||s>=2&&s<=4&&l>=2&&l<=4?t.set(a+s,i+l,!0,!0):t.set(a+s,i+l,!1,!0))}}function ms(t){let e=t.size;for(let n=8;n<e-8;n++){let o=n%2===0;t.set(n,6,o,!0),t.set(6,n,o,!0)}}function ps(t,e){let n=ss.getPositions(e);for(let o=0;o<n.length;o++){let r=n[o][0],a=n[o][1];for(let i=-2;i<=2;i++)for(let s=-2;s<=2;s++)i===-2||i===2||s===-2||s===2||i===0&&s===0?t.set(r+i,a+s,!0,!0):t.set(r+i,a+s,!1,!0)}}function fs(t,e){let n=t.size,o=St.getEncodedBits(e),r,a,i;for(let s=0;s<18;s++)r=Math.floor(s/3),a=s%3+n-8-3,i=(o>>s&1)===1,t.set(r,a,i,!0),t.set(a,r,i,!0)}function an(t,e,n){let o=t.size,r=cs.getEncodedBits(e,n),a,i;for(a=0;a<15;a++)i=(r>>a&1)===1,a<6?t.set(a,8,i,!0):a<8?t.set(a+1,8,i,!0):t.set(o-15+a,8,i,!0),a<8?t.set(8,o-a-1,i,!0):a<9?t.set(8,15-a-1+1,i,!0):t.set(8,15-a-1,i,!0);t.set(o-8,8,1,!0)}function gs(t,e){let n=t.size,o=-1,r=n-1,a=7,i=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let l=0;l<2;l++)if(!t.isReserved(r,s-l)){let c=!1;i<e.length&&(c=(e[i]>>>a&1)===1),t.set(r,s-l,c),a--,a===-1&&(i++,a=7)}if(r+=o,r<0||n<=r){r-=o,o=-o;break}}}function hs(t,e,n){let o=new rs;n.forEach(function(l){o.put(l.mode.bit,4),o.put(l.getLength(),ds.getCharCountIndicator(l.mode,t)),l.write(o)});let r=Tt.getSymbolTotalCodewords(t),a=ln.getTotalCodewordsCount(t,e),i=(r-a)*8;for(o.getLengthInBits()+4<=i&&o.put(0,4);o.getLengthInBits()%8!==0;)o.putBit(0);let s=(i-o.getLengthInBits())/8;for(let l=0;l<s;l++)o.put(l%2?17:236,8);return bs(o,t,e)}function bs(t,e,n){let o=Tt.getSymbolTotalCodewords(e),r=ln.getTotalCodewordsCount(e,n),a=o-r,i=ln.getBlocksCount(e,n),s=o%i,l=i-s,c=Math.floor(o/i),u=Math.floor(a/i),d=u+1,f=c-u,h=new ls(f),g=0,m=new Array(i),b=new Array(i),T=0,p=new Uint8Array(t.buffer);for(let D=0;D<i;D++){let fe=D<l?u:d;m[D]=p.slice(g,g+fe),b[D]=h.encode(m[D]),g+=fe,T=Math.max(T,fe)}let x=new Uint8Array(o),B=0,w,V;for(w=0;w<T;w++)for(V=0;V<i;V++)w<m[V].length&&(x[B++]=m[V][w]);for(w=0;w<f;w++)for(V=0;V<i;V++)x[B++]=b[V][w];return x}function ys(t,e,n,o){let r;if(Array.isArray(t))r=rn.fromArray(t);else if(typeof t=="string"){let c=e;if(!c){let u=rn.rawSplit(t);c=St.getBestVersionForData(u,n)}r=rn.fromString(t,c||40)}else throw new Error("Invalid data");let a=St.getBestVersionForData(r,n);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=a;else if(e<a)throw new Error(`
|
|
5
5
|
The chosen QR Code version cannot contain this amount of data.
|
|
6
6
|
Minimum version required to store current data is: `+a+`.
|
|
7
7
|
`);let i=hs(e,n,r),s=Tt.getSymbolSize(e),l=new as(s);return us(l,e),ms(l),ps(l,e),an(l,n,0),e>=7&&fs(l,e),gs(l,i),isNaN(o)&&(o=sn.getBestMask(l,an.bind(null,l,n))),sn.applyMask(o,l),an(l,n,o),{modules:l,version:e,errorCorrectionLevel:n,maskPattern:o,segments:r}}Vo.create=function(e,n){if(typeof e>"u"||e==="")throw new Error("No input text");let o=on.M,r,a;return typeof n<"u"&&(o=on.from(n.errorCorrectionLevel,on.M),r=St.from(n.version),a=sn.from(n.maskPattern),n.toSJISFunc&&Tt.setToSJISFunction(n.toSJISFunc)),ys(e,r,o,a)}});var cn=A(Ae=>{"use strict";function Ho(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||e.length===5||e.length>8)throw new Error("Invalid hex color: "+t);(e.length===3||e.length===4)&&(e=Array.prototype.concat.apply([],e.map(function(o){return[o,o]}))),e.length===6&&e.push("F","F");let n=parseInt(e.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+e.slice(0,6).join("")}}Ae.getOptions=function(e){e||(e={}),e.color||(e.color={});let n=typeof e.margin>"u"||e.margin===null||e.margin<0?4:e.margin,o=e.width&&e.width>=21?e.width:void 0,r=e.scale||4;return{width:o,scale:o?4:r,margin:n,color:{dark:Ho(e.color.dark||"#000000ff"),light:Ho(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}};Ae.getScale=function(e,n){return n.width&&n.width>=e+n.margin*2?n.width/(e+n.margin*2):n.scale};Ae.getImageWidth=function(e,n){let o=Ae.getScale(e,n);return Math.floor((e+n.margin*2)*o)};Ae.qrToImageData=function(e,n,o){let r=n.modules.size,a=n.modules.data,i=Ae.getScale(r,o),s=Math.floor((r+o.margin*2)*i),l=o.margin*i,c=[o.color.light,o.color.dark];for(let u=0;u<s;u++)for(let d=0;d<s;d++){let f=(u*s+d)*4,h=o.color.light;if(u>=l&&d>=l&&u<s-l&&d<s-l){let g=Math.floor((u-l)/i),m=Math.floor((d-l)/i);h=c[a[g*r+m]?1:0]}e[f++]=h.r,e[f++]=h.g,e[f++]=h.b,e[f]=h.a}}});var Oo=A(Bt=>{"use strict";var dn=cn();function xs(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+"px",e.style.width=n+"px"}function vs(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}Bt.render=function(e,n,o){let r=o,a=n;typeof r>"u"&&(!n||!n.getContext)&&(r=n,n=void 0),n||(a=vs()),r=dn.getOptions(r);let i=dn.getImageWidth(e.modules.size,r),s=a.getContext("2d"),l=s.createImageData(i,i);return dn.qrToImageData(l.data,e,r),xs(s,a,i),s.putImageData(l,0,0),a};Bt.renderToDataURL=function(e,n,o){let r=o;typeof r>"u"&&(!n||!n.getContext)&&(r=n,n=void 0),r||(r={});let a=Bt.render(e,n,r),i=r.type||"image/png",s=r.rendererOpts||{};return a.toDataURL(i,s.quality)}});var Ko=A(Fo=>{"use strict";var Cs=cn();function _o(t,e){let n=t.a/255,o=e+'="'+t.hex+'"';return n<1?o+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':o}function un(t,e,n){let o=t+e;return typeof n<"u"&&(o+=" "+n),o}function Ns(t,e,n){let o="",r=0,a=!1,i=0;for(let s=0;s<t.length;s++){let l=Math.floor(s%e),c=Math.floor(s/e);!l&&!a&&(a=!0),t[s]?(i++,s>0&&l>0&&t[s-1]||(o+=a?un("M",l+n,.5+c+n):un("m",r,0),r=0,a=!1),l+1<e&&t[s+1]||(o+=un("h",i),i=0)):r++}return o}Fo.render=function(e,n,o){let r=Cs.getOptions(n),a=e.modules.size,i=e.modules.data,s=a+r.margin*2,l=r.color.light.a?"<path "+_o(r.color.light,"fill")+' d="M0 0h'+s+"v"+s+'H0z"/>':"",c="<path "+_o(r.color.dark,"stroke")+' d="'+Ns(i,a,r.margin)+'"/>',u='viewBox="0 0 '+s+" "+s+'"',f='<svg xmlns="http://www.w3.org/2000/svg" '+(r.width?'width="'+r.width+'" height="'+r.width+'" ':"")+u+' shape-rendering="crispEdges">'+l+c+`</svg>
|
|
8
|
-
`;return typeof o=="function"&&o(null,f),f}});var jo=A(st=>{"use strict";var ws=Qn(),mn=Uo(),qo=Oo(),ks=Ko();function pn(t,e,n,o,r){let a=[].slice.call(arguments,1),i=a.length,s=typeof a[i-1]=="function";if(!s&&!ws())throw new Error("Callback required as last argument");if(s){if(i<2)throw new Error("Too few arguments provided");i===2?(r=n,n=e,e=o=void 0):i===3&&(e.getContext&&typeof r>"u"?(r=o,o=void 0):(r=o,o=n,n=e,e=void 0))}else{if(i<1)throw new Error("Too few arguments provided");return i===1?(n=e,e=o=void 0):i===2&&!e.getContext&&(o=n,n=e,e=void 0),new Promise(function(l,c){try{let u=mn.create(n,o);l(t(u,e,o))}catch(u){c(u)}})}try{let l=mn.create(n,o);r(null,t(l,e,o))}catch(l){r(l)}}st.create=mn.create;st.toCanvas=pn.bind(null,qo.render);st.toDataURL=pn.bind(null,qo.renderToDataURL);st.toString=pn.bind(null,function(t,e,n){return ks.render(t,n)})});import{useState as Ht,useEffect as ba,useCallback as Vn,useRef as ya}from"react";import{AppkitConnectButton as xa}from"@naculus/connect-appkit-react";import{createContext as la,useContext as Ln,useState as ht,useCallback as zt,useEffect as ca,useMemo as zn,useRef as Lt}from"react";import{useWeb3 as da}from"@naculus/connect-appkit-react";import{jsx as ma}from"react/jsx-runtime";var Wt=la(null);function Vt({children:t}){let e=da(),[n,o]=ht(null),[r,a]=ht(!1),[i,s]=ht("idle"),[l,c]=ht(null),u=Lt(0),d=Lt(null);ca(()=>()=>{d.current&&clearTimeout(d.current)},[]);let f=zt(()=>{u.current+=1,e.cancelPairing?.(),d.current&&(clearTimeout(d.current),d.current=null),o(null),a(!1),s("cancelled"),c(null)},[e]),h=Lt(void 0);h.current=async()=>{if(!e.startPairing||!e.completePairing){c("WalletConnect pairing not available"),s("error");return}let p=++u.current,x=()=>u.current===p;s("loading"),c(null),a(!0);try{let B=await e.startPairing();if(!x())return;o(B),s("ready");try{if(await e.completePairing(),!x())return;d.current=setTimeout(()=>{d.current=null,x()&&(a(!1),o(null),s("idle"))},1e3)}catch(w){if(!x())return;s("error"),c(w instanceof Error?w.message:"Connection failed")}}catch(B){if(!x())return;s("error"),c(B instanceof Error?B.message:"Failed to generate QR code")}};let g=zt(async()=>{await h.current?.()},[]),m=zt(()=>{o(null),c(null),s("loading"),h.current?.()},[]),b=zn(()=>({qrUri:n,showQR:r,qrStatus:i,error:l}),[n,r,i,l]),T=zn(()=>({state:b,connectWalletConnect:g,cancelQR:f,retryQR:m}),[b,g,f,m]);return ma(Wt.Provider,{value:T,children:t})}function ua(){let t=Ln(Wt);if(!t)throw new Error("useWalletConnect must be used within a WalletConnectProvider");return t}function Ut(){return Ln(Wt)}import{useState as Wn,useEffect as pa,useRef as fa}from"react";function Ye(){let[t,e]=Wn([]),[n,o]=Wn(!0),r=fa(new Set);return pa(()=>{r.current.clear(),o(!0);let a=c=>{let u=c.detail,d=u?.info,f=u?.provider;!d?.rdns||r.current.has(d.rdns)||(r.current.add(d.rdns),e(h=>h.find(g=>g.id===d.rdns)?h:[...h,{id:d.rdns,name:d.name||d.rdns,icon:d.icon||"",rdns:d.rdns,provider:f}]))};window.addEventListener("eip6963:announceProvider",a);let i=window,s=(c,u,d)=>{r.current.has(c)||(r.current.add(c),e(f=>f.some(h=>h.id===c)?f:[...f,{id:c,name:u,icon:"",rdns:c,provider:d}]))};i.ethereum?.isMetaMask&&s("io.metamask","MetaMask",i.ethereum),i.phantom?s("app.phantom","Phantom",i.phantom):i.solana?.isPhantom&&s("app.phantom","Phantom",i.solana),window.dispatchEvent(new Event("eip6963:requestProvider"));let l=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),clearTimeout(l)}},[]),{wallets:t,isDetecting:n,hasWallets:t.length>0}}import{useState as ga,useEffect as ha}from"react";function Je(){let[t,e]=ga(!1);return ha(()=>{if(typeof navigator>"u"||typeof window>"u")return;let n=navigator.userAgent.toLowerCase();e(/(iphone|ipad|ipod|android|mobile)/i.test(n))},[]),t}import{jsx as Un}from"react/jsx-runtime";function Se({className:t,isConnected:e,isConnecting:n,onConnect:o,onDisconnect:r,onMobileDeepLink:a,mobileWalletName:i,startPairing:s,completePairing:l,address:c,balance:u,balanceSymbol:d,tokenBalances:f,isBalanceLoading:h,explorerUrl:g,explorerLabel:m}){let b=Ut(),{wallets:T}=Ye(),p=Je(),x=JSON.stringify(T.map(({id:j,name:ue,icon:J,rdns:Le})=>({id:j,name:ue,icon:J,rdns:Le}))),[B,w]=Ht(null),[V,D]=Ht(!1),[fe,Y]=Ht(null),re=ya({aborted:!1}),Ge=Vn(()=>{re.current.aborted=!0,b?.cancelQR(),D(!1),w(null),Y(null)},[b]);ba(()=>{if(!b)return;let{qrStatus:j,qrUri:ue,error:J}=b.state;j==="loading"?(D(!0),w(null),Y(null)):j==="ready"&&ue?(D(!1),w(ue),Y(null)):j==="error"?(D(!1),Y(J)):(j==="idle"||j==="cancelled")&&(D(!1),w(null),Y(null))},[b?.state?.qrStatus,b?.state?.qrUri,b?.state?.error]);let ge=Vn((j,ue)=>{if(j==="walletconnect"){if(b){b.connectWalletConnect();return}if(s&&l){D(!0),Y(null),re.current.aborted=!1,s().then(J=>{re.current.aborted||(w(J),D(!1),l().then(()=>{re.current.aborted||w(null)}).catch(Le=>{re.current.aborted||Y(Le instanceof Error?Le.message:"Connection failed")}))}).catch(J=>{re.current.aborted||(D(!1),Y(J instanceof Error?J.message:"Connection failed"))});return}}o?.(j,()=>{},ue)},[b,s,l,o]);return Un("div",{className:t,children:Un(xa,{connected:e??!1,connecting:n??!1,address:c??"",balance:u??null,balanceSymbol:d??"",isBalanceLoading:h??!1,tokenBalancesJson:JSON.stringify(f??[]),explorerUrl:g??"",explorerLabel:m??"",walletsJson:x,isMobile:p,mobileWalletName:i??"",qrUri:B,qrLoading:V,qrError:fe,onAppkitConnect:j=>{ge(j.detail.kind,j.detail.walletId)},onAppkitDisconnect:()=>r?.(),onAppkitStartPairing:()=>ge("walletconnect"),onAppkitRetry:()=>{re.current.aborted=!0,Y(null),w(null),ge("walletconnect")},onAppkitCancelPairing:Ge,onAppkitMobileDeepLink:()=>a?.(),onAppkitCopyAddress:j=>{navigator.clipboard?.writeText(j.detail).catch(()=>{})}})})}import{logger as gi}from"@naculus/connect-core";import{useState as hi,useRef as bi,useEffect as yi}from"react";import{useChain as xi,useWallet as vi}from"@naculus/connect-appkit-react";import{clsx as va}from"clsx";import{twMerge as Ca}from"tailwind-merge";function y(...t){return Ca(va(t))}var Hn='<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 0l-.26.97v28.15l.26.26 13.07-7.72L12 0z" fill="#8C8C8C"/><path d="M12 0L-.87 21.69l12.87 7.72V0z" fill="#3C3C3B"/><path d="M12 31.88l-.16.2v10.55l.16.47 13.08-18.42L12 31.88z" fill="#8C8C8C"/><path d="M12 42.9V31.88L-.87 24.68 12 42.9z" fill="#3C3C3B"/><path d="M12 28.41l13.07-7.72L12 14.09v14.32z" fill="#141414"/><path d="M-.87 20.69L12 28.41V14.09l-12.87 6.6z" fill="#393939"/></svg>',Na='<svg viewBox="0 0 24 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15 12.3l-3.7 2.2-3.8-2.2V7.9L11.3 5.7 15 7.9v2.7l-2.2 1.3-1.5-.9v-2l1.5.9 2.2-1.3V7.9L11.3 4 6 7.9v6.3l5.3 3.1 5.3-3.1-1.6-2.8z" fill="#6C00F6"/></svg>',wa='<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="#F0B90B"/><path d="M12 4l2.7 1.6L14.7 7 12 5.4 9.3 7l-.7-.4L12 4zm4.7 2.7l-2.7 1.6V10l4 2.3v4.7L16 18.7v-4l-1.3-.7v4L12 20l-2.7-1.6v-4L8 14.7v4l-1.3-.7V12.3l4-2.3V8.3l-2.7-1.6.7-.4L12 8l2.7-1.7.7.4z" fill="white"/></svg>',ka='<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 1.5c.3 0 .6.1.8.2l8.8 5.1c.5.3.9.9.9 1.5v10.2c0 .6-.3 1.2-.9 1.5l-8.8 5.1c-.3.2-.6.2-.8.2s-.6-.1-.8-.2l-8.8-5.1c-.5-.3-.9-.9-.9-1.5V8.3c0-.6.3-1.2.9-1.5l8.8-5.1c.3-.2.6-.2.8-.2z" fill="#213147"/><path d="M14.7 13.8l-1.2 3.2c0 .1 0 .2.1.3l2 5.5 2.3-1.3-2.8-7.6c-.1-.2-.3-.2-.4-.1z" fill="#12AAFF"/><path d="M16.3 8.5c0-.2-.3-.2-.4 0l-1.1 3.2c0 .1 0 .2.1.3l3.3 9 2.3-1.3-4.2-9.1v-.1z" fill="#12AAFF"/><path d="M12 3.5c.1 0 .2 0 .3.1l8.8 5.1c.1.1.2.2.2.3v10.2c0 .1-.1.2-.2.3l-8.8 5.1c-.1 0-.2.1-.3.1s-.2 0-.3-.1l-8.8-5.1c-.1-.1-.2-.2-.2-.3V9c0-.1.1-.2.2-.3l8.8-5.1c.1 0 .2-.1.3-.1z" fill="#9DCCED" fill-opacity="0.3"/><path d="M13.3 6.2h-2.2c-.2 0-.3.1-.4.3L5.9 19.6l2.3 1.3L13 6.5c0-.1-.1-.3-.2-.3h.4z" fill="white"/><path d="M15.2 6.2H13c-.2 0-.3.1-.4.3L8.1 21.4l2.3 1.3 6-16.4c0-.1-.1-.3-.2-.3v.2z" fill="white"/></svg>',Ra='<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="#FF0420"/><path d="M8.5 16c-.5 0-.9-.1-1.3-.3-.4-.2-.7-.5-1-.8-.3-.4-.4-.8-.4-1.3V10c0-.5.1-1 .4-1.4.3-.4.6-.7 1-.9.4-.2.8-.3 1.3-.3.4 0 .8.1 1.2.2.3.2.6.4.8.7l-1 1c-.2-.2-.4-.3-.6-.4-.2-.1-.5-.2-.8-.2-.3 0-.6.1-.9.2-.3.2-.5.4-.6.7-.1.3-.2.6-.2 1v3.5c0 .3.1.6.2.9.1.3.3.5.6.6.3.2.6.2.9.2.3 0 .6-.1.8-.2.2-.1.4-.3.6-.5l1 1c-.2.3-.5.5-.8.7-.4.2-.9.3-1.4.3z" fill="white"/><path d="M15.5 16c-.5 0-.9-.1-1.3-.3-.4-.2-.7-.5-1-.8-.2-.4-.4-.8-.4-1.3V10c0-.5.1-1 .4-1.4.2-.4.5-.7.9-.9.4-.2.8-.3 1.3-.3.5 0 1 .1 1.4.3.4.2.7.5.9.9.2.4.3.9.3 1.4v.7h-2.9v-1.1c0-.3-.1-.6-.2-.9-.1-.3-.3-.5-.5-.6-.2-.1-.5-.2-.8-.2-.3 0-.6.1-.8.2-.3.2-.5.4-.6.7-.1.3-.2.6-.2 1v3.5c0 .3.1.6.2.8.1.3.3.5.6.6.2.2.5.2.8.2.3 0 .6-.1.8-.2.2-.1.4-.3.5-.6.1-.3.2-.6.2-1v-1.1h2.9v.7c0 .5-.1 1-.3 1.4-.2.4-.5.7-.9.9-.4.2-.9.3-1.4.3z" fill="white"/></svg>',Sa='<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="#E84142"/><path d="M8.6 16.8H6.3c-.5 0-.8-.1-1-.3-.2-.2-.3-.5-.3-.8 0-.2 0-.4.1-.6l5.8-10.7c.2-.4.5-.7.8-.8.3-.1.5-.1.7 0 .2.1.5.3.7.8l1.2 2.1.1.2c.3.5.5.9.5 1.3.1.4.1.8 0 1.1-.1.4-.3.8-.6 1.3l-3 5.4c-.2.5-.5.8-.8 1-.4.2-.7.2-1.2.2z" fill="white"/><path d="M14.5 16.8h3.3c.5 0 .7-.1 1-.3.2-.2.3-.5.3-.8 0-.2-.1-.4-.3-.7l-1.7-3-.2-.3c-.2-.4-.4-.7-.6-.8-.2-.1-.4-.1-.6 0-.2.1-.4.3-.6.8l-1.6 3c-.2.4-.4.7-.4.9 0 .2.1.5.3.7.1.1.4.3.9.3z" fill="white"/></svg>',Ta='<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="#1969FF"/><path d="M11.3 3.8c.4-.2 1-.2 1.4 0l4.1 2.2c.2.1.4.3.4.5h0v10.9c0 .2-.1.4-.4.6l-4.1 2.2c-.4.2-1 .2-1.4 0l-4.1-2.2c-.3-.1-.4-.4-.4-.6V6.5c0-.2.1-.4.4-.5l4.1-2.2zm5.3 8.7l-3.9 2c-.4.2-1 .2-1.4 0l-3.9-2v4.8l3.9 2c.2.1.5.2.7.2.2 0 .5-.1.7-.2l3.9-2v-4.8z" fill="white"/></svg>',Ba={"eip155:1":Hn,"eip155:137":Na,"eip155:56":wa,"eip155:42161":ka,"eip155:10":Ra,"eip155:43114":Sa,"eip155:250":Ta,"eip155:11155111":Hn};function bt(t){return Ba[t]}import{createContext as ci,useContext as di,useMemo as ui}from"react";import{Wallet as Pa}from"lucide-react";import{jsx as Xe}from"react/jsx-runtime";function M({className:t,variant:e,size:n,type:o="button",...r}){return Xe("button",{type:o,className:y("inline-flex items-center justify-center gap-2 rounded-lg border px-4 py-2 text-sm font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",e==="outline"?"border-input bg-transparent hover:bg-accent":e==="ghost"?"border-transparent bg-transparent hover:bg-accent":"border-primary bg-primary text-primary-foreground hover:bg-primary/90",n==="sm"?"h-9 px-3":n==="icon"?"h-10 w-10 p-0":"h-10",t),...r})}function me({className:t,...e}){return Xe("div",{className:y("rounded-xl border border-border bg-card text-card-foreground shadow-sm",t),...e})}function We({className:t,variant:e,...n}){return Xe("span",{className:y("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium",t),...n})}function On(t){return Xe("input",{...t})}function _n({className:t,...e}){return Xe("hr",{className:y("h-px bg-border",t),...e})}import{jsx as Ve,jsxs as Ot}from"react/jsx-runtime";function Aa({children:t}){return Ve("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-primary text-primary-foreground",children:t})}function _t({className:t,showAddress:e=!0,showBalance:n=!1,address:o,balance:r,balanceSymbol:a,onConnect:i}){let l=S().Button??M;if(!o)return Ot(l,{"aria-label":"Connect Wallet",onClick:i,className:t,children:[Ve(Pa,{size:18,className:"shrink-0"}),"Connect Wallet"]});let c=o.includes(":")?o.split(":").pop():o,u=c.slice(0,6)+"..."+c.slice(-4),d=r!=null?parseFloat(r).toLocaleString(void 0,{maximumFractionDigits:4})+(a?` ${a}`:""):null;return Ot(l,{className:t,children:[Ve(Aa,{children:"W"}),Ot("div",{className:"flex flex-col items-start gap-0",children:[e&&Ve("span",{className:"font-mono text-xs",children:u}),n&&d&&Ve("span",{className:"text-xs text-muted-foreground",children:d}),n&&!d&&r===null&&Ve("span",{className:"text-xs text-muted-foreground",children:"Loading..."})]})]})}import{useRef as Qo,useEffect as $o,useState as Go,useCallback as Rs}from"react";import{Smartphone as Ss,RefreshCw as Yo,CheckCircle2 as Ts,AlertCircle as Jo,Loader2 as Bs}from"lucide-react";import{useEffect as Fn}from"react";import{X as Ea}from"lucide-react";import{jsx as ye,jsxs as Ft}from"react/jsx-runtime";function Ue({open:t,onClose:e,children:n,closable:o,className:r}){return Fn(()=>{if(!t)return;let a=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=a}},[t]),Fn(()=>{if(!t||!e)return;let a=i=>{i.key==="Escape"&&e()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,e]),t?Ft("div",{className:y("fixed inset-0 z-50 flex items-center justify-center p-4",r),style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",padding:"1rem"},children:[ye("div",{className:"absolute inset-0 bg-black/80","aria-hidden":"true",onClick:e,style:{position:"absolute",inset:0,background:"rgb(0 0 0 / 0.8)"}}),Ft("div",{role:"dialog","aria-modal":"true",className:"relative z-10 w-full max-w-sm rounded-xl border bg-card text-card-foreground shadow-2xl max-h-[85vh] overflow-y-auto p-6",style:{position:"relative",zIndex:10,width:"100%",maxWidth:"24rem",maxHeight:"85vh",overflowY:"auto",borderRadius:"0.75rem",padding:"1.5rem",background:"hsl(var(--card, 0 0% 100%))",color:"hsl(var(--card-foreground, 222.2 84% 4.9%))",boxShadow:"0 25px 50px -12px rgb(0 0 0 / 0.4)"},children:[o&&e&&ye("button",{onClick:e,type:"button","aria-label":"Close modal",className:"absolute right-4 top-4 z-20 rounded-md p-1 text-muted-foreground hover:text-foreground",style:{position:"absolute",right:"1rem",top:"1rem",zIndex:20,border:0,background:"transparent",cursor:"pointer",color:"inherit"},children:ye("svg",{"aria-hidden":"true",className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:ye("path",{d:"M18 6 6 18M6 6l12 12","data-testid":"x-icon"})})}),n]})]}):null}function Kn({title:t,onClose:e,showCloseButton:n=!0}){return Ft("div",{className:"flex items-center justify-between mb-4",children:[ye("h2",{className:"text-lg font-semibold m-0",children:t}),n&&e&&ye("button",{onClick:e,type:"button",className:"rounded-md p-1 text-muted-foreground hover:text-foreground transition-all duration-200","aria-label":"Close",children:ye(Ea,{size:16})})]})}function qn({children:t,className:e=""}){return ye("div",{className:y("flex flex-col gap-4",e),children:t})}import{jsx as _,jsxs as pe}from"react/jsx-runtime";async function Ps(t,e){let n=await Promise.resolve().then(()=>ia(jo(),1)),r=(n.default??n).toCanvas??n.toCanvas;if(typeof r!="function")throw new Error("qrcode.toCanvas is unavailable");return new Promise((a,i)=>{r(t,e,{width:280,margin:2},s=>{s?i(s):a()})})}function it({uri:t,open:e,onClose:n,onDeepLink:o,onRetry:r,status:a="pending",showDeepLink:i,timeoutMs:s=300*1e3,title:l="Scan with WalletConnect",description:c="Open your wallet app and scan this QR code to connect.",className:u}){let d=Qo(null),[f,h]=Go(null),[g,m]=Go(0),b=Je(),T=S(),p=T.Button,x=i??b,B=Qo(null);$o(()=>{!e||!t||!d.current||(h(null),Ps(d.current,t).catch(J=>{h(J instanceof Error?J.message:"Unable to render QR code")}))},[e,t]),$o(()=>{if(!e||a!=="pending"){B.current&&(clearInterval(B.current),B.current=null),m(0);return}let J=Date.now();return B.current=setInterval(()=>m(Date.now()-J),1e3),()=>{B.current&&clearInterval(B.current)}},[e,a,s]);let w=g>=s&&a==="pending",V=w||a==="expired"||a==="error",D=Math.max(0,Math.ceil((s-g)/1e3)),fe=Math.floor(D/60),Y=D%60,re=Math.min(g/s,1),Ge=Rs(()=>{t&&o&&o(t)},[t,o]),ge=t&&!w&&a==="pending"?f?pe("div",{className:"w-[280px] h-[280px] flex flex-col items-center justify-center bg-muted rounded-lg gap-2",children:[_(Jo,{size:24,className:"text-muted-foreground"}),_("span",{className:"text-sm text-muted-foreground",children:"Failed to render QR code"})]}):_("canvas",{ref:d,width:280,height:280,role:"img","aria-label":"WalletConnect pairing QR code",className:"rounded-lg border border-border"}):pe("div",{className:"flex flex-col items-center justify-center gap-3 bg-muted rounded-lg w-[280px] h-[280px]",children:[a==="scanned"?_(Ts,{size:48,className:"text-[hsl(var(--primary))]"}):_(Jo,{size:48,className:"text-destructive"}),_("span",{className:"text-sm text-muted-foreground","data-testid":"status-label",children:a==="scanned"?"QR code scanned! Connecting...":w||a==="expired"?"Connection timed out.":"Something went wrong. Try again."})]}),ue=T.Modal??Ue;return _(ue,{open:e,onClose:n,closable:!0,title:l,className:u,children:pe("div",{className:"p-6",children:[pe("div",{className:"text-center mb-5",children:[_("div",{className:"flex justify-center mb-3",children:a==="pending"&&!w&&_(Bs,{size:20,className:"animate-spin text-primary","data-testid":"loader-icon-inline"})}),_("h3",{className:"text-lg font-semibold m-0 text-foreground",children:l}),c&&_("p",{className:"text-sm text-muted-foreground mt-1.5 mb-0",children:c})]}),_("div",{className:"flex justify-center mb-4",children:ge}),a==="pending"&&!w&&pe("div",{className:"mb-3",children:[_("div",{className:"h-1 bg-muted rounded-full overflow-hidden",role:"progressbar","aria-valuenow":Math.round((1-re)*100),"aria-valuemin":0,"aria-valuemax":100,children:_("div",{className:"h-full bg-primary rounded-full transition-all duration-1000",style:{width:`${(1-re)*100}%`}})}),pe("p",{"data-testid":"countdown",className:"text-xs text-muted-foreground text-center mt-1.5 mb-0",children:["Expires in ",fe,":",Y.toString().padStart(2,"0")]})]}),pe("div",{className:"flex flex-col gap-2",children:[x&&t&&a==="pending"&&!w&&pe("button",{type:"button",onClick:Ge,className:"inline-flex items-center justify-center gap-2 w-full rounded-lg border border-input bg-card px-4 py-2.5 text-sm font-medium text-foreground hover:bg-accent hover:text-accent-foreground transition-all duration-200 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:[_(Ss,{size:16})," Open in Wallet App"]}),V&&r&&(p?pe(p,{onClick:r,variant:"default",size:"default",className:"w-full",children:[_(Yo,{size:16})," Generate New QR Code"]}):pe("button",{type:"button",onClick:r,className:"inline-flex items-center justify-center gap-2 w-full rounded-lg bg-primary text-primary-foreground px-4 py-2.5 text-sm font-medium hover:bg-primary/90 transition-all duration-200 cursor-pointer border-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:[_(Yo,{size:16})," Generate New QR Code"]})),p?_(p,{onClick:n,variant:"outline",size:"default",className:"w-full",children:"Cancel"}):_("button",{type:"button",onClick:n,className:"inline-flex items-center justify-center w-full rounded-lg border border-input bg-transparent px-4 py-2.5 text-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all duration-200 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:"Cancel"})]})]})})}import{useState as fn}from"react";import{LogIn as As,Loader2 as Es,CheckCircle2 as hn,AlertCircle as Ds,X as Ms,Copy as Is,Check as zs}from"lucide-react";import{Fragment as Xo,jsx as k,jsxs as Q}from"react/jsx-runtime";function bn({className:t,isSignedIn:e=!1,isSigningIn:n=!1,result:o=null,error:r=null,onSignIn:a,onClearError:i,children:s}){let[l,c]=fn(!1),[u,d]=fn(!1),[f,h]=fn(!1),g=S(),m=g.Button??M,b=g.Dialog,T=g.DialogContent,p=g.DialogHeader,x=g.DialogTitle,B=async()=>{if(o?.signature)try{await navigator.clipboard.writeText(o.signature),h(!1),d(!0),setTimeout(()=>d(!1),2e3)}catch{d(!1),h(!0)}};return!e&&!n&&!r?k(m,{onClick:a,className:t,"aria-label":"Sign In",children:Q("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"},children:[k(As,{size:16}),s??"Sign In"]})}):n?k(m,{disabled:!0,className:t,"aria-label":"Signing In",children:Q("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"},children:[k(Es,{size:16,className:"animate-spin"}),"Signing In..."]})}):r&&!e?Q("div",{style:{position:"relative",display:"inline-flex",flexDirection:"column"},children:[k(m,{onClick:a,className:t,"aria-label":"Retry Sign In",children:Q("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"},children:[k(Ds,{size:16,style:{color:"var(--destructive, #ef4444)"}}),s??"Retry Sign In"]})}),k("div",{style:{fontSize:"0.75rem",color:"var(--destructive, #ef4444)",padding:"0.25rem 0.5rem",borderRadius:"0.375rem",background:"var(--destructive-foreground, #fef2f2)",marginTop:"2px",wordBreak:"break-word",maxWidth:"100%",lineHeight:1.4},children:r.message})]}):Q("div",{style:{position:"relative",display:"inline-block"},children:[k(m,{onClick:()=>c(w=>!w),className:t,children:Q("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"},children:[k(hn,{size:16,style:{color:"#22c55e"}}),k("span",{style:{fontSize:"0.875rem",fontWeight:500},children:"Signed In"})]})}),l&&(b&&T?k(b,{open:!0,onOpenChange:w=>{w||c(!1)},children:k(T,{children:p&&x?Q(Xo,{children:[k(p,{children:k(x,{children:"Sign-In Details"})}),k(gn,{result:o,onClose:()=>c(!1),copiedSign:u,copyFailed:f,onCopy:B})]}):Q(Xo,{children:[k("div",{style:{fontWeight:600,fontSize:"1.125rem",marginBottom:"0.75rem"},children:"Sign-In Details"}),k(gn,{result:o,onClose:()=>c(!1),copiedSign:u,copyFailed:f,onCopy:B})]})})}):l&&k("div",{style:{position:"absolute",top:"calc(100% + 8px)",right:0,zIndex:100,width:"340px",maxWidth:"90vw",background:"var(--card, #fff)",border:"1px solid var(--border, #e2e8f0)",borderRadius:"0.75rem",boxShadow:"0 10px 25px rgba(0,0,0,0.1)",padding:"1rem"},children:k(gn,{result:o,onClose:()=>c(!1),copiedSign:u,copyFailed:f,onCopy:B})}))]})}function gn({result:t,onClose:e,copiedSign:n,onCopy:o,copyFailed:r}){let i=S().Button??M;if(!t)return Q("div",{style:{textAlign:"center",padding:"1rem 0"},children:[k(hn,{size:32,style:{color:"#22c55e",margin:"0 auto 0.75rem"}}),k("p",{style:{fontSize:"0.875rem",color:"var(--muted-foreground, #64748b)"},children:"Authenticated successfully"}),k(i,{variant:"outline",size:"sm",onClick:e,children:"Close"})]});let{message:s,signature:l}=t,c=l.length>20?l.slice(0,14)+"..."+l.slice(-6):l;return Q("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[Q("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Q("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[k(hn,{size:18,color:"#22c55e"}),k("span",{style:{fontWeight:600,fontSize:"0.9375rem"},children:"Signed In"})]}),k(i,{variant:"ghost",size:"icon",onClick:e,children:k(Ms,{size:16})})]}),Q("div",{style:{display:"grid",gap:"0.375rem"},children:[Q("div",{children:[k("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Domain"}),k("p",{style:{fontSize:"0.8125rem",fontFamily:"monospace",marginTop:"0.125rem"},children:s.domain})]}),Q("div",{children:[k("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Address"}),k("p",{style:{fontSize:"0.8125rem",fontFamily:"monospace",marginTop:"0.125rem",wordBreak:"break-all"},children:s.address})]}),Q("div",{children:[k("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Chain"}),k("p",{style:{fontSize:"0.8125rem",fontFamily:"monospace",marginTop:"0.125rem"},children:s.chainId})]})]}),s.statement&&k("div",{style:{padding:"0.5rem 0.625rem",borderRadius:"0.375rem",background:"var(--muted, #f1f5f9)",fontSize:"0.8125rem",lineHeight:1.5},children:s.statement}),Q("div",{children:[Q("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"0.25rem"},children:[k("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Signature"}),k(i,{variant:"ghost",size:"icon",onClick:o,title:r?"This browser refused the clipboard \u2014 select the signature and copy it":"Copy signature","aria-label":r?"Copy failed":"Copy signature",children:n?k(zs,{size:12,color:"#22c55e"}):k(Is,{size:12})})]}),k("p",{style:{fontSize:"0.75rem",fontFamily:"monospace",wordBreak:"break-all",lineHeight:1.4,color:"var(--muted-foreground, #64748b)",background:"var(--muted, #f1f5f9)",padding:"0.375rem 0.5rem",borderRadius:"0.375rem"},children:c})]}),k(i,{variant:"outline",className:"w-full",onClick:e,children:"Close"})]})}import{useState as be,useCallback as Ee,useMemo as Zo}from"react";import{AlertTriangle as Ls,Check as yn,Copy as Ws,Download as Vs,Eye as Us,EyeOff as Hs,SkipForward as er,ArrowLeft as Os,ArrowRight as _s,Shield as Fs,X as Ks}from"lucide-react";import{Fragment as vn,jsx as N,jsxs as E}from"react/jsx-runtime";function qs(t){let e=Math.floor(4294967296/t)*t,n=new Uint32Array(1),o;do crypto.getRandomValues(n),o=n[0];while(o>=e);return o%t}function xn(t){let e=[...t];for(let n=e.length-1;n>0;n--){let o=qs(n+1);[e[n],e[o]]=[e[o],e[n]]}return e}function tr(t,e=3){let n=t.trim().split(/\s+/);return xn(n.map((r,a)=>a)).slice(0,Math.min(e,n.length)).map(r=>{let a=n[r],i=n.filter((c,u)=>u!==r),s=xn(i).slice(0,3),l=xn([a,...s]);return{index:r,correct:a,options:l}})}function lt({seedPhrase:t,onConfirm:e,onSkip:n,onExportPrivateKey:o,className:r,wordCount:a,inline:i=!1,open:s=!0,onOpenChange:l}){let c=S(),u=c.Button??M,d=c.Dialog,f=c.DialogContent,h=c.DialogHeader,g=c.DialogTitle,[m,b]=be("reveal"),[T,p]=be(!1),[x,B]=be(!1),[w,V]=be(!1),[D,fe]=be(()=>tr(t,3)),[Y,re]=be({}),[Ge,ge]=be([]),[j,ue]=be(!1),[J,Le]=be(null),Dn=Zo(()=>t.trim().split(/\s+/),[t]),Fr=Zo(()=>{let L=new Map;return Dn.map(X=>{let ae=L.get(X)??0;return L.set(X,ae+1),{word:X,key:`${X}-${ae}`}})},[Dn]),Kr=Ee(()=>p(!0),[]),qr=Ee(async()=>{try{await navigator.clipboard.writeText(t),V(!1),B(!0),setTimeout(()=>B(!1),2e3)}catch{B(!1),V(!0)}},[t]),jr=Ee(()=>{fe(tr(t,3)),re({}),ge([]),b("confirm")},[t]),Qr=Ee((L,X)=>{re(ae=>({...ae,[L]:X})),ge(ae=>ae.filter(It=>It!==L))},[]),$r=Ee(()=>{let L=[];for(let X of D)Y[X.index]!==X.correct&&L.push(X.index);if(L.length>0){ge(L);return}b("done"),e()},[D,Y,e]),Mn=Ee(()=>{n?.()},[n]),Gr=Ee(()=>{if(o){let L=o();Le(L),ue(!0)}},[o]),Yr=D.every(L=>Y[L.index]!==void 0),Jr=E("div",{className:"space-y-4",children:[N("div",{className:"rounded-lg border border-amber-200 bg-amber-50 dark:border-amber-800 dark:bg-amber-950/30 px-4 py-3",children:E("div",{className:"flex items-start gap-2",children:[N(Ls,{size:16,className:"mt-0.5 shrink-0 text-amber-600 dark:text-amber-400"}),N("p",{className:"text-sm text-amber-800 dark:text-amber-200",children:"Write down these words in order and store them somewhere safe. Never share them with anyone. If you lose your seed phrase, your funds cannot be recovered."})]})}),T?E(vn,{children:[N("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:Fr.map(({word:L,key:X},ae)=>E("div",{className:"flex items-center gap-1.5 rounded-md border bg-card px-2.5 py-1.5 text-sm",children:[N("span",{className:"text-xs text-muted-foreground w-5 shrink-0 text-right",children:ae+1}),N("span",{className:"font-mono font-medium",children:L})]},X))}),E("div",{className:"flex flex-wrap gap-2",children:[E(u,{onClick:qr,variant:"outline",size:"sm",children:[x?N(yn,{size:14}):N(Ws,{size:14}),x?"Copied":w?"Copy failed":"Copy"]}),o&&E(u,{onClick:Gr,variant:"outline",size:"sm",children:[N(Vs,{size:14}),"Export Private Key"]})]}),w&&N("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive",children:"This browser would not let the page write to your clipboard. Nothing was copied \u2014 select the words above and copy them yourself, or write them down."}),j&&J&&E("div",{className:"rounded-lg border border-border bg-muted p-3 space-y-2",children:[E("div",{className:"flex items-center gap-2",children:[N(Hs,{size:14,className:"text-muted-foreground"}),N("span",{className:"text-xs font-medium text-muted-foreground",children:"Private Key (keep secret!)"})]}),N("p",{className:"font-mono text-xs break-all select-all",children:J})]}),E("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-between",children:[E(u,{onClick:jr,variant:"default",children:["I've Saved It",N(_s,{size:16})]}),n&&E(u,{onClick:Mn,variant:"ghost",size:"sm",children:[N(er,{size:14}),"Skip Backup"]})]})]}):E("div",{className:"flex flex-col items-center gap-3 py-6",children:[N(Fs,{size:40,className:"text-muted-foreground"}),N("p",{className:"text-sm text-muted-foreground text-center",children:"Click the button below to reveal your seed phrase. Make sure no one is watching your screen."}),E(u,{onClick:Kr,variant:"default",children:[N(Us,{size:16}),"Reveal Seed Phrase"]})]})]}),Xr=E("div",{className:"space-y-4",children:[N("p",{className:"text-sm text-muted-foreground",children:"Verify your backup by selecting the correct word for each position."}),D.map(L=>{let X=Ge.includes(L.index);return E("div",{className:"space-y-2",children:[E("p",{className:y("text-sm font-medium",X?"text-destructive":"text-foreground"),children:["Word #",L.index+1,X&&N("span",{className:"ml-2 text-xs text-destructive",children:"(incorrect)"})]}),N("div",{className:"grid grid-cols-2 gap-2",children:L.options.map(ae=>{let It=Y[L.index]===ae;return N("button",{type:"button",onClick:()=>Qr(L.index,ae),className:y("rounded-md border px-3 py-2 text-sm font-mono transition-all duration-200 cursor-pointer text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",It?"border-primary bg-primary/10 text-primary font-medium":X?"border-destructive/50 bg-destructive/5":"border-border bg-card hover:border-primary/50"),children:ae},`${L.index}-${ae}`)})})]},L.index)}),E("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-between",children:[E(u,{onClick:$r,variant:"default",disabled:!Yr,children:[N(yn,{size:16}),"Verify & Confirm"]}),E("div",{className:"flex gap-2",children:[E(u,{onClick:()=>b("reveal"),variant:"ghost",size:"sm",children:[N(Os,{size:14}),"Back"]}),n&&E(u,{onClick:Mn,variant:"ghost",size:"sm",children:[N(er,{size:14}),"Skip"]})]})]})]}),Zr={reveal:Jr,confirm:Xr,done:E("div",{className:"flex flex-col items-center gap-3 py-6 text-center",children:[N("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-green-100 dark:bg-green-900/30",children:N(yn,{size:24,className:"text-green-600 dark:text-green-400"})}),N("p",{className:"font-medium text-foreground",children:"Backup Confirmed"}),N("p",{className:"text-sm text-muted-foreground",children:"Your seed phrase has been backed up successfully."})]})},ea={reveal:"Backup Seed Phrase",confirm:"Verify Backup",done:"Backup Complete"},ft=Zr[m],gt=ea[m];return i?E("div",{className:y("space-y-4",r),children:[m!=="done"&&N("h3",{className:"text-lg font-semibold",children:gt}),ft]}):s?d&&f?N(d,{open:!0,onOpenChange:L=>{L||l?.(!1)},children:N(f,{children:h&&g?E(vn,{children:[N(h,{children:N(g,{children:gt})}),N("div",{className:"mt-2 max-h-[55vh] overflow-y-auto",children:ft})]}):E(vn,{children:[N("div",{className:"mb-3 text-lg font-semibold",children:gt}),N("div",{className:"max-h-[55vh] overflow-y-auto",children:ft})]})})}):E(Ue,{open:!0,onClose:()=>l?.(!1),children:[E("div",{className:"flex items-center justify-between mb-4",children:[N("h2",{className:"text-lg font-semibold m-0",children:gt}),l&&N("button",{onClick:()=>l(!1),type:"button",className:"rounded-md p-1 text-muted-foreground hover:text-foreground transition-all duration-200 cursor-pointer border-none bg-transparent","aria-label":"Close",children:N(Ks,{size:16})})]}),ft]}):null}import js from"react";import{Fragment as nr,jsx as Z,jsxs as we}from"react/jsx-runtime";function Qs({error:t,reset:e,dismiss:n,retryLabel:o="Try Again"}){let r=S(),a=r.Button??M,i=r.Dialog,s=r.DialogContent,l=r.DialogHeader,c=r.DialogTitle;if(i&&s)return Z(i,{open:!0,onOpenChange:()=>{},children:Z(s,{children:l&&c?we(nr,{children:[Z(l,{children:Z(c,{children:"Something went wrong"})}),we("div",{style:{marginTop:"0.5rem"},children:[Z("p",{style:{color:"var(--muted-foreground, #666)",fontSize:"0.875rem",lineHeight:"1.5",margin:0},children:t.message||"An unexpected error occurred while connecting your wallet."}),we("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[n&&Z(a,{variant:"outline",size:"default",onClick:n,children:"Dismiss"}),Z(a,{variant:"default",size:"default",onClick:e,children:o})]})]})]}):we(nr,{children:[Z("div",{style:{fontWeight:600,fontSize:"1.125rem",marginBottom:"0.75rem"},children:"Something went wrong"}),Z("p",{style:{color:"var(--muted-foreground, #666)",fontSize:"0.875rem",lineHeight:"1.5",margin:0},children:t.message||"An unexpected error occurred while connecting your wallet."}),we("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[n&&Z(a,{variant:"outline",size:"default",onClick:n,children:"Dismiss"}),Z(a,{variant:"default",size:"default",onClick:e,children:o})]})]})})});let u=!0,d=n??void 0;return we(Ue,{open:u,onClose:d,children:[Z(Kn,{title:"Something went wrong",onClose:d,showCloseButton:!!n}),we(qn,{children:[Z("p",{style:{color:"var(--muted-foreground, #666)",fontSize:"0.875rem",lineHeight:"1.5",margin:0},children:t.message||"An unexpected error occurred while connecting your wallet."}),we("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[n&&Z(a,{variant:"outline",size:"default",onClick:n,children:"Dismiss"}),Z(a,{variant:"default",size:"default",onClick:e,children:o})]})]})]})}var ct=class extends js.Component{constructor(e){super(e),this.state={hasError:!1,error:null,dismissed:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e,dismissed:!1}}componentDidCatch(e,n){this.props.onError?.(e,n)}handleReset=()=>{this.setState({hasError:!1,error:null,dismissed:!1}),this.props.onReset?.()};handleDismiss=()=>{this.setState(e=>({...e,dismissed:!0})),this.props.onDismiss?.()};render(){return this.state.dismissed?this.props.children:this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback({error:this.state.error,reset:this.handleReset}):Z(Qs,{error:this.state.error,reset:this.handleReset,dismiss:this.props.onDismiss?this.handleDismiss:void 0,retryLabel:this.props.retryLabel}):this.props.children}};import{createContext as ri,useContext as ai,useMemo as si}from"react";import{Web3ConnectProvider as ii}from"@naculus/connect-appkit-react";import{createContext as Gs,useContext as Ys,useMemo as Pt,useEffect as At,useCallback as Js,useState as Et}from"react";var qe={primary:{name:"--primary",fallback:"221.2 83.2% 53.3%"},"primary-foreground":{name:"--primary-foreground",fallback:"210 40% 98%"},background:{name:"--background",fallback:"0 0% 100%"},foreground:{name:"--foreground",fallback:"222.2 84% 4.9%"},card:{name:"--card",fallback:"0 0% 100%"},"card-foreground":{name:"--card-foreground",fallback:"222.2 84% 4.9%"},popover:{name:"--popover",fallback:"0 0% 100%"},"popover-foreground":{name:"--popover-foreground",fallback:"222.2 84% 4.9%"},secondary:{name:"--secondary",fallback:"210 40% 96.1%"},"secondary-foreground":{name:"--secondary-foreground",fallback:"222.2 47.4% 11.2%"},muted:{name:"--muted",fallback:"210 40% 96.1%"},"muted-foreground":{name:"--muted-foreground",fallback:"215.4 16.3% 46.9%"},accent:{name:"--accent",fallback:"210 40% 96.1%"},"accent-foreground":{name:"--accent-foreground",fallback:"222.2 47.4% 11.2%"},destructive:{name:"--destructive",fallback:"0 84.2% 60.2%"},border:{name:"--border",fallback:"214.3 31.8% 91.4%"},input:{name:"--input",fallback:"214.3 31.8% 91.4%"},ring:{name:"--ring",fallback:"221.2 83.2% 53.3%"},radius:{name:"--radius",fallback:"0.5rem"}},$s=new Map;function Cn(){$s.clear()}import{jsx as ni,jsxs as oi}from"react/jsx-runtime";var or=Gs({theme:{},isDark:!1,setTheme:()=>{},toggleDarkMode:()=>{}}),Xs=/[;{}<>\r\n\\]/;function Zs(t){let e=[];for(let[n,o]of Object.entries(t)){let r=qe[n];r&&o&&!Xs.test(String(o))&&e.push(" "+r.name+": "+o+";")}return e.length===0?"":`:root {
|
|
8
|
+
`;return typeof o=="function"&&o(null,f),f}});var jo=A(it=>{"use strict";var ws=Qn(),mn=Uo(),qo=Oo(),ks=Ko();function pn(t,e,n,o,r){let a=[].slice.call(arguments,1),i=a.length,s=typeof a[i-1]=="function";if(!s&&!ws())throw new Error("Callback required as last argument");if(s){if(i<2)throw new Error("Too few arguments provided");i===2?(r=n,n=e,e=o=void 0):i===3&&(e.getContext&&typeof r>"u"?(r=o,o=void 0):(r=o,o=n,n=e,e=void 0))}else{if(i<1)throw new Error("Too few arguments provided");return i===1?(n=e,e=o=void 0):i===2&&!e.getContext&&(o=n,n=e,e=void 0),new Promise(function(l,c){try{let u=mn.create(n,o);l(t(u,e,o))}catch(u){c(u)}})}try{let l=mn.create(n,o);r(null,t(l,e,o))}catch(l){r(l)}}it.create=mn.create;it.toCanvas=pn.bind(null,qo.render);it.toDataURL=pn.bind(null,qo.renderToDataURL);it.toString=pn.bind(null,function(t,e,n){return ks.render(t,n)})});import{useState as Ht,useEffect as ba,useCallback as Vn,useRef as ya}from"react";import{AppkitConnectButton as xa}from"@naculus/connect-appkit-react";import{createContext as la,useContext as Ln,useState as ht,useCallback as It,useEffect as ca,useMemo as In,useRef as Lt}from"react";import{useWeb3 as da}from"@naculus/connect-appkit-react";import{jsx as ma}from"react/jsx-runtime";var Wt=la(null);function Vt({children:t}){let e=da(),[n,o]=ht(null),[r,a]=ht(!1),[i,s]=ht("idle"),[l,c]=ht(null),u=Lt(0),d=Lt(null);ca(()=>()=>{d.current&&clearTimeout(d.current)},[]);let f=It(()=>{u.current+=1,e.cancelPairing?.(),d.current&&(clearTimeout(d.current),d.current=null),o(null),a(!1),s("cancelled"),c(null)},[e]),h=Lt(void 0);h.current=async()=>{if(!e.startPairing||!e.completePairing){c("WalletConnect pairing not available"),s("error");return}let p=++u.current,x=()=>u.current===p;s("loading"),c(null),a(!0);try{let B=await e.startPairing();if(!x())return;o(B),s("ready");try{if(await e.completePairing(),!x())return;d.current=setTimeout(()=>{d.current=null,x()&&(a(!1),o(null),s("idle"))},1e3)}catch(w){if(!x())return;s("error"),c(w instanceof Error?w.message:"Connection failed")}}catch(B){if(!x())return;s("error"),c(B instanceof Error?B.message:"Failed to generate QR code")}};let g=It(async()=>{await h.current?.()},[]),m=It(()=>{o(null),c(null),s("loading"),h.current?.()},[]),b=In(()=>({qrUri:n,showQR:r,qrStatus:i,error:l}),[n,r,i,l]),T=In(()=>({state:b,connectWalletConnect:g,cancelQR:f,retryQR:m}),[b,g,f,m]);return ma(Wt.Provider,{value:T,children:t})}function ua(){let t=Ln(Wt);if(!t)throw new Error("useWalletConnect must be used within a WalletConnectProvider");return t}function Ut(){return Ln(Wt)}import{useState as Wn,useEffect as pa,useRef as fa}from"react";function Je(){let[t,e]=Wn([]),[n,o]=Wn(!0),r=fa(new Set);return pa(()=>{r.current.clear(),o(!0);let a=c=>{let u=c.detail,d=u?.info,f=u?.provider;!d?.rdns||r.current.has(d.rdns)||(r.current.add(d.rdns),e(h=>h.find(g=>g.id===d.rdns)?h:[...h,{id:d.rdns,name:d.name||d.rdns,icon:d.icon||"",rdns:d.rdns,provider:f}]))};window.addEventListener("eip6963:announceProvider",a);let i=window,s=(c,u,d)=>{r.current.has(c)||(r.current.add(c),e(f=>f.some(h=>h.id===c)?f:[...f,{id:c,name:u,icon:"",rdns:c,provider:d}]))};i.ethereum?.isMetaMask&&s("io.metamask","MetaMask",i.ethereum),i.phantom?s("app.phantom","Phantom",i.phantom):i.solana?.isPhantom&&s("app.phantom","Phantom",i.solana),window.dispatchEvent(new Event("eip6963:requestProvider"));let l=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),clearTimeout(l)}},[]),{wallets:t,isDetecting:n,hasWallets:t.length>0}}import{useState as ga,useEffect as ha}from"react";function Xe(){let[t,e]=ga(!1);return ha(()=>{if(typeof navigator>"u"||typeof window>"u")return;let n=navigator.userAgent.toLowerCase();e(/(iphone|ipad|ipod|android|mobile)/i.test(n))},[]),t}import{jsx as Un}from"react/jsx-runtime";function Se({className:t,isConnected:e,isConnecting:n,onConnect:o,onDisconnect:r,onMobileDeepLink:a,mobileWalletName:i,startPairing:s,completePairing:l,address:c,balance:u,balanceSymbol:d,tokenBalances:f,isBalanceLoading:h,explorerUrl:g,explorerLabel:m}){let b=Ut(),{wallets:T}=Je(),p=Xe(),x=JSON.stringify(T.map(({id:j,name:ue,icon:J,rdns:Le})=>({id:j,name:ue,icon:J,rdns:Le}))),[B,w]=Ht(null),[V,D]=Ht(!1),[fe,Y]=Ht(null),re=ya({aborted:!1}),Ge=Vn(()=>{re.current.aborted=!0,b?.cancelQR(),D(!1),w(null),Y(null)},[b]);ba(()=>{if(!b)return;let{qrStatus:j,qrUri:ue,error:J}=b.state;j==="loading"?(D(!0),w(null),Y(null)):j==="ready"&&ue?(D(!1),w(ue),Y(null)):j==="error"?(D(!1),Y(J)):(j==="idle"||j==="cancelled")&&(D(!1),w(null),Y(null))},[b?.state?.qrStatus,b?.state?.qrUri,b?.state?.error]);let ge=Vn((j,ue)=>{if(j==="walletconnect"){if(b){b.connectWalletConnect();return}if(s&&l){D(!0),Y(null),re.current.aborted=!1,s().then(J=>{re.current.aborted||(w(J),D(!1),l().then(()=>{re.current.aborted||w(null)}).catch(Le=>{re.current.aborted||Y(Le instanceof Error?Le.message:"Connection failed")}))}).catch(J=>{re.current.aborted||(D(!1),Y(J instanceof Error?J.message:"Connection failed"))});return}}o?.(j,()=>{},ue)},[b,s,l,o]);return Un("div",{className:t,children:Un(xa,{connected:e??!1,connecting:n??!1,address:c??"",balance:u??null,balanceSymbol:d??"",isBalanceLoading:h??!1,tokenBalancesJson:JSON.stringify(f??[]),explorerUrl:g??"",explorerLabel:m??"",walletsJson:x,isMobile:p,mobileWalletName:i??"",qrUri:B,qrLoading:V,qrError:fe,onAppkitConnect:j=>{ge(j.detail.kind,j.detail.walletId)},onAppkitDisconnect:()=>r?.(),onAppkitStartPairing:()=>ge("walletconnect"),onAppkitRetry:()=>{re.current.aborted=!0,Y(null),w(null),ge("walletconnect")},onAppkitCancelPairing:Ge,onAppkitMobileDeepLink:()=>a?.(),onAppkitCopyAddress:j=>{navigator.clipboard?.writeText(j.detail).catch(()=>{})}})})}import{logger as gi}from"@naculus/connect-core";import{useState as hi,useRef as bi,useEffect as yi}from"react";import{useChain as xi,useWallet as vi}from"@naculus/connect-appkit-react";import{clsx as va}from"clsx";import{twMerge as Ca}from"tailwind-merge";function y(...t){return Ca(va(t))}var Hn='<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 0l-.26.97v28.15l.26.26 13.07-7.72L12 0z" fill="#8C8C8C"/><path d="M12 0L-.87 21.69l12.87 7.72V0z" fill="#3C3C3B"/><path d="M12 31.88l-.16.2v10.55l.16.47 13.08-18.42L12 31.88z" fill="#8C8C8C"/><path d="M12 42.9V31.88L-.87 24.68 12 42.9z" fill="#3C3C3B"/><path d="M12 28.41l13.07-7.72L12 14.09v14.32z" fill="#141414"/><path d="M-.87 20.69L12 28.41V14.09l-12.87 6.6z" fill="#393939"/></svg>',Na='<svg viewBox="0 0 24 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15 12.3l-3.7 2.2-3.8-2.2V7.9L11.3 5.7 15 7.9v2.7l-2.2 1.3-1.5-.9v-2l1.5.9 2.2-1.3V7.9L11.3 4 6 7.9v6.3l5.3 3.1 5.3-3.1-1.6-2.8z" fill="#6C00F6"/></svg>',wa='<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="#F0B90B"/><path d="M12 4l2.7 1.6L14.7 7 12 5.4 9.3 7l-.7-.4L12 4zm4.7 2.7l-2.7 1.6V10l4 2.3v4.7L16 18.7v-4l-1.3-.7v4L12 20l-2.7-1.6v-4L8 14.7v4l-1.3-.7V12.3l4-2.3V8.3l-2.7-1.6.7-.4L12 8l2.7-1.7.7.4z" fill="white"/></svg>',ka='<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 1.5c.3 0 .6.1.8.2l8.8 5.1c.5.3.9.9.9 1.5v10.2c0 .6-.3 1.2-.9 1.5l-8.8 5.1c-.3.2-.6.2-.8.2s-.6-.1-.8-.2l-8.8-5.1c-.5-.3-.9-.9-.9-1.5V8.3c0-.6.3-1.2.9-1.5l8.8-5.1c.3-.2.6-.2.8-.2z" fill="#213147"/><path d="M14.7 13.8l-1.2 3.2c0 .1 0 .2.1.3l2 5.5 2.3-1.3-2.8-7.6c-.1-.2-.3-.2-.4-.1z" fill="#12AAFF"/><path d="M16.3 8.5c0-.2-.3-.2-.4 0l-1.1 3.2c0 .1 0 .2.1.3l3.3 9 2.3-1.3-4.2-9.1v-.1z" fill="#12AAFF"/><path d="M12 3.5c.1 0 .2 0 .3.1l8.8 5.1c.1.1.2.2.2.3v10.2c0 .1-.1.2-.2.3l-8.8 5.1c-.1 0-.2.1-.3.1s-.2 0-.3-.1l-8.8-5.1c-.1-.1-.2-.2-.2-.3V9c0-.1.1-.2.2-.3l8.8-5.1c.1 0 .2-.1.3-.1z" fill="#9DCCED" fill-opacity="0.3"/><path d="M13.3 6.2h-2.2c-.2 0-.3.1-.4.3L5.9 19.6l2.3 1.3L13 6.5c0-.1-.1-.3-.2-.3h.4z" fill="white"/><path d="M15.2 6.2H13c-.2 0-.3.1-.4.3L8.1 21.4l2.3 1.3 6-16.4c0-.1-.1-.3-.2-.3v.2z" fill="white"/></svg>',Ra='<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="#FF0420"/><path d="M8.5 16c-.5 0-.9-.1-1.3-.3-.4-.2-.7-.5-1-.8-.3-.4-.4-.8-.4-1.3V10c0-.5.1-1 .4-1.4.3-.4.6-.7 1-.9.4-.2.8-.3 1.3-.3.4 0 .8.1 1.2.2.3.2.6.4.8.7l-1 1c-.2-.2-.4-.3-.6-.4-.2-.1-.5-.2-.8-.2-.3 0-.6.1-.9.2-.3.2-.5.4-.6.7-.1.3-.2.6-.2 1v3.5c0 .3.1.6.2.9.1.3.3.5.6.6.3.2.6.2.9.2.3 0 .6-.1.8-.2.2-.1.4-.3.6-.5l1 1c-.2.3-.5.5-.8.7-.4.2-.9.3-1.4.3z" fill="white"/><path d="M15.5 16c-.5 0-.9-.1-1.3-.3-.4-.2-.7-.5-1-.8-.2-.4-.4-.8-.4-1.3V10c0-.5.1-1 .4-1.4.2-.4.5-.7.9-.9.4-.2.8-.3 1.3-.3.5 0 1 .1 1.4.3.4.2.7.5.9.9.2.4.3.9.3 1.4v.7h-2.9v-1.1c0-.3-.1-.6-.2-.9-.1-.3-.3-.5-.5-.6-.2-.1-.5-.2-.8-.2-.3 0-.6.1-.8.2-.3.2-.5.4-.6.7-.1.3-.2.6-.2 1v3.5c0 .3.1.6.2.8.1.3.3.5.6.6.2.2.5.2.8.2.3 0 .6-.1.8-.2.2-.1.4-.3.5-.6.1-.3.2-.6.2-1v-1.1h2.9v.7c0 .5-.1 1-.3 1.4-.2.4-.5.7-.9.9-.4.2-.9.3-1.4.3z" fill="white"/></svg>',Sa='<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="#E84142"/><path d="M8.6 16.8H6.3c-.5 0-.8-.1-1-.3-.2-.2-.3-.5-.3-.8 0-.2 0-.4.1-.6l5.8-10.7c.2-.4.5-.7.8-.8.3-.1.5-.1.7 0 .2.1.5.3.7.8l1.2 2.1.1.2c.3.5.5.9.5 1.3.1.4.1.8 0 1.1-.1.4-.3.8-.6 1.3l-3 5.4c-.2.5-.5.8-.8 1-.4.2-.7.2-1.2.2z" fill="white"/><path d="M14.5 16.8h3.3c.5 0 .7-.1 1-.3.2-.2.3-.5.3-.8 0-.2-.1-.4-.3-.7l-1.7-3-.2-.3c-.2-.4-.4-.7-.6-.8-.2-.1-.4-.1-.6 0-.2.1-.4.3-.6.8l-1.6 3c-.2.4-.4.7-.4.9 0 .2.1.5.3.7.1.1.4.3.9.3z" fill="white"/></svg>',Ta='<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="#1969FF"/><path d="M11.3 3.8c.4-.2 1-.2 1.4 0l4.1 2.2c.2.1.4.3.4.5h0v10.9c0 .2-.1.4-.4.6l-4.1 2.2c-.4.2-1 .2-1.4 0l-4.1-2.2c-.3-.1-.4-.4-.4-.6V6.5c0-.2.1-.4.4-.5l4.1-2.2zm5.3 8.7l-3.9 2c-.4.2-1 .2-1.4 0l-3.9-2v4.8l3.9 2c.2.1.5.2.7.2.2 0 .5-.1.7-.2l3.9-2v-4.8z" fill="white"/></svg>',Ba={"eip155:1":Hn,"eip155:137":Na,"eip155:56":wa,"eip155:42161":ka,"eip155:10":Ra,"eip155:43114":Sa,"eip155:250":Ta,"eip155:11155111":Hn};function bt(t){return Ba[t]}import{createContext as ci,useContext as di,useMemo as ui}from"react";import{Wallet as Pa}from"lucide-react";import{jsx as Ze}from"react/jsx-runtime";function M({className:t,variant:e,size:n,type:o="button",...r}){return Ze("button",{type:o,className:y("inline-flex items-center justify-center gap-2 rounded-lg border px-4 py-2 text-sm font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",e==="outline"?"border-input bg-transparent hover:bg-accent":e==="ghost"?"border-transparent bg-transparent hover:bg-accent":"border-primary bg-primary text-primary-foreground hover:bg-primary/90",n==="sm"?"h-9 px-3":n==="icon"?"h-10 w-10 p-0":"h-10",t),...r})}function me({className:t,...e}){return Ze("div",{className:y("rounded-xl border border-border bg-card text-card-foreground shadow-sm",t),...e})}function We({className:t,variant:e,...n}){return Ze("span",{className:y("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium",t),...n})}function On(t){return Ze("input",{...t})}function _n({className:t,...e}){return Ze("hr",{className:y("h-px bg-border",t),...e})}import{jsx as Ve,jsxs as Ot}from"react/jsx-runtime";function Aa({children:t}){return Ve("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-primary text-primary-foreground",children:t})}function _t({className:t,showAddress:e=!0,showBalance:n=!1,address:o,balance:r,balanceSymbol:a,onConnect:i}){let l=S().Button??M;if(!o)return Ot(l,{"aria-label":"Connect Wallet",onClick:i,className:t,children:[Ve(Pa,{size:18,className:"shrink-0"}),"Connect Wallet"]});let c=o.includes(":")?o.split(":").pop():o,u=c.slice(0,6)+"..."+c.slice(-4),d=r!=null?parseFloat(r).toLocaleString(void 0,{maximumFractionDigits:4})+(a?` ${a}`:""):null;return Ot(l,{className:t,children:[Ve(Aa,{children:"W"}),Ot("div",{className:"flex flex-col items-start gap-0",children:[e&&Ve("span",{className:"font-mono text-xs",children:u}),n&&d&&Ve("span",{className:"text-xs text-muted-foreground",children:d}),n&&!d&&r===null&&Ve("span",{className:"text-xs text-muted-foreground",children:"Loading..."})]})]})}import{useRef as Qo,useEffect as $o,useState as Go,useCallback as Rs}from"react";import{Smartphone as Ss,RefreshCw as Yo,CheckCircle2 as Ts,AlertCircle as Jo,Loader2 as Bs}from"lucide-react";import{useEffect as Fn}from"react";import{X as Ea}from"lucide-react";import{jsx as ye,jsxs as Ft}from"react/jsx-runtime";function Ue({open:t,onClose:e,children:n,closable:o,className:r,title:a}){return Fn(()=>{if(!t)return;let i=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=i}},[t]),Fn(()=>{if(!t||!e)return;let i=s=>{s.key==="Escape"&&e()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[t,e]),t?Ft("div",{className:y("naculus-dialog-viewport fixed inset-0 z-50 flex items-center justify-center p-4",r),style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",padding:"1rem"},children:[ye("div",{className:"absolute inset-0 bg-black/80","aria-hidden":"true",onClick:e,style:{position:"absolute",inset:0,background:"rgb(0 0 0 / 0.8)"}}),Ft("div",{role:"dialog","aria-modal":"true","aria-label":a??"Dialog",className:"naculus-dialog-surface relative z-10 flex w-full max-w-lg flex-col overflow-y-auto rounded-xl border bg-card p-6 text-card-foreground shadow-2xl",style:{position:"relative",zIndex:10,width:"100%",maxWidth:"32rem",overflowY:"auto",borderRadius:"0.75rem",padding:"1.5rem",background:"hsl(var(--card, 0 0% 100%))",color:"hsl(var(--card-foreground, 222.2 84% 4.9%))",boxShadow:"0 25px 50px -12px rgb(0 0 0 / 0.4)"},children:[o&&e&&ye("button",{onClick:e,type:"button","aria-label":"Close modal",className:"absolute right-4 top-4 z-20 rounded-md p-1 text-muted-foreground hover:text-foreground",style:{position:"absolute",right:"1rem",top:"1rem",zIndex:20,border:0,background:"transparent",cursor:"pointer",color:"inherit"},children:ye("svg",{"aria-hidden":"true",className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:ye("path",{d:"M18 6 6 18M6 6l12 12","data-testid":"x-icon"})})}),n]})]}):null}function Kn({title:t,onClose:e,showCloseButton:n=!0}){return Ft("div",{className:"sticky top-0 z-10 -mx-1 mb-4 flex items-center justify-between bg-card px-1 py-1",children:[ye("h2",{className:"text-lg font-semibold m-0",children:t}),n&&e&&ye("button",{onClick:e,type:"button",className:"rounded-md p-1 text-muted-foreground hover:text-foreground transition-all duration-200","aria-label":"Close",children:ye(Ea,{size:16})})]})}function qn({children:t,className:e=""}){return ye("div",{className:y("flex flex-col gap-4",e),children:t})}import{jsx as _,jsxs as pe}from"react/jsx-runtime";async function Ps(t,e){let n=await Promise.resolve().then(()=>ia(jo(),1)),r=(n.default??n).toCanvas??n.toCanvas;if(typeof r!="function")throw new Error("qrcode.toCanvas is unavailable");return new Promise((a,i)=>{r(t,e,{width:280,margin:2},s=>{s?i(s):a()})})}function lt({uri:t,open:e,onClose:n,onDeepLink:o,onRetry:r,status:a="pending",showDeepLink:i,timeoutMs:s=300*1e3,title:l="Scan with WalletConnect",description:c="Open your wallet app and scan this QR code to connect.",className:u}){let d=Qo(null),[f,h]=Go(null),[g,m]=Go(0),b=Xe(),T=S(),p=T.Button,x=i??b,B=Qo(null);$o(()=>{!e||!t||!d.current||(h(null),Ps(d.current,t).catch(J=>{h(J instanceof Error?J.message:"Unable to render QR code")}))},[e,t]),$o(()=>{if(!e||a!=="pending"){B.current&&(clearInterval(B.current),B.current=null),m(0);return}let J=Date.now();return B.current=setInterval(()=>m(Date.now()-J),1e3),()=>{B.current&&clearInterval(B.current)}},[e,a,s]);let w=g>=s&&a==="pending",V=w||a==="expired"||a==="error",D=Math.max(0,Math.ceil((s-g)/1e3)),fe=Math.floor(D/60),Y=D%60,re=Math.min(g/s,1),Ge=Rs(()=>{t&&o&&o(t)},[t,o]),ge=t&&!w&&a==="pending"?f?pe("div",{className:"w-[280px] h-[280px] flex flex-col items-center justify-center bg-muted rounded-lg gap-2",children:[_(Jo,{size:24,className:"text-muted-foreground"}),_("span",{className:"text-sm text-muted-foreground",children:"Failed to render QR code"})]}):_("canvas",{ref:d,width:280,height:280,role:"img","aria-label":"WalletConnect pairing QR code",className:"rounded-lg border border-border"}):pe("div",{className:"flex flex-col items-center justify-center gap-3 bg-muted rounded-lg w-[280px] h-[280px]",children:[a==="scanned"?_(Ts,{size:48,className:"text-[hsl(var(--primary))]"}):_(Jo,{size:48,className:"text-destructive"}),_("span",{className:"text-sm text-muted-foreground","data-testid":"status-label",children:a==="scanned"?"QR code scanned! Connecting...":w||a==="expired"?"Connection timed out.":"Something went wrong. Try again."})]}),ue=T.Modal??Ue;return _(ue,{open:e,onClose:n,closable:!0,title:l,className:u,children:pe("div",{className:"p-6",children:[pe("div",{className:"sticky top-0 z-10 -mx-1 mb-5 bg-card px-1 py-1 text-center",children:[_("div",{className:"flex justify-center mb-3",children:a==="pending"&&!w&&_(Bs,{size:20,className:"animate-spin text-primary","data-testid":"loader-icon-inline"})}),_("h3",{className:"text-lg font-semibold m-0 text-foreground",children:l}),c&&_("p",{className:"text-sm text-muted-foreground mt-1.5 mb-0",children:c})]}),_("div",{className:"flex justify-center mb-4",children:ge}),a==="pending"&&!w&&pe("div",{className:"mb-3",children:[_("div",{className:"h-1 bg-muted rounded-full overflow-hidden",role:"progressbar","aria-valuenow":Math.round((1-re)*100),"aria-valuemin":0,"aria-valuemax":100,children:_("div",{className:"h-full bg-primary rounded-full transition-all duration-1000",style:{width:`${(1-re)*100}%`}})}),pe("p",{"data-testid":"countdown",className:"text-xs text-muted-foreground text-center mt-1.5 mb-0",children:["Expires in ",fe,":",Y.toString().padStart(2,"0")]})]}),pe("div",{"data-dialog-actions":!0,className:"sticky bottom-0 z-10 -mx-1 flex flex-col gap-2 border-t border-border bg-card px-1 pb-[max(0rem,env(safe-area-inset-bottom))] pt-3",children:[x&&t&&a==="pending"&&!w&&pe("button",{type:"button",onClick:Ge,className:"inline-flex items-center justify-center gap-2 w-full rounded-lg border border-input bg-card px-4 py-2.5 text-sm font-medium text-foreground hover:bg-accent hover:text-accent-foreground transition-all duration-200 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:[_(Ss,{size:16})," Open in Wallet App"]}),V&&r&&(p?pe(p,{onClick:r,variant:"default",size:"default",className:"w-full",children:[_(Yo,{size:16})," Generate New QR Code"]}):pe("button",{type:"button",onClick:r,className:"inline-flex items-center justify-center gap-2 w-full rounded-lg bg-primary text-primary-foreground px-4 py-2.5 text-sm font-medium hover:bg-primary/90 transition-all duration-200 cursor-pointer border-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:[_(Yo,{size:16})," Generate New QR Code"]})),p?_(p,{onClick:n,variant:"outline",size:"default",className:"w-full",children:"Cancel"}):_("button",{type:"button",onClick:n,className:"inline-flex items-center justify-center w-full rounded-lg border border-input bg-transparent px-4 py-2.5 text-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all duration-200 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:"Cancel"})]})]})})}import{useState as fn}from"react";import{LogIn as As,Loader2 as Es,CheckCircle2 as hn,AlertCircle as Ds,X as Ms,Copy as zs,Check as Is}from"lucide-react";import{Fragment as Xo,jsx as k,jsxs as Q}from"react/jsx-runtime";function bn({className:t,isSignedIn:e=!1,isSigningIn:n=!1,result:o=null,error:r=null,onSignIn:a,onClearError:i,children:s}){let[l,c]=fn(!1),[u,d]=fn(!1),[f,h]=fn(!1),g=S(),m=g.Button??M,b=g.Dialog,T=g.DialogContent,p=g.DialogHeader,x=g.DialogTitle,B=async()=>{if(o?.signature)try{await navigator.clipboard.writeText(o.signature),h(!1),d(!0),setTimeout(()=>d(!1),2e3)}catch{d(!1),h(!0)}};return!e&&!n&&!r?k(m,{onClick:a,className:t,"aria-label":"Sign In",children:Q("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"},children:[k(As,{size:16}),s??"Sign In"]})}):n?k(m,{disabled:!0,className:t,"aria-label":"Signing In",children:Q("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"},children:[k(Es,{size:16,className:"animate-spin"}),"Signing In..."]})}):r&&!e?Q("div",{style:{position:"relative",display:"inline-flex",flexDirection:"column"},children:[k(m,{onClick:a,className:t,"aria-label":"Retry Sign In",children:Q("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"},children:[k(Ds,{size:16,style:{color:"var(--destructive, #ef4444)"}}),s??"Retry Sign In"]})}),k("div",{style:{fontSize:"0.75rem",color:"var(--destructive, #ef4444)",padding:"0.25rem 0.5rem",borderRadius:"0.375rem",background:"var(--destructive-foreground, #fef2f2)",marginTop:"2px",wordBreak:"break-word",maxWidth:"100%",lineHeight:1.4},children:r.message})]}):Q("div",{style:{position:"relative",display:"inline-block"},children:[k(m,{onClick:()=>c(w=>!w),className:t,children:Q("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"},children:[k(hn,{size:16,style:{color:"#22c55e"}}),k("span",{style:{fontSize:"0.875rem",fontWeight:500},children:"Signed In"})]})}),l&&(b&&T?k(b,{open:!0,onOpenChange:w=>{w||c(!1)},children:k(T,{children:p&&x?Q(Xo,{children:[k(p,{children:k(x,{children:"Sign-In Details"})}),k(gn,{result:o,onClose:()=>c(!1),copiedSign:u,copyFailed:f,onCopy:B})]}):Q(Xo,{children:[k("div",{style:{fontWeight:600,fontSize:"1.125rem",marginBottom:"0.75rem"},children:"Sign-In Details"}),k(gn,{result:o,onClose:()=>c(!1),copiedSign:u,copyFailed:f,onCopy:B})]})})}):l&&k("div",{style:{position:"absolute",top:"calc(100% + 8px)",right:0,zIndex:100,width:"340px",maxWidth:"90vw",background:"var(--card, #fff)",border:"1px solid var(--border, #e2e8f0)",borderRadius:"0.75rem",boxShadow:"0 10px 25px rgba(0,0,0,0.1)",padding:"1rem"},children:k(gn,{result:o,onClose:()=>c(!1),copiedSign:u,copyFailed:f,onCopy:B})}))]})}function gn({result:t,onClose:e,copiedSign:n,onCopy:o,copyFailed:r}){let i=S().Button??M;if(!t)return Q("div",{style:{textAlign:"center",padding:"1rem 0"},children:[k(hn,{size:32,style:{color:"#22c55e",margin:"0 auto 0.75rem"}}),k("p",{style:{fontSize:"0.875rem",color:"var(--muted-foreground, #64748b)"},children:"Authenticated successfully"}),k(i,{variant:"outline",size:"sm",onClick:e,children:"Close"})]});let{message:s,signature:l}=t,c=l.length>20?l.slice(0,14)+"..."+l.slice(-6):l;return Q("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[Q("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Q("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[k(hn,{size:18,color:"#22c55e"}),k("span",{style:{fontWeight:600,fontSize:"0.9375rem"},children:"Signed In"})]}),k(i,{variant:"ghost",size:"icon",onClick:e,children:k(Ms,{size:16})})]}),Q("div",{style:{display:"grid",gap:"0.375rem"},children:[Q("div",{children:[k("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Domain"}),k("p",{style:{fontSize:"0.8125rem",fontFamily:"monospace",marginTop:"0.125rem"},children:s.domain})]}),Q("div",{children:[k("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Address"}),k("p",{style:{fontSize:"0.8125rem",fontFamily:"monospace",marginTop:"0.125rem",wordBreak:"break-all"},children:s.address})]}),Q("div",{children:[k("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Chain"}),k("p",{style:{fontSize:"0.8125rem",fontFamily:"monospace",marginTop:"0.125rem"},children:s.chainId})]})]}),s.statement&&k("div",{style:{padding:"0.5rem 0.625rem",borderRadius:"0.375rem",background:"var(--muted, #f1f5f9)",fontSize:"0.8125rem",lineHeight:1.5},children:s.statement}),Q("div",{children:[Q("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"0.25rem"},children:[k("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Signature"}),k(i,{variant:"ghost",size:"icon",onClick:o,title:r?"This browser refused the clipboard \u2014 select the signature and copy it":"Copy signature","aria-label":r?"Copy failed":"Copy signature",children:n?k(Is,{size:12,color:"#22c55e"}):k(zs,{size:12})})]}),k("p",{style:{fontSize:"0.75rem",fontFamily:"monospace",wordBreak:"break-all",lineHeight:1.4,color:"var(--muted-foreground, #64748b)",background:"var(--muted, #f1f5f9)",padding:"0.375rem 0.5rem",borderRadius:"0.375rem"},children:c})]}),k(i,{variant:"outline",className:"w-full",onClick:e,children:"Close"})]})}import{useState as be,useCallback as Ee,useMemo as Zo}from"react";import{AlertTriangle as Ls,Check as yn,Copy as Ws,Download as Vs,Eye as Us,EyeOff as Hs,SkipForward as er,ArrowLeft as Os,ArrowRight as _s,Shield as Fs,X as Ks}from"lucide-react";import{Fragment as vn,jsx as N,jsxs as E}from"react/jsx-runtime";function qs(t){let e=Math.floor(4294967296/t)*t,n=new Uint32Array(1),o;do crypto.getRandomValues(n),o=n[0];while(o>=e);return o%t}function xn(t){let e=[...t];for(let n=e.length-1;n>0;n--){let o=qs(n+1);[e[n],e[o]]=[e[o],e[n]]}return e}function tr(t,e=3){let n=t.trim().split(/\s+/);return xn(n.map((r,a)=>a)).slice(0,Math.min(e,n.length)).map(r=>{let a=n[r],i=n.filter((c,u)=>u!==r),s=xn(i).slice(0,3),l=xn([a,...s]);return{index:r,correct:a,options:l}})}function ct({seedPhrase:t,onConfirm:e,onSkip:n,onExportPrivateKey:o,className:r,wordCount:a,inline:i=!1,open:s=!0,onOpenChange:l}){let c=S(),u=c.Button??M,d=c.Dialog,f=c.DialogContent,h=c.DialogHeader,g=c.DialogTitle,[m,b]=be("reveal"),[T,p]=be(!1),[x,B]=be(!1),[w,V]=be(!1),[D,fe]=be(()=>tr(t,3)),[Y,re]=be({}),[Ge,ge]=be([]),[j,ue]=be(!1),[J,Le]=be(null),Dn=Zo(()=>t.trim().split(/\s+/),[t]),Fr=Zo(()=>{let L=new Map;return Dn.map(X=>{let ae=L.get(X)??0;return L.set(X,ae+1),{word:X,key:`${X}-${ae}`}})},[Dn]),Kr=Ee(()=>p(!0),[]),qr=Ee(async()=>{try{await navigator.clipboard.writeText(t),V(!1),B(!0),setTimeout(()=>B(!1),2e3)}catch{B(!1),V(!0)}},[t]),jr=Ee(()=>{fe(tr(t,3)),re({}),ge([]),b("confirm")},[t]),Qr=Ee((L,X)=>{re(ae=>({...ae,[L]:X})),ge(ae=>ae.filter(zt=>zt!==L))},[]),$r=Ee(()=>{let L=[];for(let X of D)Y[X.index]!==X.correct&&L.push(X.index);if(L.length>0){ge(L);return}b("done"),e()},[D,Y,e]),Mn=Ee(()=>{n?.()},[n]),Gr=Ee(()=>{if(o){let L=o();Le(L),ue(!0)}},[o]),Yr=D.every(L=>Y[L.index]!==void 0),Jr=E("div",{className:"space-y-4",children:[N("div",{className:"rounded-lg border border-amber-200 bg-amber-50 dark:border-amber-800 dark:bg-amber-950/30 px-4 py-3",children:E("div",{className:"flex items-start gap-2",children:[N(Ls,{size:16,className:"mt-0.5 shrink-0 text-amber-600 dark:text-amber-400"}),N("p",{className:"text-sm text-amber-800 dark:text-amber-200",children:"Write down these words in order and store them somewhere safe. Never share them with anyone. If you lose your seed phrase, your funds cannot be recovered."})]})}),T?E(vn,{children:[N("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:Fr.map(({word:L,key:X},ae)=>E("div",{className:"flex items-center gap-1.5 rounded-md border bg-card px-2.5 py-1.5 text-sm",children:[N("span",{className:"text-xs text-muted-foreground w-5 shrink-0 text-right",children:ae+1}),N("span",{className:"font-mono font-medium",children:L})]},X))}),E("div",{className:"flex flex-wrap gap-2",children:[E(u,{onClick:qr,variant:"outline",size:"sm",children:[x?N(yn,{size:14}):N(Ws,{size:14}),x?"Copied":w?"Copy failed":"Copy"]}),o&&E(u,{onClick:Gr,variant:"outline",size:"sm",children:[N(Vs,{size:14}),"Export Private Key"]})]}),w&&N("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive",children:"This browser would not let the page write to your clipboard. Nothing was copied \u2014 select the words above and copy them yourself, or write them down."}),j&&J&&E("div",{className:"rounded-lg border border-border bg-muted p-3 space-y-2",children:[E("div",{className:"flex items-center gap-2",children:[N(Hs,{size:14,className:"text-muted-foreground"}),N("span",{className:"text-xs font-medium text-muted-foreground",children:"Private Key (keep secret!)"})]}),N("p",{className:"font-mono text-xs break-all select-all",children:J})]}),E("div",{"data-dialog-actions":!0,className:"sticky bottom-0 z-10 -mx-1 flex min-h-14 flex-col gap-2 border-t border-border bg-card px-1 pb-[max(0rem,env(safe-area-inset-bottom))] pt-3 sm:flex-row sm:justify-between",children:[E(u,{onClick:jr,variant:"default",children:["I've Saved It",N(_s,{size:16})]}),n&&E(u,{onClick:Mn,variant:"ghost",size:"sm",children:[N(er,{size:14}),"Skip Backup"]})]})]}):E("div",{className:"flex flex-col items-center gap-3 py-6",children:[N(Fs,{size:40,className:"text-muted-foreground"}),N("p",{className:"text-sm text-muted-foreground text-center",children:"Click the button below to reveal your seed phrase. Make sure no one is watching your screen."}),E(u,{onClick:Kr,variant:"default",children:[N(Us,{size:16}),"Reveal Seed Phrase"]})]})]}),Xr=E("div",{className:"space-y-4",children:[N("p",{className:"text-sm text-muted-foreground",children:"Verify your backup by selecting the correct word for each position."}),D.map(L=>{let X=Ge.includes(L.index);return E("div",{className:"space-y-2",children:[E("p",{className:y("text-sm font-medium",X?"text-destructive":"text-foreground"),children:["Word #",L.index+1,X&&N("span",{className:"ml-2 text-xs text-destructive",children:"(incorrect)"})]}),N("div",{className:"grid grid-cols-2 gap-2",children:L.options.map(ae=>{let zt=Y[L.index]===ae;return N("button",{type:"button",onClick:()=>Qr(L.index,ae),className:y("rounded-md border px-3 py-2 text-sm font-mono transition-all duration-200 cursor-pointer text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",zt?"border-primary bg-primary/10 text-primary font-medium":X?"border-destructive/50 bg-destructive/5":"border-border bg-card hover:border-primary/50"),children:ae},`${L.index}-${ae}`)})})]},L.index)}),E("div",{"data-dialog-actions":!0,className:"sticky bottom-0 z-10 -mx-1 flex min-h-14 flex-col gap-2 border-t border-border bg-card px-1 pb-[max(0rem,env(safe-area-inset-bottom))] pt-3 sm:flex-row sm:justify-between",children:[E(u,{onClick:$r,variant:"default",disabled:!Yr,children:[N(yn,{size:16}),"Verify & Confirm"]}),E("div",{className:"flex gap-2",children:[E(u,{onClick:()=>b("reveal"),variant:"ghost",size:"sm",children:[N(Os,{size:14}),"Back"]}),n&&E(u,{onClick:Mn,variant:"ghost",size:"sm",children:[N(er,{size:14}),"Skip"]})]})]})]}),Zr={reveal:Jr,confirm:Xr,done:E("div",{className:"flex flex-col items-center gap-3 py-6 text-center",children:[N("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-green-100 dark:bg-green-900/30",children:N(yn,{size:24,className:"text-green-600 dark:text-green-400"})}),N("p",{className:"font-medium text-foreground",children:"Backup Confirmed"}),N("p",{className:"text-sm text-muted-foreground",children:"Your seed phrase has been backed up successfully."})]})},ea={reveal:"Backup Seed Phrase",confirm:"Verify Backup",done:"Backup Complete"},gt=Zr[m],Ye=ea[m];return i?E("div",{className:y("space-y-4",r),children:[m!=="done"&&N("h3",{className:"text-lg font-semibold",children:Ye}),gt]}):s?d&&f?N(d,{open:!0,onOpenChange:L=>{L||l?.(!1)},children:N(f,{className:"naculus-dialog-surface flex w-full max-w-lg flex-col overflow-y-auto",children:h&&g?E(vn,{children:[N(h,{children:N(g,{children:Ye})}),N("div",{className:"mt-2 max-h-[55vh] overflow-y-auto",children:gt})]}):E(vn,{children:[N("div",{className:"mb-3 text-lg font-semibold",children:Ye}),N("div",{className:"max-h-[55vh] overflow-y-auto",children:gt})]})})}):E(Ue,{open:!0,onClose:()=>l?.(!1),title:Ye,children:[E("div",{className:"sticky top-0 z-10 -mx-1 mb-4 flex items-center justify-between bg-card px-1 py-1",children:[N("h2",{className:"text-lg font-semibold m-0",children:Ye}),l&&N("button",{onClick:()=>l(!1),type:"button",className:"rounded-md p-1 text-muted-foreground hover:text-foreground transition-all duration-200 cursor-pointer border-none bg-transparent","aria-label":"Close",children:N(Ks,{size:16})})]}),gt]}):null}import js from"react";import{Fragment as nr,jsx as Z,jsxs as we}from"react/jsx-runtime";function Qs({error:t,reset:e,dismiss:n,retryLabel:o="Try Again"}){let r=S(),a=r.Button??M,i=r.Dialog,s=r.DialogContent,l=r.DialogHeader,c=r.DialogTitle;if(i&&s)return Z(i,{open:!0,onOpenChange:()=>{},children:Z(s,{className:"naculus-dialog-surface flex w-full max-w-lg flex-col overflow-y-auto",children:l&&c?we(nr,{children:[Z(l,{children:Z(c,{children:"Something went wrong"})}),we("div",{style:{marginTop:"0.5rem"},children:[Z("p",{style:{color:"var(--muted-foreground, #666)",fontSize:"0.875rem",lineHeight:"1.5",margin:0},children:t.message||"An unexpected error occurred while connecting your wallet."}),we("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[n&&Z(a,{variant:"outline",size:"default",onClick:n,children:"Dismiss"}),Z(a,{variant:"default",size:"default",onClick:e,children:o})]})]})]}):we(nr,{children:[Z("div",{style:{fontWeight:600,fontSize:"1.125rem",marginBottom:"0.75rem"},children:"Something went wrong"}),Z("p",{style:{color:"var(--muted-foreground, #666)",fontSize:"0.875rem",lineHeight:"1.5",margin:0},children:t.message||"An unexpected error occurred while connecting your wallet."}),we("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[n&&Z(a,{variant:"outline",size:"default",onClick:n,children:"Dismiss"}),Z(a,{variant:"default",size:"default",onClick:e,children:o})]})]})})});let u=!0,d=n??void 0;return we(Ue,{open:u,onClose:d,title:"Something went wrong",children:[Z(Kn,{title:"Something went wrong",onClose:d,showCloseButton:!!n}),we(qn,{children:[Z("p",{style:{color:"var(--muted-foreground, #666)",fontSize:"0.875rem",lineHeight:"1.5",margin:0},children:t.message||"An unexpected error occurred while connecting your wallet."}),we("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[n&&Z(a,{variant:"outline",size:"default",onClick:n,children:"Dismiss"}),Z(a,{variant:"default",size:"default",onClick:e,children:o})]})]})]})}var dt=class extends js.Component{constructor(e){super(e),this.state={hasError:!1,error:null,dismissed:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e,dismissed:!1}}componentDidCatch(e,n){this.props.onError?.(e,n)}handleReset=()=>{this.setState({hasError:!1,error:null,dismissed:!1}),this.props.onReset?.()};handleDismiss=()=>{this.setState(e=>({...e,dismissed:!0})),this.props.onDismiss?.()};render(){return this.state.dismissed?this.props.children:this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback({error:this.state.error,reset:this.handleReset}):Z(Qs,{error:this.state.error,reset:this.handleReset,dismiss:this.props.onDismiss?this.handleDismiss:void 0,retryLabel:this.props.retryLabel}):this.props.children}};import{createContext as ri,useContext as ai,useMemo as si}from"react";import{Web3ConnectProvider as ii}from"@naculus/connect-appkit-react";import{createContext as Gs,useContext as Ys,useMemo as Pt,useEffect as At,useCallback as Js,useState as Et}from"react";var qe={primary:{name:"--primary",fallback:"221.2 83.2% 53.3%"},"primary-foreground":{name:"--primary-foreground",fallback:"210 40% 98%"},background:{name:"--background",fallback:"0 0% 100%"},foreground:{name:"--foreground",fallback:"222.2 84% 4.9%"},card:{name:"--card",fallback:"0 0% 100%"},"card-foreground":{name:"--card-foreground",fallback:"222.2 84% 4.9%"},popover:{name:"--popover",fallback:"0 0% 100%"},"popover-foreground":{name:"--popover-foreground",fallback:"222.2 84% 4.9%"},secondary:{name:"--secondary",fallback:"210 40% 96.1%"},"secondary-foreground":{name:"--secondary-foreground",fallback:"222.2 47.4% 11.2%"},muted:{name:"--muted",fallback:"210 40% 96.1%"},"muted-foreground":{name:"--muted-foreground",fallback:"215.4 16.3% 46.9%"},accent:{name:"--accent",fallback:"210 40% 96.1%"},"accent-foreground":{name:"--accent-foreground",fallback:"222.2 47.4% 11.2%"},destructive:{name:"--destructive",fallback:"0 84.2% 60.2%"},border:{name:"--border",fallback:"214.3 31.8% 91.4%"},input:{name:"--input",fallback:"214.3 31.8% 91.4%"},ring:{name:"--ring",fallback:"221.2 83.2% 53.3%"},radius:{name:"--radius",fallback:"0.5rem"}},$s=new Map;function Cn(){$s.clear()}import{jsx as ni,jsxs as oi}from"react/jsx-runtime";var or=Gs({theme:{},isDark:!1,setTheme:()=>{},toggleDarkMode:()=>{}}),Xs=/[;{}<>\r\n\\]/;function Zs(t){let e=[];for(let[n,o]of Object.entries(t)){let r=qe[n];r&&o&&!Xs.test(String(o))&&e.push(" "+r.name+": "+o+";")}return e.length===0?"":`:root {
|
|
9
9
|
`+e.join(`
|
|
10
10
|
`)+`
|
|
11
|
-
}`}function ei(t){let e=new Set;if(t!=="computed"||typeof document>"u")return e;for(let n of Object.keys(qe)){let o=qe[n],r=getComputedStyle(document.documentElement).getPropertyValue(o.name).trim();r&&r!==o.fallback&&e.add(n)}return e}function Nn({children:t,theme:e={},defaultDark:n=!1,priority:o="fallback"}){let[r,a]=Et(e),[i,s]=Et(n);At(()=>{Cn()},[r]);let[l,c]=Et(new Set);At(()=>{c(ei(o))},[o]);let u=Pt(()=>{if(o==="fallback"||l.size===0)return r;let m={};for(let[b,T]of Object.entries(r))!l.has(b)&&T&&(m[b]=T);return m},[r,o,l]),d=Pt(()=>Zs(u),[u]);At(()=>{if(typeof document>"u")return;let m=document.documentElement;i?m.classList.add("dark"):m.classList.remove("dark"),Cn()},[i]);let f=Pt(()=>"w3c-theme-"+Math.random().toString(36).slice(2,9),[]),h=Js(()=>s(m=>!m),[]),g=Pt(()=>({theme:r,isDark:i,setTheme:a,toggleDarkMode:h}),[r,i,h]);return oi(or.Provider,{value:g,children:[d?ni("style",{id:f,children:d}):null,t]})}function rr(){return Ys(or)}function ti(t){let{theme:e}=rr(),[n,o]=Et("");return At(()=>{let r=qe[t];if(!r)return;let a=e[t];if(a){o(a);return}if(typeof document>"u"){o(r.fallback);return}let i=getComputedStyle(document.documentElement).getPropertyValue(r.name).trim();o(i||r.fallback)},[t,e]),n||qe[t]?.fallback||""}import{jsx as dt}from"react/jsx-runtime";var ar=ri({mode:"walletconnect"});function li(){return ai(ar)}function ut({config:t,children:e,autoConnect:n=!1,detectionMode:o="walletconnect",theme:r,defaultDark:a=!1,themePriority:i="computed"}){let s=si(()=>({mode:o}),[o]),l=o==="walletconnect"||o==="auto";return dt(ar.Provider,{value:s,children:dt(Nn,{theme:r,defaultDark:a,priority:i,children:dt(wn,{components:{QRCodeModal:it},children:dt(ii,{config:t,autoConnect:n,children:l?dt(Vt,{children:e}):e})})})})}import{jsx as fi}from"react/jsx-runtime";var kn={Button:M,ConnectButton:Se,AccountButton:_t,ChainSelector:je,QRCodeModal:it,SignInButton:bn,SeedPhraseBackup:lt,ErrorBoundary:ct,Web3ConnectUI:ut},sr=ci({});function wn({children:t,components:e={}}){let n=ui(()=>({...kn,...e}),[e]);return fi(sr.Provider,{value:n,children:t})}function S(){return di(sr)}function mi(t){return S()[t]}import{jsx as ee,jsxs as De}from"react/jsx-runtime";function ir(t){let e=t&&typeof t=="object"&&"details"in t?t.details:void 0,n=e instanceof Error?`${e.name}: ${e.message}`:e;gi.error("ui/ChainSelector","switchChain failed",t,n)}function mt({chainId:t,className:e}){let n=bt(t);return n?ee("span",{className:y("inline-flex items-center justify-center shrink-0",e),dangerouslySetInnerHTML:{__html:n}}):null}function je({className:t,showLabel:e=!0,variant:n="dropdown"}){let{currentChain:o,availableChains:r,switchChain:a}=xi(),{isConnected:i}=vi(),[s,l]=hi(!1),u=S().Button??M,d=bi(null);if(yi(()=>{function g(m){d.current&&!d.current.contains(m.target)&&l(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]),!i)return null;let f=o?.name??"Unknown Chain",h=r.length>1;return n==="minimal"?De("div",{className:y("inline-flex items-center gap-1.5 text-xs text-muted-foreground",t),children:[o&&ee(mt,{chainId:o.caip2,className:"h-3.5 w-3.5"}),f]}):n==="buttons"?ee("div",{className:y("flex flex-wrap gap-2",t),children:r.map(g=>{let m=g.caip2,b=m===o?.caip2;return De(u,{className:b?y("bg-accent","border-primary"):"",onClick:()=>{b||a(m).catch(ir)},children:[ee(mt,{chainId:m,className:"h-4 w-4"}),g.name,g.token&&ee("span",{className:"text-xs opacity-60",children:g.token})]},m)})}):h?De("div",{ref:d,className:y("relative inline-block",t),children:[De(u,{onClick:()=>l(!s),children:[o&&ee(mt,{chainId:o.caip2,className:"h-4 w-4"}),f,ee("svg",{"aria-hidden":"true",className:y("h-3 w-3 transition-transform",s&&"rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:ee("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),s&&De("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-[180px] rounded-lg border bg-card p-1 shadow-lg animate-in fade-in zoom-in-95 duration-200",children:[e&&ee("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Switch Network"}),r.map(g=>{let m=g.caip2,b=m===o?.caip2;return De(u,{onClick:()=>{b||a(m).catch(ir),l(!1)},className:y("flex w-full items-center gap-2 rounded-md px-2 py-2 text-sm transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",b?"bg-accent font-medium":"hover:bg-accent/50"),children:[ee(mt,{chainId:m,className:"h-4 w-4"}),ee("span",{className:"flex-1 text-left",children:g.name}),g.token&&ee("span",{className:"text-xs text-muted-foreground",children:g.token}),b&&ee("svg",{"aria-hidden":"true",className:"h-4 w-4 text-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:ee("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]},m)})]})]}):De("div",{className:y("inline-flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm opacity-60 cursor-default",t),children:[o&&ee(mt,{chainId:o.caip2,className:"h-4 w-4"}),f]})}import{useEmbeddedWallet as Ci}from"@naculus/connect-appkit-react";import{Check as lr,Copy as Ni,Loader2 as wi,Plus as ki}from"lucide-react";import{useCallback as Rn,useState as Sn}from"react";import{jsx as ne,jsxs as Qe}from"react/jsx-runtime";var Ri={eip155:{name:"Ethereum & EVM",detail:"One address across Ethereum, Polygon, Arbitrum and every EVM chain"},solana:{name:"Solana",detail:"A separate key on a different curve"}};function Si(t){return t.length<=12?t:`${t.slice(0,6)}...${t.slice(-4)}`}function Ti({account:t,isActive:e,onSelect:n}){let[o,r]=Sn(!1),a=Ri[t.namespace]??{name:t.namespace,detail:""},i=Rn(s=>{s.stopPropagation();let l=navigator?.clipboard?.writeText;l&&l.call(navigator.clipboard,t.address).then(()=>{r(!0),setTimeout(()=>r(!1),1500)},()=>{})},[t.address]);return Qe("div",{role:"radio",tabIndex:0,"aria-checked":e,onClick:n,onKeyDown:s=>{s.target===s.currentTarget&&(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),n())},className:y("flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-left text-sm transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e?"border-primary bg-accent":"border-border hover:bg-accent/50"),children:[Qe("span",{className:"flex min-w-0 flex-1 flex-col",children:[Qe("span",{className:"flex items-center gap-2 font-medium",children:[a.name,e&&ne("span",{className:"rounded-sm bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-primary",children:"Signing"})]}),ne("span",{className:"truncate font-mono text-xs text-muted-foreground",children:Si(t.address)})]}),ne("button",{type:"button","aria-label":`Copy ${a.name} address`,onClick:i,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:o?ne(lr,{size:14}):ne(Ni,{size:14})}),e&&ne(lr,{size:16,className:"shrink-0 text-primary"})]})}function cr({className:t,hideBackfill:e=!1,onSelect:n,accounts:o,activeNamespace:r,canDerive:a,setActiveNamespace:i,backfillAccounts:s}){let[l,c]=Sn(!1),[u,d]=Sn(null),f=Rn(m=>{if(m!==r)try{i(m),d(null),n?.(m)}catch(b){d(b instanceof Error?b.message:"Could not switch account")}},[r,i,n]),h=Rn(async()=>{c(!0),d(null);try{await s()}catch(m){d(m instanceof Error?m.message:"Could not derive accounts")}finally{c(!1)}},[s]);if(o.length===0)return null;let g=!e&&a;return Qe("div",{className:y("flex flex-col gap-2",t),children:[Qe("div",{className:"flex items-baseline justify-between",children:[ne("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Accounts"}),ne("span",{className:"text-[11px] text-muted-foreground",children:"Chooses the signing key, not the network"})]}),ne("div",{role:"radiogroup","aria-label":"Wallet accounts",className:"flex flex-col gap-1.5",children:o.map(m=>ne(Ti,{account:m,isActive:m.namespace===r,onSelect:()=>f(m.namespace)},m.namespace))}),g&&Qe("button",{type:"button",onClick:h,disabled:l,className:y("flex items-center justify-center gap-2 rounded-md border border-dashed border-border px-3 py-2 text-xs text-muted-foreground","hover:bg-accent/50 disabled:opacity-60"),children:[l?ne(wi,{size:14,className:"animate-spin"}):ne(ki,{size:14}),l?"Deriving\u2026":"Show accounts this phrase already owns"]}),u&&ne("p",{role:"alert",className:"text-xs text-destructive",children:u})]})}function Bi(t){let{wallet:e,accounts:n,activeNamespace:o,setActiveNamespace:r,backfillAccounts:a}=Ci();return e?ne(cr,{...t,accounts:n,activeNamespace:o,canDerive:e.recoveryAvailable&&n.length<2,setActiveNamespace:r,backfillAccounts:a}):null}import{AlertTriangle as Pi,Info as ur,ShieldAlert as Ai,ShieldCheck as Ei}from"lucide-react";import{useEmbeddedWallet as Di}from"@naculus/connect-appkit-react";import{jsx as se,jsxs as de}from"react/jsx-runtime";var Mi={critical:Ai,warning:Pi,info:ur},Ii={critical:"text-destructive",warning:"text-amber-600 dark:text-amber-500",info:"text-muted-foreground"};function dr(t){return t>=90?"text-emerald-600 dark:text-emerald-500":t>=70?"text-amber-600 dark:text-amber-500":"text-destructive"}function zi({finding:t}){let e=Mi[t.severity]??ur;return de("li",{className:"flex gap-2.5 rounded-md border border-border px-3 py-2.5",children:[se(e,{size:16,className:y("mt-0.5 shrink-0",Ii[t.severity])}),de("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[de("div",{className:"flex items-baseline justify-between gap-2",children:[se("span",{className:"text-sm font-medium",children:t.title}),t.deduction>0&&de("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:["\u2212",t.deduction]})]}),se("p",{className:"text-xs leading-relaxed text-muted-foreground",children:t.detail}),t.remedy&&de("p",{className:"text-xs leading-relaxed",children:[se("span",{className:"font-medium",children:"What helps: "}),se("span",{className:"text-muted-foreground",children:t.remedy})]})]})]})}function mr({className:t,hideInformational:e=!1,report:n}){if(!n)return null;let{score:o,level:r,findings:a,encrypted:i,backend:s,unlock:l}=n,c=e?a.filter(d=>d.deduction>0):a,u=a.every(d=>d.deduction===0);return de("div",{className:y("flex flex-col gap-3",t),children:[de("div",{className:"flex items-center gap-3 rounded-lg border border-border px-4 py-3",children:[se(Ei,{size:22,className:y("shrink-0",dr(o))}),de("div",{className:"flex min-w-0 flex-1 flex-col",children:[de("div",{className:"flex items-baseline gap-2",children:[se("span",{className:y("text-2xl font-semibold tabular-nums",dr(o)),children:o}),se("span",{className:"text-sm text-muted-foreground",children:"/ 100"}),de("span",{className:"ml-auto text-xs text-muted-foreground",children:["Tier ",r]})]}),de("span",{className:"text-xs text-muted-foreground",children:[s==="localStorage"?"localStorage":"IndexedDB",i?" \xB7 encrypted":" \xB7 not encrypted",l.sealedWith?.includes("prf")?" \xB7 passkey":""]})]})]}),u?se("p",{className:"text-xs text-muted-foreground",children:"Nothing is holding this score down."}):se("p",{className:"text-xs text-muted-foreground",children:"Scored against this SDK's own published rubric, not an external standard. Each item below names the points it costs."}),se("ul",{className:"flex flex-col gap-1.5",children:c.map(d=>se(zi,{finding:d},d.id))})]})}function Li(t){let{securityReport:e}=Di();return se(mr,{...t,report:e})}import{useCallback as Wi,useEffect as Vi,useRef as Ui,useState as Tn}from"react";import{Eye as Hi,EyeOff as Oi,KeyRound as _i,ShieldAlert as Fi}from"lucide-react";import{usePassphraseGate as Ki}from"@naculus/connect-appkit-react";import{jsx as F,jsxs as ke}from"react/jsx-runtime";var Bn=8,qi=12;function pr({className:t,request:e,submit:n,cancel:o}){let[r,a]=Tn(""),[i,s]=Tn(""),[l,c]=Tn(!1),u=Ui(null),d=e?.intent==="create";Vi(()=>{if(!e){a(""),s(""),c(!1);return}a(""),s(""),u.current?.focus()},[e]);let f=d&&r.length>0&&r.length<Bn,h=d&&i.length>0&&i!==r,g=d?r.length>=Bn&&i===r:r.length>0,m=Wi(b=>{b.preventDefault(),g&&n(r)},[g,n,r]);return e?F("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",role:"presentation",children:ke("form",{role:"dialog","aria-modal":"true","aria-label":d?"Choose a passphrase":"Unlock your wallet",onSubmit:m,className:y("flex w-full max-w-sm flex-col gap-4 rounded-lg border border-border bg-card p-5 shadow-lg",t),children:[ke("div",{className:"flex items-center gap-2",children:[F(_i,{size:18,className:"shrink-0 text-primary"}),F("h2",{className:"text-base font-semibold",children:d?"Choose a passphrase":"Unlock your wallet"})]}),e.previousError&&F("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive",children:e.previousError}),F("p",{className:"text-xs leading-relaxed text-muted-foreground",children:d?"This encrypts your wallet on this device. Without it, anything that can run script on this page can read your keys.":"Your wallet is encrypted on this device. Enter the passphrase you chose to open it."}),ke("label",{className:"flex flex-col gap-1.5",children:[F("span",{className:"text-xs font-medium",children:"Passphrase"}),ke("span",{className:"relative flex items-center",children:[F("input",{ref:u,type:l?"text":"password",value:r,onChange:b=>a(b.target.value),autoComplete:d?"new-password":"current-password",autoFocus:!0,className:"w-full rounded-md border border-border bg-background px-3 py-2 pr-9 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),F("button",{type:"button","aria-label":l?"Hide passphrase":"Show passphrase",onClick:()=>c(b=>!b),className:"absolute right-2 text-muted-foreground hover:text-foreground",children:l?F(Oi,{size:15}):F(Hi,{size:15})})]})]}),d&&ke("label",{className:"flex flex-col gap-1.5",children:[F("span",{className:"text-xs font-medium",children:"Type it again"}),F("input",{type:l?"text":"password",value:i,onChange:b=>s(b.target.value),autoComplete:"new-password",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"})]}),f&&ke("p",{role:"alert",className:"text-xs text-destructive",children:["At least ",Bn," characters."]}),h&&F("p",{role:"alert",className:"text-xs text-destructive",children:"These do not match."}),d&&!f&&r.length>0&&r.length<qi&&F("p",{className:"text-xs text-muted-foreground",children:"Short. Several ordinary words are far harder to guess than a short one with symbols in it."}),d&&ke("p",{className:"flex gap-2 rounded-md bg-amber-500/10 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-500",children:[F(Fi,{size:14,className:"mt-0.5 shrink-0"}),F("span",{children:"If you forget this, nothing can open this copy of the wallet \u2014 not us, not your browser. Your recovery phrase is the only thing that gets it back."})]}),ke("div",{className:"flex justify-end gap-2 pt-1",children:[F("button",{type:"button",onClick:()=>o(),className:"rounded-md border border-border px-3 py-2 text-sm hover:bg-accent",children:"Cancel"}),F("button",{type:"submit",disabled:!g,className:"rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",children:d?"Encrypt wallet":"Unlock"})]})]})}):null}function ji(t){let{request:e,submit:n,cancel:o}=Ki();return F(pr,{...t,request:e,submit:n,cancel:o})}import{useCallback as hr,useState as Pn}from"react";import{Fingerprint as fr,Loader2 as Qi,ShieldAlert as gr,ShieldCheck as $i,TriangleAlert as Gi}from"lucide-react";import{useEmbeddedWallet as Yi,useWeb3 as Ji}from"@naculus/connect-appkit-react";import{Fragment as Zi,jsx as oe,jsxs as $e}from"react/jsx-runtime";function br({className:t,passkeys:e,unlock:n,onRegistered:o}){let[r,a]=Pn(!1),[i,s]=Pn(null),[l,c]=Pn(!1),u=!!e?.hasCredential?.()||l,d=hr(async()=>{if(e){a(!0),s(null);try{await e.createPasskey(),c(!0),await o?.()}catch(m){s(m instanceof Error?m.message:"Could not register a passkey")}finally{a(!1)}}},[e,o]);if(!e)return null;let f=n?.sealedWith?.includes("prf")??!1,h=null;if(u)switch(n?.prf){case"available":h=f?{tone:"good",icon:oe($i,{size:16}),title:"Your passkey unlocks this wallet",detail:"Opening it needs your fingerprint or face, not a value a script on this page can supply."}:{tone:"warn",icon:oe(Gi,{size:16}),title:"Registered, but not applied yet",detail:"This device can produce the key material. The next time the wallet is saved, the record is sealed under it."};break;case"unavailable":h={tone:"bad",icon:oe(gr,{size:16}),title:"This passkey cannot unlock the wallet",detail:"The authenticator did not return the key material. Firefox does not implement the extension, and a passkey created before it was requested cannot have it added afterwards \u2014 a new one has to be registered on a browser that supports it."};break;default:h={tone:"neutral",icon:oe(fr,{size:16}),title:"A passkey is registered",detail:"Whether it can unlock this wallet is not known until the wallet is opened once. It will be used if it works."};break}let g={good:"text-emerald-600 dark:text-emerald-500",warn:"text-amber-600 dark:text-amber-500",bad:"text-destructive",neutral:"text-muted-foreground"};return $e("div",{className:y("flex flex-col gap-3",t),children:[h?$e("div",{className:"flex gap-2.5 rounded-md border border-border px-3 py-2.5",children:[oe("span",{className:y("mt-0.5 shrink-0",g[h.tone]),children:h.icon}),$e("div",{className:"flex min-w-0 flex-col gap-1",children:[oe("span",{className:"text-sm font-medium",children:h.title}),oe("p",{className:"text-xs leading-relaxed text-muted-foreground",children:h.detail})]})]}):$e(Zi,{children:[oe("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"A passkey raises what it takes to read your stored keys from \u201Cany script on this page\u201D to your fingerprint or face. The passphrase keeps working, so a broken or replaced authenticator does not cost you this copy."}),$e("p",{className:"flex gap-2 rounded-md bg-amber-500/10 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-500",children:[oe(gr,{size:14,className:"mt-0.5 shrink-0"}),oe("span",{children:"This protects the copy on this device. It does not back up your wallet \u2014 the recovery phrase is still the only thing that survives losing this device."})]}),$e("button",{type:"button",onClick:d,disabled:r,className:"flex items-center justify-center gap-2 rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-60",children:[r?oe(Qi,{size:15,className:"animate-spin"}):oe(fr,{size:15}),r?"Waiting for your device\u2026":"Protect with a passkey"]})]}),i&&oe("p",{role:"alert",className:"text-xs text-destructive",children:i})]})}function Xi(t){let{client:e}=Ji(),{securityReport:n,hasWallet:o}=Yi(),r=hr(async()=>{let a=e?.embeddedConnector;a&&o&&await a.save()},[e,o]);return oe(br,{...t,passkeys:e?.passkeysConnector??null,unlock:n?.unlock,onRegistered:r})}import{useAccount as xr,useBalance as el,useChain as tl,useDisconnect as vr,useEmbeddedWallet as nl,useWallet as ol,useWeb3 as rl}from"@naculus/connect-appkit-react";import{createContext as al,useCallback as pt,useContext as sl,useEffect as il,useMemo as Cr,useState as yr}from"react";import{jsx as Me,jsxs as Tr}from"react/jsx-runtime";var Nr=al(null);function wr(){let t=sl(Nr);if(!t)throw new Error("useAppKit must be used within an <AppKit> component");return t}function kr({projectId:t,metadata:e,enableEmbedded:n=!1,enablePasskeys:o=!1,chains:r,embeddedConfig:a,encryptionKey:i,siwx:s,children:l,className:c,autoConnect:u=!1,theme:d,defaultDark:f=!1,themePriority:h="computed",detectionMode:g="auto"}){let[m,b]=yr(!1),[T,p]=yr(!1),x=Cr(()=>({projectId:t,metadata:e,enableEmbedded:n,enablePasskeys:o,chains:r,embeddedConfig:a,encryptionKey:i,siwx:s}),[t,e,n,o,r,a,i,s]);return Me(ut,{config:x,autoConnect:u,detectionMode:g,theme:d,defaultDark:f,themePriority:h,children:Me(ll,{className:c,open:m,setOpen:b,backupOpen:T,setBackupOpen:p,children:l})})}function ll({children:t,className:e,open:n,setOpen:o,backupOpen:r,setBackupOpen:a}){let{isConnected:i,isConnecting:s}=ol(),{primaryAccount:l}=xr(),{currentChain:c,availableChains:u,switchChain:d}=tl(),f=nl(),{disconnect:h}=vr(),{wallets:g,hasWallets:m}=Ye(),{formatted:b}=el(),T=b??null,p=pt(async()=>{await h()},[h]),x=pt(()=>{f.confirmBackup(),a(!1)},[f,a]),B=pt(()=>{f.confirmBackup(),a(!1)},[f,a]),w=pt(()=>f.getPrivateKey(),[f]),V=Cr(()=>({connect:()=>o(!0),disconnect:p,isConnected:i,isConnecting:s,address:l,balance:T,balanceSymbol:c?.token??null,chainName:c?.name??null,availableChains:u.map(D=>({caip2:D.caip2,name:D.name,token:D.token})),switchChain:d,wallets:g,hasWallets:m,backupPending:f.backupPending,seedPhrase:f.seedPhrase,confirmBackup:x,skipBackup:B,open:n,setOpen:o}),[i,s,l,T,c,u,d,g,m,f.backupPending,f.seedPhrase,x,B,p,n,o]);return il(()=>{f.seedPhrase&&f.backupPending&&a(!0)},[f.seedPhrase,f.backupPending,a]),Tr(Nr.Provider,{value:V,children:[t,f.seedPhrase&&r&&Me(lt,{seedPhrase:f.seedPhrase,onConfirm:x,onSkip:B,onExportPrivateKey:w,open:r,onOpenChange:a})]})}function Rr({className:t}){let e=wr(),{connectInjected:n}=rl(),{primaryAccount:o}=xr(),{disconnect:r}=vr(),a=pt(async(i,s,l)=>{i==="injected"&&(await n(l),s())},[n]);return e.isConnected&&o?Tr("div",{className:y("inline-flex items-center gap-2",t),children:[Me(je,{variant:"minimal"}),Me(Se,{isConnected:e.isConnected,address:o,balance:e.balance,balanceSymbol:e.balanceSymbol??void 0,onDisconnect:r,onConnect:a,className:t})]}):Me(Se,{isConnected:e.isConnected,isConnecting:e.isConnecting,address:o,balance:e.balance,balanceSymbol:e.balanceSymbol??void 0,onDisconnect:r,onConnect:a,className:t})}function Sr({className:t,variant:e="dropdown"}){return Me(je,{className:t,variant:e})}try{let t=kn;t&&Object.assign(t,{AppKit:kr,AppKitButton:Rr,AppKitChainSelector:Sr})}catch{}import{ArrowRight as cl,CheckCircle2 as dl,Clock as ul,DollarSign as ml,Loader2 as Er,XCircle as pl,AlertCircle as fl}from"lucide-react";import{Fragment as Ar,jsx as v,jsxs as U}from"react/jsx-runtime";function gl(t){if(t<1e3)return"<1s";if(t<6e4)return`~${Math.round(t/1e3)}s`;let e=Math.floor(t/6e4),n=Math.round(t%6e4/1e3);return n>0?`~${e}m ${n}s`:`~${e}m`}function Br(t){return t.symbol||"UNKNOWN"}function hl(t){let e=t.toLowerCase();return e.includes("lifi")?"default":e.includes("axelar")?"secondary":"outline"}function bl(t){return t.length>12?`${t.slice(0,6)}...${t.slice(-6)}`:t}function yl({route:t,onSelect:e}){let n=S(),o=n.Button??M,r=n.Badge,a=t.provider??"Route";return U("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border p-4 transition-colors hover:bg-accent/30",children:[U("div",{className:"flex flex-col gap-1.5 min-w-0",children:[U("div",{className:"flex items-center gap-2",children:[r?v(r,{variant:hl(a),children:a}):v("span",{className:"inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium",children:a}),t.steps.length>1&&U("span",{className:"text-xs text-muted-foreground",children:[t.steps.length," steps"]})]}),U("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-sm",children:[U("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[v(ml,{className:"h-3.5 w-3.5"}),"$",t.gasCosts.totalUsd]}),U("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[v(ul,{className:"h-3.5 w-3.5"}),gl(t.steps.reduce((i,s)=>{let l=t.estimatedTime>0?15e3:0;return i+l},0))]}),U("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[t.gasCosts.totalUsd," cost"]})]})]}),v(o,{variant:"outline",size:"sm",onClick:e,children:"Select"})]})}function xl(){let e=S().Skeleton;return U("div",{className:"flex flex-col gap-3","data-testid":"route-selector-loading",children:[U("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[v(Er,{className:"h-4 w-4 animate-spin"}),v("span",{children:"Fetching best routes..."})]}),[1,2,3].map(n=>U("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border p-4",children:[v("div",{className:"flex flex-col gap-2 flex-1",children:e?U(Ar,{children:[v(e,{className:"h-4 w-24"}),v(e,{className:"h-3 w-48"})]}):U(Ar,{children:[v("div",{className:"h-4 w-24 animate-pulse rounded bg-muted"}),v("div",{className:"h-3 w-48 animate-pulse rounded bg-muted"})]})}),e?v(e,{className:"h-8 w-20 rounded-md"}):v("div",{className:"h-8 w-20 animate-pulse rounded-md bg-muted"})]},n))]})}function vl(){return U("div",{className:"flex flex-col items-center justify-center gap-2 py-8 text-sm text-muted-foreground","data-testid":"route-selector-empty",children:[v(fl,{className:"h-8 w-8 opacity-40"}),v("span",{children:"No routes found for this pair"}),v("span",{className:"text-xs",children:"Try a different token or amount"})]})}function Cl({error:t,onRetry:e}){let o=S().Button??M;return U("div",{className:"flex flex-col items-center justify-center gap-2 py-6","data-testid":"route-selector-error",children:[v(pl,{className:"h-8 w-8 text-destructive"}),v("p",{className:"text-sm text-destructive font-medium",children:"Failed to fetch routes"}),v("p",{className:"text-xs text-muted-foreground max-w-xs text-center",children:t}),e&&v(o,{variant:"outline",size:"sm",onClick:e,children:"Retry"})]})}function Nl(){let e=S().Progress;return U("div",{className:"flex flex-col items-center gap-3 py-6","data-testid":"route-selector-executing",children:[v(Er,{className:"h-6 w-6 animate-spin text-primary"}),v("p",{className:"text-sm font-medium",children:"Executing route..."}),v("p",{className:"text-xs text-muted-foreground",children:"Please confirm the transaction in your wallet"}),e?v(e,{value:50,className:"w-48 h-1.5"}):v("div",{className:"h-1.5 w-48 rounded-full bg-muted",children:v("div",{className:"h-full w-1/2 rounded-full bg-primary animate-pulse"})})]})}function wl({txHash:t}){return U("div",{className:"flex flex-col items-center gap-2 py-6","data-testid":"route-selector-success",children:[v(dl,{className:"h-8 w-8 text-green-500"}),v("p",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:"Route executed successfully!"}),U("p",{className:"text-xs text-muted-foreground font-mono",children:["TX: ",bl(t)]})]})}function Pr({chainId:t,className:e}){let n=bt(`eip155:${t}`);return n?v("span",{className:y("inline-flex items-center justify-center shrink-0",e),dangerouslySetInnerHTML:{__html:n}}):null}function kl({inputToken:t,outputToken:e,amount:n,routes:o=[],loading:r=!1,executing:a=!1,onRouteSelected:i,onCancel:s,successTxHash:l,error:c,className:u}){let d=S(),f=d.Card,h=d.Button??M;if(l)return v("div",{className:y("rounded-lg border border-border",u),children:v(wl,{txHash:l})});if(a)return v("div",{className:y("rounded-lg border border-border",u),children:v(Nl,{})});return f?U(f,{className:y("p-4",u),children:[m(),b(),T()]}):U("div",{className:y("rounded-lg border border-border p-4",u),children:[m(),b(),T()]});function m(){return!t&&!e?null:U("div",{className:"mb-4 flex flex-wrap items-center gap-2 text-sm",children:[t&&U("span",{className:"inline-flex items-center gap-1.5 font-medium",children:[v(Pr,{chainId:t.chainId,className:"h-4 w-4"}),n?`${n.toString()} `:"",Br(t)]}),t&&e&&v(cl,{className:"h-3.5 w-3.5 text-muted-foreground"}),e&&U("span",{className:"inline-flex items-center gap-1.5 font-medium",children:[v(Pr,{chainId:e.chainId,className:"h-4 w-4"}),Br(e)]})]})}function b(){return r?v(xl,{}):c?v(Cl,{error:c}):o.length===0?v(vl,{}):v("div",{className:"flex flex-col gap-2","data-testid":"route-selector-routes",children:o.map((p,x)=>v(yl,{route:p,onSelect:()=>i?.(p)},`${p.fromChain}-${p.toChain}-${p.gasCosts.totalUsd}-${x}`))})}function T(){return!r&&o.length===0&&!c?null:v("div",{className:"mt-4 flex justify-end",children:v(h,{variant:"ghost",size:"sm",onClick:s,children:"Cancel"})})}}import Rl from"react";import{Shield as Sl,ShieldCheck as Dr,LoaderCircle as Tl,Settings as Bl,ChevronRight as Pl,AlertCircle as Al,RotateCcw as El,CheckCircle2 as Dl,Fuel as Mr,Zap as Ml,RefreshCw as Il}from"lucide-react";import{Fragment as Wl,jsx as R,jsxs as H}from"react/jsx-runtime";function zl(t){let e=Number(t)/1e18;return e<.001?`~${e.toFixed(6)} ETH`:`~${e.toFixed(3)} ETH`}function Ll({isDeployed:t=!1,isDeploying:e=!1,estimatedGas:n,error:o=null,onUpgrade:r,onShowSettings:a,onRetry:i}){let s=S(),l=s.Button??M,c=s.Card??me,u=s.Badge??We,d=a?H(l,{variant:"outline",className:"w-full",onClick:a,children:[R(Bl,{size:15})," Advanced Settings ",R(Pl,{size:14,className:"text-muted-foreground"})]}):null;return t?H(c,{className:"w-full rounded-xl border border-border bg-card p-5 shadow-sm",children:[R("div",{className:"flex items-start justify-between",children:H("div",{className:"flex items-center gap-3",children:[R("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-green-500/10",children:R(Dr,{size:22,className:"text-green-500"})}),H("div",{children:[H("div",{className:"flex items-center gap-2",children:[R("span",{className:"text-base font-semibold text-foreground",children:"Smart Wallet"}),H(u,{variant:"secondary",className:"rounded-full bg-green-500/10 px-2 py-0 text-xs font-medium text-green-500",children:[R(Dl,{size:12,className:"mr-0.5 inline"})," Deployed"]})]}),R("p",{className:"mt-0.5 text-sm text-muted-foreground",children:"Your wallet has been upgraded to a smart wallet"})]})]})}),R("div",{className:"mt-4 grid grid-cols-2 gap-3",children:[[Mr,"Gas Sponsorship","Enabled"],[Il,"Recovery","Enabled"]].map(([f,h,g])=>H("div",{className:"rounded-lg bg-muted/50 p-3",children:[H("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[Rl.createElement(f,{size:14}),R("span",{children:h})]}),R("div",{className:"mt-1 text-sm font-medium text-foreground",children:g})]},h))}),a&&R("div",{className:"mt-4",children:d})]}):e?R(c,{className:"w-full rounded-xl border border-border bg-card p-5 shadow-sm",children:H("div",{className:"flex flex-col items-center text-center",children:[R("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-primary/10",children:R(Tl,{size:28,className:"animate-spin text-primary"})}),R("h3",{className:"mb-1 text-base font-semibold text-foreground",children:"Deploying Smart Wallet..."}),R("p",{className:"mb-4 text-sm text-muted-foreground",children:"Please wait, contract deployment may take a few seconds"}),R("div",{className:"h-2 w-full max-w-[200px] overflow-hidden rounded-full bg-muted",children:R("div",{className:"h-full w-full animate-pulse rounded-full bg-primary",style:{animationDuration:"1.5s"}})})]})}):o?H(c,{className:"w-full rounded-xl border border-destructive/30 bg-destructive/5 p-5 shadow-sm",children:[H("div",{className:"flex items-start gap-3",children:[R("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-destructive/10",children:R(Al,{size:18,className:"text-destructive"})}),H("div",{className:"min-w-0 flex-1",children:[R("h4",{className:"text-sm font-semibold text-destructive",children:"Deployment Failed"}),R("p",{className:"mt-1 text-xs text-destructive/80 break-words",children:o}),i&&H(l,{variant:"outline",size:"sm",className:"mt-3 border-destructive/30 text-destructive hover:bg-destructive/10",onClick:i,children:[R(El,{size:13})," Retry"]})]})]}),a&&R("div",{className:"mt-3",children:d})]}):H(c,{className:"w-full rounded-xl border border-border bg-card p-5 shadow-sm",children:[H("div",{className:"flex items-center gap-3",children:[R("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-500/10",children:R(Sl,{size:20,className:"text-amber-500"})}),H("div",{children:[H("div",{className:"flex items-center gap-2",children:[R("span",{className:"text-base font-semibold text-foreground",children:"Smart Wallet"}),R("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground",children:"Not Upgraded"})]}),R("p",{className:"mt-0.5 text-sm text-muted-foreground",children:"Upgrade to a smart wallet for more features"})]})]}),H("div",{className:"mt-4 space-y-2",children:[R(An,{icon:Ml,color:"text-green-500",text:"No ETH needed for transactions \u2014 pay gas with USDC/USDT"}),R(An,{icon:Mr,color:"text-blue-500",text:"Optional dApp sponsorship, zero-cost transactions"}),R(An,{icon:Dr,color:"text-purple-500",text:"Secure recovery mechanism, no fear of losing keys"})]}),r&&H(l,{className:"mt-4 w-full",onClick:r,children:["Upgrade Now",n!==void 0&&H("span",{className:"ml-1 text-xs opacity-80",children:["(Estimated gas fee: ",zl(n),")"]})]}),a&&H(Wl,{children:[H("div",{className:"mt-4 mb-3 flex items-center gap-2",children:[R("div",{className:"h-px flex-1 bg-border"}),R("span",{className:"text-xs text-muted-foreground",children:"or"}),R("div",{className:"h-px flex-1 bg-border"})]}),d]})]})}function An({icon:t,color:e,text:n}){return H("div",{className:"flex items-center gap-2.5 text-sm text-foreground/80",children:[R(t,{size:14,className:`shrink-0 ${e}`}),R("span",{children:n})]})}import{useState as En,useCallback as Ir}from"react";import{ArrowLeft as zr,Save as Vl,Shield as Lr,Users as Wr,KeyRound as Vr,Fuel as Ul,Wrench as Hl,Plus as Ol,X as _l}from"lucide-react";import{jsx as C,jsxs as I}from"react/jsx-runtime";var Fl=[{value:"simple",label:"Single Sign (default)",description:"Single key control, simple and secure",icon:C(Lr,{size:16})},{value:"multi-sig",label:"Multi-Sign (2-of-3)",description:"Requires multiple signers to authorize transactions",icon:C(Wr,{size:16})},{value:"social-recovery",label:"Social Recovery",description:"Set guardian accounts to help recover",icon:C(Vr,{size:16})}],Kl=[{value:"self",label:"Pay Self (ETH)",description:"Pay gas fees with ETH"},{value:"sponsor",label:"Sponsored by dApp",description:"dApp covers your gas fees"},{value:"erc20",label:"Pay with USDC/USDT",description:"Use ERC-20 tokens for gas"},{value:"custom",label:"Custom Paymaster URL",description:"Use a custom paymaster service"}],ql=[{value:"pimlico",label:"Pimlico",description:"High-performance bundler service"},{value:"stackup",label:"Stackup",description:"Decentralized bundler network"},{value:"alchemy",label:"Alchemy",description:"Alchemy AA infrastructure"},{value:"custom",label:"Custom Bundler URL",description:"Use custom bundler endpoint"}];function jl(){return{accountType:"simple",paymasterType:"self",customPaymasterUrl:"",bundlerPreset:"pimlico",customBundlerUrl:"",guardians:[],threshold:2}}function Ql({currentConfig:t,onSave:e,onBack:n}){let o=S(),r=o.Button??M,a=o.Input??On,i=o.Card??me,s=o.Separator??_n,[l,c]=En({...jl(),...t}),[u,d]=En(""),[f,h]=En(!1),g=p=>y("flex cursor-pointer items-center gap-3 rounded-lg border px-4 py-3 transition-all duration-200",p?"border-primary bg-primary/5":"border-border hover:bg-accent"),m="w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground outline-none focus:border-ring focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-all duration-200",b=Ir(()=>{e?.(l),h(!0),setTimeout(()=>h(!1),2e3)},[l,e]),T=Ir(()=>{let p=u.trim();!p||l.guardians.includes(p)||(c(x=>({...x,guardians:[...x.guardians,p]})),d(""))},[u,l.guardians]);return I(i,{className:"w-full rounded-xl border border-border bg-card p-5 shadow-sm",children:[C("div",{className:"flex items-center justify-between mb-5",children:I("div",{className:"flex items-center gap-2",children:[n&&I(r,{variant:"ghost",size:"sm",onClick:n,children:[C(zr,{size:15}),"Back"]}),C("h2",{className:"text-lg font-semibold text-foreground",children:"Smart Wallet Settings"})]})}),I("section",{className:"mb-6",children:[I("h3",{className:"mb-3 flex items-center gap-1.5 text-sm font-semibold text-foreground",children:[C(Lr,{size:15})," Verification Method"]}),C("div",{className:"space-y-2",children:Fl.map(p=>I("label",{className:g(l.accountType===p.value),children:[C("input",{type:"radio",name:"accountType",value:p.value,checked:l.accountType===p.value,onChange:()=>c(x=>({...x,accountType:p.value})),className:"h-4 w-4 text-primary accent-primary"}),C("div",{className:"flex items-center gap-2 text-foreground",children:p.icon}),I("div",{children:[C("div",{className:"text-sm font-medium text-foreground",children:p.label}),C("div",{className:"text-xs text-muted-foreground",children:p.description})]})]},p.value))})]}),l.accountType==="social-recovery"&&I("section",{className:"mb-6 rounded-lg border border-border bg-muted/30 p-4",children:[I("h4",{className:"mb-2 flex items-center gap-1.5 text-sm font-semibold text-foreground",children:[C(Vr,{size:14})," Guardian Addresses"]}),C("p",{className:"mb-3 text-xs text-muted-foreground",children:"Set at least one guardian to help recover your wallet if you lose your key"}),l.guardians.length>0&&C("div",{className:"mb-3 space-y-1.5",children:l.guardians.map(p=>I("div",{className:"flex items-center justify-between rounded-md bg-card px-3 py-2 text-sm",children:[I("span",{className:"font-mono text-xs text-foreground",children:[p.slice(0,8),"...",p.slice(-6)]}),C(r,{variant:"ghost",size:"icon",onClick:()=>c(x=>({...x,guardians:x.guardians.filter(B=>B!==p)})),children:C(_l,{size:14})})]},p))}),I("div",{className:"flex gap-2",children:[C(a,{type:"text",placeholder:"Enter guardian address (0x...)",value:u,onChange:p=>d(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),T())},className:"flex-1"}),I(r,{size:"sm",onClick:T,disabled:!u.trim(),children:[C(Ol,{size:14})," Add"]})]})]}),l.accountType==="multi-sig"&&I("section",{className:"mb-6 rounded-lg border border-border bg-muted/30 p-4",children:[I("h4",{className:"mb-2 flex items-center gap-1.5 text-sm font-semibold text-foreground",children:[C(Wr,{size:14})," Signing Threshold"]}),C("p",{className:"mb-3 text-xs text-muted-foreground",children:"Set how many signers are needed to authorize a transaction"}),C("div",{className:"flex items-center gap-3",children:[1,2,3].map(p=>I("label",{className:g(l.threshold===p),children:[C("input",{type:"radio",name:"threshold",value:p,checked:l.threshold===p,onChange:()=>c(x=>({...x,threshold:p})),className:"sr-only"}),p,"-of-3"]},p))})]}),C(s,{className:"my-4"}),I("section",{className:"mb-6",children:[I("h3",{className:"mb-3 flex items-center gap-1.5 text-sm font-semibold text-foreground",children:[C(Ul,{size:15})," Gas Fees"]}),C("div",{className:"space-y-2",children:Kl.map(p=>I("label",{className:g(l.paymasterType===p.value),children:[C("input",{type:"radio",name:"paymasterType",value:p.value,checked:l.paymasterType===p.value,onChange:()=>c(x=>({...x,paymasterType:p.value})),className:"h-4 w-4 text-primary accent-primary"}),I("div",{className:"flex-1",children:[C("div",{className:"text-sm font-medium text-foreground",children:p.label}),C("div",{className:"text-xs text-muted-foreground",children:p.description})]})]},p.value))}),l.paymasterType==="custom"&&C("div",{className:"mt-3",children:C("input",{type:"text",placeholder:"Custom Paymaster URL",value:l.customPaymasterUrl,onChange:p=>c(x=>({...x,customPaymasterUrl:p.target.value})),className:m})})]}),C(s,{className:"my-4"}),I("section",{className:"mb-6",children:[I("h3",{className:"mb-3 flex items-center gap-1.5 text-sm font-semibold text-foreground",children:[C(Hl,{size:15})," Bundler"]}),C("div",{className:"space-y-2",children:ql.map(p=>I("label",{className:g(l.bundlerPreset===p.value),children:[C("input",{type:"radio",name:"bundlerPreset",value:p.value,checked:l.bundlerPreset===p.value,onChange:()=>c(x=>({...x,bundlerPreset:p.value})),className:"h-4 w-4 text-primary accent-primary"}),I("div",{className:"flex-1",children:[C("div",{className:"text-sm font-medium text-foreground",children:p.label}),C("div",{className:"text-xs text-muted-foreground",children:p.description})]})]},p.value))}),l.bundlerPreset==="custom"&&C("div",{className:"mt-3",children:C("input",{type:"text",placeholder:"Custom Bundler URL",value:l.customBundlerUrl,onChange:p=>c(x=>({...x,customBundlerUrl:p.target.value})),className:m})})]}),I("div",{className:"flex items-center gap-3",children:[I(r,{className:"flex-1",onClick:b,children:[C(Vl,{size:15}),f?"Saved \u2713":"Save Settings"]}),n&&I(r,{variant:"outline",onClick:n,children:[C(zr,{size:15}),"\u2190 Back to Simple Mode"]})]})]})}import{AlertTriangle as $l,CheckCircle as Gl,ShieldAlert as Yl,X as Jl}from"lucide-react";import{useValidateDestination as Xl}from"@naculus/connect-appkit-react";import{jsx as $,jsxs as Re}from"react/jsx-runtime";var Zl={ok:{icon:$(Gl,{size:20}),label:"No problem found",colorClass:"text-muted-foreground",bgClass:"bg-muted",buttonVariant:"default"},warning:{icon:$($l,{size:20}),label:"Warning",colorClass:"text-[hsl(var(--warning,38_92%_50%))]",bgClass:"bg-[hsl(var(--warning)/0.1)]",buttonVariant:"default"},blocked:{icon:$(Yl,{size:20}),label:"Blocked",colorClass:"text-destructive",bgClass:"bg-destructive/10",buttonVariant:"destructive"}};function ec({address:t,open:e,onClose:n,onProceed:o}){let r=S(),a=r.Button,i=r.Dialog,s=r.DialogContent,l=r.DialogHeader,c=r.DialogTitle,{validation:u}=Xl({address:t}),{level:d,warning:f}=u,h=Zl[d],g=d==="blocked",m=t.length>12?`${t.slice(0,6)}...${t.slice(-4)}`:t,b=p=>y("inline-flex items-center justify-center whitespace-nowrap rounded-lg","text-sm font-medium transition-all duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","h-10 px-4 py-2",p==="outline"&&"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",p==="destructive"&&"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm",p==="default"&&"bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm"),T=Re("div",{className:"flex flex-col gap-4",children:[Re("div",{className:y("flex items-center gap-3 rounded-lg p-4",h.bgClass),children:[$("span",{className:h.colorClass,children:h.icon}),Re("div",{className:"flex flex-col gap-0.5",children:[$("span",{className:y("text-sm font-semibold",h.colorClass),children:h.label}),$("span",{className:"text-xs text-muted-foreground break-all font-mono",children:m})]})]}),f&&$("p",{className:"text-sm text-muted-foreground m-0",children:f}),Re("div",{className:"flex gap-2 justify-end pt-2",children:[a?$(a,{onClick:n,variant:"outline",className:"w-full sm:w-auto",children:"Cancel"}):$("button",{type:"button",onClick:n,className:y(b("outline"),"w-full sm:w-auto"),children:"Cancel"}),o&&(a?$(a,{onClick:o,variant:g?"destructive":"default",disabled:g,className:"w-full sm:w-auto",children:"Proceed anyway"}):$("button",{type:"button",onClick:o,disabled:g,className:y(b(g?"destructive":"default"),"w-full sm:w-auto"),children:"Proceed anyway"}))]})]});return i&&s&&l&&c?$(i,{open:e,onOpenChange:p=>{p||n()},children:Re(s,{className:"sm:max-w-md",children:[$(l,{children:$(c,{children:"Address Warning"})}),T]})}):e?Re("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[$("div",{className:"absolute inset-0 bg-black/80","aria-hidden":"true",onClick:n}),Re("div",{role:"dialog","aria-modal":"true",className:"relative z-10 w-full max-w-sm rounded-xl border bg-card text-card-foreground shadow-2xl p-6",children:[Re("div",{className:"flex items-center justify-between mb-4",children:[$("h2",{className:"text-lg font-semibold m-0",children:"Address Warning"}),$("button",{onClick:n,type:"button",className:"rounded-md p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":"Close",children:$(Jl,{size:16})})]}),T]})]}):null}import{Wallet as Ur,AlertCircle as tc}from"lucide-react";import{jsx as te,jsxs as Ie}from"react/jsx-runtime";function nc({wallets:t,onSelect:e,loading:n=!1,error:o=null}){let a=S().Card,i=s=>a?te(a,{className:"p-4",children:s}):te("div",{className:"rounded-xl border bg-card text-card-foreground shadow-sm p-4",children:s});return n?i(Ie("div",{className:"flex flex-col gap-3",children:[Array.from({length:3}).map((s,l)=>Ie("div",{className:"flex items-center gap-3 p-3 rounded-lg animate-pulse",children:[te("div",{className:"h-10 w-10 rounded-full bg-muted"}),te("div",{className:"h-4 w-32 rounded bg-muted"})]},l)),te("p",{className:"text-xs text-muted-foreground text-center m-0",children:"Detecting wallets..."})]})):o?i(Ie("div",{className:"flex flex-col items-center gap-3 py-4",children:[te(tc,{size:24,className:"text-destructive"}),te("p",{className:"text-sm text-destructive m-0 font-medium",children:o})]})):t.length===0?i(Ie("div",{className:"flex flex-col items-center gap-3 py-6",children:[te(Ur,{size:32,className:"text-muted-foreground"}),Ie("p",{className:"text-sm text-muted-foreground m-0 text-center",children:["No wallets detected.",te("br",{}),"Install a browser wallet extension to get started."]})]})):te("div",{className:"flex flex-col gap-2",children:t.map(s=>Ie("button",{type:"button",onClick:()=>e(s),className:y("flex items-center gap-3 w-full p-3 rounded-lg","border border-input bg-card hover:bg-accent hover:text-accent-foreground","transition-all duration-200 cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[s.icon?te("img",{src:s.icon,alt:s.name,className:"h-10 w-10 rounded-full object-cover shrink-0",onError:l=>{l.target.style.display="none"}}):te("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center shrink-0",children:te(Ur,{size:18,className:"text-muted-foreground"})}),Ie("div",{className:"flex flex-col items-start gap-0.5 text-left min-w-0",children:[te("span",{className:"text-sm font-medium truncate w-full",children:s.name}),te("span",{className:"text-xs text-muted-foreground truncate w-full",children:s.rdns})]})]},s.id))})}import{describeAuthorization as cc}from"@naculus/connect-appkit-core";import{AlertTriangle as dc,ShieldCheck as uc,ShieldX as mc}from"lucide-react";import{formatAuthorizationAmount as oc}from"@naculus/connect-appkit-core";import{Check as rc,Copy as ac}from"lucide-react";import{useState as sc}from"react";import{jsx as Dt,jsxs as lc}from"react/jsx-runtime";function ic(t){return t.length<=18?t:`${t.slice(0,8)}\u2026${t.slice(-8)}`}function ze({value:t}){let n=S().Button??M,[o,r]=sc(!1),a=async()=>{await navigator.clipboard?.writeText(t),r(!0)};return lc("span",{className:"flex min-w-0 items-center gap-1.5",children:[Dt("span",{className:"min-w-0 break-all font-mono text-xs",title:t,children:ic(t)}),Dt(n,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 p-0","aria-label":o?`Copied ${t}`:`Copy ${t}`,onClick:()=>{a()},children:o?Dt(rc,{"aria-hidden":!0,size:14}):Dt(ac,{"aria-hidden":!0,size:14})})]})}function Hr(t,e,n){if(t===null)return"Amount not reported";let o=e?n[e]:void 0;return/^\d+$/.test(String(t))?oc(BigInt(t),o).formatted:`${t.toString()} base units`}function Mt(t,e=!1){return y("border",t?"border-emerald-700 bg-emerald-50 text-emerald-900 dark:border-emerald-500 dark:bg-emerald-950 dark:text-emerald-100":e?"border-destructive/60 bg-destructive/10 text-foreground":"border-border bg-muted text-foreground")}import{jsx as W,jsxs as K}from"react/jsx-runtime";function pc(t){return"expiry"in t}function fc({authorization:t,assets:e={},locale:n,now:o,requester:r,preview:a,onApprove:i,onDecline:s,busy:l=!1,className:c}){let u=pc(t)?t:cc(t,{assets:e,locale:n,now:o}),d=S(),f=d.Button??M,h=d.Card??me;return K("section",{"aria-labelledby":"authorization-consent-title",className:y("mx-auto flex w-full max-w-lg flex-col gap-4 overflow-hidden text-foreground",c),onKeyDown:g=>{g.key==="Escape"&&s()},children:[K("header",{className:"flex min-w-0 items-center gap-3",children:[r.icon?W("img",{className:"h-11 w-11 shrink-0 rounded-xl object-cover",src:r.icon,alt:""}):W("span",{"aria-hidden":!0,className:"grid h-11 w-11 shrink-0 place-items-center rounded-xl bg-muted text-lg font-semibold",children:r.name.slice(0,1).toUpperCase()}),K("div",{className:"min-w-0",children:[K("h2",{id:"authorization-consent-title",className:"truncate text-lg font-semibold",children:["Allow ",r.name," to pay?"]}),r.origin&&W("p",{className:"break-all text-xs text-muted-foreground",children:r.origin})]})]}),u.warnings.map(g=>K("div",{role:"alert",className:"flex gap-2 rounded-lg border border-amber-700 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-500 dark:bg-amber-950 dark:text-amber-100",children:[W(dc,{"aria-hidden":!0,className:"mt-0.5 shrink-0",size:18}),W("strong",{children:g})]},g)),a&&K("div",{className:y("flex gap-2 rounded-lg p-3 text-sm",Mt(a.allowed,!a.allowed)),children:[a.allowed?W(uc,{"aria-hidden":!0,size:18}):W(mc,{"aria-hidden":!0,size:18}),K("p",{children:[K("strong",{children:[a.allowed?"Allowed":"Blocked","."]})," ",a.sentence]})]}),W("div",{className:"flex flex-col gap-3",children:u.grants.map(g=>K(h,{className:"min-w-0 p-4",children:[W("h3",{className:"break-all text-sm font-semibold",children:g.assetLabel}),K("div",{className:"mt-3 grid grid-cols-2 gap-3",children:[K("div",{children:[W("p",{className:"text-xs text-muted-foreground",children:"Per payment"}),W("p",{className:"break-words text-xl font-semibold tabular-nums",children:g.perPayment.formatted})]}),K("div",{children:[W("p",{className:"text-xs text-muted-foreground",children:"Total limit"}),W("p",{className:"break-words text-xl font-semibold tabular-nums",children:g.total.formatted})]})]}),K("dl",{className:"mt-4 grid gap-3 text-sm",children:[K("div",{children:[W("dt",{className:"font-medium",children:"Recipients"}),W("dd",{className:"mt-1 flex flex-col gap-1",children:g.recipients.length?g.recipients.map(m=>W(ze,{value:m.full},m.full)):W("span",{className:"font-semibold text-destructive",children:"No recipient restriction is displayed"})})]}),K("div",{children:[W("dt",{className:"font-medium",children:"Payment count"}),W("dd",{className:"text-muted-foreground",children:g.count===null?"No count limit":`Up to ${g.count}`})]}),K("div",{children:[W("dt",{className:"font-medium",children:"Payment methods"}),W("dd",{className:"mt-1 flex flex-wrap gap-1.5",children:g.rails.map(m=>W("span",{className:"rounded-full border border-border bg-muted px-2 py-1 text-xs",children:m},m))})]})]})]},`${g.asset}:${g.recipients.map(m=>m.full).join(",")}:${g.perPayment.formatted}:${g.total.formatted}`))}),K("div",{className:"rounded-lg bg-muted p-3 text-sm",children:[K("p",{className:"font-medium",children:["Expires ",u.expiry.relative]}),W("time",{className:"text-xs text-muted-foreground",dateTime:new Date(u.expiry.timestamp*1e3).toISOString(),children:u.expiry.absolute})]}),K("div",{className:"grid grid-cols-2 gap-3",children:[W(f,{variant:"outline",onClick:s,children:"Decline"}),W(f,{disabled:l,"aria-busy":l,onClick:i,children:l?"Approving\u2026":"Approve"})]})]})}import{describeAuthorization as gc,formatAuthorizationAmount as hc}from"@naculus/connect-appkit-core";import{AlertTriangle as bc,Ban as yc}from"lucide-react";import{useState as Or}from"react";import{Fragment as vc,jsx as q,jsxs as ie}from"react/jsx-runtime";function xc({entries:t,assets:e={},onRevoke:n,revokingId:o,locale:r,className:a}){let i=Array.isArray(t)?t:t.entries,[s,l]=Or(null),[c,u]=Or(new Set),d=S(),f=d.Button??M,h=d.Card??me,g=d.Badge??We;return i.length===0?ie("section",{className:y("rounded-xl border border-dashed border-border p-8 text-center",a),children:[q(yc,{"aria-hidden":!0,className:"mx-auto mb-2 text-muted-foreground"}),q("h2",{className:"font-semibold",children:"No payment authorizations"}),q("p",{className:"mt-1 text-sm text-muted-foreground",children:"Approvals you create will appear here."})]}):ie("section",{"aria-labelledby":"authorization-list-title",className:y("flex flex-col gap-3",a),children:[q("h2",{id:"authorization-list-title",className:"text-lg font-semibold",children:"Payment authorizations"}),i.map(m=>{let b=gc(m,{assets:e,locale:r}),T=o===m.keyId;return ie(h,{className:"min-w-0 p-4",children:[ie("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[ie("div",{className:"min-w-0",children:[q("h3",{className:"break-all font-semibold",children:b.label??b.grants.map(p=>p.assetLabel).join(", ")}),q("p",{className:"text-xs text-muted-foreground",children:{"evm-session":"EVM session key","solana-session":"Solana session key","mpp-voucher":"MPP channel key"}[m.enforcer]??m.enforcer.replaceAll("-"," ")})]}),q(g,{className:y("capitalize",m.status==="active"&&"bg-primary text-primary-foreground",m.status==="pending"&&"border border-border bg-background",(m.status==="revoked"||m.status==="expired")&&"bg-muted text-muted-foreground"),children:m.status})]}),q("div",{className:"mt-3 flex flex-col gap-3",children:b.grants.map(p=>{let x=m.spent?.[p.asset],B=m.grants.find(V=>V.asset===p.asset)?.maxTotal,w=x!==void 0&&B&&B>0n?Number(x*100n/B):null;return ie("div",{className:"min-w-0 rounded-lg bg-muted p-3",children:[b.label&&q("p",{className:"break-all text-sm font-medium",children:p.assetLabel}),q("div",{className:"mt-1 flex flex-col gap-1",children:p.recipients.map(V=>q(ze,{value:V.full},V.full))}),x!==void 0&&ie("div",{className:"mt-3",children:[ie("div",{className:"flex justify-between gap-2 text-xs",children:[ie("span",{children:["Spent"," ",hc(x,e[p.asset]).formatted]}),ie("span",{children:["Total ",p.total.formatted]})]}),q("div",{role:"progressbar","aria-label":`${p.assetLabel} spent`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(w??0,100),className:"mt-1 h-2 overflow-hidden rounded-full bg-background",children:q("span",{className:"block h-full bg-primary",style:{width:`${Math.min(w??0,100)}%`}})})]})]},p.asset)})}),ie("p",{className:"mt-3 text-xs text-muted-foreground",title:new Date(b.expiry.timestamp*1e3).toISOString(),children:[m.status==="expired"?"Expired":m.status==="revoked"?"Revoked":`Expires ${b.expiry.relative}`," \xB7 ",b.expiry.absolute]}),b.warnings.map(p=>ie("p",{role:"alert",className:"mt-2 flex gap-2 rounded-md border border-amber-700 bg-amber-50 p-2 text-sm text-amber-950 dark:border-amber-500 dark:bg-amber-950 dark:text-amber-100",children:[q(bc,{"aria-hidden":!0,className:"shrink-0",size:16}),p]},p)),c.has(m.keyId)&&q("p",{role:"status",className:"mt-2 rounded-md border border-amber-700 p-2 text-sm font-medium",children:"Local access is revoked. Complete the on-chain revocation to stop this authorization on chain."}),m.status==="active"||m.status==="pending"?q("div",{className:"mt-3 flex justify-end gap-2",children:s===m.keyId?ie(vc,{children:[q(f,{variant:"ghost",onClick:()=>l(null),children:"Cancel"}),q(f,{disabled:T,"aria-busy":T,onClick:()=>{Promise.resolve(n(m)).then(p=>{l(null),p.onChainRevocationRequired&&u(x=>new Set(x).add(m.keyId))})},children:T?"Revoking\u2026":"Confirm revoke"})]}):q(f,{variant:"outline",onClick:()=>l(m.keyId),children:"Revoke"})}):null]},m.keyId)})]})}import{AlertCircle as Cc,CheckCircle2 as Nc,ExternalLink as wc,LoaderCircle as kc,ShieldQuestion as Rc}from"lucide-react";import{jsx as G,jsxs as le}from"react/jsx-runtime";var _r={unverified:["Unverified","Reported by the server, not yet checked."],pending:["Checking","Checking on chain."],verified:["Verified","Verified on chain."],mismatch:["Mismatch","The on-chain settlement does not match this payment."],failed:["Verification failed","The settlement could not be verified."],unavailable:["Verification unavailable","On-chain checking is unavailable. Retry later."]};function Sc({record:t,assets:e={},explorerUrl:n,className:o}){let r=S(),a=r.Card??me,i=r.Badge??We,s=t.verification.status,l=s==="verified",c=s==="mismatch"||s==="failed",u=l?Nc:s==="pending"?kc:c?Cc:Rc,d=n?.(t);return le(a,{"data-verification":s,className:y("mx-auto flex h-full w-full max-w-lg min-w-0 flex-col overflow-hidden p-5",o),children:[le("header",{className:"text-center",children:[G("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Payment receipt"}),G("h2",{className:"mt-2 break-words text-3xl font-semibold tabular-nums",children:Hr(t.amount,t.asset,e)}),G("p",{className:"mt-1 break-all text-sm text-muted-foreground",children:t.asset?e[t.asset]?.symbol??t.asset:"Asset not reported"})]}),le("div",{"aria-live":"polite",className:y("mt-5 flex min-h-[9rem] gap-2 rounded-lg p-3",Mt(l,c)),children:[G(u,{"aria-hidden":!0,className:y("mt-0.5 shrink-0",s==="pending"&&"animate-spin"),size:18}),le("div",{children:[G(i,{className:"mb-1",children:_r[s][0]}),G("p",{className:"text-sm",children:_r[s][1]}),t.verification.reason&&le("p",{className:"mt-1 break-words text-sm font-medium",children:["Reason: ",t.verification.reason]})]})]}),le("dl",{className:"mt-5 grid gap-4 text-sm",children:[le("div",{children:[G("dt",{className:"text-xs text-muted-foreground",children:"Recipient"}),G("dd",{children:t.payTo?G(ze,{value:t.payTo}):"Not reported"})]}),le("div",{className:"grid grid-cols-2 gap-3",children:[le("div",{children:[G("dt",{className:"text-xs text-muted-foreground",children:"Protocol"}),G("dd",{children:t.protocol==="mpp"?"MPP":t.protocol})]}),le("div",{children:[G("dt",{className:"text-xs text-muted-foreground",children:"Time"}),G("dd",{children:"Not recorded"})]})]}),le("div",{children:[G("dt",{className:"text-xs text-muted-foreground",children:"Settlement reference"}),G("dd",{className:"mt-1",children:t.reference?le("div",{className:"flex flex-wrap items-center gap-2",children:[G(ze,{value:t.reference}),d&&le("a",{className:"inline-flex items-center gap-1 rounded text-xs font-medium underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",href:d,target:"_blank",rel:"noreferrer",children:["View on explorer ",G(wc,{"aria-hidden":!0,size:13})]})]}):"Not reported"})]})]})]})}export{_t as AccountButton,Bi as AccountSelector,cr as AccountSelectorView,ec as AddressWarningDialog,kr as AppKit,Rr as AppKitButton,Sr as AppKitChainSelector,fc as AuthorizationConsent,xc as AuthorizationList,je as ChainSelector,Se as ConnectButton,ct as ErrorBoundary,Xi as PasskeySetup,br as PasskeySetupView,ji as PassphraseDialog,pr as PassphraseDialogView,Sc as PaymentReceipt,it as QRCodeModal,kl as RouteSelector,lt as SeedPhraseBackup,bn as SignInButton,Ql as SmartWalletSettings,Ll as SmartWalletToggle,Nn as ThemeProvider,Vt as WalletConnectProvider,nc as WalletPicker,Li as WalletSecurityPanel,mr as WalletSecurityPanelView,wn as Web3ComponentProvider,ut as Web3ConnectUI,y as cn,wr as useAppKit,mi as useComponent,S as useComponentRegistry,li as useDetectionMode,Ye as useEIP6963,Je as useIsMobile,rr as useTheme,ti as useThemeVariable,ua as useWalletConnect,Ut as useWalletConnectOptional};
|
|
11
|
+
}`}function ei(t){let e=new Set;if(t!=="computed"||typeof document>"u")return e;for(let n of Object.keys(qe)){let o=qe[n],r=getComputedStyle(document.documentElement).getPropertyValue(o.name).trim();r&&r!==o.fallback&&e.add(n)}return e}function Nn({children:t,theme:e={},defaultDark:n=!1,priority:o="fallback"}){let[r,a]=Et(e),[i,s]=Et(n);At(()=>{Cn()},[r]);let[l,c]=Et(new Set);At(()=>{c(ei(o))},[o]);let u=Pt(()=>{if(o==="fallback"||l.size===0)return r;let m={};for(let[b,T]of Object.entries(r))!l.has(b)&&T&&(m[b]=T);return m},[r,o,l]),d=Pt(()=>Zs(u),[u]);At(()=>{if(typeof document>"u")return;let m=document.documentElement;i?m.classList.add("dark"):m.classList.remove("dark"),Cn()},[i]);let f=Pt(()=>"w3c-theme-"+Math.random().toString(36).slice(2,9),[]),h=Js(()=>s(m=>!m),[]),g=Pt(()=>({theme:r,isDark:i,setTheme:a,toggleDarkMode:h}),[r,i,h]);return oi(or.Provider,{value:g,children:[d?ni("style",{id:f,children:d}):null,t]})}function rr(){return Ys(or)}function ti(t){let{theme:e}=rr(),[n,o]=Et("");return At(()=>{let r=qe[t];if(!r)return;let a=e[t];if(a){o(a);return}if(typeof document>"u"){o(r.fallback);return}let i=getComputedStyle(document.documentElement).getPropertyValue(r.name).trim();o(i||r.fallback)},[t,e]),n||qe[t]?.fallback||""}import{jsx as ut}from"react/jsx-runtime";var ar=ri({mode:"walletconnect"});function li(){return ai(ar)}function mt({config:t,children:e,autoConnect:n=!1,detectionMode:o="walletconnect",theme:r,defaultDark:a=!1,themePriority:i="computed"}){let s=si(()=>({mode:o}),[o]),l=o==="walletconnect"||o==="auto";return ut(ar.Provider,{value:s,children:ut(Nn,{theme:r,defaultDark:a,priority:i,children:ut(wn,{components:{QRCodeModal:lt},children:ut(ii,{config:t,autoConnect:n,children:l?ut(Vt,{children:e}):e})})})})}import{jsx as fi}from"react/jsx-runtime";var kn={Button:M,ConnectButton:Se,AccountButton:_t,ChainSelector:je,QRCodeModal:lt,SignInButton:bn,SeedPhraseBackup:ct,ErrorBoundary:dt,Web3ConnectUI:mt},sr=ci({});function wn({children:t,components:e={}}){let n=ui(()=>({...kn,...e}),[e]);return fi(sr.Provider,{value:n,children:t})}function S(){return di(sr)}function mi(t){return S()[t]}import{jsx as ee,jsxs as De}from"react/jsx-runtime";function ir(t){let e=t&&typeof t=="object"&&"details"in t?t.details:void 0,n=e instanceof Error?`${e.name}: ${e.message}`:e;gi.error("ui/ChainSelector","switchChain failed",t,n)}function pt({chainId:t,className:e}){let n=bt(t);return n?ee("span",{className:y("inline-flex items-center justify-center shrink-0",e),dangerouslySetInnerHTML:{__html:n}}):null}function je({className:t,showLabel:e=!0,variant:n="dropdown"}){let{currentChain:o,availableChains:r,switchChain:a}=xi(),{isConnected:i}=vi(),[s,l]=hi(!1),u=S().Button??M,d=bi(null);if(yi(()=>{function g(m){d.current&&!d.current.contains(m.target)&&l(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]),!i)return null;let f=o?.name??"Unknown Chain",h=r.length>1;return n==="minimal"?De("div",{className:y("inline-flex items-center gap-1.5 text-xs text-muted-foreground",t),children:[o&&ee(pt,{chainId:o.caip2,className:"h-3.5 w-3.5"}),f]}):n==="buttons"?ee("div",{className:y("flex flex-wrap gap-2",t),children:r.map(g=>{let m=g.caip2,b=m===o?.caip2;return De(u,{className:b?y("bg-accent","border-primary"):"",onClick:()=>{b||a(m).catch(ir)},children:[ee(pt,{chainId:m,className:"h-4 w-4"}),g.name,g.token&&ee("span",{className:"text-xs opacity-60",children:g.token})]},m)})}):h?De("div",{ref:d,className:y("relative inline-block",t),children:[De(u,{onClick:()=>l(!s),children:[o&&ee(pt,{chainId:o.caip2,className:"h-4 w-4"}),f,ee("svg",{"aria-hidden":"true",className:y("h-3 w-3 transition-transform",s&&"rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:ee("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),s&&De("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-[180px] rounded-lg border bg-card p-1 shadow-lg animate-in fade-in zoom-in-95 duration-200",children:[e&&ee("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Switch Network"}),r.map(g=>{let m=g.caip2,b=m===o?.caip2;return De(u,{onClick:()=>{b||a(m).catch(ir),l(!1)},className:y("flex w-full items-center gap-2 rounded-md px-2 py-2 text-sm transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",b?"bg-accent font-medium":"hover:bg-accent/50"),children:[ee(pt,{chainId:m,className:"h-4 w-4"}),ee("span",{className:"flex-1 text-left",children:g.name}),g.token&&ee("span",{className:"text-xs text-muted-foreground",children:g.token}),b&&ee("svg",{"aria-hidden":"true",className:"h-4 w-4 text-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:ee("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]},m)})]})]}):De("div",{className:y("inline-flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm opacity-60 cursor-default",t),children:[o&&ee(pt,{chainId:o.caip2,className:"h-4 w-4"}),f]})}import{useEmbeddedWallet as Ci}from"@naculus/connect-appkit-react";import{Check as lr,Copy as Ni,Loader2 as wi,Plus as ki}from"lucide-react";import{useCallback as Rn,useState as Sn}from"react";import{jsx as ne,jsxs as Qe}from"react/jsx-runtime";var Ri={eip155:{name:"Ethereum & EVM",detail:"One address across Ethereum, Polygon, Arbitrum and every EVM chain"},solana:{name:"Solana",detail:"A separate key on a different curve"}};function Si(t){return t.length<=12?t:`${t.slice(0,6)}...${t.slice(-4)}`}function Ti({account:t,isActive:e,onSelect:n}){let[o,r]=Sn(!1),a=Ri[t.namespace]??{name:t.namespace,detail:""},i=Rn(s=>{s.stopPropagation();let l=navigator?.clipboard?.writeText;l&&l.call(navigator.clipboard,t.address).then(()=>{r(!0),setTimeout(()=>r(!1),1500)},()=>{})},[t.address]);return Qe("div",{role:"radio",tabIndex:0,"aria-checked":e,onClick:n,onKeyDown:s=>{s.target===s.currentTarget&&(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),n())},className:y("flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-left text-sm transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e?"border-primary bg-accent":"border-border hover:bg-accent/50"),children:[Qe("span",{className:"flex min-w-0 flex-1 flex-col",children:[Qe("span",{className:"flex items-center gap-2 font-medium",children:[a.name,e&&ne("span",{className:"rounded-sm bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-primary",children:"Signing"})]}),ne("span",{className:"truncate font-mono text-xs text-muted-foreground",children:Si(t.address)})]}),ne("button",{type:"button","aria-label":`Copy ${a.name} address`,onClick:i,className:"naculus-hit-target shrink-0 rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:o?ne(lr,{size:14}):ne(Ni,{size:14})}),e&&ne(lr,{size:16,className:"shrink-0 text-primary"})]})}function cr({className:t,hideBackfill:e=!1,onSelect:n,accounts:o,activeNamespace:r,canDerive:a,setActiveNamespace:i,backfillAccounts:s}){let[l,c]=Sn(!1),[u,d]=Sn(null),f=Rn(m=>{if(m!==r)try{i(m),d(null),n?.(m)}catch(b){d(b instanceof Error?b.message:"Could not switch account")}},[r,i,n]),h=Rn(async()=>{c(!0),d(null);try{await s()}catch(m){d(m instanceof Error?m.message:"Could not derive accounts")}finally{c(!1)}},[s]);if(o.length===0)return null;let g=!e&&a;return Qe("div",{className:y("flex flex-col gap-2",t),children:[Qe("div",{className:"flex items-baseline justify-between",children:[ne("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Accounts"}),ne("span",{className:"text-[11px] text-muted-foreground",children:"Chooses the signing key, not the network"})]}),ne("div",{role:"radiogroup","aria-label":"Wallet accounts",className:"flex flex-col gap-1.5",children:o.map(m=>ne(Ti,{account:m,isActive:m.namespace===r,onSelect:()=>f(m.namespace)},m.namespace))}),g&&Qe("button",{type:"button",onClick:h,disabled:l,className:y("flex items-center justify-center gap-2 rounded-md border border-dashed border-border px-3 py-2 text-xs text-muted-foreground","hover:bg-accent/50 disabled:opacity-60"),children:[l?ne(wi,{size:14,className:"animate-spin"}):ne(ki,{size:14}),l?"Deriving\u2026":"Show accounts this phrase already owns"]}),u&&ne("p",{role:"alert",className:"text-xs text-destructive",children:u})]})}function Bi(t){let{wallet:e,accounts:n,activeNamespace:o,setActiveNamespace:r,backfillAccounts:a}=Ci();return e?ne(cr,{...t,accounts:n,activeNamespace:o,canDerive:e.recoveryAvailable&&n.length<2,setActiveNamespace:r,backfillAccounts:a}):null}import{AlertTriangle as Pi,Info as ur,ShieldAlert as Ai,ShieldCheck as Ei}from"lucide-react";import{useEmbeddedWallet as Di}from"@naculus/connect-appkit-react";import{jsx as se,jsxs as de}from"react/jsx-runtime";var Mi={critical:Ai,warning:Pi,info:ur},zi={critical:"text-destructive",warning:"text-amber-600 dark:text-amber-500",info:"text-muted-foreground"};function dr(t){return t>=90?"text-emerald-600 dark:text-emerald-500":t>=70?"text-amber-600 dark:text-amber-500":"text-destructive"}function Ii({finding:t}){let e=Mi[t.severity]??ur;return de("li",{className:"flex gap-2.5 rounded-md border border-border px-3 py-2.5",children:[se(e,{size:16,className:y("mt-0.5 shrink-0",zi[t.severity])}),de("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[de("div",{className:"flex items-baseline justify-between gap-2",children:[se("span",{className:"text-sm font-medium",children:t.title}),t.deduction>0&&de("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:["\u2212",t.deduction]})]}),se("p",{className:"text-xs leading-relaxed text-muted-foreground",children:t.detail}),t.remedy&&de("p",{className:"text-xs leading-relaxed",children:[se("span",{className:"font-medium",children:"What helps: "}),se("span",{className:"text-muted-foreground",children:t.remedy})]})]})]})}function mr({className:t,hideInformational:e=!1,report:n}){if(!n)return null;let{score:o,level:r,findings:a,encrypted:i,backend:s,unlock:l}=n,c=e?a.filter(d=>d.deduction>0):a,u=a.every(d=>d.deduction===0);return de("div",{className:y("flex flex-col gap-3",t),children:[de("div",{className:"flex items-center gap-3 rounded-lg border border-border px-4 py-3",children:[se(Ei,{size:22,className:y("shrink-0",dr(o))}),de("div",{className:"flex min-w-0 flex-1 flex-col",children:[de("div",{className:"flex items-baseline gap-2",children:[se("span",{className:y("text-2xl font-semibold tabular-nums",dr(o)),children:o}),se("span",{className:"text-sm text-muted-foreground",children:"/ 100"}),de("span",{className:"ml-auto text-xs text-muted-foreground",children:["Tier ",r]})]}),de("span",{className:"text-xs text-muted-foreground",children:[s==="localStorage"?"localStorage":"IndexedDB",i?" \xB7 encrypted":" \xB7 not encrypted",l.sealedWith?.includes("prf")?" \xB7 passkey":""]})]})]}),u?se("p",{className:"text-xs text-muted-foreground",children:"Nothing is holding this score down."}):se("p",{className:"text-xs text-muted-foreground",children:"Scored against this SDK's own published rubric, not an external standard. Each item below names the points it costs."}),se("ul",{className:"flex flex-col gap-1.5",children:c.map(d=>se(Ii,{finding:d},d.id))})]})}function Li(t){let{securityReport:e}=Di();return se(mr,{...t,report:e})}import{useCallback as Wi,useEffect as Vi,useRef as Ui,useState as Tn}from"react";import{Eye as Hi,EyeOff as Oi,KeyRound as _i,ShieldAlert as Fi}from"lucide-react";import{usePassphraseGate as Ki}from"@naculus/connect-appkit-react";import{jsx as F,jsxs as ke}from"react/jsx-runtime";var Bn=8,qi=12;function pr({className:t,request:e,submit:n,cancel:o}){let[r,a]=Tn(""),[i,s]=Tn(""),[l,c]=Tn(!1),u=Ui(null),d=e?.intent==="create";Vi(()=>{if(!e){a(""),s(""),c(!1);return}a(""),s(""),u.current?.focus()},[e]);let f=d&&r.length>0&&r.length<Bn,h=d&&i.length>0&&i!==r,g=d?r.length>=Bn&&i===r:r.length>0,m=Wi(b=>{b.preventDefault(),g&&n(r)},[g,n,r]);return e?F("div",{className:"naculus-dialog-viewport fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",role:"presentation",children:ke("form",{role:"dialog","aria-modal":"true","aria-label":d?"Choose a passphrase":"Unlock your wallet",onSubmit:m,className:y("naculus-dialog-surface flex w-full max-w-lg flex-col gap-4 overflow-y-auto rounded-lg border border-border bg-card p-5 shadow-lg",t),children:[ke("div",{className:"sticky top-0 z-10 -mx-1 flex items-center gap-2 bg-card px-1 py-1",children:[F(_i,{size:18,className:"shrink-0 text-primary"}),F("h2",{className:"text-base font-semibold",children:d?"Choose a passphrase":"Unlock your wallet"})]}),e.previousError&&F("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive",children:e.previousError}),F("p",{className:"text-xs leading-relaxed text-muted-foreground",children:d?"This encrypts your wallet on this device. Without it, anything that can run script on this page can read your keys.":"Your wallet is encrypted on this device. Enter the passphrase you chose to open it."}),ke("label",{className:"flex flex-col gap-1.5",children:[F("span",{className:"text-xs font-medium",children:"Passphrase"}),ke("span",{className:"relative flex items-center",children:[F("input",{ref:u,type:l?"text":"password",value:r,onChange:b=>a(b.target.value),autoComplete:d?"new-password":"current-password",autoFocus:!0,className:"w-full rounded-md border border-border bg-background px-3 py-2 pr-9 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),F("button",{type:"button","aria-label":l?"Hide passphrase":"Show passphrase",onClick:()=>c(b=>!b),className:"naculus-hit-target absolute right-2 text-muted-foreground hover:text-foreground",children:l?F(Oi,{size:15}):F(Hi,{size:15})})]})]}),d&&ke("label",{className:"flex flex-col gap-1.5",children:[F("span",{className:"text-xs font-medium",children:"Type it again"}),F("input",{type:l?"text":"password",value:i,onChange:b=>s(b.target.value),autoComplete:"new-password",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"})]}),f&&ke("p",{role:"alert",className:"text-xs text-destructive",children:["At least ",Bn," characters."]}),h&&F("p",{role:"alert",className:"text-xs text-destructive",children:"These do not match."}),d&&!f&&r.length>0&&r.length<qi&&F("p",{className:"text-xs text-muted-foreground",children:"Short. Several ordinary words are far harder to guess than a short one with symbols in it."}),d&&ke("p",{className:"flex gap-2 rounded-md bg-amber-500/10 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-500",children:[F(Fi,{size:14,className:"mt-0.5 shrink-0"}),F("span",{children:"If you forget this, nothing can open this copy of the wallet \u2014 not us, not your browser. Your recovery phrase is the only thing that gets it back."})]}),ke("div",{"data-dialog-actions":!0,className:"sticky bottom-0 z-10 -mx-5 flex min-h-14 justify-end gap-2 border-t border-border bg-card px-5 pb-[max(0rem,env(safe-area-inset-bottom))] pt-3",children:[F("button",{type:"button",onClick:()=>o(),className:"rounded-md border border-border px-3 py-2 text-sm hover:bg-accent",children:"Cancel"}),F("button",{type:"submit",disabled:!g,className:"rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",children:d?"Encrypt wallet":"Unlock"})]})]})}):null}function ji(t){let{request:e,submit:n,cancel:o}=Ki();return F(pr,{...t,request:e,submit:n,cancel:o})}import{useCallback as hr,useState as Pn}from"react";import{Fingerprint as fr,Loader2 as Qi,ShieldAlert as gr,ShieldCheck as $i,TriangleAlert as Gi}from"lucide-react";import{useEmbeddedWallet as Yi,useWeb3 as Ji}from"@naculus/connect-appkit-react";import{Fragment as Zi,jsx as oe,jsxs as $e}from"react/jsx-runtime";function br({className:t,passkeys:e,unlock:n,onRegistered:o}){let[r,a]=Pn(!1),[i,s]=Pn(null),[l,c]=Pn(!1),u=!!e?.hasCredential?.()||l,d=hr(async()=>{if(e){a(!0),s(null);try{await e.createPasskey(),c(!0),await o?.()}catch(m){s(m instanceof Error?m.message:"Could not register a passkey")}finally{a(!1)}}},[e,o]);if(!e)return null;let f=n?.sealedWith?.includes("prf")??!1,h=null;if(u)switch(n?.prf){case"available":h=f?{tone:"good",icon:oe($i,{size:16}),title:"Your passkey unlocks this wallet",detail:"Opening it needs your fingerprint or face, not a value a script on this page can supply."}:{tone:"warn",icon:oe(Gi,{size:16}),title:"Registered, but not applied yet",detail:"This device can produce the key material. The next time the wallet is saved, the record is sealed under it."};break;case"unavailable":h={tone:"bad",icon:oe(gr,{size:16}),title:"This passkey cannot unlock the wallet",detail:"The authenticator did not return the key material. Firefox does not implement the extension, and a passkey created before it was requested cannot have it added afterwards \u2014 a new one has to be registered on a browser that supports it."};break;default:h={tone:"neutral",icon:oe(fr,{size:16}),title:"A passkey is registered",detail:"Whether it can unlock this wallet is not known until the wallet is opened once. It will be used if it works."};break}let g={good:"text-emerald-600 dark:text-emerald-500",warn:"text-amber-600 dark:text-amber-500",bad:"text-destructive",neutral:"text-muted-foreground"};return $e("div",{className:y("flex flex-col gap-3",t),children:[h?$e("div",{className:"flex gap-2.5 rounded-md border border-border px-3 py-2.5",children:[oe("span",{className:y("mt-0.5 shrink-0",g[h.tone]),children:h.icon}),$e("div",{className:"flex min-w-0 flex-col gap-1",children:[oe("span",{className:"text-sm font-medium",children:h.title}),oe("p",{className:"text-xs leading-relaxed text-muted-foreground",children:h.detail})]})]}):$e(Zi,{children:[oe("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"A passkey raises what it takes to read your stored keys from \u201Cany script on this page\u201D to your fingerprint or face. The passphrase keeps working, so a broken or replaced authenticator does not cost you this copy."}),$e("p",{className:"flex gap-2 rounded-md bg-amber-500/10 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-500",children:[oe(gr,{size:14,className:"mt-0.5 shrink-0"}),oe("span",{children:"This protects the copy on this device. It does not back up your wallet \u2014 the recovery phrase is still the only thing that survives losing this device."})]}),$e("button",{type:"button",onClick:d,disabled:r,className:"flex items-center justify-center gap-2 rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-60",children:[r?oe(Qi,{size:15,className:"animate-spin"}):oe(fr,{size:15}),r?"Waiting for your device\u2026":"Protect with a passkey"]})]}),i&&oe("p",{role:"alert",className:"text-xs text-destructive",children:i})]})}function Xi(t){let{client:e}=Ji(),{securityReport:n,hasWallet:o}=Yi(),r=hr(async()=>{let a=e?.embeddedConnector;a&&o&&await a.save()},[e,o]);return oe(br,{...t,passkeys:e?.passkeysConnector??null,unlock:n?.unlock,onRegistered:r})}import{useAccount as xr,useBalance as el,useChain as tl,useDisconnect as vr,useEmbeddedWallet as nl,useWallet as ol,useWeb3 as rl}from"@naculus/connect-appkit-react";import{createContext as al,useCallback as ft,useContext as sl,useEffect as il,useMemo as Cr,useState as yr}from"react";import{jsx as Me,jsxs as Tr}from"react/jsx-runtime";var Nr=al(null);function wr(){let t=sl(Nr);if(!t)throw new Error("useAppKit must be used within an <AppKit> component");return t}function kr({projectId:t,metadata:e,enableEmbedded:n=!1,enablePasskeys:o=!1,chains:r,embeddedConfig:a,encryptionKey:i,siwx:s,children:l,className:c,autoConnect:u=!1,theme:d,defaultDark:f=!1,themePriority:h="computed",detectionMode:g="auto"}){let[m,b]=yr(!1),[T,p]=yr(!1),x=Cr(()=>({projectId:t,metadata:e,enableEmbedded:n,enablePasskeys:o,chains:r,embeddedConfig:a,encryptionKey:i,siwx:s}),[t,e,n,o,r,a,i,s]);return Me(mt,{config:x,autoConnect:u,detectionMode:g,theme:d,defaultDark:f,themePriority:h,children:Me(ll,{className:c,open:m,setOpen:b,backupOpen:T,setBackupOpen:p,children:l})})}function ll({children:t,className:e,open:n,setOpen:o,backupOpen:r,setBackupOpen:a}){let{isConnected:i,isConnecting:s}=ol(),{primaryAccount:l}=xr(),{currentChain:c,availableChains:u,switchChain:d}=tl(),f=nl(),{disconnect:h}=vr(),{wallets:g,hasWallets:m}=Je(),{formatted:b}=el(),T=b??null,p=ft(async()=>{await h()},[h]),x=ft(()=>{f.confirmBackup(),a(!1)},[f,a]),B=ft(()=>{f.confirmBackup(),a(!1)},[f,a]),w=ft(()=>f.getPrivateKey(),[f]),V=Cr(()=>({connect:()=>o(!0),disconnect:p,isConnected:i,isConnecting:s,address:l,balance:T,balanceSymbol:c?.token??null,chainName:c?.name??null,availableChains:u.map(D=>({caip2:D.caip2,name:D.name,token:D.token})),switchChain:d,wallets:g,hasWallets:m,backupPending:f.backupPending,seedPhrase:f.seedPhrase,confirmBackup:x,skipBackup:B,open:n,setOpen:o}),[i,s,l,T,c,u,d,g,m,f.backupPending,f.seedPhrase,x,B,p,n,o]);return il(()=>{f.seedPhrase&&f.backupPending&&a(!0)},[f.seedPhrase,f.backupPending,a]),Tr(Nr.Provider,{value:V,children:[t,f.seedPhrase&&r&&Me(ct,{seedPhrase:f.seedPhrase,onConfirm:x,onSkip:B,onExportPrivateKey:w,open:r,onOpenChange:a})]})}function Rr({className:t}){let e=wr(),{connectInjected:n}=rl(),{primaryAccount:o}=xr(),{disconnect:r}=vr(),a=ft(async(i,s,l)=>{i==="injected"&&(await n(l),s())},[n]);return e.isConnected&&o?Tr("div",{className:y("inline-flex items-center gap-2",t),children:[Me(je,{variant:"minimal"}),Me(Se,{isConnected:e.isConnected,address:o,balance:e.balance,balanceSymbol:e.balanceSymbol??void 0,onDisconnect:r,onConnect:a,className:t})]}):Me(Se,{isConnected:e.isConnected,isConnecting:e.isConnecting,address:o,balance:e.balance,balanceSymbol:e.balanceSymbol??void 0,onDisconnect:r,onConnect:a,className:t})}function Sr({className:t,variant:e="dropdown"}){return Me(je,{className:t,variant:e})}try{let t=kn;t&&Object.assign(t,{AppKit:kr,AppKitButton:Rr,AppKitChainSelector:Sr})}catch{}import{ArrowRight as cl,CheckCircle2 as dl,Clock as ul,DollarSign as ml,Loader2 as Er,XCircle as pl,AlertCircle as fl}from"lucide-react";import{Fragment as Ar,jsx as v,jsxs as U}from"react/jsx-runtime";function gl(t){if(t<1e3)return"<1s";if(t<6e4)return`~${Math.round(t/1e3)}s`;let e=Math.floor(t/6e4),n=Math.round(t%6e4/1e3);return n>0?`~${e}m ${n}s`:`~${e}m`}function Br(t){return t.symbol||"UNKNOWN"}function hl(t){let e=t.toLowerCase();return e.includes("lifi")?"default":e.includes("axelar")?"secondary":"outline"}function bl(t){return t.length>12?`${t.slice(0,6)}...${t.slice(-6)}`:t}function yl({route:t,onSelect:e}){let n=S(),o=n.Button??M,r=n.Badge,a=t.provider??"Route";return U("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border p-4 transition-colors hover:bg-accent/30",children:[U("div",{className:"flex flex-col gap-1.5 min-w-0",children:[U("div",{className:"flex items-center gap-2",children:[r?v(r,{variant:hl(a),children:a}):v("span",{className:"inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium",children:a}),t.steps.length>1&&U("span",{className:"text-xs text-muted-foreground",children:[t.steps.length," steps"]})]}),U("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-sm",children:[U("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[v(ml,{className:"h-3.5 w-3.5"}),"$",t.gasCosts.totalUsd]}),U("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[v(ul,{className:"h-3.5 w-3.5"}),gl(t.steps.reduce((i,s)=>{let l=t.estimatedTime>0?15e3:0;return i+l},0))]}),U("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[t.gasCosts.totalUsd," cost"]})]})]}),v(o,{variant:"outline",size:"sm",onClick:e,children:"Select"})]})}function xl(){let e=S().Skeleton;return U("div",{className:"flex flex-col gap-3","data-testid":"route-selector-loading",children:[U("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[v(Er,{className:"h-4 w-4 animate-spin"}),v("span",{children:"Fetching best routes..."})]}),[1,2,3].map(n=>U("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border p-4",children:[v("div",{className:"flex flex-col gap-2 flex-1",children:e?U(Ar,{children:[v(e,{className:"h-4 w-24"}),v(e,{className:"h-3 w-48"})]}):U(Ar,{children:[v("div",{className:"h-4 w-24 animate-pulse rounded bg-muted"}),v("div",{className:"h-3 w-48 animate-pulse rounded bg-muted"})]})}),e?v(e,{className:"h-8 w-20 rounded-md"}):v("div",{className:"h-8 w-20 animate-pulse rounded-md bg-muted"})]},n))]})}function vl(){return U("div",{className:"flex flex-col items-center justify-center gap-2 py-8 text-sm text-muted-foreground","data-testid":"route-selector-empty",children:[v(fl,{className:"h-8 w-8 opacity-40"}),v("span",{children:"No routes found for this pair"}),v("span",{className:"text-xs",children:"Try a different token or amount"})]})}function Cl({error:t,onRetry:e}){let o=S().Button??M;return U("div",{className:"flex flex-col items-center justify-center gap-2 py-6","data-testid":"route-selector-error",children:[v(pl,{className:"h-8 w-8 text-destructive"}),v("p",{className:"text-sm text-destructive font-medium",children:"Failed to fetch routes"}),v("p",{className:"text-xs text-muted-foreground max-w-xs text-center",children:t}),e&&v(o,{variant:"outline",size:"sm",onClick:e,children:"Retry"})]})}function Nl(){let e=S().Progress;return U("div",{className:"flex flex-col items-center gap-3 py-6","data-testid":"route-selector-executing",children:[v(Er,{className:"h-6 w-6 animate-spin text-primary"}),v("p",{className:"text-sm font-medium",children:"Executing route..."}),v("p",{className:"text-xs text-muted-foreground",children:"Please confirm the transaction in your wallet"}),e?v(e,{value:50,className:"w-48 h-1.5"}):v("div",{className:"h-1.5 w-48 rounded-full bg-muted",children:v("div",{className:"h-full w-1/2 rounded-full bg-primary animate-pulse"})})]})}function wl({txHash:t}){return U("div",{className:"flex flex-col items-center gap-2 py-6","data-testid":"route-selector-success",children:[v(dl,{className:"h-8 w-8 text-green-500"}),v("p",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:"Route executed successfully!"}),U("p",{className:"text-xs text-muted-foreground font-mono",children:["TX: ",bl(t)]})]})}function Pr({chainId:t,className:e}){let n=bt(`eip155:${t}`);return n?v("span",{className:y("inline-flex items-center justify-center shrink-0",e),dangerouslySetInnerHTML:{__html:n}}):null}function kl({inputToken:t,outputToken:e,amount:n,routes:o=[],loading:r=!1,executing:a=!1,onRouteSelected:i,onCancel:s,successTxHash:l,error:c,className:u}){let d=S(),f=d.Card,h=d.Button??M;if(l)return v("div",{className:y("rounded-lg border border-border",u),children:v(wl,{txHash:l})});if(a)return v("div",{className:y("rounded-lg border border-border",u),children:v(Nl,{})});return f?U(f,{className:y("p-4",u),children:[m(),b(),T()]}):U("div",{className:y("rounded-lg border border-border p-4",u),children:[m(),b(),T()]});function m(){return!t&&!e?null:U("div",{className:"mb-4 flex flex-wrap items-center gap-2 text-sm",children:[t&&U("span",{className:"inline-flex items-center gap-1.5 font-medium",children:[v(Pr,{chainId:t.chainId,className:"h-4 w-4"}),n?`${n.toString()} `:"",Br(t)]}),t&&e&&v(cl,{className:"h-3.5 w-3.5 text-muted-foreground"}),e&&U("span",{className:"inline-flex items-center gap-1.5 font-medium",children:[v(Pr,{chainId:e.chainId,className:"h-4 w-4"}),Br(e)]})]})}function b(){return r?v(xl,{}):c?v(Cl,{error:c}):o.length===0?v(vl,{}):v("div",{className:"flex flex-col gap-2","data-testid":"route-selector-routes",children:o.map((p,x)=>v(yl,{route:p,onSelect:()=>i?.(p)},`${p.fromChain}-${p.toChain}-${p.gasCosts.totalUsd}-${x}`))})}function T(){return!r&&o.length===0&&!c?null:v("div",{className:"mt-4 flex justify-end",children:v(h,{variant:"ghost",size:"sm",onClick:s,children:"Cancel"})})}}import Rl from"react";import{Shield as Sl,ShieldCheck as Dr,LoaderCircle as Tl,Settings as Bl,ChevronRight as Pl,AlertCircle as Al,RotateCcw as El,CheckCircle2 as Dl,Fuel as Mr,Zap as Ml,RefreshCw as zl}from"lucide-react";import{Fragment as Wl,jsx as R,jsxs as H}from"react/jsx-runtime";function Il(t){let e=Number(t)/1e18;return e<.001?`~${e.toFixed(6)} ETH`:`~${e.toFixed(3)} ETH`}function Ll({isDeployed:t=!1,isDeploying:e=!1,estimatedGas:n,error:o=null,onUpgrade:r,onShowSettings:a,onRetry:i}){let s=S(),l=s.Button??M,c=s.Card??me,u=s.Badge??We,d=a?H(l,{variant:"outline",className:"w-full",onClick:a,children:[R(Bl,{size:15})," Advanced Settings ",R(Pl,{size:14,className:"text-muted-foreground"})]}):null;return t?H(c,{className:"w-full rounded-xl border border-border bg-card p-5 shadow-sm",children:[R("div",{className:"flex items-start justify-between",children:H("div",{className:"flex items-center gap-3",children:[R("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-green-500/10",children:R(Dr,{size:22,className:"text-green-500"})}),H("div",{children:[H("div",{className:"flex items-center gap-2",children:[R("span",{className:"text-base font-semibold text-foreground",children:"Smart Wallet"}),H(u,{variant:"secondary",className:"rounded-full bg-green-500/10 px-2 py-0 text-xs font-medium text-green-500",children:[R(Dl,{size:12,className:"mr-0.5 inline"})," Deployed"]})]}),R("p",{className:"mt-0.5 text-sm text-muted-foreground",children:"Your wallet has been upgraded to a smart wallet"})]})]})}),R("div",{className:"mt-4 grid grid-cols-2 gap-3",children:[[Mr,"Gas Sponsorship","Enabled"],[zl,"Recovery","Enabled"]].map(([f,h,g])=>H("div",{className:"rounded-lg bg-muted/50 p-3",children:[H("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[Rl.createElement(f,{size:14}),R("span",{children:h})]}),R("div",{className:"mt-1 text-sm font-medium text-foreground",children:g})]},h))}),a&&R("div",{className:"mt-4",children:d})]}):e?R(c,{className:"w-full rounded-xl border border-border bg-card p-5 shadow-sm",children:H("div",{className:"flex flex-col items-center text-center",children:[R("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-primary/10",children:R(Tl,{size:28,className:"animate-spin text-primary"})}),R("h3",{className:"mb-1 text-base font-semibold text-foreground",children:"Deploying Smart Wallet..."}),R("p",{className:"mb-4 text-sm text-muted-foreground",children:"Please wait, contract deployment may take a few seconds"}),R("div",{className:"h-2 w-full max-w-[200px] overflow-hidden rounded-full bg-muted",children:R("div",{className:"h-full w-full animate-pulse rounded-full bg-primary",style:{animationDuration:"1.5s"}})})]})}):o?H(c,{className:"w-full rounded-xl border border-destructive/30 bg-destructive/5 p-5 shadow-sm",children:[H("div",{className:"flex items-start gap-3",children:[R("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-destructive/10",children:R(Al,{size:18,className:"text-destructive"})}),H("div",{className:"min-w-0 flex-1",children:[R("h4",{className:"text-sm font-semibold text-destructive",children:"Deployment Failed"}),R("p",{className:"mt-1 text-xs text-destructive/80 break-words",children:o}),i&&H(l,{variant:"outline",size:"sm",className:"mt-3 border-destructive/30 text-destructive hover:bg-destructive/10",onClick:i,children:[R(El,{size:13})," Retry"]})]})]}),a&&R("div",{className:"mt-3",children:d})]}):H(c,{className:"w-full rounded-xl border border-border bg-card p-5 shadow-sm",children:[H("div",{className:"flex items-center gap-3",children:[R("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-500/10",children:R(Sl,{size:20,className:"text-amber-500"})}),H("div",{children:[H("div",{className:"flex items-center gap-2",children:[R("span",{className:"text-base font-semibold text-foreground",children:"Smart Wallet"}),R("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground",children:"Not Upgraded"})]}),R("p",{className:"mt-0.5 text-sm text-muted-foreground",children:"Upgrade to a smart wallet for more features"})]})]}),H("div",{className:"mt-4 space-y-2",children:[R(An,{icon:Ml,color:"text-green-500",text:"No ETH needed for transactions \u2014 pay gas with USDC/USDT"}),R(An,{icon:Mr,color:"text-blue-500",text:"Optional dApp sponsorship, zero-cost transactions"}),R(An,{icon:Dr,color:"text-purple-500",text:"Secure recovery mechanism, no fear of losing keys"})]}),r&&H(l,{className:"mt-4 w-full",onClick:r,children:["Upgrade Now",n!==void 0&&H("span",{className:"ml-1 text-xs opacity-80",children:["(Estimated gas fee: ",Il(n),")"]})]}),a&&H(Wl,{children:[H("div",{className:"mt-4 mb-3 flex items-center gap-2",children:[R("div",{className:"h-px flex-1 bg-border"}),R("span",{className:"text-xs text-muted-foreground",children:"or"}),R("div",{className:"h-px flex-1 bg-border"})]}),d]})]})}function An({icon:t,color:e,text:n}){return H("div",{className:"flex items-center gap-2.5 text-sm text-foreground/80",children:[R(t,{size:14,className:`shrink-0 ${e}`}),R("span",{children:n})]})}import{useState as En,useCallback as zr}from"react";import{ArrowLeft as Ir,Save as Vl,Shield as Lr,Users as Wr,KeyRound as Vr,Fuel as Ul,Wrench as Hl,Plus as Ol,X as _l}from"lucide-react";import{jsx as C,jsxs as z}from"react/jsx-runtime";var Fl=[{value:"simple",label:"Single Sign (default)",description:"Single key control, simple and secure",icon:C(Lr,{size:16})},{value:"multi-sig",label:"Multi-Sign (2-of-3)",description:"Requires multiple signers to authorize transactions",icon:C(Wr,{size:16})},{value:"social-recovery",label:"Social Recovery",description:"Set guardian accounts to help recover",icon:C(Vr,{size:16})}],Kl=[{value:"self",label:"Pay Self (ETH)",description:"Pay gas fees with ETH"},{value:"sponsor",label:"Sponsored by dApp",description:"dApp covers your gas fees"},{value:"erc20",label:"Pay with USDC/USDT",description:"Use ERC-20 tokens for gas"},{value:"custom",label:"Custom Paymaster URL",description:"Use a custom paymaster service"}],ql=[{value:"pimlico",label:"Pimlico",description:"High-performance bundler service"},{value:"stackup",label:"Stackup",description:"Decentralized bundler network"},{value:"alchemy",label:"Alchemy",description:"Alchemy AA infrastructure"},{value:"custom",label:"Custom Bundler URL",description:"Use custom bundler endpoint"}];function jl(){return{accountType:"simple",paymasterType:"self",customPaymasterUrl:"",bundlerPreset:"pimlico",customBundlerUrl:"",guardians:[],threshold:2}}function Ql({currentConfig:t,onSave:e,onBack:n}){let o=S(),r=o.Button??M,a=o.Input??On,i=o.Card??me,s=o.Separator??_n,[l,c]=En({...jl(),...t}),[u,d]=En(""),[f,h]=En(!1),g=p=>y("flex cursor-pointer items-center gap-3 rounded-lg border px-4 py-3 transition-all duration-200",p?"border-primary bg-primary/5":"border-border hover:bg-accent"),m="w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground outline-none focus:border-ring focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-all duration-200",b=zr(()=>{e?.(l),h(!0),setTimeout(()=>h(!1),2e3)},[l,e]),T=zr(()=>{let p=u.trim();!p||l.guardians.includes(p)||(c(x=>({...x,guardians:[...x.guardians,p]})),d(""))},[u,l.guardians]);return z(i,{className:"w-full rounded-xl border border-border bg-card p-5 shadow-sm",children:[C("div",{className:"flex items-center justify-between mb-5",children:z("div",{className:"flex items-center gap-2",children:[n&&z(r,{variant:"ghost",size:"sm",onClick:n,children:[C(Ir,{size:15}),"Back"]}),C("h2",{className:"text-lg font-semibold text-foreground",children:"Smart Wallet Settings"})]})}),z("section",{className:"mb-6",children:[z("h3",{className:"mb-3 flex items-center gap-1.5 text-sm font-semibold text-foreground",children:[C(Lr,{size:15})," Verification Method"]}),C("div",{className:"space-y-2",children:Fl.map(p=>z("label",{className:g(l.accountType===p.value),children:[C("input",{type:"radio",name:"accountType",value:p.value,checked:l.accountType===p.value,onChange:()=>c(x=>({...x,accountType:p.value})),className:"h-4 w-4 text-primary accent-primary"}),C("div",{className:"flex items-center gap-2 text-foreground",children:p.icon}),z("div",{children:[C("div",{className:"text-sm font-medium text-foreground",children:p.label}),C("div",{className:"text-xs text-muted-foreground",children:p.description})]})]},p.value))})]}),l.accountType==="social-recovery"&&z("section",{className:"mb-6 rounded-lg border border-border bg-muted/30 p-4",children:[z("h4",{className:"mb-2 flex items-center gap-1.5 text-sm font-semibold text-foreground",children:[C(Vr,{size:14})," Guardian Addresses"]}),C("p",{className:"mb-3 text-xs text-muted-foreground",children:"Set at least one guardian to help recover your wallet if you lose your key"}),l.guardians.length>0&&C("div",{className:"mb-3 space-y-1.5",children:l.guardians.map(p=>z("div",{className:"flex items-center justify-between rounded-md bg-card px-3 py-2 text-sm",children:[z("span",{className:"font-mono text-xs text-foreground",children:[p.slice(0,8),"...",p.slice(-6)]}),C(r,{variant:"ghost",size:"icon",onClick:()=>c(x=>({...x,guardians:x.guardians.filter(B=>B!==p)})),children:C(_l,{size:14})})]},p))}),z("div",{className:"flex gap-2",children:[C(a,{type:"text",placeholder:"Enter guardian address (0x...)",value:u,onChange:p=>d(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),T())},className:"flex-1"}),z(r,{size:"sm",onClick:T,disabled:!u.trim(),children:[C(Ol,{size:14})," Add"]})]})]}),l.accountType==="multi-sig"&&z("section",{className:"mb-6 rounded-lg border border-border bg-muted/30 p-4",children:[z("h4",{className:"mb-2 flex items-center gap-1.5 text-sm font-semibold text-foreground",children:[C(Wr,{size:14})," Signing Threshold"]}),C("p",{className:"mb-3 text-xs text-muted-foreground",children:"Set how many signers are needed to authorize a transaction"}),C("div",{className:"flex items-center gap-3",children:[1,2,3].map(p=>z("label",{className:g(l.threshold===p),children:[C("input",{type:"radio",name:"threshold",value:p,checked:l.threshold===p,onChange:()=>c(x=>({...x,threshold:p})),className:"sr-only"}),p,"-of-3"]},p))})]}),C(s,{className:"my-4"}),z("section",{className:"mb-6",children:[z("h3",{className:"mb-3 flex items-center gap-1.5 text-sm font-semibold text-foreground",children:[C(Ul,{size:15})," Gas Fees"]}),C("div",{className:"space-y-2",children:Kl.map(p=>z("label",{className:g(l.paymasterType===p.value),children:[C("input",{type:"radio",name:"paymasterType",value:p.value,checked:l.paymasterType===p.value,onChange:()=>c(x=>({...x,paymasterType:p.value})),className:"h-4 w-4 text-primary accent-primary"}),z("div",{className:"flex-1",children:[C("div",{className:"text-sm font-medium text-foreground",children:p.label}),C("div",{className:"text-xs text-muted-foreground",children:p.description})]})]},p.value))}),l.paymasterType==="custom"&&C("div",{className:"mt-3",children:C("input",{type:"text",placeholder:"Custom Paymaster URL",value:l.customPaymasterUrl,onChange:p=>c(x=>({...x,customPaymasterUrl:p.target.value})),className:m})})]}),C(s,{className:"my-4"}),z("section",{className:"mb-6",children:[z("h3",{className:"mb-3 flex items-center gap-1.5 text-sm font-semibold text-foreground",children:[C(Hl,{size:15})," Bundler"]}),C("div",{className:"space-y-2",children:ql.map(p=>z("label",{className:g(l.bundlerPreset===p.value),children:[C("input",{type:"radio",name:"bundlerPreset",value:p.value,checked:l.bundlerPreset===p.value,onChange:()=>c(x=>({...x,bundlerPreset:p.value})),className:"h-4 w-4 text-primary accent-primary"}),z("div",{className:"flex-1",children:[C("div",{className:"text-sm font-medium text-foreground",children:p.label}),C("div",{className:"text-xs text-muted-foreground",children:p.description})]})]},p.value))}),l.bundlerPreset==="custom"&&C("div",{className:"mt-3",children:C("input",{type:"text",placeholder:"Custom Bundler URL",value:l.customBundlerUrl,onChange:p=>c(x=>({...x,customBundlerUrl:p.target.value})),className:m})})]}),z("div",{className:"flex items-center gap-3",children:[z(r,{className:"flex-1",onClick:b,children:[C(Vl,{size:15}),f?"Saved \u2713":"Save Settings"]}),n&&z(r,{variant:"outline",onClick:n,children:[C(Ir,{size:15}),"\u2190 Back to Simple Mode"]})]})]})}import{AlertTriangle as $l,CheckCircle as Gl,ShieldAlert as Yl,X as Jl}from"lucide-react";import{useValidateDestination as Xl}from"@naculus/connect-appkit-react";import{jsx as $,jsxs as Re}from"react/jsx-runtime";var Zl={ok:{icon:$(Gl,{size:20}),label:"No problem found",colorClass:"text-muted-foreground",bgClass:"bg-muted",buttonVariant:"default"},warning:{icon:$($l,{size:20}),label:"Warning",colorClass:"text-[hsl(var(--warning,38_92%_50%))]",bgClass:"bg-[hsl(var(--warning)/0.1)]",buttonVariant:"default"},blocked:{icon:$(Yl,{size:20}),label:"Blocked",colorClass:"text-destructive",bgClass:"bg-destructive/10",buttonVariant:"destructive"}};function ec({address:t,open:e,onClose:n,onProceed:o}){let r=S(),a=r.Button,i=r.Dialog,s=r.DialogContent,l=r.DialogHeader,c=r.DialogTitle,{validation:u}=Xl({address:t}),{level:d,warning:f}=u,h=Zl[d],g=d==="blocked",m=t.length>12?`${t.slice(0,6)}...${t.slice(-4)}`:t,b=p=>y("inline-flex items-center justify-center whitespace-nowrap rounded-lg","text-sm font-medium transition-all duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","h-10 px-4 py-2",p==="outline"&&"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",p==="destructive"&&"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm",p==="default"&&"bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm"),T=Re("div",{className:"flex flex-col gap-4",children:[Re("div",{className:y("flex items-center gap-3 rounded-lg p-4",h.bgClass),children:[$("span",{className:h.colorClass,children:h.icon}),Re("div",{className:"flex flex-col gap-0.5",children:[$("span",{className:y("text-sm font-semibold",h.colorClass),children:h.label}),$("span",{className:"text-xs text-muted-foreground break-all font-mono",children:m})]})]}),f&&$("p",{className:"text-sm text-muted-foreground m-0",children:f}),Re("div",{"data-dialog-actions":!0,className:"sticky bottom-0 z-10 -mx-1 flex min-h-14 justify-end gap-2 border-t border-border bg-card px-1 pb-[max(0rem,env(safe-area-inset-bottom))] pt-3",children:[a?$(a,{onClick:n,variant:"outline",className:"w-full sm:w-auto",children:"Cancel"}):$("button",{type:"button",onClick:n,className:y(b("outline"),"w-full sm:w-auto"),children:"Cancel"}),o&&(a?$(a,{onClick:o,variant:g?"destructive":"default",disabled:g,className:"w-full sm:w-auto",children:"Proceed anyway"}):$("button",{type:"button",onClick:o,disabled:g,className:y(b(g?"destructive":"default"),"w-full sm:w-auto"),children:"Proceed anyway"}))]})]});return i&&s&&l&&c?$(i,{open:e,onOpenChange:p=>{p||n()},children:Re(s,{className:"naculus-dialog-surface flex w-full max-w-lg flex-col overflow-y-auto",children:[$(l,{children:$(c,{children:"Address Warning"})}),T]})}):e?Re("div",{className:"naculus-dialog-viewport fixed inset-0 z-50 flex items-center justify-center p-4",children:[$("div",{className:"absolute inset-0 bg-black/80","aria-hidden":"true",onClick:n}),Re("div",{role:"dialog","aria-modal":"true","aria-label":"Address warning",className:"naculus-dialog-surface relative z-10 flex w-full max-w-lg flex-col overflow-y-auto rounded-xl border bg-card p-6 text-card-foreground shadow-2xl",children:[Re("div",{className:"sticky top-0 z-10 -mx-1 mb-4 flex items-center justify-between bg-card px-1 py-1",children:[$("h2",{className:"text-lg font-semibold m-0",children:"Address Warning"}),$("button",{onClick:n,type:"button",className:"rounded-md p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":"Close",children:$(Jl,{size:16})})]}),T]})]}):null}import{Wallet as Ur,AlertCircle as tc}from"lucide-react";import{jsx as te,jsxs as ze}from"react/jsx-runtime";function nc({wallets:t,onSelect:e,loading:n=!1,error:o=null}){let a=S().Card,i=s=>a?te(a,{className:"p-4",children:s}):te("div",{className:"rounded-xl border bg-card text-card-foreground shadow-sm p-4",children:s});return n?i(ze("div",{className:"flex flex-col gap-3",children:[Array.from({length:3}).map((s,l)=>ze("div",{className:"flex items-center gap-3 p-3 rounded-lg animate-pulse",children:[te("div",{className:"h-10 w-10 rounded-full bg-muted"}),te("div",{className:"h-4 w-32 rounded bg-muted"})]},l)),te("p",{className:"text-xs text-muted-foreground text-center m-0",children:"Detecting wallets..."})]})):o?i(ze("div",{className:"flex flex-col items-center gap-3 py-4",children:[te(tc,{size:24,className:"text-destructive"}),te("p",{className:"text-sm text-destructive m-0 font-medium",children:o})]})):t.length===0?i(ze("div",{className:"flex flex-col items-center gap-3 py-6",children:[te(Ur,{size:32,className:"text-muted-foreground"}),ze("p",{className:"text-sm text-muted-foreground m-0 text-center",children:["No wallets detected.",te("br",{}),"Install a browser wallet extension to get started."]})]})):te("div",{className:"flex flex-col gap-2",children:t.map(s=>ze("button",{type:"button",onClick:()=>e(s),className:y("flex items-center gap-3 w-full p-3 rounded-lg","border border-input bg-card hover:bg-accent hover:text-accent-foreground","transition-all duration-200 cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[s.icon?te("img",{src:s.icon,alt:s.name,className:"h-10 w-10 rounded-full object-cover shrink-0",onError:l=>{l.target.style.display="none"}}):te("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center shrink-0",children:te(Ur,{size:18,className:"text-muted-foreground"})}),ze("div",{className:"flex flex-col items-start gap-0.5 text-left min-w-0",children:[te("span",{className:"text-sm font-medium truncate w-full",children:s.name}),te("span",{className:"text-xs text-muted-foreground truncate w-full",children:s.rdns})]})]},s.id))})}import{describeAuthorization as cc}from"@naculus/connect-appkit-core";import{AlertTriangle as dc,ShieldCheck as uc,ShieldX as mc}from"lucide-react";import{formatAuthorizationAmount as oc}from"@naculus/connect-appkit-core";import{Check as rc,Copy as ac}from"lucide-react";import{useState as sc}from"react";import{jsx as Dt,jsxs as lc}from"react/jsx-runtime";function ic(t){return t.length<=18?t:`${t.slice(0,8)}\u2026${t.slice(-8)}`}function Ie({value:t}){let n=S().Button??M,[o,r]=sc(!1),a=async()=>{await navigator.clipboard?.writeText(t),r(!0)};return lc("span",{className:"flex min-w-0 items-center gap-1.5",children:[Dt("span",{className:"min-w-0 break-all font-mono text-xs",title:t,children:ic(t)}),Dt(n,{variant:"ghost",size:"icon",className:"naculus-hit-target h-8 w-8 shrink-0 p-0","aria-label":o?`Copied ${t}`:`Copy ${t}`,onClick:()=>{a()},children:o?Dt(rc,{"aria-hidden":!0,size:14}):Dt(ac,{"aria-hidden":!0,size:14})})]})}function Hr(t,e,n){if(t===null)return"Amount not reported";let o=e?n[e]:void 0;return/^\d+$/.test(String(t))?oc(BigInt(t),o).formatted:`${t.toString()} base units`}function Mt(t,e=!1){return y("border",t?"border-emerald-700 bg-emerald-50 text-emerald-900 dark:border-emerald-500 dark:bg-emerald-950 dark:text-emerald-100":e?"border-destructive/60 bg-destructive/10 text-foreground":"border-border bg-muted text-foreground")}import{jsx as W,jsxs as K}from"react/jsx-runtime";function pc(t){return"expiry"in t}function fc({authorization:t,assets:e={},locale:n,now:o,requester:r,preview:a,onApprove:i,onDecline:s,busy:l=!1,className:c}){let u=pc(t)?t:cc(t,{assets:e,locale:n,now:o}),d=S(),f=d.Button??M,h=d.Card??me;return K("section",{"aria-labelledby":"authorization-consent-title",className:y("naculus-payment-surface naculus-authorization-consent mx-auto flex w-full max-w-lg flex-col gap-4 overflow-y-auto text-foreground",c),onKeyDown:g=>{g.key==="Escape"&&s()},children:[K("header",{className:"naculus-consent-requester flex min-w-0 items-center gap-3",children:[r.icon?W("img",{className:"h-11 w-11 shrink-0 rounded-xl object-cover",src:r.icon,alt:""}):W("span",{"aria-hidden":!0,className:"grid h-11 w-11 shrink-0 place-items-center rounded-xl bg-muted text-lg font-semibold",children:r.name.slice(0,1).toUpperCase()}),K("div",{className:"min-w-0",children:[K("h2",{id:"authorization-consent-title",className:"truncate text-lg font-semibold",children:["Allow ",r.name," to pay?"]}),r.origin&&W("p",{className:"break-all text-xs text-muted-foreground",children:r.origin})]})]}),u.warnings.map(g=>K("div",{role:"alert",className:"naculus-consent-summary flex gap-2 rounded-lg border border-amber-700 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-500 dark:bg-amber-950 dark:text-amber-100",children:[W(dc,{"aria-hidden":!0,className:"mt-0.5 shrink-0",size:18}),W("strong",{children:g})]},g)),a&&K("div",{className:y("naculus-consent-summary flex gap-2 rounded-lg p-3 text-sm",Mt(a.allowed,!a.allowed)),children:[a.allowed?W(uc,{"aria-hidden":!0,size:18}):W(mc,{"aria-hidden":!0,size:18}),K("p",{children:[K("strong",{children:[a.allowed?"Allowed":"Blocked","."]})," ",a.sentence]})]}),W("div",{className:"naculus-consent-grants flex flex-col gap-3",children:u.grants.map(g=>K(h,{className:"min-w-0 p-4",children:[W("h3",{className:"break-all text-sm font-semibold",children:g.assetLabel}),K("div",{className:"mt-3 grid grid-cols-2 gap-3",children:[K("div",{children:[W("p",{className:"text-xs text-muted-foreground",children:"Per payment"}),W("p",{className:"break-words text-xl font-semibold tabular-nums",children:g.perPayment.formatted})]}),K("div",{children:[W("p",{className:"text-xs text-muted-foreground",children:"Total limit"}),W("p",{className:"break-words text-xl font-semibold tabular-nums",children:g.total.formatted})]})]}),K("dl",{className:"mt-4 grid gap-3 text-sm",children:[K("div",{children:[W("dt",{className:"font-medium",children:"Recipients"}),W("dd",{className:"mt-1 flex flex-col gap-1",children:g.recipients.length?g.recipients.map(m=>W(Ie,{value:m.full},m.full)):W("span",{className:"font-semibold text-destructive",children:"No recipient restriction is displayed"})})]}),K("div",{children:[W("dt",{className:"font-medium",children:"Payment count"}),W("dd",{className:"text-muted-foreground",children:g.count===null?"No count limit":`Up to ${g.count}`})]}),K("div",{children:[W("dt",{className:"font-medium",children:"Payment methods"}),W("dd",{className:"mt-1 flex flex-wrap gap-1.5",children:g.rails.map(m=>W("span",{className:"rounded-full border border-border bg-muted px-2 py-1 text-xs",children:m},m))})]})]})]},`${g.asset}:${g.recipients.map(m=>m.full).join(",")}:${g.perPayment.formatted}:${g.total.formatted}`))}),K("div",{className:"naculus-consent-expiry rounded-lg bg-muted p-3 text-sm",children:[K("p",{className:"font-medium",children:["Expires ",u.expiry.relative]}),W("time",{className:"text-xs text-muted-foreground",dateTime:new Date(u.expiry.timestamp*1e3).toISOString(),children:u.expiry.absolute})]}),K("div",{"data-payment-actions":!0,className:"naculus-sticky-actions sticky bottom-0 z-10 -mx-1 grid min-h-14 grid-cols-2 gap-3 border-t border-border bg-background px-1 pb-[max(0rem,env(safe-area-inset-bottom))] pt-3",children:[W(f,{variant:"outline",onClick:s,children:"Decline"}),W(f,{disabled:l,"aria-busy":l,onClick:i,children:l?"Approving\u2026":"Approve"})]})]})}import{describeAuthorization as gc,formatAuthorizationAmount as hc}from"@naculus/connect-appkit-core";import{AlertTriangle as bc,Ban as yc}from"lucide-react";import{useState as Or}from"react";import{Fragment as vc,jsx as q,jsxs as ie}from"react/jsx-runtime";function xc({entries:t,assets:e={},onRevoke:n,revokingId:o,locale:r,className:a}){let i=Array.isArray(t)?t:t.entries,[s,l]=Or(null),[c,u]=Or(new Set),d=S(),f=d.Button??M,h=d.Card??me,g=d.Badge??We;return i.length===0?ie("section",{className:y("rounded-xl border border-dashed border-border p-8 text-center",a),children:[q(yc,{"aria-hidden":!0,className:"mx-auto mb-2 text-muted-foreground"}),q("h2",{className:"font-semibold",children:"No payment authorizations"}),q("p",{className:"mt-1 text-sm text-muted-foreground",children:"Approvals you create will appear here."})]}):ie("section",{"aria-labelledby":"authorization-list-title",className:y("naculus-payment-surface flex w-full max-w-lg flex-col gap-3",a),children:[q("h2",{id:"authorization-list-title",className:"text-lg font-semibold",children:"Payment authorizations"}),i.map(m=>{let b=gc(m,{assets:e,locale:r}),T=o===m.keyId;return ie(h,{className:"flex min-h-full min-w-0 flex-col overflow-y-auto p-4",children:[ie("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[ie("div",{className:"min-w-0",children:[q("h3",{className:"break-all font-semibold",children:b.label??b.grants.map(p=>p.assetLabel).join(", ")}),q("p",{className:"text-xs text-muted-foreground",children:{"evm-session":"EVM session key","solana-session":"Solana session key","mpp-voucher":"MPP channel key"}[m.enforcer]??m.enforcer.replaceAll("-"," ")})]}),q(g,{className:y("capitalize",m.status==="active"&&"bg-primary text-primary-foreground",m.status==="pending"&&"border border-border bg-background",(m.status==="revoked"||m.status==="expired")&&"bg-muted text-muted-foreground"),children:m.status})]}),q("div",{className:"mt-3 flex flex-col gap-3",children:b.grants.map(p=>{let x=m.spent?.[p.asset],B=m.grants.find(V=>V.asset===p.asset)?.maxTotal,w=x!==void 0&&B&&B>0n?Number(x*100n/B):null;return ie("div",{className:"min-w-0 rounded-lg bg-muted p-3",children:[b.label&&q("p",{className:"break-all text-sm font-medium",children:p.assetLabel}),q("div",{className:"mt-1 flex flex-col gap-1",children:p.recipients.map(V=>q(Ie,{value:V.full},V.full))}),x!==void 0&&ie("div",{className:"mt-3",children:[ie("div",{className:"flex justify-between gap-2 text-xs",children:[ie("span",{children:["Spent"," ",hc(x,e[p.asset]).formatted]}),ie("span",{children:["Total ",p.total.formatted]})]}),q("div",{role:"progressbar","aria-label":`${p.assetLabel} spent`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(w??0,100),className:"mt-1 h-2 overflow-hidden rounded-full bg-background",children:q("span",{className:"block h-full bg-primary",style:{width:`${Math.min(w??0,100)}%`}})})]})]},p.asset)})}),ie("p",{className:"mt-3 text-xs text-muted-foreground",title:new Date(b.expiry.timestamp*1e3).toISOString(),children:[m.status==="expired"?"Expired":m.status==="revoked"?"Revoked":`Expires ${b.expiry.relative}`," \xB7 ",b.expiry.absolute]}),b.warnings.map(p=>ie("p",{role:"alert",className:"mt-2 flex gap-2 rounded-md border border-amber-700 bg-amber-50 p-2 text-sm text-amber-950 dark:border-amber-500 dark:bg-amber-950 dark:text-amber-100",children:[q(bc,{"aria-hidden":!0,className:"shrink-0",size:16}),p]},p)),c.has(m.keyId)&&q("p",{role:"status",className:"mt-2 rounded-md border border-amber-700 p-2 text-sm font-medium",children:"Local access is revoked. Complete the on-chain revocation to stop this authorization on chain."}),m.status==="active"||m.status==="pending"?q("div",{"data-payment-actions":!0,className:"naculus-sticky-actions sticky bottom-0 z-10 -mx-1 mt-3 flex min-h-14 justify-end gap-2 border-t border-border bg-card px-1 pb-[max(0rem,env(safe-area-inset-bottom))] pt-3",children:s===m.keyId?ie(vc,{children:[q(f,{variant:"ghost",onClick:()=>l(null),children:"Cancel"}),q(f,{className:"min-w-32",disabled:T,"aria-busy":T,onClick:()=>{Promise.resolve(n(m)).then(p=>{l(null),p.onChainRevocationRequired&&u(x=>new Set(x).add(m.keyId))})},children:T?"Revoking\u2026":"Confirm revoke"})]}):q(f,{variant:"outline",onClick:()=>l(m.keyId),children:"Revoke"})}):null]},m.keyId)})]})}import{AlertCircle as Cc,CheckCircle2 as Nc,ExternalLink as wc,LoaderCircle as kc,ShieldQuestion as Rc}from"lucide-react";import{jsx as G,jsxs as le}from"react/jsx-runtime";var _r={unverified:["Unverified","Reported by the server, not yet checked."],pending:["Checking","Checking on chain."],verified:["Verified","Verified on chain."],mismatch:["Mismatch","The on-chain settlement does not match this payment."],failed:["Verification failed","The settlement could not be verified."],unavailable:["Verification unavailable","On-chain checking is unavailable. Retry later."]};function Sc({record:t,assets:e={},explorerUrl:n,className:o}){let r=S(),a=r.Card??me,i=r.Badge??We,s=t.verification.status,l=s==="verified",c=s==="mismatch"||s==="failed",u=l?Nc:s==="pending"?kc:c?Cc:Rc,d=n?.(t);return le(a,{"data-verification":s,className:y("naculus-payment-surface mx-auto flex h-full w-full max-w-lg min-w-0 flex-col overflow-hidden p-5",o),children:[le("header",{className:"text-center",children:[G("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Payment receipt"}),G("h2",{className:"mt-2 break-words text-3xl font-semibold tabular-nums",children:Hr(t.amount,t.asset,e)}),G("p",{className:"mt-1 break-all text-sm text-muted-foreground",children:t.asset?e[t.asset]?.symbol??t.asset:"Asset not reported"})]}),le("div",{"aria-live":"polite",className:y("mt-5 flex min-h-[9rem] gap-2 rounded-lg p-3",Mt(l,c)),children:[G(u,{"aria-hidden":!0,className:y("mt-0.5 shrink-0",s==="pending"&&"animate-spin"),size:18}),le("div",{children:[G(i,{className:"mb-1",children:_r[s][0]}),G("p",{className:"text-sm",children:_r[s][1]}),t.verification.reason&&le("p",{className:"mt-1 break-words text-sm font-medium",children:["Reason: ",t.verification.reason]})]})]}),le("dl",{className:"mt-5 grid gap-4 text-sm",children:[le("div",{children:[G("dt",{className:"text-xs text-muted-foreground",children:"Recipient"}),G("dd",{children:t.payTo?G(Ie,{value:t.payTo}):"Not reported"})]}),le("div",{className:"grid grid-cols-2 gap-3",children:[le("div",{children:[G("dt",{className:"text-xs text-muted-foreground",children:"Protocol"}),G("dd",{children:t.protocol==="mpp"?"MPP":t.protocol})]}),le("div",{children:[G("dt",{className:"text-xs text-muted-foreground",children:"Time"}),G("dd",{children:"Not recorded"})]})]}),le("div",{children:[G("dt",{className:"text-xs text-muted-foreground",children:"Settlement reference"}),G("dd",{className:"mt-1",children:t.reference?le("div",{className:"flex flex-wrap items-center gap-2",children:[G(Ie,{value:t.reference}),d&&le("a",{className:"naculus-hit-target relative inline-flex items-center gap-1 rounded text-xs font-medium underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",href:d,target:"_blank",rel:"noreferrer",children:["View on explorer ",G(wc,{"aria-hidden":!0,size:13})]})]}):"Not reported"})]})]})]})}export{_t as AccountButton,Bi as AccountSelector,cr as AccountSelectorView,ec as AddressWarningDialog,kr as AppKit,Rr as AppKitButton,Sr as AppKitChainSelector,fc as AuthorizationConsent,xc as AuthorizationList,je as ChainSelector,Se as ConnectButton,dt as ErrorBoundary,Xi as PasskeySetup,br as PasskeySetupView,ji as PassphraseDialog,pr as PassphraseDialogView,Sc as PaymentReceipt,lt as QRCodeModal,kl as RouteSelector,ct as SeedPhraseBackup,bn as SignInButton,Ql as SmartWalletSettings,Ll as SmartWalletToggle,Nn as ThemeProvider,Vt as WalletConnectProvider,nc as WalletPicker,Li as WalletSecurityPanel,mr as WalletSecurityPanelView,wn as Web3ComponentProvider,mt as Web3ConnectUI,y as cn,wr as useAppKit,mi as useComponent,S as useComponentRegistry,li as useDetectionMode,Je as useEIP6963,Xe as useIsMobile,rr as useTheme,ti as useThemeVariable,ua as useWalletConnect,Ut as useWalletConnectOptional};
|
|
12
12
|
//# sourceMappingURL=index.js.map
|